diff --git a/go.mod b/go.mod index 4d839b84604e0..e1304a0328d95 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/crate-crypto/go-kzg-4844 v1.1.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 - github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250205201532-8ff62ada16e1 + github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250228185245-d4bb112dc979 github.com/ethereum/go-ethereum v1.15.1 github.com/fatih/color v1.18.0 github.com/fsnotify/fsnotify v1.8.0 diff --git a/go.sum b/go.sum index a6dd712478e2e..e1c0086e5ce8e 100644 --- a/go.sum +++ b/go.sum @@ -196,6 +196,12 @@ github.com/ethereum-optimism/op-geth v1.101500.2-rc.1 h1:CCQtyKKobjMbK9jYd676YbH github.com/ethereum-optimism/op-geth v1.101500.2-rc.1/go.mod h1:OMpyVMMy5zpAAHlR5s/aGbXRk+7cIKczUEIJj54APbY= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250205201532-8ff62ada16e1 h1:OqRYDcjiOx5QCLn5krpd3BK1CW+VfSZx7YIa6zY9ePE= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250205201532-8ff62ada16e1/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= +github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250226225001-eda352a0be39 h1:PKn3dL9W0FyGC/oynhP6T43P0Xm80W+woW53lRUp2nE= +github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250226225001-eda352a0be39/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= +github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250227173852-b4f7e4022c2e h1:CWdI4k9JxMvWLv6HjWuAFJuuEwMEEwKdW/mOVnrNBD8= +github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250227173852-b4f7e4022c2e/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= +github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250228185245-d4bb112dc979 h1:P37l7EFCz5KxE20+yPa3LWiH2Cg+xx6lQ4mOKYCZFPs= +github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250228185245-d4bb112dc979/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= diff --git a/op-chain-ops/interopgen/configs.go b/op-chain-ops/interopgen/configs.go index 948d9daa30533..c3113d240e10c 100644 --- a/op-chain-ops/interopgen/configs.go +++ b/op-chain-ops/interopgen/configs.go @@ -40,8 +40,6 @@ type OPCMImplementationsConfig struct { FaultProof SuperFaultProofConfig UseInterop bool // to deploy Interop implementation contracts, instead of the regular ones. - - StandardVersionsToml string // serialized string of superchain-registry 'standard-versions-mainnet.toml' file } type SuperchainConfig struct { diff --git a/op-chain-ops/interopgen/recipe.go b/op-chain-ops/interopgen/recipe.go index c17984044e912..e6ea3b6043bbd 100644 --- a/op-chain-ops/interopgen/recipe.go +++ b/op-chain-ops/interopgen/recipe.go @@ -4,8 +4,6 @@ import ( "fmt" "math/big" - "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/standard" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/params" @@ -79,8 +77,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error) DisputeGameFinalityDelaySeconds: big.NewInt(6), MipsVersion: big.NewInt(1), }, - UseInterop: true, - StandardVersionsToml: standard.VersionsMainnetData, + UseInterop: true, }, SuperchainL1DeployConfig: genesis.SuperchainL1DeployConfig{ RequiredProtocolVersion: params.OPStackSupport, diff --git a/op-deployer/book/src/SUMMARY.md b/op-deployer/book/src/SUMMARY.md index 0aa6807481835..862b2bba9cd81 100644 --- a/op-deployer/book/src/SUMMARY.md +++ b/op-deployer/book/src/SUMMARY.md @@ -8,6 +8,7 @@ - [Usage](user-guide/usage.md) - [init](user-guide/init.md) - [apply](user-guide/apply.md) + - [bootstrap](user-guide/bootstrap.md) - [Known Limitations](user-guide/known-limitations.md) # Reference Guide @@ -16,3 +17,4 @@ - [Deployment Pipeline](reference-guide/pipeline.md) - [Scripting Engine](reference-guide/engine.md) - [Artifacts Locators](reference-guide/artifacts-locators.md) +- [Releases](reference-guide/releases.md) diff --git a/op-deployer/book/src/reference-guide/artifacts-locators.md b/op-deployer/book/src/reference-guide/artifacts-locators.md index 729cdc8bba136..0f4af8805a2d7 100644 --- a/op-deployer/book/src/reference-guide/artifacts-locators.md +++ b/op-deployer/book/src/reference-guide/artifacts-locators.md @@ -14,19 +14,4 @@ Locators can be one of three types: cached on disk to avoid repeated downloads. - `https://` locators, which point to a tarball of contract artifacts somewhere on the web. HTTP locators are cached just like tagged locators are, but they are not validated against a checksum. -- `file://` locators, which point to a directory on disk containing the artifacts. - -## Version Hints - -OP Deployer supports multiple different contract versions at the same time. Sometimes, contracts at version X are -backwards-incompatible with version Y. OP Deployer will support both versions at the same time when this happens. -However, OP Deployer needs to know which versioning behavior to use with each locator. For `tag` locators this is -easy since the behavior is encoded in the tag itself. However, it's more complicated for `https` and `file` locators. - -To support multiple versions of each contract, OP Deployer supports specifying _version hints_ in the locator. These -hints are URL fragments (e.g., the part of the URL that comes after the `#` symbol) denoting how OP Deployer should -treat the artifacts at that URL. For example, the URL `https://example.com/artifacts.tar.gz#v1` would treat the -artifacts at the URL with the versioning behavior of version `v1`. - -This only applies to `https` and `file` locators. `tag` locators are versioned by the tag itself, and any hints will -be ignored. \ No newline at end of file +- `file://` locators, which point to a directory on disk containing the artifacts. \ No newline at end of file diff --git a/op-deployer/book/src/reference-guide/releases.md b/op-deployer/book/src/reference-guide/releases.md new file mode 100644 index 0000000000000..aefad5d89db63 --- /dev/null +++ b/op-deployer/book/src/reference-guide/releases.md @@ -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 +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: ` 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 +``` + +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(""), + ContentHash: common.HexToHash(""), + }, +} + +// 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@ +``` + +That should be it! \ No newline at end of file diff --git a/op-deployer/book/src/user-guide/bootstrap.md b/op-deployer/book/src/user-guide/bootstrap.md new file mode 100644 index 0000000000000..cf2450db28ce9 --- /dev/null +++ b/op-deployer/book/src/user-guide/bootstrap.md @@ -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 \ + --l1-contracts-release op-contracts/ \ + --l1-rpc-url \ + --mips-version <1 or 2, for MIPS32 or MIPS64> \ + --private-key \ + --protocol-versions-proxy \ + --superchain-config-proxy \ + --upgrade-controller +``` + +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 +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. \ No newline at end of file diff --git a/op-deployer/book/src/user-guide/known-limitations.md b/op-deployer/book/src/user-guide/known-limitations.md index aaf5aa3397487..c5574f39d70da 100644 --- a/op-deployer/book/src/user-guide/known-limitations.md +++ b/op-deployer/book/src/user-guide/known-limitations.md @@ -4,6 +4,8 @@ OP Deployer is subject to some known limitations which we're working on addressi ## Tagged Releases on New Chains +**Fixed in all versions after v0.0.11.** + It is not currently possible to deploy chains using tagged contract locators (i.e., those starting with `tag://`) anywhere except Sepolia and Ethereum mainnet. If you try to, you'll see an error like this: diff --git a/op-deployer/justfile b/op-deployer/justfile index fdf3b8e2c9694..8686b8ce194db 100644 --- a/op-deployer/justfile +++ b/op-deployer/justfile @@ -8,8 +8,3 @@ calculate-artifacts-hash checksum: just download-artifacts {{checksum}} /tmp/artifact.tgz sha256sum /tmp/artifact.tgz rm /tmp/artifact.tgz - -# Sync standard versions -sync-standard-version: - curl -Lo ./pkg/deployer/standard/standard-versions-mainnet.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions-mainnet.toml - curl -Lo ./pkg/deployer/standard/standard-versions-sepolia.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions-sepolia.toml \ No newline at end of file diff --git a/op-deployer/pkg/deployer/bootstrap/flags.go b/op-deployer/pkg/deployer/bootstrap/flags.go index f2476741052a7..ba29f6141163e 100644 --- a/op-deployer/pkg/deployer/bootstrap/flags.go +++ b/op-deployer/pkg/deployer/bootstrap/flags.go @@ -198,7 +198,6 @@ var Commands = []*cli.Command{ Usage: "Bootstraps implementations.", Flags: cliapp.ProtectFlags(ImplementationsFlags), Action: ImplementationsCLI, - Hidden: true, }, { Name: "proxy", diff --git a/op-deployer/pkg/deployer/bootstrap/implementations.go b/op-deployer/pkg/deployer/bootstrap/implementations.go index 30ee8498d0c01..9875ee6c0f3ad 100644 --- a/op-deployer/pkg/deployer/bootstrap/implementations.go +++ b/op-deployer/pkg/deployer/bootstrap/implementations.go @@ -134,6 +134,10 @@ func Implementations(ctx context.Context, cfg ImplementationsConfig) (opcm.Deplo lgr := cfg.Logger + if cfg.ArtifactsLocator.IsTag() && !standard.IsSupportedL1Version(cfg.ArtifactsLocator.Tag) { + return dio, fmt.Errorf("unsupported L1 version: %s", cfg.ArtifactsLocator.Tag) + } + artifactsFS, err := artifacts.Download(ctx, cfg.ArtifactsLocator, artifacts.BarProgressor(), cfg.CacheDir) if err != nil { return dio, fmt.Errorf("failed to download artifacts: %w", err) diff --git a/op-deployer/pkg/deployer/integration_test/apply_test.go b/op-deployer/pkg/deployer/integration_test/apply_test.go index 025b57f288eb5..83884e07bac73 100644 --- a/op-deployer/pkg/deployer/integration_test/apply_test.go +++ b/op-deployer/pkg/deployer/integration_test/apply_test.go @@ -128,8 +128,9 @@ func TestEndToEndApply(t *testing.T) { intent, st := newIntent(t, l1ChainID, dk, l2ChainID1, loc, loc) intent.L1ContractsLocator = artifacts.DefaultL1ContractsLocator intent.L2ContractsLocator = artifacts.DefaultL2ContractsLocator + cg := ethClientCodeGetter(ctx, l1Client) - require.ErrorIs(t, deployer.ApplyPipeline( + require.NoError(t, deployer.ApplyPipeline( ctx, deployer.ApplyPipelineOpts{ DeploymentTarget: deployer.DeploymentTargetLive, @@ -141,7 +142,10 @@ func TestEndToEndApply(t *testing.T) { StateWriter: pipeline.NoopStateWriter(), CacheDir: testCacheDir, }, - ), pipeline.ErrRefusingToDeployTaggedReleaseWithoutOPCM) + )) + + validateSuperchainDeployment(t, st, cg) + validateOPChainDeployment(t, cg, st, intent, false) }) t.Run("with calldata broadcasts", func(t *testing.T) { diff --git a/op-deployer/pkg/deployer/opcm/dispute_game.go b/op-deployer/pkg/deployer/opcm/dispute_game.go index 8ab20a8dea68b..862819b9294c8 100644 --- a/op-deployer/pkg/deployer/opcm/dispute_game.go +++ b/op-deployer/pkg/deployer/opcm/dispute_game.go @@ -8,7 +8,6 @@ import ( type DeployDisputeGameInput struct { Release string - StandardVersionsToml string VmAddress common.Address GameKind string GameType uint32 @@ -24,6 +23,10 @@ type DeployDisputeGameInput struct { Challenger common.Address } +func (input *DeployDisputeGameInput) StandardVersionsToml() string { + return "" +} + func (input *DeployDisputeGameInput) InputSet() bool { return true } diff --git a/op-deployer/pkg/deployer/opcm/dispute_game_test.go b/op-deployer/pkg/deployer/opcm/dispute_game_test.go index 604329d7c0993..61c6deb388ace 100644 --- a/op-deployer/pkg/deployer/opcm/dispute_game_test.go +++ b/op-deployer/pkg/deployer/opcm/dispute_game_test.go @@ -28,8 +28,6 @@ func TestDeployDisputeGame(t *testing.T) { ) require.NoError(t, err) - standardVersionsTOML, err := standard.L1VersionsDataFor(11155111) - require.NoError(t, err) vmAddr := common.Address{'V'} host.ImportAccount(vmAddr, types.Account{Code: vmCode}) // Address has to match the one returned by vmCode for oracle()(address) @@ -37,7 +35,6 @@ func TestDeployDisputeGame(t *testing.T) { input := DeployDisputeGameInput{ Release: "dev", - StandardVersionsToml: standardVersionsTOML, VmAddress: vmAddr, GameKind: "PermissionedDisputeGame", GameType: 1, diff --git a/op-deployer/pkg/deployer/pipeline/init.go b/op-deployer/pkg/deployer/pipeline/init.go index ef4ddfed2f50d..2b5d2396576ad 100644 --- a/op-deployer/pkg/deployer/pipeline/init.go +++ b/op-deployer/pkg/deployer/pipeline/init.go @@ -3,10 +3,7 @@ package pipeline import ( "context" "crypto/rand" - "errors" "fmt" - "os" - "strings" "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/standard" "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/state" @@ -16,8 +13,6 @@ import ( "github.com/ethereum/go-ethereum/common" ) -var ErrRefusingToDeployTaggedReleaseWithoutOPCM = errors.New("refusing to deploy tagged release without OPCM") - func IsSupportedStateVersion(version int) bool { return version == 1 } @@ -32,9 +27,18 @@ func InitLiveStrategy(ctx context.Context, env *Env, intent *state.Intent, st *s opcmAddress, opcmAddrErr := standard.ManagerImplementationAddrFor(intent.L1ChainID, intent.L1ContractsLocator.Tag) hasPredeployedOPCM := opcmAddrErr == nil - isTag := intent.L1ContractsLocator.IsTag() + isL1Tag := intent.L1ContractsLocator.IsTag() + isL2Tag := intent.L2ContractsLocator.IsTag() + + if isL1Tag && !standard.IsSupportedL1Version(intent.L1ContractsLocator.Tag) { + return fmt.Errorf("unsupported L1 version: %s", intent.L1ContractsLocator.Tag) + } - if isTag && hasPredeployedOPCM { + if isL2Tag && !standard.IsSupportedL2Version(intent.L2ContractsLocator.Tag) { + return fmt.Errorf("unsupported L2 version: %s", intent.L2ContractsLocator.Tag) + } + + if isL1Tag && hasPredeployedOPCM { superCfg, err := standard.SuperchainFor(intent.L1ChainID) if err != nil { return fmt.Errorf("error getting superchain config: %w", err) @@ -45,8 +49,6 @@ func InitLiveStrategy(ctx context.Context, env *Env, intent *state.Intent, st *s return fmt.Errorf("error getting superchain proxy admin address: %w", err) } - // Have to do this weird pointer thing below because the Superchain Registry defines its - // own Address type. st.SuperchainDeployment = &state.SuperchainDeployment{ ProxyAdminAddress: proxyAdmin, ProtocolVersionsProxyAddress: superCfg.ProtocolVersionsAddr, @@ -56,10 +58,6 @@ func InitLiveStrategy(ctx context.Context, env *Env, intent *state.Intent, st *s st.ImplementationsDeployment = &state.ImplementationsDeployment{ OpcmAddress: opcmAddress, } - } else if isTag && !hasPredeployedOPCM { - if err := displayWarning(); err != nil { - return err - } } l1ChainID, err := env.L1Client.ChainID(ctx) @@ -136,23 +134,3 @@ func InitGenesisStrategy(env *Env, intent *state.Intent, st *state.State) error func immutableErr(field string, was, is any) error { return fmt.Errorf("%s is immutable: was %v, is %v", field, was, is) } - -func displayWarning() error { - warning := strings.TrimPrefix(` -####################### WARNING! WARNING WARNING! ####################### - -You are deploying a tagged release to a chain with no pre-deployed OPCM. -Due to a quirk of our contract version system, this can lead to deploying -contracts containing unaudited or untested code. As a result, this -functionality is currently disabled. - -We will fix this in an upcoming release. - -This process will now exit. - -####################### WARNING! WARNING WARNING! ####################### -`, "\n") - - _, _ = fmt.Fprint(os.Stderr, warning) - return ErrRefusingToDeployTaggedReleaseWithoutOPCM -} diff --git a/op-deployer/pkg/deployer/standard/standard-versions-mainnet.toml b/op-deployer/pkg/deployer/standard/standard-versions-mainnet.toml deleted file mode 100644 index 550fd32e1f00c..0000000000000 --- a/op-deployer/pkg/deployer/standard/standard-versions-mainnet.toml +++ /dev/null @@ -1,62 +0,0 @@ -# Contracts which are -# * unproxied singletons: specify a standard "address" -# * proxied : specify a standard "implementation_address" -# * neither : specify neither a standard "address" nor "implementation_address" - -# Holocene https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.8.0-rc.4 -["op-contracts/v1.8.0-rc.4"] -# Updated in this release -system_config = { version = "2.3.0", implementation_address = "0xAB9d6cB7A427c0765163A7f45BB91cAfe5f2D375" } # UPDATED IN THIS RELEASE -fault_dispute_game = { version = "1.3.1" } # UPDATED IN THIS RELEASE -permissioned_dispute_game = { version = "1.3.1" } # UPDATED IN THIS RELEASE -mips = { version = "1.2.1", address = "0x5fE03a12C1236F9C22Cb6479778DDAa4bce6299C" } # UPDATED IN THIS RELEASE -# Unchanged in this release -optimism_portal = { version = "3.10.0", implementation_address = "0xe2F826324b2faf99E513D16D266c3F80aE87832B" } -anchor_state_registry = { version = "2.0.0" } -delayed_weth = { version = "1.1.0", implementation_address = "0x71e966Ae981d1ce531a7b6d23DC0f27B38409087" } -dispute_game_factory = { version = "1.0.0", implementation_address = "0xc641A33cab81C559F2bd4b21EA34C290E2440C2B" } -preimage_oracle = { version = "1.1.2", address = "0x9c065e11870B891D214Bc2Da7EF1f9DDFA1BE277" } -l1_cross_domain_messenger = { version = "2.3.0", implementation_address = "0xD3494713A5cfaD3F5359379DfA074E2Ac8C6Fd65" } -l1_erc721_bridge = { version = "2.1.0", implementation_address = "0xAE2AF01232a6c4a4d3012C5eC5b1b35059caF10d" } -l1_standard_bridge = { version = "2.1.0", implementation_address = "0x64B5a5Ed26DCb17370Ff4d33a8D503f0fbD06CfF" } -# l2_output_oracle -- This contract not used in fault proofs -optimism_mintable_erc20_factory = { version = "1.9.0", implementation_address = "0xE01efbeb1089D1d1dB9c6c8b135C934C0734c846" } - -# Fault Proofs https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.6.0 -["op-contracts/v1.6.0"] -optimism_portal = { version = "3.10.0", implementation_address = "0xe2F826324b2faf99E513D16D266c3F80aE87832B" } -system_config = { version = "2.2.0", implementation_address = "0xF56D96B2535B932656d3c04Ebf51baBff241D886" } -anchor_state_registry = { version = "2.0.0" } -delayed_weth = { version = "1.1.0", implementation_address = "0x71e966Ae981d1ce531a7b6d23DC0f27B38409087" } -dispute_game_factory = { version = "1.0.0", implementation_address = "0xc641A33cab81C559F2bd4b21EA34C290E2440C2B" } -fault_dispute_game = { version = "1.3.0" } -permissioned_dispute_game = { version = "1.3.0" } -mips = { version = "1.1.0", address = "0x16e83cE5Ce29BF90AD9Da06D2fE6a15d5f344ce4" } -preimage_oracle = { version = "1.1.2", address = "0x9c065e11870B891D214Bc2Da7EF1f9DDFA1BE277" } -l1_cross_domain_messenger = { version = "2.3.0", implementation_address = "0xD3494713A5cfaD3F5359379DfA074E2Ac8C6Fd65" } -l1_erc721_bridge = { version = "2.1.0", implementation_address = "0xAE2AF01232a6c4a4d3012C5eC5b1b35059caF10d" } -l1_standard_bridge = { version = "2.1.0", implementation_address = "0x64B5a5Ed26DCb17370Ff4d33a8D503f0fbD06CfF" } -# l2_output_oracle -- This contract not used in fault proofs -optimism_mintable_erc20_factory = { version = "1.9.0", implementation_address = "0xE01efbeb1089D1d1dB9c6c8b135C934C0734c846" } - -# Fault Proofs https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.4.0 -["op-contracts/v1.4.0"] -optimism_portal = { version = "3.10.0", implementation_address = "0xe2F826324b2faf99E513D16D266c3F80aE87832B" } -system_config = { version = "2.2.0", implementation_address = "0xF56D96B2535B932656d3c04Ebf51baBff241D886" } -anchor_state_registry = { version = "1.0.0" } -delayed_weth = { version = "1.0.0", implementation_address = "0x97988d5624F1ba266E1da305117BCf20713bee08" } -dispute_game_factory = { version = "1.0.0", implementation_address = "0xc641A33cab81C559F2bd4b21EA34C290E2440C2B" } -fault_dispute_game = { version = "1.2.0" } -permissioned_dispute_game = { version = "1.2.0" } -mips = { version = "1.0.1", address = "0x0f8EdFbDdD3c0256A80AD8C0F2560B1807873C9c" } -preimage_oracle = { version = "1.0.0", address = "0xD326E10B8186e90F4E2adc5c13a2d0C137ee8b34" } - -# MCP https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.3.0 -["op-contracts/v1.3.0"] -l1_cross_domain_messenger = { version = "2.3.0", implementation_address = "0xD3494713A5cfaD3F5359379DfA074E2Ac8C6Fd65" } -l1_erc721_bridge = { version = "2.1.0", implementation_address = "0xAE2AF01232a6c4a4d3012C5eC5b1b35059caF10d" } -l1_standard_bridge = { version = "2.1.0", implementation_address = "0x64B5a5Ed26DCb17370Ff4d33a8D503f0fbD06CfF" } -l2_output_oracle = { version = "1.8.0", implementation_address = "0xF243BEd163251380e78068d317ae10f26042B292" } -optimism_mintable_erc20_factory = { version = "1.9.0", implementation_address = "0xE01efbeb1089D1d1dB9c6c8b135C934C0734c846" } -optimism_portal = { version = "2.5.0", implementation_address = "0x2D778797049FE9259d947D1ED8e5442226dFB589" } -system_config = { version = "1.12.0", implementation_address = "0xba2492e52F45651B60B8B38d4Ea5E2390C64Ffb1" } diff --git a/op-deployer/pkg/deployer/standard/standard-versions-sepolia.toml b/op-deployer/pkg/deployer/standard/standard-versions-sepolia.toml deleted file mode 100644 index cbb664fbc6370..0000000000000 --- a/op-deployer/pkg/deployer/standard/standard-versions-sepolia.toml +++ /dev/null @@ -1,40 +0,0 @@ -# Contracts which are -# * unproxied singletons: specify a standard "address" -# * proxied : specify a standard "implementation_address" -# * neither : specify neither a standard "address" nor "implementation_address" - -# Holocene https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.8.0-rc.4 -["op-contracts/v1.8.0-rc.4"] -# Updated in this release -system_config = { version = "2.3.0", implementation_address = "0x33b83E4C305c908B2Fc181dDa36e230213058d7d" } # UPDATED IN THIS RELEASE -fault_dispute_game = { version = "1.3.1" } # UPDATED IN THIS RELEASE -permissioned_dispute_game = { version = "1.3.1" } # UPDATED IN THIS RELEASE -mips = { version = "1.2.1", address = "0x69470D6970Cd2A006b84B1d4d70179c892cFCE01" } # UPDATED IN THIS RELEASE -# Unchanged in this release -optimism_portal = { version = "3.10.0", implementation_address = "0x35028bae87d71cbc192d545d38f960ba30b4b233" } -anchor_state_registry = { version = "2.0.0" } -delayed_weth = { version = "1.1.0", implementation_address = "0x07f69b19532476c6cd03056d6bc3f1b110ab7538" } -dispute_game_factory = { version = "1.0.0", implementation_address = "0xa51bea7e4d34206c0bcb04a776292f2f19f0beec" } -preimage_oracle = { version = "1.1.2", address = "0x92240135b46fc1142dA181f550aE8f595B858854" } -l1_cross_domain_messenger = { version = "2.3.0", implementation_address = "0xD3494713A5cfaD3F5359379DfA074E2Ac8C6Fd65" } -l1_erc721_bridge = { version = "2.1.0", implementation_address = "0xae2af01232a6c4a4d3012c5ec5b1b35059caf10d" } -l1_standard_bridge = { version = "2.1.0", implementation_address = "0x64b5a5ed26dcb17370ff4d33a8d503f0fbd06cff" } -# l2_output_oracle -- This contract not used in fault proofs -optimism_mintable_erc20_factory = { version = "1.9.0", implementation_address = "0xe01efbeb1089d1d1db9c6c8b135c934c0734c846" } - -# Fault Proofs https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.6.0 -["op-contracts/v1.6.0"] -optimism_portal = { version = "3.10.0", implementation_address = "0x35028bae87d71cbc192d545d38f960ba30b4b233" } -system_config = { version = "2.2.0", implementation_address = "0xCcdd86d581e40fb5a1C77582247BC493b6c8B169" } -anchor_state_registry = { version = "2.0.0" } -delayed_weth = { version = "1.1.0", implementation_address = "0x07f69b19532476c6cd03056d6bc3f1b110ab7538" } -dispute_game_factory = { version = "1.0.0", implementation_address = "0xa51bea7e4d34206c0bcb04a776292f2f19f0beec" } -fault_dispute_game = { version = "1.3.0" } -permissioned_dispute_game = { version = "1.3.0" } -mips = { version = "1.1.0", address = "0x47B0E34C1054009e696BaBAAd56165e1e994144d" } -preimage_oracle = { version = "1.1.2", address = "0x92240135b46fc1142dA181f550aE8f595B858854" } -l1_cross_domain_messenger = { version = "2.3.0", implementation_address = "0xD3494713A5cfaD3F5359379DfA074E2Ac8C6Fd65" } -l1_erc721_bridge = { version = "2.1.0", implementation_address = "0xae2af01232a6c4a4d3012c5ec5b1b35059caf10d" } -l1_standard_bridge = { version = "2.1.0", implementation_address = "0x64b5a5ed26dcb17370ff4d33a8d503f0fbd06cff" } -# l2_output_oracle -- This contract not used in fault proofs -optimism_mintable_erc20_factory = { version = "1.9.0", implementation_address = "0xe01efbeb1089d1d1db9c6c8b135c934c0734c846" } diff --git a/op-deployer/pkg/deployer/standard/standard.go b/op-deployer/pkg/deployer/standard/standard.go index ee88170662016..1f43b33fe1137 100644 --- a/op-deployer/pkg/deployer/standard/standard.go +++ b/op-deployer/pkg/deployer/standard/standard.go @@ -13,8 +13,6 @@ import ( "github.com/ethereum-optimism/optimism/op-node/rollup" op_service "github.com/ethereum-optimism/optimism/op-service" - "github.com/BurntSushi/toml" - "github.com/ethereum/go-ethereum/common" ) @@ -40,151 +38,61 @@ const ( ContractsV160Tag = "op-contracts/v1.6.0" ContractsV180Tag = "op-contracts/v1.8.0-rc.4" ContractsV170Beta1L2Tag = "op-contracts/v1.7.0-beta.1+l2-contracts" + ContractsV200Tag = "op-contracts/v2.0.0-rc.1" ) var DisputeAbsolutePrestate = common.HexToHash("0x038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c") -//go:embed standard-versions-mainnet.toml -var VersionsMainnetData string - -//go:embed standard-versions-sepolia.toml -var VersionsSepoliaData string - -var L1VersionsSepolia L1Versions - -var L1VersionsMainnet L1Versions - -var DefaultL1ContractsTag = ContractsV180Tag +var DefaultL1ContractsTag = ContractsV200Tag var DefaultL2ContractsTag = ContractsV170Beta1L2Tag -type L1Versions map[string]L1VersionsReleases - -type L1VersionsReleases struct { - OptimismPortal VersionRelease `toml:"optimism_portal"` - SystemConfig VersionRelease `toml:"system_config"` - AnchorStateRegistry VersionRelease `toml:"anchor_state_registry"` - DelayedWETH VersionRelease `toml:"delayed_weth"` - DisputeGameFactory VersionRelease `toml:"dispute_game_factory"` - FaultDisputeGame VersionRelease `toml:"fault_dispute_game"` - PermissionedDisputeGame VersionRelease `toml:"permissioned_dispute_game"` - MIPS VersionRelease `toml:"mips"` - PreimageOracle VersionRelease `toml:"preimage_oracle"` - L1CrossDomainMessenger VersionRelease `toml:"l1_cross_domain_messenger"` - L1ERC721Bridge VersionRelease `toml:"l1_erc721_bridge"` - L1StandardBridge VersionRelease `toml:"l1_standard_bridge"` - OptimismMintableERC20Factory VersionRelease `toml:"optimism_mintable_erc20_factory"` -} - -type VersionRelease struct { - Version string `toml:"version"` - ImplementationAddress common.Address `toml:"implementation_address"` - Address common.Address `toml:"address"` -} - -var _ embed.FS - -type OPCMBlueprints struct { - AddressManager common.Address - Proxy common.Address - ProxyAdmin common.Address - L1ChugSplashProxy common.Address - ResolvedDelegateProxy common.Address - AnchorStateRegistry common.Address - PermissionedDisputeGame1 common.Address - PermissionedDisputeGame2 common.Address +type TaggedRelease struct { + ArtifactsHash common.Hash + ContentHash common.Hash } -type OPCMBlueprintsByChain struct { - Mainnet *OPCMBlueprints - Sepolia *OPCMBlueprints +func (t TaggedRelease) URL() string { + return fmt.Sprintf("https://storage.googleapis.com/oplabs-contract-artifacts/artifacts-v1-%x.tar.gz", t.ContentHash) } -var opcmBlueprintsByVersion = map[string]OPCMBlueprintsByChain{ - "op-contracts/v1.6.0": { - Mainnet: &OPCMBlueprints{ - AddressManager: common.HexToAddress("0x29aA24714c06914d9689e933cae2293C569AfeEa"), - Proxy: common.HexToAddress("0x3626ebD458c7f34FD98789A373593fF2fc227bA0"), - ProxyAdmin: common.HexToAddress("0x7170678A5CFFb6872606d251B3CcdB27De962631"), - L1ChugSplashProxy: common.HexToAddress("0x538906C8B000D621fd11B7e8642f504dD8730837"), - ResolvedDelegateProxy: common.HexToAddress("0xF12bD34d6a1d26d230240ECEA761f77e2013926E"), - AnchorStateRegistry: common.HexToAddress("0xbA7Be2bEE016568274a4D1E6c852Bb9a99FaAB8B"), - PermissionedDisputeGame1: common.HexToAddress("0xb94bF6130Df8BD9a9eA45D8dD8C18957002d1986"), - PermissionedDisputeGame2: common.HexToAddress("0xe0a642B249CF6cbF0fF7b4dDf41443Ea7a5C8Cc8"), - }, - Sepolia: &OPCMBlueprints{ - AddressManager: common.HexToAddress("0x3125a4cB2179E04203D3Eb2b5784aaef9FD64216"), - Proxy: common.HexToAddress("0xe650ADb86a0de96e2c434D0a52E7D5B70980D6f1"), - ProxyAdmin: common.HexToAddress("0x3AC6b88F6bC4A5038DB7718dE47a5ab1a9609319"), - L1ChugSplashProxy: common.HexToAddress("0x58770FC7ed304c43D2B70248914eb34A741cF411"), - ResolvedDelegateProxy: common.HexToAddress("0x0449adB72D489a137d476aB49c6b812161754fD3"), - AnchorStateRegistry: common.HexToAddress("0xB98095199437883b7661E0D58256060f3bc730a4"), - PermissionedDisputeGame1: common.HexToAddress("0xf72Ac5f164cC024DE09a2c249441715b69a16eAb"), - PermissionedDisputeGame2: common.HexToAddress("0x713dAC5A23728477547b484f9e0D751077E300a2"), - }, +var taggedReleases = map[string]TaggedRelease{ + ContractsV160Tag: { + ArtifactsHash: common.HexToHash("d20a930cc0ff204c2d93b7aa60755ec7859ba4f328b881f5090c6a6a2a86dcba"), + ContentHash: common.HexToHash("e1f0c4020618c4a98972e7124c39686cab2e31d5d7846f9ce5e0d5eed0f5ff32"), + }, + ContractsV170Beta1L2Tag: { + ArtifactsHash: common.HexToHash("9e3ad322ec9b2775d59143ce6874892f9b04781742c603ad59165159e90b00b9"), + ContentHash: common.HexToHash("b0fb1f6f674519d637cff39a22187a5993d7f81a6d7b7be6507a0b50a5e38597"), + }, + ContractsV180Tag: { + ArtifactsHash: common.HexToHash("78f186df4e9a02a6421bd9c3641b281e297535140967faa428c938286923976a"), + ContentHash: common.HexToHash("361ebf1f520c20d932695b00babfff6923ce2530cd05b2776eb74e07038898a6"), }, - "op-contracts/v1.8.0-rc.4": { - Mainnet: &OPCMBlueprints{ - AddressManager: common.HexToAddress("0x29aA24714c06914d9689e933cae2293C569AfeEa"), - Proxy: common.HexToAddress("0x3626ebD458c7f34FD98789A373593fF2fc227bA0"), - ProxyAdmin: common.HexToAddress("0x7170678A5CFFb6872606d251B3CcdB27De962631"), - L1ChugSplashProxy: common.HexToAddress("0x538906C8B000D621fd11B7e8642f504dD8730837"), - ResolvedDelegateProxy: common.HexToAddress("0xF12bD34d6a1d26d230240ECEA761f77e2013926E"), - AnchorStateRegistry: common.HexToAddress("0xbA7Be2bEE016568274a4D1E6c852Bb9a99FaAB8B"), - PermissionedDisputeGame1: common.HexToAddress("0x596A4334a28056c7943c8bcEf220F38cA5B42dC5"), // updated - PermissionedDisputeGame2: common.HexToAddress("0x4E3E5C09B07AAA3fe482F5A1f82a19e91944Fffc"), // updated - }, - Sepolia: &OPCMBlueprints{ - AddressManager: common.HexToAddress("0x3125a4cB2179E04203D3Eb2b5784aaef9FD64216"), - Proxy: common.HexToAddress("0xe650ADb86a0de96e2c434D0a52E7D5B70980D6f1"), - ProxyAdmin: common.HexToAddress("0x3AC6b88F6bC4A5038DB7718dE47a5ab1a9609319"), - L1ChugSplashProxy: common.HexToAddress("0x58770FC7ed304c43D2B70248914eb34A741cF411"), - ResolvedDelegateProxy: common.HexToAddress("0x0449adB72D489a137d476aB49c6b812161754fD3"), - AnchorStateRegistry: common.HexToAddress("0xB98095199437883b7661E0D58256060f3bc730a4"), - PermissionedDisputeGame1: common.HexToAddress("0x596A4334a28056c7943c8bcEf220F38cA5B42dC5"), // updated - PermissionedDisputeGame2: common.HexToAddress("0x4E3E5C09B07AAA3fe482F5A1f82a19e91944Fffc"), // updated - }, + ContractsV200Tag: { + ArtifactsHash: common.HexToHash("32e11c96e07b83619f419595facb273368dccfe2439287549e7b436c9b522204"), + ContentHash: common.HexToHash("1cec51ed629c0394b8fb17ff2c6fa45c406c30f94ebbd37d4c90ede6c29ad608"), }, } -func OPCMBlueprintsFor(chainID uint64, version string) (OPCMBlueprints, error) { - switch chainID { - case 1: - bps := opcmBlueprintsByVersion[version].Mainnet - if bps == nil { - return OPCMBlueprints{}, fmt.Errorf("unsupported version: %s", version) - } - return *bps, nil - case 11155111: - bps := opcmBlueprintsByVersion[version].Sepolia - if bps == nil { - return OPCMBlueprints{}, fmt.Errorf("unsupported version: %s", version) - } - return *bps, nil - default: - return OPCMBlueprints{}, fmt.Errorf("unsupported chain ID: %d", chainID) - } +var _ embed.FS + +func IsSupportedL1Version(tag string) bool { + return tag == ContractsV200Tag } -func L1VersionsDataFor(chainID uint64) (string, error) { - switch chainID { - case 1: - return VersionsMainnetData, nil - case 11155111: - return VersionsSepoliaData, nil - default: - return "", fmt.Errorf("unsupported chain ID: %d", chainID) - } +func IsSupportedL2Version(tag string) bool { + return tag == ContractsV170Beta1L2Tag } -func L1VersionsFor(chainID uint64) (L1Versions, error) { +func L1VersionsFor(chainID uint64) (validation.Versions, error) { switch chainID { case 1: - return L1VersionsMainnet, nil + return validation.StandardVersionsMainnet, nil case 11155111: - return L1VersionsSepolia, nil + return validation.StandardVersionsSepolia, nil default: - return L1Versions{}, fmt.Errorf("unsupported chain ID: %d", chainID) + return nil, fmt.Errorf("unsupported chain ID: %d", chainID) } } @@ -222,38 +130,15 @@ func SuperchainFor(chainID uint64) (superchain.Superchain, error) { } func ManagerImplementationAddrFor(chainID uint64, tag string) (common.Address, error) { - switch chainID { - case 1: - switch tag { - case "op-contracts/v1.6.0": - // Generated using the bootstrap command on 11/18/2024. - // Verified against compiled bytecode at: - // https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts-v160-artifacts-opcm-redesign-backport - return common.HexToAddress("0x9BC0A1eD534BFb31a6Be69e5b767Cba332f14347"), nil - case "op-contracts/v1.8.0-rc.4": - // Generated using the bootstrap command on 01/23/2025. - // Verified against compiled bytecode at: - // https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts-v180-blueprints-script - return common.HexToAddress("0x5269eed89b0d04d909a0973439e2587e815ba932"), nil - default: - return common.Address{}, fmt.Errorf("unsupported mainnet tag: %s", tag) - } - case 11155111: - switch tag { - case "op-contracts/v1.6.0": - // Generated using the bootstrap command on 11/18/2024. - // Verified against compiled bytecode at: - // https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts-v160-artifacts-opcm-redesign-backport - return common.HexToAddress("0x760B1d2Dc68DC51fb6E8B2b8722B8ed08903540c"), nil - case "op-contracts/v1.8.0-rc.4": - // Generated using the bootstrap command on 12/19/2024. - return common.HexToAddress("0xefb0779120d9cc3582747e5eb787d859e3a53a5c"), nil - default: - return common.Address{}, fmt.Errorf("unsupported sepolia tag: %s", tag) - } - default: + versionsData, err := L1VersionsFor(chainID) + if err != nil { return common.Address{}, fmt.Errorf("unsupported chain ID: %d", chainID) } + versionData, ok := versionsData[validation.Semver(tag)] + if !ok { + return common.Address{}, fmt.Errorf("unsupported tag for chain ID %d: %s", chainID, tag) + } + return common.Address(*versionData.OPContractsManager.Address), nil } // SuperchainProxyAdminAddrFor returns the address of the Superchain ProxyAdmin for the given chain ID. @@ -293,29 +178,20 @@ func ProtocolVersionsOwner(chainID uint64) (common.Address, error) { } func ArtifactsURLForTag(tag string) (*url.URL, error) { - switch tag { - case "op-contracts/v1.6.0": - return url.Parse(standardArtifactsURL("e1f0c4020618c4a98972e7124c39686cab2e31d5d7846f9ce5e0d5eed0f5ff32")) - case "op-contracts/v1.7.0-beta.1+l2-contracts": - return url.Parse(standardArtifactsURL("b0fb1f6f674519d637cff39a22187a5993d7f81a6d7b7be6507a0b50a5e38597")) - case "op-contracts/v1.8.0-rc.4": - return url.Parse(standardArtifactsURL("361ebf1f520c20d932695b00babfff6923ce2530cd05b2776eb74e07038898a6")) - default: + release, ok := taggedReleases[tag] + if !ok { return nil, fmt.Errorf("unsupported tag: %s", tag) } + + return url.Parse(release.URL()) } func ArtifactsHashForTag(tag string) (common.Hash, error) { - switch tag { - case "op-contracts/v1.6.0": - return common.HexToHash("d20a930cc0ff204c2d93b7aa60755ec7859ba4f328b881f5090c6a6a2a86dcba"), nil - case "op-contracts/v1.7.0-beta.1+l2-contracts": - return common.HexToHash("9e3ad322ec9b2775d59143ce6874892f9b04781742c603ad59165159e90b00b9"), nil - case "op-contracts/v1.8.0-rc.4": - return common.HexToHash("78f186df4e9a02a6421bd9c3641b281e297535140967faa428c938286923976a"), nil - default: + release, ok := taggedReleases[tag] + if !ok { return common.Hash{}, fmt.Errorf("unsupported tag: %s", tag) } + return release.ArtifactsHash, nil } // DefaultHardforkScheduleForTag is used to determine which hardforks should be activated by default given a @@ -341,19 +217,3 @@ func DefaultHardforkScheduleForTag(tag string) *genesis.UpgradeScheduleDeployCon return sched } - -func standardArtifactsURL(checksum string) string { - return fmt.Sprintf("https://storage.googleapis.com/oplabs-contract-artifacts/artifacts-v1-%s.tar.gz", checksum) -} - -func init() { - L1VersionsMainnet = L1Versions{} - if err := toml.Unmarshal([]byte(VersionsMainnetData), &L1VersionsMainnet); err != nil { - panic(err) - } - - L1VersionsSepolia = L1Versions{} - if err := toml.Unmarshal([]byte(VersionsSepoliaData), &L1VersionsSepolia); err != nil { - panic(err) - } -} diff --git a/op-deployer/pkg/deployer/state/intent.go b/op-deployer/pkg/deployer/state/intent.go index 7210b93122436..e142b59ec3917 100644 --- a/op-deployer/pkg/deployer/state/intent.go +++ b/op-deployer/pkg/deployer/state/intent.go @@ -7,6 +7,8 @@ import ( "net/url" "reflect" + "github.com/ethereum-optimism/superchain-registry/validation" + "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/artifacts" "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/standard" @@ -229,7 +231,7 @@ func (c *Intent) checkL1Prod() error { return err } - if _, ok := versions[c.L1ContractsLocator.Tag]; !ok { + if _, ok := versions[validation.Semver(c.L1ContractsLocator.Tag)]; !ok { return fmt.Errorf("tag '%s' not found in standard versions", c.L1ContractsLocator.Tag) } diff --git a/op-deployer/pkg/deployer/state/intent_test.go b/op-deployer/pkg/deployer/state/intent_test.go index 718a11357b1b9..7451397bb5051 100644 --- a/op-deployer/pkg/deployer/state/intent_test.go +++ b/op-deployer/pkg/deployer/state/intent_test.go @@ -8,7 +8,7 @@ import ( ) func TestValidateStandardValues(t *testing.T) { - intent, err := NewIntentStandard(1, []common.Hash{common.HexToHash("0x336")}) + intent, err := NewIntentStandard(11155111, []common.Hash{common.HexToHash("0x336")}) require.NoError(t, err) err = intent.Check() @@ -64,7 +64,7 @@ func TestValidateStandardValues(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - intent, err := NewIntentStandard(1, []common.Hash{common.HexToHash("0x336")}) + intent, err := NewIntentStandard(11155111, []common.Hash{common.HexToHash("0x336")}) require.NoError(t, err) setChainRoles(&intent) setFeeAddresses(&intent) diff --git a/op-deployer/pkg/deployer/upgrade/v2_0_0/upgrade.go b/op-deployer/pkg/deployer/upgrade/v2_0_0/upgrade.go index 579fbe3b7c98d..a5926899d01bf 100644 --- a/op-deployer/pkg/deployer/upgrade/v2_0_0/upgrade.go +++ b/op-deployer/pkg/deployer/upgrade/v2_0_0/upgrade.go @@ -4,6 +4,8 @@ import ( "encoding/json" "fmt" + "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/standard" + "github.com/ethereum-optimism/optimism/op-chain-ops/script" "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/opcm" "github.com/ethereum/go-ethereum/common" @@ -55,7 +57,7 @@ func (u *Upgrader) SupportsVersion(version string) bool { } func (u *Upgrader) ArtifactsURL() string { - return "" + return "tag://" + standard.ContractsV200Tag } var DefaultUpgrader = new(Upgrader) diff --git a/op-validator/pkg/validations/addresses.go b/op-validator/pkg/validations/addresses.go index 1b5cf5b9f933d..57f8fef9d9fb5 100644 --- a/op-validator/pkg/validations/addresses.go +++ b/op-validator/pkg/validations/addresses.go @@ -13,9 +13,10 @@ const ( var addresses = map[uint64]map[string]common.Address{ 11155111: { - // Both versions below bootstrapped on 02/23/2025 using OP Deployer. + // Bootstrapped on 03/02/2025 using OP Deployer. VersionV180: common.HexToAddress("0x0a5bf8ebb4b177b2dcc6eba933db726a2e2e2b4d"), - VersionV200: common.HexToAddress("0xaf72eedb110f114a3b4e921c12755b4e47dbd63d"), + // Bootstrapped on 03/02/2025 using OP Deployer. + VersionV200: common.HexToAddress("0x37739a6b0a3f1e7429499a4ec4a0685439daff5c"), }, } diff --git a/op-validator/pkg/validations/addresses_test.go b/op-validator/pkg/validations/addresses_test.go index c6bf0b3e533e5..d3967e348f692 100644 --- a/op-validator/pkg/validations/addresses_test.go +++ b/op-validator/pkg/validations/addresses_test.go @@ -26,7 +26,7 @@ func TestValidatorAddress(t *testing.T) { name: "Valid Sepolia v2.0.0", chainID: 11155111, version: VersionV200, - want: common.HexToAddress("0xaf72eedb110f114a3b4e921c12755b4e47dbd63d"), + want: common.HexToAddress("0x37739a6b0a3F1E7429499a4eC4A0685439Daff5C"), expectError: false, }, { diff --git a/op-validator/pkg/validations/testdata/validations-v200.json b/op-validator/pkg/validations/testdata/validations-v200.json index 56c24a4345b04..b9e26d9a80947 100644 --- a/op-validator/pkg/validations/testdata/validations-v200.json +++ b/op-validator/pkg/validations/testdata/validations-v200.json @@ -7,7 +7,7 @@ "method": "eth_call", "params": [ { - "to": "0xaf72eedb110f114a3b4e921c12755b4e47dbd63d", + "to": "0x37739a6b0a3f1e7429499a4ec4a0685439daff5c", "data": "0x30d14888000000000000000000000000189abaaaa82dfc015a588a7dbad6f13b1d3485bc000000000000000000000000034edd2a225f7f429a63e0f1d2084b9e0a93b538038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c0000000000000000000000000000000000000000000000000000000000aa37dc0000000000000000000000000000000000000000000000000000000000000001" }, "latest" diff --git a/op-validator/pkg/validations/validations_test.go b/op-validator/pkg/validations/validations_test.go index 451d31516dbec..5c5fc43c1e6fb 100644 --- a/op-validator/pkg/validations/validations_test.go +++ b/op-validator/pkg/validations/validations_test.go @@ -16,7 +16,7 @@ import ( "github.com/ethereum-optimism/optimism/op-service/testutils/mockrpc" ) -func TestValidate(t *testing.T) { +func TestValidate_Mocked(t *testing.T) { tests := []struct { version string validator func(rpcClient *rpc.Client) Validator diff --git a/packages/contracts-bedrock/src/L1/StandardValidator.sol b/packages/contracts-bedrock/src/L1/StandardValidator.sol index cb54e935c1a16..4ff5dc75e9f13 100644 --- a/packages/contracts-bedrock/src/L1/StandardValidator.sol +++ b/packages/contracts-bedrock/src/L1/StandardValidator.sol @@ -621,11 +621,11 @@ contract StandardValidatorV200 is StandardValidatorBase { } function l1ERC721BridgeVersion() public pure override returns (string memory) { - return "2.3.0"; + return "2.3.1"; } function optimismPortalVersion() public pure override returns (string memory) { - return "3.12.0"; + return "3.13.0"; } function systemConfigVersion() public pure override returns (string memory) { @@ -641,10 +641,30 @@ contract StandardValidatorV200 is StandardValidatorBase { } function l1StandardBridgeVersion() public pure override returns (string memory) { - return "2.2.1"; + return "2.2.2"; } function disputeGameFactoryVersion() public pure override returns (string memory) { return "1.0.1"; } + + function anchorStateRegistryVersion() public pure override returns (string memory) { + return "2.2.2"; + } + + function delayedWETHVersion() public pure override returns (string memory) { + return "1.3.0"; + } + + function mipsVersion() public pure override returns (string memory) { + return "1.3.0"; + } + + function permissionedDisputeGameVersion() public pure override returns (string memory) { + return "1.4.1"; + } + + function preimageOracleVersion() public pure override returns (string memory) { + return "1.1.4"; + } } diff --git a/packages/contracts-bedrock/test/L1/StandardValidator.t.sol b/packages/contracts-bedrock/test/L1/StandardValidator.t.sol index 9e6062bc9f2df..39852cf273da2 100644 --- a/packages/contracts-bedrock/test/L1/StandardValidator.t.sol +++ b/packages/contracts-bedrock/test/L1/StandardValidator.t.sol @@ -1135,12 +1135,20 @@ contract StandardValidatorV200_Test is StandardValidatorTest { super._mockValidationCalls(); // Override version numbers for V200 - vm.mockCall(address(l1ERC721Bridge), abi.encodeCall(ISemver.version, ()), abi.encode("2.3.0")); - vm.mockCall(address(optimismPortal), abi.encodeCall(ISemver.version, ()), abi.encode("3.12.0")); + vm.mockCall(address(l1ERC721Bridge), abi.encodeCall(ISemver.version, ()), abi.encode("2.3.1")); + vm.mockCall(address(optimismPortal), abi.encodeCall(ISemver.version, ()), abi.encode("3.13.0")); vm.mockCall(address(systemConfig), abi.encodeCall(ISemver.version, ()), abi.encode("2.4.0")); vm.mockCall(address(optimismMintableERC20Factory), abi.encodeCall(ISemver.version, ()), abi.encode("1.10.1")); vm.mockCall(address(l1CrossDomainMessenger), abi.encodeCall(ISemver.version, ()), abi.encode("2.5.0")); - vm.mockCall(address(l1StandardBridge), abi.encodeCall(ISemver.version, ()), abi.encode("2.2.1")); + vm.mockCall(address(l1StandardBridge), abi.encodeCall(ISemver.version, ()), abi.encode("2.2.2")); vm.mockCall(address(disputeGameFactory), abi.encodeCall(ISemver.version, ()), abi.encode("1.0.1")); + vm.mockCall(address(permissionedASR), abi.encodeCall(ISemver.version, ()), abi.encode("2.2.2")); + vm.mockCall(address(permissionedDelayedWETH), abi.encodeCall(ISemver.version, ()), abi.encode("1.3.0")); + vm.mockCall(address(permissionlessASR), abi.encodeCall(ISemver.version, ()), abi.encode("2.2.2")); + vm.mockCall(address(permissionlessDelayedWETH), abi.encodeCall(ISemver.version, ()), abi.encode("1.3.0")); + vm.mockCall(address(mips), abi.encodeCall(ISemver.version, ()), abi.encode("1.3.0")); + vm.mockCall(address(permissionedDisputeGame), abi.encodeCall(ISemver.version, ()), abi.encode("1.4.1")); + vm.mockCall(address(permissionlessDisputeGame), abi.encodeCall(ISemver.version, ()), abi.encode("1.4.1")); + vm.mockCall(address(preimageOracle), abi.encodeCall(ISemver.version, ()), abi.encode("1.1.4")); } }