diff --git a/op-chain-ops/deployer/opcm/opchain.go b/op-chain-ops/deployer/opcm/opchain.go index 7a750f72fb0d3..9f13c19f1e85c 100644 --- a/op-chain-ops/deployer/opcm/opchain.go +++ b/op-chain-ops/deployer/opcm/opchain.go @@ -30,12 +30,14 @@ type DeployOPChainInput struct { Proposer common.Address Challenger common.Address - BasefeeScalar uint32 - BlobBaseFeeScalar uint32 - L2ChainId *big.Int - OpcmProxy common.Address - SaltMixer string - GasLimit uint64 + BasefeeScalar uint32 + BlobBaseFeeScalar uint32 + L2ChainId *big.Int + OpcmProxy common.Address + SaltMixer string + GasLimit uint64 + EIP1559Denominator uint32 + EIP1559Elasticity uint32 DisputeGameType uint32 DisputeAbsolutePrestate common.Hash @@ -133,6 +135,8 @@ type opcmDeployInput struct { StartingAnchorRoots []byte SaltMixer string GasLimit uint64 + EIP1559Denominator uint32 + EIP1559Elasticity uint32 DisputeGameType uint32 DisputeAbsolutePrestate common.Hash DisputeMaxGameDepth *big.Int @@ -259,6 +263,8 @@ func DeployOPChainRaw( StartingAnchorRoots: input.StartingAnchorRoots(), SaltMixer: input.SaltMixer, GasLimit: input.GasLimit, + EIP1559Denominator: input.EIP1559Denominator, + EIP1559Elasticity: input.EIP1559Elasticity, DisputeGameType: input.DisputeGameType, DisputeAbsolutePrestate: input.DisputeAbsolutePrestate, DisputeMaxGameDepth: new(big.Int).SetUint64(input.DisputeMaxGameDepth), diff --git a/op-chain-ops/deployer/pipeline/opchain.go b/op-chain-ops/deployer/pipeline/opchain.go index c97f162e94017..c8fd84da7d20c 100644 --- a/op-chain-ops/deployer/pipeline/opchain.go +++ b/op-chain-ops/deployer/pipeline/opchain.go @@ -41,6 +41,8 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs, OpcmProxy: st.ImplementationsDeployment.OpcmProxyAddress, SaltMixer: st.Create2Salt.String(), // passing through salt generated at state initialization GasLimit: 30_000_000, + EIP1559Denominator: 250, + EIP1559Elasticity: 6, DisputeGameType: 1, // PERMISSIONED_CANNON Game Type DisputeAbsolutePrestate: common.HexToHash("0x038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c"), DisputeMaxGameDepth: 73, diff --git a/op-chain-ops/interopgen/deploy.go b/op-chain-ops/interopgen/deploy.go index 7f238023572a3..59715031774b1 100644 --- a/op-chain-ops/interopgen/deploy.go +++ b/op-chain-ops/interopgen/deploy.go @@ -209,6 +209,8 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme OpcmProxy: superDeployment.OpcmProxy, SaltMixer: cfg.SaltMixer, GasLimit: cfg.GasLimit, + EIP1559Denominator: uint32(cfg.EIP1559Denominator), + EIP1559Elasticity: uint32(cfg.EIP1559Elasticity), DisputeGameType: cfg.DisputeGameType, DisputeAbsolutePrestate: cfg.DisputeAbsolutePrestate, DisputeMaxGameDepth: cfg.DisputeMaxGameDepth, diff --git a/packages/contracts-bedrock/.gas-snapshot b/packages/contracts-bedrock/.gas-snapshot index 8e43cb748941e..c0eefafe7acdb 100644 --- a/packages/contracts-bedrock/.gas-snapshot +++ b/packages/contracts-bedrock/.gas-snapshot @@ -4,14 +4,14 @@ GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchm GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5099) GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531) GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597) -GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369242) -GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967382) -GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564356) -GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4076571) -GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 467019) -GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3512723) -GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 72618) +GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369350) +GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967490) +GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564464) +GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4076679) +GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 466998) +GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3512702) +GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 72661) GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 92973) -GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68357) -GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68921) +GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68422) +GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68986) GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 155610) \ No newline at end of file diff --git a/packages/contracts-bedrock/scripts/DeployImplementations.s.sol b/packages/contracts-bedrock/scripts/DeployImplementations.s.sol index c8476b8a2e508..442f28dcbb114 100644 --- a/packages/contracts-bedrock/scripts/DeployImplementations.s.sol +++ b/packages/contracts-bedrock/scripts/DeployImplementations.s.sol @@ -369,24 +369,26 @@ contract DeployImplementationsOutput is BaseDeployIO { require(systemConfig.blobbasefeeScalar() == 0, "SYSCON-50"); require(systemConfig.batcherHash() == bytes32(0), "SYSCON-60"); require(systemConfig.gasLimit() == 1, "SYSCON-70"); - require(systemConfig.unsafeBlockSigner() == address(0), "SYSCON-80"); + require(systemConfig.eip1559Denominator() == 1, "SYSCON-80"); + require(systemConfig.eip1559Elasticity() == 1, "SYSCON-90"); + require(systemConfig.unsafeBlockSigner() == address(0), "SYSCON-100"); IResourceMetering.ResourceConfig memory resourceConfig = systemConfig.resourceConfig(); - require(resourceConfig.maxResourceLimit == 1, "SYSCON-90"); - require(resourceConfig.elasticityMultiplier == 1, "SYSCON-100"); - require(resourceConfig.baseFeeMaxChangeDenominator == 2, "SYSCON-110"); - require(resourceConfig.systemTxMaxGas == 0, "SYSCON-120"); - require(resourceConfig.minimumBaseFee == 0, "SYSCON-130"); - require(resourceConfig.maximumBaseFee == 0, "SYSCON-140"); - - require(systemConfig.startBlock() == type(uint256).max, "SYSCON-150"); - require(systemConfig.batchInbox() == address(0), "SYSCON-160"); - require(systemConfig.l1CrossDomainMessenger() == address(0), "SYSCON-170"); - require(systemConfig.l1ERC721Bridge() == address(0), "SYSCON-180"); - require(systemConfig.l1StandardBridge() == address(0), "SYSCON-190"); - require(systemConfig.disputeGameFactory() == address(0), "SYSCON-200"); - require(systemConfig.optimismPortal() == address(0), "SYSCON-210"); - require(systemConfig.optimismMintableERC20Factory() == address(0), "SYSCON-220"); + require(resourceConfig.maxResourceLimit == 1, "SYSCON-110"); + require(resourceConfig.elasticityMultiplier == 1, "SYSCON-120"); + require(resourceConfig.baseFeeMaxChangeDenominator == 2, "SYSCON-130"); + require(resourceConfig.systemTxMaxGas == 0, "SYSCON-140"); + require(resourceConfig.minimumBaseFee == 0, "SYSCON-150"); + require(resourceConfig.maximumBaseFee == 0, "SYSCON-160"); + + require(systemConfig.startBlock() == type(uint256).max, "SYSCON-170"); + require(systemConfig.batchInbox() == address(0), "SYSCON-180"); + require(systemConfig.l1CrossDomainMessenger() == address(0), "SYSCON-190"); + require(systemConfig.l1ERC721Bridge() == address(0), "SYSCON-200"); + require(systemConfig.l1StandardBridge() == address(0), "SYSCON-210"); + require(systemConfig.disputeGameFactory() == address(0), "SYSCON-220"); + require(systemConfig.optimismPortal() == address(0), "SYSCON-230"); + require(systemConfig.optimismMintableERC20Factory() == address(0), "SYSCON-240"); } function assertValidL1CrossDomainMessengerImpl(DeployImplementationsInput) internal view { diff --git a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol index ea285c95f4b3f..1bb5fc18a836c 100644 --- a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol +++ b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol @@ -49,6 +49,8 @@ contract DeployOPChainInput is BaseDeployIO { OPContractsManager internal _opcmProxy; string internal _saltMixer; uint64 internal _gasLimit; + uint32 internal _eip1559Denominator; + uint32 internal _eip1559Elasticity; // Configurable dispute game inputs GameType internal _disputeGameType; @@ -80,6 +82,10 @@ contract DeployOPChainInput is BaseDeployIO { _l2ChainId = _value; } else if (_sel == this.gasLimit.selector) { _gasLimit = SafeCast.toUint64(_value); + } else if (_sel == this.eip1559Denominator.selector) { + _eip1559Denominator = SafeCast.toUint32(_value); + } else if (_sel == this.eip1559Elasticity.selector) { + _eip1559Elasticity = SafeCast.toUint32(_value); } else if (_sel == this.disputeGameType.selector) { _disputeGameType = GameType.wrap(SafeCast.toUint32(_value)); } else if (_sel == this.disputeMaxGameDepth.selector) { @@ -187,6 +193,14 @@ contract DeployOPChainInput is BaseDeployIO { return _gasLimit; } + function eip1559Denominator() public view returns (uint32) { + return _eip1559Denominator; + } + + function eip1559Elasticity() public view returns (uint32) { + return _eip1559Elasticity; + } + function disputeGameType() public view returns (GameType) { return _disputeGameType; } @@ -570,6 +584,8 @@ contract DeployOPChain is Script { startingAnchorRoots: _doi.startingAnchorRoots(), saltMixer: _doi.saltMixer(), gasLimit: _doi.gasLimit(), + eip1559Denominator: _doi.eip1559Denominator(), + eip1559Elasticity: _doi.eip1559Elasticity(), disputeGameType: _doi.disputeGameType(), disputeAbsolutePrestate: _doi.disputeAbsolutePrestate(), disputeMaxGameDepth: _doi.disputeMaxGameDepth(), diff --git a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol index b89ef5a0612d8..fe15752bec0f1 100644 --- a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol @@ -1080,6 +1080,15 @@ contract Deploy is Deployer { } IProxyAdmin proxyAdmin = IProxyAdmin(payable(mustGetAddress("ProxyAdmin"))); + ISystemConfig.Addresses memory addresses = ISystemConfig.Addresses({ + l1CrossDomainMessenger: mustGetAddress("L1CrossDomainMessengerProxy"), + l1ERC721Bridge: mustGetAddress("L1ERC721BridgeProxy"), + l1StandardBridge: mustGetAddress("L1StandardBridgeProxy"), + disputeGameFactory: mustGetAddress("DisputeGameFactoryProxy"), + optimismPortal: mustGetAddress("OptimismPortalProxy"), + optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy"), + gasPayingToken: customGasTokenAddress + }); proxyAdmin.upgradeAndCall({ _proxy: payable(systemConfigProxy), _implementation: systemConfig, @@ -1091,18 +1100,12 @@ contract Deploy is Deployer { cfg.blobbasefeeScalar(), batcherHash, uint64(cfg.l2GenesisBlockGasLimit()), + uint32(cfg.eip1559Denominator()), + uint32(cfg.eip1559Elasticity()), cfg.p2pSequencerAddress(), Constants.DEFAULT_RESOURCE_CONFIG(), cfg.batchInboxAddress(), - ISystemConfig.Addresses({ - l1CrossDomainMessenger: mustGetAddress("L1CrossDomainMessengerProxy"), - l1ERC721Bridge: mustGetAddress("L1ERC721BridgeProxy"), - l1StandardBridge: mustGetAddress("L1StandardBridgeProxy"), - disputeGameFactory: mustGetAddress("DisputeGameFactoryProxy"), - optimismPortal: mustGetAddress("OptimismPortalProxy"), - optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy"), - gasPayingToken: customGasTokenAddress - }) + addresses ) ) }); diff --git a/packages/contracts-bedrock/semver-lock.json b/packages/contracts-bedrock/semver-lock.json index ca879f5b2bdeb..45713cb23ddf4 100644 --- a/packages/contracts-bedrock/semver-lock.json +++ b/packages/contracts-bedrock/semver-lock.json @@ -24,8 +24,8 @@ "sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649" }, "src/L1/OPContractsManager.sol": { - "initCodeHash": "0xd58cb3978affc5c1457cdd498ff8420c90aef804d4c3b62cf42ab2691986d6d2", - "sourceCodeHash": "0x7bfa6eff76176649fe600303cd60009a0f6e282cbaec55836b5ea1f8875cbeb5" + "initCodeHash": "0xeb453dfe363ca345779b8671278c99542df651c0f465ba0ff9500bad369ecec0", + "sourceCodeHash": "0x8d4620523fa18d0ce8cbae546a698f9d6cdfa613fc21d33b8c178bdfb8e4b0b6" }, "src/L1/OptimismPortal.sol": { "initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190", @@ -48,12 +48,12 @@ "sourceCodeHash": "0x39489a85bc3a5c8560f82d41b31bf7fe22f5b648f4ed538f61695a73092ea9eb" }, "src/L1/SystemConfig.sol": { - "initCodeHash": "0x2fc36af5b3c493a423a19e0b597f6ff230b756b861b68099f3192d69b6088dc0", - "sourceCodeHash": "0x06a50ac992175fdb434b13e8461893e83862c23ce399e697e6e8109728ad1a3d" + "initCodeHash": "0x983d2115e57a76911d3756a18240bbd75a96814a628181e967a681b440a047e3", + "sourceCodeHash": "0x5e7d3348673d315ae18294611a842ff6c3db833db8fc1d850c19ad50af416584" }, "src/L1/SystemConfigInterop.sol": { - "initCodeHash": "0x7515e5ed1266412a8c2d27d99aba6266fda2fc9068c20f0b7e6b555ee5073c91", - "sourceCodeHash": "0x441d1e3e8e987f829f55996b5b6c850da8c59ad48f09cf7e0a69a1fa559d42a2" + "initCodeHash": "0x94fcdc582016cc51882454cb440c8a63217625c7768cb23c2294b01fc7ce830f", + "sourceCodeHash": "0x18005ac296708248b59fbe1f3c24dc35aa24ed5d8e4413c15acc1b43970bb04c" }, "src/L2/BaseFeeVault.sol": { "initCodeHash": "0x3bfcd57e25ad54b66c374f63e24e33a6cf107044aa8f5f69ef21202c380b5c5b", diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json index 7c478feb235d4..7d37361016971 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManager.json @@ -173,6 +173,16 @@ "name": "gasLimit", "type": "uint64" }, + { + "internalType": "uint32", + "name": "eip1559Denominator", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "eip1559Elasticity", + "type": "uint32" + }, { "internalType": "GameType", "name": "disputeGameType", diff --git a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerInterop.json b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerInterop.json index 7c478feb235d4..7d37361016971 100644 --- a/packages/contracts-bedrock/snapshots/abi/OPContractsManagerInterop.json +++ b/packages/contracts-bedrock/snapshots/abi/OPContractsManagerInterop.json @@ -173,6 +173,16 @@ "name": "gasLimit", "type": "uint64" }, + { + "internalType": "uint32", + "name": "eip1559Denominator", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "eip1559Elasticity", + "type": "uint32" + }, { "internalType": "GameType", "name": "disputeGameType", diff --git a/packages/contracts-bedrock/snapshots/abi/SystemConfig.json b/packages/contracts-bedrock/snapshots/abi/SystemConfig.json index 695231b9b1196..f2acb1a071531 100644 --- a/packages/contracts-bedrock/snapshots/abi/SystemConfig.json +++ b/packages/contracts-bedrock/snapshots/abi/SystemConfig.json @@ -199,6 +199,32 @@ "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", @@ -283,6 +309,16 @@ "name": "_gasLimit", "type": "uint64" }, + { + "internalType": "uint32", + "name": "_eip1559Denominator", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_eip1559Elasticity", + "type": "uint32" + }, { "internalType": "address", "name": "_unsafeBlockSigner", @@ -586,6 +622,24 @@ "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": [ { diff --git a/packages/contracts-bedrock/snapshots/abi/SystemConfigInterop.json b/packages/contracts-bedrock/snapshots/abi/SystemConfigInterop.json index 64f72945615b4..6c7467df2a825 100644 --- a/packages/contracts-bedrock/snapshots/abi/SystemConfigInterop.json +++ b/packages/contracts-bedrock/snapshots/abi/SystemConfigInterop.json @@ -220,6 +220,32 @@ "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", @@ -304,6 +330,16 @@ "name": "_gasLimit", "type": "uint64" }, + { + "internalType": "uint32", + "name": "_eip1559Denominator", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_eip1559Elasticity", + "type": "uint32" + }, { "internalType": "address", "name": "_unsafeBlockSigner", @@ -431,6 +467,16 @@ "name": "_gasLimit", "type": "uint64" }, + { + "internalType": "uint32", + "name": "_eip1559Denominator", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_eip1559Elasticity", + "type": "uint32" + }, { "internalType": "address", "name": "_unsafeBlockSigner", @@ -747,6 +793,24 @@ "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": [ { diff --git a/packages/contracts-bedrock/snapshots/storageLayout/SystemConfig.json b/packages/contracts-bedrock/snapshots/storageLayout/SystemConfig.json index b0946e1bc4dba..a6184a1f10dd5 100644 --- a/packages/contracts-bedrock/snapshots/storageLayout/SystemConfig.json +++ b/packages/contracts-bedrock/snapshots/storageLayout/SystemConfig.json @@ -82,5 +82,19 @@ "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" } ] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/storageLayout/SystemConfigInterop.json b/packages/contracts-bedrock/snapshots/storageLayout/SystemConfigInterop.json index b0946e1bc4dba..a6184a1f10dd5 100644 --- a/packages/contracts-bedrock/snapshots/storageLayout/SystemConfigInterop.json +++ b/packages/contracts-bedrock/snapshots/storageLayout/SystemConfigInterop.json @@ -82,5 +82,19 @@ "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" } ] \ No newline at end of file diff --git a/packages/contracts-bedrock/src/L1/OPContractsManager.sol b/packages/contracts-bedrock/src/L1/OPContractsManager.sol index 4bf52ff228a19..b3bafb683ab2b 100644 --- a/packages/contracts-bedrock/src/L1/OPContractsManager.sol +++ b/packages/contracts-bedrock/src/L1/OPContractsManager.sol @@ -60,6 +60,8 @@ contract OPContractsManager is ISemver, Initializable { // The salt mixer is used as part of making the resulting salt unique. string saltMixer; uint64 gasLimit; + uint32 eip1559Denominator; + uint32 eip1559Elasticity; // Configurable dispute game parameters. GameType disputeGameType; Claim disputeAbsolutePrestate; @@ -129,8 +131,8 @@ contract OPContractsManager is ISemver, Initializable { // -------- Constants and Variables -------- - /// @custom:semver 1.0.0-beta.20 - string public constant version = "1.0.0-beta.20"; + /// @custom:semver 1.0.0-beta.21 + string public constant version = "1.0.0-beta.21"; /// @notice Represents the interface version so consumers know how to decode the DeployOutput struct /// that's emitted in the `Deployed` event. Whenever that struct changes, a new version should be used. @@ -485,6 +487,7 @@ contract OPContractsManager is ISemver, Initializable { ISystemConfig.Addresses memory opChainAddrs ) = defaultSystemConfigParams(_selector, _input, _output); + address batchInboxAddress = chainIdToBatchInboxAddress(_input.l2ChainId); return abi.encodeWithSelector( _selector, _input.roles.systemConfigOwner, @@ -492,9 +495,11 @@ contract OPContractsManager is ISemver, Initializable { _input.blobBasefeeScalar, bytes32(uint256(uint160(_input.roles.batcher))), // batcherHash _input.gasLimit, + _input.eip1559Denominator, + _input.eip1559Elasticity, _input.roles.unsafeBlockSigner, referenceResourceConfig, - chainIdToBatchInboxAddress(_input.l2ChainId), + batchInboxAddress, opChainAddrs ); } diff --git a/packages/contracts-bedrock/src/L1/SystemConfig.sol b/packages/contracts-bedrock/src/L1/SystemConfig.sol index 032cb3227984f..5fdd2f7d6ea2f 100644 --- a/packages/contracts-bedrock/src/L1/SystemConfig.sol +++ b/packages/contracts-bedrock/src/L1/SystemConfig.sol @@ -27,11 +27,13 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { /// @custom:value GAS_LIMIT Represents an update to gas limit on L2. /// @custom:value UNSAFE_BLOCK_SIGNER Represents an update to the signer key for unsafe /// block distrubution. + /// @custom:value EIP_1559_PARAMS Represents an update to the EIP-1559 parameters. enum UpdateType { BATCHER, GAS_CONFIG, GAS_LIMIT, - UNSAFE_BLOCK_SIGNER + UNSAFE_BLOCK_SIGNER, + EIP_1559_PARAMS } /// @notice Struct representing the addresses of L1 system contracts. These should be the @@ -123,6 +125,12 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { /// Set as internal with a getter so that the struct is returned instead of a tuple. IResourceMetering.ResourceConfig internal _resourceConfig; + /// @notice The EIP-1559 base fee max change denominator. + uint32 public eip1559Denominator; + + /// @notice The elasticity multiplier for the EIP-1559 market. + uint32 public eip1559Elasticity; + /// @notice Emitted when configuration is updated. /// @param version SystemConfig version. /// @param updateType Type of update. @@ -130,9 +138,9 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data); /// @notice Semantic version. - /// @custom:semver 2.3.0-beta.3 + /// @custom:semver 2.3.0-beta.4 function version() public pure virtual returns (string memory) { - return "2.3.0-beta.3"; + return "2.3.0-beta.4"; } /// @notice Constructs the SystemConfig contract. Cannot set @@ -148,6 +156,8 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { _blobbasefeeScalar: 0, _batcherHash: bytes32(0), _gasLimit: 1, + _eip1559Denominator: 1, + _eip1559Elasticity: 1, _unsafeBlockSigner: address(0), _config: IResourceMetering.ResourceConfig({ maxResourceLimit: 1, @@ -172,22 +182,26 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { /// @notice Initializer. /// The resource config must be set before the require check. - /// @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 _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 _eip1559Denominator Initial EIP-1559 base fee max change denominator. + /// @param _eip1559Elasticity Initial EIP-1559 elasticity multiplier. + /// @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. function initialize( address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, + uint32 _eip1559Denominator, + uint32 _eip1559Elasticity, address _unsafeBlockSigner, IResourceMetering.ResourceConfig memory _config, address _batchInbox, @@ -203,6 +217,7 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { _setBatcherHash(_batcherHash); _setGasConfigEcotone({ _basefeeScalar: _basefeeScalar, _blobbasefeeScalar: _blobbasefeeScalar }); _setGasLimit(_gasLimit); + _setEIP1559Params(_eip1559Denominator, _eip1559Elasticity); Storage.setAddress(UNSAFE_BLOCK_SIGNER_SLOT, _unsafeBlockSigner); Storage.setAddress(BATCH_INBOX_SLOT, _batchInbox); @@ -420,6 +435,22 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { emit ConfigUpdate(VERSION, UpdateType.GAS_LIMIT, data); } + /// @notice Updates the EIP-1559 parameters of the chain. Can only be called by the owner. + /// @param _denominator EIP-1559 base fee max change denominator. + /// @param _elasticity EIP-1559 elasticity multiplier. + function setEIP1559Params(uint32 _denominator, uint32 _elasticity) external onlyOwner { + _setEIP1559Params(_denominator, _elasticity); + } + + /// @notice Internal function for updating the EIP-1559 parameters. + function _setEIP1559Params(uint32 _denominator, uint32 _elasticity) internal { + eip1559Denominator = _denominator; + eip1559Elasticity = _elasticity; + + bytes memory data = abi.encode(uint64(_denominator) << 32 | uint64(_elasticity)); + emit ConfigUpdate(VERSION, UpdateType.EIP_1559_PARAMS, data); + } + /// @notice Sets the start block in a backwards compatible way. Proxies /// that were initialized before the startBlock existed in storage /// can have their start block set by a user provided override. diff --git a/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol b/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol index f7b8921d10d2d..df271d623051e 100644 --- a/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol +++ b/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol @@ -28,23 +28,27 @@ contract SystemConfigInterop is SystemConfig { 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 + /// @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 _eip1559Denominator Initial EIP-1559 base fee max change denominator. + /// @param _eip1559Elasticity Initial EIP-1559 elasticity multiplier. + /// @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, + uint32 _eip1559Denominator, + uint32 _eip1559Elasticity, address _unsafeBlockSigner, IResourceMetering.ResourceConfig memory _config, address _batchInbox, @@ -60,6 +64,8 @@ contract SystemConfigInterop is SystemConfig { _blobbasefeeScalar: _blobbasefeeScalar, _batcherHash: _batcherHash, _gasLimit: _gasLimit, + _eip1559Denominator: _eip1559Denominator, + _eip1559Elasticity: _eip1559Elasticity, _unsafeBlockSigner: _unsafeBlockSigner, _config: _config, _batchInbox: _batchInbox, @@ -68,9 +74,9 @@ contract SystemConfigInterop is SystemConfig { Storage.setAddress(DEPENDENCY_MANAGER_SLOT, _dependencyManager); } - /// @custom:semver +interop-beta.1 + /// @custom:semver +interop-beta.2 function version() public pure override returns (string memory) { - return string.concat(super.version(), "+interop-beta.1"); + return string.concat(super.version(), "+interop-beta.2"); } /// @notice Internal setter for the gas paying token address, includes validation. diff --git a/packages/contracts-bedrock/src/L1/interfaces/ISystemConfig.sol b/packages/contracts-bedrock/src/L1/interfaces/ISystemConfig.sol index a7c5434d048b0..a68b599558cbf 100644 --- a/packages/contracts-bedrock/src/L1/interfaces/ISystemConfig.sol +++ b/packages/contracts-bedrock/src/L1/interfaces/ISystemConfig.sol @@ -9,7 +9,8 @@ interface ISystemConfig { BATCHER, GAS_CONFIG, GAS_LIMIT, - UNSAFE_BLOCK_SIGNER + UNSAFE_BLOCK_SIGNER, + EIP_1559_PARAMS } struct Addresses { @@ -42,6 +43,8 @@ interface ISystemConfig { 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 gasPayingToken() external view returns (address addr_, uint8 decimals_); function gasPayingTokenName() external view returns (string memory name_); function gasPayingTokenSymbol() external view returns (string memory symbol_); @@ -51,6 +54,8 @@ interface ISystemConfig { uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, + uint32 _eip1559Denominator, + uint32 _eip1559Elasticity, address _unsafeBlockSigner, IResourceMetering.ResourceConfig memory _config, address _batchInbox, @@ -74,6 +79,7 @@ interface ISystemConfig { function setGasConfig(uint256 _overhead, uint256 _scalar) external; function setGasConfigEcotone(uint32 _basefeeScalar, uint32 _blobbasefeeScalar) external; function setGasLimit(uint64 _gasLimit) external; + function setEIP1559Params(uint32 _denominator, uint32 _elasticity) external; function setUnsafeBlockSigner(address _unsafeBlockSigner) external; function startBlock() external view returns (uint256 startBlock_); function transferOwnership(address newOwner) external; // nosemgrep diff --git a/packages/contracts-bedrock/src/L1/interfaces/ISystemConfigInterop.sol b/packages/contracts-bedrock/src/L1/interfaces/ISystemConfigInterop.sol index fffbd3cb66814..c63f05993c132 100644 --- a/packages/contracts-bedrock/src/L1/interfaces/ISystemConfigInterop.sol +++ b/packages/contracts-bedrock/src/L1/interfaces/ISystemConfigInterop.sol @@ -59,6 +59,8 @@ interface ISystemConfigInterop { uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, + uint32 _eip1559Denominator, + uint32 _eip1559Elasticity, address _unsafeBlockSigner, IResourceMetering.ResourceConfig memory _config, address _batchInbox, diff --git a/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol b/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol index fb008d4aa8d0c..a67f502e26a06 100644 --- a/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol +++ b/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol @@ -78,6 +78,8 @@ contract OPContractsManager_Deploy_Test is DeployOPChain_TestBase { startingAnchorRoots: _doi.startingAnchorRoots(), saltMixer: _doi.saltMixer(), gasLimit: _doi.gasLimit(), + eip1559Denominator: _doi.eip1559Denominator(), + eip1559Elasticity: _doi.eip1559Elasticity(), disputeGameType: _doi.disputeGameType(), disputeAbsolutePrestate: _doi.disputeAbsolutePrestate(), disputeMaxGameDepth: _doi.disputeMaxGameDepth(), diff --git a/packages/contracts-bedrock/test/L1/SystemConfig.t.sol b/packages/contracts-bedrock/test/L1/SystemConfig.t.sol index aad093e3283a9..020486381251b 100644 --- a/packages/contracts-bedrock/test/L1/SystemConfig.t.sol +++ b/packages/contracts-bedrock/test/L1/SystemConfig.t.sol @@ -27,6 +27,8 @@ contract SystemConfig_Initialize_Test is SystemConfig_Init { address owner; bytes32 batcherHash; uint64 gasLimit; + uint32 eip1559Denominator; + uint32 eip1559Elasticity; address unsafeBlockSigner; address systemConfigImpl; address optimismMintableERC20Factory; @@ -41,6 +43,8 @@ contract SystemConfig_Initialize_Test is SystemConfig_Init { blobbasefeeScalar = deploy.cfg().blobbasefeeScalar(); batcherHash = bytes32(uint256(uint160(deploy.cfg().batchSenderAddress()))); gasLimit = uint64(deploy.cfg().l2GenesisBlockGasLimit()); + eip1559Denominator = uint32(deploy.cfg().eip1559Denominator()); + eip1559Elasticity = uint32(deploy.cfg().eip1559Elasticity()); unsafeBlockSigner = deploy.cfg().p2pSequencerAddress(); systemConfigImpl = deploy.mustGetAddress("SystemConfig"); optimismMintableERC20Factory = deploy.mustGetAddress("OptimismMintableERC20FactoryProxy"); @@ -54,6 +58,8 @@ contract SystemConfig_Initialize_Test is SystemConfig_Init { assertEq(impl.scalar(), uint256(0x01) << 248); assertEq(impl.batcherHash(), bytes32(0)); assertEq(impl.gasLimit(), 1); + assertEq(impl.eip1559Denominator(), 1); + assertEq(impl.eip1559Elasticity(), 1); assertEq(impl.unsafeBlockSigner(), address(0)); assertEq(impl.basefeeScalar(), 0); assertEq(impl.blobbasefeeScalar(), 0); @@ -86,6 +92,8 @@ contract SystemConfig_Initialize_Test is SystemConfig_Init { assertEq(systemConfig.scalar() >> 248, 1); assertEq(systemConfig.batcherHash(), batcherHash); assertEq(systemConfig.gasLimit(), gasLimit); + assertEq(systemConfig.eip1559Denominator(), eip1559Denominator); + assertEq(systemConfig.eip1559Elasticity(), eip1559Elasticity); assertEq(systemConfig.unsafeBlockSigner(), unsafeBlockSigner); assertEq(systemConfig.basefeeScalar(), basefeeScalar); assertEq(systemConfig.blobbasefeeScalar(), blobbasefeeScalar); @@ -134,6 +142,8 @@ contract SystemConfig_Initialize_TestFail is SystemConfig_Initialize_Test { _blobbasefeeScalar: blobbasefeeScalar, _batcherHash: bytes32(hex"abcd"), _gasLimit: minimumGasLimit - 1, + _eip1559Denominator: eip1559Denominator, + _eip1559Elasticity: eip1559Elasticity, _unsafeBlockSigner: address(1), _config: Constants.DEFAULT_RESOURCE_CONFIG(), _batchInbox: address(0), @@ -164,6 +174,8 @@ contract SystemConfig_Initialize_TestFail is SystemConfig_Initialize_Test { _blobbasefeeScalar: blobbasefeeScalar, _batcherHash: bytes32(hex"abcd"), _gasLimit: gasLimit, + _eip1559Denominator: eip1559Denominator, + _eip1559Elasticity: eip1559Elasticity, _unsafeBlockSigner: address(1), _config: Constants.DEFAULT_RESOURCE_CONFIG(), _batchInbox: address(0), @@ -195,6 +207,8 @@ contract SystemConfig_Initialize_TestFail is SystemConfig_Initialize_Test { _blobbasefeeScalar: blobbasefeeScalar, _batcherHash: bytes32(hex"abcd"), _gasLimit: gasLimit, + _eip1559Denominator: eip1559Denominator, + _eip1559Elasticity: eip1559Elasticity, _unsafeBlockSigner: address(1), _config: Constants.DEFAULT_RESOURCE_CONFIG(), _batchInbox: address(0), @@ -290,6 +304,8 @@ contract SystemConfig_Init_ResourceConfig is SystemConfig_Init { _blobbasefeeScalar: 0, _batcherHash: bytes32(0), _gasLimit: gasLimit, + _eip1559Denominator: 0, + _eip1559Elasticity: 0, _unsafeBlockSigner: address(0), _config: config, _batchInbox: address(0), @@ -329,6 +345,8 @@ contract SystemConfig_Init_CustomGasToken is SystemConfig_Init { _blobbasefeeScalar: 1000000, _batcherHash: bytes32(hex"abcd"), _gasLimit: 30_000_000, + _eip1559Denominator: 50, + _eip1559Elasticity: 6, _unsafeBlockSigner: address(1), _config: Constants.DEFAULT_RESOURCE_CONFIG(), _batchInbox: address(0), @@ -512,6 +530,12 @@ contract SystemConfig_Setters_TestFail is SystemConfig_Init { systemConfig.setUnsafeBlockSigner(address(0x20)); } + /// @dev Tests that `setEIP1559Params` reverts if the caller is not the owner. + function test_setEIP1559Params_notOwner_reverts() external { + vm.expectRevert("Ownable: caller is not the owner"); + systemConfig.setEIP1559Params(uint32(0), uint32(0)); + } + /// @dev Tests that `setGasLimit` reverts if the gas limit is too low. function test_setGasLimit_lowGasLimit_reverts() external { uint64 minimumGasLimit = systemConfig.minimumGasLimit(); @@ -585,6 +609,19 @@ contract SystemConfig_Setters_Test is SystemConfig_Init { assertEq(systemConfig.gasLimit(), newGasLimit); } + /// @dev Tests that `setEIP1559Params` updates the EIP-1559 parameters successfully. + function testFuzz_setEIP1559Params_succeeds(uint32 _denominator, uint32 _elasticity) external { + vm.expectEmit(address(systemConfig)); + emit ConfigUpdate( + 0, ISystemConfig.UpdateType.EIP_1559_PARAMS, abi.encode(uint64(_denominator) << 32 | uint64(_elasticity)) + ); + + vm.prank(systemConfig.owner()); + systemConfig.setEIP1559Params(_denominator, _elasticity); + assertEq(systemConfig.eip1559Denominator(), _denominator); + assertEq(systemConfig.eip1559Elasticity(), _elasticity); + } + /// @dev Tests that `setUnsafeBlockSigner` updates the block signer successfully. function testFuzz_setUnsafeBlockSigner_succeeds(address newUnsafeSigner) external { vm.expectEmit(address(systemConfig)); diff --git a/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol b/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol index 0e47529c760ca..07edbedf62cdb 100644 --- a/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol +++ b/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol @@ -118,6 +118,8 @@ contract SystemConfigInterop_Test is CommonTest { _blobbasefeeScalar: 1000000, _batcherHash: bytes32(hex"abcd"), _gasLimit: 30_000_000, + _eip1559Denominator: 50, + _eip1559Elasticity: 6, _unsafeBlockSigner: address(1), _config: Constants.DEFAULT_RESOURCE_CONFIG(), _batchInbox: address(0), diff --git a/packages/contracts-bedrock/test/invariants/SystemConfig.t.sol b/packages/contracts-bedrock/test/invariants/SystemConfig.t.sol index 1321499462b71..afe9ed2d36db1 100644 --- a/packages/contracts-bedrock/test/invariants/SystemConfig.t.sol +++ b/packages/contracts-bedrock/test/invariants/SystemConfig.t.sol @@ -25,6 +25,8 @@ contract SystemConfig_GasLimitBoundaries_Invariant is Test { 1000000, // scalar bytes32(hex"abcd"), // batcher hash 30_000_000, // gas limit + 50, // eip1559Denominator + 6, // eip1559Elasticity address(1), // unsafe block signer Constants.DEFAULT_RESOURCE_CONFIG(), address(0), // _batchInbox diff --git a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol index ec93c0ab24647..761712b9d1c1e 100644 --- a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol @@ -370,6 +370,8 @@ contract DeployOPChain_TestBase is Test { OPContractsManager opcm = OPContractsManager(address(0)); string saltMixer = "defaultSaltMixer"; uint64 gasLimit = 30_000_000; + uint32 eip1559Denominator = 50; + uint32 eip1559Elasticity = 6; // Configurable dispute game parameters. uint32 disputeGameType = GameType.unwrap(GameTypes.PERMISSIONED_CANNON); bytes32 disputeAbsolutePrestate = hex"038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c"; @@ -497,6 +499,8 @@ contract DeployOPChain_Test is DeployOPChain_TestBase { doi.set(doi.opcmProxy.selector, address(opcm)); // Not fuzzed since it must be an actual instance. doi.set(doi.saltMixer.selector, saltMixer); doi.set(doi.gasLimit.selector, gasLimit); + doi.set(doi.eip1559Denominator.selector, eip1559Denominator); + doi.set(doi.eip1559Elasticity.selector, eip1559Elasticity); doi.set(doi.disputeGameType.selector, disputeGameType); doi.set(doi.disputeAbsolutePrestate.selector, disputeAbsolutePrestate); doi.set(doi.disputeMaxGameDepth.selector, disputeMaxGameDepth); @@ -520,12 +524,14 @@ contract DeployOPChain_Test is DeployOPChain_TestBase { assertEq(l2ChainId, doi.l2ChainId(), "900"); assertEq(saltMixer, doi.saltMixer(), "1000"); assertEq(gasLimit, doi.gasLimit(), "1100"); - assertEq(disputeGameType, GameType.unwrap(doi.disputeGameType()), "1200"); - assertEq(disputeAbsolutePrestate, Claim.unwrap(doi.disputeAbsolutePrestate()), "1300"); - assertEq(disputeMaxGameDepth, doi.disputeMaxGameDepth(), "1400"); - assertEq(disputeSplitDepth, doi.disputeSplitDepth(), "1500"); - assertEq(disputeClockExtension, Duration.unwrap(doi.disputeClockExtension()), "1600"); - assertEq(disputeMaxClockDuration, Duration.unwrap(doi.disputeMaxClockDuration()), "1700"); + assertEq(eip1559Denominator, doi.eip1559Denominator(), "1200"); + assertEq(eip1559Elasticity, doi.eip1559Elasticity(), "1300"); + assertEq(disputeGameType, GameType.unwrap(doi.disputeGameType()), "1400"); + assertEq(disputeAbsolutePrestate, Claim.unwrap(doi.disputeAbsolutePrestate()), "1500"); + assertEq(disputeMaxGameDepth, doi.disputeMaxGameDepth(), "1600"); + assertEq(disputeSplitDepth, doi.disputeSplitDepth(), "1700"); + assertEq(disputeClockExtension, Duration.unwrap(doi.disputeClockExtension()), "1800"); + assertEq(disputeMaxClockDuration, Duration.unwrap(doi.disputeMaxClockDuration()), "1900"); // Assert inputs were properly passed through to the contract initializers. assertEq(address(doo.opChainProxyAdmin().owner()), opChainProxyAdminOwner, "2100"); diff --git a/packages/contracts-bedrock/test/universal/Specs.t.sol b/packages/contracts-bedrock/test/universal/Specs.t.sol index b95604135eb01..1bddcea726600 100644 --- a/packages/contracts-bedrock/test/universal/Specs.t.sol +++ b/packages/contracts-bedrock/test/universal/Specs.t.sol @@ -431,6 +431,8 @@ contract Specification_Test is CommonTest { _addSpec({ _name: "SystemConfig", _sel: _getSel("VERSION()") }); _addSpec({ _name: "SystemConfig", _sel: _getSel("batcherHash()") }); _addSpec({ _name: "SystemConfig", _sel: _getSel("gasLimit()") }); + _addSpec({ _name: "SystemConfig", _sel: _getSel("eip1559Denominator()") }); + _addSpec({ _name: "SystemConfig", _sel: _getSel("eip1559Elasticity()") }); _addSpec({ _name: "SystemConfig", _sel: ISystemConfig.initialize.selector }); _addSpec({ _name: "SystemConfig", _sel: ISystemConfig.minimumGasLimit.selector }); _addSpec({ _name: "SystemConfig", _sel: _getSel("overhead()") }); @@ -441,6 +443,7 @@ contract Specification_Test is CommonTest { _addSpec({ _name: "SystemConfig", _sel: ISystemConfig.setBatcherHash.selector, _auth: Role.SYSTEMCONFIGOWNER }); _addSpec({ _name: "SystemConfig", _sel: ISystemConfig.setGasConfig.selector, _auth: Role.SYSTEMCONFIGOWNER }); _addSpec({ _name: "SystemConfig", _sel: ISystemConfig.setGasLimit.selector, _auth: Role.SYSTEMCONFIGOWNER }); + _addSpec({ _name: "SystemConfig", _sel: ISystemConfig.setEIP1559Params.selector, _auth: Role.SYSTEMCONFIGOWNER }); _addSpec({ _name: "SystemConfig", _sel: ISystemConfig.setUnsafeBlockSigner.selector, @@ -483,6 +486,8 @@ contract Specification_Test is CommonTest { _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: ISystemConfig.initialize.selector }); _addSpec({ _name: "SystemConfigInterop", _sel: ISystemConfig.minimumGasLimit.selector }); _addSpec({ _name: "SystemConfigInterop", _sel: _getSel("overhead()") }); @@ -500,6 +505,11 @@ contract Specification_Test is CommonTest { _sel: ISystemConfig.setGasConfig.selector, _auth: Role.SYSTEMCONFIGOWNER }); + _addSpec({ + _name: "SystemConfigInterop", + _sel: ISystemConfig.setEIP1559Params.selector, + _auth: Role.SYSTEMCONFIGOWNER + }); _addSpec({ _name: "SystemConfigInterop", _sel: ISystemConfig.setGasLimit.selector, @@ -554,7 +564,7 @@ contract Specification_Test is CommonTest { _addSpec({ _name: "SystemConfigInterop", _sel: _getSel( - "initialize(address,uint32,uint32,bytes32,uint64,address,(uint32,uint8,uint8,uint32,uint32,uint128),address,(address,address,address,address,address,address,address),address)" + "initialize(address,uint32,uint32,bytes32,uint64,uint32,uint32,address,(uint32,uint8,uint8,uint32,uint32,uint128),address,(address,address,address,address,address,address,address),address)" ) }); diff --git a/packages/contracts-bedrock/test/vendor/Initializable.t.sol b/packages/contracts-bedrock/test/vendor/Initializable.t.sol index 7b7596b9bafec..0a786c34182a6 100644 --- a/packages/contracts-bedrock/test/vendor/Initializable.t.sol +++ b/packages/contracts-bedrock/test/vendor/Initializable.t.sol @@ -182,6 +182,8 @@ contract Initializer_Test is Bridge_Initializer { 0, bytes32(0), 1, + 1, + 1, address(0), IResourceMetering.ResourceConfig({ maxResourceLimit: 1, @@ -218,6 +220,8 @@ contract Initializer_Test is Bridge_Initializer { 0, bytes32(0), 1, + 1, + 1, address(0), IResourceMetering.ResourceConfig({ maxResourceLimit: 1,