diff --git a/.semgrep/rules/sol-rules.yaml b/.semgrep/rules/sol-rules.yaml index 2e97715f699ba..be966c682028e 100644 --- a/.semgrep/rules/sol-rules.yaml +++ b/.semgrep/rules/sol-rules.yaml @@ -241,10 +241,6 @@ rules: _disableInitializers(); ... } - paths: - exclude: - - packages/contracts-bedrock/src/L1/SystemConfigInterop.sol - - packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol - id: sol-safety-proper-initializer languages: [solidity] @@ -273,9 +269,6 @@ rules: function initialize(...) public reinitializer(...) { ... } - paths: - exclude: - - packages/contracts-bedrock/src/L1/SystemConfigInterop.sol - id: sol-safety-proper-upgrade-function languages: [solidity] diff --git a/op-chain-ops/interopgen/configs.go b/op-chain-ops/interopgen/configs.go index a365fd6cb78ee..c3113d240e10c 100644 --- a/op-chain-ops/interopgen/configs.go +++ b/op-chain-ops/interopgen/configs.go @@ -74,16 +74,15 @@ type L2Config struct { Challenger common.Address SystemConfigOwner common.Address genesis.L2InitializationConfig - Prefund map[common.Address]*big.Int - SaltMixer string - GasLimit uint64 - DisputeGameUsesSuperRoots bool - DisputeGameType uint32 - DisputeAbsolutePrestate common.Hash - DisputeMaxGameDepth uint64 - DisputeSplitDepth uint64 - DisputeClockExtension uint64 - DisputeMaxClockDuration uint64 + Prefund map[common.Address]*big.Int + SaltMixer string + GasLimit uint64 + DisputeGameType uint32 + DisputeAbsolutePrestate common.Hash + DisputeMaxGameDepth uint64 + DisputeSplitDepth uint64 + DisputeClockExtension uint64 + DisputeMaxClockDuration uint64 } func (c *L2Config) Check(log log.Logger) error { diff --git a/op-chain-ops/interopgen/deploy.go b/op-chain-ops/interopgen/deploy.go index 84a06245132ae..4ef1d32b658df 100644 --- a/op-chain-ops/interopgen/deploy.go +++ b/op-chain-ops/interopgen/deploy.go @@ -198,25 +198,24 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme l1Host.SetTxOrigin(cfg.Deployer) output, err := opcm.DeployOPChain(l1Host, opcm.DeployOPChainInput{ - OpChainProxyAdminOwner: cfg.ProxyAdminOwner, - SystemConfigOwner: cfg.SystemConfigOwner, - Batcher: cfg.BatchSenderAddress, - UnsafeBlockSigner: cfg.P2PSequencerAddress, - Proposer: cfg.Proposer, - Challenger: cfg.Challenger, - BasefeeScalar: cfg.GasPriceOracleBaseFeeScalar, - BlobBaseFeeScalar: cfg.GasPriceOracleBlobBaseFeeScalar, - L2ChainId: new(big.Int).SetUint64(cfg.L2ChainID), - Opcm: superDeployment.Opcm, - SaltMixer: cfg.SaltMixer, - GasLimit: cfg.GasLimit, - DisputeGameUsesSuperRoots: cfg.DisputeGameUsesSuperRoots, - DisputeGameType: cfg.DisputeGameType, - DisputeAbsolutePrestate: cfg.DisputeAbsolutePrestate, - DisputeMaxGameDepth: cfg.DisputeMaxGameDepth, - DisputeSplitDepth: cfg.DisputeSplitDepth, - DisputeClockExtension: cfg.DisputeClockExtension, - DisputeMaxClockDuration: cfg.DisputeMaxClockDuration, + OpChainProxyAdminOwner: cfg.ProxyAdminOwner, + SystemConfigOwner: cfg.SystemConfigOwner, + Batcher: cfg.BatchSenderAddress, + UnsafeBlockSigner: cfg.P2PSequencerAddress, + Proposer: cfg.Proposer, + Challenger: cfg.Challenger, + BasefeeScalar: cfg.GasPriceOracleBaseFeeScalar, + BlobBaseFeeScalar: cfg.GasPriceOracleBlobBaseFeeScalar, + L2ChainId: new(big.Int).SetUint64(cfg.L2ChainID), + Opcm: superDeployment.Opcm, + SaltMixer: cfg.SaltMixer, + GasLimit: cfg.GasLimit, + DisputeGameType: cfg.DisputeGameType, + DisputeAbsolutePrestate: cfg.DisputeAbsolutePrestate, + DisputeMaxGameDepth: cfg.DisputeMaxGameDepth, + DisputeSplitDepth: cfg.DisputeSplitDepth, + DisputeClockExtension: cfg.DisputeClockExtension, + DisputeMaxClockDuration: cfg.DisputeMaxClockDuration, }) if err != nil { return nil, fmt.Errorf("failed to deploy L2 OP chain: %w", err) diff --git a/op-chain-ops/interopgen/recipe.go b/op-chain-ops/interopgen/recipe.go index b835716ea588b..6cf3265925c4d 100644 --- a/op-chain-ops/interopgen/recipe.go +++ b/op-chain-ops/interopgen/recipe.go @@ -275,16 +275,15 @@ func (r *InteropDevL2Recipe) build(l1ChainID uint64, addrs devkeys.Addresses) (* UseAltDA: false, }, }, - Prefund: make(map[common.Address]*big.Int), - SaltMixer: "", - GasLimit: 60_000_000, - DisputeGameUsesSuperRoots: true, - DisputeGameType: 1, // PERMISSIONED_CANNON Game Type - DisputeAbsolutePrestate: common.HexToHash("0x038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c"), - DisputeMaxGameDepth: 73, - DisputeSplitDepth: 30, - DisputeClockExtension: 10800, // 3 hours (input in seconds) - DisputeMaxClockDuration: 302400, // 3.5 days (input in seconds) + Prefund: make(map[common.Address]*big.Int), + SaltMixer: "", + GasLimit: 60_000_000, + DisputeGameType: 1, // PERMISSIONED_CANNON Game Type + DisputeAbsolutePrestate: common.HexToHash("0x038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c"), + DisputeMaxGameDepth: 73, + DisputeSplitDepth: 30, + DisputeClockExtension: 10800, // 3 hours (input in seconds) + DisputeMaxClockDuration: 302400, // 3.5 days (input in seconds) } l2Users := devkeys.ChainUserKeys(new(big.Int).SetUint64(r.ChainID)) diff --git a/op-deployer/pkg/deployer/integration_test/apply_test.go b/op-deployer/pkg/deployer/integration_test/apply_test.go index 134d9a34c2cd7..8bdcf1d56ae82 100644 --- a/op-deployer/pkg/deployer/integration_test/apply_test.go +++ b/op-deployer/pkg/deployer/integration_test/apply_test.go @@ -401,24 +401,6 @@ func TestProofParamOverrides(t *testing.T) { } } -func TestInteropDeployment(t *testing.T) { - op_e2e.InitParallel(t) - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - opts, intent, st := setupGenesisChain(t, defaultL1ChainID) - intent.UseInterop = true - - require.NoError(t, deployer.ApplyPipeline(ctx, opts)) - - chainState := st.Chains[0] - depManagerSlot := common.HexToHash("0x1708e077affb93e89be2665fb0fb72581be66f84dc00d25fed755ae911905b1c") - checkImmutable(t, st.L1StateDump.Data.Accounts, st.ImplementationsDeployment.SystemConfigImplAddress, depManagerSlot) - proxyAdminOwnerHash := common.BytesToHash(intent.Chains[0].Roles.SystemConfigOwner.Bytes()) - checkStorageSlot(t, st.L1StateDump.Data.Accounts, chainState.SystemConfigProxyAddress, depManagerSlot, proxyAdminOwnerHash) -} - func TestAltDADeployment(t *testing.T) { op_e2e.InitParallel(t) @@ -529,7 +511,6 @@ func TestAdditionalDisputeGames(t *testing.T) { intent.Chains[0].AdditionalDisputeGames = []state.AdditionalDisputeGame{ { ChainProofParams: state.ChainProofParams{ - DisputeGameUsesSuperRoots: false, DisputeGameType: 255, DisputeAbsolutePrestate: standard.DisputeAbsolutePrestate, DisputeMaxGameDepth: 50, diff --git a/op-deployer/pkg/deployer/opcm/implementations.go b/op-deployer/pkg/deployer/opcm/implementations.go index 917754cbd5620..6480d51e99e77 100644 --- a/op-deployer/pkg/deployer/opcm/implementations.go +++ b/op-deployer/pkg/deployer/opcm/implementations.go @@ -81,9 +81,6 @@ func DeployImplementations( defer cleanupOutput() implContract := "DeployImplementations" - if input.UseInterop { - implContract = "DeployImplementationsInterop" - } deployScript, cleanupDeploy, err := script.WithScript[DeployImplementationsScript](host, "DeployImplementations.s.sol", implContract) if err != nil { return output, fmt.Errorf("failed to load %s script: %w", implContract, err) @@ -97,9 +94,6 @@ func DeployImplementations( // So we can see in detail where the SystemConfig interop initializer fails sysConfig := "SystemConfig" - if input.UseInterop { - sysConfig = "SystemConfigInterop" - } if err := host.RememberOnLabel("SystemConfigImpl", sysConfig+".sol", sysConfig); err != nil { return output, fmt.Errorf("failed to link SystemConfig label: %w", err) } diff --git a/op-deployer/pkg/deployer/opcm/manage_dependencies.go b/op-deployer/pkg/deployer/opcm/manage_dependencies.go deleted file mode 100644 index 2a05de55f3e12..0000000000000 --- a/op-deployer/pkg/deployer/opcm/manage_dependencies.go +++ /dev/null @@ -1,21 +0,0 @@ -package opcm - -import ( - "math/big" - - "github.com/ethereum-optimism/optimism/op-chain-ops/script" - "github.com/ethereum/go-ethereum/common" -) - -type ManageDependenciesInput struct { - ChainId *big.Int - SystemConfig common.Address - Remove bool -} - -func ManageDependencies( - host *script.Host, - input ManageDependenciesInput, -) error { - return RunScriptVoid[ManageDependenciesInput](host, input, "ManageDependencies.s.sol", "ManageDependencies") -} diff --git a/op-deployer/pkg/deployer/opcm/opchain.go b/op-deployer/pkg/deployer/opcm/opchain.go index 813b7435170ad..9d87fb4979a4e 100644 --- a/op-deployer/pkg/deployer/opcm/opchain.go +++ b/op-deployer/pkg/deployer/opcm/opchain.go @@ -33,7 +33,6 @@ type DeployOPChainInput struct { SaltMixer string GasLimit uint64 - DisputeGameUsesSuperRoots bool DisputeGameType uint32 DisputeAbsolutePrestate common.Hash DisputeMaxGameDepth uint64 diff --git a/op-deployer/pkg/deployer/pipeline/opchain.go b/op-deployer/pkg/deployer/pipeline/opchain.go index 3007aaa1f47fe..fd6c647667887 100644 --- a/op-deployer/pkg/deployer/pipeline/opchain.go +++ b/op-deployer/pkg/deployer/pipeline/opchain.go @@ -74,13 +74,12 @@ func DeployOPChain(env *Env, intent *state.Intent, st *state.State, chainID comm func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common.Hash, st *state.State) (opcm.DeployOPChainInput, error) { proofParams, err := jsonutil.MergeJSON( state.ChainProofParams{ - DisputeGameUsesSuperRoots: standard.DisputeGameUsesSuperRoots, - DisputeGameType: standard.DisputeGameType, - DisputeAbsolutePrestate: standard.DisputeAbsolutePrestate, - DisputeMaxGameDepth: standard.DisputeMaxGameDepth, - DisputeSplitDepth: standard.DisputeSplitDepth, - DisputeClockExtension: standard.DisputeClockExtension, - DisputeMaxClockDuration: standard.DisputeMaxClockDuration, + DisputeGameType: standard.DisputeGameType, + DisputeAbsolutePrestate: standard.DisputeAbsolutePrestate, + DisputeMaxGameDepth: standard.DisputeMaxGameDepth, + DisputeSplitDepth: standard.DisputeSplitDepth, + DisputeClockExtension: standard.DisputeClockExtension, + DisputeMaxClockDuration: standard.DisputeMaxClockDuration, }, intent.GlobalDeployOverrides, thisIntent.DeployOverrides, @@ -102,7 +101,6 @@ func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common Opcm: st.ImplementationsDeployment.OpcmAddress, SaltMixer: st.Create2Salt.String(), // passing through salt generated at state initialization GasLimit: standard.GasLimit, - DisputeGameUsesSuperRoots: proofParams.DisputeGameUsesSuperRoots, DisputeGameType: proofParams.DisputeGameType, DisputeAbsolutePrestate: proofParams.DisputeAbsolutePrestate, DisputeMaxGameDepth: proofParams.DisputeMaxGameDepth, diff --git a/op-deployer/pkg/deployer/standard/standard.go b/op-deployer/pkg/deployer/standard/standard.go index 72f65d5d2aef1..e9ba7d8d45540 100644 --- a/op-deployer/pkg/deployer/standard/standard.go +++ b/op-deployer/pkg/deployer/standard/standard.go @@ -26,7 +26,6 @@ const ( ProofMaturityDelaySeconds uint64 = 604800 DisputeGameFinalityDelaySeconds uint64 = 302400 MIPSVersion uint64 = 1 - DisputeGameUsesSuperRoots bool = false DisputeGameType uint32 = 1 // PERMISSIONED game type DisputeMaxGameDepth uint64 = 73 DisputeSplitDepth uint64 = 30 diff --git a/op-deployer/pkg/deployer/state/chain_intent.go b/op-deployer/pkg/deployer/state/chain_intent.go index b53a8d0a8bc1e..f374466ea41ca 100644 --- a/op-deployer/pkg/deployer/state/chain_intent.go +++ b/op-deployer/pkg/deployer/state/chain_intent.go @@ -17,7 +17,6 @@ const ( ) type ChainProofParams struct { - DisputeGameUsesSuperRoots bool `json:"disputeGameUsesSuperRoots" toml:"disputeGameUsesSuperRoots"` DisputeGameType uint32 `json:"respectedGameType" toml:"respectedGameType"` DisputeAbsolutePrestate common.Hash `json:"faultGameAbsolutePrestate" toml:"faultGameAbsolutePrestate"` DisputeMaxGameDepth uint64 `json:"faultGameMaxDepth" toml:"faultGameMaxDepth"` diff --git a/op-deployer/pkg/deployer/upgrade/v2_0_0/upgrade_test.go b/op-deployer/pkg/deployer/upgrade/v2_0_0/upgrade_test.go index b025855751b11..95585401b1182 100644 --- a/op-deployer/pkg/deployer/upgrade/v2_0_0/upgrade_test.go +++ b/op-deployer/pkg/deployer/upgrade/v2_0_0/upgrade_test.go @@ -21,7 +21,6 @@ import ( ) func TestUpgradeOPChainInput_OpChainConfigs(t *testing.T) { - t.Skip("skipping for upgrade 15") input := &UpgradeOPChainInput{ Prank: common.Address{0xaa}, Opcm: common.Address{0xbb}, @@ -55,7 +54,6 @@ func TestUpgradeOPChainInput_OpChainConfigs(t *testing.T) { } func TestUpgrader_Upgrade(t *testing.T) { - t.Skip("skipping for upgrade 15") lgr := testlog.Logger(t, slog.LevelDebug) forkedL1, stopL1, err := devnet.NewForkedSepolia(lgr) diff --git a/op-e2e/config/init.go b/op-e2e/config/init.go index 74c54093a2e0d..b13a60023426d 100644 --- a/op-e2e/config/init.go +++ b/op-e2e/config/init.go @@ -436,13 +436,12 @@ func defaultIntent(root string, loc *artifacts.Locator, deployer common.Address, { ChainProofParams: state.ChainProofParams{ // Fast game - DisputeGameUsesSuperRoots: false, - DisputeGameType: 254, - DisputeAbsolutePrestate: defaultPrestate, - DisputeMaxGameDepth: 14 + 3 + 1, - DisputeSplitDepth: 14, - DisputeClockExtension: 0, - DisputeMaxClockDuration: 0, + DisputeGameType: 254, + DisputeAbsolutePrestate: defaultPrestate, + DisputeMaxGameDepth: 14 + 3 + 1, + DisputeSplitDepth: 14, + DisputeClockExtension: 0, + DisputeMaxClockDuration: 0, }, VMType: state.VMTypeAlphabet, UseCustomOracle: true, @@ -453,25 +452,23 @@ func defaultIntent(root string, loc *artifacts.Locator, deployer common.Address, { ChainProofParams: state.ChainProofParams{ // Alphabet game - DisputeGameUsesSuperRoots: false, - DisputeGameType: 255, - DisputeAbsolutePrestate: defaultPrestate, - DisputeMaxGameDepth: 14 + 3 + 1, - DisputeSplitDepth: 14, - DisputeClockExtension: 0, - DisputeMaxClockDuration: 1200, + DisputeGameType: 255, + DisputeAbsolutePrestate: defaultPrestate, + DisputeMaxGameDepth: 14 + 3 + 1, + DisputeSplitDepth: 14, + DisputeClockExtension: 0, + DisputeMaxClockDuration: 1200, }, VMType: state.VMTypeAlphabet, }, { ChainProofParams: state.ChainProofParams{ - DisputeGameUsesSuperRoots: false, - DisputeGameType: 0, - DisputeAbsolutePrestate: cannonPrestate(root, allocType), - DisputeMaxGameDepth: 50, - DisputeSplitDepth: 14, - DisputeClockExtension: 0, - DisputeMaxClockDuration: 1200, + DisputeGameType: 0, + DisputeAbsolutePrestate: cannonPrestate(root, allocType), + DisputeMaxGameDepth: 50, + DisputeSplitDepth: 14, + DisputeClockExtension: 0, + DisputeMaxClockDuration: 1200, }, VMType: cannonVMType(allocType), }, diff --git a/op-e2e/interop/interop_test.go b/op-e2e/interop/interop_test.go index b4a5ba08c9412..f2f9760a407c0 100644 --- a/op-e2e/interop/interop_test.go +++ b/op-e2e/interop/interop_test.go @@ -144,10 +144,19 @@ func TestInterop_EmitLogs(t *testing.T) { ids := s2.L2IDs() chainA := ids[0] chainB := ids[1] - EmitterA := s2.DeployEmitterContract(chainA, "Alice") - EmitterB := s2.DeployEmitterContract(chainB, "Alice") payload1 := "SUPER JACKPOT!" numEmits := 10 + + // Deploy emitter to chain A + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + EmitterA := s2.DeployEmitterContract(ctx, chainA, "Alice") + + // Deploy emitter to chain B + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + EmitterB := s2.DeployEmitterContract(ctx, chainB, "Alice") + // emit logs on both chains in parallel var emitParallel sync.WaitGroup emitOn := func(chainID string) { @@ -258,26 +267,14 @@ func TestInteropBlockBuilding(t *testing.T) { ids := s2.L2IDs() chainA := ids[0] chainB := ids[1] - // We will initiate on chain A, and execute on chain B - s2.DeployEmitterContract(chainA, "Alice") - // Add chain A as dependency to chain B, - // such that we can execute a message on B that was initiated on A. + // We will initiate on chain A, and execute on chain B ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - depRec := s2.AddDependency(ctx, chainB, s2.ChainID(chainA)) - cancel() - t.Logf("Dependency set in L1 block %d", depRec.BlockNumber) + defer cancel() + s2.DeployEmitterContract(ctx, chainA, "Alice") rollupClA := s2.L2RollupClient(chainA, "sequencer") - // Now wait for the dependency to be visible in the L2 (receipt needs to be picked up) - require.Eventually(t, func() bool { - status, err := rollupClA.SyncStatus(context.Background()) - require.NoError(t, err) - return status.CrossUnsafeL2.L1Origin.Number >= depRec.BlockNumber.Uint64() - }, time.Second*30, time.Second, "wait for L1 origin to match dependency L1 block") - t.Log("Dependency information has been processed in L2 block") - // emit log on chain A ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) emitRec := s2.EmitData(ctx, chainA, "sequencer", "Alice", "hello world") diff --git a/op-e2e/interop/supersystem.go b/op-e2e/interop/supersystem.go index 1da8484bf1ecb..163829da5516b 100644 --- a/op-e2e/interop/supersystem.go +++ b/op-e2e/interop/supersystem.go @@ -35,7 +35,6 @@ import ( "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/interop/contracts/bindings/emit" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/interop/contracts/bindings/inbox" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/interop/contracts/bindings/systemconfig" - "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait" "github.com/ethereum-optimism/optimism/op-e2e/system/helpers" l2os "github.com/ethereum-optimism/optimism/op-proposer/proposer" "github.com/ethereum-optimism/optimism/op-service/client" @@ -94,8 +93,7 @@ type SuperSystem interface { L2OperatorKey(network string, role devkeys.ChainOperatorRole) ecdsa.PrivateKey Address(network string, username string) common.Address Contract(network string, contractName string) interface{} - DeployEmitterContract(network string, username string) common.Address - AddDependency(ctx context.Context, network string, dep *big.Int) *types.Receipt + DeployEmitterContract(ctx context.Context, network string, username string) common.Address ValidateMessage( ctx context.Context, id string, @@ -539,37 +537,10 @@ func (s *interopE2ESystem) ValidateMessage( return bind.WaitMined(ctx, s.L2GethClient(id, "sequencer"), tx) // use the sequencer client to wait for the tx } -func (s *interopE2ESystem) AddDependency(ctx context.Context, id string, dep *big.Int) *types.Receipt { - // There is a note in OPContractsManagerInterop that the proxy-admin is used for now, - // even though it should be a separate dependency-set-manager address. - secret, err := s.hdWallet.Secret(devkeys.ChainOperatorKey{ - ChainID: s.l2s[id].chainID, - Role: devkeys.SystemConfigOwner, - }) - require.NoError(s.t, err) - - auth, err := bind.NewKeyedTransactorWithChainID(secret, s.worldOutput.L1.Genesis.Config.ChainID) - require.NoError(s.t, err) - - balance, err := s.l1GethClient.BalanceAt(ctx, crypto.PubkeyToAddress(secret.PublicKey), nil) - require.NoError(s.t, err) - require.False(s.t, balance.Sign() == 0, "system config owner needs a balance") - - auth.GasLimit = uint64(3000000) - auth.GasPrice = big.NewInt(20000000000) - - contract := s.Contract(id, "systemconfig").(*systemconfig.Systemconfig) - tx, err := contract.SystemconfigTransactor.AddDependency(auth, dep) - require.NoError(s.t, err) - - receipt, err := wait.ForReceiptOK(ctx, s.L1GethClient(), tx.Hash()) - require.NoError(s.t, err) - return receipt -} - // DeployEmitterContract deploys the Emitter contract on the L2 // it uses the sequencer node to deploy the contract func (s *interopE2ESystem) DeployEmitterContract( + ctx context.Context, id string, sender string, ) common.Address { @@ -578,7 +549,9 @@ func (s *interopE2ESystem) DeployEmitterContract( require.NoError(s.t, err) auth.GasLimit = uint64(3000000) auth.GasPrice = big.NewInt(20000000000) - address, _, _, err := emit.DeployEmit(auth, s.L2GethClient(id, "sequencer")) + address, tx, _, err := emit.DeployEmit(auth, s.L2GethClient(id, "sequencer")) + require.NoError(s.t, err) + _, err = bind.WaitMined(ctx, s.L2GethClient(id, "sequencer"), tx) require.NoError(s.t, err) contract, err := emit.NewEmit(address, s.L2GethClient(id, "sequencer")) require.NoError(s.t, err) diff --git a/packages/contracts-bedrock/foundry.toml b/packages/contracts-bedrock/foundry.toml index e256ab97e995d..5724df0f58c4f 100644 --- a/packages/contracts-bedrock/foundry.toml +++ b/packages/contracts-bedrock/foundry.toml @@ -31,7 +31,6 @@ compilation_restrictions = [ { paths = "src/L1/OPContractsManagerInterop.sol", optimizer_runs = 5000 }, { paths = "src/L1/StandardValidator.sol", optimizer_runs = 5000 }, { paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 5000 }, - { paths = "src/L1/OptimismPortalInterop.sol", optimizer_runs = 5000 }, ] extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout'] @@ -148,7 +147,6 @@ compilation_restrictions = [ { paths = "src/L1/OPContractsManagerInterop.sol", optimizer_runs = 0 }, { paths = "src/L1/StandardValidator.sol", optimizer_runs = 0 }, { paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 0 }, - { paths = "src/L1/OptimismPortalInterop.sol", optimizer_runs = 0 }, ] ################################################################ diff --git a/packages/contracts-bedrock/interfaces/L1/IETHLockbox.sol b/packages/contracts-bedrock/interfaces/L1/IETHLockbox.sol index 5d4abd72c79f5..c69ca0bb98316 100644 --- a/packages/contracts-bedrock/interfaces/L1/IETHLockbox.sol +++ b/packages/contracts-bedrock/interfaces/L1/IETHLockbox.sol @@ -12,6 +12,7 @@ interface IETHLockbox is IProxyAdminOwnedBase, ISemver { error ETHLockbox_InsufficientBalance(); error ETHLockbox_NoWithdrawalTransactions(); error ETHLockbox_DifferentProxyAdminOwner(); + error ETHLockbox_DifferentSuperchainConfig(); event Initialized(uint8 version); event ETHLocked(address indexed portal, uint256 amount); diff --git a/packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol b/packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol index d2f83d685d99e..09821208687ac 100644 --- a/packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol +++ b/packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol @@ -108,7 +108,6 @@ interface IOPContractsManager { string saltMixer; uint64 gasLimit; // Configurable dispute game parameters. - bool disputeGameUsesSuperRoots; GameType disputeGameType; Claim disputeAbsolutePrestate; uint256 disputeMaxGameDepth; @@ -176,7 +175,6 @@ interface IOPContractsManager { ISystemConfig systemConfigProxy; IProxyAdmin proxyAdmin; Claim absolutePrestate; - bool disputeGameUsesSuperRoots; } struct AddGameInput { diff --git a/packages/contracts-bedrock/interfaces/L1/IOPContractsManagerLegacyUpgrade.sol b/packages/contracts-bedrock/interfaces/L1/IOPContractsManagerLegacyUpgrade.sol deleted file mode 100644 index 057139005a96a..0000000000000 --- a/packages/contracts-bedrock/interfaces/L1/IOPContractsManagerLegacyUpgrade.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol"; -import { IProxyAdmin } from "interfaces/universal/IProxyAdmin.sol"; -import { Claim } from "src/dispute/lib/Types.sol"; - -/// @title IOPContractsManagerLegacyUpgrade -/// @notice Interface for the legacy OPContractsManager upgrade function. -/// This interface is used to test Upgrade 13 and 14 paths and can be safely removed -/// after those upgrades are completed. Only difference in the new struct is the added -/// disputeGameUsesSuperRoots boolean. -interface IOPContractsManagerLegacyUpgrade { - struct OpChainConfig { - ISystemConfig systemConfigProxy; - IProxyAdmin proxyAdmin; - Claim absolutePrestate; - } - - function upgrade(OpChainConfig[] memory _opChainConfigs) external; -} diff --git a/packages/contracts-bedrock/interfaces/L1/IOptimismPortal2.sol b/packages/contracts-bedrock/interfaces/L1/IOptimismPortal2.sol index f9cfc5325436c..673b3c778f85a 100644 --- a/packages/contracts-bedrock/interfaces/L1/IOptimismPortal2.sol +++ b/packages/contracts-bedrock/interfaces/L1/IOptimismPortal2.sol @@ -37,6 +37,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase { error OptimismPortal_InvalidSuperRootProof(); error OptimismPortal_InvalidOutputRootChainId(); error OptimismPortal_WrongProofMethod(); + error OptimismPortal_MigratingToSameRegistry(); error Encoding_EmptySuperRoot(); error Encoding_InvalidSuperRootVersion(); error OutOfGas(); @@ -49,7 +50,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase { event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to); event WithdrawalProvenExtension1(bytes32 indexed withdrawalHash, address indexed proofSubmitter); event ETHMigrated(address indexed lockbox, uint256 ethBalance); - event LockboxUpdated(address oldLockbox, address newLockbox); + event PortalMigrated(IETHLockbox oldLockbox, IETHLockbox newLockbox, IAnchorStateRegistry oldAnchorStateRegistry, IAnchorStateRegistry newAnchorStateRegistry); receive() external payable; @@ -68,7 +69,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase { function disputeGameFactory() external view returns (IDisputeGameFactory); function disputeGameFinalityDelaySeconds() external view returns (uint256); function donateETH() external payable; - function updateLockbox(IETHLockbox _newLockbox) external; + function migrateToSuperRoots(IETHLockbox _newLockbox, IAnchorStateRegistry _newAnchorStateRegistry) external; function finalizeWithdrawalTransaction(Types.WithdrawalTransaction memory _tx) external; function finalizeWithdrawalTransactionExternalProof( Types.WithdrawalTransaction memory _tx, @@ -81,8 +82,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase { ISystemConfig _systemConfig, ISuperchainConfig _superchainConfig, IAnchorStateRegistry _anchorStateRegistry, - IETHLockbox _ethLockbox, - bool _superRootsActive + IETHLockbox _ethLockbox ) external; function initVersion() external view returns (uint8); @@ -123,8 +123,7 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase { function systemConfig() external view returns (ISystemConfig); function upgrade( IAnchorStateRegistry _anchorStateRegistry, - IETHLockbox _ethLockbox, - bool _superRootsActive + IETHLockbox _ethLockbox ) external; function version() external pure returns (string memory); diff --git a/packages/contracts-bedrock/interfaces/L1/IOptimismPortalInterop.sol b/packages/contracts-bedrock/interfaces/L1/IOptimismPortalInterop.sol deleted file mode 100644 index 7cd674a0c1835..0000000000000 --- a/packages/contracts-bedrock/interfaces/L1/IOptimismPortalInterop.sol +++ /dev/null @@ -1,136 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import { Types } from "src/libraries/Types.sol"; -import { GameType } from "src/dispute/lib/LibUDT.sol"; -import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; -import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol"; -import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol"; -import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol"; -import { ConfigType } from "interfaces/L2/IL1BlockInterop.sol"; -import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; -import { IETHLockbox } from "interfaces/L1/IETHLockbox.sol"; -import { IProxyAdminOwnedBase } from "interfaces/L1/IProxyAdminOwnedBase.sol"; - -interface IOptimismPortalInterop is IProxyAdminOwnedBase { - error ContentLengthMismatch(); - error EmptyItem(); - error InvalidDataRemainder(); - error InvalidHeader(); - error ReinitializableBase_ZeroInitVersion(); - error OptimismPortal_AlreadyFinalized(); - error OptimismPortal_BadTarget(); - error OptimismPortal_CallPaused(); - error OptimismPortal_CalldataTooLarge(); - error OptimismPortal_GasEstimation(); - error OptimismPortal_GasLimitTooLow(); - error OptimismPortal_ImproperDisputeGame(); - error OptimismPortal_InvalidDisputeGame(); - error OptimismPortal_InvalidMerkleProof(); - error OptimismPortal_InvalidOutputRootProof(); - error OptimismPortal_InvalidProofTimestamp(); - error OptimismPortal_InvalidRootClaim(); - error OptimismPortal_NoReentrancy(); - error OptimismPortal_ProofNotOldEnough(); - error OptimismPortal_Unauthorized(); - error OptimismPortal_Unproven(); - error OptimismPortal_InvalidOutputRootIndex(); - error OptimismPortal_InvalidSuperRootProof(); - error OptimismPortal_InvalidOutputRootChainId(); - error OptimismPortal_WrongProofMethod(); - error Encoding_EmptySuperRoot(); - error Encoding_InvalidSuperRootVersion(); - error OutOfGas(); - error UnexpectedList(); - error UnexpectedString(); - - event Initialized(uint8 version); - event TransactionDeposited(address indexed from, address indexed to, uint256 indexed version, bytes opaqueData); - event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success); - event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to); - event WithdrawalProvenExtension1(bytes32 indexed withdrawalHash, address indexed proofSubmitter); - event ETHMigrated(address indexed lockbox, uint256 ethBalance); - event LockboxUpdated(address oldLockbox, address newLockbox); - - receive() external payable; - - function anchorStateRegistry() external view returns (IAnchorStateRegistry); - function ethLockbox() external view returns (IETHLockbox); - function checkWithdrawal(bytes32 _withdrawalHash, address _proofSubmitter) external view; - function depositTransaction( - address _to, - uint256 _value, - uint64 _gasLimit, - bool _isCreation, - bytes memory _data - ) - external - payable; - function disputeGameFactory() external view returns (IDisputeGameFactory); - function disputeGameFinalityDelaySeconds() external view returns (uint256); - function donateETH() external payable; - function updateLockbox(IETHLockbox _newLockbox) external; - function finalizeWithdrawalTransaction(Types.WithdrawalTransaction memory _tx) external; - function finalizeWithdrawalTransactionExternalProof( - Types.WithdrawalTransaction memory _tx, - address _proofSubmitter - ) - external; - function migrateLiquidity() external; - function finalizedWithdrawals(bytes32) external view returns (bool); - function guardian() external view returns (address); - function initialize( - ISystemConfig _systemConfig, - ISuperchainConfig _superchainConfig, - IAnchorStateRegistry _anchorStateRegistry, - IETHLockbox _ethLockbox, - bool _superRootsActive - ) - external; - function initVersion() external view returns (uint8); - function l2Sender() external view returns (address); - function minimumGasLimit(uint64 _byteCount) external pure returns (uint64); - function numProofSubmitters(bytes32 _withdrawalHash) external view returns (uint256); - function params() external view returns (uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum); // nosemgrep - function paused() external view returns (bool); - function proofMaturityDelaySeconds() external view returns (uint256); - function proofSubmitters(bytes32, uint256) external view returns (address); - function proveWithdrawalTransaction( - Types.WithdrawalTransaction memory _tx, - uint256 _disputeGameIndex, - Types.OutputRootProof memory _outputRootProof, - bytes[] memory _withdrawalProof - ) - external; - function proveWithdrawalTransaction( - Types.WithdrawalTransaction memory _tx, - IDisputeGame _disputeGameProxy, - uint256 _outputRootIndex, - Types.SuperRootProof memory _superRootProof, - Types.OutputRootProof memory _outputRootProof, - bytes[] memory _withdrawalProof - ) - external; - function provenWithdrawals( - bytes32, - address - ) - external - view - returns (IDisputeGame disputeGameProxy, uint64 timestamp); // nosemgrep - function respectedGameType() external view returns (GameType); - function respectedGameTypeUpdatedAt() external view returns (uint64); - function setConfig(ConfigType _type, bytes memory _value) external; - function superchainConfig() external view returns (ISuperchainConfig); - function superRootsActive() external view returns (bool); - function systemConfig() external view returns (ISystemConfig); - function upgrade( - IAnchorStateRegistry _anchorStateRegistry, - IETHLockbox _ethLockbox, - bool _superRootsActive - ) - external; - function version() external pure returns (string memory); - - function __constructor__(uint256 _proofMaturityDelaySeconds) external; -} diff --git a/packages/contracts-bedrock/interfaces/L1/ISystemConfigInterop.sol b/packages/contracts-bedrock/interfaces/L1/ISystemConfigInterop.sol deleted file mode 100644 index 6842e0f701392..0000000000000 --- a/packages/contracts-bedrock/interfaces/L1/ISystemConfigInterop.sol +++ /dev/null @@ -1,79 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol"; -import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol"; - -interface ISystemConfigInterop { - error ReinitializableBase_ZeroInitVersion(); - - event ConfigUpdate(uint256 indexed version, ISystemConfig.UpdateType indexed updateType, bytes data); - event Initialized(uint8 version); - event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); - - function BATCH_INBOX_SLOT() external view returns (bytes32); - function DISPUTE_GAME_FACTORY_SLOT() external view returns (bytes32); - function L1_CROSS_DOMAIN_MESSENGER_SLOT() external view returns (bytes32); - function L1_ERC_721_BRIDGE_SLOT() external view returns (bytes32); - function L1_STANDARD_BRIDGE_SLOT() external view returns (bytes32); - function OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT() external view returns (bytes32); - function OPTIMISM_PORTAL_SLOT() external view returns (bytes32); - function START_BLOCK_SLOT() external view returns (bytes32); - function UNSAFE_BLOCK_SIGNER_SLOT() external view returns (bytes32); - function VERSION() external view returns (uint256); - function basefeeScalar() external view returns (uint32); - function batchInbox() external view returns (address addr_); - function batcherHash() external view returns (bytes32); - function blobbasefeeScalar() external view returns (uint32); - function disputeGameFactory() external view returns (address addr_); - function gasLimit() external view returns (uint64); - function eip1559Denominator() external view returns (uint32); - function eip1559Elasticity() external view returns (uint32); - function l1CrossDomainMessenger() external view returns (address addr_); - function l1ERC721Bridge() external view returns (address addr_); - function l1StandardBridge() external view returns (address addr_); - function l2ChainId() external view returns (uint256); - function maximumGasLimit() external pure returns (uint64); - function minimumGasLimit() external view returns (uint64); - function operatorFeeConstant() external view returns (uint64); - function operatorFeeScalar() external view returns (uint32); - function optimismMintableERC20Factory() external view returns (address addr_); - function optimismPortal() external view returns (address addr_); - function overhead() external view returns (uint256); - function owner() external view returns (address); - function renounceOwnership() external; - function resourceConfig() external view returns (IResourceMetering.ResourceConfig memory); - function scalar() external view returns (uint256); - function setBatcherHash(bytes32 _batcherHash) external; - function setGasConfig(uint256 _overhead, uint256 _scalar) external; - function setGasConfigEcotone(uint32 _basefeeScalar, uint32 _blobbasefeeScalar) external; - function setGasLimit(uint64 _gasLimit) external; - function setUnsafeBlockSigner(address _unsafeBlockSigner) external; - function setEIP1559Params(uint32 _denominator, uint32 _elasticity) external; - function setOperatorFeeScalars(uint32 _operatorFeeScalar, uint64 _operatorFeeConstant) external; - function startBlock() external view returns (uint256 startBlock_); - function transferOwnership(address newOwner) external; // nosemgrep - function unsafeBlockSigner() external view returns (address addr_); - - function addDependency(uint256 _chainId) external; - function removeDependency(uint256 _chainId) external; - function dependencyManager() external view returns (address); - function initialize( - address _owner, - uint32 _basefeeScalar, - uint32 _blobbasefeeScalar, - bytes32 _batcherHash, - uint64 _gasLimit, - address _unsafeBlockSigner, - IResourceMetering.ResourceConfig memory _config, - address _batchInbox, - ISystemConfig.Addresses memory _addresses, - address _dependencyManager, - uint256 _l2ChainId - ) - external; - function initVersion() external view returns (uint8); - function version() external pure returns (string memory); - - function __constructor__() external; -} diff --git a/packages/contracts-bedrock/scripts/checks/check-frozen-files.sh b/packages/contracts-bedrock/scripts/checks/check-frozen-files.sh index 435cd301a35ce..a6c194de05ae1 100755 --- a/packages/contracts-bedrock/scripts/checks/check-frozen-files.sh +++ b/packages/contracts-bedrock/scripts/checks/check-frozen-files.sh @@ -57,11 +57,9 @@ ALLOWED_FILES=( "src/L1/OPContractsManagerInterop.sol:OPContractsManagerInterop" "src/L1/OPPrestateUpdater.sol:OPPrestateUpdater" "src/L1/OptimismPortal2.sol:OptimismPortal2" - "src/L1/OptimismPortalInterop.sol:OptimismPortalInterop" "src/L1/ProtocolVersions.sol:ProtocolVersions" "src/L1/SuperchainConfig.sol:SuperchainConfig" "src/L1/SystemConfig.sol:SystemConfig" - "src/L1/SystemConfigInterop.sol:SystemConfigInterop" "src/L2/BaseFeeVault.sol:BaseFeeVault" "src/L2/CrossL2Inbox.sol:CrossL2Inbox" "src/L2/ETHLiquidity.sol:ETHLiquidity" diff --git a/packages/contracts-bedrock/scripts/checks/interfaces/main.go b/packages/contracts-bedrock/scripts/checks/interfaces/main.go index 0ecc45e19034b..276b5526c6328 100644 --- a/packages/contracts-bedrock/scripts/checks/interfaces/main.go +++ b/packages/contracts-bedrock/scripts/checks/interfaces/main.go @@ -26,12 +26,9 @@ var excludeContracts = []string{ // EAS "IEAS", "ISchemaResolver", "ISchemaRegistry", - // Misc stuff that can be ignored - "IOPContractsManagerLegacyUpgrade", - // TODO: Interfaces that need to be fixed "IInitializable", "IOptimismMintableERC20", "ILegacyMintableERC20", - "KontrolCheatsBase", "ISystemConfigInterop", "IResolvedDelegateProxy", + "KontrolCheatsBase", "IResolvedDelegateProxy", } type ContractDefinition struct { diff --git a/packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol b/packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol index a8457150ec48b..92972355fa4d6 100644 --- a/packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol +++ b/packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol @@ -7,7 +7,6 @@ import { console2 as console } from "forge-std/console2.sol"; // Scripts import { DeployConfig } from "scripts/deploy/DeployConfig.s.sol"; -import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol"; import { DeployUtils } from "scripts/libraries/DeployUtils.sol"; // Libraries @@ -123,32 +122,6 @@ library ChainAssertions { } } - /// @notice Asserts that the SystemConfigInterop is setup correctly - function checkSystemConfigInterop( - Types.ContractSet memory _contracts, - DeployConfig _cfg, - bool _isProxy - ) - internal - view - { - ISystemConfigInterop config = ISystemConfigInterop(_contracts.SystemConfig); - console.log( - "Running chain assertions on the SystemConfigInterop %s at %s", - _isProxy ? "proxy" : "implementation", - address(config) - ); - - checkSystemConfig(_contracts, _cfg, _isProxy); - if (_isProxy) { - // TODO: this is not being set in the deployment, nor is a config value. - // Update this when it has an entry in hardhat.json - require(config.dependencyManager() == address(0), "CHECK-SCFGI-10"); - } else { - require(config.dependencyManager() == address(0), "CHECK-SCFGI-20"); - } - } - /// @notice Asserts that the L1CrossDomainMessenger is setup correctly function checkL1CrossDomainMessenger(Types.ContractSet memory _contracts, Vm _vm, bool _isProxy) internal view { IL1CrossDomainMessenger messenger = IL1CrossDomainMessenger(_contracts.L1CrossDomainMessenger); diff --git a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol index 1a353f2f063f4..10f11cc959451 100644 --- a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol @@ -20,7 +20,6 @@ import { DeploySuperchainInput, DeploySuperchain, DeploySuperchainOutput } from import { DeployImplementationsInput, DeployImplementations, - DeployImplementationsInterop, DeployImplementationsOutput } from "scripts/deploy/DeployImplementations.s.sol"; @@ -297,9 +296,6 @@ contract Deploy is Deployer { // I think this was a bug dii.set(dii.upgradeController.selector, superchainProxyAdmin.owner()); - if (_isInterop) { - di = DeployImplementations(new DeployImplementationsInterop()); - } di.run(dii, dio); // Save the implementation addresses which are needed outside of this function or script. @@ -349,11 +345,7 @@ contract Deploy is Deployer { _mips: IMIPS(address(dio.mipsSingleton())), _superchainProxyAdmin: superchainProxyAdmin }); - if (_isInterop) { - ChainAssertions.checkSystemConfigInterop({ _contracts: impls, _cfg: cfg, _isProxy: false }); - } else { - ChainAssertions.checkSystemConfig({ _contracts: impls, _cfg: cfg, _isProxy: false }); - } + ChainAssertions.checkSystemConfig({ _contracts: impls, _cfg: cfg, _isProxy: false }); } /// @notice Deploy all of the OP Chain specific contracts @@ -969,7 +961,6 @@ contract Deploy is Deployer { ), saltMixer: saltMixer, gasLimit: uint64(cfg.l2GenesisBlockGasLimit()), - disputeGameUsesSuperRoots: false, disputeGameType: GameTypes.PERMISSIONED_CANNON, disputeAbsolutePrestate: Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate())), disputeMaxGameDepth: cfg.faultGameMaxDepth(), diff --git a/packages/contracts-bedrock/scripts/deploy/DeployImplementations.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployImplementations.s.sol index 776803cb6df1f..2666ac296a8b1 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployImplementations.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployImplementations.s.sol @@ -31,8 +31,6 @@ import { IL1CrossDomainMessenger } from "interfaces/L1/IL1CrossDomainMessenger.s import { IL1ERC721Bridge } from "interfaces/L1/IL1ERC721Bridge.sol"; import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol"; import { IOptimismMintableERC20Factory } from "interfaces/universal/IOptimismMintableERC20Factory.sol"; -import { IOptimismPortalInterop } from "interfaces/L1/IOptimismPortalInterop.sol"; -import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol"; import { IProxyAdmin } from "interfaces/universal/IProxyAdmin.sol"; import { DeployUtils } from "scripts/libraries/DeployUtils.sol"; import { Solarray } from "scripts/libraries/Solarray.sol"; @@ -948,84 +946,3 @@ contract DeployImplementations is Script { dio_ = DeployImplementationsOutput(DeployUtils.toIOAddress(msg.sender, "optimism.DeployImplementationsOutput")); } } - -// Similar to how DeploySuperchain.s.sol contains a lot of comments to thoroughly document the script -// architecture, this comment block documents how to update the deploy scripts to support new features. -// -// Using the base scripts and contracts (DeploySuperchain, DeployImplementations, DeployOPChain, and -// the corresponding OPContractsManager) deploys a standard chain. For nonstandard and in-development -// features we need to modify some or all of those contracts, and we do that via inheritance. Using -// interop as an example, they've made the following changes to L1 contracts: -// - `OptimismPortalInterop is OptimismPortal`: A different portal implementation is used, and -// it's ABI is the same. -// - `SystemConfigInterop is SystemConfig`: A different system config implementation is used, and -// it's initializer has a different signature. This signature is different because there is a -// new input parameter, the `dependencyManager`. -// - Because of the different system config initializer, there is a new input parameter (dependencyManager). -// -// Similar to how inheritance was used to develop the new portal and system config contracts, we use -// inheritance to modify up to all of the deployer contracts. For this interop example, what this -// means is we need: -// - An `OPContractsManagerInterop is OPContractsManager` that knows how to encode the calldata for the -// new system config initializer. -// - A `DeployImplementationsInterop is DeployImplementations` that: -// - Deploys OptimismPortalInterop instead of OptimismPortal. -// - Deploys SystemConfigInterop instead of SystemConfig. -// - Deploys OPContractsManagerInterop instead of OPContractsManager, which contains the updated logic -// for encoding the SystemConfig initializer. -// - Updates the OPCM release setter logic to use the updated initializer. -// - A `DeployOPChainInterop is DeployOPChain` that allows the updated input parameter to be passed. -// -// Most of the complexity in the above flow comes from the the new input for the updated SystemConfig -// initializer. If all function signatures were the same, all we'd have to change is the contract -// implementations that are deployed then set in the OPCM. For now, to simplify things until we -// resolve https://github.com/ethereum-optimism/optimism/issues/11783, we just assume this new role -// is the same as the proxy admin owner. -contract DeployImplementationsInterop is DeployImplementations { - function deployOPCMDeployer(DeployImplementationsOutput _dio) public override { - IOPContractsManagerDeployer impl = IOPContractsManagerDeployer( - DeployUtils.createDeterministic({ - _name: "OPContractsManager.sol:OPContractsManagerDeployerInterop", - _args: DeployUtils.encodeConstructor( - abi.encodeCall(IOPContractsManagerDeployer.__constructor__, (_dio.opcmContractsContainer())) - ), - _salt: _salt - }) - ); - vm.label(address(impl), "OPContractsManagerDeployerImpl"); - _dio.set(_dio.opcmDeployer.selector, address(impl)); - } - - function deployOptimismPortalImpl( - DeployImplementationsInput _dii, - DeployImplementationsOutput _dio - ) - public - override - { - uint256 proofMaturityDelaySeconds = _dii.proofMaturityDelaySeconds(); - IOptimismPortalInterop impl = IOptimismPortalInterop( - DeployUtils.createDeterministic({ - _name: "OptimismPortalInterop", - _args: DeployUtils.encodeConstructor( - abi.encodeCall(IOptimismPortalInterop.__constructor__, (proofMaturityDelaySeconds)) - ), - _salt: _salt - }) - ); - vm.label(address(impl), "OptimismPortalImpl"); - _dio.set(_dio.optimismPortalImpl.selector, address(impl)); - } - - function deploySystemConfigImpl(DeployImplementationsOutput _dio) public override { - ISystemConfigInterop impl = ISystemConfigInterop( - DeployUtils.createDeterministic({ - _name: "SystemConfigInterop", - _args: DeployUtils.encodeConstructor(abi.encodeCall(ISystemConfigInterop.__constructor__, ())), - _salt: _salt - }) - ); - vm.label(address(impl), "SystemConfigImpl"); - _dio.set(_dio.systemConfigImpl.selector, address(impl)); - } -} diff --git a/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol index 2978582420a2d..b6f56428b420c 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol @@ -52,7 +52,6 @@ contract DeployOPChainInput is BaseDeployIO { uint64 internal _gasLimit; // Configurable dispute game inputs - bool internal _disputeGameUsesSuperRoots; GameType internal _disputeGameType; Claim internal _disputeAbsolutePrestate; uint256 internal _disputeMaxGameDepth; @@ -100,9 +99,6 @@ contract DeployOPChainInput is BaseDeployIO { _operatorFeeScalar = SafeCast.toUint32(_value); } else if (_sel == this.operatorFeeConstant.selector) { _operatorFeeConstant = SafeCast.toUint64(_value); - } else if (_sel == this.disputeGameUsesSuperRoots.selector) { - require(_value == 0 || _value == 1, "DeployOPChainInput: invalid disputeGameUsesSuperRoots"); - _disputeGameUsesSuperRoots = _value == 1; } else { revert("DeployOPChainInput: unknown selector"); } @@ -199,10 +195,6 @@ contract DeployOPChainInput is BaseDeployIO { return _gasLimit; } - function disputeGameUsesSuperRoots() public view returns (bool) { - return _disputeGameUsesSuperRoots; - } - function disputeGameType() public view returns (GameType) { return _disputeGameType; } @@ -388,7 +380,6 @@ contract DeployOPChain is Script { startingAnchorRoot: _doi.startingAnchorRoot(), saltMixer: _doi.saltMixer(), gasLimit: _doi.gasLimit(), - disputeGameUsesSuperRoots: _doi.disputeGameUsesSuperRoots(), disputeGameType: _doi.disputeGameType(), disputeAbsolutePrestate: _doi.disputeAbsolutePrestate(), disputeMaxGameDepth: _doi.disputeMaxGameDepth(), diff --git a/packages/contracts-bedrock/scripts/deploy/ManageDependencies.s.sol b/packages/contracts-bedrock/scripts/deploy/ManageDependencies.s.sol deleted file mode 100644 index 1e8bdc2a7c3b7..0000000000000 --- a/packages/contracts-bedrock/scripts/deploy/ManageDependencies.s.sol +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import { Script } from "forge-std/Script.sol"; -import { BaseDeployIO } from "scripts/deploy/BaseDeployIO.sol"; -import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol"; - -contract ManageDependenciesInput is BaseDeployIO { - uint256 internal _chainId; - ISystemConfigInterop _systemConfig; - bool internal _remove; - - // Setter for uint256 type - function set(bytes4 _sel, uint256 _value) public { - if (_sel == this.chainId.selector) _chainId = _value; - else revert("ManageDependenciesInput: unknown selector"); - } - - // Setter for address type - function set(bytes4 _sel, address _addr) public { - require(_addr != address(0), "ManageDependenciesInput: cannot set zero address"); - - if (_sel == this.systemConfig.selector) _systemConfig = ISystemConfigInterop(_addr); - else revert("ManageDependenciesInput: unknown selector"); - } - - // Setter for bool type - function set(bytes4 _sel, bool _value) public { - if (_sel == this.remove.selector) _remove = _value; - else revert("ManageDependenciesInput: unknown selector"); - } - - // Getters - function chainId() public view returns (uint256) { - require(_chainId > 0, "ManageDependenciesInput: not set"); - return _chainId; - } - - function systemConfig() public view returns (ISystemConfigInterop) { - require(address(_systemConfig) != address(0), "ManageDependenciesInput: not set"); - return _systemConfig; - } - - function remove() public view returns (bool) { - return _remove; - } -} - -contract ManageDependencies is Script { - function run(ManageDependenciesInput _input) public { - bool remove = _input.remove(); - uint256 chainId = _input.chainId(); - ISystemConfigInterop systemConfig = _input.systemConfig(); - - // Call the appropriate function based on the remove flag - vm.broadcast(msg.sender); - if (remove) { - systemConfig.removeDependency(chainId); - } else { - systemConfig.addDependency(chainId); - } - } -} diff --git a/packages/contracts-bedrock/snapshots/abi/ETHLockbox.json b/packages/contracts-bedrock/snapshots/abi/ETHLockbox.json index d0e9c8fb9a626..6d7c112cd48fc 100644 --- a/packages/contracts-bedrock/snapshots/abi/ETHLockbox.json +++ b/packages/contracts-bedrock/snapshots/abi/ETHLockbox.json @@ -298,6 +298,11 @@ "name": "ETHLockbox_DifferentProxyAdminOwner", "type": "error" }, + { + "inputs": [], + "name": "ETHLockbox_DifferentSuperchainConfig", + "type": "error" + }, { "inputs": [], "name": "ETHLockbox_InsufficientBalance", diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json index 381040d946efc..47e5d823e8c78 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json @@ -293,11 +293,6 @@ "name": "gasLimit", "type": "uint64" }, - { - "internalType": "bool", - "name": "disputeGameUsesSuperRoots", - "type": "bool" - }, { "internalType": "GameType", "name": "disputeGameType", @@ -637,11 +632,6 @@ "internalType": "Claim", "name": "absolutePrestate", "type": "bytes32" - }, - { - "internalType": "bool", - "name": "disputeGameUsesSuperRoots", - "type": "bool" } ], "internalType": "struct OPContractsManager.OpChainConfig[]", @@ -672,11 +662,6 @@ "internalType": "Claim", "name": "absolutePrestate", "type": "bytes32" - }, - { - "internalType": "bool", - "name": "disputeGameUsesSuperRoots", - "type": "bool" } ], "internalType": "struct OPContractsManager.OpChainConfig[]", diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployer.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployer.json index a3e0783fd0d34..b24342213aaed 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployer.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployer.json @@ -186,11 +186,6 @@ "name": "gasLimit", "type": "uint64" }, - { - "internalType": "bool", - "name": "disputeGameUsesSuperRoots", - "type": "bool" - }, { "internalType": "GameType", "name": "disputeGameType", diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployerInterop.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployerInterop.json deleted file mode 100644 index a3e0783fd0d34..0000000000000 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerDeployerInterop.json +++ /dev/null @@ -1,517 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "contract OPContractsManagerContractsContainer", - "name": "_contractsContainer", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_who", - "type": "address" - } - ], - "name": "assertValidContractAddress", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "blueprints", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "addressManager", - "type": "address" - }, - { - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "proxyAdmin", - "type": "address" - }, - { - "internalType": "address", - "name": "l1ChugSplashProxy", - "type": "address" - }, - { - "internalType": "address", - "name": "resolvedDelegateProxy", - "type": "address" - }, - { - "internalType": "address", - "name": "permissionedDisputeGame1", - "type": "address" - }, - { - "internalType": "address", - "name": "permissionedDisputeGame2", - "type": "address" - }, - { - "internalType": "address", - "name": "permissionlessDisputeGame1", - "type": "address" - }, - { - "internalType": "address", - "name": "permissionlessDisputeGame2", - "type": "address" - } - ], - "internalType": "struct OPContractsManager.Blueprints", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_l2ChainId", - "type": "uint256" - } - ], - "name": "chainIdToBatchInboxAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "contractsContainer", - "outputs": [ - { - "internalType": "contract OPContractsManagerContractsContainer", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "opChainProxyAdminOwner", - "type": "address" - }, - { - "internalType": "address", - "name": "systemConfigOwner", - "type": "address" - }, - { - "internalType": "address", - "name": "batcher", - "type": "address" - }, - { - "internalType": "address", - "name": "unsafeBlockSigner", - "type": "address" - }, - { - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "internalType": "address", - "name": "challenger", - "type": "address" - } - ], - "internalType": "struct OPContractsManager.Roles", - "name": "roles", - "type": "tuple" - }, - { - "internalType": "uint32", - "name": "basefeeScalar", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "blobBasefeeScalar", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "l2ChainId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "startingAnchorRoot", - "type": "bytes" - }, - { - "internalType": "string", - "name": "saltMixer", - "type": "string" - }, - { - "internalType": "uint64", - "name": "gasLimit", - "type": "uint64" - }, - { - "internalType": "bool", - "name": "disputeGameUsesSuperRoots", - "type": "bool" - }, - { - "internalType": "GameType", - "name": "disputeGameType", - "type": "uint32" - }, - { - "internalType": "Claim", - "name": "disputeAbsolutePrestate", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "disputeMaxGameDepth", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "disputeSplitDepth", - "type": "uint256" - }, - { - "internalType": "Duration", - "name": "disputeClockExtension", - "type": "uint64" - }, - { - "internalType": "Duration", - "name": "disputeMaxClockDuration", - "type": "uint64" - } - ], - "internalType": "struct OPContractsManager.DeployInput", - "name": "_input", - "type": "tuple" - }, - { - "internalType": "contract ISuperchainConfig", - "name": "_superchainConfig", - "type": "address" - }, - { - "internalType": "address", - "name": "_deployer", - "type": "address" - } - ], - "name": "deploy", - "outputs": [ - { - "components": [ - { - "internalType": "contract IProxyAdmin", - "name": "opChainProxyAdmin", - "type": "address" - }, - { - "internalType": "contract IAddressManager", - "name": "addressManager", - "type": "address" - }, - { - "internalType": "contract IL1ERC721Bridge", - "name": "l1ERC721BridgeProxy", - "type": "address" - }, - { - "internalType": "contract ISystemConfig", - "name": "systemConfigProxy", - "type": "address" - }, - { - "internalType": "contract IOptimismMintableERC20Factory", - "name": "optimismMintableERC20FactoryProxy", - "type": "address" - }, - { - "internalType": "contract IL1StandardBridge", - "name": "l1StandardBridgeProxy", - "type": "address" - }, - { - "internalType": "contract IL1CrossDomainMessenger", - "name": "l1CrossDomainMessengerProxy", - "type": "address" - }, - { - "internalType": "contract IETHLockbox", - "name": "ethLockboxProxy", - "type": "address" - }, - { - "internalType": "contract IOptimismPortal2", - "name": "optimismPortalProxy", - "type": "address" - }, - { - "internalType": "contract IDisputeGameFactory", - "name": "disputeGameFactoryProxy", - "type": "address" - }, - { - "internalType": "contract IAnchorStateRegistry", - "name": "anchorStateRegistryProxy", - "type": "address" - }, - { - "internalType": "contract IFaultDisputeGame", - "name": "faultDisputeGame", - "type": "address" - }, - { - "internalType": "contract IPermissionedDisputeGame", - "name": "permissionedDisputeGame", - "type": "address" - }, - { - "internalType": "contract IDelayedWETH", - "name": "delayedWETHPermissionedGameProxy", - "type": "address" - }, - { - "internalType": "contract IDelayedWETH", - "name": "delayedWETHPermissionlessGameProxy", - "type": "address" - } - ], - "internalType": "struct OPContractsManager.DeployOutput", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementations", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "superchainConfigImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "protocolVersionsImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "l1ERC721BridgeImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "optimismPortalImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "ethLockboxImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "systemConfigImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "optimismMintableERC20FactoryImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "l1CrossDomainMessengerImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "l1StandardBridgeImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "disputeGameFactoryImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "anchorStateRegistryImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "delayedWETHImpl", - "type": "address" - }, - { - "internalType": "address", - "name": "mipsImpl", - "type": "address" - } - ], - "internalType": "struct OPContractsManager.Implementations", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "l2ChainId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "deployer", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "deployOutput", - "type": "bytes" - } - ], - "name": "Deployed", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "who", - "type": "address" - } - ], - "name": "AddressHasNoCode", - "type": "error" - }, - { - "inputs": [], - "name": "BytesArrayTooLong", - "type": "error" - }, - { - "inputs": [], - "name": "DeploymentFailed", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyInitcode", - "type": "error" - }, - { - "inputs": [], - "name": "IdentityPrecompileCallFailed", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidChainId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "InvalidRoleAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidStartingAnchorRoot", - "type": "error" - }, - { - "inputs": [], - "name": "NotABlueprint", - "type": "error" - }, - { - "inputs": [], - "name": "ReservedBitsSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "UnexpectedPreambleData", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "UnsupportedERCVersion", - "type": "error" - } -] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerGameTypeAdder.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerGameTypeAdder.json index 75a4caf40467b..bc3cd92692052 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerGameTypeAdder.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerGameTypeAdder.json @@ -316,11 +316,6 @@ "internalType": "Claim", "name": "absolutePrestate", "type": "bytes32" - }, - { - "internalType": "bool", - "name": "disputeGameUsesSuperRoots", - "type": "bool" } ], "internalType": "struct OPContractsManager.OpChainConfig[]", diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUpgrader.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUpgrader.json index d9ac40df7ca94..42887ce92c3d6 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUpgrader.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerUpgrader.json @@ -213,11 +213,6 @@ "internalType": "Claim", "name": "absolutePrestate", "type": "bytes32" - }, - { - "internalType": "bool", - "name": "disputeGameUsesSuperRoots", - "type": "bool" } ], "internalType": "struct OPContractsManager.OpChainConfig[]", diff --git a/packages/contracts-bedrock/snapshots/abi/OptimismPortal2.json b/packages/contracts-bedrock/snapshots/abi/OptimismPortal2.json index 5a60bf69cd620..9719bfe65046c 100644 --- a/packages/contracts-bedrock/snapshots/abi/OptimismPortal2.json +++ b/packages/contracts-bedrock/snapshots/abi/OptimismPortal2.json @@ -285,11 +285,6 @@ "internalType": "contract IETHLockbox", "name": "_ethLockbox", "type": "address" - }, - { - "internalType": "bool", - "name": "_superRootsActive", - "type": "bool" } ], "name": "initialize", @@ -317,6 +312,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract IETHLockbox", + "name": "_newLockbox", + "type": "address" + }, + { + "internalType": "contract IAnchorStateRegistry", + "name": "_newAnchorStateRegistry", + "type": "address" + } + ], + "name": "migrateToSuperRoots", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -738,19 +751,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "contract IETHLockbox", - "name": "_newLockbox", - "type": "address" - } - ], - "name": "updateLockbox", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -762,11 +762,6 @@ "internalType": "contract IETHLockbox", "name": "_ethLockbox", "type": "address" - }, - { - "internalType": "bool", - "name": "_superRootsActive", - "type": "bool" } ], "name": "upgrade", @@ -824,18 +819,30 @@ "inputs": [ { "indexed": false, - "internalType": "address", + "internalType": "contract IETHLockbox", "name": "oldLockbox", "type": "address" }, { "indexed": false, - "internalType": "address", + "internalType": "contract IETHLockbox", "name": "newLockbox", "type": "address" + }, + { + "indexed": false, + "internalType": "contract IAnchorStateRegistry", + "name": "oldAnchorStateRegistry", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IAnchorStateRegistry", + "name": "newAnchorStateRegistry", + "type": "address" } ], - "name": "LockboxUpdated", + "name": "PortalMigrated", "type": "event" }, { @@ -1037,6 +1044,11 @@ "name": "OptimismPortal_InvalidSuperRootProof", "type": "error" }, + { + "inputs": [], + "name": "OptimismPortal_MigratingToSameRegistry", + "type": "error" + }, { "inputs": [], "name": "OptimismPortal_NoReentrancy", diff --git a/packages/contracts-bedrock/snapshots/abi/OptimismPortalInterop.json b/packages/contracts-bedrock/snapshots/abi/OptimismPortalInterop.json deleted file mode 100644 index 4835f00aa2ca9..0000000000000 --- a/packages/contracts-bedrock/snapshots/abi/OptimismPortalInterop.json +++ /dev/null @@ -1,1103 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "uint256", - "name": "_proofMaturityDelaySeconds", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "stateMutability": "payable", - "type": "receive" - }, - { - "inputs": [], - "name": "anchorStateRegistry", - "outputs": [ - { - "internalType": "contract IAnchorStateRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_withdrawalHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "_proofSubmitter", - "type": "address" - } - ], - "name": "checkWithdrawal", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "_gasLimit", - "type": "uint64" - }, - { - "internalType": "bool", - "name": "_isCreation", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "depositTransaction", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "disputeGameFactory", - "outputs": [ - { - "internalType": "contract IDisputeGameFactory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disputeGameFinalityDelaySeconds", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "donateETH", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "ethLockbox", - "outputs": [ - { - "internalType": "contract IETHLockbox", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "gasLimit", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct Types.WithdrawalTransaction", - "name": "_tx", - "type": "tuple" - } - ], - "name": "finalizeWithdrawalTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "gasLimit", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct Types.WithdrawalTransaction", - "name": "_tx", - "type": "tuple" - }, - { - "internalType": "address", - "name": "_proofSubmitter", - "type": "address" - } - ], - "name": "finalizeWithdrawalTransactionExternalProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "finalizedWithdrawals", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "guardian", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initVersion", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ISystemConfig", - "name": "_systemConfig", - "type": "address" - }, - { - "internalType": "contract ISuperchainConfig", - "name": "_superchainConfig", - "type": "address" - }, - { - "internalType": "contract IAnchorStateRegistry", - "name": "_anchorStateRegistry", - "type": "address" - }, - { - "internalType": "contract IETHLockbox", - "name": "_ethLockbox", - "type": "address" - }, - { - "internalType": "bool", - "name": "_superRootsActive", - "type": "bool" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "l2Sender", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "migrateLiquidity", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "_byteCount", - "type": "uint64" - } - ], - "name": "minimumGasLimit", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_withdrawalHash", - "type": "bytes32" - } - ], - "name": "numProofSubmitters", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "params", - "outputs": [ - { - "internalType": "uint128", - "name": "prevBaseFee", - "type": "uint128" - }, - { - "internalType": "uint64", - "name": "prevBoughtGas", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "prevBlockNum", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proofMaturityDelaySeconds", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "proofSubmitters", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "gasLimit", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct Types.WithdrawalTransaction", - "name": "_tx", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "_disputeGameIndex", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "version", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "stateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "messagePasserStorageRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "latestBlockhash", - "type": "bytes32" - } - ], - "internalType": "struct Types.OutputRootProof", - "name": "_outputRootProof", - "type": "tuple" - }, - { - "internalType": "bytes[]", - "name": "_withdrawalProof", - "type": "bytes[]" - } - ], - "name": "proveWithdrawalTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "gasLimit", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct Types.WithdrawalTransaction", - "name": "_tx", - "type": "tuple" - }, - { - "internalType": "contract IDisputeGame", - "name": "_disputeGameProxy", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_outputRootIndex", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "bytes1", - "name": "version", - "type": "bytes1" - }, - { - "internalType": "uint64", - "name": "timestamp", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "root", - "type": "bytes32" - } - ], - "internalType": "struct Types.OutputRootWithChainId[]", - "name": "outputRoots", - "type": "tuple[]" - } - ], - "internalType": "struct Types.SuperRootProof", - "name": "_superRootProof", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "version", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "stateRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "messagePasserStorageRoot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "latestBlockhash", - "type": "bytes32" - } - ], - "internalType": "struct Types.OutputRootProof", - "name": "_outputRootProof", - "type": "tuple" - }, - { - "internalType": "bytes[]", - "name": "_withdrawalProof", - "type": "bytes[]" - } - ], - "name": "proveWithdrawalTransaction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "provenWithdrawals", - "outputs": [ - { - "internalType": "contract IDisputeGame", - "name": "disputeGameProxy", - "type": "address" - }, - { - "internalType": "uint64", - "name": "timestamp", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxyAdminOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "respectedGameType", - "outputs": [ - { - "internalType": "GameType", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "respectedGameTypeUpdatedAt", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum ConfigType", - "name": "_type", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "_value", - "type": "bytes" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "superRootsActive", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "superchainConfig", - "outputs": [ - { - "internalType": "contract ISuperchainConfig", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "systemConfig", - "outputs": [ - { - "internalType": "contract ISystemConfig", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IETHLockbox", - "name": "_newLockbox", - "type": "address" - } - ], - "name": "updateLockbox", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IAnchorStateRegistry", - "name": "_anchorStateRegistry", - "type": "address" - }, - { - "internalType": "contract IETHLockbox", - "name": "_ethLockbox", - "type": "address" - }, - { - "internalType": "bool", - "name": "_superRootsActive", - "type": "bool" - } - ], - "name": "upgrade", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "lockbox", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ethBalance", - "type": "uint256" - } - ], - "name": "ETHMigrated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldLockbox", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newLockbox", - "type": "address" - } - ], - "name": "LockboxUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "version", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "opaqueData", - "type": "bytes" - } - ], - "name": "TransactionDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "withdrawalHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "name": "WithdrawalFinalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "withdrawalHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "WithdrawalProven", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "withdrawalHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "proofSubmitter", - "type": "address" - } - ], - "name": "WithdrawalProvenExtension1", - "type": "event" - }, - { - "inputs": [], - "name": "ContentLengthMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyItem", - "type": "error" - }, - { - "inputs": [], - "name": "Encoding_EmptySuperRoot", - "type": "error" - }, - { - "inputs": [], - "name": "Encoding_InvalidSuperRootVersion", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidDataRemainder", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidHeader", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_AlreadyFinalized", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_BadTarget", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_CallPaused", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_CalldataTooLarge", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_GasEstimation", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_GasLimitTooLow", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_ImproperDisputeGame", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_InvalidDisputeGame", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_InvalidMerkleProof", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_InvalidOutputRootChainId", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_InvalidOutputRootIndex", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_InvalidOutputRootProof", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_InvalidProofTimestamp", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_InvalidRootClaim", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_InvalidSuperRootProof", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_NoReentrancy", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_ProofNotOldEnough", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_Unproven", - "type": "error" - }, - { - "inputs": [], - "name": "OptimismPortal_WrongProofMethod", - "type": "error" - }, - { - "inputs": [], - "name": "OutOfGas", - "type": "error" - }, - { - "inputs": [], - "name": "ReinitializableBase_ZeroInitVersion", - "type": "error" - }, - { - "inputs": [], - "name": "UnexpectedList", - "type": "error" - }, - { - "inputs": [], - "name": "UnexpectedString", - "type": "error" - } -] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/abi/SystemConfigInterop.json b/packages/contracts-bedrock/snapshots/abi/SystemConfigInterop.json deleted file mode 100644 index c11d382aa528f..0000000000000 --- a/packages/contracts-bedrock/snapshots/abi/SystemConfigInterop.json +++ /dev/null @@ -1,1041 +0,0 @@ -[ - { - "inputs": [], - "name": "BATCH_INBOX_SLOT", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DISPUTE_GAME_FACTORY_SLOT", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L1_CROSS_DOMAIN_MESSENGER_SLOT", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L1_ERC_721_BRIDGE_SLOT", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L1_STANDARD_BRIDGE_SLOT", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPTIMISM_PORTAL_SLOT", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "START_BLOCK_SLOT", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UNSAFE_BLOCK_SIGNER_SLOT", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "VERSION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" - } - ], - "name": "addDependency", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "basefeeScalar", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "batchInbox", - "outputs": [ - { - "internalType": "address", - "name": "addr_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "batcherHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "blobbasefeeScalar", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "dependencyManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disputeGameFactory", - "outputs": [ - { - "internalType": "address", - "name": "addr_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eip1559Denominator", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eip1559Elasticity", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gasLimit", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAddresses", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "l1CrossDomainMessenger", - "type": "address" - }, - { - "internalType": "address", - "name": "l1ERC721Bridge", - "type": "address" - }, - { - "internalType": "address", - "name": "l1StandardBridge", - "type": "address" - }, - { - "internalType": "address", - "name": "disputeGameFactory", - "type": "address" - }, - { - "internalType": "address", - "name": "optimismPortal", - "type": "address" - }, - { - "internalType": "address", - "name": "optimismMintableERC20Factory", - "type": "address" - } - ], - "internalType": "struct SystemConfig.Addresses", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initVersion", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "uint32", - "name": "_basefeeScalar", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "_blobbasefeeScalar", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "_batcherHash", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "_gasLimit", - "type": "uint64" - }, - { - "internalType": "address", - "name": "_unsafeBlockSigner", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint32", - "name": "maxResourceLimit", - "type": "uint32" - }, - { - "internalType": "uint8", - "name": "elasticityMultiplier", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "baseFeeMaxChangeDenominator", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "minimumBaseFee", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "systemTxMaxGas", - "type": "uint32" - }, - { - "internalType": "uint128", - "name": "maximumBaseFee", - "type": "uint128" - } - ], - "internalType": "struct IResourceMetering.ResourceConfig", - "name": "_config", - "type": "tuple" - }, - { - "internalType": "address", - "name": "_batchInbox", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "l1CrossDomainMessenger", - "type": "address" - }, - { - "internalType": "address", - "name": "l1ERC721Bridge", - "type": "address" - }, - { - "internalType": "address", - "name": "l1StandardBridge", - "type": "address" - }, - { - "internalType": "address", - "name": "disputeGameFactory", - "type": "address" - }, - { - "internalType": "address", - "name": "optimismPortal", - "type": "address" - }, - { - "internalType": "address", - "name": "optimismMintableERC20Factory", - "type": "address" - } - ], - "internalType": "struct SystemConfig.Addresses", - "name": "_addresses", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "_l2ChainId", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "uint32", - "name": "_basefeeScalar", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "_blobbasefeeScalar", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "_batcherHash", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "_gasLimit", - "type": "uint64" - }, - { - "internalType": "address", - "name": "_unsafeBlockSigner", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint32", - "name": "maxResourceLimit", - "type": "uint32" - }, - { - "internalType": "uint8", - "name": "elasticityMultiplier", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "baseFeeMaxChangeDenominator", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "minimumBaseFee", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "systemTxMaxGas", - "type": "uint32" - }, - { - "internalType": "uint128", - "name": "maximumBaseFee", - "type": "uint128" - } - ], - "internalType": "struct IResourceMetering.ResourceConfig", - "name": "_config", - "type": "tuple" - }, - { - "internalType": "address", - "name": "_batchInbox", - "type": "address" - }, - { - "components": [ - { - "internalType": "address", - "name": "l1CrossDomainMessenger", - "type": "address" - }, - { - "internalType": "address", - "name": "l1ERC721Bridge", - "type": "address" - }, - { - "internalType": "address", - "name": "l1StandardBridge", - "type": "address" - }, - { - "internalType": "address", - "name": "disputeGameFactory", - "type": "address" - }, - { - "internalType": "address", - "name": "optimismPortal", - "type": "address" - }, - { - "internalType": "address", - "name": "optimismMintableERC20Factory", - "type": "address" - } - ], - "internalType": "struct SystemConfig.Addresses", - "name": "_addresses", - "type": "tuple" - }, - { - "internalType": "address", - "name": "_dependencyManager", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_l2ChainId", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "l1CrossDomainMessenger", - "outputs": [ - { - "internalType": "address", - "name": "addr_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l1ERC721Bridge", - "outputs": [ - { - "internalType": "address", - "name": "addr_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l1StandardBridge", - "outputs": [ - { - "internalType": "address", - "name": "addr_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "l2ChainId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maximumGasLimit", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "minimumGasLimit", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "operatorFeeConstant", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "operatorFeeScalar", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "optimismMintableERC20Factory", - "outputs": [ - { - "internalType": "address", - "name": "addr_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "optimismPortal", - "outputs": [ - { - "internalType": "address", - "name": "addr_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "overhead", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" - } - ], - "name": "removeDependency", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "resourceConfig", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "maxResourceLimit", - "type": "uint32" - }, - { - "internalType": "uint8", - "name": "elasticityMultiplier", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "baseFeeMaxChangeDenominator", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "minimumBaseFee", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "systemTxMaxGas", - "type": "uint32" - }, - { - "internalType": "uint128", - "name": "maximumBaseFee", - "type": "uint128" - } - ], - "internalType": "struct IResourceMetering.ResourceConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "scalar", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_batcherHash", - "type": "bytes32" - } - ], - "name": "setBatcherHash", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "_denominator", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "_elasticity", - "type": "uint32" - } - ], - "name": "setEIP1559Params", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_overhead", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_scalar", - "type": "uint256" - } - ], - "name": "setGasConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "_basefeeScalar", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "_blobbasefeeScalar", - "type": "uint32" - } - ], - "name": "setGasConfigEcotone", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "_gasLimit", - "type": "uint64" - } - ], - "name": "setGasLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "_operatorFeeScalar", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "_operatorFeeConstant", - "type": "uint64" - } - ], - "name": "setOperatorFeeScalars", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_unsafeBlockSigner", - "type": "address" - } - ], - "name": "setUnsafeBlockSigner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "startBlock", - "outputs": [ - { - "internalType": "uint256", - "name": "startBlock_", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "unsafeBlockSigner", - "outputs": [ - { - "internalType": "address", - "name": "addr_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_l2ChainId", - "type": "uint256" - } - ], - "name": "upgrade", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "version", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "enum SystemConfig.UpdateType", - "name": "updateType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "ConfigUpdate", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "ReinitializableBase_ZeroInitVersion", - "type": "error" - } -] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/semver-lock.json b/packages/contracts-bedrock/snapshots/semver-lock.json index ea49df2bac3c4..8dd120dad8d54 100644 --- a/packages/contracts-bedrock/snapshots/semver-lock.json +++ b/packages/contracts-bedrock/snapshots/semver-lock.json @@ -4,8 +4,8 @@ "sourceCodeHash": "0xe772f7db8033e4a738850cb28ac4849d3a454c93732135a8a10d4f7cb498088e" }, "src/L1/ETHLockbox.sol:ETHLockbox": { - "initCodeHash": "0x599593bf96170081d2fd191bb2f61eaa2d094faafb6a583a34b3eea2dc49e5c6", - "sourceCodeHash": "0x34da4a8a0e32cabce97056f10cc1c8231f14a1cd706ae63ee0bef3c1f65f3e13" + "initCodeHash": "0x85bbd94ec44dbfbf6b8ffd2c706dfa4e776d6b02bb7583829e9b0fc53ca377f1", + "sourceCodeHash": "0x8de4672699c8a600e226fe57be1a21d814bb27f3c35312dce5e993cf6bb0d3d8" }, "src/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger": { "initCodeHash": "0x5a6272f6bd4346da460b7ff2ebc426d158d7ffc65dc0f2c0651a9e6d545bfd03", @@ -20,16 +20,12 @@ "sourceCodeHash": "0x44797707aea8c63dec049a02d69ea056662a06e5cf320028ab8b388634bf1c67" }, "src/L1/OPContractsManager.sol:OPContractsManager": { - "initCodeHash": "0x9e7496b9720bae99e5db18dc18c99b5c06cd755c6d4079e0d38c56d625fe7b4e", - "sourceCodeHash": "0x8302de0ccd551512f2430d545ea55c938b002701d2292fd7aad2b4d2b975727b" + "initCodeHash": "0xbe05d8be3a52f8d3700d9c6a99dde5be57dc85ad4e02eea17a9884db1ffbe760", + "sourceCodeHash": "0xae25661822173f97f54378e52fc51b1fe19add53a6eac16126da10a438d27dc6" }, "src/L1/OptimismPortal2.sol:OptimismPortal2": { - "initCodeHash": "0x774dd0c79fb11ea7ecbbffb28d1c005b72790577adbeeeb881c2a180e2feaadf", - "sourceCodeHash": "0x2d36fbd2326ceafe89ca1a3b80c223ad7f934e89e996d20b847498f015316bdf" - }, - "src/L1/OptimismPortalInterop.sol:OptimismPortalInterop": { - "initCodeHash": "0x9c35223461ee313b77eafb727c51300596975b5134ff51847d8fab424b4dcd0b", - "sourceCodeHash": "0xa1ecf8a19638dd24d80f62e2faef132afa15c6945c14133fe58709015fcb14a6" + "initCodeHash": "0xbc7db7b1016025228d99a40db1760290b333bb90563dff5514fd253fd91019ba", + "sourceCodeHash": "0x367e0a1c609e3c82db41a8c5e056108cbbae58d61bfeb08707449655485ba8ab" }, "src/L1/ProtocolVersions.sol:ProtocolVersions": { "initCodeHash": "0x5a76c8530cb24cf23d3baacc6eefaac226382af13f1e2a35535d2ec2b0573b29", @@ -43,10 +39,6 @@ "initCodeHash": "0x471ac69544fdee81d0734b87151297ad4cf91ca1d43a2c95e9e644c0424eed65", "sourceCodeHash": "0x8c3ccb8f3718c00c3f9bf7c866a22d87ea18a87a6e9454c31d1c97638107434c" }, - "src/L1/SystemConfigInterop.sol:SystemConfigInterop": { - "initCodeHash": "0xcdca84b074ddfd6b4e4df1a57d3500c1d48ecf88852af47f6351e9ae24b6fc2a", - "sourceCodeHash": "0x71914fa1408befaef3a06a67404e0ab580d9d945e068ba23063ea6588f0f68a6" - }, "src/L2/BaseFeeVault.sol:BaseFeeVault": { "initCodeHash": "0xc403d4c555d8e69a2699e01d192ae7327136701fa02da10a6d75a584b3c364c9", "sourceCodeHash": "0xfa56426153227e798150f6becc30a33fd20a3c6e0d73c797a3922dd631acbb57" diff --git a/packages/contracts-bedrock/snapshots/storageLayout/OPContractsManagerDeployerInterop.json b/packages/contracts-bedrock/snapshots/storageLayout/OPContractsManagerDeployerInterop.json deleted file mode 100644 index 0637a088a01e8..0000000000000 --- a/packages/contracts-bedrock/snapshots/storageLayout/OPContractsManagerDeployerInterop.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/storageLayout/OptimismPortalInterop.json b/packages/contracts-bedrock/snapshots/storageLayout/OptimismPortalInterop.json deleted file mode 100644 index a66c4b71b4d16..0000000000000 --- a/packages/contracts-bedrock/snapshots/storageLayout/OptimismPortalInterop.json +++ /dev/null @@ -1,149 +0,0 @@ -[ - { - "bytes": "1", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "uint8" - }, - { - "bytes": "1", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "bool" - }, - { - "bytes": "32", - "label": "params", - "offset": 0, - "slot": "1", - "type": "struct ResourceMetering.ResourceParams" - }, - { - "bytes": "1536", - "label": "__gap", - "offset": 0, - "slot": "2", - "type": "uint256[48]" - }, - { - "bytes": "20", - "label": "l2Sender", - "offset": 0, - "slot": "50", - "type": "address" - }, - { - "bytes": "32", - "label": "finalizedWithdrawals", - "offset": 0, - "slot": "51", - "type": "mapping(bytes32 => bool)" - }, - { - "bytes": "32", - "label": "spacer_52_0_32", - "offset": 0, - "slot": "52", - "type": "bytes32" - }, - { - "bytes": "1", - "label": "spacer_53_0_1", - "offset": 0, - "slot": "53", - "type": "bool" - }, - { - "bytes": "20", - "label": "superchainConfig", - "offset": 1, - "slot": "53", - "type": "contract ISuperchainConfig" - }, - { - "bytes": "20", - "label": "spacer_54_0_20", - "offset": 0, - "slot": "54", - "type": "address" - }, - { - "bytes": "20", - "label": "systemConfig", - "offset": 0, - "slot": "55", - "type": "contract ISystemConfig" - }, - { - "bytes": "20", - "label": "spacer_56_0_20", - "offset": 0, - "slot": "56", - "type": "address" - }, - { - "bytes": "32", - "label": "provenWithdrawals", - "offset": 0, - "slot": "57", - "type": "mapping(bytes32 => mapping(address => struct OptimismPortal2.ProvenWithdrawal))" - }, - { - "bytes": "32", - "label": "spacer_58_0_32", - "offset": 0, - "slot": "58", - "type": "bytes32" - }, - { - "bytes": "4", - "label": "spacer_59_0_4", - "offset": 0, - "slot": "59", - "type": "GameType" - }, - { - "bytes": "8", - "label": "spacer_59_4_8", - "offset": 4, - "slot": "59", - "type": "uint64" - }, - { - "bytes": "32", - "label": "proofSubmitters", - "offset": 0, - "slot": "60", - "type": "mapping(bytes32 => address[])" - }, - { - "bytes": "32", - "label": "spacer_61_0_32", - "offset": 0, - "slot": "61", - "type": "uint256" - }, - { - "bytes": "20", - "label": "anchorStateRegistry", - "offset": 0, - "slot": "62", - "type": "contract IAnchorStateRegistry" - }, - { - "bytes": "20", - "label": "ethLockbox", - "offset": 0, - "slot": "63", - "type": "contract IETHLockbox" - }, - { - "bytes": "1", - "label": "superRootsActive", - "offset": 20, - "slot": "63", - "type": "bool" - } -] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/storageLayout/SystemConfigInterop.json b/packages/contracts-bedrock/snapshots/storageLayout/SystemConfigInterop.json deleted file mode 100644 index 3d1796e5e4063..0000000000000 --- a/packages/contracts-bedrock/snapshots/storageLayout/SystemConfigInterop.json +++ /dev/null @@ -1,121 +0,0 @@ -[ - { - "bytes": "1", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "uint8" - }, - { - "bytes": "1", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "bool" - }, - { - "bytes": "1600", - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "uint256[50]" - }, - { - "bytes": "20", - "label": "_owner", - "offset": 0, - "slot": "51", - "type": "address" - }, - { - "bytes": "1568", - "label": "__gap", - "offset": 0, - "slot": "52", - "type": "uint256[49]" - }, - { - "bytes": "32", - "label": "overhead", - "offset": 0, - "slot": "101", - "type": "uint256" - }, - { - "bytes": "32", - "label": "scalar", - "offset": 0, - "slot": "102", - "type": "uint256" - }, - { - "bytes": "32", - "label": "batcherHash", - "offset": 0, - "slot": "103", - "type": "bytes32" - }, - { - "bytes": "8", - "label": "gasLimit", - "offset": 0, - "slot": "104", - "type": "uint64" - }, - { - "bytes": "4", - "label": "basefeeScalar", - "offset": 8, - "slot": "104", - "type": "uint32" - }, - { - "bytes": "4", - "label": "blobbasefeeScalar", - "offset": 12, - "slot": "104", - "type": "uint32" - }, - { - "bytes": "32", - "label": "_resourceConfig", - "offset": 0, - "slot": "105", - "type": "struct IResourceMetering.ResourceConfig" - }, - { - "bytes": "4", - "label": "eip1559Denominator", - "offset": 0, - "slot": "106", - "type": "uint32" - }, - { - "bytes": "4", - "label": "eip1559Elasticity", - "offset": 4, - "slot": "106", - "type": "uint32" - }, - { - "bytes": "4", - "label": "operatorFeeScalar", - "offset": 8, - "slot": "106", - "type": "uint32" - }, - { - "bytes": "8", - "label": "operatorFeeConstant", - "offset": 12, - "slot": "106", - "type": "uint64" - }, - { - "bytes": "32", - "label": "l2ChainId", - "offset": 0, - "slot": "107", - "type": "uint256" - } -] \ No newline at end of file diff --git a/packages/contracts-bedrock/src/L1/ETHLockbox.sol b/packages/contracts-bedrock/src/L1/ETHLockbox.sol index 3931c90fb3e0e..5965feb006f9c 100644 --- a/packages/contracts-bedrock/src/L1/ETHLockbox.sol +++ b/packages/contracts-bedrock/src/L1/ETHLockbox.sol @@ -34,6 +34,9 @@ contract ETHLockbox is ProxyAdminOwnedBase, Initializable, ISemver { /// @notice Thrown when the admin owner of the lockbox is different from the admin owner of the proxy admin. error ETHLockbox_DifferentProxyAdminOwner(); + /// @notice Thrown when any authorized portal has a different SuperchainConfig. + error ETHLockbox_DifferentSuperchainConfig(); + /// @notice Emitted when ETH is locked in the lockbox by an authorized portal. /// @param portal The address of the portal that locked the ETH. /// @param amount The amount of ETH locked. @@ -71,9 +74,9 @@ contract ETHLockbox is ProxyAdminOwnedBase, Initializable, ISemver { mapping(address => bool) public authorizedLockboxes; /// @notice Semantic version. - /// @custom:semver 0.0.1 + /// @custom:semver 1.0.0 function version() public view virtual returns (string memory) { - return "0.0.1"; + return "1.0.0"; } /// @notice Constructs the ETHLockbox contract. @@ -93,7 +96,7 @@ contract ETHLockbox is ProxyAdminOwnedBase, Initializable, ISemver { { superchainConfig = ISuperchainConfig(_superchainConfig); for (uint256 i; i < _portals.length; i++) { - _authorizePortal(address(_portals[i])); + _authorizePortal(_portals[i]); } } @@ -101,7 +104,7 @@ contract ETHLockbox is ProxyAdminOwnedBase, Initializable, ISemver { /// @param _portal The address of the portal to authorize. function authorizePortal(IOptimismPortal _portal) external { if (msg.sender != proxyAdminOwner()) revert ETHLockbox_Unauthorized(); - _authorizePortal(address(_portal)); + _authorizePortal(_portal); } /// @notice Getter for the current paused status. @@ -165,9 +168,10 @@ contract ETHLockbox is ProxyAdminOwnedBase, Initializable, ISemver { /// @notice Authorizes a portal to lock and unlock ETH. /// @param _portal The address of the portal to authorize. - function _authorizePortal(address _portal) internal { - if (!_sameProxyAdminOwner(_portal)) revert ETHLockbox_DifferentProxyAdminOwner(); - authorizedPortals[_portal] = true; - emit PortalAuthorized(_portal); + function _authorizePortal(IOptimismPortal _portal) internal { + if (!_sameProxyAdminOwner(address(_portal))) revert ETHLockbox_DifferentProxyAdminOwner(); + if (_portal.superchainConfig() != superchainConfig) revert ETHLockbox_DifferentSuperchainConfig(); + authorizedPortals[address(_portal)] = true; + emit PortalAuthorized(address(_portal)); } } diff --git a/packages/contracts-bedrock/src/L1/OPContractsManager.sol b/packages/contracts-bedrock/src/L1/OPContractsManager.sol index 096b46c5bd477..c3222920f4cb0 100644 --- a/packages/contracts-bedrock/src/L1/OPContractsManager.sol +++ b/packages/contracts-bedrock/src/L1/OPContractsManager.sol @@ -29,7 +29,6 @@ import { IL1ERC721Bridge } from "interfaces/L1/IL1ERC721Bridge.sol"; import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol"; import { IOptimismMintableERC20Factory } from "interfaces/universal/IOptimismMintableERC20Factory.sol"; import { IHasSuperchainConfig } from "interfaces/L1/IHasSuperchainConfig.sol"; -import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol"; import { IETHLockbox } from "interfaces/L1/IETHLockbox.sol"; contract OPContractsManagerContractsContainer { @@ -630,9 +629,7 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { } // Call `upgrade` on the OptimismPortal contract. - IOptimismPortal(payable(opChainAddrs.optimismPortal)).upgrade( - newAnchorStateRegistryProxy, ethLockbox, _opChainConfigs[i].disputeGameUsesSuperRoots - ); + IOptimismPortal(payable(opChainAddrs.optimismPortal)).upgrade(newAnchorStateRegistryProxy, ethLockbox); } // We also need to redeploy the dispute games because the AnchorStateRegistry is new. @@ -724,10 +721,17 @@ contract OPContractsManagerUpgrader is OPContractsManagerBase { // Modify the params with the new vm values. params.anchorStateRegistry = IAnchorStateRegistry(address(_newAnchorStateRegistryProxy)); params.vm = IBigStepper(impls.mipsImpl); - if (Claim.unwrap(_opChainConfig.absolutePrestate) == bytes32(0)) { + + // If the prestate is set in the config, use it. If not set, we'll try to use the prestate + // that already exists on the current dispute game. + if (Claim.unwrap(_opChainConfig.absolutePrestate) != bytes32(0)) { + params.absolutePrestate = _opChainConfig.absolutePrestate; + } + + // As a sanity check, if the prestate is zero here, revert. + if (params.absolutePrestate.raw() == bytes32(0)) { revert OPContractsManager.PrestateNotSet(); } - params.absolutePrestate = _opChainConfig.absolutePrestate; IDisputeGame newGame; if (GameType.unwrap(_gameType) == GameType.unwrap(GameTypes.PERMISSIONED_CANNON)) { @@ -889,7 +893,7 @@ contract OPContractsManagerDeployer is OPContractsManagerBase { output.opChainProxyAdmin, address(output.l1ERC721BridgeProxy), implementation.l1ERC721BridgeImpl, data ); - data = encodeOptimismPortalInitializer(_input, output, _superchainConfig); + data = encodeOptimismPortalInitializer(output, _superchainConfig); upgradeToAndCall( output.opChainProxyAdmin, address(output.optimismPortalProxy), implementation.optimismPortalImpl, data ); @@ -1044,7 +1048,6 @@ contract OPContractsManagerDeployer is OPContractsManagerBase { /// @notice Helper method for encoding the OptimismPortal initializer data. function encodeOptimismPortalInitializer( - OPContractsManager.DeployInput memory _input, OPContractsManager.DeployOutput memory _output, ISuperchainConfig _superchainConfig ) @@ -1055,13 +1058,7 @@ contract OPContractsManagerDeployer is OPContractsManagerBase { { return abi.encodeCall( IOptimismPortal.initialize, - ( - _output.systemConfigProxy, - _superchainConfig, - _output.anchorStateRegistryProxy, - _output.ethLockboxProxy, - _input.disputeGameUsesSuperRoots - ) + (_output.systemConfigProxy, _superchainConfig, _output.anchorStateRegistryProxy, _output.ethLockboxProxy) ); } @@ -1180,52 +1177,6 @@ contract OPContractsManagerDeployer is OPContractsManagerBase { } } -contract OPContractsManagerDeployerInterop is OPContractsManagerDeployer { - constructor(OPContractsManagerContractsContainer _contractsContainer) - OPContractsManagerDeployer(_contractsContainer) - { } - - // The `SystemConfigInterop` contract has an extra `address _dependencyManager` argument - // that we must account for. - function encodeSystemConfigInitializer( - OPContractsManager.DeployInput memory _input, - OPContractsManager.DeployOutput memory _output - ) - internal - view - virtual - override - returns (bytes memory) - { - (IResourceMetering.ResourceConfig memory referenceResourceConfig, ISystemConfig.Addresses memory opChainAddrs) = - defaultSystemConfigParams(_input, _output); - - // TODO For now we assume that the dependency manager is the same as system config owner. - // This is currently undefined since it's not part of the standard config, so we may need - // to update where this value is pulled from in the future. To support a different dependency - // manager in this contract without an invasive change of redefining the `Roles` struct, - // we will make the change described in https://github.com/ethereum-optimism/optimism/issues/11783. - address dependencyManager = address(_input.roles.systemConfigOwner); - - return abi.encodeCall( - ISystemConfigInterop.initialize, - ( - _input.roles.systemConfigOwner, - _input.basefeeScalar, - _input.blobBasefeeScalar, - bytes32(uint256(uint160(_input.roles.batcher))), // batcherHash - _input.gasLimit, - _input.roles.unsafeBlockSigner, - referenceResourceConfig, - chainIdToBatchInboxAddress(_input.l2ChainId), - opChainAddrs, - dependencyManager, - _input.l2ChainId - ) - ); - } -} - contract OPContractsManager is ISemver { // -------- Structs -------- @@ -1251,7 +1202,6 @@ contract OPContractsManager is ISemver { string saltMixer; uint64 gasLimit; // Configurable dispute game parameters. - bool disputeGameUsesSuperRoots; GameType disputeGameType; Claim disputeAbsolutePrestate; uint256 disputeMaxGameDepth; @@ -1319,7 +1269,6 @@ contract OPContractsManager is ISemver { ISystemConfig systemConfigProxy; IProxyAdmin proxyAdmin; Claim absolutePrestate; - bool disputeGameUsesSuperRoots; } struct AddGameInput { @@ -1345,9 +1294,9 @@ contract OPContractsManager is ISemver { // -------- Constants and Variables -------- - /// @custom:semver 1.10.0 + /// @custom:semver 1.11.0 function version() public pure virtual returns (string memory) { - return "1.10.0"; + return "1.11.0"; } OPContractsManagerGameTypeAdder public immutable opcmGameTypeAdder; diff --git a/packages/contracts-bedrock/src/L1/OptimismPortal2.sol b/packages/contracts-bedrock/src/L1/OptimismPortal2.sol index 5b8cef6cc83dd..a6478226fb00b 100644 --- a/packages/contracts-bedrock/src/L1/OptimismPortal2.sol +++ b/packages/contracts-bedrock/src/L1/OptimismPortal2.sol @@ -160,7 +160,14 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ReinitializableBase /// @notice Emitted when the ETHLockbox contract is updated. /// @param oldLockbox The address of the old ETHLockbox contract. /// @param newLockbox The address of the new ETHLockbox contract. - event LockboxUpdated(address oldLockbox, address newLockbox); + /// @param oldAnchorStateRegistry The address of the old AnchorStateRegistry contract. + /// @param newAnchorStateRegistry The address of the new AnchorStateRegistry contract. + event PortalMigrated( + IETHLockbox oldLockbox, + IETHLockbox newLockbox, + IAnchorStateRegistry oldAnchorStateRegistry, + IAnchorStateRegistry newAnchorStateRegistry + ); /// @notice Thrown when a withdrawal has already been finalized. error OptimismPortal_AlreadyFinalized(); @@ -222,6 +229,9 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ReinitializableBase /// @notice Thrown when an output root chain id is invalid. error OptimismPortal_InvalidOutputRootChainId(); + /// @notice Thrown when trying to migrate to the same AnchorStateRegistry. + error OptimismPortal_MigratingToSameRegistry(); + /// @notice Reverts when paused. modifier whenNotPaused() { if (paused()) revert OptimismPortal_CallPaused(); @@ -229,9 +239,9 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ReinitializableBase } /// @notice Semantic version. - /// @custom:semver 4.0.0 + /// @custom:semver 4.1.0 function version() public pure virtual returns (string memory) { - return "4.0.0"; + return "4.1.0"; } /// @param _proofMaturityDelaySeconds The proof maturity delay in seconds. @@ -245,13 +255,11 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ReinitializableBase /// @param _superchainConfig Address of the SuperchainConfig. /// @param _anchorStateRegistry Address of the AnchorStateRegistry. /// @param _ethLockbox Contract of the ETHLockbox. - /// @param _superRootsActive Whether the OptimismPortal is using Super Roots or Output Roots. function initialize( ISystemConfig _systemConfig, ISuperchainConfig _superchainConfig, IAnchorStateRegistry _anchorStateRegistry, - IETHLockbox _ethLockbox, - bool _superRootsActive + IETHLockbox _ethLockbox ) external reinitializer(initVersion()) @@ -260,7 +268,6 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ReinitializableBase superchainConfig = _superchainConfig; anchorStateRegistry = _anchorStateRegistry; ethLockbox = _ethLockbox; - superRootsActive = _superRootsActive; // Set the l2Sender slot, only if it is currently empty. This signals the first // initialization of the contract. @@ -274,18 +281,15 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ReinitializableBase /// @notice Upgrades the OptimismPortal contract to have a reference to the AnchorStateRegistry. /// @param _anchorStateRegistry AnchorStateRegistry contract. /// @param _ethLockbox ETHLockbox contract. - /// @param _superRootsActive Whether the OptimismPortal is using Super Roots or Output Roots. function upgrade( IAnchorStateRegistry _anchorStateRegistry, - IETHLockbox _ethLockbox, - bool _superRootsActive + IETHLockbox _ethLockbox ) external reinitializer(initVersion()) { anchorStateRegistry = _anchorStateRegistry; ethLockbox = _ethLockbox; - superRootsActive = _superRootsActive; // Migrate the whole ETH balance to the ETHLockbox. _migrateLiquidity(); @@ -354,18 +358,46 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ReinitializableBase // Intentionally empty. } - /// @notice Updates the ETHLockbox contract. - /// @dev This function MUST be called atomically with `ETHLockbox.migrateLiquidity()` - /// in the same transaction batch, or otherwise the OptimismPortal may not be able to - /// unlock ETH from the ETHLockbox on finalized withdrawals. + /// @notice Allows the owner of the ProxyAdmin to migrate the OptimismPortal to use a new + /// lockbox, point at a new AnchorStateRegistry, and start to use the Super Roots proof + /// method. Primarily used for OptimismPortal instances to join the interop set, but + /// can also be used to swap the proof method from Output Roots to Super Roots if the + /// provided lockbox is the same as the current one. + /// @dev It is possible to change lockboxes without migrating liquidity. This can cause one + /// of the OptimismPortal instances connected to the new lockbox to not be able to + /// unlock sufficient ETH to finalize withdrawals which would trigger reverts. To avoid + /// this issue, guarantee that this function is called atomically alongside the + /// ETHLockbox.migrateLiquidity() function within the same transaction. /// @param _newLockbox The address of the new ETHLockbox contract. - function updateLockbox(IETHLockbox _newLockbox) external { + function migrateToSuperRoots(IETHLockbox _newLockbox, IAnchorStateRegistry _newAnchorStateRegistry) external { + // Make sure the caller is the owner of the ProxyAdmin. if (msg.sender != proxyAdminOwner()) revert OptimismPortal_Unauthorized(); - address oldLockbox = address(ethLockbox); + // Chains can use this method to swap the proof method from Output Roots to Super Roots + // without joining the interop set. In this case, the old and new lockboxes will be the + // same. However, whether or not a chain is joining the interop set, all chains will need a + // new AnchorStateRegistry when migrating to Super Roots. We therefore check that the new + // AnchorStateRegistry is different than the old one to prevent this function from being + // accidentally misused. + if (anchorStateRegistry == _newAnchorStateRegistry) { + revert OptimismPortal_MigratingToSameRegistry(); + } + + // Update the ETHLockbox. + IETHLockbox oldLockbox = ethLockbox; ethLockbox = _newLockbox; - emit LockboxUpdated(oldLockbox, address(_newLockbox)); + // Update the AnchorStateRegistry. + IAnchorStateRegistry oldAnchorStateRegistry = anchorStateRegistry; + anchorStateRegistry = _newAnchorStateRegistry; + + // Set the proof method to Super Roots. We expect that migration will happen more than once + // for some chains (switching to single-chain Super Roots and then later joining the + // interop set) so we don't need to check that this is false. + superRootsActive = true; + + // Emit a PortalMigrated event. + emit PortalMigrated(oldLockbox, _newLockbox, oldAnchorStateRegistry, _newAnchorStateRegistry); } /// @notice Proves a withdrawal transaction using a Super Root proof. Only callable when the diff --git a/packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol b/packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol deleted file mode 100644 index da2e9559e645b..0000000000000 --- a/packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -// Contracts -import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol"; - -// Libraries -import { Predeploys } from "src/libraries/Predeploys.sol"; -import { Constants } from "src/libraries/Constants.sol"; - -// Interfaces -import { IL1BlockInterop, ConfigType } from "interfaces/L2/IL1BlockInterop.sol"; - -/// @custom:proxied true -/// @title OptimismPortalInterop -/// @notice The OptimismPortal is a low-level contract responsible for passing messages between L1 -/// and L2. Messages sent directly to the OptimismPortal have no form of replayability. -/// Users are encouraged to use the L1CrossDomainMessenger for a higher-level interface. -contract OptimismPortalInterop is OptimismPortal2 { - /// @param _proofMaturityDelaySeconds The proof maturity delay in seconds. - constructor(uint256 _proofMaturityDelaySeconds) OptimismPortal2(_proofMaturityDelaySeconds) { } - - /// @custom:semver +interop.4 - function version() public pure override returns (string memory) { - return string.concat(super.version(), "+interop.4"); - } - - /// @notice Sets static configuration options for the L2 system. - /// @param _type Type of configuration to set. - /// @param _value Encoded value of the configuration. - function setConfig(ConfigType _type, bytes memory _value) external { - if (msg.sender != address(systemConfig)) revert OptimismPortal_Unauthorized(); - - // Set L2 deposit gas as used without paying burning gas. Ensures that deposits cannot use too much L2 gas. - // This value must be large enough to cover the cost of calling `L1Block.setConfig`. - useGas(SYSTEM_DEPOSIT_GAS_LIMIT); - - // Emit the special deposit transaction directly that sets the config in the L1Block predeploy contract. - emit TransactionDeposited( - Constants.DEPOSITOR_ACCOUNT, - Predeploys.L1_BLOCK_ATTRIBUTES, - DEPOSIT_VERSION, - abi.encodePacked( - uint256(0), // mint - uint256(0), // value - uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit - false, // isCreation, - abi.encodeCall(IL1BlockInterop.setConfig, (_type, _value)) - ) - ); - } -} diff --git a/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol b/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol deleted file mode 100644 index fc4135c088326..0000000000000 --- a/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol +++ /dev/null @@ -1,97 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -// Contracts -import { SystemConfig } from "src/L1/SystemConfig.sol"; - -// Libraries -import { StaticConfig } from "src/libraries/StaticConfig.sol"; -import { Storage } from "src/libraries/Storage.sol"; - -// Interfaces -import { IOptimismPortalInterop as IOptimismPortal } from "interfaces/L1/IOptimismPortalInterop.sol"; -import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol"; -import { ConfigType } from "interfaces/L2/IL1BlockInterop.sol"; - -/// @custom:proxied true -/// @title SystemConfigInterop -/// @notice The SystemConfig contract is used to manage configuration of an Optimism network. -/// All configuration is stored on L1 and picked up by L2 as part of the derviation of -/// the L2 chain. -contract SystemConfigInterop is SystemConfig { - /// @notice Storage slot where the dependency manager address is stored - /// @dev Equal to bytes32(uint256(keccak256("systemconfig.dependencymanager")) - 1) - bytes32 internal constant DEPENDENCY_MANAGER_SLOT = - 0x1708e077affb93e89be2665fb0fb72581be66f84dc00d25fed755ae911905b1c; - - /// @notice Initializer. - /// @param _owner Initial owner of the contract. - /// @param _basefeeScalar Initial basefee scalar value. - /// @param _blobbasefeeScalar Initial blobbasefee scalar value. - /// @param _batcherHash Initial batcher hash. - /// @param _gasLimit Initial gas limit. - /// @param _unsafeBlockSigner Initial unsafe block signer address. - /// @param _config Initial ResourceConfig. - /// @param _batchInbox Batch inbox address. An identifier for the op-node to find - /// canonical data. - /// @param _addresses Set of L1 contract addresses. These should be the proxies. - /// @param _dependencyManager The addressed allowed to add/remove from the dependency set - function initialize( - address _owner, - uint32 _basefeeScalar, - uint32 _blobbasefeeScalar, - bytes32 _batcherHash, - uint64 _gasLimit, - address _unsafeBlockSigner, - IResourceMetering.ResourceConfig memory _config, - address _batchInbox, - SystemConfig.Addresses memory _addresses, - address _dependencyManager, - uint256 _l2ChainId - ) - external - { - // This method has an initializer modifier, and will revert if already initialized. - initialize({ - _owner: _owner, - _basefeeScalar: _basefeeScalar, - _blobbasefeeScalar: _blobbasefeeScalar, - _batcherHash: _batcherHash, - _gasLimit: _gasLimit, - _unsafeBlockSigner: _unsafeBlockSigner, - _config: _config, - _batchInbox: _batchInbox, - _addresses: _addresses, - _l2ChainId: _l2ChainId - }); - Storage.setAddress(DEPENDENCY_MANAGER_SLOT, _dependencyManager); - } - - /// @custom:semver +interop.2 - function version() public pure override returns (string memory) { - return string.concat(super.version(), "+interop.2"); - } - - /// @notice Adds a chain to the interop dependency set. Can only be called by the dependency manager. - /// @param _chainId Chain ID of chain to add. - function addDependency(uint256 _chainId) external { - require(msg.sender == dependencyManager(), "SystemConfig: caller is not the dependency manager"); - IOptimismPortal(payable(optimismPortal())).setConfig( - ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId) - ); - } - - /// @notice Removes a chain from the interop dependency set. Can only be called by the dependency manager - /// @param _chainId Chain ID of the chain to remove. - function removeDependency(uint256 _chainId) external { - require(msg.sender == dependencyManager(), "SystemConfig: caller is not the dependency manager"); - IOptimismPortal(payable(optimismPortal())).setConfig( - ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId) - ); - } - - /// @notice getter for the dependency manager address - function dependencyManager() public view returns (address) { - return Storage.getAddress(DEPENDENCY_MANAGER_SLOT); - } -} diff --git a/packages/contracts-bedrock/test/L1/ETHLockbox.t.sol b/packages/contracts-bedrock/test/L1/ETHLockbox.t.sol index 17ade24455429..963a4d608a760 100644 --- a/packages/contracts-bedrock/test/L1/ETHLockbox.t.sol +++ b/packages/contracts-bedrock/test/L1/ETHLockbox.t.sol @@ -157,6 +157,12 @@ contract ETHLockboxTest is CommonTest { address(_portal), abi.encodeCall(IProxyAdminOwnedBase.proxyAdminOwner, ()), abi.encode(proxyAdminOwner) ); + // Mock the SuperchainConfig on the portal to be the same as the SuperchainConfig on the + // lockbox. + vm.mockCall( + address(_portal), abi.encodeCall(IOptimismPortal.superchainConfig, ()), abi.encode(superchainConfig) + ); + // Set the portal as an authorized portal if needed if (!ethLockbox.authorizedPortals(address(_portal))) { vm.prank(proxyAdminOwner); @@ -269,6 +275,12 @@ contract ETHLockboxTest is CommonTest { address(_portal), abi.encodeCall(IProxyAdminOwnedBase.proxyAdminOwner, ()), abi.encode(proxyAdminOwner) ); + // Mock the SuperchainConfig on the portal to be the same as the SuperchainConfig on the + // lockbox. + vm.mockCall( + address(_portal), abi.encodeCall(IOptimismPortal.superchainConfig, ()), abi.encode(superchainConfig) + ); + // Set the portal as an authorized portal if needed if (!ethLockbox.authorizedPortals(address(_portal))) { vm.prank(proxyAdminOwner); @@ -324,6 +336,28 @@ contract ETHLockboxTest is CommonTest { ethLockbox.authorizePortal(_portal); } + /// @notice Tests the authorizePortal function reverts when the portal has a different + /// SuperchainConfig than the one configured in the lockbox. + /// @param _portal The portal to authorize. + function testFuzz_authorizePortal_differentSuperchainConfig_reverts(IOptimismPortal2 _portal) public { + assumeNotForgeAddress(address(_portal)); + + // Mock the portal to have the right proxyAdminOwner. + vm.mockCall( + address(_portal), abi.encodeCall(IProxyAdminOwnedBase.proxyAdminOwner, ()), abi.encode(proxyAdminOwner) + ); + + // Mock the portal to have the wrong SuperchainConfig. + vm.mockCall(address(_portal), abi.encodeCall(IOptimismPortal.superchainConfig, ()), abi.encode(address(0))); + + // Expect the revert with `DifferentSuperchainConfig` selector + vm.expectRevert(IETHLockbox.ETHLockbox_DifferentSuperchainConfig.selector); + + // Call the `authorizePortal` function + vm.prank(proxyAdminOwner); + ethLockbox.authorizePortal(_portal); + } + /// @notice Tests the `authorizeLockbox` function succeeds using the `optimismPortal2` address as the portal. function test_authorizePortal_succeeds() public { // Calculate the correct storage slot for the mapping value @@ -355,6 +389,12 @@ contract ETHLockboxTest is CommonTest { address(_portal), abi.encodeCall(IProxyAdminOwnedBase.proxyAdminOwner, ()), abi.encode(proxyAdminOwner) ); + // Mock the SuperchainConfig on the portal to be the same as the SuperchainConfig on the + // Lockbox. + vm.mockCall( + address(_portal), abi.encodeCall(IOptimismPortal.superchainConfig, ()), abi.encode(superchainConfig) + ); + // Expect the `PortalAuthorized` event to be emitted vm.expectEmit(address(ethLockbox)); emit PortalAuthorized(address(_portal)); diff --git a/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol b/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol index 80880840d8bef..1286d8f8e67f2 100644 --- a/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol +++ b/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol @@ -32,11 +32,11 @@ import { IProxyAdmin } from "interfaces/universal/IProxyAdmin.sol"; import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol"; import { IProtocolVersions } from "interfaces/L1/IProtocolVersions.sol"; import { IPreimageOracle } from "interfaces/cannon/IPreimageOracle.sol"; +import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol"; import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol"; import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol"; -import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol"; import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol"; import { IOPContractsManager, @@ -46,7 +46,6 @@ import { IOPContractsManagerUpgrader, IOPContractsManagerContractsContainer } from "interfaces/L1/IOPContractsManager.sol"; -import { IOPContractsManagerLegacyUpgrade } from "interfaces/L1/IOPContractsManagerLegacyUpgrade.sol"; import { ISemver } from "interfaces/universal/ISemver.sol"; import { IETHLockbox } from "interfaces/L1/IETHLockbox.sol"; @@ -148,7 +147,6 @@ contract OPContractsManager_Deploy_Test is DeployOPChain_TestBase { startingAnchorRoot: _doi.startingAnchorRoot(), saltMixer: _doi.saltMixer(), gasLimit: _doi.gasLimit(), - disputeGameUsesSuperRoots: _doi.disputeGameUsesSuperRoots(), disputeGameType: _doi.disputeGameType(), disputeAbsolutePrestate: _doi.disputeAbsolutePrestate(), disputeMaxGameDepth: _doi.disputeMaxGameDepth(), @@ -273,8 +271,7 @@ contract OPContractsManager_Upgrade_Harness is CommonTest { IOPContractsManager.OpChainConfig({ systemConfigProxy: systemConfig, proxyAdmin: proxyAdmin, - absolutePrestate: absolutePrestate, - disputeGameUsesSuperRoots: false + absolutePrestate: absolutePrestate }) ); @@ -289,29 +286,6 @@ contract OPContractsManager_Upgrade_Harness is CommonTest { faultDisputeGame = IFaultDisputeGame(address(artifacts.mustGetAddress("FaultDisputeGame"))); } - /// @notice Converts the new OpChainConfig struct to the legacy OpChainConfig struct format. - /// This function is used to test Upgrade 13 and 14 paths and can be safely removed - /// after those upgrades are completed. Only difference in the new struct is the added - /// disputeGameUsesSuperRoots boolean. - /// @param _opChainConfigs The new OpChainConfig structs to convert. - /// @return The legacy OpChainConfig structs. - function convertToLegacyConfigs(IOPContractsManager.OpChainConfig[] memory _opChainConfigs) - public - pure - returns (IOPContractsManagerLegacyUpgrade.OpChainConfig[] memory) - { - IOPContractsManagerLegacyUpgrade.OpChainConfig[] memory legacyConfigs = - new IOPContractsManagerLegacyUpgrade.OpChainConfig[](_opChainConfigs.length); - for (uint256 i = 0; i < _opChainConfigs.length; i++) { - legacyConfigs[i] = IOPContractsManagerLegacyUpgrade.OpChainConfig({ - systemConfigProxy: _opChainConfigs[i].systemConfigProxy, - proxyAdmin: _opChainConfigs[i].proxyAdmin, - absolutePrestate: _opChainConfigs[i].absolutePrestate - }); - } - return legacyConfigs; - } - function expectEmitUpgraded(address impl, address proxy) public { vm.expectEmit(proxy); emit Upgraded(impl); @@ -379,8 +353,7 @@ contract OPContractsManager_Upgrade_Harness is CommonTest { vm.etch(_delegateCaller, vm.getDeployedCode("test/mocks/Callers.sol:DelegateCaller")); DelegateCaller(_delegateCaller).dcForward( - address(deployedOPCM), - abi.encodeCall(IOPContractsManagerLegacyUpgrade.upgrade, (convertToLegacyConfigs(opChainConfigs))) + address(deployedOPCM), abi.encodeCall(IOPContractsManager.upgrade, (opChainConfigs)) ); VmSafe.Gas memory gas = vm.lastCallGas(); @@ -427,7 +400,6 @@ contract OPContractsManager_Upgrade_Harness is CommonTest { } function runUpgrade14UpgradeAndChecks(address _delegateCaller) public { - // TODO(#14665): Replace this address with once the final OPCM is deployed for Upgrade 14. IOPContractsManager deployedOPCM = IOPContractsManager(address(0x3A1f523a4bc09cd344A2745a108Bb0398288094F)); IOPCMImplementationsWithoutLockbox.Implementations memory impls = IOPCMImplementationsWithoutLockbox(address(deployedOPCM)).implementations(); @@ -461,8 +433,7 @@ contract OPContractsManager_Upgrade_Harness is CommonTest { vm.etch(_delegateCaller, vm.getDeployedCode("test/mocks/Callers.sol:DelegateCaller")); DelegateCaller(_delegateCaller).dcForward( - address(deployedOPCM), - abi.encodeCall(IOPContractsManagerLegacyUpgrade.upgrade, (convertToLegacyConfigs(opChainConfigs))) + address(deployedOPCM), abi.encodeCall(IOPContractsManager.upgrade, (opChainConfigs)) ); VmSafe.Gas memory gas = vm.lastCallGas(); @@ -590,7 +561,7 @@ contract OPContractsManager_Upgrade_Harness is CommonTest { // Make sure that the OptimismPortal is upgraded to the right version. It must also have a // reference to the new AnchorStateRegistry. - assertEq(ISemver(address(optimismPortal2)).version(), "4.0.0"); + assertEq(ISemver(address(optimismPortal2)).version(), "4.1.0"); assertEq(impls.optimismPortalImpl, EIP1967Helper.getImplementation(address(optimismPortal2))); assertEq(address(optimismPortal2.anchorStateRegistry()), address(newAsrProxy)); DeployUtils.assertInitialized({ @@ -677,6 +648,79 @@ contract OPContractsManager_Upgrade_Test is OPContractsManager_Upgrade_Harness { // Try to upgrade the current OPChain runUpgradeTestAndChecks(upgrader); } + + /// @notice Tests that the absolute prestate can be overridden using the upgrade config. + function test_upgrade_absolutePrestateOverride_succeeds() public { + // Run Upgrade 13 and 14 to get us to a state where we can run Upgrade 15. + // Can remove these two calls as Upgrade 13 and 14 are executed in prod. + runV200UpgradeAndChecks(upgrader); + runUpgrade14UpgradeAndChecks(upgrader); + + // Get the pdg and fdg before the upgrade + Claim pdgPrestateBefore = IPermissionedDisputeGame( + address(disputeGameFactory.gameImpls(GameTypes.PERMISSIONED_CANNON)) + ).absolutePrestate(); + Claim fdgPrestateBefore = + IFaultDisputeGame(address(disputeGameFactory.gameImpls(GameTypes.CANNON))).absolutePrestate(); + + // Assert that the prestate is not zero. + assertNotEq(pdgPrestateBefore.raw(), bytes32(0)); + assertNotEq(fdgPrestateBefore.raw(), bytes32(0)); + + // Set the absolute prestate input to something non-zero. + opChainConfigs[0].absolutePrestate = Claim.wrap(bytes32(uint256(1))); + + // Now run Upgrade 15. + runUpgrade15UpgradeAndChecks(upgrader); + + // Get the absolute prestate after the upgrade + Claim pdgPrestateAfter = IPermissionedDisputeGame( + address(disputeGameFactory.gameImpls(GameTypes.PERMISSIONED_CANNON)) + ).absolutePrestate(); + Claim fdgPrestateAfter = + IFaultDisputeGame(address(disputeGameFactory.gameImpls(GameTypes.CANNON))).absolutePrestate(); + + // Assert that the absolute prestate is the non-zero value we set. + assertEq(pdgPrestateAfter.raw(), bytes32(uint256(1))); + assertEq(fdgPrestateAfter.raw(), bytes32(uint256(1))); + } + + /// @notice Tests that the old absolute prestate is used if the upgrade config does not set an + /// absolute prestate. + function test_upgrade_absolutePrestateNotSet_succeeds() public { + // Run Upgrade 13 and 14 to get us to a state where we can run Upgrade 15. + // Can remove these two calls as Upgrade 13 and 14 are executed in prod. + runV200UpgradeAndChecks(upgrader); + runUpgrade14UpgradeAndChecks(upgrader); + + // Get the pdg and fdg before the upgrade + Claim pdgPrestateBefore = IPermissionedDisputeGame( + address(disputeGameFactory.gameImpls(GameTypes.PERMISSIONED_CANNON)) + ).absolutePrestate(); + Claim fdgPrestateBefore = + IFaultDisputeGame(address(disputeGameFactory.gameImpls(GameTypes.CANNON))).absolutePrestate(); + + // Assert that the prestate is not zero. + assertNotEq(pdgPrestateBefore.raw(), bytes32(0)); + assertNotEq(fdgPrestateBefore.raw(), bytes32(0)); + + // Set the absolute prestate input to zero. + opChainConfigs[0].absolutePrestate = Claim.wrap(bytes32(0)); + + // Now run Upgrade 15. + runUpgrade15UpgradeAndChecks(upgrader); + + // Get the absolute prestate after the upgrade + Claim pdgPrestateAfter = IPermissionedDisputeGame( + address(disputeGameFactory.gameImpls(GameTypes.PERMISSIONED_CANNON)) + ).absolutePrestate(); + Claim fdgPrestateAfter = + IFaultDisputeGame(address(disputeGameFactory.gameImpls(GameTypes.CANNON))).absolutePrestate(); + + // Assert that the absolute prestate is the same as before the upgrade. + assertEq(pdgPrestateAfter.raw(), pdgPrestateBefore.raw()); + assertEq(fdgPrestateAfter.raw(), fdgPrestateBefore.raw()); + } } contract OPContractsManager_Upgrade_TestFails is OPContractsManager_Upgrade_Harness { @@ -705,8 +749,24 @@ contract OPContractsManager_Upgrade_TestFails is OPContractsManager_Upgrade_Harn ); } + /// @notice Tests that upgrade reverts when absolutePrestate is zero and the existing game also + /// has an absolute prestate of zero. function test_upgrade_absolutePrestateNotSet_reverts() public { + // Set the config to try to update the absolutePrestate to zero. opChainConfigs[0].absolutePrestate = Claim.wrap(bytes32(0)); + + // Get the address of the PermissionedDisputeGame. + IPermissionedDisputeGame pdg = + IPermissionedDisputeGame(address(disputeGameFactory.gameImpls(GameTypes.PERMISSIONED_CANNON))); + + // Mock the PDG to return a prestate of zero. + vm.mockCall( + address(pdg), + abi.encodeCall(IPermissionedDisputeGame.absolutePrestate, ()), + abi.encode(Claim.wrap(bytes32(0))) + ); + + // Expect the upgrade to revert with PrestateNotSet. vm.expectRevert(IOPContractsManager.PrestateNotSet.selector); DelegateCaller(upgrader).dcForward(address(opcm), abi.encodeCall(IOPContractsManager.upgrade, (opChainConfigs))); } @@ -929,7 +989,6 @@ contract OPContractsManager_AddGameType_Test is Test { l2ChainId: 100, saltMixer: "hello", gasLimit: 30_000_000, - disputeGameUsesSuperRoots: false, disputeGameType: GameType.wrap(1), disputeAbsolutePrestate: Claim.wrap( bytes32(hex"038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c") @@ -1286,7 +1345,6 @@ contract OPContractsManager_UpdatePrestate_Test is Test { l2ChainId: 100, saltMixer: "hello", gasLimit: 30_000_000, - disputeGameUsesSuperRoots: false, disputeGameType: GameType.wrap(1), disputeAbsolutePrestate: Claim.wrap( bytes32(hex"038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c") @@ -1308,10 +1366,7 @@ contract OPContractsManager_UpdatePrestate_Test is Test { function test_updatePrestate_pdgOnlyWithValidInput_succeeds() public { IOPContractsManager.OpChainConfig[] memory inputs = new IOPContractsManager.OpChainConfig[](1); inputs[0] = IOPContractsManager.OpChainConfig( - chainDeployOutput.systemConfigProxy, - chainDeployOutput.opChainProxyAdmin, - Claim.wrap(bytes32(hex"ABBA")), - false + chainDeployOutput.systemConfigProxy, chainDeployOutput.opChainProxyAdmin, Claim.wrap(bytes32(hex"ABBA")) ); address proxyAdminOwner = chainDeployOutput.opChainProxyAdmin.owner(); @@ -1342,10 +1397,7 @@ contract OPContractsManager_UpdatePrestate_Test is Test { IOPContractsManager.OpChainConfig[] memory inputs = new IOPContractsManager.OpChainConfig[](1); inputs[0] = IOPContractsManager.OpChainConfig( - chainDeployOutput.systemConfigProxy, - chainDeployOutput.opChainProxyAdmin, - Claim.wrap(bytes32(hex"ABBA")), - false + chainDeployOutput.systemConfigProxy, chainDeployOutput.opChainProxyAdmin, Claim.wrap(bytes32(hex"ABBA")) ); address proxyAdminOwner = chainDeployOutput.opChainProxyAdmin.owner(); @@ -1382,8 +1434,7 @@ contract OPContractsManager_UpdatePrestate_Test is Test { inputs[0] = IOPContractsManager.OpChainConfig({ systemConfigProxy: chainDeployOutput.systemConfigProxy, proxyAdmin: chainDeployOutput.opChainProxyAdmin, - absolutePrestate: Claim.wrap(bytes32(0)), - disputeGameUsesSuperRoots: false + absolutePrestate: Claim.wrap(bytes32(0)) }); address proxyAdminOwner = chainDeployOutput.opChainProxyAdmin.owner(); diff --git a/packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol b/packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol index c0c05e6f327e4..35b8fb014c69c 100644 --- a/packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol +++ b/packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol @@ -101,7 +101,7 @@ contract OptimismPortal2_Test is CommonTest { // Call the upgrade function. vm.prank(Predeploys.PROXY_ADMIN); - optimismPortal2.upgrade(IAnchorStateRegistry(_newAnchorStateRegistry), IETHLockbox(ethLockbox), true); + optimismPortal2.upgrade(IAnchorStateRegistry(_newAnchorStateRegistry), IETHLockbox(ethLockbox)); // Assert the portal is properly upgraded. assertEq(address(optimismPortal2.ethLockbox()), address(ethLockbox)); @@ -469,27 +469,52 @@ contract OptimismPortal2_Test is CommonTest { assertEq(accountAccesses[2].storageAccesses.length, 0); } - /// @dev Tests that `updateLockbox` reverts if the caller is not the proxy admin owner. - function testFuzz_updateLockbox_notProxyAdminOwner_reverts(address _caller) external { + /// @dev Tests that `migrateToSuperRoots` reverts if the caller is not the proxy admin owner. + function testFuzz_migrateToSuperRoots_notProxyAdminOwner_reverts(address _caller) external { vm.assume(_caller != optimismPortal2.proxyAdminOwner()); vm.expectRevert(IOptimismPortal.OptimismPortal_Unauthorized.selector); vm.prank(_caller); - optimismPortal2.updateLockbox(IETHLockbox(address(1))); + optimismPortal2.migrateToSuperRoots(IETHLockbox(address(1)), IAnchorStateRegistry(address(1))); } - /// @dev Tests that `updateLockbox` updates the ETHLockbox contract. - function testFuzz_updateLockbox_succeeds(address _newLockbox) external { + /// @dev Tests that `migrateToSuperRoots` reverts if the new registry is the same as the + /// current one. + /// @param _newLockbox The new ETHLockbox to migrate to. + function testFuzz_migrateToSuperRoots_usingSameRegistry_reverts(address _newLockbox) external { + vm.assume(_newLockbox != address(optimismPortal2.ethLockbox())); + + // Use the same registry as the current one. + IAnchorStateRegistry newAnchorStateRegistry = optimismPortal2.anchorStateRegistry(); + + // Trigger the call from the right address. + address caller = optimismPortal2.proxyAdminOwner(); + + // Expect the migration to revert. + vm.expectRevert(IOptimismPortal.OptimismPortal_MigratingToSameRegistry.selector); + vm.prank(caller); + optimismPortal2.migrateToSuperRoots(IETHLockbox(_newLockbox), newAnchorStateRegistry); + } + + /// @dev Tests that `migrateToSuperRoots` updates the ETHLockbox contract, updates the + /// AnchorStateRegistry, and sets the superRootsActive flag to true. + /// @param _newLockbox The new ETHLockbox to migrate to. + /// @param _newAnchorStateRegistry The new AnchorStateRegistry to migrate to. + function testFuzz_migrateToSuperRoots_succeeds(address _newLockbox, address _newAnchorStateRegistry) external { address oldLockbox = address(optimismPortal2.ethLockbox()); + address oldAnchorStateRegistry = address(optimismPortal2.anchorStateRegistry()); vm.assume(_newLockbox != oldLockbox); + vm.assume(_newAnchorStateRegistry != oldAnchorStateRegistry); vm.expectEmit(address(optimismPortal2)); - emit LockboxUpdated(oldLockbox, _newLockbox); + emit PortalMigrated(oldLockbox, _newLockbox, oldAnchorStateRegistry, _newAnchorStateRegistry); vm.prank(optimismPortal2.proxyAdminOwner()); - optimismPortal2.updateLockbox(IETHLockbox(_newLockbox)); + optimismPortal2.migrateToSuperRoots(IETHLockbox(_newLockbox), IAnchorStateRegistry(_newAnchorStateRegistry)); assertEq(address(optimismPortal2.ethLockbox()), _newLockbox); + assertEq(address(optimismPortal2.anchorStateRegistry()), _newAnchorStateRegistry); + assertTrue(optimismPortal2.superRootsActive()); } } @@ -2137,15 +2162,12 @@ contract OptimismPortal2_upgrade_Test is CommonTest { vm.store(address(optimismPortal2), bytes32(slot.slot), bytes32(0)); // Trigger upgrade(). - optimismPortal2.upgrade(IAnchorStateRegistry(address(0xdeadbeef)), IETHLockbox(ethLockbox), true); + optimismPortal2.upgrade(IAnchorStateRegistry(address(0xdeadbeef)), IETHLockbox(ethLockbox)); // Verify that the initialized slot was updated. bytes32 initializedSlotAfter = vm.load(address(optimismPortal2), bytes32(slot.slot)); assertEq(initializedSlotAfter, bytes32(uint256(2))); - // Verify that superRootsActive was set to true. - assertEq(optimismPortal2.superRootsActive(), true); - // Verify that the AnchorStateRegistry was set. assertEq(address(optimismPortal2.anchorStateRegistry()), address(0xdeadbeef)); } @@ -2159,11 +2181,11 @@ contract OptimismPortal2_upgrade_Test is CommonTest { vm.store(address(optimismPortal2), bytes32(slot.slot), bytes32(0)); // Trigger first upgrade. - optimismPortal2.upgrade(IAnchorStateRegistry(address(0xdeadbeef)), IETHLockbox(ethLockbox), true); + optimismPortal2.upgrade(IAnchorStateRegistry(address(0xdeadbeef)), IETHLockbox(ethLockbox)); // Try to trigger second upgrade. vm.expectRevert("Initializable: contract is already initialized"); - optimismPortal2.upgrade(IAnchorStateRegistry(address(0xdeadbeef)), IETHLockbox(ethLockbox), true); + optimismPortal2.upgrade(IAnchorStateRegistry(address(0xdeadbeef)), IETHLockbox(ethLockbox)); } /// @notice Tests that the upgrade() function reverts if called after initialization. @@ -2180,7 +2202,7 @@ contract OptimismPortal2_upgrade_Test is CommonTest { // Try to trigger upgrade(). vm.expectRevert("Initializable: contract is already initialized"); - optimismPortal2.upgrade(IAnchorStateRegistry(address(0xdeadbeef)), IETHLockbox(ethLockbox), true); + optimismPortal2.upgrade(IAnchorStateRegistry(address(0xdeadbeef)), IETHLockbox(ethLockbox)); } } diff --git a/packages/contracts-bedrock/test/L1/OptimismPortalInterop.t.sol b/packages/contracts-bedrock/test/L1/OptimismPortalInterop.t.sol deleted file mode 100644 index 3a8c9973e62dc..0000000000000 --- a/packages/contracts-bedrock/test/L1/OptimismPortalInterop.t.sol +++ /dev/null @@ -1,79 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -// Testing -import { CommonTest } from "test/setup/CommonTest.sol"; - -// Libraries -import { Constants } from "src/libraries/Constants.sol"; -import { Predeploys } from "src/libraries/Predeploys.sol"; - -// Interfaces -import { IL1BlockInterop, ConfigType } from "interfaces/L2/IL1BlockInterop.sol"; -import { IOptimismPortalInterop } from "interfaces/L1/IOptimismPortalInterop.sol"; - -contract OptimismPortalInterop_Test is CommonTest { - /// @notice Marked virtual to be overridden in - /// test/kontrol/deployment/DeploymentSummary.t.sol - function setUp() public virtual override { - super.enableInterop(); - super.setUp(); - } - - /// @notice Tests that the version function returns a valid string. We avoid testing the - /// specific value of the string as it changes frequently. - function test_version_succeeds() external view { - assert(bytes(_optimismPortalInterop().version()).length > 0); - } - - /// @dev Tests that the config for adding a dependency can be set. - function testFuzz_setConfig_addDependency_succeeds(bytes calldata _value) public { - vm.expectEmit(address(optimismPortal2)); - emitTransactionDeposited({ - _from: Constants.DEPOSITOR_ACCOUNT, - _to: Predeploys.L1_BLOCK_ATTRIBUTES, - _value: 0, - _mint: 0, - _gasLimit: 200_000, - _isCreation: false, - _data: abi.encodeCall(IL1BlockInterop.setConfig, (ConfigType.ADD_DEPENDENCY, _value)) - }); - - vm.prank(address(_optimismPortalInterop().systemConfig())); - _optimismPortalInterop().setConfig(ConfigType.ADD_DEPENDENCY, _value); - } - - /// @dev Tests that setting the add dependency config as not the system config reverts. - function testFuzz_setConfig_addDependencyButNotSystemConfig_reverts(bytes calldata _value) public { - vm.expectRevert(IOptimismPortalInterop.OptimismPortal_Unauthorized.selector); - _optimismPortalInterop().setConfig(ConfigType.ADD_DEPENDENCY, _value); - } - - /// @dev Tests that the config for removing a dependency can be set. - function testFuzz_setConfig_removeDependency_succeeds(bytes calldata _value) public { - vm.expectEmit(address(optimismPortal2)); - emitTransactionDeposited({ - _from: Constants.DEPOSITOR_ACCOUNT, - _to: Predeploys.L1_BLOCK_ATTRIBUTES, - _value: 0, - _mint: 0, - _gasLimit: 200_000, - _isCreation: false, - _data: abi.encodeCall(IL1BlockInterop.setConfig, (ConfigType.REMOVE_DEPENDENCY, _value)) - }); - - vm.prank(address(_optimismPortalInterop().systemConfig())); - _optimismPortalInterop().setConfig(ConfigType.REMOVE_DEPENDENCY, _value); - } - - /// @dev Tests that setting the remove dependency config as not the system config reverts. - function testFuzz_setConfig_removeDependencyButNotSystemConfig_reverts(bytes calldata _value) public { - vm.expectRevert(IOptimismPortalInterop.OptimismPortal_Unauthorized.selector); - _optimismPortalInterop().setConfig(ConfigType.REMOVE_DEPENDENCY, _value); - } - - /// @dev Returns the OptimismPortalInterop instance. - function _optimismPortalInterop() internal view returns (IOptimismPortalInterop) { - return IOptimismPortalInterop(payable(address(optimismPortal2))); - } -} diff --git a/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol b/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol deleted file mode 100644 index 2f953ef7413f4..0000000000000 --- a/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol +++ /dev/null @@ -1,77 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -// Testing -import { CommonTest } from "test/setup/CommonTest.sol"; - -// Libraries -import { StaticConfig } from "src/libraries/StaticConfig.sol"; - -// Interfaces -import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol"; -import { IOptimismPortalInterop } from "interfaces/L1/IOptimismPortalInterop.sol"; -import { ConfigType } from "interfaces/L2/IL1BlockInterop.sol"; - -contract SystemConfigInterop_Test is CommonTest { - /// @notice Marked virtual to be overridden in - /// test/kontrol/deployment/DeploymentSummary.t.sol - function setUp() public virtual override { - super.enableInterop(); - super.setUp(); - } - - /// @notice Tests that the version function returns a valid string. We avoid testing the - /// specific value of the string as it changes frequently. - function test_version_succeeds() external view { - assert(bytes(_systemConfigInterop().version()).length > 0); - } - - /// @dev Tests that a dependency can be added. - function testFuzz_addDependency_succeeds(uint256 _chainId) public { - vm.expectCall( - address(optimismPortal2), - abi.encodeCall( - IOptimismPortalInterop.setConfig, - (ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)) - ) - ); - - vm.prank(_systemConfigInterop().dependencyManager()); - _systemConfigInterop().addDependency(_chainId); - } - - /// @dev Tests that adding a dependency as not the dependency manager reverts. - function testFuzz_addDependency_notDependencyManager_reverts(uint256 _chainId) public { - require(alice != _systemConfigInterop().dependencyManager(), "SystemConfigInterop_Test: 100"); - vm.expectRevert("SystemConfig: caller is not the dependency manager"); - vm.prank(alice); - _systemConfigInterop().addDependency(_chainId); - } - - /// @dev Tests that a dependency can be removed. - function testFuzz_removeDependency_succeeds(uint256 _chainId) public { - vm.expectCall( - address(optimismPortal2), - abi.encodeCall( - IOptimismPortalInterop.setConfig, - (ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId)) - ) - ); - - vm.prank(_systemConfigInterop().dependencyManager()); - _systemConfigInterop().removeDependency(_chainId); - } - - /// @dev Tests that removing a dependency as not the dependency manager reverts. - function testFuzz_removeDependency_notDependencyManager_reverts(uint256 _chainId) public { - require(alice != _systemConfigInterop().dependencyManager(), "SystemConfigInterop_Test: 100"); - vm.expectRevert("SystemConfig: caller is not the dependency manager"); - vm.prank(alice); - _systemConfigInterop().removeDependency(_chainId); - } - - /// @dev Returns the SystemConfigInterop instance. - function _systemConfigInterop() internal view returns (ISystemConfigInterop) { - return ISystemConfigInterop(address(systemConfig)); - } -} diff --git a/packages/contracts-bedrock/test/opcm/DeployImplementations.t.sol b/packages/contracts-bedrock/test/opcm/DeployImplementations.t.sol index 07d577e642239..895aa9e082266 100644 --- a/packages/contracts-bedrock/test/opcm/DeployImplementations.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployImplementations.t.sol @@ -30,7 +30,6 @@ import { IETHLockbox } from "interfaces/L1/IETHLockbox.sol"; import { DeployImplementationsInput, DeployImplementations, - DeployImplementationsInterop, DeployImplementationsOutput } from "scripts/deploy/DeployImplementations.s.sol"; @@ -259,7 +258,6 @@ contract DeployImplementations_Test is Test { // By deploying the `DeployImplementations` contract with this virtual function, we provide a // hook that child contracts can override to return a different implementation of the contract. - // This lets us test e.g. the `DeployImplementationsInterop` contract without duplicating test code. function createDeployImplementationsContract() internal virtual returns (DeployImplementations) { return new DeployImplementations(); } @@ -459,9 +457,3 @@ contract DeployImplementations_Test is Test { deployImplementations.run(dii, dio); } } - -contract DeployImplementationsInterop_Test is DeployImplementations_Test { - function createDeployImplementationsContract() internal override returns (DeployImplementations) { - return new DeployImplementationsInterop(); - } -} diff --git a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol index 48d8046873390..73959dbb0e5c3 100644 --- a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol @@ -7,7 +7,6 @@ import { DeploySuperchainInput, DeploySuperchain, DeploySuperchainOutput } from import { DeployImplementationsInput, DeployImplementations, - DeployImplementationsInterop, DeployImplementationsOutput } from "scripts/deploy/DeployImplementations.s.sol"; import { DeployOPChainInput, DeployOPChain, DeployOPChainOutput } from "scripts/deploy/DeployOPChain.s.sol"; @@ -522,9 +521,3 @@ contract DeployOPChain_Test is DeployOPChain_TestBase { doi.set(doi.disputeMaxClockDuration.selector, disputeMaxClockDuration); } } - -contract DeployOPChain_Test_Interop is DeployOPChain_Test { - function createDeployImplementationsContract() internal override returns (DeployImplementations) { - return new DeployImplementationsInterop(); - } -} diff --git a/packages/contracts-bedrock/test/opcm/ManageDependencies.t.sol b/packages/contracts-bedrock/test/opcm/ManageDependencies.t.sol deleted file mode 100644 index aeac3e23a0b1f..0000000000000 --- a/packages/contracts-bedrock/test/opcm/ManageDependencies.t.sol +++ /dev/null @@ -1,95 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import { Test } from "forge-std/Test.sol"; -import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol"; -import { ManageDependencies, ManageDependenciesInput } from "scripts/deploy/ManageDependencies.s.sol"; - -contract ManageDependencies_Test is Test { - ManageDependencies script; - ManageDependenciesInput input; - address mockSystemConfig; - uint256 testChainId; - - event DependencyAdded(uint256 indexed chainId); - event DependencyRemoved(uint256 indexed chainId); - - function setUp() public { - script = new ManageDependencies(); - input = new ManageDependenciesInput(); - mockSystemConfig = makeAddr("systemConfig"); - testChainId = 123; - - vm.etch(mockSystemConfig, hex"01"); - } - - function test_run_add_succeeds() public { - input.set(input.systemConfig.selector, mockSystemConfig); - input.set(input.chainId.selector, testChainId); - input.set(input.remove.selector, false); - - // Expect the addDependency call - vm.mockCall(mockSystemConfig, abi.encodeCall(ISystemConfigInterop.addDependency, testChainId), bytes("")); - script.run(input); - } - - function test_run_remove_succeeds() public { - input.set(input.systemConfig.selector, mockSystemConfig); - input.set(input.chainId.selector, testChainId); - input.set(input.remove.selector, true); - - vm.mockCall(mockSystemConfig, abi.encodeCall(ISystemConfigInterop.removeDependency, testChainId), bytes("")); - script.run(input); - } -} - -contract ManageDependenciesInput_Test is Test { - ManageDependenciesInput input; - - function setUp() public { - input = new ManageDependenciesInput(); - } - - function test_getters_whenNotSet_reverts() public { - vm.expectRevert("ManageDependenciesInput: not set"); - input.chainId(); - - vm.expectRevert("ManageDependenciesInput: not set"); - input.systemConfig(); - - // remove() doesn't revert when not set, returns false - assertFalse(input.remove()); - } - - function test_set_succeeds() public { - address systemConfig = makeAddr("systemConfig"); - uint256 chainId = 123; - bool remove = true; - - vm.etch(systemConfig, hex"01"); - - input.set(input.systemConfig.selector, systemConfig); - input.set(input.chainId.selector, chainId); - input.set(input.remove.selector, remove); - - assertEq(address(input.systemConfig()), systemConfig); - assertEq(input.chainId(), chainId); - assertTrue(input.remove()); - } - - function test_set_withZeroAddress_reverts() public { - vm.expectRevert("ManageDependenciesInput: cannot set zero address"); - input.set(input.systemConfig.selector, address(0)); - } - - function test_set_withInvalidSelector_reverts() public { - vm.expectRevert("ManageDependenciesInput: unknown selector"); - input.set(bytes4(0xdeadbeef), makeAddr("test")); - - vm.expectRevert("ManageDependenciesInput: unknown selector"); - input.set(bytes4(0xdeadbeef), uint256(1)); - - vm.expectRevert("ManageDependenciesInput: unknown selector"); - input.set(bytes4(0xdeadbeef), true); - } -} diff --git a/packages/contracts-bedrock/test/opcm/UpgradeOPChain.t.sol b/packages/contracts-bedrock/test/opcm/UpgradeOPChain.t.sol index 8b4944be7077a..06e20c078c122 100644 --- a/packages/contracts-bedrock/test/opcm/UpgradeOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/UpgradeOPChain.t.sol @@ -55,8 +55,7 @@ contract UpgradeOPChainInput_Test is Test { configs[0] = OPContractsManager.OpChainConfig({ systemConfigProxy: ISystemConfig(systemConfig1), proxyAdmin: IProxyAdmin(proxyAdmin1), - absolutePrestate: Claim.wrap(bytes32(uint256(1))), - disputeGameUsesSuperRoots: false + absolutePrestate: Claim.wrap(bytes32(uint256(1))) }); // Setup mock addresses and contracts for second config @@ -68,8 +67,7 @@ contract UpgradeOPChainInput_Test is Test { configs[1] = OPContractsManager.OpChainConfig({ systemConfigProxy: ISystemConfig(systemConfig2), proxyAdmin: IProxyAdmin(proxyAdmin2), - absolutePrestate: Claim.wrap(bytes32(uint256(2))), - disputeGameUsesSuperRoots: false + absolutePrestate: Claim.wrap(bytes32(uint256(2))) }); input.set(input.opChainConfigs.selector, configs); @@ -113,8 +111,7 @@ contract UpgradeOPChainInput_Test is Test { configs[0] = OPContractsManager.OpChainConfig({ systemConfigProxy: ISystemConfig(mockSystemConfig), proxyAdmin: IProxyAdmin(mockProxyAdmin), - absolutePrestate: Claim.wrap(bytes32(uint256(1))), - disputeGameUsesSuperRoots: false + absolutePrestate: Claim.wrap(bytes32(uint256(1))) }); vm.expectRevert("UpgradeOPCMInput: unknown selector"); @@ -150,8 +147,7 @@ contract UpgradeOPChain_Test is Test { config = OPContractsManager.OpChainConfig({ systemConfigProxy: ISystemConfig(makeAddr("systemConfigProxy")), proxyAdmin: IProxyAdmin(makeAddr("proxyAdmin")), - absolutePrestate: Claim.wrap(keccak256("absolutePrestate")), - disputeGameUsesSuperRoots: false + absolutePrestate: Claim.wrap(keccak256("absolutePrestate")) }); OPContractsManager.OpChainConfig[] memory configs = new OPContractsManager.OpChainConfig[](1); configs[0] = config; diff --git a/packages/contracts-bedrock/test/setup/Events.sol b/packages/contracts-bedrock/test/setup/Events.sol index 022258e02baf9..64c63e65e6a1f 100644 --- a/packages/contracts-bedrock/test/setup/Events.sol +++ b/packages/contracts-bedrock/test/setup/Events.sol @@ -1,10 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; +// Libraries +import { Types } from "src/libraries/Types.sol"; import "src/dispute/lib/Types.sol"; -import { Types } from "src/libraries/Types.sol"; +// Interfaces +import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol"; /// @title Events /// @dev Contains various events that are tested against. This contract needs to @@ -109,5 +111,7 @@ contract Events { event ETHMigrated(address indexed lockbox, uint256 ethBalance); - event LockboxUpdated(address oldLockbox, address newLockbox); + event PortalMigrated( + address oldLockbox, address newLockbox, address oldAnchorStateRegistry, address newAnchorStateRegistry + ); } diff --git a/packages/contracts-bedrock/test/setup/ForkLive.s.sol b/packages/contracts-bedrock/test/setup/ForkLive.s.sol index 6f3d663000ee6..70839e22bbfe4 100644 --- a/packages/contracts-bedrock/test/setup/ForkLive.s.sol +++ b/packages/contracts-bedrock/test/setup/ForkLive.s.sol @@ -26,7 +26,6 @@ import { IOPContractsManager } from "interfaces/L1/IOPContractsManager.sol"; import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol"; import { IETHLockbox } from "interfaces/L1/IETHLockbox.sol"; import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol"; -import { IOPContractsManagerLegacyUpgrade } from "interfaces/L1/IOPContractsManagerLegacyUpgrade.sol"; /// @title ForkLive /// @notice This script is called by Setup.sol as a preparation step for the foundry test suite, and is run as an @@ -190,8 +189,7 @@ contract ForkLive is Deployer { opChains[0] = IOPContractsManager.OpChainConfig({ systemConfigProxy: systemConfig, proxyAdmin: proxyAdmin, - absolutePrestate: Claim.wrap(bytes32(keccak256("absolutePrestate"))), - disputeGameUsesSuperRoots: false + absolutePrestate: Claim.wrap(bytes32(keccak256("absolutePrestate"))) }); // Temporarily replace the upgrader with a DelegateCaller so we can test the upgrade, @@ -199,27 +197,14 @@ contract ForkLive is Deployer { bytes memory upgraderCode = address(upgrader).code; vm.etch(upgrader, vm.getDeployedCode("test/mocks/Callers.sol:DelegateCaller")); - // Some upgrades require the legacy format. - IOPContractsManagerLegacyUpgrade.OpChainConfig[] memory legacyConfigs = - new IOPContractsManagerLegacyUpgrade.OpChainConfig[](opChains.length); - for (uint256 i = 0; i < opChains.length; i++) { - legacyConfigs[i] = IOPContractsManagerLegacyUpgrade.OpChainConfig({ - systemConfigProxy: opChains[i].systemConfigProxy, - proxyAdmin: opChains[i].proxyAdmin, - absolutePrestate: opChains[i].absolutePrestate - }); - } - // Start by doing Upgrade 13. DelegateCaller(upgrader).dcForward( - address(0x026b2F158255Beac46c1E7c6b8BbF29A4b6A7B76), - abi.encodeCall(IOPContractsManagerLegacyUpgrade.upgrade, (legacyConfigs)) + address(0x026b2F158255Beac46c1E7c6b8BbF29A4b6A7B76), abi.encodeCall(IOPContractsManager.upgrade, (opChains)) ); // Then do Upgrade 14. DelegateCaller(upgrader).dcForward( - address(0x3A1f523a4bc09cd344A2745a108Bb0398288094F), - abi.encodeCall(IOPContractsManagerLegacyUpgrade.upgrade, (legacyConfigs)) + address(0x3A1f523a4bc09cd344A2745a108Bb0398288094F), abi.encodeCall(IOPContractsManager.upgrade, (opChains)) ); // Then do the final upgrade. diff --git a/packages/contracts-bedrock/test/universal/Specs.t.sol b/packages/contracts-bedrock/test/universal/Specs.t.sol index 236294d0b0fc9..be874d72618fa 100644 --- a/packages/contracts-bedrock/test/universal/Specs.t.sol +++ b/packages/contracts-bedrock/test/universal/Specs.t.sol @@ -11,9 +11,7 @@ import { ForgeArtifacts, Abi, AbiEntry } from "scripts/libraries/ForgeArtifacts. // Interfaces import { IOPContractsManager } from "interfaces/L1/IOPContractsManager.sol"; import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol"; -import { IOptimismPortalInterop } from "interfaces/L1/IOptimismPortalInterop.sol"; import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol"; -import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol"; import { IDataAvailabilityChallenge } from "interfaces/L1/IDataAvailabilityChallenge.sol"; import { IProtocolVersions } from "interfaces/L1/IProtocolVersions.sol"; @@ -208,75 +206,12 @@ contract Specification_Test is CommonTest { _addSpec({ _name: "L1StandardBridge", _sel: _getSel("superchainConfig()") }); _addSpec({ _name: "L1StandardBridge", _sel: _getSel("version()") }); - // OptimismPortalInterop - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("anchorStateRegistry()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("checkWithdrawal(bytes32,address)") }); - _addSpec({ - _name: "OptimismPortalInterop", - _sel: _getSel("depositTransaction(address,uint256,uint64,bool,bytes)") - }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("donateETH()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("updateLockbox(address)") }); - _addSpec({ - _name: "OptimismPortalInterop", - _sel: IOptimismPortalInterop.finalizeWithdrawalTransaction.selector, - _pausable: true - }); - _addSpec({ - _name: "OptimismPortalInterop", - _sel: IOptimismPortalInterop.finalizeWithdrawalTransactionExternalProof.selector, - _pausable: true - }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("finalizedWithdrawals(bytes32)") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("guardian()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("initialize(address,address,address,address,bool)") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("l2Sender()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("minimumGasLimit(uint64)") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("params()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("paused()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("initVersion()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("superRootsActive()") }); - _addSpec({ - _name: "OptimismPortalInterop", - _sel: _getSel( - "proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes),uint256,(bytes32,bytes32,bytes32,bytes32),bytes[])" - ), - _pausable: true - }); - _addSpec({ - _name: "OptimismPortalInterop", - _sel: _getSel( - "proveWithdrawalTransaction((uint256,address,address,uint256,uint256,bytes),address,uint256,(bytes1,uint64,(uint256,bytes32)[]),(bytes32,bytes32,bytes32,bytes32),bytes[])" - ), - _pausable: true - }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("provenWithdrawals(bytes32,address)") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("superchainConfig()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("systemConfig()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("version()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("disputeGameFactory()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("respectedGameType()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("proofMaturityDelaySeconds()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("disputeGameFinalityDelaySeconds()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("respectedGameTypeUpdatedAt()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("proofSubmitters(bytes32,uint256)") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("numProofSubmitters(bytes32)") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("ethLockbox()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("migrateLiquidity()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("proxyAdminOwner()") }); - _addSpec({ _name: "OptimismPortalInterop", _sel: _getSel("upgrade(address,address,bool)") }); - _addSpec({ - _name: "OptimismPortalInterop", - _sel: IOptimismPortalInterop.setConfig.selector, - _auth: Role.SYSTEMCONFIGOWNER - }); - // OptimismPortal2 _addSpec({ _name: "OptimismPortal2", _sel: _getSel("anchorStateRegistry()") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("checkWithdrawal(bytes32,address)") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("depositTransaction(address,uint256,uint64,bool,bytes)") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("donateETH()") }); - _addSpec({ _name: "OptimismPortal2", _sel: _getSel("updateLockbox(address)") }); + _addSpec({ _name: "OptimismPortal2", _sel: _getSel("migrateToSuperRoots(address,address)") }); _addSpec({ _name: "OptimismPortal2", _sel: IOptimismPortal2.finalizeWithdrawalTransaction.selector, @@ -289,7 +224,7 @@ contract Specification_Test is CommonTest { }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("finalizedWithdrawals(bytes32)") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("guardian()") }); - _addSpec({ _name: "OptimismPortal2", _sel: _getSel("initialize(address,address,address,address,bool)") }); + _addSpec({ _name: "OptimismPortal2", _sel: _getSel("initialize(address,address,address,address)") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("l2Sender()") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("minimumGasLimit(uint64)") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("params()") }); @@ -321,7 +256,7 @@ contract Specification_Test is CommonTest { _addSpec({ _name: "OptimismPortal2", _sel: _getSel("respectedGameTypeUpdatedAt()") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("proofSubmitters(bytes32,uint256)") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("numProofSubmitters(bytes32)") }); - _addSpec({ _name: "OptimismPortal2", _sel: _getSel("upgrade(address,address,bool)") }); + _addSpec({ _name: "OptimismPortal2", _sel: _getSel("upgrade(address,address)") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("ethLockbox()") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("migrateLiquidity()") }); _addSpec({ _name: "OptimismPortal2", _sel: _getSel("proxyAdminOwner()") }); @@ -441,95 +376,6 @@ contract Specification_Test is CommonTest { _addSpec({ _name: "SystemConfig", _sel: _getSel("upgrade(uint256)") }); _addSpec({ _name: "SystemConfig", _sel: _getSel("initVersion()") }); - // SystemConfigInterop - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("UNSAFE_BLOCK_SIGNER_SLOT()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("START_BLOCK_SLOT()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("VERSION()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("batcherHash()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("gasLimit()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("eip1559Denominator()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("eip1559Elasticity()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("operatorFeeScalar()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("operatorFeeConstant()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: ISystemConfigInterop.initialize.selector }); - _addSpec({ _name: "SystemConfigInterop", _sel: ISystemConfig.initialize.selector }); - _addSpec({ _name: "SystemConfigInterop", _sel: ISystemConfigInterop.minimumGasLimit.selector }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("overhead()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("owner()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("renounceOwnership()"), _auth: Role.SYSTEMCONFIGOWNER }); - _addSpec({ _name: "SystemConfigInterop", _sel: ISystemConfigInterop.resourceConfig.selector }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("scalar()") }); - _addSpec({ - _name: "SystemConfigInterop", - _sel: ISystemConfigInterop.setBatcherHash.selector, - _auth: Role.SYSTEMCONFIGOWNER - }); - _addSpec({ - _name: "SystemConfigInterop", - _sel: ISystemConfigInterop.setGasConfig.selector, - _auth: Role.SYSTEMCONFIGOWNER - }); - _addSpec({ - _name: "SystemConfigInterop", - _sel: ISystemConfigInterop.setGasLimit.selector, - _auth: Role.SYSTEMCONFIGOWNER - }); - _addSpec({ - _name: "SystemConfigInterop", - _sel: ISystemConfigInterop.setEIP1559Params.selector, - _auth: Role.SYSTEMCONFIGOWNER - }); - _addSpec({ - _name: "SystemConfigInterop", - _sel: ISystemConfigInterop.setOperatorFeeScalars.selector, - _auth: Role.SYSTEMCONFIGOWNER - }); - _addSpec({ - _name: "SystemConfigInterop", - _sel: ISystemConfigInterop.setUnsafeBlockSigner.selector, - _auth: Role.SYSTEMCONFIGOWNER - }); - _addSpec({ - _name: "SystemConfigInterop", - _sel: _getSel("transferOwnership(address)"), - _auth: Role.SYSTEMCONFIGOWNER - }); - _addSpec({ _name: "SystemConfigInterop", _sel: ISystemConfigInterop.unsafeBlockSigner.selector }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("version()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("l1CrossDomainMessenger()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("l1ERC721Bridge()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("l1StandardBridge()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("optimismPortal()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("optimismMintableERC20Factory()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("batchInbox()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("startBlock()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("L1_CROSS_DOMAIN_MESSENGER_SLOT()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("L1_ERC_721_BRIDGE_SLOT()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("L1_STANDARD_BRIDGE_SLOT()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("OPTIMISM_PORTAL_SLOT()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("BATCH_INBOX_SLOT()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("DISPUTE_GAME_FACTORY_SLOT()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("disputeGameFactory()") }); - _addSpec({ - _name: "SystemConfigInterop", - _sel: _getSel("setGasConfigEcotone(uint32,uint32)"), - _auth: Role.SYSTEMCONFIGOWNER - }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("basefeeScalar()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("blobbasefeeScalar()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("maximumGasLimit()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("addDependency(uint256)"), _auth: Role.DEPENDENCYMANAGER }); - _addSpec({ - _name: "SystemConfigInterop", - _sel: _getSel("removeDependency(uint256)"), - _auth: Role.DEPENDENCYMANAGER - }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("dependencyManager()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("getAddresses()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("l2ChainId()") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("upgrade(uint256)") }); - _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("initVersion()") }); // ProxyAdmin _addSpec({ _name: "ProxyAdmin", _sel: _getSel("addressManager()") }); _addSpec({ diff --git a/packages/contracts-bedrock/test/vendor/Initializable.t.sol b/packages/contracts-bedrock/test/vendor/Initializable.t.sol index 3eb79187e65ff..c943901863922 100644 --- a/packages/contracts-bedrock/test/vendor/Initializable.t.sol +++ b/packages/contracts-bedrock/test/vendor/Initializable.t.sol @@ -124,7 +124,7 @@ contract Initializer_Test is CommonTest { name: "OptimismPortal2Impl", target: EIP1967Helper.getImplementation(address(optimismPortal2)), initCalldata: abi.encodeCall( - optimismPortal2.initialize, (systemConfig, superchainConfig, anchorStateRegistry, ethLockbox, false) + optimismPortal2.initialize, (systemConfig, superchainConfig, anchorStateRegistry, ethLockbox) ) }) ); @@ -134,7 +134,7 @@ contract Initializer_Test is CommonTest { name: "OptimismPortal2Proxy", target: address(optimismPortal2), initCalldata: abi.encodeCall( - optimismPortal2.initialize, (systemConfig, superchainConfig, anchorStateRegistry, ethLockbox, false) + optimismPortal2.initialize, (systemConfig, superchainConfig, anchorStateRegistry, ethLockbox) ) }) ); @@ -358,29 +358,25 @@ contract Initializer_Test is CommonTest { function test_cannotReinitialize_succeeds() public { // Collect exclusions. string[] memory excludes = new string[](11); - // TODO: Neither of these contracts are labeled properly in the deployment script. Both are - // currently being labeled as their non-interop versions. Remove these exclusions once - // the deployment script is fixed. - excludes[0] = "src/L1/SystemConfigInterop.sol"; - excludes[1] = "src/L1/OptimismPortalInterop.sol"; + // Contract is currently not being deployed as part of the standard deployment script. - excludes[2] = "src/L2/OptimismSuperchainERC20.sol"; + excludes[1] = "src/L2/OptimismSuperchainERC20.sol"; + // Periphery contracts don't get deployed as part of the standard deployment script. - excludes[3] = "src/periphery/*"; + excludes[2] = "src/periphery/*"; + // TODO: Deployment script is currently "broken" in the sense that it doesn't properly // label the FaultDisputeGame, PermissionedDisputeGame, SuperFaultDisputeGame, and - // SuperPermissionedDisputeGame - // contracts and instead simply deploys them anonymously. Means that functions like "getInitializedSlot" - // don't work properly. Remove these exclusions once the deployment script is fixed. - excludes[4] = "src/dispute/FaultDisputeGame.sol"; - excludes[5] = "src/dispute/SuperFaultDisputeGame.sol"; - excludes[6] = "src/dispute/PermissionedDisputeGame.sol"; - excludes[7] = "src/dispute/SuperPermissionedDisputeGame.sol"; - // TODO: Eventually remove this exclusion. Same reason as above dispute contracts. - excludes[8] = "src/L1/OPContractsManager.sol"; - excludes[9] = "src/L1/OPContractsManagerInterop.sol"; + // SuperPermissionedDisputeGame contracts and instead simply deploys them + // anonymously. Means that functions like "getInitializedSlot" don't work properly. + // Remove these exclusions once the deployment script is fixed. + excludes[3] = "src/dispute/FaultDisputeGame.sol"; + excludes[4] = "src/dispute/SuperFaultDisputeGame.sol"; + excludes[5] = "src/dispute/PermissionedDisputeGame.sol"; + excludes[6] = "src/dispute/SuperPermissionedDisputeGame.sol"; + // L2 contract initialization is tested in Predeploys.t.sol - excludes[10] = "src/L2/*"; + excludes[7] = "src/L2/*"; // Get all contract names in the src directory, minus the excluded contracts. string[] memory contractNames = ForgeArtifacts.getContractNames("src/*", excludes);