From ac962872c10952c30b6c8dc5b983289a67ff3c31 Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Fri, 24 May 2024 13:43:43 +0900 Subject: [PATCH 1/8] Add Fjord override flags and time --- cmd/utils/flags.go | 7 +++++++ core/genesis_write.go | 11 +++++++---- erigon-lib/chain/chain_config.go | 1 + eth/backend.go | 5 ++++- eth/ethconfig/config.go | 1 + turbo/cli/default_flags.go | 1 + 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 08f03bdffff..7c46dd795aa 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -138,6 +138,10 @@ var ( Name: "override.ecotone", Usage: "Manually specify the Optimism Ecotone fork time, overriding the bundled setting", } + OverrideOptimismFjordFlag = flags.BigFlag{ + Name: "override.fjord", + Usage: "Manually specify the Optimism Ecotone fork time, overriding the bundled setting", + } // Ethash settings EthashCachesInMemoryFlag = cli.IntFlag{ Name: "ethash.cachesinmem", @@ -2006,6 +2010,9 @@ func SetEthConfig(ctx *cli.Context, nodeConfig *nodecfg.Config, cfg *ethconfig.C "cancun", overrideCancunTime.String(), "ecotone", overrideOptimismEcotoneTime.String()) } } + if ctx.IsSet(OverrideOptimismFjordFlag.Name) { + cfg.OverrideOptimismFjordTime = flags.GlobalBig(ctx, OverrideOptimismFjordFlag.Name) + } if ctx.IsSet(InternalConsensusFlag.Name) && clparams.EmbeddedSupported(cfg.NetworkID) { cfg.InternalCL = ctx.Bool(InternalConsensusFlag.Name) } diff --git a/core/genesis_write.go b/core/genesis_write.go index 6619799bca3..a03ad295abb 100644 --- a/core/genesis_write.go +++ b/core/genesis_write.go @@ -68,16 +68,16 @@ import ( // // The returned chain configuration is never nil. func CommitGenesisBlock(db kv.RwDB, genesis *types.Genesis, tmpDir string, logger log.Logger) (*chain.Config, *types.Block, error) { - return CommitGenesisBlockWithOverride(db, genesis, nil, nil, nil, nil, nil, tmpDir, logger) + return CommitGenesisBlockWithOverride(db, genesis, nil, nil, nil, nil, nil, nil, tmpDir, logger) } -func CommitGenesisBlockWithOverride(db kv.RwDB, genesis *types.Genesis, overrideCancunTime, overrideShanghaiTime, overrideOptimismCanyonTime, overrideOptimismEcotoneTime, overridePragueTime *big.Int, tmpDir string, logger log.Logger) (*chain.Config, *types.Block, error) { +func CommitGenesisBlockWithOverride(db kv.RwDB, genesis *types.Genesis, overrideCancunTime, overrideShanghaiTime, overrideOptimismCanyonTime, overrideOptimismEcotoneTime, overrideOptimismFjordTime, overridePragueTime *big.Int, tmpDir string, logger log.Logger) (*chain.Config, *types.Block, error) { tx, err := db.BeginRw(context.Background()) if err != nil { return nil, nil, err } defer tx.Rollback() - c, b, err := WriteGenesisBlock(tx, genesis, overrideCancunTime, overrideShanghaiTime, overrideOptimismCanyonTime, overrideOptimismEcotoneTime, overridePragueTime, tmpDir, logger) + c, b, err := WriteGenesisBlock(tx, genesis, overrideCancunTime, overrideShanghaiTime, overrideOptimismCanyonTime, overrideOptimismEcotoneTime, overrideOptimismFjordTime, overridePragueTime, tmpDir, logger) if err != nil { return c, b, err } @@ -88,7 +88,7 @@ func CommitGenesisBlockWithOverride(db kv.RwDB, genesis *types.Genesis, override return c, b, nil } -func WriteGenesisBlock(tx kv.RwTx, genesis *types.Genesis, overrideCancunTime, overrideShanghaiTime, overrideOptimismCanyonTime, overrideOptimismEcotoneTime, overridePragueTime *big.Int, tmpDir string, logger log.Logger) (*chain.Config, *types.Block, error) { +func WriteGenesisBlock(tx kv.RwTx, genesis *types.Genesis, overrideCancunTime, overrideShanghaiTime, overrideOptimismCanyonTime, overrideOptimismEcotoneTime, overrideOptimismFjordTime, overridePragueTime *big.Int, tmpDir string, logger log.Logger) (*chain.Config, *types.Block, error) { var storedBlock *types.Block if genesis != nil && genesis.Config == nil { return params.AllProtocolChanges, nil, types.ErrGenesisNoConfig @@ -135,6 +135,9 @@ func WriteGenesisBlock(tx kv.RwTx, genesis *types.Genesis, overrideCancunTime, o "cancun", overrideCancunTime.String(), "ecotone", overrideOptimismEcotoneTime.String()) } } + if config.IsOptimism() && overrideOptimismFjordTime != nil { + config.FjordTime = overrideOptimismFjordTime + } } if (storedHash == libcommon.Hash{}) { diff --git a/erigon-lib/chain/chain_config.go b/erigon-lib/chain/chain_config.go index 8382fb59690..fa16e9762e9 100644 --- a/erigon-lib/chain/chain_config.go +++ b/erigon-lib/chain/chain_config.go @@ -74,6 +74,7 @@ type Config struct { CanyonTime *big.Int `json:"canyonTime,omitempty"` // Canyon switch time (nil = no fork, 0 = already on optimism canyon) // Delta: the Delta upgrade does not affect the execution-layer, and is thus not configurable in the chain config. EcotoneTime *big.Int `json:"ecotoneTime,omitempty"` // Ecotone switch time (nil = no fork, 0 = already on optimism ecotone) + FjordTime *big.Int `json:"fjordTime,omitempty"` // Fjord switch time (nil = no fork, 0 = already on optimism fjord) // Optional EIP-4844 parameters MinBlobGasPrice *uint64 `json:"minBlobGasPrice,omitempty"` diff --git a/eth/backend.go b/eth/backend.go index faa003ac746..e017b510a8d 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -303,7 +303,7 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger genesisSpec = nil } var genesisErr error - chainConfig, genesis, genesisErr = core.WriteGenesisBlock(tx, genesisSpec, config.OverrideCancunTime, config.OverrideShanghaiTime, config.OverrideOptimismCanyonTime, config.OverrideOptimismEcotoneTime, config.OverridePragueTime, tmpdir, logger) + chainConfig, genesis, genesisErr = core.WriteGenesisBlock(tx, genesisSpec, config.OverrideCancunTime, config.OverrideShanghaiTime, config.OverrideOptimismCanyonTime, config.OverrideOptimismEcotoneTime, config.OverrideOptimismFjordTime, config.OverridePragueTime, tmpdir, logger) if _, ok := genesisErr.(*chain.ConfigCompatError); genesisErr != nil && !ok { return genesisErr } @@ -326,6 +326,9 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger if chainConfig.EcotoneTime == nil { log.Warn("Optimism EcotoneTime has not been set") } + if chainConfig.FjordTime == nil { + log.Warn("Optimism FjordTime has not been set") + } } setBorDefaultMinerGasPrice(chainConfig, config, logger) diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index bead6d46f08..f9ad2c7af07 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -256,6 +256,7 @@ type Config struct { OverrideOptimismCanyonTime *big.Int `toml:",omitempty"` OverrideOptimismEcotoneTime *big.Int `toml:",omitempty"` + OverrideOptimismFjordTime *big.Int `toml:",omitempty"` OverridePragueTime *big.Int `toml:",omitempty"` diff --git a/turbo/cli/default_flags.go b/turbo/cli/default_flags.go index 19c74dbfe03..20e5a5ff306 100644 --- a/turbo/cli/default_flags.go +++ b/turbo/cli/default_flags.go @@ -164,6 +164,7 @@ var DefaultFlags = []cli.Flag{ &utils.OverrideShanghaiTime, &utils.OverrideOptimismCanyonFlag, &utils.OverrideOptimismEcotoneFlag, + &utils.OverrideOptimismFjordFlag, &utils.RollupSequencerHTTPFlag, &utils.RollupHistoricalRPCFlag, &utils.RollupHistoricalRPCTimeoutFlag, From 14d1d1fff949a6c9ba0c3d08c0b408666e33adf1 Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Fri, 24 May 2024 14:05:24 +0900 Subject: [PATCH 2/8] Fix genesis tests for adding new args --- core/genesis_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/genesis_test.go b/core/genesis_test.go index 7c45f66f915..5ca96d24d9d 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -34,7 +34,7 @@ func TestGenesisBlockHashes(t *testing.T) { t.Fatal(err) } defer tx.Rollback() - _, block, err := core.WriteGenesisBlock(tx, genesis, nil, nil, nil, nil, nil, "", logger) + _, block, err := core.WriteGenesisBlock(tx, genesis, nil, nil, nil, nil, nil, nil, "", logger) require.NoError(t, err) expect := params.GenesisHashByChainName(network) require.NotNil(t, expect, network) @@ -83,13 +83,13 @@ func TestCommitGenesisIdempotency(t *testing.T) { defer tx.Rollback() genesis := core.GenesisBlockByChainName(networkname.MainnetChainName) - _, _, err = core.WriteGenesisBlock(tx, genesis, nil, nil, nil, nil, nil, "", logger) + _, _, err = core.WriteGenesisBlock(tx, genesis, nil, nil, nil, nil, nil, nil, "", logger) require.NoError(t, err) seq, err := tx.ReadSequence(kv.EthTx) require.NoError(t, err) require.Equal(t, uint64(2), seq) - _, _, err = core.WriteGenesisBlock(tx, genesis, nil, nil, nil, nil, nil, "", logger) + _, _, err = core.WriteGenesisBlock(tx, genesis, nil, nil, nil, nil, nil, nil, "", logger) require.NoError(t, err) seq, err = tx.ReadSequence(kv.EthTx) require.NoError(t, err) From 3a1519b479106350844ea7d761c772de9a5cdc50 Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Fri, 24 May 2024 14:01:37 +0900 Subject: [PATCH 3/8] Add fjord getters and description --- erigon-lib/chain/chain_config.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/erigon-lib/chain/chain_config.go b/erigon-lib/chain/chain_config.go index fa16e9762e9..9060b426a9f 100644 --- a/erigon-lib/chain/chain_config.go +++ b/erigon-lib/chain/chain_config.go @@ -124,7 +124,7 @@ func (o *OptimismConfig) String() string { func (c *Config) String() string { engine := c.getEngine() - return fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Prague: %v, Osaka: %v, Engine: %v, NoPruneContracts: %v}", + configString := fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Prague: %v, Osaka: %v, Engine: %v, NoPruneContracts: %v}", c.ChainID, c.HomesteadBlock, c.DAOForkBlock, @@ -148,6 +148,16 @@ func (c *Config) String() string { engine, c.NoPruneContracts, ) + if c.IsOptimism() { + configString += fmt.Sprintf("{Bedrock: %v, Regolith: %v, Canyon: %v, Ecotone: %v, Fjord: %v}", + c.BedrockBlock, + c.RegolithTime, + c.CanyonTime, + c.EcotoneTime, + c.FjordTime, + ) + } + return configString } func (c *Config) getEngine() string { @@ -322,6 +332,10 @@ func (c *Config) IsEcotone(time uint64) bool { return isForked(c.EcotoneTime, time) } +func (c *Config) IsFjord(time uint64) bool { + return isForked(c.FjordTime, time) +} + // IsOptimism returns whether the node is an optimism node or not. func (c *Config) IsOptimism() bool { return c.Optimism != nil @@ -344,6 +358,10 @@ func (c *Config) IsOptimismEcotone(time uint64) bool { return c.IsOptimism() && c.IsEcotone(time) } +func (c *Config) IsOptimismFjord(time uint64) bool { + return c.IsOptimism() && c.IsFjord(time) +} + // IsOptimismPreBedrock returns true iff this is an optimism node & bedrock is not yet active func (c *Config) IsOptimismPreBedrock(num uint64) bool { return c.IsOptimism() && !c.IsBedrock(num) From c00a08c6fd508f779c6c8cc9dc9099a65c90e933 Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Fri, 24 May 2024 14:17:29 +0900 Subject: [PATCH 4/8] Add missing rules for optimism --- erigon-lib/chain/chain_config.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/erigon-lib/chain/chain_config.go b/erigon-lib/chain/chain_config.go index 9060b426a9f..e1bb8133b54 100644 --- a/erigon-lib/chain/chain_config.go +++ b/erigon-lib/chain/chain_config.go @@ -606,14 +606,15 @@ func borKeyValueConfigHelper[T uint64 | common.Address](field map[string]T, numb // Rules is a one time interface meaning that it shouldn't be used in between transition // phases. type Rules struct { - ChainID *big.Int - IsHomestead, IsTangerineWhistle, IsSpuriousDragon bool - IsByzantium, IsConstantinople, IsPetersburg bool - IsIstanbul, IsBerlin, IsLondon, IsShanghai bool - IsCancun, IsNapoli bool - IsPrague, IsOsaka bool - IsAura bool - IsOptimismBedrock, IsOptimismRegolith bool + ChainID *big.Int + IsHomestead, IsTangerineWhistle, IsSpuriousDragon bool + IsByzantium, IsConstantinople, IsPetersburg bool + IsIstanbul, IsBerlin, IsLondon, IsShanghai bool + IsCancun, IsNapoli bool + IsPrague, IsOsaka bool + IsAura bool + IsOptimismBedrock, IsOptimismRegolith bool + IsOptimismCanyon, IsOptimismEcotone, IsOptimismFjord bool } // Rules ensures c's ChainID is not nil and returns a new Rules instance @@ -642,6 +643,9 @@ func (c *Config) Rules(num uint64, time uint64) *Rules { IsAura: c.Aura != nil, IsOptimismBedrock: c.IsOptimismBedrock(num), IsOptimismRegolith: c.IsOptimismRegolith(time), + IsOptimismCanyon: c.IsOptimismCanyon(time), + IsOptimismEcotone: c.IsOptimismEcotone(time), + IsOptimismFjord: c.IsOptimismFjord(time), } } From 01215d2cb44cbf00b49d27bc1ff769b50f24568e Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Fri, 24 May 2024 14:12:37 +0900 Subject: [PATCH 5/8] Set fjord time for sepolia/devnet Devnet: https://github.com/ethereum-optimism/op-geth/pull/316 Sepolia: https://github.com/ethereum-optimism/op-geth/pull/320 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 01be28336c7..b6f431d2671 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf github.com/edsrzf/mmap-go v1.1.0 github.com/emicklei/dot v1.6.1 - github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240229171554-54fc16ca2a16 + github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240522134500-19555bdbdc95 github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c github.com/gballet/go-verkle v0.0.0-20221121182333-31427a1f2d35 github.com/gfx-labs/sse v0.0.0-20231226060816-f747e26a9baa diff --git a/go.sum b/go.sum index 0a919bca8c5..8bd47ce6746 100644 --- a/go.sum +++ b/go.sum @@ -274,8 +274,8 @@ github.com/erigontech/silkworm-go v0.18.0 h1:j56p61xZHBFhZGH1OixlGU8KcfjHzcw9pjA github.com/erigontech/silkworm-go v0.18.0/go.mod h1:O50ux0apICEVEGyRWiE488K8qz8lc3PA/SXbQQAc8SU= github.com/erigontech/torrent v1.54.2-alpha-8 h1:MQobu6sUZCFbmWpsB7GqAh0IWs7VAZ370POaVxlApIk= github.com/erigontech/torrent v1.54.2-alpha-8/go.mod h1:nYNeuR4xPlEl4CturFD9/KRXBRJEcJGqjegDNWakwG4= -github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240229171554-54fc16ca2a16 h1:r3d42CFNNHzjbHb6efRbTRLXwtdCaO+nF8GQaJ6h+jo= -github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240229171554-54fc16ca2a16/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240522134500-19555bdbdc95 h1:GjXKQg6u6WkEIcY0dvW2IKhMRY8cVjwdw+rNKhduAo8= +github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240522134500-19555bdbdc95/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c h1:CndMRAH4JIwxbW8KYq6Q+cGWcGHz0FjGR3QqcInWcW0= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= From b9ff2b219ab3a3645f13c642144dea52d69a7896 Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Fri, 24 May 2024 15:05:19 +0900 Subject: [PATCH 6/8] Get hardfork times from chConfig, not superchainConfig --- params/superchain.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/params/superchain.go b/params/superchain.go index 33fe0e227d2..61b5d12bbe6 100644 --- a/params/superchain.go +++ b/params/superchain.go @@ -90,9 +90,9 @@ func ChainConfigByOpStackGenesisHash(genesisHash common.Hash) *chain.Config { // LoadSuperChainConfig loads superchain config from superchain registry for given chain, and builds erigon chain config. // This implementation is based on op-geth(https://github.com/ethereum-optimism/op-geth/blob/c7871bc4454ffc924eb128fa492975b30c9c46ad/params/superchain.go#L39) func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config { - superchainConfig, ok := superchain.Superchains[opStackChainCfg.Superchain] + chConfig, ok := superchain.OPChains[opStackChainCfg.ChainID] if !ok { - panic("unknown superchain: " + opStackChainCfg.Superchain) + panic(fmt.Sprintf("LoadSuperChainConfig: unknown chain ID: %d", opStackChainCfg.ChainID)) } out := &chain.Config{ ChainName: opStackChainCfg.Name, @@ -129,18 +129,17 @@ func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config }, } - if superchainConfig.Config.CanyonTime != nil { - out.ShanghaiTime = new(big.Int).SetUint64(*superchainConfig.Config.CanyonTime) // Shanghai activates with Canyon - out.CanyonTime = new(big.Int).SetUint64(*superchainConfig.Config.CanyonTime) + if chConfig.CanyonTime != nil { + out.ShanghaiTime = new(big.Int).SetUint64(*chConfig.CanyonTime) // Shanghai activates with Canyon + out.CanyonTime = new(big.Int).SetUint64(*chConfig.CanyonTime) } - if superchainConfig.Config.EcotoneTime != nil { - out.CancunTime = new(big.Int).SetUint64(*superchainConfig.Config.EcotoneTime) // CancunTime activates with Ecotone - out.EcotoneTime = new(big.Int).SetUint64(*superchainConfig.Config.EcotoneTime) + if chConfig.EcotoneTime != nil { + out.CancunTime = new(big.Int).SetUint64(*chConfig.EcotoneTime) // CancunTime activates with Ecotone + out.EcotoneTime = new(big.Int).SetUint64(*chConfig.EcotoneTime) } - // note: no actual parameters are being loaded, yet. - // Future superchain upgrades are loaded from the superchain chConfig and applied to the geth ChainConfig here. - _ = superchainConfig.Config + out.FjordTime = new(big.Int).SetUint64(*chConfig.FjordTime) + } // special overrides for OP-Stack chains with pre-Regolith upgrade history switch opStackChainCfg.ChainID { From 7b265eee9c62b29a68258a65ebe5907ac2ddc3d2 Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Fri, 24 May 2024 16:54:08 +0900 Subject: [PATCH 7/8] Fetch fjord time from superchain registry --- params/superchain.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/params/superchain.go b/params/superchain.go index 61b5d12bbe6..69bbf7fd8ba 100644 --- a/params/superchain.go +++ b/params/superchain.go @@ -118,6 +118,7 @@ func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config RegolithTime: big.NewInt(0), CanyonTime: nil, EcotoneTime: nil, + FjordTime: nil, TerminalTotalDifficulty: common.Big0, TerminalTotalDifficultyPassed: true, Ethash: nil, @@ -137,7 +138,7 @@ func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config out.CancunTime = new(big.Int).SetUint64(*chConfig.EcotoneTime) // CancunTime activates with Ecotone out.EcotoneTime = new(big.Int).SetUint64(*chConfig.EcotoneTime) } - + if chConfig.FjordTime != nil { out.FjordTime = new(big.Int).SetUint64(*chConfig.FjordTime) } From 984cf687476ac3847a876a5fdc817f134907b0ac Mon Sep 17 00:00:00 2001 From: pcw109550 Date: Fri, 24 May 2024 17:14:08 +0900 Subject: [PATCH 8/8] Drop OP stack goerli because superchain removed support https://github.com/ethereum-optimism/superchain-registry/pull/115 --- consensus/misc/create2deployer_test.go | 2 +- core/genesis_write.go | 2 -- erigon-lib/chain/networkname/network_name.go | 5 ---- params/config.go | 5 ---- params/superchain.go | 30 ++++---------------- 5 files changed, 7 insertions(+), 37 deletions(-) diff --git a/consensus/misc/create2deployer_test.go b/consensus/misc/create2deployer_test.go index f2254328a4f..98a60be5d31 100644 --- a/consensus/misc/create2deployer_test.go +++ b/consensus/misc/create2deployer_test.go @@ -72,7 +72,7 @@ func TestEnsureCreate2Deployer(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { cfg := chain.Config{ - ChainID: big.NewInt(params.OPGoerliChainID), + ChainID: big.NewInt(params.OPMainnetChainID), Optimism: &chain.OptimismConfig{}, CanyonTime: big.NewInt(int64(canyonTime)), } diff --git a/core/genesis_write.go b/core/genesis_write.go index a03ad295abb..008e3074202 100644 --- a/core/genesis_write.go +++ b/core/genesis_write.go @@ -839,8 +839,6 @@ func loadOPStackGenesisByChainName(name string) (*types.Genesis, error) { switch opStackChainCfg.ChainID { case params.OPMainnetChainID: expectedHash = params.OPMainnetGenesisHash - case params.OPGoerliChainID: - expectedHash = params.OPGoerliGenesisHash default: return nil, fmt.Errorf("unknown stateless genesis definition for chain %d", opStackChainCfg.ChainID) } diff --git a/erigon-lib/chain/networkname/network_name.go b/erigon-lib/chain/networkname/network_name.go index 3cc0a487872..b48de254cfb 100644 --- a/erigon-lib/chain/networkname/network_name.go +++ b/erigon-lib/chain/networkname/network_name.go @@ -16,11 +16,9 @@ const ( OPDevnetChainName = "op-devnet" OPMainnetChainName = "op-mainnet" - OPGoerliChainName = "op-goerli" LegacyOPDevnetChainName = "optimism-devnet" LegacyOPMainnetChainName = "optimism-mainnet" - LegacyOPGoerliChainName = "optimism-goerli" ) var All = []string{ @@ -34,7 +32,6 @@ var All = []string{ BorDevnetChainName, GnosisChainName, ChiadoChainName, - OPGoerliChainName, OPDevnetChainName, } @@ -42,8 +39,6 @@ func HandleLegacyName(name string) string { switch name { case LegacyOPDevnetChainName: return OPDevnetChainName - case LegacyOPGoerliChainName: - return OPGoerliChainName case LegacyOPMainnetChainName: return OPMainnetChainName default: diff --git a/params/config.go b/params/config.go index b199253ceec..79d6104eef7 100644 --- a/params/config.go +++ b/params/config.go @@ -74,7 +74,6 @@ var ( ChiadoGenesisHash = libcommon.HexToHash("0xada44fd8d2ecab8b08f256af07ad3e777f17fb434f8f8e678b312f576212ba9a") OPMainnetGenesisHash = libcommon.HexToHash("0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b") - OPGoerliGenesisHash = libcommon.HexToHash("0xc1fc15cd51159b1f1e5cbc4b82e85c1447ddfa33c52cf1d98d14fba0d6354be1") OPDevnetGenesisHash = libcommon.HexToHash("0x1c16b5a055ff0197544b96f1375bf6be35ec478e23a95093cfe01902d821c22a") ) @@ -82,7 +81,6 @@ var ( GnosisGenesisStateRoot = libcommon.HexToHash("0x40cf4430ecaa733787d1a65154a3b9efb560c95d9e324a23b97f0609b539133b") ChiadoGenesisStateRoot = libcommon.HexToHash("0x9ec3eaf4e6188dfbdd6ade76eaa88289b57c63c9a2cde8d35291d5a29e143d31") OptimismMainnetStateRoot = libcommon.HexToHash("0xeddb4c1786789419153a27c4c80ff44a2226b6eda04f7e22ce5bae892ea568eb") - OptimismGoerliStateRoot = libcommon.HexToHash("0x9e6b478a1cd331a979c39e4bddf42c676bcf5a63382f898dc441fe3fe5eb0837") ) var ( @@ -285,9 +283,6 @@ func GenesisHashByChainName(chain string) *libcommon.Hash { case networkname.OPMainnetChainName: // cannot use genesis has from superchain registry because of pre-bedrock blocks return &OPMainnetGenesisHash - case networkname.OPGoerliChainName: - // cannot use genesis has from superchain registry because of pre-bedrock blocks - return &OPGoerliGenesisHash default: if opStackChainCfg := OPStackChainConfigByName(chain); opStackChainCfg != nil { genesisHash := libcommon.Hash(opStackChainCfg.Genesis.L2.Hash) diff --git a/params/superchain.go b/params/superchain.go index 69bbf7fd8ba..c1695f7c66b 100644 --- a/params/superchain.go +++ b/params/superchain.go @@ -14,15 +14,12 @@ import ( ) const ( - OPMainnetChainID = 10 - OPGoerliChainID = 420 - BaseMainnetChainID = 8453 - BaseGoerliChainID = 84531 - baseSepoliaChainID = 84532 - baseGoerliDevnetChainID = 11763071 - pgnSepoliaChainID = 58008 - devnetChainID = 997 - chaosnetChainID = 888 + OPMainnetChainID = 10 + BaseMainnetChainID = 8453 + baseSepoliaChainID = 84532 + pgnSepoliaChainID = 58008 + devnetChainID = 997 + chaosnetChainID = 888 ) // OP Stack chain config @@ -58,8 +55,6 @@ func OPStackChainConfigByName(name string) *superchain.ChainConfig { func OPStackChainConfigByGenesisHash(genesisHash common.Hash) *superchain.ChainConfig { if bytes.Equal(genesisHash.Bytes(), OPMainnetGenesisHash.Bytes()) { return superchain.OPChains[OPMainnetChainID] - } else if bytes.Equal(genesisHash.Bytes(), OPGoerliGenesisHash.Bytes()) { - return superchain.OPChains[OPGoerliChainID] } for _, chainCfg := range superchain.OPChains { if bytes.Equal(chainCfg.Genesis.L2.Hash[:], genesisHash.Bytes()) { @@ -144,14 +139,6 @@ func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config // special overrides for OP-Stack chains with pre-Regolith upgrade history switch opStackChainCfg.ChainID { - case OPGoerliChainID: - out.LondonBlock = big.NewInt(4061224) - out.ArrowGlacierBlock = big.NewInt(4061224) - out.GrayGlacierBlock = big.NewInt(4061224) - out.MergeNetsplitBlock = big.NewInt(4061224) - out.BedrockBlock = big.NewInt(4061224) - out.RegolithTime = OptimismGoerliRegolithTime - out.Optimism.EIP1559Elasticity = 10 case OPMainnetChainID: out.BerlinBlock = big.NewInt(3950000) out.LondonBlock = big.NewInt(105235063) @@ -159,13 +146,8 @@ func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config out.GrayGlacierBlock = big.NewInt(105235063) out.MergeNetsplitBlock = big.NewInt(105235063) out.BedrockBlock = big.NewInt(105235063) - case BaseGoerliChainID: - out.RegolithTime = BaseGoerliRegolithTime - out.Optimism.EIP1559Elasticity = 10 case baseSepoliaChainID: out.Optimism.EIP1559Elasticity = 10 - case baseGoerliDevnetChainID: - out.RegolithTime = baseGoerliDevnetRegolithTime case pgnSepoliaChainID: out.Optimism.EIP1559Elasticity = 2 out.Optimism.EIP1559Denominator = 8