Commit 549f2a9e authored by Maurelian's avatar Maurelian

contracts-bedrock/op-chain-ops: Rename Guardian config var

parent 63c71b69
...@@ -122,8 +122,8 @@ type DeployConfig struct { ...@@ -122,8 +122,8 @@ type DeployConfig struct {
// FinalSystemOwner is the owner of the system on L1. Any L1 contract that is ownable has // FinalSystemOwner is the owner of the system on L1. Any L1 contract that is ownable has
// this account set as its owner. // this account set as its owner.
FinalSystemOwner common.Address `json:"finalSystemOwner"` FinalSystemOwner common.Address `json:"finalSystemOwner"`
// PortalGuardian represents the GUARDIAN account in the OptimismPortal. Has the ability to pause withdrawals. // SuperchainConfigGuardian represents the GUARDIAN account in the SuperchainConfig. Has the ability to pause withdrawals.
PortalGuardian common.Address `json:"portalGuardian"` SuperchainConfigGuardian common.Address `json:"superchainConfigGuardian"`
// BaseFeeVaultRecipient represents the recipient of fees accumulated in the BaseFeeVault. // BaseFeeVaultRecipient represents the recipient of fees accumulated in the BaseFeeVault.
// Can be an account on L1 or L2, depending on the BaseFeeVaultWithdrawalNetwork value. // Can be an account on L1 or L2, depending on the BaseFeeVaultWithdrawalNetwork value.
BaseFeeVaultRecipient common.Address `json:"baseFeeVaultRecipient"` BaseFeeVaultRecipient common.Address `json:"baseFeeVaultRecipient"`
...@@ -252,8 +252,8 @@ func (d *DeployConfig) Check() error { ...@@ -252,8 +252,8 @@ func (d *DeployConfig) Check() error {
if d.L2OutputOracleStartingBlockNumber == 0 { if d.L2OutputOracleStartingBlockNumber == 0 {
log.Warn("L2OutputOracleStartingBlockNumber is 0, should only be 0 for fresh chains") log.Warn("L2OutputOracleStartingBlockNumber is 0, should only be 0 for fresh chains")
} }
if d.PortalGuardian == (common.Address{}) { if d.SuperchainConfigGuardian == (common.Address{}) {
return fmt.Errorf("%w: PortalGuardian cannot be address(0)", ErrInvalidDeployConfig) return fmt.Errorf("%w: SuperchainConfigGuardian cannot be address(0)", ErrInvalidDeployConfig)
} }
if d.MaxSequencerDrift == 0 { if d.MaxSequencerDrift == 0 {
return fmt.Errorf("%w: MaxSequencerDrift cannot be 0", ErrInvalidDeployConfig) return fmt.Errorf("%w: MaxSequencerDrift cannot be 0", ErrInvalidDeployConfig)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"l1GenesisBlockGasLimit": "0x1c9c380", "l1GenesisBlockGasLimit": "0x1c9c380",
"l1GenesisBlockDifficulty": "0x1", "l1GenesisBlockDifficulty": "0x1",
"finalSystemOwner": "0xbcd4042de499d14e55001ccbb24a551f3b954096", "finalSystemOwner": "0xbcd4042de499d14e55001ccbb24a551f3b954096",
"portalGuardian": "0x0000000000000000000000000000000000000112", "superchainConfigGuardian": "0x0000000000000000000000000000000000000112",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
"l1GenesisBlockMixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "l1GenesisBlockMixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"l1GenesisBlockCoinbase": "0x0000000000000000000000000000000000000000", "l1GenesisBlockCoinbase": "0x0000000000000000000000000000000000000000",
......
...@@ -269,9 +269,9 @@ func OptimismPortal(batch *safe.Batch, implementations superchain.Implementation ...@@ -269,9 +269,9 @@ func OptimismPortal(batch *safe.Batch, implementations superchain.Implementation
return err return err
} }
var portalGuardian common.Address var superchainConfigGuardian common.Address
if config != nil { if config != nil {
portalGuardian = config.PortalGuardian superchainConfigGuardian = config.SuperchainConfigGuardian
} else { } else {
optimismPortal, err := bindings.NewOptimismPortalCaller(common.HexToAddress(list.OptimismPortalProxy.String()), backend) optimismPortal, err := bindings.NewOptimismPortalCaller(common.HexToAddress(list.OptimismPortalProxy.String()), backend)
if err != nil { if err != nil {
...@@ -281,10 +281,10 @@ func OptimismPortal(batch *safe.Batch, implementations superchain.Implementation ...@@ -281,10 +281,10 @@ func OptimismPortal(batch *safe.Batch, implementations superchain.Implementation
if err != nil { if err != nil {
return err return err
} }
portalGuardian = guardian superchainConfigGuardian = guardian
} }
calldata, err := optimismPortalABI.Pack("initialize", common.HexToAddress(list.L2OutputOracleProxy.String()), portalGuardian, common.HexToAddress(chainConfig.SystemConfigAddr.String()), false) calldata, err := optimismPortalABI.Pack("initialize", common.HexToAddress(list.L2OutputOracleProxy.String()), superchainConfigGuardian, common.HexToAddress(chainConfig.SystemConfigAddr.String()), false)
if err != nil { if err != nil {
return err return err
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"sequencerFeeVaultWithdrawalNetwork": "remote", "sequencerFeeVaultWithdrawalNetwork": "remote",
"proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"portalGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "superchainConfigGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
"fundDevAccounts": true, "fundDevAccounts": true,
"l2GenesisBlockBaseFeePerGas": "0x1", "l2GenesisBlockBaseFeePerGas": "0x1",
......
{ {
"finalSystemOwner": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "finalSystemOwner": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"portalGuardian": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "superchainConfigGuardian": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"l1StartingBlockTag": "0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7", "l1StartingBlockTag": "0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7",
"l1ChainID": 5, "l1ChainID": 5,
"l2ChainID": 420, "l2ChainID": 420,
......
{ {
"finalSystemOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "finalSystemOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"portalGuardian": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "superchainConfigGuardian": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"proxyAdminOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "proxyAdminOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"l1StartingBlockTag": "earliest", "l1StartingBlockTag": "earliest",
"l1ChainID": 900, "l1ChainID": 900,
......
{ {
"finalSystemOwner": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF", "finalSystemOwner": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF",
"portalGuardian": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF", "superchainConfigGuardian": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF",
"l1StartingBlockTag": "0x19c7e6b18fe156e45f4cfef707294fd8f079fa9c30a7b7cd6ec1ce3682ec6a2e", "l1StartingBlockTag": "0x19c7e6b18fe156e45f4cfef707294fd8f079fa9c30a7b7cd6ec1ce3682ec6a2e",
"l1ChainID": 5, "l1ChainID": 5,
"l2ChainID": 998, "l2ChainID": 998,
......
{ {
"finalSystemOwner": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A", "finalSystemOwner": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A",
"portalGuardian": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A", "superchainConfigGuardian": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A",
"l1StartingBlockTag": "0x438335a20d98863a4c0c97999eb2481921ccd28553eac6f913af7c12aec04108", "l1StartingBlockTag": "0x438335a20d98863a4c0c97999eb2481921ccd28553eac6f913af7c12aec04108",
"l1ChainID": 1, "l1ChainID": 1,
"l2ChainID": 10, "l2ChainID": 10,
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"batchInboxAddress": "0x454A2A86132C937AD4eFc8721f1b85418f92cbCe", "batchInboxAddress": "0x454A2A86132C937AD4eFc8721f1b85418f92cbCe",
"batchSenderAddress": "0x7224e05E6cF6E07aFBE1eFa09a3fA23A637DD485", "batchSenderAddress": "0x7224e05E6cF6E07aFBE1eFa09a3fA23A637DD485",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"portalGuardian": "0x45eFFbD799Ab49122eeEAB75B78D9C56A187F9A7", "superchainConfigGuardian": "0x45eFFbD799Ab49122eeEAB75B78D9C56A187F9A7",
"l2OutputOracleSubmissionInterval": 180, "l2OutputOracleSubmissionInterval": 180,
"l2OutputOracleStartingTimestamp": -1, "l2OutputOracleStartingTimestamp": -1,
"l2OutputOracleProposer": "0xD457799C5ba870D609f21048c67a9b11aC611BF0", "l2OutputOracleProposer": "0xD457799C5ba870D609f21048c67a9b11aC611BF0",
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"batchInboxAddress": "0xC1B90E1e459aBBDcEc4DCF90dA45ba077d83BFc5", "batchInboxAddress": "0xC1B90E1e459aBBDcEc4DCF90dA45ba077d83BFc5",
"batchSenderAddress": "0x99526b0e49A95833E734EB556A6aBaFFAb0Ee167", "batchSenderAddress": "0x99526b0e49A95833E734EB556A6aBaFFAb0Ee167",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"portalGuardian": "0x39E13D1AB040F6EA58CE19998edCe01B3C365f84", "superchainConfigGuardian": "0x39E13D1AB040F6EA58CE19998edCe01B3C365f84",
"l2OutputOracleSubmissionInterval": 1800, "l2OutputOracleSubmissionInterval": 1800,
"l2OutputOracleStartingTimestamp": -1, "l2OutputOracleStartingTimestamp": -1,
"l2OutputOracleProposer": "0x69968Ce0E92d9c101BAd81de55EFbcb69603cFe3", "l2OutputOracleProposer": "0x69968Ce0E92d9c101BAd81de55EFbcb69603cFe3",
......
{ {
"finalSystemOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301", "finalSystemOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"portalGuardian": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301", "superchainConfigGuardian": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"l1StartingBlockTag": "0x48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b", "l1StartingBlockTag": "0x48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b",
"l1ChainID": 11155111, "l1ChainID": 11155111,
"l2ChainID": 11155420, "l2ChainID": 11155420,
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"batchInboxAddress": "0xcF628E24aC574866D3d0a7CFE4e9DA7278b7ef13", "batchInboxAddress": "0xcF628E24aC574866D3d0a7CFE4e9DA7278b7ef13",
"batchSenderAddress": "0x427c9a666d3b27873111cE3894712Bf64C6343A0", "batchSenderAddress": "0x427c9a666d3b27873111cE3894712Bf64C6343A0",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"portalGuardian": "0x45eFFbD799Ab49122eeEAB75B78D9C56A187F9A7", "superchainConfigGuardian": "0x45eFFbD799Ab49122eeEAB75B78D9C56A187F9A7",
"l2OutputOracleSubmissionInterval": 180, "l2OutputOracleSubmissionInterval": 180,
"l2OutputOracleStartingTimestamp": 0, "l2OutputOracleStartingTimestamp": 0,
"l2OutputOracleProposer": "0xa98B585654fC03E2fEa3FAB56E1C851E4f5c2B54", "l2OutputOracleProposer": "0xa98B585654fC03E2fEa3FAB56E1C851E4f5c2B54",
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"batchInboxAddress": "0x6F54Ca6F6EdE96662024Ffd61BFd18f3f4e34DFf", "batchInboxAddress": "0x6F54Ca6F6EdE96662024Ffd61BFd18f3f4e34DFf",
"batchSenderAddress": "0x625726c858dBF78c0125436C943Bf4b4bE9d9033", "batchSenderAddress": "0x625726c858dBF78c0125436C943Bf4b4bE9d9033",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"portalGuardian": "0xC72aE5c7cc9a332699305E29F68Be66c73b60542", "superchainConfigGuardian": "0xC72aE5c7cc9a332699305E29F68Be66c73b60542",
"l2OutputOracleSubmissionInterval": 1800, "l2OutputOracleSubmissionInterval": 1800,
"l2OutputOracleStartingTimestamp": -1, "l2OutputOracleStartingTimestamp": -1,
"l2OutputOracleProposer": "0x48247032092e7b0ecf5dEF611ad89eaf3fC888Dd", "l2OutputOracleProposer": "0x48247032092e7b0ecf5dEF611ad89eaf3fC888Dd",
......
...@@ -145,15 +145,15 @@ library ChainAssertions { ...@@ -145,15 +145,15 @@ library ChainAssertions {
{ {
OptimismPortal portal = OptimismPortal(payable(_contracts.OptimismPortal)); OptimismPortal portal = OptimismPortal(payable(_contracts.OptimismPortal));
address guardian = _cfg.portalGuardian(); address guardian = _cfg.superchainConfigGuardian();
if (guardian.code.length == 0) { if (guardian.code.length == 0) {
console.log("Portal guardian has no code: %s", guardian); console.log("Portal guardian has no code: %s", guardian);
} }
require(address(portal.L2_ORACLE()) == _contracts.L2OutputOracle); require(address(portal.L2_ORACLE()) == _contracts.L2OutputOracle);
require(address(portal.l2Oracle()) == _contracts.L2OutputOracle); require(address(portal.l2Oracle()) == _contracts.L2OutputOracle);
require(portal.GUARDIAN() == _cfg.portalGuardian()); require(portal.GUARDIAN() == _cfg.superchainConfigGuardian());
require(portal.guardian() == _cfg.portalGuardian()); require(portal.guardian() == _cfg.superchainConfigGuardian());
require(address(portal.SYSTEM_CONFIG()) == _contracts.SystemConfig); require(address(portal.SYSTEM_CONFIG()) == _contracts.SystemConfig);
require(address(portal.systemConfig()) == _contracts.SystemConfig); require(address(portal.systemConfig()) == _contracts.SystemConfig);
require(address(portal.superchainConfig()) == address(_contracts.SuperchainConfig)); require(address(portal.superchainConfig()) == address(_contracts.SuperchainConfig));
...@@ -183,15 +183,15 @@ library ChainAssertions { ...@@ -183,15 +183,15 @@ library ChainAssertions {
/// @notice Asserts that the SuperchainConfig is setup correctly /// @notice Asserts that the SuperchainConfig is setup correctly
function checkSuperchainConfig( function checkSuperchainConfig(
Types.ContractSet memory _proxies, Types.ContractSet memory _contracts,
DeployConfig _cfg, DeployConfig _cfg,
bool _isPaused bool _isPaused
) )
internal internal
view view
{ {
SuperchainConfig superchainConfig = SuperchainConfig(_proxies.SuperchainConfig); SuperchainConfig superchainConfig = SuperchainConfig(_contracts.SuperchainConfig);
require(superchainConfig.guardian() == _cfg.portalGuardian()); require(superchainConfig.guardian() == _cfg.superchainConfigGuardian());
require(superchainConfig.paused() == _isPaused); require(superchainConfig.paused() == _isPaused);
} }
} }
...@@ -497,7 +497,7 @@ contract Deploy is Deployer { ...@@ -497,7 +497,7 @@ contract Deploy is Deployer {
/// @notice Deploy the OptimismPortal /// @notice Deploy the OptimismPortal
function deployOptimismPortal() public broadcast returns (address addr_) { function deployOptimismPortal() public broadcast returns (address addr_) {
console.log("Deploying OptimismPortal implementation"); console.log("Deploying OptimismPortal implementation");
address guardian = cfg.portalGuardian(); address guardian = cfg.superchainConfigGuardian();
if (guardian.code.length == 0) { if (guardian.code.length == 0) {
console.log("Portal guardian has no code: %s", guardian); console.log("Portal guardian has no code: %s", guardian);
} }
...@@ -508,8 +508,6 @@ contract Deploy is Deployer { ...@@ -508,8 +508,6 @@ contract Deploy is Deployer {
OptimismPortal portal = new OptimismPortal{ salt: _implSalt() }({ OptimismPortal portal = new OptimismPortal{ salt: _implSalt() }({
_l2Oracle: l2OutputOracle, _l2Oracle: l2OutputOracle,
_guardian: guardian,
_paused: true,
_systemConfig: systemConfig, _systemConfig: systemConfig,
_superchainConfig: superchainConfig _superchainConfig: superchainConfig
}); });
...@@ -735,10 +733,10 @@ contract Deploy is Deployer { ...@@ -735,10 +733,10 @@ contract Deploy is Deployer {
_upgradeAndCallViaSafe({ _upgradeAndCallViaSafe({
_proxy: superchainConfigProxy, _proxy: superchainConfigProxy,
_implementation: superchainConfig, _implementation: superchainConfig,
_innerCallData: abi.encodeCall(SuperchainConfig.initialize, (cfg.portalGuardian())) _innerCallData: abi.encodeCall(SuperchainConfig.initialize, (cfg.superchainConfigGuardian()))
}); });
ChainAssertions.checkSuperchainConfig({ _proxies: _proxiesUnstrict(), _cfg: cfg, _isPaused: false }); ChainAssertions.checkSuperchainConfig({ _contracts: _proxiesUnstrict(), _cfg: cfg, _isPaused: false });
} }
/// @notice Initialize the DisputeGameFactory /// @notice Initialize the DisputeGameFactory
......
...@@ -15,7 +15,7 @@ contract DeployConfig is Script { ...@@ -15,7 +15,7 @@ contract DeployConfig is Script {
string internal _json; string internal _json;
address public finalSystemOwner; address public finalSystemOwner;
address public portalGuardian; address public superchainConfigGuardian;
uint256 public l1ChainID; uint256 public l1ChainID;
uint256 public l2ChainID; uint256 public l2ChainID;
uint256 public l2BlockTime; uint256 public l2BlockTime;
...@@ -64,7 +64,7 @@ contract DeployConfig is Script { ...@@ -64,7 +64,7 @@ contract DeployConfig is Script {
} }
finalSystemOwner = stdJson.readAddress(_json, "$.finalSystemOwner"); finalSystemOwner = stdJson.readAddress(_json, "$.finalSystemOwner");
portalGuardian = stdJson.readAddress(_json, "$.portalGuardian"); superchainConfigGuardian = stdJson.readAddress(_json, "$.superchainConfigGuardian");
l1ChainID = stdJson.readUint(_json, "$.l1ChainID"); l1ChainID = stdJson.readUint(_json, "$.l1ChainID");
l2ChainID = stdJson.readUint(_json, "$.l2ChainID"); l2ChainID = stdJson.readUint(_json, "$.l2ChainID");
l2BlockTime = stdJson.readUint(_json, "$.l2BlockTime"); l2BlockTime = stdJson.readUint(_json, "$.l2BlockTime");
......
...@@ -28,7 +28,7 @@ blockhash=$(echo "$block" | awk '/hash/ { print $2 }') ...@@ -28,7 +28,7 @@ blockhash=$(echo "$block" | awk '/hash/ { print $2 }')
config=$(cat << EOL config=$(cat << EOL
{ {
"finalSystemOwner": "$GS_ADMIN_ADDRESS", "finalSystemOwner": "$GS_ADMIN_ADDRESS",
"portalGuardian": "$GS_ADMIN_ADDRESS", "superchainConfigGuardian": "$GS_ADMIN_ADDRESS",
"l1StartingBlockTag": "$blockhash", "l1StartingBlockTag": "$blockhash",
......
...@@ -30,7 +30,7 @@ contract OptimismPortal_Test is CommonTest { ...@@ -30,7 +30,7 @@ contract OptimismPortal_Test is CommonTest {
/// @dev Tests that the constructor sets the correct values. /// @dev Tests that the constructor sets the correct values.
function test_constructor_succeeds() external { function test_constructor_succeeds() external {
address guardian = deploy.cfg().portalGuardian(); address guardian = deploy.cfg().superchainConfigGuardian();
assertEq(address(optimismPortal.L2_ORACLE()), address(l2OutputOracle)); assertEq(address(optimismPortal.L2_ORACLE()), address(l2OutputOracle));
assertEq(address(optimismPortal.l2Oracle()), address(l2OutputOracle)); assertEq(address(optimismPortal.l2Oracle()), address(l2OutputOracle));
assertEq(optimismPortal.GUARDIAN(), guardian); assertEq(optimismPortal.GUARDIAN(), guardian);
......
...@@ -17,7 +17,7 @@ contract SuperchainConfig_Init_Test is CommonTest { ...@@ -17,7 +17,7 @@ contract SuperchainConfig_Init_Test is CommonTest {
/// @dev Tests that initialization sets the correct values. These are defined in CommonTest.sol. /// @dev Tests that initialization sets the correct values. These are defined in CommonTest.sol.
function test_initialize_values_succeeds() external { function test_initialize_values_succeeds() external {
assertFalse(superchainConfig.paused()); assertFalse(superchainConfig.paused());
assertEq(superchainConfig.guardian(), deploy.cfg().portalGuardian()); assertEq(superchainConfig.guardian(), deploy.cfg().superchainConfigGuardian());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment