-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add deployImplementations to ForkLive flow #13573
base: opcm-up/dont-read-addrs-from-disk
Are you sure you want to change the base?
Add deployImplementations to ForkLive flow #13573
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
462d3ab
to
8e643a4
Compare
157879e
to
f3b007b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## opcm-up/dont-read-addrs-from-disk #13573 +/- ##
======================================================================
+ Coverage 45.89% 90.83% +44.94%
======================================================================
Files 893 109 -784
Lines 74874 4595 -70279
Branches 768 768
======================================================================
- Hits 34360 4174 -30186
+ Misses 37820 334 -37486
+ Partials 2694 87 -2607
Flags with carried forward coverage won't be shown. Click here to find out more. |
cbc6606
to
050944f
Compare
c023b16
to
7d1a662
Compare
050944f
to
3e7d2cd
Compare
7d1a662
to
d6e9629
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the PR description to say why we need this feature? From the description I understand the what, but not the why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this:
This is necessary because the ForkLive script currently only loads the pre-existing contracts from the production network. So we are now deploying the current implementation contracts so that the Proxies can be upgraded to them.
/// @notice Etches a new Deploy.s.sol contract at a deterministic address, sets up the environment, | ||
/// and deploys new implementations with a "_NextVersion" suffix. This suffix is necessary to avoid | ||
/// naming collisions with the implementations saved above. | ||
function _deployNewImplementations() internal { | ||
Deploy deployNew = Deploy(address(uint160(uint256(keccak256(abi.encode("optimism.deploy.new")))))); | ||
vm.etch(address(deployNew), vm.getDeployedCode("Deploy.s.sol:Deploy")); | ||
vm.label(address(deployNew), "DeployNew"); | ||
vm.allowCheatcodes(address(deployNew)); | ||
vm.setEnv("CONTRACT_ADDRESSES_PATH", string.concat(vm.projectRoot(), "/deployments/1-deploy.json")); | ||
|
||
deployNew.setUp(); | ||
deployNew.deployImplementations({ _isInterop: false, _suffix: "_NextVersion" }); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we also talked about an approach where deployImplementations
is create2 based, so we could have it do something like this:
- compute address for deploying a contract
- check if there's code there
- if code, contract is unchanged, skip deploy
- if no code, contract changed, execute deploy
Is my interpretation correct that this PR is an alternative solution to that one? The create2 based one feels cleaner and simpler to me though. Here we are further enshrining the save
functionality by relying on it and I thought we wanted to move away from that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow.
A move towards create2
would have to happen in the DeployImplementations.s.sol
script which deployImplementations
just wraps.
While I agree that we should move away from save()
if possible, I'm a bit afraid to open up that can of worms at this moment, as its very deeply integrated with the deploy scripts so it's hard to assess the effort required. In my mind it would require ForkLive.run() and Deploy.run() to both return very large structs similar (but not identical) to DeployOpChain Output, so that those values can be used in CommonTest
.
13c469f
to
3a4e011
Compare
d6e9629
to
a2803aa
Compare
16d54d6
to
2013c01
Compare
a30d375
to
c02e6b2
Compare
2013c01
to
22c3410
Compare
c02e6b2
to
c2f094a
Compare
22c3410
to
1362e01
Compare
TL;DR
Added support for deploying the
develop
versions of contract implementations alongside implementations from the forked network.This is necessary because the ForkLive script currently only loads the pre-existing contracts from the production network. So we are now deploying the current implementation contracts so that the Proxies can be upgraded to them.
What changed?
Deploy.deployImplementations
to:save("SystemConfigImpl_NextVersion")
).Deploy
on the forked network to deploy new implementations.