From f5d15006a0a840df2fb92e78c8e4277dcc8be54a Mon Sep 17 00:00:00 2001 From: geoknee Date: Tue, 17 Dec 2024 21:00:38 +0000 Subject: [PATCH] add exceptions for EOAs in SystemConfig storage --- .../NestedSignFromJson.s.sol | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tasks/sep/026-holocene-system-config-upgrade-and-init-multi-chain/NestedSignFromJson.s.sol b/tasks/sep/026-holocene-system-config-upgrade-and-init-multi-chain/NestedSignFromJson.s.sol index 15791520..4dd071b2 100644 --- a/tasks/sep/026-holocene-system-config-upgrade-and-init-multi-chain/NestedSignFromJson.s.sol +++ b/tasks/sep/026-holocene-system-config-upgrade-and-init-multi-chain/NestedSignFromJson.s.sol @@ -7,6 +7,7 @@ import {Vm, VmSafe} from "forge-std/Vm.sol"; import {Simulation} from "@base-contracts/script/universal/Simulation.sol"; import {console2 as console} from "forge-std/console2.sol"; import {ProxyAdmin} from "@eth-optimism-bedrock/src/universal/ProxyAdmin.sol"; +import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; import {stdJson} from "forge-std/StdJson.sol"; /// @title ISemver @@ -114,8 +115,19 @@ contract NestedSignFromJson is OriginalNestedSignFromJson { allowed[8] = livenessGuard; } - function getCodeExceptions() internal pure override returns (address[] memory) { - address[] memory exceptions = new address[](0); + function getCodeExceptions() internal view override returns (address[] memory) { + address[] memory exceptions = new address[](4 * l2ChainIds.length); + for (uint256 i = 0; i < l2ChainIds.length; i += 4) { + SystemConfig systemConfigProxy = + SystemConfig(readAddressFromSuperchainRegistry(l2ChainIds[i], "SystemConfigProxy")); + // The following are all EOAs which will be "updated" (to their original values) + // When we reinit the SystemConfig. So we need to except them from the check + // which complains when it finds addresses in storage with no code. + exceptions[i] = systemConfigProxy.owner(); // NOTE this can be removed for mainnet + exceptions[i + 1] = address(uint160(uint256((systemConfigProxy.batcherHash())))); + exceptions[i + 2] = systemConfigProxy.unsafeBlockSigner(); + exceptions[i + 3] = systemConfigProxy.batchInbox(); + } return exceptions; } }