From 66c0c4e5174a0b231727f27c7ad48624189ecc62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 26 Apr 2023 18:17:37 +0300 Subject: [PATCH] cmd, eth, les: replace Shanghai override flag with Cancun (#27171) --- cmd/geth/config.go | 6 +++--- cmd/geth/main.go | 2 +- cmd/utils/flags.go | 6 +++--- core/genesis.go | 6 +++--- eth/backend.go | 4 ++-- eth/ethconfig/config.go | 4 ++-- eth/ethconfig/gen_config.go | 10 +++++----- les/client.go | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 0b856d1c1..ad7fd4d71 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -158,9 +158,9 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) { // makeFullNode loads geth configuration and creates the Ethereum backend. func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { stack, cfg := makeConfigNode(ctx) - if ctx.IsSet(utils.OverrideShanghai.Name) { - v := ctx.Uint64(utils.OverrideShanghai.Name) - cfg.Eth.OverrideShanghai = &v + if ctx.IsSet(utils.OverrideCancun.Name) { + v := ctx.Uint64(utils.OverrideCancun.Name) + cfg.Eth.OverrideCancun = &v } backend, eth := utils.RegisterEthService(stack, &cfg.Eth) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index f55adb144..799493e67 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -64,7 +64,7 @@ var ( utils.NoUSBFlag, utils.USBFlag, utils.SmartCardDaemonPathFlag, - utils.OverrideShanghai, + utils.OverrideCancun, utils.EnablePersonal, utils.EthashCacheDirFlag, utils.EthashCachesInMemoryFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index e9b6320ad..ba9916d93 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -268,9 +268,9 @@ var ( Value: 2048, Category: flags.EthCategory, } - OverrideShanghai = &cli.Uint64Flag{ - Name: "override.shanghai", - Usage: "Manually specify the Shanghai fork timestamp, overriding the bundled setting", + OverrideCancun = &cli.Uint64Flag{ + Name: "override.cancun", + Usage: "Manually specify the Cancun fork timestamp, overriding the bundled setting", Category: flags.EthCategory, } // Light server and client settings diff --git a/core/genesis.go b/core/genesis.go index 269c1486d..e1682ebeb 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -267,7 +267,7 @@ func (e *GenesisMismatchError) Error() string { // ChainOverrides contains the changes to chain config. type ChainOverrides struct { - OverrideShanghai *uint64 + OverrideCancun *uint64 } // SetupGenesisBlock writes or updates the genesis block in db. @@ -293,8 +293,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen } applyOverrides := func(config *params.ChainConfig) { if config != nil { - if overrides != nil && overrides.OverrideShanghai != nil { - config.ShanghaiTime = overrides.OverrideShanghai + if overrides != nil && overrides.OverrideCancun != nil { + config.CancunTime = overrides.OverrideCancun } } } diff --git a/eth/backend.go b/eth/backend.go index 24ae08502..21c0deaa2 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -194,8 +194,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { ) // Override the chain config with provided settings. var overrides core.ChainOverrides - if config.OverrideShanghai != nil { - overrides.OverrideShanghai = config.OverrideShanghai + if config.OverrideCancun != nil { + overrides.OverrideCancun = config.OverrideCancun } eth.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, config.Genesis, &overrides, eth.engine, vmConfig, eth.shouldPreserve, &config.TxLookupLimit) if err != nil { diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 3d26cf69a..3279d9a1b 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -198,8 +198,8 @@ type Config struct { // send-transaction variants. The unit is ether. RPCTxFeeCap float64 - // OverrideShanghai (TODO: remove after the fork) - OverrideShanghai *uint64 `toml:",omitempty"` + // OverrideCancun (TODO: remove after the fork) + OverrideCancun *uint64 `toml:",omitempty"` } // CreateConsensusEngine creates a consensus engine for the given chain configuration. diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index 3ab434014..0070ba4c0 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -56,7 +56,7 @@ func (c Config) MarshalTOML() (interface{}, error) { RPCGasCap uint64 RPCEVMTimeout time.Duration RPCTxFeeCap float64 - OverrideShanghai *uint64 `toml:",omitempty"` + OverrideCancun *uint64 `toml:",omitempty"` } var enc Config enc.Genesis = c.Genesis @@ -98,7 +98,7 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.RPCGasCap = c.RPCGasCap enc.RPCEVMTimeout = c.RPCEVMTimeout enc.RPCTxFeeCap = c.RPCTxFeeCap - enc.OverrideShanghai = c.OverrideShanghai + enc.OverrideCancun = c.OverrideCancun return &enc, nil } @@ -144,7 +144,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { RPCGasCap *uint64 RPCEVMTimeout *time.Duration RPCTxFeeCap *float64 - OverrideShanghai *uint64 `toml:",omitempty"` + OverrideCancun *uint64 `toml:",omitempty"` } var dec Config if err := unmarshal(&dec); err != nil { @@ -267,8 +267,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.RPCTxFeeCap != nil { c.RPCTxFeeCap = *dec.RPCTxFeeCap } - if dec.OverrideShanghai != nil { - c.OverrideShanghai = dec.OverrideShanghai + if dec.OverrideCancun != nil { + c.OverrideCancun = dec.OverrideCancun } return nil } diff --git a/les/client.go b/les/client.go index 9b75f07bd..8eb46c2e6 100644 --- a/les/client.go +++ b/les/client.go @@ -94,8 +94,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*LightEthereum, error) { return nil, err } var overrides core.ChainOverrides - if config.OverrideShanghai != nil { - overrides.OverrideShanghai = config.OverrideShanghai + if config.OverrideCancun != nil { + overrides.OverrideCancun = config.OverrideCancun } chainConfig, genesisHash, genesisErr := core.SetupGenesisBlockWithOverride(chainDb, trie.NewDatabase(chainDb), config.Genesis, &overrides) if _, isCompat := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !isCompat {