diff --git a/go.mod b/go.mod index f23cd4b74faa..cdb76bc37c19 100644 --- a/go.mod +++ b/go.mod @@ -257,7 +257,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101408.1-0.20241209113131-e6499495c176 +replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101408.1-0.20241211135814-0162ce9d0298 // replace github.com/ethereum/go-ethereum => ../op-geth diff --git a/go.sum b/go.sum index ddcea4dc2961..e0a4c89501f6 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,8 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/celo-org/op-geth v1.101408.1-0.20241209113131-e6499495c176 h1:pVzNAblfE20Lk1+zqzegjIZ/1UgwEGDpxDTzHCFP9wI= -github.com/celo-org/op-geth v1.101408.1-0.20241209113131-e6499495c176/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac= +github.com/celo-org/op-geth v1.101408.1-0.20241211135814-0162ce9d0298 h1:tv3rg2aT8xQJoL0e2hMyLG+s/a+y4GucB0Ir/TitqaQ= +github.com/celo-org/op-geth v1.101408.1-0.20241211135814-0162ce9d0298/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= diff --git a/op-chain-ops/cmd/celo-migrate/state.go b/op-chain-ops/cmd/celo-migrate/state.go index f1797c910cbd..74e6683d3bf8 100644 --- a/op-chain-ops/cmd/celo-migrate/state.go +++ b/op-chain-ops/cmd/celo-migrate/state.go @@ -90,9 +90,9 @@ var ( BaklavaNetworkID: common.HexToAddress("0x022c5d5837E177B6d145761feb4C5574e5b48F5e"), } celoTokenAddressMap = map[uint64]common.Address{ - AlfajoresNetworkID: addresses.CeloTokenAlfajoresAddress, - BaklavaNetworkID: addresses.CeloTokenBaklavaAddress, - MainnetNetworkID: addresses.CeloTokenAddress, + AlfajoresNetworkID: addresses.AlfajoresAddresses.CeloToken, + BaklavaNetworkID: addresses.BaklavaAddresses.CeloToken, + MainnetNetworkID: addresses.MainnetAddresses.CeloToken, } ) diff --git a/op-e2e/celo/tests/setup.js b/op-e2e/celo/tests/setup.js index e7400420f674..d76e00254476 100644 --- a/op-e2e/celo/tests/setup.js +++ b/op-e2e/celo/tests/setup.js @@ -53,9 +53,9 @@ export async function setup() { config.addresses = contractAddrs const success = await Promise.all([ - waitReachable(config.client.l1.public, 10_000), - waitReachable(config.client.l2.public, 10_000), - waitForNextGame(config.client.l1.public, chainConfig.l2, 60_000), + waitReachable(config.client.l1.public, 60_000), + waitReachable(config.client.l2.public, 60_000), + waitForNextGame(config.client.l1.public, chainConfig.l2, 300_000), ]) if (success.every((v) => v == true)) { return config diff --git a/op-e2e/celo/tests/tokenduality.test.js b/op-e2e/celo/tests/tokenduality.test.js index 9980c81fece4..905581178233 100644 --- a/op-e2e/celo/tests/tokenduality.test.js +++ b/op-e2e/celo/tests/tokenduality.test.js @@ -6,7 +6,7 @@ let config = {} beforeAll(async () => { config = await setup() -}, 30_000) +}, 5*minute) test( 'test token duality', diff --git a/op-e2e/celo/tests/withdraw_deposit.test.js b/op-e2e/celo/tests/withdraw_deposit.test.js index b7235239f4d1..fdf8a4bf3d71 100644 --- a/op-e2e/celo/tests/withdraw_deposit.test.js +++ b/op-e2e/celo/tests/withdraw_deposit.test.js @@ -8,7 +8,7 @@ var config = {} beforeAll(async () => { config = await setup() -}, minute) +}, 5*minute) test( 'execute a withdraw and a deposit in succession', diff --git a/op-e2e/system/fees/fees_test.go b/op-e2e/system/fees/fees_test.go index 198309a32047..61ba48699b2b 100644 --- a/op-e2e/system/fees/fees_test.go +++ b/op-e2e/system/fees/fees_test.go @@ -138,7 +138,7 @@ func testFees(t *testing.T, cfg e2esys.SystemConfig) { baseFeeRecipient := predeploys.BaseFeeVaultAddr if sys.RollupConfig.IsCel2(sys.L2GenesisCfg.Timestamp) { - baseFeeRecipient = addresses.FeeHandlerAddress + baseFeeRecipient = addresses.GetAddresses(cfg.L2ChainIDBig()).FeeHandler } // BaseFee Recipient baseFeeRecipientStartBalance, err := l2Seq.BalanceAt(context.Background(), baseFeeRecipient, big.NewInt(rpc.EarliestBlockNumber.Int64())) diff --git a/ops-bedrock/l2-op-geth.Dockerfile b/ops-bedrock/l2-op-geth.Dockerfile index afd6e4e8203f..47f5fe81126c 100644 --- a/ops-bedrock/l2-op-geth.Dockerfile +++ b/ops-bedrock/l2-op-geth.Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 us-west1-docker.pkg.dev/blockchaintestsglobaltestnet/dev-images/op-geth@sha256:6fe04ace89e6ebae1c527c2754d1eb40bcb073a85b2f23384816c53d94bbaff2 +FROM --platform=linux/amd64 us-west1-docker.pkg.dev/blockchaintestsglobaltestnet/dev-images/op-geth@sha256:2cbe7293f435d37312290c52784c3215559a4889dab686c25da677d088676fd3 RUN apk add --no-cache jq diff --git a/ops/celo/update-geth.sh b/ops/celo/update-geth.sh old mode 100644 new mode 100755 index d081ab04545c..2a1c06ce2837 --- a/ops/celo/update-geth.sh +++ b/ops/celo/update-geth.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -eo pipefail branch="$1" if [ -z "$branch" ]; then @@ -18,11 +19,11 @@ sha256digest=$(gcloud --format=json artifacts files list \ --location=us-west1 \ --package=op-geth \ --limit=1 \ - --tag="$commit" | jq ".[0].name" | grep -oP "sha256:\K[0-9a-f]{64}") + --tag="$commit" | jq ".[0].name" | grep -oE 'sha256:([0-9a-f]{64})' | sed 's/^sha256://') if [ -z "$sha256digest" ]; then exit 1; fi -sed -i "s|\(.*op-geth@sha256:\)\(.*\)|\1$sha256digest|" ./ops-bedrock/l2-op-geth.Dockerfile -sed -i "s|\(replace github.com/ethereum/go-ethereum => \)github.com/celo-org/op-geth v.*|\1$go_version|" go.mod +perl -pi -e "s|(.*op-geth@sha256:)(.*)|\1$sha256digest|" ./ops-bedrock/l2-op-geth.Dockerfile +perl -pi -e "s|^(replace github.com/ethereum/go-ethereum .* => )github.com/.*/op-geth v.*|\1$go_version|" go.mod go_mod_error=$(go mod tidy >/dev/null) if [ -n "$go_mod_error" ]; then diff --git a/ops/check-changed/requirements.txt b/ops/check-changed/requirements.txt index 1d0c88d77f2d..52f22da4a72b 100644 --- a/ops/check-changed/requirements.txt +++ b/ops/check-changed/requirements.txt @@ -1,5 +1,5 @@ certifi==2024.7.4 -cffi==1.15.1 +cffi==1.17.1 charset-normalizer==2.1.1 Deprecated==1.2.13 idna==3.7 diff --git a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol index d97bdfd587fa..1f4440593d6f 100644 --- a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol @@ -286,6 +286,17 @@ contract Deploy is Deployer { _run(); } + /// @notice Deploy all of the L1 contracts necessary for a full Superchain with a single Op Chain. + /// The two parameters correspond to: + /// 1. Whether or not the Superchain contracts need to be deployed. Set to deploy a new Superchain contracts + /// 2. Whether or not the fault games need to be initialized. Set to false, and execute latter + /// `setupFaultGames()` to initialize + /// when the config `faultGameGenesisOutputRoot` is known + function runCelo() public { + console.log("Deploying a fresh OP Stack including SuperchainConfig"); + _run(true, false); + } + /// @notice Deploy a new OP Chain using an existing SuperchainConfig and ProtocolVersions /// @param _superchainConfigProxy Address of the existing SuperchainConfig proxy /// @param _protocolVersionsProxy Address of the existing ProtocolVersions proxy @@ -332,11 +343,18 @@ contract Deploy is Deployer { /// @notice Compatibility function for tests that override _run(). function _run() internal virtual { - _run(true); + _run(true, true); + } + + /// @notice (Celo) Compatibility function for OP stack + function _run(bool _needsSuperchain) internal virtual { + _run(_needsSuperchain, true); } /// @notice Internal function containing the deploy logic. - function _run(bool _needsSuperchain) internal { + /// @param _needsSuperchain Whether or not the Superchain contracts need to be deployed. + /// @param _initializeFaultGames Whether or not the fault games need to be initialized. + function _run(bool _needsSuperchain, bool _initializeFaultGames) internal { console.log("start of L1 Deploy!"); deploySafe("SystemOwnerSafe"); console.log("deployed Safe!"); @@ -358,7 +376,7 @@ contract Deploy is Deployer { setupOpAltDA(); } } - setupOpChain(); + setupOpChain(_initializeFaultGames); console.log("set up op chain!"); } @@ -392,7 +410,7 @@ contract Deploy is Deployer { } /// @notice Deploy a new OP Chain, with an existing SuperchainConfig provided - function setupOpChain() public { + function setupOpChain(bool _initializeFaultGames) public { console.log("Deploying OP Chain"); // Ensure that the requisite contracts are deployed @@ -403,15 +421,26 @@ contract Deploy is Deployer { deployProxies(); deployImplementations(); - initializeImplementations(); + initializeImplementations(_initializeFaultGames); + + if (_initializeFaultGames) { + setAlphabetFaultGameImplementation({ _allowUpgrade: false }); + setFastFaultGameImplementation({ _allowUpgrade: false }); + setCannonFaultGameImplementation({ _allowUpgrade: false }); + setPermissionedCannonFaultGameImplementation({ _allowUpgrade: false }); + transferDisputeGameFactoryOwnership(); + } + + transferDelayedWETHOwnership(); + } - setAlphabetFaultGameImplementation({ _allowUpgrade: false }); - setFastFaultGameImplementation({ _allowUpgrade: false }); + /// @notice Deploy the fault games and set the implementations. Initialize AnchorStateRegistry. + function setupFaultGames() public { + initializeL2OutputOracle(); setCannonFaultGameImplementation({ _allowUpgrade: false }); setPermissionedCannonFaultGameImplementation({ _allowUpgrade: false }); - + initializeAnchorStateRegistry(false); transferDisputeGameFactoryOwnership(); - transferDelayedWETHOwnership(); } /// @notice Deploy all of the proxies @@ -484,7 +513,7 @@ contract Deploy is Deployer { } /// @notice Initialize all of the implementations - function initializeImplementations() public { + function initializeImplementations(bool _initializeAnchorStateRegistry) public { console.log("Initializing implementations"); if (cfg.useCustomGasToken()) { @@ -507,11 +536,13 @@ contract Deploy is Deployer { initializeL1ERC721Bridge(); initializeOptimismMintableERC20Factory(); initializeL1CrossDomainMessenger(); - initializeL2OutputOracle(); initializeDisputeGameFactory(); initializeDelayedWETH(); initializePermissionedDelayedWETH(); - initializeAnchorStateRegistry(); + if (_initializeAnchorStateRegistry) { + initializeL2OutputOracle(); + initializeAnchorStateRegistry(true); + } ChainAssertions.checkCustomGasTokenOptimismPortal({ _contracts: _proxies(), _cfg: cfg, _isProxy: true }); } @@ -1047,48 +1078,69 @@ contract Deploy is Deployer { }); } - function initializeAnchorStateRegistry() public broadcast { + /// @notice Initialize the AnchorStateRegistry with a known root anchor + /// @param _deployTestingGames Whether to deploy the testing Fualt Game implementations) + function initializeAnchorStateRegistry(bool _deployTestingGames) public broadcast { console.log("Upgrading and initializing AnchorStateRegistry proxy"); address anchorStateRegistryProxy = mustGetAddress("AnchorStateRegistryProxy"); address anchorStateRegistry = mustGetAddress("AnchorStateRegistry"); ISuperchainConfig superchainConfig = ISuperchainConfig(mustGetAddress("SuperchainConfigProxy")); - IAnchorStateRegistry.StartingAnchorRoot[] memory roots = new IAnchorStateRegistry.StartingAnchorRoot[](5); - roots[0] = IAnchorStateRegistry.StartingAnchorRoot({ - gameType: GameTypes.CANNON, - outputRoot: OutputRoot({ - root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), - l2BlockNumber: cfg.faultGameGenesisBlock() - }) - }); - roots[1] = IAnchorStateRegistry.StartingAnchorRoot({ - gameType: GameTypes.PERMISSIONED_CANNON, - outputRoot: OutputRoot({ - root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), - l2BlockNumber: cfg.faultGameGenesisBlock() - }) - }); - roots[2] = IAnchorStateRegistry.StartingAnchorRoot({ - gameType: GameTypes.ALPHABET, - outputRoot: OutputRoot({ - root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), - l2BlockNumber: cfg.faultGameGenesisBlock() - }) - }); - roots[3] = IAnchorStateRegistry.StartingAnchorRoot({ - gameType: GameTypes.ASTERISC, - outputRoot: OutputRoot({ - root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), - l2BlockNumber: cfg.faultGameGenesisBlock() - }) - }); - roots[4] = IAnchorStateRegistry.StartingAnchorRoot({ - gameType: GameTypes.FAST, - outputRoot: OutputRoot({ - root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), - l2BlockNumber: cfg.faultGameGenesisBlock() - }) - }); + IAnchorStateRegistry.StartingAnchorRoot[] memory roots; + if (_deployTestingGames) { + roots = new IAnchorStateRegistry.StartingAnchorRoot[](5); + roots[0] = IAnchorStateRegistry.StartingAnchorRoot({ + gameType: GameTypes.CANNON, + outputRoot: OutputRoot({ + root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), + l2BlockNumber: cfg.faultGameGenesisBlock() + }) + }); + roots[1] = IAnchorStateRegistry.StartingAnchorRoot({ + gameType: GameTypes.PERMISSIONED_CANNON, + outputRoot: OutputRoot({ + root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), + l2BlockNumber: cfg.faultGameGenesisBlock() + }) + }); + roots[2] = IAnchorStateRegistry.StartingAnchorRoot({ + gameType: GameTypes.ALPHABET, + outputRoot: OutputRoot({ + root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), + l2BlockNumber: cfg.faultGameGenesisBlock() + }) + }); + roots[3] = IAnchorStateRegistry.StartingAnchorRoot({ + gameType: GameTypes.ASTERISC, + outputRoot: OutputRoot({ + root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), + l2BlockNumber: cfg.faultGameGenesisBlock() + }) + }); + roots[4] = IAnchorStateRegistry.StartingAnchorRoot({ + gameType: GameTypes.FAST, + outputRoot: OutputRoot({ + root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), + l2BlockNumber: cfg.faultGameGenesisBlock() + }) + }); + } else { + roots = new IAnchorStateRegistry.StartingAnchorRoot[](2); + roots[0] = IAnchorStateRegistry.StartingAnchorRoot({ + gameType: GameTypes.CANNON, + outputRoot: OutputRoot({ + root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), + l2BlockNumber: cfg.faultGameGenesisBlock() + }) + }); + roots[1] = IAnchorStateRegistry.StartingAnchorRoot({ + gameType: GameTypes.PERMISSIONED_CANNON, + outputRoot: OutputRoot({ + root: Hash.wrap(cfg.faultGameGenesisOutputRoot()), + l2BlockNumber: cfg.faultGameGenesisBlock() + }) + }); + } _upgradeAndCallViaSafe({ _proxy: payable(anchorStateRegistryProxy),