Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66c0c4e

Browse files
authored
cmd, eth, les: replace Shanghai override flag with Cancun (ethereum#27171)
1 parent 306d177 commit 66c0c4e

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

cmd/geth/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
158158
// makeFullNode loads geth configuration and creates the Ethereum backend.
159159
func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
160160
stack, cfg := makeConfigNode(ctx)
161-
if ctx.IsSet(utils.OverrideShanghai.Name) {
162-
v := ctx.Uint64(utils.OverrideShanghai.Name)
163-
cfg.Eth.OverrideShanghai = &v
161+
if ctx.IsSet(utils.OverrideCancun.Name) {
162+
v := ctx.Uint64(utils.OverrideCancun.Name)
163+
cfg.Eth.OverrideCancun = &v
164164
}
165165
backend, eth := utils.RegisterEthService(stack, &cfg.Eth)
166166

cmd/geth/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var (
6464
utils.NoUSBFlag,
6565
utils.USBFlag,
6666
utils.SmartCardDaemonPathFlag,
67-
utils.OverrideShanghai,
67+
utils.OverrideCancun,
6868
utils.EnablePersonal,
6969
utils.EthashCacheDirFlag,
7070
utils.EthashCachesInMemoryFlag,

cmd/utils/flags.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ var (
268268
Value: 2048,
269269
Category: flags.EthCategory,
270270
}
271-
OverrideShanghai = &cli.Uint64Flag{
272-
Name: "override.shanghai",
273-
Usage: "Manually specify the Shanghai fork timestamp, overriding the bundled setting",
271+
OverrideCancun = &cli.Uint64Flag{
272+
Name: "override.cancun",
273+
Usage: "Manually specify the Cancun fork timestamp, overriding the bundled setting",
274274
Category: flags.EthCategory,
275275
}
276276
// Light server and client settings

core/genesis.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func (e *GenesisMismatchError) Error() string {
267267

268268
// ChainOverrides contains the changes to chain config.
269269
type ChainOverrides struct {
270-
OverrideShanghai *uint64
270+
OverrideCancun *uint64
271271
}
272272

273273
// SetupGenesisBlock writes or updates the genesis block in db.
@@ -293,8 +293,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
293293
}
294294
applyOverrides := func(config *params.ChainConfig) {
295295
if config != nil {
296-
if overrides != nil && overrides.OverrideShanghai != nil {
297-
config.ShanghaiTime = overrides.OverrideShanghai
296+
if overrides != nil && overrides.OverrideCancun != nil {
297+
config.CancunTime = overrides.OverrideCancun
298298
}
299299
}
300300
}

eth/backend.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
194194
)
195195
// Override the chain config with provided settings.
196196
var overrides core.ChainOverrides
197-
if config.OverrideShanghai != nil {
198-
overrides.OverrideShanghai = config.OverrideShanghai
197+
if config.OverrideCancun != nil {
198+
overrides.OverrideCancun = config.OverrideCancun
199199
}
200200
eth.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, config.Genesis, &overrides, eth.engine, vmConfig, eth.shouldPreserve, &config.TxLookupLimit)
201201
if err != nil {

eth/ethconfig/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ type Config struct {
198198
// send-transaction variants. The unit is ether.
199199
RPCTxFeeCap float64
200200

201-
// OverrideShanghai (TODO: remove after the fork)
202-
OverrideShanghai *uint64 `toml:",omitempty"`
201+
// OverrideCancun (TODO: remove after the fork)
202+
OverrideCancun *uint64 `toml:",omitempty"`
203203
}
204204

205205
// CreateConsensusEngine creates a consensus engine for the given chain configuration.

eth/ethconfig/gen_config.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

les/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*LightEthereum, error) {
9494
return nil, err
9595
}
9696
var overrides core.ChainOverrides
97-
if config.OverrideShanghai != nil {
98-
overrides.OverrideShanghai = config.OverrideShanghai
97+
if config.OverrideCancun != nil {
98+
overrides.OverrideCancun = config.OverrideCancun
9999
}
100100
chainConfig, genesisHash, genesisErr := core.SetupGenesisBlockWithOverride(chainDb, trie.NewDatabase(chainDb), config.Genesis, &overrides)
101101
if _, isCompat := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !isCompat {

0 commit comments

Comments
 (0)