-
Notifications
You must be signed in to change notification settings - Fork 3.9k
op-deployer: Start finalizing support for v2.0.0 #14557
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a2feb14
op-deployer: Start finalizing support for v2.0.0
mslipper a608fd1
remove stdvertoml
mslipper 049e0f7
remove another usage of stdvertoml
mslipper 18fb819
goimports
mslipper 1722e92
update to latest SR
mslipper acd4cdb
bump SR again
mslipper 84480d6
Add updated sepolia SV200 addresses
maurelian c2fe203
update v200 validator
mslipper 83af725
fix test
mslipper fa4b09c
Update op-deployer/book/src/reference-guide/releases.md
mslipper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Releases | ||
|
|
||
| ## Versioning | ||
|
|
||
| For all releases after `v0.0.11`, each minor version of OP Deployer will support the current governance-approved | ||
mslipper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| release of the smart contracts as well as the tip of the `develop` branch at the time the tag was created. If you | ||
| want to deploy an earlier version of the contracts (which may be dangerous!), you should use an earlier version of | ||
| OP Deployer. This setup allows our smart contract developers to make breaking changes on `develop`, while still | ||
| allowing new chains to be deployed and upgraded using production-ready smart contracts. | ||
|
|
||
| For example (note that these are just examples, check out the [releases][releases] page for the exact versions to use): | ||
|
|
||
| - `v0.1.x` : Supports deploying `develop` and `op-contracts/v2.0.0`. | ||
| - `v0.2.x`: Supports deploying `develop` and `op-contracts/v3.0.0`. | ||
|
|
||
| If you deploy from an HTTPS or file [locator](./artifacts-locators.md), the deployment behavior will match that of | ||
| the supported tag. For example, if you use `v0.1.x` then the deployment will work as if you were deploying | ||
| `op-contracts/v2.0.0`. Typically, errors like `unknown selector: <some hex>` imply that you're using the wrong | ||
| version of OP Deployer for your contract artifacts. If this happens, we recommend trying different versions until | ||
| you get one that works. Note that this workflow is **not recommended** for production chains. | ||
|
|
||
| [releases]: https://github.com/ethereum-optimism/optimism/releases | ||
|
|
||
| ## Adding Support for New Contract Versions | ||
|
|
||
| Adding support for a new contract version is a multi-step process. Here's a high-level overview. For the sake of | ||
| simplicity we will assume you are adding support for a new `rc` release. | ||
|
|
||
| ### Step 1: Add Support on `develop` | ||
|
|
||
| **This section is designed for people developing OP Deployer itself.** | ||
|
|
||
| First, you need to add support for the new contract version on the `develop` branch. This means ensuring that the | ||
| deployment pipeline supports whatever changes are required for the new version. Typically, this means passing in new | ||
| deployment variables, and responding to ABI changes in the Solidity scripts/OPCM. | ||
|
|
||
| ### Step 2: Add the Published Artifacts | ||
|
|
||
| Run the following from the root of the monorepo: | ||
|
|
||
| ```bash | ||
| cd packages/contracts-bedrock | ||
| just clean | ||
| just build | ||
| bash scripts/ops/calculate-checksum.sh | ||
| # copy the outputted checksum | ||
| cd ../../op-deployer | ||
| just calculate-artifacts-hash <checksum> | ||
| ``` | ||
|
|
||
| This will calculate the checksum of your artifacts as well as the hash of the artifacts tarball. OP Deployer uses | ||
| these values to download and verify tagged contract locators. | ||
|
|
||
| Now, update `standard/standard.go` with these values so that the new artifacts tarball can be downloaded: | ||
|
|
||
| ```go | ||
| // Add a new const for your release | ||
|
|
||
| const ContractsVXTag = "op-contracts/vX.Y.Z" | ||
|
|
||
| var taggedReleases = map[string]TaggedRelease{ | ||
| // Other releases... | ||
| ContractsVXTag: { | ||
| ArtifactsHash: common.HexToHash("<the artifacts hash>"), | ||
| ContentHash: common.HexToHash("<the checksum>"), | ||
| }, | ||
| } | ||
|
|
||
| // Update the L1/L2 versions accordingly | ||
| func IsSupportedL1Version(tag string) bool { | ||
| return tag == ContractsVXTag | ||
| } | ||
| ``` | ||
|
|
||
| ### Step 3: Update the SR With the New Release | ||
|
|
||
| Add the new RC to the [standard versions][std-vers] in the Superchain Registry. | ||
|
|
||
| [std-vers]: https://github.com/ethereum-optimism/superchain-registry/tree/main/validation/standard | ||
|
|
||
| ### Step 4: Update the `validation` Package | ||
|
|
||
| The SR is pulled into OP Deployer via the `validation` package. Update it by running the following command from the | ||
| root of the monorepo: | ||
|
|
||
| ```shell | ||
| go get -u github.com/ethereum-optimism/superchain-registry/validation@<SR commit SHA> | ||
| ``` | ||
|
|
||
| That should be it! | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # The Bootstrap Commands | ||
|
|
||
| Bootstrap commands are used to deploy global singletons and implementation contracts for use with future invocations | ||
| of `apply`. Most users won't need to use these commands, since `op-deployer apply` will automatically use | ||
| predeployed contracts if they are available. However, you may need to use bootstrap commands if you're deploying | ||
| chains to an L1 that isn't natively supported by `op-deployer`. | ||
|
|
||
| There are several bootstrap commands available, which you can view by running `op-deployer bootstrap --help`. We'll | ||
| focus on the most important ones below. | ||
|
|
||
| ## Implementations | ||
|
|
||
| You can bootstrap implementations by running a command like this: | ||
|
|
||
| ```shell | ||
| op-deployer bootstrap implementations \ | ||
| --artifacts-locator <locator> \ | ||
| --l1-contracts-release op-contracts/<your-release> \ | ||
| --l1-rpc-url <rpc url> \ | ||
| --mips-version <1 or 2, for MIPS32 or MIPS64> \ | ||
| --private-key <some private key> \ | ||
| --protocol-versions-proxy <protocol versions proxy address> \ | ||
| --superchain-config-proxy <superchain config proxy address> \ | ||
| --upgrade-controller <upgrade controller address> | ||
| ``` | ||
|
|
||
| This command will deploy implementations, blueprints, and the OPCM. Deployments are (for the most part) | ||
| deterministic, so contracts will only be deployed once per chain as long as the implementation and constructor args | ||
mslipper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| remain the same. This applies to the `op-deployer apply` pipeline - that is, if someone else ran `op-deployer | ||
| boostrap implementations` at some point on a given L1 chain, then the `apply` pipeline will re-use those | ||
| implementations. | ||
|
|
||
| The command will output a JSON like the one below: | ||
|
|
||
| ```json | ||
| { | ||
| "Opcm": "0x4eeb114aaf812e21285e5b076030110e7e18fed9", | ||
| "DelayedWETHImpl": "0x5e40b9231b86984b5150507046e354dbfbed3d9e", | ||
| "OptimismPortalImpl": "0x2d7e764a0d9919e16983a46595cfa81fc34fa7cd", | ||
| "PreimageOracleSingleton": "0x1fb8cdfc6831fc866ed9c51af8817da5c287add3", | ||
| "MipsSingleton": "0xf027f4a985560fb13324e943edf55ad6f1d15dc1", | ||
| "SystemConfigImpl": "0x760c48c62a85045a6b69f07f4a9f22868659cbcc", | ||
| "L1CrossDomainMessengerImpl": "0x3ea6084748ed1b2a9b5d4426181f1ad8c93f6231", | ||
| "L1ERC721BridgeImpl": "0x276d3730f219f7ec22274f7263180b8452b46d47", | ||
| "L1StandardBridgeImpl": "0x78972e88ab8bbb517a36caea23b931bab58ad3c6", | ||
| "OptimismMintableERC20FactoryImpl": "0x5493f4677a186f64805fe7317d6993ba4863988f", | ||
| "DisputeGameFactoryImpl": "0x4bba758f006ef09402ef31724203f316ab74e4a0", | ||
| "AnchorStateRegistryImpl": "0x7b465370bb7a333f99edd19599eb7fb1c2d3f8d2", | ||
| "SuperchainConfigImpl": "0x4da82a327773965b8d4d85fa3db8249b387458e7", | ||
| "ProtocolVersionsImpl": "0x37e15e4d6dffa9e5e320ee1ec036922e563cb76c" | ||
| } | ||
| ``` | ||
|
|
||
| **It is safe to call this command from a hot wallet.** None of the contracts deployed by this command are "ownable," | ||
| so the deployment address has no further control over the system. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.