Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fjord] Superchain-Registry Update for sepolia/devnet #175

Merged
merged 8 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion consensus/misc/create2deployer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
Expand Down
6 changes: 3 additions & 3 deletions core/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
13 changes: 7 additions & 6 deletions core/genesis_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -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{}) {
Expand Down Expand Up @@ -836,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)
}
Expand Down
41 changes: 32 additions & 9 deletions erigon-lib/chain/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -123,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,
Expand All @@ -147,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 {
Expand Down Expand Up @@ -321,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
Expand All @@ -343,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)
Expand Down Expand Up @@ -587,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
Expand Down Expand Up @@ -623,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),
}
}

Expand Down
5 changes: 0 additions & 5 deletions erigon-lib/chain/networkname/network_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -34,16 +32,13 @@ var All = []string{
BorDevnetChainName,
GnosisChainName,
ChiadoChainName,
OPGoerliChainName,
OPDevnetChainName,
}

func HandleLegacyName(name string) string {
switch name {
case LegacyOPDevnetChainName:
return OPDevnetChainName
case LegacyOPGoerliChainName:
return OPGoerliChainName
case LegacyOPMainnetChainName:
return OPMainnetChainName
default:
Expand Down
5 changes: 4 additions & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
5 changes: 0 additions & 5 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,13 @@ var (
ChiadoGenesisHash = libcommon.HexToHash("0xada44fd8d2ecab8b08f256af07ad3e777f17fb434f8f8e678b312f576212ba9a")

OPMainnetGenesisHash = libcommon.HexToHash("0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b")
OPGoerliGenesisHash = libcommon.HexToHash("0xc1fc15cd51159b1f1e5cbc4b82e85c1447ddfa33c52cf1d98d14fba0d6354be1")
OPDevnetGenesisHash = libcommon.HexToHash("0x1c16b5a055ff0197544b96f1375bf6be35ec478e23a95093cfe01902d821c22a")
)

var (
GnosisGenesisStateRoot = libcommon.HexToHash("0x40cf4430ecaa733787d1a65154a3b9efb560c95d9e324a23b97f0609b539133b")
ChiadoGenesisStateRoot = libcommon.HexToHash("0x9ec3eaf4e6188dfbdd6ade76eaa88289b57c63c9a2cde8d35291d5a29e143d31")
OptimismMainnetStateRoot = libcommon.HexToHash("0xeddb4c1786789419153a27c4c80ff44a2226b6eda04f7e22ce5bae892ea568eb")
OptimismGoerliStateRoot = libcommon.HexToHash("0x9e6b478a1cd331a979c39e4bddf42c676bcf5a63382f898dc441fe3fe5eb0837")
)

var (
Expand Down Expand Up @@ -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)
Expand Down
54 changes: 18 additions & 36 deletions params/superchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()) {
Expand Down Expand Up @@ -90,9 +85,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,
Expand All @@ -118,6 +113,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,
Expand All @@ -129,43 +125,29 @@ 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)
}
if chConfig.FjordTime != nil {
out.FjordTime = new(big.Int).SetUint64(*chConfig.FjordTime)
}

// 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

// 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)
out.ArrowGlacierBlock = big.NewInt(105235063)
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
Expand Down
Loading
Loading