diff --git a/mainnet/2024-03-07-ecotome-sysconfig-updates/.env b/mainnet/2024-03-07-ecotome-sysconfig-updates/.env index e69de29b..8af6be52 100644 --- a/mainnet/2024-03-07-ecotome-sysconfig-updates/.env +++ b/mainnet/2024-03-07-ecotome-sysconfig-updates/.env @@ -0,0 +1,30 @@ +OP_COMMIT=c87a469d7d679e8a4efbace56c3646b925bcc009 +BASE_CONTRACTS_COMMIT=fe492be3478134b2305c207a12b153eca04148c0 + +L1_SYSTEM_CONFIG_ADDRESS=0x73a79Fab69143498Ed3712e519A88a918e1f4072 +SYSTEM_CONFIG_OWNER=0x14536667Cd30e52C0b458BaACcB9faDA7046E056 + +# scalars defined by running: https://github.com/ethereum-optimism/optimism/tree/4b7627cbb94a75e478a34f33f91121ef6ae794b3/op-chain-ops/cmd/ecotone-scalar +# 1 BLOB PER TX +# base fee scalar : 6607 +# blob base fee scalar: 654675 +# v1 hex encoding : 0x0100000000000000000000000000000000000000000000000009fd53000019cf +# uint value for the 'scalar' parameter in SystemConfigProxy.setGasConfig(): +SCALAR=452312848583266388373324160190187140051835877600158453279133999338625178063 + + +# 6 BLOBS PER TX +# base fee scalar : 1101 +# blob base fee scalar: 652972 +# v1 hex encoding : 0x0100000000000000000000000000000000000000000000000009f6ac0000044d +# uint value for the 'scalar' parameter in SystemConfigProxy.setGasConfig(): +# SCALAR=452312848583266388373324160190187140051835877600158453279133992024295867469 + +# THINGS WENT WRONG --> FALLBACK TO CALLDATA +# base fee scalar : 668098 +# blob base fee scalar: 0 +# v1 hex encoding : 0x01000000000000000000000000000000000000000000000000000000000a31c2 +# uint value for the 'scalar' parameter in SystemConfigProxy.setGasConfig(): +FALLBACK_SCALAR=452312848583266388373324160190187140051835877600158453279131187530911330754 + +SIGNATURES= \ No newline at end of file diff --git a/mainnet/2024-03-07-ecotome-sysconfig-updates/Makefile b/mainnet/2024-03-07-ecotome-sysconfig-updates/Makefile index aff5bb0c..6541d849 100644 --- a/mainnet/2024-03-07-ecotome-sysconfig-updates/Makefile +++ b/mainnet/2024-03-07-ecotome-sysconfig-updates/Makefile @@ -6,50 +6,20 @@ ifndef LEDGER_ACCOUNT override LEDGER_ACCOUNT = 0 endif -## -# Incident response commands -# Note that --ledger --hd-paths can be replaced with --private-key $(PRIVATE_KEY) -# in any command when using a local key. -## - -# Delete L2 Outputs Commands - -.PHONY: delete-outputs-sign -delete-outputs-sign: deps - $(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ - forge script --rpc-url $(L1_RPC_URL) DeleteL2Outputs --sig "sign()" - -.PHONY: delete-outputs-run -delete-outputs-run: deps - forge script --rpc-url $(L1_RPC_URL) \ - DeleteL2Outputs --sig "run(bytes)" $(SIGNATURES) \ - --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" \ - --broadcast - -# Pause OptimismPortal Commands - -.PHONY: pause-portal-sign -pause-portal-sign: deps +.PHONY: sign-update-gas-config +sign-update-gas-config: $(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ - forge script --rpc-url $(L1_RPC_URL) PausePortal --sig "sign()" + forge script --rpc-url $(L1_RPC_URL) UpdateGasConfig \ + --sig "sign()" -.PHONY: pause-portal-run -pause-portal-run: deps - forge script --rpc-url $(L1_RPC_URL) \ - PausePortal --sig "run(bytes)" $(SIGNATURES) \ +.PHONY: approve-update-gas-config +approve-update-gas-config: + forge script --rpc-url $(L1_RPC_URL) UpdateGasConfig \ + --sig "approve(address,bytes)" $(SYSTEM_CONFIG_OWNER) $(SIGNATURES) \ --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" \ --broadcast -# Unpause OptimismPortal Commands - -.PHONY: unpause-portal-sign -unpause-portal-sign: deps - $(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ - forge script --rpc-url $(L1_RPC_URL) UnpausePortal --sig "sign()" - -.PHONY: unpause-portal-run -unpause-portal-run: deps - forge script --rpc-url $(L1_RPC_URL) \ - UnpausePortal --sig "run(bytes)" $(SIGNATURES) \ - --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" \ - --broadcast \ No newline at end of file +.PHONY: execute +execute: + forge script --rpc-url $(L1_RPC_URL) UpdateGasConfig \ + --sig "run()" --ledger -hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" diff --git a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/DeleteL2Outputs.s.sol b/mainnet/2024-03-07-ecotome-sysconfig-updates/script/DeleteL2Outputs.s.sol deleted file mode 100644 index 07d034f3..00000000 --- a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/DeleteL2Outputs.s.sol +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -import "@eth-optimism-bedrock/contracts/L1/L2OutputOracle.sol"; -import "@base-contracts/src/Challenger1of2.sol"; -import "@base-contracts/script/universal/MultisigBuilder.sol"; - -contract DeleteL2Outputs is MultisigBuilder { - address constant internal L2_OUTPUT_ORACLE_PROXY = vm.envAddress("L2_OUTPUT_ORACLE_PROXY"); // TODO: define L2_OUTPUT_ORACLE_PROXY=xxx in the .env file - address constant internal CHALLENGER = vm.envAddress("CHALLENGER"); // TODO: define CHALLENGER=xxx in the .env file - address constant internal SAFE = vm.envAddress("SAFE"); // TODO: define SAFE=xxx in the .env file - ie the multisig which is signer on challenger> - uint256 constant internal L2_OUTPUT_INDEX = vm.envAddress("L2_OUTPUT_INDEX"); // TODO: define L2_OUTPUT_INDEX=xxx in the .env file - this is the index start deleting from (everything after will be deleted) - - function _postCheck() internal override view { - L2OutputOracle l2OutputOracle = L2OutputOracle(L2_OUTPUT_ORACLE_PROXY); - require(l2OutputOracle.latestOutputIndex() < L2_OUTPUT_INDEX, "DeleteL2Outputs: L2OutputOracle did not get deleted"); - } - - function _buildCalls() internal override view returns (IMulticall3.Call3[] memory) { - IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); - - L2OutputOracle l2OutputOracle = L2OutputOracle(L2_OUTPUT_ORACLE_PROXY); - bytes memory deleteL2OutputData = abi.encodeCall( - L2OutputOracle.deleteL2Outputs, (L2_OUTPUT_INDEX) - ); - - calls[0] = IMulticall3.Call3({ - target: CHALLENGER, - allowFailure: false, - callData: abi.encodeCall( - Challenger1of2.execute, (deleteL2OutputData) - ) - }); - - return calls; - } - - function _ownerSafe() internal override view returns (address) { - return SAFE; - } -} diff --git a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/PausePortal.s.sol b/mainnet/2024-03-07-ecotome-sysconfig-updates/script/PausePortal.s.sol deleted file mode 100644 index cba5e253..00000000 --- a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/PausePortal.s.sol +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -import "@base-contracts/script/universal/MultisigBuilder.sol"; -import "@eth-optimism-bedrock/contracts/L1/OptimismPortal.sol"; - -contract PausePortal is MultisigBuilder { - address constant internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY"); // TODO: define OPTIMISM_PORTAL_PROXY=xxx in the .env file - address constant internal GUARDIAN = vm.envAddress("GUARDIAN"); // TODO: define GUARDIAN=xxx in the .env file - - function _postCheck() internal override view { - OptimismPortal optimismPortal = OptimismPortal(payable(OPTIMISM_PORTAL_PROXY)); - require(optimismPortal.paused() == true, "PausePortal: Portal did not get paused"); - } - - function _buildCalls() internal override view returns (IMulticall3.Call3[] memory) { - IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); - - calls[0] = IMulticall3.Call3({ - target: OPTIMISM_PORTAL_PROXY, - allowFailure: false, - callData: abi.encodeCall( - OptimismPortal.pause, () - ) - }); - - return calls; - } - - function _ownerSafe() internal override view returns (address) { - return GUARDIAN; - } -} diff --git a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/SetBatcher.s.sol b/mainnet/2024-03-07-ecotome-sysconfig-updates/script/SetBatcher.s.sol deleted file mode 100644 index c8ec7900..00000000 --- a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/SetBatcher.s.sol +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -import "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; -import "@base-contracts/script/universal/MultisigBuilder.sol"; - -contract SetBatcherAddr is MultisigBuilder { - address constant internal NEW_BATCHER = vm.envAddress("NEW_BATCHER_ADDR"); // TODO: define NEW_BATCHER_ADDR=xxx in the .env file - address constant internal SYSTEM_CONFIG = vm.envAddress("SYSTEM_CONFIG_ADDR"); // TODO: define SYSTEM_CONFIG_ADDR=xxx in the .env file - address internal SYSTEM_CONFIG_OWNER = vm.envAddress("SYSTEM_CONFIG_OWNER"); // TODO: define SYSTEM_CONFIG_OWNER=xxx in the .env file - - - function _postCheck() internal override view { - SystemConfig systemConfig = SystemConfig(SYSTEM_CONFIG); - bytes32 batcherHash = bytes32(abi.encode(NEW_BATCHER)); - require(systemConfig.batcherHash() == batcherHash, "SetBatcherAddr: batcherHash not set correctly"); - } - - function _buildCalls() internal override view returns (IMulticall3.Call3[] memory) { - IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); - - bytes32 batcherHash = bytes32(abi.encode(NEW_BATCHER)); - - calls[0] = IMulticall3.Call3({ - target: SYSTEM_CONFIG, - allowFailure: false, - callData: abi.encodeCall( - SystemConfig.setBatcherHash, - (batcherHash) - ) - }); - - return calls; - } - - function _ownerSafe() internal override view returns (address) { - return SYSTEM_CONFIG_OWNER; - } -} \ No newline at end of file diff --git a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/SetupNewProposer.s.sol b/mainnet/2024-03-07-ecotome-sysconfig-updates/script/SetupNewProposer.s.sol deleted file mode 100644 index 7903b2ed..00000000 --- a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/SetupNewProposer.s.sol +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -import "@eth-optimism-bedrock/contracts/L1/L2OutputOracle.sol"; -import "forge-std/Script.sol"; - -contract SetupNewProposer is Script { - address constant internal NEW_PROPOSER = vm.envUint("NEW_PROPOSER"); // TODO: define NEW_PROPOSER=xxx in the .env file - address constant internal DEPLOYER = vm.envAddress("DEPLOYER"); // TODO: define DEPLOYER=xxx in the .env file - address constant internal L2_OUTPUT_ORACLE_PROXY = vm.envAddress("L2_OUTPUT_ORACLE_PROXY"); // TODO: define L2_OUTPUT_ORACLE_PROXY=xxx in the .env file - - function run() public { - L2OutputOracle existingL2OO = L2OutputOracle(L2_OUTPUT_ORACLE_PROXY); - uint256 oldSubmissionInterval = existingL2OO.SUBMISSION_INTERVAL(); - uint256 oldL2BlockTime = existingL2OO.L2_BLOCK_TIME(); - uint256 oldFinalizationPeriodSeconds = existingL2OO.FINALIZATION_PERIOD_SECONDS(); - uint256 startingBlockNumber = existingL2OO.startingBlockNumber(); - uint256 startingTimestamp = existingL2OO.startingTimestamp(); - address oldProposer = existingL2OO.PROPOSER(); - address oldChallenger = existingL2OO.CHALLENGER(); - - console.log(oldProposer); - console.log(NEW_PROPOSER); - - // Deploy L2OutputOracle new implementation wiht the new submission interval - vm.broadcast(DEPLOYER); - L2OutputOracle l2OutputOracleImpl = new L2OutputOracle({ - _submissionInterval: oldSubmissionInterval, - _l2BlockTime: oldL2BlockTime, - _startingBlockNumber: startingBlockNumber, - _startingTimestamp: startingTimestamp, - _proposer: NEW_PROPOSER, - _challenger: oldChallenger, - _finalizationPeriodSeconds: oldFinalizationPeriodSeconds - }); - - require(l2OutputOracleImpl.L2_BLOCK_TIME() == oldL2BlockTime, "Deploy: l2OutputOracle l2BlockTime is incorrect"); - require(l2OutputOracleImpl.PROPOSER() == NEW_PROPOSER, "Deploy: l2OutputOracle proposer is incorrect"); - - console.logAddress(address(l2OutputOracleImpl)); - } -} \ No newline at end of file diff --git a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/UnpausePortal.s.sol b/mainnet/2024-03-07-ecotome-sysconfig-updates/script/UnpausePortal.s.sol deleted file mode 100644 index 0516fe30..00000000 --- a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/UnpausePortal.s.sol +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -import "@base-contracts/script/universal/MultisigBuilder.sol"; -import "@eth-optimism-bedrock/contracts/L1/OptimismPortal.sol"; - -contract UnpausePortal is MultisigBuilder { - address constant internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY"); // TODO: define OPTIMISM_PORTAL_PROXY=xxx in the .env file - address constant internal GUARDIAN = vm.envAddress("GUARDIAN"); // TODO: define GUARDIAN=xxx in the .env file - - function _postCheck() internal override view { - OptimismPortal optimismPortal = OptimismPortal(payable(OPTIMISM_PORTAL_PROXY)); - require(optimismPortal.paused() == false, "UnpausePortal: Portal did not get unpaused"); - } - - function _buildCalls() internal override view returns (IMulticall3.Call3[] memory) { - IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); - - calls[0] = IMulticall3.Call3({ - target: OPTIMISM_PORTAL_PROXY, - allowFailure: false, - callData: abi.encodeCall( - OptimismPortal.unpause, () - ) - }); - - return calls; - } - - function _ownerSafe() internal override view returns (address) { - return GUARDIAN; - } -} diff --git a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/UpdateGasConfig.sol b/mainnet/2024-03-07-ecotome-sysconfig-updates/script/UpdateGasConfig.sol new file mode 100644 index 00000000..77b898b8 --- /dev/null +++ b/mainnet/2024-03-07-ecotome-sysconfig-updates/script/UpdateGasConfig.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; + +import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; +import "@base-contracts/script/universal/MultisigBuilder.sol"; + +contract UpdateGasConfig is MultisigBuilder { + + address internal SYSTEM_CONFIG_OWNER = vm.envAddress("SYSTEM_CONFIG_OWNER"); + address internal L1_SYSTEM_CONFIG = vm.envAddress("L1_SYSTEM_CONFIG_ADDRESS"); + uint256 internal SCALAR = vm.envUint("SCALAR"); + + function _postCheck() internal override view { + require(SystemConfig(L1_SYSTEM_CONFIG).scalar() == SCALAR); + require(SystemConfig(L1_SYSTEM_CONFIG).overhead() == 0); + } + + function _buildCalls() internal override view returns (IMulticall3.Call3[] memory) { + IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); + + calls[0] = IMulticall3.Call3({ + target: L1_SYSTEM_CONFIG, + allowFailure: false, + callData: abi.encodeCall( + SystemConfig.setGasConfig, + ( + 0, // overhead is not used post Ecotome + SCALAR + ) + ) + }); + + return calls; + } + + function _ownerSafe() internal override view returns (address) { + return SYSTEM_CONFIG_OWNER; + } +} \ No newline at end of file diff --git a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/UpdateProposer.s.sol b/mainnet/2024-03-07-ecotome-sysconfig-updates/script/UpdateProposer.s.sol deleted file mode 100644 index 53aa4ad5..00000000 --- a/mainnet/2024-03-07-ecotome-sysconfig-updates/script/UpdateProposer.s.sol +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.15; - -import "@eth-optimism-bedrock/src/universal/ProxyAdmin.sol"; -import "@base-contracts/script/universal/NestedMultisigBuilder.sol"; - -contract UpdateProposer is NestedMultisigBuilder { - // TODO: this assumes a new L2OutputOracle implementation contract has already been deployed. See SetupNewProposer.s.sol. - - address internal PROXY_ADMIN_CONTRACT = vm.envAddress("L1_PROXY_ADMIN"); // TODO: define L1_PROXY_ADMIN=xxx in the .env file - address internal PROXY_ADMIN_OWNER = vm.envAddress("L1_NESTED_SAFE"); // TODO: define L1_NESTED_SAFE=xxx in the .env file - address internal L2_OUTPUT_PROPOSER = vm.envAddress("L2_OUTPUT_PROPOSER"); // TODO: define L2_OUTPUT_PROPOSER=xxx in the .env file - address internal L2_OUTPUT_PROPOSER_NEW_IMPL = vm.envAddress("L2_OUTPUT_PROPOSER_NEW_IMPL"); // TODO: define L2_OUTPUT_PROPOSER_NEW_IMPL=xxx in the .env file - - function _postCheck() internal override view { - ProxyAdmin proxyAdmin = ProxyAdmin(PROXY_ADMIN_CONTRACT); - require(proxyAdmin.getProxyImplementation(L2_OUTPUT_PROPOSER).codehash == L2_OUTPUT_PROPOSER_NEW_IMPL.codehash); - } - - function _buildCalls() internal override view returns (IMulticall3.Call3[] memory) { - IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); - - calls[0] = IMulticall3.Call3({ - target: PROXY_ADMIN_CONTRACT, - allowFailure: false, - callData: abi.encodeCall( - ProxyAdmin.upgrade, - (payable(L2_OUTPUT_PROPOSER), L2_OUTPUT_PROPOSER_NEW_IMPL) - ) - }); - - return calls; - } - - function _ownerSafe() internal override view returns (address) { - return PROXY_ADMIN_OWNER; - } -} \ No newline at end of file