diff --git a/devnet-sdk/testing/testlib/validators/validators_test.go b/devnet-sdk/testing/testlib/validators/validators_test.go index 17bc4829405ce..baaa9eb002217 100644 --- a/devnet-sdk/testing/testlib/validators/validators_test.go +++ b/devnet-sdk/testing/testlib/validators/validators_test.go @@ -52,7 +52,7 @@ func TestValidators(t *testing.T) { }, }, config: ¶ms.ChainConfig{ - Optimism: ¶ms.OptimismConfig{}, + FeeParams: ¶ms.FeeParamsConfig{}, IsthmusTime: Uint64Ptr(0), }, nodes: []system.Node{ @@ -97,7 +97,7 @@ func TestValidators(t *testing.T) { &mockL2Chain{ mockChain: mockChain{ config: ¶ms.ChainConfig{ - Optimism: ¶ms.OptimismConfig{}, + FeeParams: ¶ms.FeeParamsConfig{}, IsthmusTime: Uint64Ptr(50), }, nodes: []system.Node{ @@ -131,7 +131,7 @@ func TestValidators(t *testing.T) { &mockL2Chain{ mockChain: mockChain{ config: ¶ms.ChainConfig{ - Optimism: ¶ms.OptimismConfig{}, + FeeParams: ¶ms.FeeParamsConfig{}, IsthmusTime: Uint64Ptr(150), }, nodes: []system.Node{ @@ -159,7 +159,7 @@ func TestValidators(t *testing.T) { &mockL2Chain{ mockChain: mockChain{ config: ¶ms.ChainConfig{ - Optimism: ¶ms.OptimismConfig{}, + FeeParams: ¶ms.FeeParamsConfig{}, IsthmusTime: Uint64Ptr(150), // Activates after current timestamp }, nodes: []system.Node{ @@ -193,7 +193,7 @@ func TestValidators(t *testing.T) { &mockL2Chain{ mockChain: mockChain{ config: ¶ms.ChainConfig{ - Optimism: ¶ms.OptimismConfig{}, + FeeParams: ¶ms.FeeParamsConfig{}, IsthmusTime: Uint64Ptr(50), }, nodes: []system.Node{ diff --git a/go.mod b/go.mod index 599c284ef2413..283dc41746d0d 100644 --- a/go.mod +++ b/go.mod @@ -275,7 +275,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101503.4-rc.1 +replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v0.0.0-20250414141518-15b48c2a8165 //replace github.com/ethereum/go-ethereum => ../op-geth diff --git a/go.sum b/go.sum index cfd91aab99342..7f495004c1431 100644 --- a/go.sum +++ b/go.sum @@ -204,8 +204,8 @@ github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/u github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= 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.101503.4-rc.1 h1:ddcoFOmABL7bwz6b0pllSE4Org9iFTwMN6r1G6NRy3w= -github.com/ethereum-optimism/op-geth v1.101503.4-rc.1/go.mod h1:QUo3fn+45vWqJWzJW+rIzRHUV7NmhhHLPdI87mAn1M8= +github.com/ethereum-optimism/op-geth v0.0.0-20250414141518-15b48c2a8165 h1:02rQWFJ3B4KMk55s8ZSw0lKhw0KmrhGa9phJ+6py2xI= +github.com/ethereum-optimism/op-geth v0.0.0-20250414141518-15b48c2a8165/go.mod h1:QUo3fn+45vWqJWzJW+rIzRHUV7NmhhHLPdI87mAn1M8= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250314162817-2c60e5723c64 h1:teDhU4h4ryaE8rSBl+vJJiwKHjxdnnHPkKZ9iNr2R8k= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250314162817-2c60e5723c64/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= diff --git a/op-batcher/batcher/driver.go b/op-batcher/batcher/driver.go index ff62a84ba960b..fe759ac704da3 100644 --- a/op-batcher/batcher/driver.go +++ b/op-batcher/batcher/driver.go @@ -919,7 +919,7 @@ func (l *BatchSubmitter) blobTxCandidate(data txData) (*txmgr.TxCandidate, error "size", size, "last_size", lastSize, "num_blobs", len(blobs)) l.Metr.RecordBlobUsedBytes(lastSize) return &txmgr.TxCandidate{ - To: &l.RollupConfig.BatchInboxAddress, + To: &l.RollupConfig.Genesis.SystemConfig.BatchInboxAddr, Blobs: blobs, }, nil } @@ -927,7 +927,7 @@ func (l *BatchSubmitter) blobTxCandidate(data txData) (*txmgr.TxCandidate, error func (l *BatchSubmitter) calldataTxCandidate(data []byte) *txmgr.TxCandidate { l.Log.Info("Building Calldata transaction candidate", "size", len(data)) return &txmgr.TxCandidate{ - To: &l.RollupConfig.BatchInboxAddress, + To: &l.RollupConfig.Genesis.SystemConfig.BatchInboxAddr, TxData: data, } } diff --git a/op-batcher/batcher/driver_test.go b/op-batcher/batcher/driver_test.go index d2e7621858c00..e6ff0e6be2774 100644 --- a/op-batcher/batcher/driver_test.go +++ b/op-batcher/batcher/driver_test.go @@ -145,7 +145,7 @@ func TestBatchSubmitter_sendTx_FloorDataGas(t *testing.T) { }, } candidate := txmgr.TxCandidate{ - To: &bs.RollupConfig.BatchInboxAddress, + To: &bs.RollupConfig.Genesis.SystemConfig.BatchInboxAddr, TxData: txData.CallData(), } diff --git a/op-chain-ops/cmd/check-ecotone/main.go b/op-chain-ops/cmd/check-ecotone/main.go index 37e590c47fa11..eedc78461c5dd 100644 --- a/op-chain-ops/cmd/check-ecotone/main.go +++ b/op-chain-ops/cmd/check-ecotone/main.go @@ -529,7 +529,7 @@ func checkBlobTxDenial(ctx context.Context, env *actionEnv) error { return fmt.Errorf("failed to retrieve rollup config: %w", err) } txData := &types.BlobTx{ - To: rollupCfg.BatchInboxAddress, + To: rollupCfg.Genesis.SystemConfig.BatchInboxAddr, Data: nil, Gas: params.TxGas, // intrinsic gas only BlobHashes: blobHashes, diff --git a/op-chain-ops/genesis/config.go b/op-chain-ops/genesis/config.go index 3c906284486bd..c038a4f6655a3 100644 --- a/op-chain-ops/genesis/config.go +++ b/op-chain-ops/genesis/config.go @@ -1010,7 +1010,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *eth.BlockRef, l2GenesisBlockHa return nil, errors.New("SystemConfigProxy cannot be address(0)") } - chainOpConfig := ¶ms.OptimismConfig{ + chainFeeParams := ¶ms.FeeParamsConfig{ EIP1559Elasticity: d.EIP1559Elasticity, EIP1559Denominator: d.EIP1559Denominator, EIP1559DenominatorCanyon: &d.EIP1559DenominatorCanyon, @@ -1040,6 +1040,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *eth.BlockRef, l2GenesisBlockHa }, L2Time: l1StartBlock.Time, SystemConfig: d.GenesisSystemConfig(), + FeeParams: chainFeeParams, }, BlockTime: d.L2BlockTime, MaxSequencerDrift: d.MaxSequencerDrift, @@ -1047,7 +1048,6 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *eth.BlockRef, l2GenesisBlockHa ChannelTimeoutBedrock: d.ChannelTimeoutBedrock, L1ChainID: new(big.Int).SetUint64(d.L1ChainID), L2ChainID: new(big.Int).SetUint64(d.L2ChainID), - BatchInboxAddress: d.BatchInboxAddress, DepositContractAddress: d.OptimismPortalProxy, L1SystemConfigAddress: d.SystemConfigProxy, RegolithTime: d.RegolithTime(l1StartTime), @@ -1063,7 +1063,6 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *eth.BlockRef, l2GenesisBlockHa InteropTime: d.InteropTime(l1StartTime), ProtocolVersionsAddress: d.ProtocolVersionsProxy, AltDAConfig: altDA, - ChainOpConfig: chainOpConfig, }, nil } @@ -1072,6 +1071,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *eth.BlockRef, l2GenesisBlockHa func (d *DeployConfig) GenesisSystemConfig() eth.SystemConfig { return eth.SystemConfig{ BatcherAddr: d.BatchSenderAddress, + BatchInboxAddr: d.BatchInboxAddress, Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(d.GasPriceOracleOverhead))), Scalar: d.FeeScalar(), GasLimit: uint64(d.L2GenesisBlockGasLimit), diff --git a/op-chain-ops/genesis/genesis.go b/op-chain-ops/genesis/genesis.go index fa55eda6cf21a..d4e78a93eaeb4 100644 --- a/op-chain-ops/genesis/genesis.go +++ b/op-chain-ops/genesis/genesis.go @@ -75,7 +75,7 @@ func NewL2Genesis(config *DeployConfig, l1StartHeader *eth.BlockRef) (*core.Gene JovianTime: config.JovianTime(l1StartTime), PragueTime: config.IsthmusTime(l1StartTime), InteropTime: config.InteropTime(l1StartTime), - Optimism: ¶ms.OptimismConfig{ + FeeParams: ¶ms.FeeParamsConfig{ EIP1559Denominator: eip1559Denom, EIP1559Elasticity: eip1559Elasticity, EIP1559DenominatorCanyon: &eip1559DenomCanyon, diff --git a/op-chain-ops/script/script.go b/op-chain-ops/script/script.go index f98884314fa81..d7b185d9d0913 100644 --- a/op-chain-ops/script/script.go +++ b/op-chain-ops/script/script.go @@ -229,7 +229,7 @@ func NewHost( HoloceneTime: nil, JovianTime: nil, InteropTime: nil, - Optimism: nil, + FeeParams: nil, } // Create an in-memory database, to host our temporary script state changes diff --git a/op-conductor/conductor/service_test.go b/op-conductor/conductor/service_test.go index 704b52cc24d1b..f51a817ee5a87 100644 --- a/op-conductor/conductor/service_test.go +++ b/op-conductor/conductor/service_test.go @@ -55,10 +55,11 @@ func mockConfig(t *testing.T) Config { }, L2Time: now, SystemConfig: eth.SystemConfig{ - BatcherAddr: [20]byte{1}, - Overhead: [32]byte{1}, - Scalar: [32]byte{1}, - GasLimit: 30000000, + BatcherAddr: [20]byte{1}, + BatchInboxAddr: [20]byte{1, 2}, + Overhead: [32]byte{1}, + Scalar: [32]byte{1}, + GasLimit: 30000000, }, }, BlockTime: 2, @@ -69,7 +70,6 @@ func mockConfig(t *testing.T) Config { L2ChainID: big.NewInt(2), RegolithTime: &now, CanyonTime: &now, - BatchInboxAddress: [20]byte{1, 2}, DepositContractAddress: [20]byte{2, 3}, L1SystemConfigAddress: [20]byte{3, 4}, ProtocolVersionsAddress: [20]byte{4, 5}, diff --git a/op-e2e/actions/helpers/l2_batcher.go b/op-e2e/actions/helpers/l2_batcher.go index 6ca2924aab4cf..6f96aec94dfd6 100644 --- a/op-e2e/actions/helpers/l2_batcher.go +++ b/op-e2e/actions/helpers/l2_batcher.go @@ -356,7 +356,7 @@ func (s *L2Batcher) ActL2BatchSubmitRaw(t Testing, payload []byte, txOpts ...fun rawTx := &types.DynamicFeeTx{ ChainID: s.rollupCfg.L1ChainID, Nonce: nonce, - To: &s.rollupCfg.BatchInboxAddress, + To: &s.rollupCfg.Genesis.SystemConfig.BatchInboxAddr, GasTipCap: gasTipCap, GasFeeCap: gasFeeCap, Data: payload, @@ -381,7 +381,7 @@ func (s *L2Batcher) ActL2BatchSubmitRaw(t Testing, payload []byte, txOpts ...fun blobFeeCap = uint256.NewInt(params.GWei) } txData = &types.BlobTx{ - To: s.rollupCfg.BatchInboxAddress, + To: s.rollupCfg.Genesis.SystemConfig.BatchInboxAddr, Data: nil, Gas: params.TxGas, // intrinsic gas only BlobHashes: blobHashes, @@ -465,7 +465,7 @@ func (s *L2Batcher) ActL2BatchSubmitMultiBlob(t Testing, numBlobs int) { blobFeeCap = uint256.NewInt(params.GWei) } txData := &types.BlobTx{ - To: s.rollupCfg.BatchInboxAddress, + To: s.rollupCfg.Genesis.SystemConfig.BatchInboxAddr, Data: nil, Gas: params.TxGas, // intrinsic gas only BlobHashes: blobHashes, @@ -561,7 +561,7 @@ func (s *L2Batcher) ActSubmitSetCodeTx(t Testing) { nonce, err := s.l1.PendingNonceAt(t.Ctx(), s.BatcherAddr) require.NoError(t, err, "need batcher nonce") - tx, err := PrepareSignedSetCodeTx(chainId, s.l2BatcherCfg.BatcherKey, s.l1Signer, nonce, s.rollupCfg.BatchInboxAddress, s.ReadNextOutputFrame(t)) + tx, err := PrepareSignedSetCodeTx(chainId, s.l2BatcherCfg.BatcherKey, s.l1Signer, nonce, s.rollupCfg.Genesis.SystemConfig.BatchInboxAddr, s.ReadNextOutputFrame(t)) require.NoError(t, err, "need to sign tx") t.Log("submitting EIP 7702 Set Code Batcher Transaction...") diff --git a/op-e2e/e2eutils/addresses.go b/op-e2e/e2eutils/addresses.go index 46e639425a22f..7f3afae4ea374 100644 --- a/op-e2e/e2eutils/addresses.go +++ b/op-e2e/e2eutils/addresses.go @@ -43,7 +43,7 @@ func CollectAddresses(sd *SetupData, dp *DeployParams) (out []common.Address) { sd.L2Cfg.Coinbase, dp.Addresses.SequencerP2P, predeploys.SequencerFeeVaultAddr, - sd.RollupCfg.BatchInboxAddress, + sd.RollupCfg.Genesis.SystemConfig.BatchInboxAddr, sd.RollupCfg.Genesis.SystemConfig.BatcherAddr, sd.RollupCfg.DepositContractAddress, ) diff --git a/op-e2e/e2eutils/batcher/batcher.go b/op-e2e/e2eutils/batcher/batcher.go index 8f3e273dfbeb9..380b75691d5c9 100644 --- a/op-e2e/e2eutils/batcher/batcher.go +++ b/op-e2e/e2eutils/batcher/batcher.go @@ -45,7 +45,7 @@ func (h *Helper) SendLargeInvalidBatch(ctx context.Context) { GasTipCap: big.NewInt(1 * params.GWei), GasFeeCap: big.NewInt(10 * params.GWei), Gas: 5_000_000, - To: &h.rollupCfg.BatchInboxAddress, + To: &h.rollupCfg.Genesis.SystemConfig.BatchInboxAddr, Value: big.NewInt(0), Data: data, }) diff --git a/op-e2e/e2eutils/setup.go b/op-e2e/e2eutils/setup.go index b999fb3ea4d0c..c29a1c2851d05 100644 --- a/op-e2e/e2eutils/setup.go +++ b/op-e2e/e2eutils/setup.go @@ -191,6 +191,11 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) * }, L2Time: uint64(deployConf.L1GenesisBlockTimestamp), SystemConfig: SystemConfigFromDeployConfig(deployConf), + FeeParams: ¶ms.FeeParamsConfig{ + EIP1559Elasticity: deployConf.EIP1559Elasticity, + EIP1559Denominator: deployConf.EIP1559Denominator, + EIP1559DenominatorCanyon: &deployConf.EIP1559DenominatorCanyon, + }, }, BlockTime: deployConf.L2BlockTime, MaxSequencerDrift: deployConf.MaxSequencerDrift, @@ -198,7 +203,6 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) * ChannelTimeoutBedrock: deployConf.ChannelTimeoutBedrock, L1ChainID: new(big.Int).SetUint64(deployConf.L1ChainID), L2ChainID: new(big.Int).SetUint64(deployConf.L2ChainID), - BatchInboxAddress: deployConf.BatchInboxAddress, DepositContractAddress: deployConf.OptimismPortalProxy, L1SystemConfigAddress: deployConf.SystemConfigProxy, RegolithTime: deployConf.RegolithTime(uint64(deployConf.L1GenesisBlockTimestamp)), @@ -213,11 +217,6 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) * JovianTime: deployConf.JovianTime(uint64(deployConf.L1GenesisBlockTimestamp)), InteropTime: deployConf.InteropTime(uint64(deployConf.L1GenesisBlockTimestamp)), AltDAConfig: pcfg, - ChainOpConfig: ¶ms.OptimismConfig{ - EIP1559Elasticity: deployConf.EIP1559Elasticity, - EIP1559Denominator: deployConf.EIP1559Denominator, - EIP1559DenominatorCanyon: &deployConf.EIP1559DenominatorCanyon, - }, } require.NoError(t, rollupCfg.Check()) diff --git a/op-e2e/opgeth/fastlz_test.go b/op-e2e/opgeth/fastlz_test.go index 5b03ca38eca3c..92e438a226fb7 100644 --- a/op-e2e/opgeth/fastlz_test.go +++ b/op-e2e/opgeth/fastlz_test.go @@ -137,7 +137,7 @@ func FuzzFjordCostFunction(f *testing.F) { zeroTime := uint64(0) // create a config where ecotone/fjord upgrades are active config := ¶ms.ChainConfig{ - Optimism: params.OptimismTestConfig.Optimism, + FeeParams: params.OptimismTestConfig.FeeParams, RegolithTime: &zeroTime, EcotoneTime: &zeroTime, FjordTime: &zeroTime, diff --git a/op-e2e/system/e2esys/setup.go b/op-e2e/system/e2esys/setup.go index dcc4429b032cc..9618a557991c6 100644 --- a/op-e2e/system/e2esys/setup.go +++ b/op-e2e/system/e2esys/setup.go @@ -684,7 +684,12 @@ func (cfg SystemConfig) Start(t *testing.T, startOpts ...StartOption) (*System, Hash: l2Genesis.ToBlock().Hash(), Number: 0, }, - L2Time: uint64(cfg.DeployConfig.L1GenesisBlockTimestamp), + L2Time: uint64(cfg.DeployConfig.L1GenesisBlockTimestamp), + FeeParams: ¶ms.FeeParamsConfig{ + EIP1559Elasticity: cfg.DeployConfig.EIP1559Elasticity, + EIP1559Denominator: cfg.DeployConfig.EIP1559Denominator, + EIP1559DenominatorCanyon: &cfg.DeployConfig.EIP1559DenominatorCanyon, + }, SystemConfig: e2eutils.SystemConfigFromDeployConfig(cfg.DeployConfig), }, BlockTime: cfg.DeployConfig.L2BlockTime, @@ -693,7 +698,6 @@ func (cfg SystemConfig) Start(t *testing.T, startOpts ...StartOption) (*System, ChannelTimeoutBedrock: cfg.DeployConfig.ChannelTimeoutBedrock, L1ChainID: cfg.L1ChainIDBig(), L2ChainID: cfg.L2ChainIDBig(), - BatchInboxAddress: cfg.DeployConfig.BatchInboxAddress, DepositContractAddress: cfg.DeployConfig.OptimismPortalProxy, L1SystemConfigAddress: cfg.DeployConfig.SystemConfigProxy, RegolithTime: cfg.DeployConfig.RegolithTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), @@ -709,11 +713,6 @@ func (cfg SystemConfig) Start(t *testing.T, startOpts ...StartOption) (*System, InteropTime: cfg.DeployConfig.InteropTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), ProtocolVersionsAddress: cfg.L1Deployments.ProtocolVersionsProxy, AltDAConfig: rollupAltDAConfig, - ChainOpConfig: ¶ms.OptimismConfig{ - EIP1559Elasticity: cfg.DeployConfig.EIP1559Elasticity, - EIP1559Denominator: cfg.DeployConfig.EIP1559Denominator, - EIP1559DenominatorCanyon: &cfg.DeployConfig.EIP1559DenominatorCanyon, - }, } } defaultConfig := makeRollupConfig() diff --git a/op-node/chaincfg/chains_test.go b/op-node/chaincfg/chains_test.go index fa157daa9bea8..a1e77d8df3c3e 100644 --- a/op-node/chaincfg/chains_test.go +++ b/op-node/chaincfg/chains_test.go @@ -36,7 +36,7 @@ func TestGetRollupConfig(t *testing.T) { } } -var defaultOpConfig = ¶ms.OptimismConfig{ +var defaultFeeParams = ¶ms.FeeParamsConfig{ EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: u64Ptr(250), @@ -52,12 +52,14 @@ var mainnetCfg = rollup.Config{ Hash: common.HexToHash("0xdbf6a80fef073de06add9b0d14026d6e5a86c85f6d102c36d3d8e9cf89c2afd3"), Number: 105235063, }, - L2Time: 1686068903, + L2Time: 1686068903, + FeeParams: defaultFeeParams, SystemConfig: eth.SystemConfig{ - BatcherAddr: common.HexToAddress("0x6887246668a3b87f54deb3b94ba47a6f63f32985"), - Overhead: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000000bc")), - Scalar: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000a6fe0")), - GasLimit: 30_000_000, + BatcherAddr: common.HexToAddress("0x6887246668a3b87f54deb3b94ba47a6f63f32985"), + BatchInboxAddr: common.HexToAddress("0xff00000000000000000000000000000000000010"), + Overhead: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000000bc")), + Scalar: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000a6fe0")), + GasLimit: 30_000_000, }, }, BlockTime: 2, @@ -66,7 +68,6 @@ var mainnetCfg = rollup.Config{ ChannelTimeoutBedrock: 300, L1ChainID: big.NewInt(1), L2ChainID: big.NewInt(10), - BatchInboxAddress: common.HexToAddress("0xff00000000000000000000000000000000000010"), DepositContractAddress: common.HexToAddress("0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"), L1SystemConfigAddress: common.HexToAddress("0x229047fed2591dbec1eF1118d64F7aF3dB9EB290"), RegolithTime: u64Ptr(0), @@ -78,7 +79,6 @@ var mainnetCfg = rollup.Config{ HoloceneTime: u64Ptr(1736445601), IsthmusTime: u64Ptr(1746806401), ProtocolVersionsAddress: common.HexToAddress("0x8062AbC286f5e7D9428a0Ccb9AbD71e50d93b935"), - ChainOpConfig: defaultOpConfig, } var sepoliaCfg = rollup.Config{ @@ -91,12 +91,14 @@ var sepoliaCfg = rollup.Config{ Hash: common.HexToHash("0x102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d"), Number: 0, }, - L2Time: 1691802540, + L2Time: 1691802540, + FeeParams: defaultFeeParams, SystemConfig: eth.SystemConfig{ - BatcherAddr: common.HexToAddress("0x8F23BB38F531600e5d8FDDaAEC41F13FaB46E98c"), - Overhead: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000000bc")), - Scalar: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000a6fe0")), - GasLimit: 30000000, + BatcherAddr: common.HexToAddress("0x8F23BB38F531600e5d8FDDaAEC41F13FaB46E98c"), + BatchInboxAddr: common.HexToAddress("0xff00000000000000000000000000000011155420"), + Overhead: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000000bc")), + Scalar: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000a6fe0")), + GasLimit: 30000000, }, }, BlockTime: 2, @@ -105,7 +107,6 @@ var sepoliaCfg = rollup.Config{ ChannelTimeoutBedrock: 300, L1ChainID: big.NewInt(11155111), L2ChainID: big.NewInt(11155420), - BatchInboxAddress: common.HexToAddress("0xff00000000000000000000000000000011155420"), DepositContractAddress: common.HexToAddress("0x16fc5058f25648194471939df75cf27a2fdc48bc"), L1SystemConfigAddress: common.HexToAddress("0x034edd2a225f7f429a63e0f1d2084b9e0a93b538"), RegolithTime: u64Ptr(0), @@ -118,7 +119,6 @@ var sepoliaCfg = rollup.Config{ PectraBlobScheduleTime: u64Ptr(1742486400), IsthmusTime: u64Ptr(1744905600), ProtocolVersionsAddress: common.HexToAddress("0x79ADD5713B383DAa0a138d3C4780C7A1804a8090"), - ChainOpConfig: defaultOpConfig, } var sepoliaDev0Cfg = rollup.Config{ @@ -131,12 +131,14 @@ var sepoliaDev0Cfg = rollup.Config{ Hash: common.HexToHash("0x027ae1f4f9a441f9c8a01828f3b6d05803a0f524c07e09263264a38b755f804b"), Number: 0, }, - L2Time: 1706484048, + L2Time: 1706484048, + FeeParams: defaultFeeParams, SystemConfig: eth.SystemConfig{ - BatcherAddr: common.HexToAddress("0x19cc7073150d9f5888f09e0e9016d2a39667df14"), - Overhead: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000000bc")), - Scalar: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000a6fe0")), - GasLimit: 30000000, + BatcherAddr: common.HexToAddress("0x19cc7073150d9f5888f09e0e9016d2a39667df14"), + BatchInboxAddr: common.HexToAddress("0xff00000000000000000000000000000011155421"), + Overhead: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000000bc")), + Scalar: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000a6fe0")), + GasLimit: 30000000, }, }, BlockTime: 2, @@ -145,7 +147,6 @@ var sepoliaDev0Cfg = rollup.Config{ ChannelTimeoutBedrock: 300, L1ChainID: big.NewInt(11155111), L2ChainID: big.NewInt(11155421), - BatchInboxAddress: common.HexToAddress("0xff00000000000000000000000000000011155421"), DepositContractAddress: common.HexToAddress("0x76114bd29dFcC7a9892240D317E6c7C2A281Ffc6"), L1SystemConfigAddress: common.HexToAddress("0xa6b72407e2dc9EBF84b839B69A24C88929cf20F7"), RegolithTime: u64Ptr(0), @@ -158,7 +159,6 @@ var sepoliaDev0Cfg = rollup.Config{ PectraBlobScheduleTime: u64Ptr(1741687200), IsthmusTime: u64Ptr(1744300800), ProtocolVersionsAddress: common.HexToAddress("0x252CbE9517F731C618961D890D534183822dcC8d"), - ChainOpConfig: defaultOpConfig, } func u64Ptr(v uint64) *uint64 { diff --git a/op-node/cmd/batch_decoder/main.go b/op-node/cmd/batch_decoder/main.go index f1178f4369ffc..dfc497c6f509f 100644 --- a/op-node/cmd/batch_decoder/main.go +++ b/op-node/cmd/batch_decoder/main.go @@ -169,8 +169,8 @@ func main() { L2BlockTime = rollupCfg.BlockTime fmt.Printf("L2BlockTime overridden: %v\n", L2BlockTime) } - if BatchInboxAddress != rollupCfg.BatchInboxAddress { - BatchInboxAddress = rollupCfg.BatchInboxAddress + if BatchInboxAddress != rollupCfg.Genesis.SystemConfig.BatchInboxAddr { + BatchInboxAddress = rollupCfg.Genesis.SystemConfig.BatchInboxAddr fmt.Printf("BatchInboxAddress overridden: %v\n", BatchInboxAddress) } } diff --git a/op-node/node/node.go b/op-node/node/node.go index e4df4b729e7ae..08d3e7fbfac3a 100644 --- a/op-node/node/node.go +++ b/op-node/node/node.go @@ -435,7 +435,7 @@ func (n *OpNode) initL2(ctx context.Context, cfg *Config) error { n.safeDB = safedb.Disabled } - if cfg.Rollup.ChainOpConfig == nil { + if cfg.Rollup.Genesis.FeeParams == nil { return fmt.Errorf("cfg.Rollup.ChainOpConfig is nil. Please see https://github.com/ethereum-optimism/optimism/releases/tag/op-node/v1.11.0: %w", err) } diff --git a/op-node/rollup/attributes/engine_consolidate.go b/op-node/rollup/attributes/engine_consolidate.go index 19a2b2aea8fe5..95bd9fefddb40 100644 --- a/op-node/rollup/attributes/engine_consolidate.go +++ b/op-node/rollup/attributes/engine_consolidate.go @@ -75,7 +75,7 @@ func AttributesMatchBlock(rollupCfg *rollup.Config, attrs *eth.PayloadAttributes if attrs.SuggestedFeeRecipient != block.FeeRecipient { return fmt.Errorf("fee recipient data does not match, expected %s but got %s", block.FeeRecipient, attrs.SuggestedFeeRecipient) } - if err := checkEIP1559ParamsMatch(rollupCfg.ChainOpConfig, attrs.EIP1559Params, block.ExtraData); err != nil { + if err := checkEIP1559ParamsMatch(rollupCfg.Genesis.FeeParams, attrs.EIP1559Params, block.ExtraData); err != nil { return err } @@ -97,7 +97,7 @@ func checkParentBeaconBlockRootMatch(attrRoot, blockRoot *common.Hash) error { return nil } -func checkEIP1559ParamsMatch(opCfg *params.OptimismConfig, attrParams *eth.Bytes8, blockExtraData []byte) error { +func checkEIP1559ParamsMatch(opCfg *params.FeeParamsConfig, attrParams *eth.Bytes8, blockExtraData []byte) error { // Note that we can assume that the attributes' eip1559params are non-nil iff Holocene is active // according to the local rollup config. if attrParams != nil { diff --git a/op-node/rollup/attributes/engine_consolidate_test.go b/op-node/rollup/attributes/engine_consolidate_test.go index ad1af4ce65b22..de751ad9dd2e2 100644 --- a/op-node/rollup/attributes/engine_consolidate_test.go +++ b/op-node/rollup/attributes/engine_consolidate_test.go @@ -20,7 +20,7 @@ import ( "github.com/ethereum-optimism/optimism/op-service/testutils" ) -var defaultOpConfig = ¶ms.OptimismConfig{ +var defaultOpConfig = ¶ms.FeeParamsConfig{ EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: ptr(uint64(250)), @@ -188,8 +188,8 @@ func TestAttributesMatch(t *testing.T) { pastTime := uint64(0) futureTime := uint64(100) - rollupCfgPreCanyon := &rollup.Config{CanyonTime: &futureTime, ChainOpConfig: defaultOpConfig} - rollupCfgPreIsthmus := &rollup.Config{CanyonTime: &pastTime, IsthmusTime: &futureTime, ChainOpConfig: defaultOpConfig} + rollupCfgPreCanyon := &rollup.Config{CanyonTime: &futureTime, Genesis: rollup.Genesis{FeeParams: defaultOpConfig}} + rollupCfgPreIsthmus := &rollup.Config{CanyonTime: &pastTime, IsthmusTime: &futureTime, Genesis: rollup.Genesis{FeeParams: defaultOpConfig}} tests := []struct { args matchArgs @@ -324,9 +324,9 @@ func TestWithdrawalsMatch(t *testing.T) { emptyWithdrawals := make(types.Withdrawals, 0) - rollupCfgPreCanyonChecks := &rollup.Config{CanyonTime: &canyonTimeInFuture, ChainOpConfig: defaultOpConfig} - rollupCfgPreIsthmusChecks := &rollup.Config{CanyonTime: &canyonTimeInPast, IsthmusTime: &isthmusTimeInFuture, ChainOpConfig: defaultOpConfig} - rollupCfgPostIsthmusChecks := &rollup.Config{CanyonTime: &canyonTimeInPast, IsthmusTime: &isthmusTimeInPast, ChainOpConfig: defaultOpConfig} + rollupCfgPreCanyonChecks := &rollup.Config{CanyonTime: &canyonTimeInFuture, Genesis: rollup.Genesis{FeeParams: defaultOpConfig}} + rollupCfgPreIsthmusChecks := &rollup.Config{CanyonTime: &canyonTimeInPast, IsthmusTime: &isthmusTimeInFuture, Genesis: rollup.Genesis{FeeParams: defaultOpConfig}} + rollupCfgPostIsthmusChecks := &rollup.Config{CanyonTime: &canyonTimeInPast, IsthmusTime: &isthmusTimeInPast, Genesis: rollup.Genesis{FeeParams: defaultOpConfig}} tests := []struct { cfg *rollup.Config diff --git a/op-node/rollup/chain_spec_test.go b/op-node/rollup/chain_spec_test.go index 97c88e6ced4d1..7826068cfbf10 100644 --- a/op-node/rollup/chain_spec_test.go +++ b/op-node/rollup/chain_spec_test.go @@ -27,10 +27,11 @@ var testConfig = Config{ }, L2Time: 0, SystemConfig: eth.SystemConfig{ - BatcherAddr: common.HexToAddress("0x6887246668a3b87f54deb3b94ba47a6f63f32985"), - Overhead: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000000bc")), - Scalar: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000a6fe0")), - GasLimit: 30_000_000, + BatcherAddr: common.HexToAddress("0x6887246668a3b87f54deb3b94ba47a6f63f32985"), + BatchInboxAddr: common.HexToAddress("0xff00000000000000000000000000000000000010"), + Overhead: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000000bc")), + Scalar: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000a6fe0")), + GasLimit: 30_000_000, }, }, BlockTime: 2, @@ -49,7 +50,6 @@ var testConfig = Config{ IsthmusTime: u64ptr(80), JovianTime: u64ptr(90), InteropTime: nil, - BatchInboxAddress: common.HexToAddress("0xff00000000000000000000000000000000000010"), DepositContractAddress: common.HexToAddress("0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"), L1SystemConfigAddress: common.HexToAddress("0x229047fed2591dbec1eF1118d64F7aF3dB9EB290"), ProtocolVersionsAddress: common.HexToAddress("0x8062AbC286f5e7D9428a0Ccb9AbD71e50d93b935"), diff --git a/op-node/rollup/derive/altda_data_source_test.go b/op-node/rollup/derive/altda_data_source_test.go index 5ce4a4447c503..9e3f60e9fa44e 100644 --- a/op-node/rollup/derive/altda_data_source_test.go +++ b/op-node/rollup/derive/altda_data_source_test.go @@ -84,10 +84,12 @@ func TestAltDADataSource(t *testing.T) { L1: refA.ID(), L2: refA0.ID(), L2Time: refA0.Time, + SystemConfig: eth.SystemConfig{ + BatchInboxAddr: batcherInbox, + }, }, - BlockTime: 1, - SeqWindowSize: 20, - BatchInboxAddress: batcherInbox, + BlockTime: 1, + SeqWindowSize: 20, AltDAConfig: &rollup.AltDAConfig{ DAChallengeWindow: pcfg.ChallengeWindow, DAResolveWindow: pcfg.ResolveWindow, @@ -327,10 +329,12 @@ func TestAltDADataSourceStall(t *testing.T) { L1: refA.ID(), L2: refA0.ID(), L2Time: refA0.Time, + SystemConfig: eth.SystemConfig{ + BatchInboxAddr: batcherInbox, + }, }, - BlockTime: 1, - SeqWindowSize: 20, - BatchInboxAddress: batcherInbox, + BlockTime: 1, + SeqWindowSize: 20, AltDAConfig: &rollup.AltDAConfig{ DAChallengeWindow: pcfg.ChallengeWindow, DAResolveWindow: pcfg.ResolveWindow, @@ -449,10 +453,12 @@ func TestAltDADataSourceInvalidData(t *testing.T) { L1: refA.ID(), L2: refA0.ID(), L2Time: refA0.Time, + SystemConfig: eth.SystemConfig{ + BatchInboxAddr: batcherInbox, + }, }, - BlockTime: 1, - SeqWindowSize: 20, - BatchInboxAddress: batcherInbox, + BlockTime: 1, + SeqWindowSize: 20, AltDAConfig: &rollup.AltDAConfig{ DAChallengeWindow: pcfg.ChallengeWindow, DAResolveWindow: pcfg.ResolveWindow, diff --git a/op-node/rollup/derive/calldata_source_test.go b/op-node/rollup/derive/calldata_source_test.go index 01b2616cca3fa..6b8776e902568 100644 --- a/op-node/rollup/derive/calldata_source_test.go +++ b/op-node/rollup/derive/calldata_source_test.go @@ -56,8 +56,12 @@ func TestDataFromEVMTransactions(t *testing.T) { inboxPriv := testutils.RandomKey() batcherPriv := testutils.RandomKey() cfg := &rollup.Config{ - L1ChainID: big.NewInt(100), - BatchInboxAddress: crypto.PubkeyToAddress(inboxPriv.PublicKey), + L1ChainID: big.NewInt(100), + Genesis: rollup.Genesis{ + SystemConfig: eth.SystemConfig{ + BatchInboxAddr: crypto.PubkeyToAddress(inboxPriv.PublicKey), + }, + }, } batcherAddr := crypto.PubkeyToAddress(batcherPriv.PublicKey) @@ -67,17 +71,17 @@ func TestDataFromEVMTransactions(t *testing.T) { testCases := []calldataTest{ { name: "simple", - txs: []testTx{{to: &cfg.BatchInboxAddress, dataLen: 1234, author: batcherPriv, good: true}}, + txs: []testTx{{to: &cfg.Genesis.SystemConfig.BatchInboxAddr, dataLen: 1234, author: batcherPriv, good: true}}, }, { name: "other inbox", txs: []testTx{{to: &altInbox, dataLen: 1234, author: batcherPriv, good: false}}}, { name: "other author", - txs: []testTx{{to: &cfg.BatchInboxAddress, dataLen: 1234, author: altAuthor, good: false}}}, + txs: []testTx{{to: &cfg.Genesis.SystemConfig.BatchInboxAddr, dataLen: 1234, author: altAuthor, good: false}}}, { name: "inbox is author", - txs: []testTx{{to: &cfg.BatchInboxAddress, dataLen: 1234, author: inboxPriv, good: false}}}, + txs: []testTx{{to: &cfg.Genesis.SystemConfig.BatchInboxAddr, dataLen: 1234, author: inboxPriv, good: false}}}, { name: "author is inbox", txs: []testTx{{to: &batcherAddr, dataLen: 1234, author: batcherPriv, good: false}}}, @@ -89,19 +93,19 @@ func TestDataFromEVMTransactions(t *testing.T) { txs: []testTx{{to: nil, dataLen: 1234, author: batcherPriv, good: false}}}, { name: "empty tx", - txs: []testTx{{to: &cfg.BatchInboxAddress, dataLen: 0, author: batcherPriv, good: true}}}, + txs: []testTx{{to: &cfg.Genesis.SystemConfig.BatchInboxAddr, dataLen: 0, author: batcherPriv, good: true}}}, { name: "value tx", - txs: []testTx{{to: &cfg.BatchInboxAddress, dataLen: 1234, value: 42, author: batcherPriv, good: true}}}, + txs: []testTx{{to: &cfg.Genesis.SystemConfig.BatchInboxAddr, dataLen: 1234, value: 42, author: batcherPriv, good: true}}}, { name: "empty block", txs: []testTx{}, }, { name: "mixed txs", txs: []testTx{ - {to: &cfg.BatchInboxAddress, dataLen: 1234, value: 42, author: batcherPriv, good: true}, - {to: &cfg.BatchInboxAddress, dataLen: 3333, value: 32, author: altAuthor, good: false}, - {to: &cfg.BatchInboxAddress, dataLen: 2000, value: 22, author: batcherPriv, good: true}, + {to: &cfg.Genesis.SystemConfig.BatchInboxAddr, dataLen: 1234, value: 42, author: batcherPriv, good: true}, + {to: &cfg.Genesis.SystemConfig.BatchInboxAddr, dataLen: 3333, value: 32, author: altAuthor, good: false}, + {to: &cfg.Genesis.SystemConfig.BatchInboxAddr, dataLen: 2000, value: 22, author: batcherPriv, good: true}, {to: &altInbox, dataLen: 2020, value: 12, author: batcherPriv, good: false}, }, }, @@ -121,7 +125,7 @@ func TestDataFromEVMTransactions(t *testing.T) { } } - out := DataFromEVMTransactions(DataSourceConfig{cfg.L1Signer(), cfg.BatchInboxAddress, false}, batcherAddr, txs, testlog.Logger(t, log.LevelCrit)) + out := DataFromEVMTransactions(DataSourceConfig{cfg.L1Signer(), cfg.Genesis.SystemConfig.BatchInboxAddr, false}, batcherAddr, txs, testlog.Logger(t, log.LevelCrit)) require.ElementsMatch(t, expectedData, out) } diff --git a/op-node/rollup/derive/data_source.go b/op-node/rollup/derive/data_source.go index dfeda599501a1..351ed885def61 100644 --- a/op-node/rollup/derive/data_source.go +++ b/op-node/rollup/derive/data_source.go @@ -50,7 +50,7 @@ type DataSourceFactory struct { func NewDataSourceFactory(log log.Logger, cfg *rollup.Config, fetcher L1Fetcher, blobsFetcher L1BlobsFetcher, altDAFetcher AltDAInputFetcher) *DataSourceFactory { config := DataSourceConfig{ l1Signer: cfg.L1Signer(), - batchInboxAddress: cfg.BatchInboxAddress, + batchInboxAddress: cfg.Genesis.SystemConfig.BatchInboxAddr, altDAEnabled: cfg.AltDAEnabled(), } return &DataSourceFactory{ diff --git a/op-node/rollup/derive/payload_util.go b/op-node/rollup/derive/payload_util.go index eb02d1afa4565..431b7a0ec468f 100644 --- a/op-node/rollup/derive/payload_util.go +++ b/op-node/rollup/derive/payload_util.go @@ -85,10 +85,11 @@ func PayloadToSystemConfig(rollupCfg *rollup.Config, payload *eth.ExecutionPaylo binary.BigEndian.PutUint32(info.L1FeeScalar[28:32], info.BaseFeeScalar) } r := eth.SystemConfig{ - BatcherAddr: info.BatcherAddr, - Overhead: info.L1FeeOverhead, - Scalar: info.L1FeeScalar, - GasLimit: uint64(payload.GasLimit), + BatcherAddr: info.BatcherAddr, + BatchInboxAddr: rollupCfg.Genesis.SystemConfig.BatchInboxAddr, + Overhead: info.L1FeeOverhead, + Scalar: info.L1FeeScalar, + GasLimit: uint64(payload.GasLimit), } if rollupCfg.IsHolocene(uint64(payload.Timestamp)) { if err := eip1559.ValidateHoloceneExtraData(payload.ExtraData); err != nil { diff --git a/op-node/rollup/superchain.go b/op-node/rollup/superchain.go index 7bb93b19b6aaf..193b8fdc56745 100644 --- a/op-node/rollup/superchain.go +++ b/op-node/rollup/superchain.go @@ -24,10 +24,10 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { if err != nil { return nil, fmt.Errorf("unable to retrieve chain %d config: %w", chainID, err) } - chOpConfig := ¶ms.OptimismConfig{ - EIP1559Elasticity: chConfig.Optimism.EIP1559Elasticity, - EIP1559Denominator: chConfig.Optimism.EIP1559Denominator, - EIP1559DenominatorCanyon: chConfig.Optimism.EIP1559DenominatorCanyon, + chFeeConfig := ¶ms.FeeParamsConfig{ + EIP1559Elasticity: chConfig.Genesis.FeeParams.EIP1559Elasticity, + EIP1559Denominator: chConfig.Genesis.FeeParams.EIP1559Denominator, + EIP1559DenominatorCanyon: chConfig.Genesis.FeeParams.EIP1559DenominatorCanyon, } superConfig, err := superchain.GetSuperchain(chain.Network) @@ -38,10 +38,11 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { sysCfg := chConfig.Genesis.SystemConfig genesisSysConfig := eth.SystemConfig{ - BatcherAddr: sysCfg.BatcherAddr, - Overhead: eth.Bytes32(sysCfg.Overhead), - Scalar: eth.Bytes32(sysCfg.Scalar), - GasLimit: sysCfg.GasLimit, + BatcherAddr: sysCfg.BatcherAddr, + BatchInboxAddr: sysCfg.BatchInboxAddr, + Overhead: eth.Bytes32(sysCfg.Overhead), + Scalar: eth.Bytes32(sysCfg.Scalar), + GasLimit: sysCfg.GasLimit, } addrs := chConfig.Addresses @@ -69,6 +70,7 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { Number: chConfig.Genesis.L2.Number, }, L2Time: chConfig.Genesis.L2Time, + FeeParams: chFeeConfig, SystemConfig: genesisSysConfig, }, // The below chain parameters can be different per OP-Stack chain, @@ -91,11 +93,9 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { PectraBlobScheduleTime: hardforks.PectraBlobScheduleTime, IsthmusTime: hardforks.IsthmusTime, JovianTime: hardforks.JovianTime, - BatchInboxAddress: chConfig.BatchInboxAddr, DepositContractAddress: *addrs.OptimismPortalProxy, L1SystemConfigAddress: *addrs.SystemConfigProxy, AltDAConfig: altDA, - ChainOpConfig: chOpConfig, } cfg.ProtocolVersionsAddress = superConfig.ProtocolVersionsAddr diff --git a/op-node/rollup/types.go b/op-node/rollup/types.go index b38c80dd1a7b9..85263f6f7d382 100644 --- a/op-node/rollup/types.go +++ b/op-node/rollup/types.go @@ -49,6 +49,11 @@ type Genesis struct { // The L2 genesis block may not include transactions, and thus cannot encode the config values, // unlike later L2 blocks. SystemConfig eth.SystemConfig `json:"system_config"` + // FeeParams relates to the EIP1559 fees for the execution layer of the given L2 chain. + // It is used during safe chain consolidation to translate zero SystemConfig EIP1559 + // parameters to the protocol values, like the execution layer does. + // If missing, it is loaded by the op-node from the embedded superchain config at startup. + FeeParams *params.FeeParamsConfig `json:"fee_params,omitempty"` } type AltDAConfig struct { @@ -134,8 +139,6 @@ type Config struct { // Note: below addresses are part of the block-derivation process, // and required to be the same network-wide to stay in consensus. - // L1 address that batches are sent to. - BatchInboxAddress common.Address `json:"batch_inbox_address"` // L1 Deposit Contract Address DepositContractAddress common.Address `json:"deposit_contract_address"` // L1 System Config Address @@ -144,12 +147,6 @@ type Config struct { // L1 address that declares the protocol versions, optional (Beta feature) ProtocolVersionsAddress common.Address `json:"protocol_versions_address,omitempty"` - // ChainOpConfig is the OptimismConfig of the execution layer ChainConfig. - // It is used during safe chain consolidation to translate zero SystemConfig EIP1559 - // parameters to the protocol values, like the execution layer does. - // If missing, it is loaded by the op-node from the embedded superchain config at startup. - ChainOpConfig *params.OptimismConfig `json:"chain_op_config,omitempty"` - // Optional Features // AltDAConfig. We are in the process of migrating to the AltDAConfig from these legacy top level values @@ -308,7 +305,7 @@ func (cfg *Config) Check() error { if cfg.Genesis.SystemConfig.GasLimit == 0 { return ErrMissingGasLimit } - if cfg.BatchInboxAddress == (common.Address{}) { + if cfg.Genesis.SystemConfig.BatchInboxAddr == (common.Address{}) { return ErrMissingBatchInboxAddress } if cfg.DepositContractAddress == (common.Address{}) { diff --git a/op-node/rollup/types_test.go b/op-node/rollup/types_test.go index 2d9d35f42fb2e..02e98879fee99 100644 --- a/op-node/rollup/types_test.go +++ b/op-node/rollup/types_test.go @@ -34,10 +34,11 @@ func randConfig() *Config { L2: eth.BlockID{Hash: randHash(), Number: 1337}, L2Time: uint64(time.Now().Unix()), SystemConfig: eth.SystemConfig{ - BatcherAddr: randAddr(), - Overhead: randHash(), - Scalar: randHash(), - GasLimit: 1234567, + BatcherAddr: randAddr(), + BatchInboxAddr: randAddr(), + Overhead: randHash(), + Scalar: randHash(), + GasLimit: 1234567, }, }, BlockTime: 2, @@ -46,7 +47,6 @@ func randConfig() *Config { ChannelTimeoutBedrock: 123, L1ChainID: big.NewInt(900), L2ChainID: big.NewInt(901), - BatchInboxAddress: randAddr(), DepositContractAddress: randAddr(), L1SystemConfigAddress: randAddr(), } @@ -488,7 +488,7 @@ func TestConfig_Check(t *testing.T) { }, { name: "NoBatchInboxAddress", - modifier: func(cfg *Config) { cfg.BatchInboxAddress = common.Address{} }, + modifier: func(cfg *Config) { cfg.Genesis.SystemConfig.BatchInboxAddr = common.Address{} }, expectedErr: ErrMissingBatchInboxAddress, }, { diff --git a/op-program/chainconfig/test/configs/901-rollup.json b/op-program/chainconfig/test/configs/901-rollup.json index 13d0893eea385..7c6ff99c77d8d 100644 --- a/op-program/chainconfig/test/configs/901-rollup.json +++ b/op-program/chainconfig/test/configs/901-rollup.json @@ -11,6 +11,7 @@ "l2_time": 1728358574, "system_config": { "batcherAddr": "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc", + "batchInboxAddr": "0xff00000000000000000000000000000000000901", "overhead": "0x0000000000000000000000000000000000000000000000000000000000000834", "scalar": "0x00000000000000000000000000000000000000000000000000000000000f4240", "gasLimit": 30000000 @@ -27,7 +28,6 @@ "delta_time": 0, "ecotone_time": 0, "fjord_time": 0, - "batch_inbox_address": "0xff00000000000000000000000000000000000901", "deposit_contract_address": "0x55bdfb0bfef1070c457124920546359426153833", "l1_system_config_address": "0x3649f526889a918af0a5498706db29e81bc91e0c", "protocol_versions_address": "0x0000000000000000000000000000000000000000" diff --git a/op-program/client/l2/engineapi/l2_engine_api.go b/op-program/client/l2/engineapi/l2_engine_api.go index 5ae6391f29165..779f68a310420 100644 --- a/op-program/client/l2/engineapi/l2_engine_api.go +++ b/op-program/client/l2/engineapi/l2_engine_api.go @@ -480,7 +480,7 @@ func (ea *L2EngineAPI) forkchoiceUpdated(_ context.Context, state *eth.Forkchoic // If the specified head matches with our local head, do nothing and keep // generating the payload. It's a special corner case that a few slots are // missing and we are requested to generate the payload in slot. - } else if ea.backend.Config().Optimism == nil { // minor L2Engine API divergence: allow proposers to reorg their own chain + } else if ea.backend.Config().FeeParams == nil { // minor L2Engine API divergence: allow proposers to reorg their own chain panic("engine not configured as optimism engine") } diff --git a/op-program/client/l2/test/miner.go b/op-program/client/l2/test/miner.go index 156c7c3d24817..0777990d2014d 100644 --- a/op-program/client/l2/test/miner.go +++ b/op-program/client/l2/test/miner.go @@ -41,7 +41,7 @@ func NewMiner(t *testing.T, logger log.Logger, isthmusTime uint64) (*Miner, *cor config.IsthmusTime = &isthmusTime config.PragueTime = &isthmusTime denomCanyon := uint64(250) - config.Optimism = ¶ms.OptimismConfig{ + config.FeeParams = ¶ms.FeeParamsConfig{ EIP1559Denominator: 50, EIP1559Elasticity: 10, EIP1559DenominatorCanyon: &denomCanyon, diff --git a/op-service/eth/types.go b/op-service/eth/types.go index 14b3c9109c8a2..8771532bf25e5 100644 --- a/op-service/eth/types.go +++ b/op-service/eth/types.go @@ -502,6 +502,8 @@ type ForkchoiceUpdatedResult struct { type SystemConfig struct { // BatcherAddr identifies the batch-sender address used in batch-inbox data-transaction filtering. BatcherAddr common.Address `json:"batcherAddr"` + // L1 address that batches are sent to. + BatchInboxAddr common.Address `json:"batchInboxAddr"` // Overhead identifies the L1 fee overhead. // Pre-Ecotone this is passed as-is to the engine. // Post-Ecotone this is always zero, and not passed into the engine. @@ -541,16 +543,18 @@ func jsonMarshalHolocene(sysCfg SystemConfig) ([]byte, error) { func jsonMarshalPreHolocene(sysCfg SystemConfig) ([]byte, error) { type sysCfgMarshaling struct { - BatcherAddr common.Address `json:"batcherAddr"` - Overhead Bytes32 `json:"overhead"` - Scalar Bytes32 `json:"scalar"` - GasLimit uint64 `json:"gasLimit"` + BatcherAddr common.Address `json:"batcherAddr"` + BatchInboxAddr common.Address `json:"batchInboxAddr"` + Overhead Bytes32 `json:"overhead"` + Scalar Bytes32 `json:"scalar"` + GasLimit uint64 `json:"gasLimit"` } sc := sysCfgMarshaling{ - BatcherAddr: sysCfg.BatcherAddr, - Overhead: sysCfg.Overhead, - Scalar: sysCfg.Scalar, - GasLimit: sysCfg.GasLimit, + BatcherAddr: sysCfg.BatcherAddr, + BatchInboxAddr: sysCfg.BatchInboxAddr, + Overhead: sysCfg.Overhead, + Scalar: sysCfg.Scalar, + GasLimit: sysCfg.GasLimit, } return json.Marshal(sc) } diff --git a/op-service/eth/types_test.go b/op-service/eth/types_test.go index ea1d40d930fb8..d563d30a180d9 100644 --- a/op-service/eth/types_test.go +++ b/op-service/eth/types_test.go @@ -96,6 +96,7 @@ func FuzzEncodeOperatorFeeParams(f *testing.F) { func TestSystemConfigMarshaling(t *testing.T) { sysConfig := SystemConfig{ BatcherAddr: common.Address{'A'}, + BatchInboxAddr: common.Address{'B'}, Overhead: Bytes32{0x4, 0x5, 0x6}, Scalar: Bytes32{0x7, 0x8, 0x9}, OperatorFeeParams: Bytes32{0x1, 0x2, 0x3}, @@ -105,11 +106,11 @@ func TestSystemConfigMarshaling(t *testing.T) { } 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","batchInboxAddr":"0x4200000000000000000000000000000000000000","overhead":"0x0405060000000000000000000000000000000000000000000000000000000000","scalar":"0x0708090000000000000000000000000000000000000000000000000000000000","gasLimit":1234,"eip1559Params":"0x0000000000000000","operatorFeeParams":"0x0102030000000000000000000000000000000000000000000000000000000000"}`, string(j)) sysConfig.MarshalPreHolocene = true j, err = json.Marshal(sysConfig) require.NoError(t, err) - require.Equal(t, `{"batcherAddr":"0x4100000000000000000000000000000000000000","overhead":"0x0405060000000000000000000000000000000000000000000000000000000000","scalar":"0x0708090000000000000000000000000000000000000000000000000000000000","gasLimit":1234}`, string(j)) + require.Equal(t, `{"batcherAddr":"0x4100000000000000000000000000000000000000","batchInboxAddr":"0x4200000000000000000000000000000000000000","overhead":"0x0405060000000000000000000000000000000000000000000000000000000000","scalar":"0x0708090000000000000000000000000000000000000000000000000000000000","gasLimit":1234}`, string(j)) } func TestStorageKey(t *testing.T) {