feat: add NUT Bundle generation#19248
feat: add NUT Bundle generation#192480xniha wants to merge 21 commits intoethereum-optimism:developfrom
Conversation
packages/contracts-bedrock/scripts/upgrade/GenerateNUTBundle.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/src/libraries/NetworkUpgradeTxns.sol
Outdated
Show resolved
Hide resolved
| /// @param fork The hardfork this bundle is for (e.g., Fork.JOVIAN, Fork.KRYPTON). | ||
| /// @param salt CREATE2 salt for deterministic address computation. | ||
| struct Input { | ||
| Fork fork; |
There was a problem hiding this comment.
I don't think that we should specify the fork here. Rather, the JSON output should just be used for whatever the next fork is, and that fork will be identified that time of canonicalization.
There was a problem hiding this comment.
The intention here is to make the script reusable to generate a bundle for different forks, and also make explicit the additional deployments/upgrades that are specific to a given fork.
e.g: deploy cd.
An alternative approach would be to include the additional deployments/upgrades, with comments explicitly stating that they are fork-specific.
There was a problem hiding this comment.
I removed the input arguments here: 1aed88f.
The only input left is l1ChainId that is needed for OptimismMintableERC721Factory constructor. We should consider upgrading it to use the Initializable pattern.
This will allow to satisfy the determinism property of the script.
There was a problem hiding this comment.
yes, I think we should upgrade it to use the Initializable pattern. It probably makes sense to do it in the PR since it's a small change, and will allow us to get it right from the start, what do you think @0xniha?
Also, we should update the 'safety invariants' in L2Genesis.s.sol, as I don't think we'll have invariant #2 anymore (and we stopped using the "new" keyword a long time ago.
There was a problem hiding this comment.
Agree! I’ll implement it in this PR, and if the diff turns out to be too large, I’ll split it into a separate one.
packages/contracts-bedrock/scripts/upgrade/GenerateNUTBundle.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/upgrade/GenerateNUTBundle.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/upgrade/GenerateNUTBundle.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/upgrade/GenerateNUTBundle.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/upgrade/GenerateNUTBundle.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/upgrade/GenerateNUTBundle.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/upgrade/GenerateNUTBundleUtils.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/test/scripts/GenerateNUTBundleUtils.t.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/test/scripts/GenerateNUTBundleUtils.t.sol
Outdated
Show resolved
Hide resolved
…idate utils into UpgradeUtils * refactor: remove fork, salt and cgt from bundle script input * refactor: comments and constants * refactor: consolidate nut bundle utilities into UpgradeUtils * fix: proxy admin get code * fix: remove unused import Fork
|
/ci authorize |
|
/ci authorize |
…721Factory initializable upgrade
|
/ci authorize |
packages/contracts-bedrock/scripts/upgrade/GenerateNUTBundle.s.sol
Outdated
Show resolved
Hide resolved
| // Phase 1: Pre-implementation deployments | ||
| // Add fork-specific deployment or upgrade txns that must occur prior to the implementation deployments | ||
| // phase. | ||
| _preImplementationDeployments(); |
There was a problem hiding this comment.
How do you think we should handle these transactions once the first fork has been executed? I would be open to keeping the logic simple, and just adding a TODO + Issue to come in here and remove the CD deployment afterwards.
There was a problem hiding this comment.
yes, I think adding a TODO + Issue would work!
|
/ci authorize |
Description
Adds infrastructure for generating Network Upgrade Transaction (NUT) bundles for L2 hardfork upgrades.
GenerateNUTBundle: Script that generates deterministic upgrade transaction bundles.GenerateNUTBundleUtils: Helper contract for constructing deployment and upgrade transactions.NetworkUpgradeTxns: Library for serializing/deserializing NUT artifacts to JSON with DepositTx-compatible metadataCloses 18834
Pending