diff --git a/go.mod b/go.mod index 202286fc0a441..b00356d84c588 100644 --- a/go.mod +++ b/go.mod @@ -302,7 +302,7 @@ require ( lukechampine.com/blake3 v1.3.0 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101602.1-rc.1 +replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101602.1-rc.1.0.20250905173340-c920f56ee245 // replace github.com/ethereum/go-ethereum => ../op-geth diff --git a/go.sum b/go.sum index c315ef604bc20..88f8cf9db4ce0 100644 --- a/go.sum +++ b/go.sum @@ -228,8 +228,8 @@ github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101602.1-rc.1 h1:gt96/7JhVw4bEk4i0URyOKTaAoA3v+Pa+ms868IaoaY= -github.com/ethereum-optimism/op-geth v1.101602.1-rc.1/go.mod h1:rOTZfq3JrsY8ktvTnS6XT9X+t4WQQ42zFb+hzXua2EU= +github.com/ethereum-optimism/op-geth v1.101602.1-rc.1.0.20250905173340-c920f56ee245 h1:ijOLAPhYEXstrTKd9kobg1+dQfjNUSpvAo4wSIXzWMw= +github.com/ethereum-optimism/op-geth v1.101602.1-rc.1.0.20250905173340-c920f56ee245/go.mod h1:rOTZfq3JrsY8ktvTnS6XT9X+t4WQQ42zFb+hzXua2EU= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250603144016-9c45ca7d4508 h1:A/3QVFt+Aa9ozpPVXxUTLui8honBjSusAaiCVRbafgs= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250603144016-9c45ca7d4508/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= github.com/ethereum/c-kzg-4844/v2 v2.1.0 h1:gQropX9YFBhl3g4HYhwE70zq3IHFRgbbNPw0Shwzf5w= diff --git a/op-chain-ops/genesis/config.go b/op-chain-ops/genesis/config.go index f3e2052cfa3f9..957a143d5c179 100644 --- a/op-chain-ops/genesis/config.go +++ b/op-chain-ops/genesis/config.go @@ -718,6 +718,7 @@ type L2InitializationConfig struct { UpgradeScheduleDeployConfig L2CoreDeployConfig AltDADeployConfig + DAFootprintGasScalar uint16 `json:"daFootprintGasScalar"` } func (d *L2InitializationConfig) Check(log log.Logger) error { @@ -1105,11 +1106,12 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *eth.BlockRef, l2GenesisBlockHa // Overhead value is considered a noop. func (d *DeployConfig) GenesisSystemConfig() eth.SystemConfig { return eth.SystemConfig{ - BatcherAddr: d.BatchSenderAddress, - Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(d.GasPriceOracleOverhead))), - Scalar: d.FeeScalar(), - GasLimit: uint64(d.L2GenesisBlockGasLimit), - OperatorFeeParams: d.OperatorFeeParams(), + BatcherAddr: d.BatchSenderAddress, + Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(d.GasPriceOracleOverhead))), + Scalar: d.FeeScalar(), + GasLimit: uint64(d.L2GenesisBlockGasLimit), + OperatorFeeParams: d.OperatorFeeParams(), + DAFootprintGasScalar: d.DAFootprintGasScalar, } } diff --git a/op-chain-ops/genesis/layer_two.go b/op-chain-ops/genesis/layer_two.go index 9f0103e2815ed..5a89ac0bfd3fa 100644 --- a/op-chain-ops/genesis/layer_two.go +++ b/op-chain-ops/genesis/layer_two.go @@ -29,8 +29,8 @@ const ( L2AllocsGranite L2AllocsMode = "granite" L2AllocsHolocene L2AllocsMode = "holocene" L2AllocsIsthmus L2AllocsMode = "isthmus" - L2AllocsInterop L2AllocsMode = "interop" L2AllocsJovian L2AllocsMode = "jovian" + L2AllocsInterop L2AllocsMode = "interop" ) var ( diff --git a/op-chain-ops/genesis/testdata/test-deploy-config-full.json b/op-chain-ops/genesis/testdata/test-deploy-config-full.json index 0f332842204f9..7cbab4f3daeab 100644 --- a/op-chain-ops/genesis/testdata/test-deploy-config-full.json +++ b/op-chain-ops/genesis/testdata/test-deploy-config-full.json @@ -59,6 +59,7 @@ "gasPriceOracleOperatorFeeConstant": 0, "gasPriceOracleOverhead": 2100, "gasPriceOracleScalar": 1000000, + "daFootprintGasScalar": 400, "enableGovernance": true, "governanceTokenSymbol": "OP", "governanceTokenName": "Optimism", diff --git a/op-chain-ops/interopgen/deploy.go b/op-chain-ops/interopgen/deploy.go index b0e34eae3e2e7..e6e6104ccf07e 100644 --- a/op-chain-ops/interopgen/deploy.go +++ b/op-chain-ops/interopgen/deploy.go @@ -247,6 +247,7 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme AllowCustomDisputeParameters: true, OperatorFeeScalar: cfg.GasPriceOracleOperatorFeeScalar, OperatorFeeConstant: cfg.GasPriceOracleOperatorFeeConstant, + DAFootprintGasScalar: cfg.DAFootprintGasScalar, }) if err != nil { return nil, fmt.Errorf("failed to deploy L2 OP chain: %w", err) diff --git a/op-deployer/pkg/deployer/opcm/opchain.go b/op-deployer/pkg/deployer/opcm/opchain.go index 76afa75fca59b..087943fb2b7c2 100644 --- a/op-deployer/pkg/deployer/opcm/opchain.go +++ b/op-deployer/pkg/deployer/opcm/opchain.go @@ -43,6 +43,8 @@ type DeployOPChainInput struct { OperatorFeeScalar uint32 OperatorFeeConstant uint64 + + DAFootprintGasScalar uint16 } func (input *DeployOPChainInput) InputSet() bool { diff --git a/op-deployer/pkg/deployer/pipeline/opchain.go b/op-deployer/pkg/deployer/pipeline/opchain.go index b1510a89a2d26..3706ad3e48665 100644 --- a/op-deployer/pkg/deployer/pipeline/opchain.go +++ b/op-deployer/pkg/deployer/pipeline/opchain.go @@ -112,6 +112,7 @@ func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common AllowCustomDisputeParameters: proofParams.DangerouslyAllowCustomDisputeParameters, OperatorFeeScalar: thisIntent.OperatorFeeScalar, OperatorFeeConstant: thisIntent.OperatorFeeConstant, + DAFootprintGasScalar: thisIntent.DAFootprintGasScalar, }, nil } diff --git a/op-deployer/pkg/deployer/state/chain_intent.go b/op-deployer/pkg/deployer/state/chain_intent.go index 819bc9e3f1f9f..40982be8edabe 100644 --- a/op-deployer/pkg/deployer/state/chain_intent.go +++ b/op-deployer/pkg/deployer/state/chain_intent.go @@ -71,6 +71,7 @@ type ChainIntent struct { AdditionalDisputeGames []AdditionalDisputeGame `json:"dangerousAdditionalDisputeGames" toml:"dangerousAdditionalDisputeGames,omitempty"` OperatorFeeScalar uint32 `json:"operatorFeeScalar,omitempty" toml:"operatorFeeScalar,omitempty"` OperatorFeeConstant uint64 `json:"operatorFeeConstant,omitempty" toml:"operatorFeeConstant,omitempty"` + DAFootprintGasScalar uint16 `json:"daFootprintGasScalar,omitempty" toml:"daFootprintGasScalar,omitempty"` L1StartBlockHash *common.Hash `json:"l1StartBlockHash,omitempty" toml:"l1StartBlockHash,omitempty"` MinBaseFee uint64 `json:"minBaseFee,omitempty" toml:"minBaseFee,omitempty"` diff --git a/op-deployer/pkg/deployer/state/deploy_config.go b/op-deployer/pkg/deployer/state/deploy_config.go index d497e0d08eb26..b441b6620981b 100644 --- a/op-deployer/pkg/deployer/state/deploy_config.go +++ b/op-deployer/pkg/deployer/state/deploy_config.go @@ -95,6 +95,7 @@ func CombineDeployConfig(intent *Intent, chainIntent *ChainIntent, state *State, ProxyAdminOwner: chainIntent.Roles.L2ProxyAdminOwner, FinalSystemOwner: chainIntent.Roles.L1ProxyAdminOwner, }, + DAFootprintGasScalar: chainIntent.DAFootprintGasScalar, }, FaultProofDeployConfig: genesis.FaultProofDeployConfig{ UseFaultProofs: true, diff --git a/op-e2e/actions/proofs/helpers/matrix.go b/op-e2e/actions/proofs/helpers/matrix.go index b13588d1954e5..025d8a96c4504 100644 --- a/op-e2e/actions/proofs/helpers/matrix.go +++ b/op-e2e/actions/proofs/helpers/matrix.go @@ -125,10 +125,11 @@ var ( Granite = &Hardfork{Name: string(rollup.Granite), Precedence: 6} Holocene = &Hardfork{Name: string(rollup.Holocene), Precedence: 7} Isthmus = &Hardfork{Name: string(rollup.Isthmus), Precedence: 8} + Jovian = &Hardfork{Name: string(rollup.Jovian), Precedence: 9} ) var ( - Hardforks = ForkMatrix{Regolith, Canyon, Delta, Ecotone, Fjord, Granite, Holocene, Isthmus} + Hardforks = ForkMatrix{Regolith, Canyon, Delta, Ecotone, Fjord, Granite, Holocene, Isthmus, Jovian} LatestFork = Hardforks[len(Hardforks)-1] LatestForkOnly = ForkMatrix{LatestFork} ) diff --git a/op-e2e/bindings/systemconfig.go b/op-e2e/bindings/systemconfig.go index 05d74beadbeb5..6962eb77c9a3f 100644 --- a/op-e2e/bindings/systemconfig.go +++ b/op-e2e/bindings/systemconfig.go @@ -26,6 +26,7 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // IResourceMeteringResourceConfig is an auto generated low-level Go binding around an user-defined struct. @@ -43,14 +44,13 @@ type SystemConfigAddresses struct { L1CrossDomainMessenger common.Address L1ERC721Bridge common.Address L1StandardBridge common.Address - DisputeGameFactory common.Address OptimismPortal common.Address OptimismMintableERC20Factory common.Address } // SystemConfigMetaData contains all meta data concerning the SystemConfig contract. var SystemConfigMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BATCH_INBOX_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DISPUTE_GAME_FACTORY_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L1_CROSS_DOMAIN_MESSENGER_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L1_ERC_721_BRIDGE_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L1_STANDARD_BRIDGE_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"OPTIMISM_PORTAL_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"START_BLOCK_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"UNSAFE_BLOCK_SIGNER_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"basefeeScalar\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchInbox\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batcherHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blobbasefeeScalar\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputeGameFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"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\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddresses\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"l1CrossDomainMessenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"l1ERC721Bridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"l1StandardBridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"disputeGameFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"optimismPortal\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"optimismMintableERC20Factory\",\"type\":\"address\"}],\"internalType\":\"structSystemConfig.Addresses\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_basefeeScalar\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_blobbasefeeScalar\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"_unsafeBlockSigner\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"maxResourceLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"elasticityMultiplier\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"baseFeeMaxChangeDenominator\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"minimumBaseFee\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"systemTxMaxGas\",\"type\":\"uint32\"},{\"internalType\":\"uint128\",\"name\":\"maximumBaseFee\",\"type\":\"uint128\"}],\"internalType\":\"structIResourceMetering.ResourceConfig\",\"name\":\"_config\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_batchInbox\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"l1CrossDomainMessenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"l1ERC721Bridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"l1StandardBridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"disputeGameFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"optimismPortal\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"optimismMintableERC20Factory\",\"type\":\"address\"}],\"internalType\":\"structSystemConfig.Addresses\",\"name\":\"_addresses\",\"type\":\"tuple\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1CrossDomainMessenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1ERC721Bridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1StandardBridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maximumGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"operatorFeeConstant\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"operatorFeeScalar\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"optimismMintableERC20Factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"optimismPortal\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"overhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resourceConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"maxResourceLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"elasticityMultiplier\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"baseFeeMaxChangeDenominator\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"minimumBaseFee\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"systemTxMaxGas\",\"type\":\"uint32\"},{\"internalType\":\"uint128\",\"name\":\"maximumBaseFee\",\"type\":\"uint128\"}],\"internalType\":\"structIResourceMetering.ResourceConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"}],\"name\":\"setBatcherHash\",\"outputs\":[],\"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\":[{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"}],\"name\":\"setGasConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_basefeeScalar\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_blobbasefeeScalar\",\"type\":\"uint32\"}],\"name\":\"setGasConfigEcotone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"}],\"name\":\"setGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_operatorFeeScalar\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"_operatorFeeConstant\",\"type\":\"uint64\"}],\"name\":\"setOperatorFeeScalars\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_unsafeBlockSigner\",\"type\":\"address\"}],\"name\":\"setUnsafeBlockSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"startBlock_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unsafeBlockSigner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr_\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enumSystemConfig.UpdateType\",\"name\":\"updateType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ConfigUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"BATCH_INBOX_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"L1_CROSS_DOMAIN_MESSENGER_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"L1_ERC_721_BRIDGE_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"L1_STANDARD_BRIDGE_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"OPTIMISM_PORTAL_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"START_BLOCK_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UNSAFE_BLOCK_SIGNER_SLOT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"basefeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"batchInbox\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"batcherHash\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"blobbasefeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"daFootprintGasScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"disputeGameFactory\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eip1559Denominator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eip1559Elasticity\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"gasLimit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getAddresses\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structSystemConfig.Addresses\",\"components\":[{\"name\":\"l1CrossDomainMessenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ERC721Bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1StandardBridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismMintableERC20Factory\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"guardian\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initVersion\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_basefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_blobbasefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_batcherHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_gasLimit\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"_unsafeBlockSigner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_config\",\"type\":\"tuple\",\"internalType\":\"structIResourceMetering.ResourceConfig\",\"components\":[{\"name\":\"maxResourceLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"elasticityMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"baseFeeMaxChangeDenominator\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"minimumBaseFee\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"systemTxMaxGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maximumBaseFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"}]},{\"name\":\"_batchInbox\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_addresses\",\"type\":\"tuple\",\"internalType\":\"structSystemConfig.Addresses\",\"components\":[{\"name\":\"l1CrossDomainMessenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ERC721Bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1StandardBridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismMintableERC20Factory\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"_l2ChainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractISuperchainConfig\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"l1CrossDomainMessenger\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1ERC721Bridge\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1StandardBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l2ChainId\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maximumGasLimit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"minimumGasLimit\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorFeeConstant\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorFeeScalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"optimismMintableERC20Factory\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"optimismPortal\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"overhead\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxyAdmin\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIProxyAdmin\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxyAdminOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resourceConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIResourceMetering.ResourceConfig\",\"components\":[{\"name\":\"maxResourceLimit\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"elasticityMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"baseFeeMaxChangeDenominator\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"minimumBaseFee\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"systemTxMaxGas\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"maximumBaseFee\",\"type\":\"uint128\",\"internalType\":\"uint128\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"scalar\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setBatcherHash\",\"inputs\":[{\"name\":\"_batcherHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setDAFootprintGasScalar\",\"inputs\":[{\"name\":\"_daFootprintGasScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setEIP1559Params\",\"inputs\":[{\"name\":\"_denominator\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_elasticity\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setGasConfig\",\"inputs\":[{\"name\":\"_overhead\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_scalar\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setGasConfigEcotone\",\"inputs\":[{\"name\":\"_basefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_blobbasefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setGasLimit\",\"inputs\":[{\"name\":\"_gasLimit\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setOperatorFeeScalars\",\"inputs\":[{\"name\":\"_operatorFeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"_operatorFeeConstant\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setUnsafeBlockSigner\",\"inputs\":[{\"name\":\"_unsafeBlockSigner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"startBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"startBlock_\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISuperchainConfig\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unsafeBlockSigner\",\"inputs\":[],\"outputs\":[{\"name\":\"addr_\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"upgrade\",\"inputs\":[{\"name\":\"_l2ChainId\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"contractISuperchainConfig\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"ConfigUpdate\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"updateType\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumSystemConfig.UpdateType\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ProxyAdminOwnedBase_NotProxyAdmin\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ProxyAdminOwnedBase_NotProxyAdminOrProxyAdminOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ProxyAdminOwnedBase_NotProxyAdminOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ProxyAdminOwnedBase_NotResolvedDelegateProxy\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ProxyAdminOwnedBase_NotSharedProxyAdminOwner\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ProxyAdminOwnedBase_ProxyAdminNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReinitializableBase_ZeroInitVersion\",\"inputs\":[]}]", } // SystemConfigABI is the input ABI used to generate the binding from. @@ -154,11 +154,11 @@ func NewSystemConfigFilterer(address common.Address, filterer bind.ContractFilte // bindSystemConfig binds a generic wrapper to an already deployed contract. func bindSystemConfig(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(SystemConfigABI)) + parsed, err := SystemConfigMetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and @@ -230,37 +230,6 @@ func (_SystemConfig *SystemConfigCallerSession) BATCHINBOXSLOT() ([32]byte, erro return _SystemConfig.Contract.BATCHINBOXSLOT(&_SystemConfig.CallOpts) } -// DISPUTEGAMEFACTORYSLOT is a free data retrieval call binding the contract method 0xe2a3285c. -// -// Solidity: function DISPUTE_GAME_FACTORY_SLOT() view returns(bytes32) -func (_SystemConfig *SystemConfigCaller) DISPUTEGAMEFACTORYSLOT(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _SystemConfig.contract.Call(opts, &out, "DISPUTE_GAME_FACTORY_SLOT") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// DISPUTEGAMEFACTORYSLOT is a free data retrieval call binding the contract method 0xe2a3285c. -// -// Solidity: function DISPUTE_GAME_FACTORY_SLOT() view returns(bytes32) -func (_SystemConfig *SystemConfigSession) DISPUTEGAMEFACTORYSLOT() ([32]byte, error) { - return _SystemConfig.Contract.DISPUTEGAMEFACTORYSLOT(&_SystemConfig.CallOpts) -} - -// DISPUTEGAMEFACTORYSLOT is a free data retrieval call binding the contract method 0xe2a3285c. -// -// Solidity: function DISPUTE_GAME_FACTORY_SLOT() view returns(bytes32) -func (_SystemConfig *SystemConfigCallerSession) DISPUTEGAMEFACTORYSLOT() ([32]byte, error) { - return _SystemConfig.Contract.DISPUTEGAMEFACTORYSLOT(&_SystemConfig.CallOpts) -} - // L1CROSSDOMAINMESSENGERSLOT is a free data retrieval call binding the contract method 0x5d73369c. // // Solidity: function L1_CROSS_DOMAIN_MESSENGER_SLOT() view returns(bytes32) @@ -633,6 +602,37 @@ func (_SystemConfig *SystemConfigCallerSession) BlobbasefeeScalar() (uint32, err return _SystemConfig.Contract.BlobbasefeeScalar(&_SystemConfig.CallOpts) } +// DaFootprintGasScalar is a free data retrieval call binding the contract method 0xfe3d5710. +// +// Solidity: function daFootprintGasScalar() view returns(uint32) +func (_SystemConfig *SystemConfigCaller) DaFootprintGasScalar(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "daFootprintGasScalar") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// DaFootprintGasScalar is a free data retrieval call binding the contract method 0xfe3d5710. +// +// Solidity: function daFootprintGasScalar() view returns(uint32) +func (_SystemConfig *SystemConfigSession) DaFootprintGasScalar() (uint32, error) { + return _SystemConfig.Contract.DaFootprintGasScalar(&_SystemConfig.CallOpts) +} + +// DaFootprintGasScalar is a free data retrieval call binding the contract method 0xfe3d5710. +// +// Solidity: function daFootprintGasScalar() view returns(uint32) +func (_SystemConfig *SystemConfigCallerSession) DaFootprintGasScalar() (uint32, error) { + return _SystemConfig.Contract.DaFootprintGasScalar(&_SystemConfig.CallOpts) +} + // DisputeGameFactory is a free data retrieval call binding the contract method 0xf2b4e617. // // Solidity: function disputeGameFactory() view returns(address addr_) @@ -759,7 +759,7 @@ func (_SystemConfig *SystemConfigCallerSession) GasLimit() (uint64, error) { // GetAddresses is a free data retrieval call binding the contract method 0xa39fac12. // -// Solidity: function getAddresses() view returns((address,address,address,address,address,address)) +// Solidity: function getAddresses() view returns((address,address,address,address,address)) func (_SystemConfig *SystemConfigCaller) GetAddresses(opts *bind.CallOpts) (SystemConfigAddresses, error) { var out []interface{} err := _SystemConfig.contract.Call(opts, &out, "getAddresses") @@ -776,18 +776,80 @@ func (_SystemConfig *SystemConfigCaller) GetAddresses(opts *bind.CallOpts) (Syst // GetAddresses is a free data retrieval call binding the contract method 0xa39fac12. // -// Solidity: function getAddresses() view returns((address,address,address,address,address,address)) +// Solidity: function getAddresses() view returns((address,address,address,address,address)) func (_SystemConfig *SystemConfigSession) GetAddresses() (SystemConfigAddresses, error) { return _SystemConfig.Contract.GetAddresses(&_SystemConfig.CallOpts) } // GetAddresses is a free data retrieval call binding the contract method 0xa39fac12. // -// Solidity: function getAddresses() view returns((address,address,address,address,address,address)) +// Solidity: function getAddresses() view returns((address,address,address,address,address)) func (_SystemConfig *SystemConfigCallerSession) GetAddresses() (SystemConfigAddresses, error) { return _SystemConfig.Contract.GetAddresses(&_SystemConfig.CallOpts) } +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address) +func (_SystemConfig *SystemConfigCaller) Guardian(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "guardian") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address) +func (_SystemConfig *SystemConfigSession) Guardian() (common.Address, error) { + return _SystemConfig.Contract.Guardian(&_SystemConfig.CallOpts) +} + +// Guardian is a free data retrieval call binding the contract method 0x452a9320. +// +// Solidity: function guardian() view returns(address) +func (_SystemConfig *SystemConfigCallerSession) Guardian() (common.Address, error) { + return _SystemConfig.Contract.Guardian(&_SystemConfig.CallOpts) +} + +// InitVersion is a free data retrieval call binding the contract method 0x38d38c97. +// +// Solidity: function initVersion() view returns(uint8) +func (_SystemConfig *SystemConfigCaller) InitVersion(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "initVersion") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// InitVersion is a free data retrieval call binding the contract method 0x38d38c97. +// +// Solidity: function initVersion() view returns(uint8) +func (_SystemConfig *SystemConfigSession) InitVersion() (uint8, error) { + return _SystemConfig.Contract.InitVersion(&_SystemConfig.CallOpts) +} + +// InitVersion is a free data retrieval call binding the contract method 0x38d38c97. +// +// Solidity: function initVersion() view returns(uint8) +func (_SystemConfig *SystemConfigCallerSession) InitVersion() (uint8, error) { + return _SystemConfig.Contract.InitVersion(&_SystemConfig.CallOpts) +} + // L1CrossDomainMessenger is a free data retrieval call binding the contract method 0xa7119869. // // Solidity: function l1CrossDomainMessenger() view returns(address addr_) @@ -881,6 +943,37 @@ func (_SystemConfig *SystemConfigCallerSession) L1StandardBridge() (common.Addre return _SystemConfig.Contract.L1StandardBridge(&_SystemConfig.CallOpts) } +// L2ChainId is a free data retrieval call binding the contract method 0xd6ae3cd5. +// +// Solidity: function l2ChainId() view returns(uint256) +func (_SystemConfig *SystemConfigCaller) L2ChainId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "l2ChainId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// L2ChainId is a free data retrieval call binding the contract method 0xd6ae3cd5. +// +// Solidity: function l2ChainId() view returns(uint256) +func (_SystemConfig *SystemConfigSession) L2ChainId() (*big.Int, error) { + return _SystemConfig.Contract.L2ChainId(&_SystemConfig.CallOpts) +} + +// L2ChainId is a free data retrieval call binding the contract method 0xd6ae3cd5. +// +// Solidity: function l2ChainId() view returns(uint256) +func (_SystemConfig *SystemConfigCallerSession) L2ChainId() (*big.Int, error) { + return _SystemConfig.Contract.L2ChainId(&_SystemConfig.CallOpts) +} + // MaximumGasLimit is a free data retrieval call binding the contract method 0x0ae14b1b. // // Solidity: function maximumGasLimit() pure returns(uint64) @@ -1129,6 +1222,99 @@ func (_SystemConfig *SystemConfigCallerSession) Owner() (common.Address, error) return _SystemConfig.Contract.Owner(&_SystemConfig.CallOpts) } +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_SystemConfig *SystemConfigCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_SystemConfig *SystemConfigSession) Paused() (bool, error) { + return _SystemConfig.Contract.Paused(&_SystemConfig.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_SystemConfig *SystemConfigCallerSession) Paused() (bool, error) { + return _SystemConfig.Contract.Paused(&_SystemConfig.CallOpts) +} + +// ProxyAdmin is a free data retrieval call binding the contract method 0x3e47158c. +// +// Solidity: function proxyAdmin() view returns(address) +func (_SystemConfig *SystemConfigCaller) ProxyAdmin(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "proxyAdmin") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ProxyAdmin is a free data retrieval call binding the contract method 0x3e47158c. +// +// Solidity: function proxyAdmin() view returns(address) +func (_SystemConfig *SystemConfigSession) ProxyAdmin() (common.Address, error) { + return _SystemConfig.Contract.ProxyAdmin(&_SystemConfig.CallOpts) +} + +// ProxyAdmin is a free data retrieval call binding the contract method 0x3e47158c. +// +// Solidity: function proxyAdmin() view returns(address) +func (_SystemConfig *SystemConfigCallerSession) ProxyAdmin() (common.Address, error) { + return _SystemConfig.Contract.ProxyAdmin(&_SystemConfig.CallOpts) +} + +// ProxyAdminOwner is a free data retrieval call binding the contract method 0xdad544e0. +// +// Solidity: function proxyAdminOwner() view returns(address) +func (_SystemConfig *SystemConfigCaller) ProxyAdminOwner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "proxyAdminOwner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ProxyAdminOwner is a free data retrieval call binding the contract method 0xdad544e0. +// +// Solidity: function proxyAdminOwner() view returns(address) +func (_SystemConfig *SystemConfigSession) ProxyAdminOwner() (common.Address, error) { + return _SystemConfig.Contract.ProxyAdminOwner(&_SystemConfig.CallOpts) +} + +// ProxyAdminOwner is a free data retrieval call binding the contract method 0xdad544e0. +// +// Solidity: function proxyAdminOwner() view returns(address) +func (_SystemConfig *SystemConfigCallerSession) ProxyAdminOwner() (common.Address, error) { + return _SystemConfig.Contract.ProxyAdminOwner(&_SystemConfig.CallOpts) +} + // ResourceConfig is a free data retrieval call binding the contract method 0xcc731b02. // // Solidity: function resourceConfig() view returns((uint32,uint8,uint8,uint32,uint32,uint128)) @@ -1222,6 +1408,37 @@ func (_SystemConfig *SystemConfigCallerSession) StartBlock() (*big.Int, error) { return _SystemConfig.Contract.StartBlock(&_SystemConfig.CallOpts) } +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_SystemConfig *SystemConfigCaller) SuperchainConfig(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SystemConfig.contract.Call(opts, &out, "superchainConfig") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_SystemConfig *SystemConfigSession) SuperchainConfig() (common.Address, error) { + return _SystemConfig.Contract.SuperchainConfig(&_SystemConfig.CallOpts) +} + +// SuperchainConfig is a free data retrieval call binding the contract method 0x35e80ab3. +// +// Solidity: function superchainConfig() view returns(address) +func (_SystemConfig *SystemConfigCallerSession) SuperchainConfig() (common.Address, error) { + return _SystemConfig.Contract.SuperchainConfig(&_SystemConfig.CallOpts) +} + // UnsafeBlockSigner is a free data retrieval call binding the contract method 0x1fd19ee1. // // Solidity: function unsafeBlockSigner() view returns(address addr_) @@ -1284,25 +1501,25 @@ func (_SystemConfig *SystemConfigCallerSession) Version() (string, error) { return _SystemConfig.Contract.Version(&_SystemConfig.CallOpts) } -// Initialize is a paid mutator transaction binding the contract method 0xca407f0c. +// Initialize is a paid mutator transaction binding the contract method 0x01045829. // -// Solidity: function initialize(address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, address _unsafeBlockSigner, (uint32,uint8,uint8,uint32,uint32,uint128) _config, address _batchInbox, (address,address,address,address,address,address) _addresses) returns() -func (_SystemConfig *SystemConfigTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _basefeeScalar uint32, _blobbasefeeScalar uint32, _batcherHash [32]byte, _gasLimit uint64, _unsafeBlockSigner common.Address, _config IResourceMeteringResourceConfig, _batchInbox common.Address, _addresses SystemConfigAddresses) (*types.Transaction, error) { - return _SystemConfig.contract.Transact(opts, "initialize", _owner, _basefeeScalar, _blobbasefeeScalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config, _batchInbox, _addresses) +// Solidity: function initialize(address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, address _unsafeBlockSigner, (uint32,uint8,uint8,uint32,uint32,uint128) _config, address _batchInbox, (address,address,address,address,address) _addresses, uint256 _l2ChainId, address _superchainConfig) returns() +func (_SystemConfig *SystemConfigTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _basefeeScalar uint32, _blobbasefeeScalar uint32, _batcherHash [32]byte, _gasLimit uint64, _unsafeBlockSigner common.Address, _config IResourceMeteringResourceConfig, _batchInbox common.Address, _addresses SystemConfigAddresses, _l2ChainId *big.Int, _superchainConfig common.Address) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "initialize", _owner, _basefeeScalar, _blobbasefeeScalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config, _batchInbox, _addresses, _l2ChainId, _superchainConfig) } -// Initialize is a paid mutator transaction binding the contract method 0xca407f0c. +// Initialize is a paid mutator transaction binding the contract method 0x01045829. // -// Solidity: function initialize(address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, address _unsafeBlockSigner, (uint32,uint8,uint8,uint32,uint32,uint128) _config, address _batchInbox, (address,address,address,address,address,address) _addresses) returns() -func (_SystemConfig *SystemConfigSession) Initialize(_owner common.Address, _basefeeScalar uint32, _blobbasefeeScalar uint32, _batcherHash [32]byte, _gasLimit uint64, _unsafeBlockSigner common.Address, _config IResourceMeteringResourceConfig, _batchInbox common.Address, _addresses SystemConfigAddresses) (*types.Transaction, error) { - return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _basefeeScalar, _blobbasefeeScalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config, _batchInbox, _addresses) +// Solidity: function initialize(address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, address _unsafeBlockSigner, (uint32,uint8,uint8,uint32,uint32,uint128) _config, address _batchInbox, (address,address,address,address,address) _addresses, uint256 _l2ChainId, address _superchainConfig) returns() +func (_SystemConfig *SystemConfigSession) Initialize(_owner common.Address, _basefeeScalar uint32, _blobbasefeeScalar uint32, _batcherHash [32]byte, _gasLimit uint64, _unsafeBlockSigner common.Address, _config IResourceMeteringResourceConfig, _batchInbox common.Address, _addresses SystemConfigAddresses, _l2ChainId *big.Int, _superchainConfig common.Address) (*types.Transaction, error) { + return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _basefeeScalar, _blobbasefeeScalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config, _batchInbox, _addresses, _l2ChainId, _superchainConfig) } -// Initialize is a paid mutator transaction binding the contract method 0xca407f0c. +// Initialize is a paid mutator transaction binding the contract method 0x01045829. // -// Solidity: function initialize(address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, address _unsafeBlockSigner, (uint32,uint8,uint8,uint32,uint32,uint128) _config, address _batchInbox, (address,address,address,address,address,address) _addresses) returns() -func (_SystemConfig *SystemConfigTransactorSession) Initialize(_owner common.Address, _basefeeScalar uint32, _blobbasefeeScalar uint32, _batcherHash [32]byte, _gasLimit uint64, _unsafeBlockSigner common.Address, _config IResourceMeteringResourceConfig, _batchInbox common.Address, _addresses SystemConfigAddresses) (*types.Transaction, error) { - return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _basefeeScalar, _blobbasefeeScalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config, _batchInbox, _addresses) +// Solidity: function initialize(address _owner, uint32 _basefeeScalar, uint32 _blobbasefeeScalar, bytes32 _batcherHash, uint64 _gasLimit, address _unsafeBlockSigner, (uint32,uint8,uint8,uint32,uint32,uint128) _config, address _batchInbox, (address,address,address,address,address) _addresses, uint256 _l2ChainId, address _superchainConfig) returns() +func (_SystemConfig *SystemConfigTransactorSession) Initialize(_owner common.Address, _basefeeScalar uint32, _blobbasefeeScalar uint32, _batcherHash [32]byte, _gasLimit uint64, _unsafeBlockSigner common.Address, _config IResourceMeteringResourceConfig, _batchInbox common.Address, _addresses SystemConfigAddresses, _l2ChainId *big.Int, _superchainConfig common.Address) (*types.Transaction, error) { + return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _basefeeScalar, _blobbasefeeScalar, _batcherHash, _gasLimit, _unsafeBlockSigner, _config, _batchInbox, _addresses, _l2ChainId, _superchainConfig) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -1347,6 +1564,27 @@ func (_SystemConfig *SystemConfigTransactorSession) SetBatcherHash(_batcherHash return _SystemConfig.Contract.SetBatcherHash(&_SystemConfig.TransactOpts, _batcherHash) } +// SetDAFootprintGasScalar is a paid mutator transaction binding the contract method 0x59bfa430. +// +// Solidity: function setDAFootprintGasScalar(uint32 _daFootprintGasScalar) returns() +func (_SystemConfig *SystemConfigTransactor) SetDAFootprintGasScalar(opts *bind.TransactOpts, _daFootprintGasScalar uint32) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "setDAFootprintGasScalar", _daFootprintGasScalar) +} + +// SetDAFootprintGasScalar is a paid mutator transaction binding the contract method 0x59bfa430. +// +// Solidity: function setDAFootprintGasScalar(uint32 _daFootprintGasScalar) returns() +func (_SystemConfig *SystemConfigSession) SetDAFootprintGasScalar(_daFootprintGasScalar uint32) (*types.Transaction, error) { + return _SystemConfig.Contract.SetDAFootprintGasScalar(&_SystemConfig.TransactOpts, _daFootprintGasScalar) +} + +// SetDAFootprintGasScalar is a paid mutator transaction binding the contract method 0x59bfa430. +// +// Solidity: function setDAFootprintGasScalar(uint32 _daFootprintGasScalar) returns() +func (_SystemConfig *SystemConfigTransactorSession) SetDAFootprintGasScalar(_daFootprintGasScalar uint32) (*types.Transaction, error) { + return _SystemConfig.Contract.SetDAFootprintGasScalar(&_SystemConfig.TransactOpts, _daFootprintGasScalar) +} + // SetEIP1559Params is a paid mutator transaction binding the contract method 0xc0fd4b41. // // Solidity: function setEIP1559Params(uint32 _denominator, uint32 _elasticity) returns() @@ -1494,6 +1732,27 @@ func (_SystemConfig *SystemConfigTransactorSession) TransferOwnership(newOwner c return _SystemConfig.Contract.TransferOwnership(&_SystemConfig.TransactOpts, newOwner) } +// Upgrade is a paid mutator transaction binding the contract method 0x028f4e47. +// +// Solidity: function upgrade(uint256 _l2ChainId, address _superchainConfig) returns() +func (_SystemConfig *SystemConfigTransactor) Upgrade(opts *bind.TransactOpts, _l2ChainId *big.Int, _superchainConfig common.Address) (*types.Transaction, error) { + return _SystemConfig.contract.Transact(opts, "upgrade", _l2ChainId, _superchainConfig) +} + +// Upgrade is a paid mutator transaction binding the contract method 0x028f4e47. +// +// Solidity: function upgrade(uint256 _l2ChainId, address _superchainConfig) returns() +func (_SystemConfig *SystemConfigSession) Upgrade(_l2ChainId *big.Int, _superchainConfig common.Address) (*types.Transaction, error) { + return _SystemConfig.Contract.Upgrade(&_SystemConfig.TransactOpts, _l2ChainId, _superchainConfig) +} + +// Upgrade is a paid mutator transaction binding the contract method 0x028f4e47. +// +// Solidity: function upgrade(uint256 _l2ChainId, address _superchainConfig) returns() +func (_SystemConfig *SystemConfigTransactorSession) Upgrade(_l2ChainId *big.Int, _superchainConfig common.Address) (*types.Transaction, error) { + return _SystemConfig.Contract.Upgrade(&_SystemConfig.TransactOpts, _l2ChainId, _superchainConfig) +} + // SystemConfigConfigUpdateIterator is returned from FilterConfigUpdate and is used to iterate over the raw logs and unpacked data for ConfigUpdate events raised by the SystemConfig contract. type SystemConfigConfigUpdateIterator struct { Event *SystemConfigConfigUpdate // Event containing the contract specifics and raw log diff --git a/op-e2e/e2eutils/setup.go b/op-e2e/e2eutils/setup.go index bfd1d123b4841..d46831b63ef5a 100644 --- a/op-e2e/e2eutils/setup.go +++ b/op-e2e/e2eutils/setup.go @@ -109,12 +109,12 @@ func Ether(v uint64) *big.Int { } func GetL2AllocsMode(dc *genesis.DeployConfig, t uint64) genesis.L2AllocsMode { - if fork := dc.JovianTime(t); fork != nil && *fork <= 0 { - return genesis.L2AllocsJovian - } if fork := dc.InteropTime(t); fork != nil && *fork <= 0 { return genesis.L2AllocsInterop } + if fork := dc.JovianTime(t); fork != nil && *fork <= 0 { + return genesis.L2AllocsJovian + } if fork := dc.IsthmusTime(t); fork != nil && *fork <= 0 { return genesis.L2AllocsIsthmus } diff --git a/op-node/rollup/derive/jovian_upgrade_transactions.go b/op-node/rollup/derive/jovian_upgrade_transactions.go new file mode 100644 index 0000000000000..2919740c72b8d --- /dev/null +++ b/op-node/rollup/derive/jovian_upgrade_transactions.go @@ -0,0 +1,55 @@ +package derive + +import ( + "fmt" + "math/big" + + "github.com/ethereum-optimism/optimism/op-service/predeploys" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" +) + +var ( + // L1Block Parameters + deployJovianL1BlockSource = UpgradeDepositSource{Intent: "Jovian: L1 Block Deployment"} + updateJovianL1BlockProxySource = UpgradeDepositSource{Intent: "Jovian: L1 Block Proxy Update"} + L1BlockJovianDeployerAddress = common.HexToAddress("0x4210000000000000000000000000000000000004") + jovianL1BlockAddress = crypto.CreateAddress(L1BlockJovianDeployerAddress, 0) + + // Bytecodes + l1BlockJovianDeploymentBytecode = common.FromHex("0x608060405234801561001057600080fd5b5061073f806100206000396000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c806364ca23ef116100e3578063c59859181161008c578063e81b2c6d11610066578063e81b2c6d146103f0578063f8206140146103f9578063fe3d57101461040257600080fd5b8063c598591814610375578063d844471514610395578063e591b282146103ce57600080fd5b80638b239f73116100bd5780638b239f73146103435780639e8c49661461034c578063b80777ea1461035557600080fd5b806364ca23ef146102ff57806368d5dca6146103135780638381f58a1461032f57600080fd5b80634397dfef1161014557806354fd4d501161011f57806354fd4d501461027b578063550fcdc9146102bd5780635cf24969146102f657600080fd5b80634397dfef1461021a578063440a5e20146102425780634d5d9a2a1461024a57600080fd5b806316d3bc7f1161017657806316d3bc7f146101d657806321326849146102035780633db6be2b1461021257600080fd5b8063015d8eb91461019d578063098999be146101b257806309bd5a60146101ba575b600080fd5b6101b06101ab36600461064d565b610422565b005b6101b0610561565b6101c360025481565b6040519081526020015b60405180910390f35b6008546101ea9067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016101cd565b604051600081526020016101cd565b6101b061056b565b6040805173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee815260126020820152016101cd565b6101b0610573565b6008546102669068010000000000000000900463ffffffff1681565b60405163ffffffff90911681526020016101cd565b60408051808201909152600581527f312e372e3000000000000000000000000000000000000000000000000000000060208201525b6040516101cd91906106bf565b60408051808201909152600381527f455448000000000000000000000000000000000000000000000000000000000060208201526102b0565b6101c360015481565b6003546101ea9067ffffffffffffffff1681565b6003546102669068010000000000000000900463ffffffff1681565b6000546101ea9067ffffffffffffffff1681565b6101c360055481565b6101c360065481565b6000546101ea9068010000000000000000900467ffffffffffffffff1681565b600354610266906c01000000000000000000000000900463ffffffff1681565b60408051808201909152600581527f457468657200000000000000000000000000000000000000000000000000000060208201526102b0565b60405173deaddeaddeaddeaddeaddeaddeaddeaddead000181526020016101cd565b6101c360045481565b6101c360075481565b600854610266906c01000000000000000000000000900463ffffffff1681565b3373deaddeaddeaddeaddeaddeaddeaddeaddead0001146104c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4c31426c6f636b3a206f6e6c7920746865206465706f7369746f72206163636f60448201527f756e742063616e20736574204c3120626c6f636b2076616c7565730000000000606482015260840160405180910390fd5b6000805467ffffffffffffffff98891668010000000000000000027fffffffffffffffffffffffffffffffff00000000000000000000000000000000909116998916999099179890981790975560019490945560029290925560038054919094167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009190911617909255600491909155600555600655565b61056961057b565b565b61056961058e565b6105696105d9565b6105836105d9565b60a43560a01c600855565b61059661057b565b600880547fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166fffffffff00000000000000000000000060b03560801c16179055565b73deaddeaddeaddeaddeaddeaddeaddeaddead000133811461060357633cc50b456000526004601cfd5b60043560801c60035560143560801c60005560243560015560443560075560643560025560843560045550565b803567ffffffffffffffff8116811461064857600080fd5b919050565b600080600080600080600080610100898b03121561066a57600080fd5b61067389610630565b975061068160208a01610630565b9650604089013595506060890135945061069d60808a01610630565b979a969950949793969560a0850135955060c08501359460e001359350915050565b600060208083528351808285015260005b818110156106ec578581018301518582016040015282016106d0565b818111156106fe576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201604001939250505056fea164736f6c634300080f000a") +) + +func JovianNetworkUpgradeTransactions() ([]hexutil.Bytes, error) { + deployL1Block, err := types.NewTx(&types.DepositTx{ + SourceHash: deployJovianL1BlockSource.SourceHash(), + From: L1BlockJovianDeployerAddress, + To: nil, + Mint: big.NewInt(0), + Value: big.NewInt(0), + Gas: 425_000, + IsSystemTransaction: false, + Data: l1BlockJovianDeploymentBytecode, + }).MarshalBinary() + if err != nil { + return nil, fmt.Errorf("build tx to deploy L1 block transaction: %w", err) + } + + updateL1BlockProxy, err := types.NewTx(&types.DepositTx{ + SourceHash: updateJovianL1BlockProxySource.SourceHash(), + From: common.Address{}, + To: &predeploys.L1BlockAddr, + Mint: big.NewInt(0), + Value: big.NewInt(0), + Gas: 50_000, + IsSystemTransaction: false, + Data: upgradeToCalldata(jovianL1BlockAddress), + }).MarshalBinary() + if err != nil { + return nil, fmt.Errorf("build tx to the update L1 block proxy: %w", err) + } + + return []hexutil.Bytes{deployL1Block, updateL1BlockProxy}, nil +} diff --git a/op-node/rollup/derive/l1_block_info.go b/op-node/rollup/derive/l1_block_info.go index ddeb35c5cdb24..f88d523848fb7 100644 --- a/op-node/rollup/derive/l1_block_info.go +++ b/op-node/rollup/derive/l1_block_info.go @@ -21,20 +21,24 @@ const ( L1InfoFuncBedrockSignature = "setL1BlockValues(uint64,uint64,uint256,bytes32,uint64,bytes32,uint256,uint256)" L1InfoFuncEcotoneSignature = "setL1BlockValuesEcotone()" L1InfoFuncIsthmusSignature = "setL1BlockValuesIsthmus()" + L1InfoFuncJovianSignature = "setL1BlockValuesJovian()" L1InfoArguments = 8 L1InfoBedrockLen = 4 + 32*L1InfoArguments - L1InfoEcotoneLen = 4 + 32*5 // after Ecotone upgrade, args are packed into 5 32-byte slots - L1InfoIsthmusLen = 4 + 32*5 + 4 + 8 // after Isthmus upgrade, additionally pack in operator fee scalar and constant + L1InfoEcotoneLen = 4 + 32*5 // after Ecotone upgrade, args are packed into 5 32-byte slots + L1InfoIsthmusLen = 4 + 32*5 + 4 + 8 // after Isthmus upgrade, additionally pack in operator fee scalar and constant + L1InfoJovianLen = L1InfoIsthmusLen + 2 // after Jovian upgrade, additionally pack in DA footprint gas scalar ) var ( L1InfoFuncBedrockBytes4 = crypto.Keccak256([]byte(L1InfoFuncBedrockSignature))[:4] L1InfoFuncEcotoneBytes4 = crypto.Keccak256([]byte(L1InfoFuncEcotoneSignature))[:4] L1InfoFuncIsthmusBytes4 = crypto.Keccak256([]byte(L1InfoFuncIsthmusSignature))[:4] + L1InfoFuncJovianBytes4 = crypto.Keccak256([]byte(L1InfoFuncJovianSignature))[:4] L1InfoDepositerAddress = common.HexToAddress("0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001") L1BlockAddress = predeploys.L1BlockAddr ErrInvalidFormat = errors.New("invalid ecotone l1 block info format") ErrInvalidIsthmusFormat = errors.New("invalid isthmus l1 block info format") + ErrInvalidJovianFormat = errors.New("invalid jovian l1 block info format") ) const ( @@ -62,6 +66,8 @@ type L1BlockInfo struct { OperatorFeeScalar uint32 // added by Isthmus upgrade OperatorFeeConstant uint64 // added by Isthmus upgrade + + DAFootprintGasScalar uint16 // added by Jovian upgrade } // Bedrock Binary Format @@ -168,7 +174,7 @@ func (info *L1BlockInfo) unmarshalBinaryBedrock(data []byte) error { // +---------+--------------------------+ func (info *L1BlockInfo) marshalBinaryEcotone() ([]byte, error) { - w := bytes.NewBuffer(make([]byte, 0, L1InfoEcotoneLen)) // Ecotone and Interop have the same length + w := bytes.NewBuffer(make([]byte, 0, L1InfoEcotoneLen)) // Ecotone have the same length if err := solabi.WriteSignature(w, L1InfoFuncEcotoneBytes4); err != nil { return nil, err } @@ -251,7 +257,7 @@ func (info *L1BlockInfo) unmarshalBinaryEcotone(data []byte) error { return nil } -// Interop & Isthmus Binary Format +// Isthmus Binary Format // +---------+--------------------------+ // | Bytes | Field | // +---------+--------------------------+ @@ -323,14 +329,14 @@ func marshalBinaryWithSignature(info *L1BlockInfo, signature []byte) ([]byte, er return w.Bytes(), nil } -func unmarshalBinaryWithSignatureAndData(info *L1BlockInfo, signature []byte, data []byte) error { +func (info *L1BlockInfo) unmarshalBinaryIsthmus(data []byte) error { if len(data) != L1InfoIsthmusLen { return fmt.Errorf("data is unexpected length: %d", len(data)) } r := bytes.NewReader(data) var err error - if _, err := solabi.ReadAndValidateSignature(r, signature); err != nil { + if _, err := solabi.ReadAndValidateSignature(r, []byte(L1InfoFuncIsthmusBytes4)); err != nil { return err } if err := binary.Read(r, binary.BigEndian, &info.BaseFeeScalar); err != nil { @@ -373,8 +379,125 @@ func unmarshalBinaryWithSignatureAndData(info *L1BlockInfo, signature []byte, da return nil } -func (info *L1BlockInfo) unmarshalBinaryIsthmus(data []byte) error { - return unmarshalBinaryWithSignatureAndData(info, L1InfoFuncIsthmusBytes4, data) +// Interop & Jovian Binary Format +// +---------+--------------------------+ +// | Bytes | Field | +// +---------+--------------------------+ +// | 4 | Function signature | +// | 4 | BaseFeeScalar | +// | 4 | BlobBaseFeeScalar | +// | 8 | SequenceNumber | +// | 8 | Timestamp | +// | 8 | L1BlockNumber | +// | 32 | BaseFee | +// | 32 | BlobBaseFee | +// | 32 | BlockHash | +// | 32 | BatcherHash | +// | 4 | OperatorFeeScalar | +// | 8 | OperatorFeeConstant | +// | 2 | DAFootprintGasScalar | +// +---------+--------------------------+ + +func (info *L1BlockInfo) marshalBinaryJovian() ([]byte, error) { + w := bytes.NewBuffer(make([]byte, 0, L1InfoIsthmusLen)) + if err := solabi.WriteSignature(w, L1InfoFuncJovianBytes4); err != nil { + return nil, err + } + if err := binary.Write(w, binary.BigEndian, info.BaseFeeScalar); err != nil { + return nil, err + } + if err := binary.Write(w, binary.BigEndian, info.BlobBaseFeeScalar); err != nil { + return nil, err + } + if err := binary.Write(w, binary.BigEndian, info.SequenceNumber); err != nil { + return nil, err + } + if err := binary.Write(w, binary.BigEndian, info.Time); err != nil { + return nil, err + } + if err := binary.Write(w, binary.BigEndian, info.Number); err != nil { + return nil, err + } + if err := solabi.WriteUint256(w, info.BaseFee); err != nil { + return nil, err + } + blobBasefee := info.BlobBaseFee + if blobBasefee == nil { + blobBasefee = big.NewInt(1) // set to 1, to match the min blob basefee as defined in EIP-4844 + } + if err := solabi.WriteUint256(w, blobBasefee); err != nil { + return nil, err + } + if err := solabi.WriteHash(w, info.BlockHash); err != nil { + return nil, err + } + // ABI encoding will perform the left-padding with zeroes to 32 bytes, matching the "batcherHash" SystemConfig format and version 0 byte. + if err := solabi.WriteAddress(w, info.BatcherAddr); err != nil { + return nil, err + } + if err := binary.Write(w, binary.BigEndian, info.OperatorFeeScalar); err != nil { + return nil, err + } + if err := binary.Write(w, binary.BigEndian, info.OperatorFeeConstant); err != nil { + return nil, err + } + if err := binary.Write(w, binary.BigEndian, info.DAFootprintGasScalar); err != nil { + return nil, err + } + return w.Bytes(), nil +} + +func (info *L1BlockInfo) unmarshalBinaryJovian(data []byte) error { + if len(data) != L1InfoJovianLen { + return fmt.Errorf("data is unexpected length: %d", len(data)) + } + r := bytes.NewReader(data) + + var err error + if _, err := solabi.ReadAndValidateSignature(r, []byte(L1InfoFuncJovianBytes4)); err != nil { + return err + } + if err := binary.Read(r, binary.BigEndian, &info.BaseFeeScalar); err != nil { + return ErrInvalidJovianFormat + } + if err := binary.Read(r, binary.BigEndian, &info.BlobBaseFeeScalar); err != nil { + return ErrInvalidJovianFormat + } + if err := binary.Read(r, binary.BigEndian, &info.SequenceNumber); err != nil { + return ErrInvalidJovianFormat + } + if err := binary.Read(r, binary.BigEndian, &info.Time); err != nil { + return ErrInvalidJovianFormat + } + if err := binary.Read(r, binary.BigEndian, &info.Number); err != nil { + return ErrInvalidJovianFormat + } + if info.BaseFee, err = solabi.ReadUint256(r); err != nil { + return err + } + if info.BlobBaseFee, err = solabi.ReadUint256(r); err != nil { + return err + } + if info.BlockHash, err = solabi.ReadHash(r); err != nil { + return err + } + // The "batcherHash" will be correctly parsed as address, since the version 0 and left-padding matches the ABI encoding format. + if info.BatcherAddr, err = solabi.ReadAddress(r); err != nil { + return err + } + if err := binary.Read(r, binary.BigEndian, &info.OperatorFeeScalar); err != nil { + return ErrInvalidJovianFormat + } + if err := binary.Read(r, binary.BigEndian, &info.OperatorFeeConstant); err != nil { + return ErrInvalidJovianFormat + } + if err := binary.Read(r, binary.BigEndian, &info.DAFootprintGasScalar); err != nil { + return ErrInvalidJovianFormat + } + if !solabi.EmptyReader(r) { + return errors.New("too many bytes") + } + return nil } // isEcotoneButNotFirstBlock returns whether the specified block is subject to the Ecotone upgrade, @@ -389,9 +512,18 @@ func isIsthmusButNotFirstBlock(rollupCfg *rollup.Config, l2Timestamp uint64) boo return rollupCfg.IsIsthmus(l2Timestamp) && !rollupCfg.IsIsthmusActivationBlock(l2Timestamp) } +// isJovianButNotFirstBlock returns whether the specified block is subject to the Jovian upgrade, +// but is not the activation block itself. +func isJovianButNotFirstBlock(rollupCfg *rollup.Config, l2Timestamp uint64) bool { + return rollupCfg.IsJovian(l2Timestamp) && !rollupCfg.IsJovianActivationBlock(l2Timestamp) +} + // L1BlockInfoFromBytes is the inverse of L1InfoDeposit, to see where the L2 chain is derived from func L1BlockInfoFromBytes(rollupCfg *rollup.Config, l2BlockTime uint64, data []byte) (*L1BlockInfo, error) { var info L1BlockInfo + if isJovianButNotFirstBlock(rollupCfg, l2BlockTime) { + return &info, info.unmarshalBinaryJovian(data) + } // Important, this should be ordered from most recent to oldest if isIsthmusButNotFirstBlock(rollupCfg, l2BlockTime) { return &info, info.unmarshalBinaryIsthmus(data) @@ -442,17 +574,23 @@ func L1InfoDeposit(rollupCfg *rollup.Config, sysCfg eth.SystemConfig, seqNumber l1BlockInfo.BaseFeeScalar = scalars.BaseFeeScalar if isIsthmusActivated { - operatorFee := sysCfg.OperatorFee() - l1BlockInfo.OperatorFeeScalar = operatorFee.Scalar - l1BlockInfo.OperatorFeeConstant = operatorFee.Constant - } - - if isIsthmusActivated { - out, err := l1BlockInfo.marshalBinaryIsthmus() - if err != nil { - return nil, fmt.Errorf("failed to marshal Isthmus l1 block info: %w", err) + if isJovianButNotFirstBlock(rollupCfg, l2Timestamp) { + l1BlockInfo.DAFootprintGasScalar = sysCfg.DAFootprintGasScalar + out, err := l1BlockInfo.marshalBinaryJovian() + if err != nil { + return nil, fmt.Errorf("failed to marshal Jovian l1 block info: %w", err) + } + data = out + } else { + operatorFee := sysCfg.OperatorFee() + l1BlockInfo.OperatorFeeScalar = operatorFee.Scalar + l1BlockInfo.OperatorFeeConstant = operatorFee.Constant + out, err := l1BlockInfo.marshalBinaryIsthmus() + if err != nil { + return nil, fmt.Errorf("failed to marshal Isthmus l1 block info: %w", err) + } + data = out } - data = out } else { out, err := l1BlockInfo.marshalBinaryEcotone() if err != nil { diff --git a/op-node/rollup/derive/l1_block_info_test.go b/op-node/rollup/derive/l1_block_info_test.go index c634a9ae4ea25..5dab5cac04158 100644 --- a/op-node/rollup/derive/l1_block_info_test.go +++ b/op-node/rollup/derive/l1_block_info_test.go @@ -192,6 +192,45 @@ func TestParseL1InfoDepositTxData(t *testing.T) { require.Equal(t, depTx.Gas, uint64(RegolithSystemTxGas)) require.Equal(t, L1InfoIsthmusLen, len(depTx.Data)) }) + t.Run("jovian", func(t *testing.T) { + rng := rand.New(rand.NewSource(1234)) + info := testutils.MakeBlockInfo(nil)(rng) + rollupCfg := rollup.Config{BlockTime: 2, Genesis: rollup.Genesis{L2Time: 1000}} + rollupCfg.ActivateAtGenesis(rollup.Jovian) + // run 1 block after interop transition + timestamp := rollupCfg.Genesis.L2Time + rollupCfg.BlockTime + depTx, err := L1InfoDeposit(&rollupCfg, randomL1Cfg(rng, info), randomSeqNr(rng), info, timestamp) + require.NoError(t, err) + require.False(t, depTx.IsSystemTransaction) + require.Equal(t, depTx.Gas, uint64(RegolithSystemTxGas)) + require.Equal(t, L1InfoJovianLen, len(depTx.Data), "the length is same in interop") + }) + t.Run("activation-block jovian", func(t *testing.T) { + rng := rand.New(rand.NewSource(1234)) + info := testutils.MakeBlockInfo(nil)(rng) + rollupCfg := rollup.Config{BlockTime: 2, Genesis: rollup.Genesis{L2Time: 1000}} + rollupCfg.ActivateAtGenesis(rollup.Jovian) + interopTime := rollupCfg.Genesis.L2Time + rollupCfg.BlockTime // activate interop just after genesis + rollupCfg.InteropTime = &interopTime + depTx, err := L1InfoDeposit(&rollupCfg, randomL1Cfg(rng, info), randomSeqNr(rng), info, interopTime) + require.NoError(t, err) + require.False(t, depTx.IsSystemTransaction) + require.Equal(t, depTx.Gas, uint64(RegolithSystemTxGas)) + // Interop activates, but isthmus L1 info is still used at this upgrade block + require.Equal(t, L1InfoJovianLen, len(depTx.Data)) + require.Equal(t, L1InfoFuncJovianBytes4, depTx.Data[:4]) + }) + t.Run("genesis-block jovian", func(t *testing.T) { + rng := rand.New(rand.NewSource(1234)) + info := testutils.MakeBlockInfo(nil)(rng) + rollupCfg := rollup.Config{BlockTime: 2, Genesis: rollup.Genesis{L2Time: 1000}} + rollupCfg.ActivateAtGenesis(rollup.Jovian) + depTx, err := L1InfoDeposit(&rollupCfg, randomL1Cfg(rng, info), randomSeqNr(rng), info, rollupCfg.Genesis.L2Time) + require.NoError(t, err) + require.False(t, depTx.IsSystemTransaction) + require.Equal(t, depTx.Gas, uint64(RegolithSystemTxGas)) + require.Equal(t, L1InfoJovianLen, len(depTx.Data)) + }) t.Run("interop", func(t *testing.T) { rng := rand.New(rand.NewSource(1234)) info := testutils.MakeBlockInfo(nil)(rng) @@ -203,22 +242,21 @@ func TestParseL1InfoDepositTxData(t *testing.T) { require.NoError(t, err) require.False(t, depTx.IsSystemTransaction) require.Equal(t, depTx.Gas, uint64(RegolithSystemTxGas)) - require.Equal(t, L1InfoIsthmusLen, len(depTx.Data), "the length is same in interop") + require.Equal(t, L1InfoJovianLen, len(depTx.Data), "the length is same in interop") }) t.Run("activation-block interop", func(t *testing.T) { rng := rand.New(rand.NewSource(1234)) info := testutils.MakeBlockInfo(nil)(rng) rollupCfg := rollup.Config{BlockTime: 2, Genesis: rollup.Genesis{L2Time: 1000}} - rollupCfg.ActivateAtGenesis(rollup.Isthmus) + rollupCfg.ActivateAtGenesis(rollup.Interop) interopTime := rollupCfg.Genesis.L2Time + rollupCfg.BlockTime // activate interop just after genesis rollupCfg.InteropTime = &interopTime depTx, err := L1InfoDeposit(&rollupCfg, randomL1Cfg(rng, info), randomSeqNr(rng), info, interopTime) require.NoError(t, err) require.False(t, depTx.IsSystemTransaction) require.Equal(t, depTx.Gas, uint64(RegolithSystemTxGas)) - // Interop activates, but isthmus L1 info is still used at this upgrade block - require.Equal(t, L1InfoIsthmusLen, len(depTx.Data)) - require.Equal(t, L1InfoFuncIsthmusBytes4, depTx.Data[:4]) + require.Equal(t, L1InfoJovianLen, len(depTx.Data)) + require.Equal(t, L1InfoFuncJovianBytes4, depTx.Data[:4]) }) t.Run("genesis-block interop", func(t *testing.T) { rng := rand.New(rand.NewSource(1234)) @@ -229,6 +267,6 @@ func TestParseL1InfoDepositTxData(t *testing.T) { require.NoError(t, err) require.False(t, depTx.IsSystemTransaction) require.Equal(t, depTx.Gas, uint64(RegolithSystemTxGas)) - require.Equal(t, L1InfoIsthmusLen, len(depTx.Data)) + require.Equal(t, L1InfoJovianLen, len(depTx.Data)) }) } diff --git a/op-node/rollup/derive/payload_util.go b/op-node/rollup/derive/payload_util.go index 24721e95acceb..f0441d3f99040 100644 --- a/op-node/rollup/derive/payload_util.go +++ b/op-node/rollup/derive/payload_util.go @@ -105,5 +105,9 @@ func PayloadToSystemConfig(rollupCfg *rollup.Config, payload *eth.ExecutionPaylo Constant: info.OperatorFeeConstant, }) } + + if rollupCfg.IsJovian(uint64(payload.Timestamp)) { + r.DAFootprintGasScalar = info.DAFootprintGasScalar + } return r, nil } diff --git a/op-node/rollup/derive/system_config.go b/op-node/rollup/derive/system_config.go index 64e21ff15f33f..def65977f7d81 100644 --- a/op-node/rollup/derive/system_config.go +++ b/op-node/rollup/derive/system_config.go @@ -17,12 +17,13 @@ import ( ) var ( - SystemConfigUpdateBatcher = common.Hash{31: 0} - SystemConfigUpdateFeeScalars = common.Hash{31: 1} - SystemConfigUpdateGasLimit = common.Hash{31: 2} - SystemConfigUpdateUnsafeBlockSigner = common.Hash{31: 3} - SystemConfigUpdateEIP1559Params = common.Hash{31: 4} - SystemConfigUpdateOperatorFeeParams = common.Hash{31: 5} + SystemConfigUpdateBatcher = common.Hash{31: 0} + SystemConfigUpdateFeeScalars = common.Hash{31: 1} + SystemConfigUpdateGasLimit = common.Hash{31: 2} + SystemConfigUpdateUnsafeBlockSigner = common.Hash{31: 3} + SystemConfigUpdateEIP1559Params = common.Hash{31: 4} + SystemConfigUpdateOperatorFeeParams = common.Hash{31: 5} + SystemConfigUpdateDAFootprintGasScalar = common.Hash{31: 6} ) var ( @@ -174,6 +175,22 @@ func ProcessSystemConfigUpdateLogEvent(destSysCfg *eth.SystemConfig, ev *types.L } destSysCfg.OperatorFeeParams = params return nil + case SystemConfigUpdateDAFootprintGasScalar: + if pointer, err := solabi.ReadUint64(reader); err != nil || pointer != 32 { + return NewCriticalError(errors.New("invalid pointer field")) + } + if length, err := solabi.ReadUint64(reader); err != nil || length != 32 { + return NewCriticalError(errors.New("invalid length field")) + } + daFootprintGasScalar, err := solabi.ReadUint16(reader) + if err != nil { + return NewCriticalError(errors.New("could not read da footprint gas scalar")) + } + if !solabi.EmptyReader(reader) { + return NewCriticalError(errors.New("too many bytes")) + } + destSysCfg.DAFootprintGasScalar = daFootprintGasScalar + return nil case SystemConfigUpdateUnsafeBlockSigner: // Ignored in derivation. This configurable applies to runtime configuration outside of the derivation. return nil diff --git a/op-node/rollup/derive/system_config_test.go b/op-node/rollup/derive/system_config_test.go index 5906f26cbea77..403eca197d486 100644 --- a/op-node/rollup/derive/system_config_test.go +++ b/op-node/rollup/derive/system_config_test.go @@ -18,6 +18,7 @@ var ( // ABI encoding helpers dynBytes, _ = abi.NewType("bytes", "", nil) address, _ = abi.NewType("address", "", nil) + uint16T, _ = abi.NewType("uint16", "", nil) uint256T, _ = abi.NewType("uint256", "", nil) addressArgs = abi.Arguments{ {Type: address}, @@ -29,6 +30,9 @@ var ( {Type: uint256T}, {Type: uint256T}, } + oneUint16 = abi.Arguments{ + {Type: uint16T}, + } oneUint256 = abi.Arguments{ {Type: uint256T}, } @@ -231,6 +235,28 @@ func TestProcessSystemConfigUpdateLogEvent(t *testing.T) { }, err: false, }, + { + name: "SystemConfigUpdateDAFootprintGasScalar", + log: &types.Log{ + Topics: []common.Hash{ + ConfigUpdateEventABIHash, + ConfigUpdateEventVersion0, + SystemConfigUpdateDAFootprintGasScalar, + }, + }, + hook: func(t *testing.T, log *types.Log) *types.Log { + numberData, err := oneUint16.Pack(uint16(100)) + require.NoError(t, err) + data, err := bytesArgs.Pack(numberData) + require.NoError(t, err) + log.Data = data + return log + }, + config: eth.SystemConfig{ + DAFootprintGasScalar: 100, + }, + err: false, + }, } for _, test := range tests { diff --git a/op-node/rollup/types.go b/op-node/rollup/types.go index 484f032f0b77d..0c9e8b28b7bb3 100644 --- a/op-node/rollup/types.go +++ b/op-node/rollup/types.go @@ -620,12 +620,12 @@ func (c *Config) IsActivationBlockForFork(l2BlockTime uint64, forkName ForkName) func (c *Config) ActivateAtGenesis(hardfork ForkName) { // IMPORTANT! ordered from newest to oldest switch hardfork { - case Jovian: - c.JovianTime = new(uint64) - fallthrough case Interop: c.InteropTime = new(uint64) fallthrough + case Jovian: + c.JovianTime = new(uint64) + fallthrough case Isthmus: c.IsthmusTime = new(uint64) fallthrough diff --git a/op-service/eth/types.go b/op-service/eth/types.go index 365060132b2d1..a655e97ffc038 100644 --- a/op-service/eth/types.go +++ b/op-service/eth/types.go @@ -613,6 +613,8 @@ type SystemConfig struct { EIP1559Params Bytes8 `json:"eip1559Params"` // OperatorFeeParams identifies the operator fee parameters. OperatorFeeParams Bytes32 `json:"operatorFeeParams"` + // DAFootprintGasScalar identifies the DA footprint gas scalar. + DAFootprintGasScalar uint16 `json:"daFootprintGasScalar"` // More fields can be added for future SystemConfig versions. // MarshalPreHolocene indicates whether or not this struct should be diff --git a/op-service/eth/types_test.go b/op-service/eth/types_test.go index ea1d40d930fb8..10ac0b751f2b6 100644 --- a/op-service/eth/types_test.go +++ b/op-service/eth/types_test.go @@ -95,17 +95,18 @@ func FuzzEncodeOperatorFeeParams(f *testing.F) { func TestSystemConfigMarshaling(t *testing.T) { sysConfig := SystemConfig{ - BatcherAddr: common.Address{'A'}, - Overhead: Bytes32{0x4, 0x5, 0x6}, - Scalar: Bytes32{0x7, 0x8, 0x9}, - OperatorFeeParams: Bytes32{0x1, 0x2, 0x3}, - GasLimit: 1234, + BatcherAddr: common.Address{'A'}, + Overhead: Bytes32{0x4, 0x5, 0x6}, + Scalar: Bytes32{0x7, 0x8, 0x9}, + OperatorFeeParams: Bytes32{0x1, 0x2, 0x3}, + GasLimit: 1234, + DAFootprintGasScalar: 400, // Leave EIP1559 params empty to prove that the // zero value is sent. } j, err := json.Marshal(sysConfig) require.NoError(t, err) - require.Equal(t, `{"batcherAddr":"0x4100000000000000000000000000000000000000","overhead":"0x0405060000000000000000000000000000000000000000000000000000000000","scalar":"0x0708090000000000000000000000000000000000000000000000000000000000","gasLimit":1234,"eip1559Params":"0x0000000000000000","operatorFeeParams":"0x0102030000000000000000000000000000000000000000000000000000000000"}`, string(j)) + require.Equal(t, `{"batcherAddr":"0x4100000000000000000000000000000000000000","overhead":"0x0405060000000000000000000000000000000000000000000000000000000000","scalar":"0x0708090000000000000000000000000000000000000000000000000000000000","gasLimit":1234,"eip1559Params":"0x0000000000000000","operatorFeeParams":"0x0102030000000000000000000000000000000000000000000000000000000000","daFootprintGasScalar":400}`, string(j)) sysConfig.MarshalPreHolocene = true j, err = json.Marshal(sysConfig) require.NoError(t, err) diff --git a/op-service/solabi/util.go b/op-service/solabi/util.go index f5d48a657693f..1763400ee8cc0 100644 --- a/op-service/solabi/util.go +++ b/op-service/solabi/util.go @@ -16,6 +16,8 @@ import ( var ( addressEmptyPadding [12]byte = [12]byte{} uint64EmptyPadding [24]byte = [24]byte{} + uint32EmptyPadding [28]byte = [28]byte{} + uint16EmptyPadding [30]byte = [30]byte{} uint8EmptyPadding [31]byte = [31]byte{} ) @@ -75,6 +77,36 @@ func ReadUint64(r io.Reader) (uint64, error) { return n, nil } +// ReadUint16 reads a big endian uint16 from a 32 byte word +func ReadUint16(r io.Reader) (uint16, error) { + var readPadding [30]byte + var n uint16 + if _, err := io.ReadFull(r, readPadding[:]); err != nil { + return n, err + } else if !bytes.Equal(readPadding[:], uint16EmptyPadding[:]) { + return n, fmt.Errorf("number padding was not empty: %x", readPadding[:]) + } + if err := binary.Read(r, binary.BigEndian, &n); err != nil { + return 0, errors.New("expected number length to be 8 bytes") + } + return n, nil +} + +// ReadUint32 reads a big endian uint32 from a 32 byte word +func ReadUint32(r io.Reader) (uint32, error) { + var readPadding [28]byte + var n uint32 + if _, err := io.ReadFull(r, readPadding[:]); err != nil { + return n, err + } else if !bytes.Equal(readPadding[:], uint32EmptyPadding[:]) { + return n, fmt.Errorf("number padding was not empty: %x", readPadding[:]) + } + if err := binary.Read(r, binary.BigEndian, &n); err != nil { + return 0, errors.New("expected number length to be 8 bytes") + } + return n, nil +} + func ReadUint256(r io.Reader) (*big.Int, error) { var n [32]byte if _, err := io.ReadFull(r, n[:]); err != nil { diff --git a/packages/contracts-bedrock/interfaces/L1/ISystemConfig.sol b/packages/contracts-bedrock/interfaces/L1/ISystemConfig.sol index 81c5f554f2d8c..8f52b14b81dfc 100644 --- a/packages/contracts-bedrock/interfaces/L1/ISystemConfig.sol +++ b/packages/contracts-bedrock/interfaces/L1/ISystemConfig.sol @@ -12,7 +12,8 @@ interface ISystemConfig is IProxyAdminOwnedBase { GAS_LIMIT, UNSAFE_BLOCK_SIGNER, EIP_1559_PARAMS, - OPERATOR_FEE_PARAMS + OPERATOR_FEE_PARAMS, + DA_FOOTPRINT_GAS_SCALAR } struct Addresses { @@ -72,6 +73,7 @@ interface ISystemConfig is IProxyAdminOwnedBase { function minimumGasLimit() external view returns (uint64); function operatorFeeConstant() external view returns (uint64); function operatorFeeScalar() external view returns (uint32); + function daFootprintGasScalar() external view returns (uint16); function optimismMintableERC20Factory() external view returns (address addr_); function optimismPortal() external view returns (address addr_); function overhead() external view returns (uint256); @@ -84,6 +86,7 @@ interface ISystemConfig is IProxyAdminOwnedBase { function setGasConfigEcotone(uint32 _basefeeScalar, uint32 _blobbasefeeScalar) external; function setGasLimit(uint64 _gasLimit) external; function setOperatorFeeScalars(uint32 _operatorFeeScalar, uint64 _operatorFeeConstant) external; + function setDAFootprintGasScalar(uint16 _daFootprintGasScalar) external; function setUnsafeBlockSigner(address _unsafeBlockSigner) external; function setEIP1559Params(uint32 _denominator, uint32 _elasticity) external; function startBlock() external view returns (uint256 startBlock_); diff --git a/packages/contracts-bedrock/interfaces/L2/IL1Block.sol b/packages/contracts-bedrock/interfaces/L2/IL1Block.sol index 30c42275adf9a..65b9ef0f2029b 100644 --- a/packages/contracts-bedrock/interfaces/L2/IL1Block.sol +++ b/packages/contracts-bedrock/interfaces/L2/IL1Block.sol @@ -18,6 +18,7 @@ interface IL1Block { function number() external view returns (uint64); function operatorFeeScalar() external view returns (uint32); function operatorFeeConstant() external view returns (uint64); + function daFootprintGasScalar() external view returns (uint16); function sequenceNumber() external view returns (uint64); function setL1BlockValues( uint64 _number, @@ -32,6 +33,7 @@ interface IL1Block { external; function setL1BlockValuesEcotone() external; function setL1BlockValuesIsthmus() external; + function setL1BlockValuesJovian() external; function timestamp() external view returns (uint64); function version() external pure returns (string memory); diff --git a/packages/contracts-bedrock/scripts/deploy/DeployConfig.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployConfig.s.sol index 4588b60cf65fd..612b3d0348ece 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployConfig.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployConfig.s.sol @@ -51,6 +51,7 @@ contract DeployConfig is Script { uint256 public l2GenesisBlockGasLimit; uint32 public basefeeScalar; uint32 public blobbasefeeScalar; + uint16 public daFootprintGasScalar; bool public enableGovernance; uint256 public faultGameAbsolutePrestate; uint256 public faultGameGenesisBlock; @@ -120,6 +121,7 @@ contract DeployConfig is Script { l2GenesisBlockGasLimit = stdJson.readUint(_json, "$.l2GenesisBlockGasLimit"); basefeeScalar = uint32(_readOr(_json, "$.gasPriceOracleBaseFeeScalar", 1368)); blobbasefeeScalar = uint32(_readOr(_json, "$.gasPriceOracleBlobBaseFeeScalar", 810949)); + daFootprintGasScalar = uint16(_readOr(_json, "$.daFootprintGasScalar", 400)); enableGovernance = _readOr(_json, "$.enableGovernance", false); systemConfigStartBlock = stdJson.readUint(_json, "$.systemConfigStartBlock"); diff --git a/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol index 050dfed7695b9..622d7fe5775fb 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol @@ -59,6 +59,8 @@ contract DeployOPChainInput is BaseDeployIO { uint32 internal _operatorFeeScalar; uint64 internal _operatorFeeConstant; + uint16 internal _daFootprintGasScalar; + function set(bytes4 _sel, address _addr) public { require(_addr != address(0), "DeployOPChainInput: cannot set zero address"); if (_sel == this.opChainProxyAdminOwner.selector) _opChainProxyAdminOwner = _addr; @@ -95,6 +97,8 @@ contract DeployOPChainInput is BaseDeployIO { _operatorFeeScalar = SafeCast.toUint32(_value); } else if (_sel == this.operatorFeeConstant.selector) { _operatorFeeConstant = SafeCast.toUint64(_value); + } else if (_sel == this.daFootprintGasScalar.selector) { + _daFootprintGasScalar = SafeCast.toUint16(_value); } else { revert("DeployOPChainInput: unknown selector"); } @@ -226,6 +230,10 @@ contract DeployOPChainInput is BaseDeployIO { function operatorFeeConstant() public view returns (uint64) { return _operatorFeeConstant; } + + function daFootprintGasScalar() public view returns (uint16) { + return _daFootprintGasScalar; + } } contract DeployOPChainOutput is BaseDeployIO { diff --git a/packages/contracts-bedrock/snapshots/abi/L1Block.json b/packages/contracts-bedrock/snapshots/abi/L1Block.json index 153d2676cf5bb..5f3ebef9dba14 100644 --- a/packages/contracts-bedrock/snapshots/abi/L1Block.json +++ b/packages/contracts-bedrock/snapshots/abi/L1Block.json @@ -77,6 +77,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "daFootprintGasScalar", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "gasPayingToken", @@ -287,6 +300,13 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "setL1BlockValuesJovian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "timestamp", diff --git a/packages/contracts-bedrock/snapshots/abi/SystemConfig.json b/packages/contracts-bedrock/snapshots/abi/SystemConfig.json index 03f82fcb103f7..a5c5f5c028d55 100644 --- a/packages/contracts-bedrock/snapshots/abi/SystemConfig.json +++ b/packages/contracts-bedrock/snapshots/abi/SystemConfig.json @@ -173,6 +173,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "daFootprintGasScalar", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "disputeGameFactory", @@ -705,6 +718,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_daFootprintGasScalar", + "type": "uint16" + } + ], + "name": "setDAFootprintGasScalar", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/packages/contracts-bedrock/snapshots/semver-lock.json b/packages/contracts-bedrock/snapshots/semver-lock.json index b4a402740fba6..dcc68aac55c63 100644 --- a/packages/contracts-bedrock/snapshots/semver-lock.json +++ b/packages/contracts-bedrock/snapshots/semver-lock.json @@ -24,8 +24,8 @@ "sourceCodeHash": "0x14ea48c6b39450b08785209132e6c7f996092ab75d7c170c756c0ef2b6565abc" }, "src/L1/OPContractsManagerStandardValidator.sol:OPContractsManagerStandardValidator": { - "initCodeHash": "0x4bc7f764443e720172be8b1dea534937893f1eae5a4ce8528f005657d12e6e9f", - "sourceCodeHash": "0x73cfd587b049a2eda1f028528a756477c39414902ea7390706eb146191a29242" + "initCodeHash": "0xb1cbbda65344fdea85b9223bb76a8ba561ebd1e0c1ce0895718d2b682b6f05eb", + "sourceCodeHash": "0xa307cdd75381e1afc40479eb53211157359133718a8907904e3096a5afb67d5c" }, "src/L1/OptimismPortal2.sol:OptimismPortal2": { "initCodeHash": "0x0bd9360663627aab37a548aca16e26b1a8017766445b3969e16bc6cca6ec801a", @@ -44,8 +44,8 @@ "sourceCodeHash": "0xad12c20a00dc20683bd3f68e6ee254f968da6cc2d98930be6534107ee5cb11d9" }, "src/L1/SystemConfig.sol:SystemConfig": { - "initCodeHash": "0x48070c60dce026f655fbd31c490673657ed0ee48b90ff399aa5bac60abc0b796", - "sourceCodeHash": "0x27101f76d083e0b15e462932f5a3bfad67c10e033eeb670b76e67c370b7f2b07" + "initCodeHash": "0x739168d4b1c93f99352db29948b25ce5e15cce9130437204dc5c33102258a117", + "sourceCodeHash": "0x970aa67b53f4624d032e69b1c702ece0cb87a5d9bf0fb31d217de4483f0cea7c" }, "src/L2/BaseFeeVault.sol:BaseFeeVault": { "initCodeHash": "0x9b664e3d84ad510091337b4aacaa494b142512e2f6f7fbcdb6210ed62ca9b885", @@ -64,8 +64,8 @@ "sourceCodeHash": "0x4351fe2ac1106c8c220b8cfe7839bc107c24d8084deb21259ac954f5a362725d" }, "src/L2/L1Block.sol:L1Block": { - "initCodeHash": "0xc35734387887a95f611888f3944546c6bcf82fd4c05dcdaa1e019779b628ad68", - "sourceCodeHash": "0x6e5349fd781d5f0127ff29ccea4d86a80240550cfa322364183a0f629abcb43e" + "initCodeHash": "0x3b24797182c92f9e8809939f0d8ff0286997d5c4b1477d6ce28542bbe00ed428", + "sourceCodeHash": "0x804e7dcf8c4feeb60bae44403fb5e26de5b8be4ac5c59c5af23151a9bb7b2983" }, "src/L2/L1FeeVault.sol:L1FeeVault": { "initCodeHash": "0x9b664e3d84ad510091337b4aacaa494b142512e2f6f7fbcdb6210ed62ca9b885", diff --git a/packages/contracts-bedrock/snapshots/storageLayout/L1Block.json b/packages/contracts-bedrock/snapshots/storageLayout/L1Block.json index 2c23f06367859..2d07ebb314bca 100644 --- a/packages/contracts-bedrock/snapshots/storageLayout/L1Block.json +++ b/packages/contracts-bedrock/snapshots/storageLayout/L1Block.json @@ -89,5 +89,19 @@ "offset": 8, "slot": "8", "type": "uint32" + }, + { + "bytes": "20", + "label": "spacer", + "offset": 12, + "slot": "8", + "type": "uint160" + }, + { + "bytes": "2", + "label": "daFootprintGasScalar", + "offset": 0, + "slot": "9", + "type": "uint16" } ] \ No newline at end of file diff --git a/packages/contracts-bedrock/snapshots/storageLayout/SystemConfig.json b/packages/contracts-bedrock/snapshots/storageLayout/SystemConfig.json index 53d4ca20c467c..98b0c4dc85ae3 100644 --- a/packages/contracts-bedrock/snapshots/storageLayout/SystemConfig.json +++ b/packages/contracts-bedrock/snapshots/storageLayout/SystemConfig.json @@ -111,6 +111,13 @@ "slot": "106", "type": "uint64" }, + { + "bytes": "2", + "label": "daFootprintGasScalar", + "offset": 20, + "slot": "106", + "type": "uint16" + }, { "bytes": "32", "label": "l2ChainId", diff --git a/packages/contracts-bedrock/src/L1/OPContractsManagerStandardValidator.sol b/packages/contracts-bedrock/src/L1/OPContractsManagerStandardValidator.sol index 226d6c798734e..58c74c52e7fdf 100644 --- a/packages/contracts-bedrock/src/L1/OPContractsManagerStandardValidator.sol +++ b/packages/contracts-bedrock/src/L1/OPContractsManagerStandardValidator.sol @@ -38,8 +38,8 @@ import { IProxyAdminOwnedBase } from "interfaces/L1/IProxyAdminOwnedBase.sol"; /// before and after an upgrade. contract OPContractsManagerStandardValidator is ISemver { /// @notice The semantic version of the OPContractsManagerStandardValidator contract. - /// @custom:semver 1.12.0 - string public constant version = "1.12.0"; + /// @custom:semver 1.13.0 + string public constant version = "1.13.0"; /// @notice The SuperchainConfig contract. ISuperchainConfig public superchainConfig; @@ -188,7 +188,7 @@ contract OPContractsManagerStandardValidator is ISemver { /// @notice Returns the expected SystemConfig version. function systemConfigVersion() public pure returns (string memory) { - return "3.7.0"; + return "3.8.0"; } /// @notice Returns the expected OptimismPortal version. diff --git a/packages/contracts-bedrock/src/L1/SystemConfig.sol b/packages/contracts-bedrock/src/L1/SystemConfig.sol index 7910e6f9d073f..1b34afbba4ac3 100644 --- a/packages/contracts-bedrock/src/L1/SystemConfig.sol +++ b/packages/contracts-bedrock/src/L1/SystemConfig.sol @@ -23,18 +23,20 @@ import { ISuperchainConfig } from "interfaces/L1/ISuperchainConfig.sol"; /// the L2 chain. contract SystemConfig is ProxyAdminOwnedBase, OwnableUpgradeable, ReinitializableBase, ISemver { /// @notice Enum representing different types of updates. - /// @custom:value BATCHER Represents an update to the batcher hash. - /// @custom:value FEE_SCALARS Represents an update to l1 data fee scalars. - /// @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 BATCHER Represents an update to the batcher hash. + /// @custom:value FEE_SCALARS Represents an update to l1 data fee scalars. + /// @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 DA_FOOTPRINT_GAS_SCALAR Represents an update to the DA footprint gas scalar. enum UpdateType { BATCHER, FEE_SCALARS, GAS_LIMIT, UNSAFE_BLOCK_SIGNER, EIP_1559_PARAMS, - OPERATOR_FEE_PARAMS + OPERATOR_FEE_PARAMS, + DA_FOOTPRINT_GAS_SCALAR } /// @notice Struct representing the addresses of L1 system contracts. These should be the @@ -129,6 +131,9 @@ contract SystemConfig is ProxyAdminOwnedBase, OwnableUpgradeable, Reinitializabl /// @notice The operator fee constant. uint64 public operatorFeeConstant; + // @notice The DA footprint gas scalar. + uint16 public daFootprintGasScalar; + /// @notice The L2 chain ID that this SystemConfig configures. uint256 public l2ChainId; @@ -154,9 +159,9 @@ contract SystemConfig is ProxyAdminOwnedBase, OwnableUpgradeable, Reinitializabl error SystemConfig_InvalidFeatureState(); /// @notice Semantic version. - /// @custom:semver 3.7.0 + /// @custom:semver 3.8.0 function version() public pure virtual returns (string memory) { - return "3.7.0"; + return "3.8.0"; } /// @notice Constructs the SystemConfig contract. @@ -447,6 +452,17 @@ contract SystemConfig is ProxyAdminOwnedBase, OwnableUpgradeable, Reinitializabl emit ConfigUpdate(VERSION, UpdateType.OPERATOR_FEE_PARAMS, data); } + function setDAFootprintGasScalar(uint16 _daFootprintGasScalar) external onlyOwner { + _setDAFootprintGasScalar(_daFootprintGasScalar); + } + + function _setDAFootprintGasScalar(uint16 _dAFootprintGasScalar) internal { + daFootprintGasScalar = _dAFootprintGasScalar; + + bytes memory data = abi.encode(_dAFootprintGasScalar); + emit ConfigUpdate(VERSION, UpdateType.DA_FOOTPRINT_GAS_SCALAR, 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/L2/L1Block.sol b/packages/contracts-bedrock/src/L2/L1Block.sol index 31935dfab7eac..ba481da644f64 100644 --- a/packages/contracts-bedrock/src/L2/L1Block.sol +++ b/packages/contracts-bedrock/src/L2/L1Block.sol @@ -61,9 +61,16 @@ contract L1Block is ISemver { /// @notice The scalar value applied to the operator fee. uint32 public operatorFeeScalar; - /// @custom:semver 1.6.1 + /// @notice Ensures daFootprintGasScalar goes in the next storage slot. + /// Otherwise bit-twiddling would be necessary in setL1BlockValuesJovian. + uint160 private spacer; + + /// @notice The DA footprint gas scalar. + uint16 public daFootprintGasScalar; + + /// @custom:semver 1.7.0 function version() public pure virtual returns (string memory) { - return "1.6.1"; + return "1.7.0"; } /// @notice Returns the gas paying token, its decimals, name and symbol. @@ -212,4 +219,46 @@ contract L1Block is ISemver { sstore(operatorFeeConstant.slot, shr(160, calldataload(164))) } } + + /// @notice Updates the L1 block values for a Jovian upgraded chain. + /// Params are packed and passed in as raw msg.data instead of ABI to reduce calldata size. + /// Params are expected to be in the following order: + /// 1. _baseFeeScalar L1 base fee scalar + /// 2. _blobBaseFeeScalar L1 blob base fee scalar + /// 3. _sequenceNumber Number of L2 blocks since epoch start. + /// 4. _timestamp L1 timestamp. + /// 5. _number L1 blocknumber. + /// 6. _basefee L1 base fee. + /// 7. _blobBaseFee L1 blob base fee. + /// 8. _hash L1 blockhash. + /// 9. _batcherHash Versioned hash to authenticate batcher by. + /// 10. _operatorFeeScalar Operator fee scalar. + /// 11. _operatorFeeConstant Operator fee constant. + /// 12. _daFootprintGasScalar DA footprint gas scalar. + function setL1BlockValuesJovian() public { + _setL1BlockValuesJovian(); + } + + /// @notice Updates the L1 block values for a Jovian upgraded chain. + /// Params are packed and passed in as raw msg.data instead of ABI to reduce calldata size. + /// Params are expected to be in the following order: + /// 1. _baseFeeScalar L1 base fee scalar + /// 2. _blobBaseFeeScalar L1 blob base fee scalar + /// 3. _sequenceNumber Number of L2 blocks since epoch start. + /// 4. _timestamp L1 timestamp. + /// 5. _number L1 blocknumber. + /// 6. _basefee L1 base fee. + /// 7. _blobBaseFee L1 blob base fee. + /// 8. _hash L1 blockhash. + /// 9. _batcherHash Versioned hash to authenticate batcher by. + /// 10. _operatorFeeScalar Operator fee scalar. + /// 11. _operatorFeeConstant Operator fee constant. + /// 12. _daFootprintGasScalar DA footprint gas scalar. + function _setL1BlockValuesJovian() internal { + _setL1BlockValuesIsthmus(); + assembly { + // daFootprintGasScalar (uint32) + sstore(daFootprintGasScalar.slot, shr(240, calldataload(176))) + } + } } diff --git a/packages/contracts-bedrock/src/libraries/Encoding.sol b/packages/contracts-bedrock/src/libraries/Encoding.sol index ec8c5623e7e75..170244cbdc30c 100644 --- a/packages/contracts-bedrock/src/libraries/Encoding.sol +++ b/packages/contracts-bedrock/src/libraries/Encoding.sol @@ -229,6 +229,55 @@ library Encoding { ); } + /// @notice Returns an appropriately encoded call to L1Block.setL1BlockValuesJovian + /// @param _baseFeeScalar L1 base fee Scalar + /// @param _blobBaseFeeScalar L1 blob base fee Scalar + /// @param _sequenceNumber Number of L2 blocks since epoch start. + /// @param _timestamp L1 timestamp. + /// @param _number L1 blocknumber. + /// @param _baseFee L1 base fee. + /// @param _blobBaseFee L1 blob base fee. + /// @param _hash L1 blockhash. + /// @param _batcherHash Versioned hash to authenticate batcher by. + /// @param _operatorFeeScalar Operator fee scalar. + /// @param _operatorFeeConstant Operator fee constant. + /// @param _daFootprintGasScalar DA Footprint scalar. + function encodeSetL1BlockValuesJovian( + uint32 _baseFeeScalar, + uint32 _blobBaseFeeScalar, + uint64 _sequenceNumber, + uint64 _timestamp, + uint64 _number, + uint256 _baseFee, + uint256 _blobBaseFee, + bytes32 _hash, + bytes32 _batcherHash, + uint32 _operatorFeeScalar, + uint64 _operatorFeeConstant, + uint16 _daFootprintGasScalar + ) + internal + pure + returns (bytes memory) + { + bytes4 functionSignature = bytes4(keccak256("setL1BlockValuesJovian()")); + return abi.encodePacked( + functionSignature, + _baseFeeScalar, + _blobBaseFeeScalar, + _sequenceNumber, + _timestamp, + _number, + _baseFee, + _blobBaseFee, + _hash, + _batcherHash, + _operatorFeeScalar, + _operatorFeeConstant, + _daFootprintGasScalar + ); + } + /// @notice Encodes a super root proof into the preimage of a Super Root. /// @param _superRootProof Super root proof to encode. /// @return Encoded super root proof. diff --git a/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol b/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol index 2a9e354536aea..34669f28e94f5 100644 --- a/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol +++ b/packages/contracts-bedrock/test/L1/OPContractsManager.t.sol @@ -267,7 +267,7 @@ contract OPContractsManager_Upgrade_Harness is CommonTest { // Make sure that the SystemConfig is upgraded to the right version. It must also have the // right l2ChainId and must be properly initialized. - assertEq(ISemver(address(systemConfig)).version(), "3.7.0"); + assertEq(ISemver(address(systemConfig)).version(), "3.8.0"); assertEq(impls.systemConfigImpl, EIP1967Helper.getImplementation(address(systemConfig))); assertEq(systemConfig.l2ChainId(), l2ChainId); DeployUtils.assertInitialized({ _contractAddress: address(systemConfig), _isProxy: true, _slot: 0, _offset: 0 }); diff --git a/packages/contracts-bedrock/test/L2/L1Block.t.sol b/packages/contracts-bedrock/test/L2/L1Block.t.sol index 7a276b94df5d6..f6d8fef99323d 100644 --- a/packages/contracts-bedrock/test/L2/L1Block.t.sol +++ b/packages/contracts-bedrock/test/L2/L1Block.t.sol @@ -315,3 +315,115 @@ contract L1Block_SetL1BlockValuesIsthmus_Test is L1Block_TestInit { assertEq(data, expReturn); } } + +/// @title L1Block_SetL1BlockValuesJovian_Test +/// @notice Tests the `setL1BlockValuesJovian` function of the `L1Block` contract. +contract L1Block_SetL1BlockValuesJovian_Test is L1Block_TestInit { + /// @notice Tests that setL1BlockValuesJovian updates the values appropriately. + function testFuzz_setL1BlockValuesJovian_succeeds( + uint32 baseFeeScalar, + uint32 blobBaseFeeScalar, + uint64 sequenceNumber, + uint64 timestamp, + uint64 number, + uint256 baseFee, + uint256 blobBaseFee, + bytes32 hash, + bytes32 batcherHash, + uint32 operatorFeeScalar, + uint64 operatorFeeConstant, + uint16 daFootprintGasScalar + ) + external + { + bytes memory functionCallDataPacked = Encoding.encodeSetL1BlockValuesJovian( + baseFeeScalar, + blobBaseFeeScalar, + sequenceNumber, + timestamp, + number, + baseFee, + blobBaseFee, + hash, + batcherHash, + operatorFeeScalar, + operatorFeeConstant, + daFootprintGasScalar + ); + + vm.prank(depositor); + (bool success,) = address(l1Block).call(functionCallDataPacked); + assertTrue(success, "Function call failed"); + + assertEq(l1Block.baseFeeScalar(), baseFeeScalar); + assertEq(l1Block.blobBaseFeeScalar(), blobBaseFeeScalar); + assertEq(l1Block.sequenceNumber(), sequenceNumber); + assertEq(l1Block.timestamp(), timestamp); + assertEq(l1Block.number(), number); + assertEq(l1Block.basefee(), baseFee); + assertEq(l1Block.blobBaseFee(), blobBaseFee); + assertEq(l1Block.hash(), hash); + assertEq(l1Block.batcherHash(), batcherHash); + assertEq(l1Block.operatorFeeScalar(), operatorFeeScalar); + assertEq(l1Block.operatorFeeConstant(), operatorFeeConstant); + assertEq(l1Block.daFootprintGasScalar(), daFootprintGasScalar); + + // ensure we didn't accidentally pollute the 128 bits of the sequencenum+scalars slot that + // should be empty + bytes32 scalarsSlot = vm.load(address(l1Block), bytes32(uint256(3))); + bytes32 mask128 = hex"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000"; + + assertEq(0, scalarsSlot & mask128); + + // ensure we didn't accidentally pollute the 128 bits of the number & timestamp slot that + // should be empty + bytes32 numberTimestampSlot = vm.load(address(l1Block), bytes32(uint256(0))); + assertEq(0, numberTimestampSlot & mask128); + } + + /// @notice Tests that `setL1BlockValuesJovian` succeeds if sender address is the depositor + function test_setL1BlockValuesJovian_isDepositor_succeeds() external { + bytes memory functionCallDataPacked = Encoding.encodeSetL1BlockValuesJovian( + type(uint32).max, + type(uint32).max, + type(uint64).max, + type(uint64).max, + type(uint64).max, + type(uint256).max, + type(uint256).max, + bytes32(type(uint256).max), + bytes32(type(uint256).max), + type(uint32).max, + type(uint64).max, + type(uint16).max + ); + + vm.prank(depositor); + (bool success,) = address(l1Block).call(functionCallDataPacked); + assertTrue(success, "function call failed"); + } + + /// @notice Tests that `setL1BlockValuesJovian` reverts if sender address is not the depositor + function test_setL1BlockValuesJovian_notDepositor_reverts() external { + bytes memory functionCallDataPacked = Encoding.encodeSetL1BlockValuesJovian( + type(uint32).max, + type(uint32).max, + type(uint64).max, + type(uint64).max, + type(uint64).max, + type(uint256).max, + type(uint256).max, + bytes32(type(uint256).max), + bytes32(type(uint256).max), + type(uint32).max, + type(uint64).max, + type(uint16).max + ); + + (bool success, bytes memory data) = address(l1Block).call(functionCallDataPacked); + assertTrue(!success, "function call should have failed"); + // make sure return value is the expected function selector for "NotDepositor()" + bytes memory expReturn = hex"3cc50b45"; + assertEq(data, expReturn); + } +}