diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 99a962452c..6174d53a0a 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -174,16 +174,16 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { cfg.Eth.ECBP1100 = new(big.Int).SetUint64(n) } } - if ctx.IsSet(utils.ECBP1100DeactivateFlag.Name) { - if n := ctx.Uint64(utils.ECBP1100DeactivateFlag.Name); n != math.MaxUint64 { - cfg.Eth.ECBP1100Deactivate = new(big.Int).SetUint64(n) - } - } if ctx.IsSet(utils.ECBP1100NoDisableFlag.Name) { if enable := ctx.Bool(utils.ECBP1100NoDisableFlag.Name); enable { cfg.Eth.ECBP1100NoDisable = &enable } } + if ctx.IsSet(utils.OverrideECBP1100DeactivateFlag.Name) { + if n := ctx.Uint64(utils.OverrideECBP1100DeactivateFlag.Name); n != math.MaxUint64 { + cfg.Eth.OverrideECBP1100Deactivate = new(big.Int).SetUint64(n) + } + } if ctx.IsSet(utils.OverrideShanghai.Name) { v := ctx.Uint64(utils.OverrideShanghai.Name) cfg.Eth.OverrideShanghai = &v diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 186e1c626b..0255d798f7 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -167,7 +167,7 @@ var ( utils.MinerNotifyFullFlag, utils.ECBP1100Flag, utils.ECBP1100NoDisableFlag, - utils.ECBP1100DeactivateFlag, + utils.OverrideECBP1100DeactivateFlag, configFileFlag, }, utils.NetworkFlags, utils.DatabasePathFlags) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 558f17b247..2182e0d5d3 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1064,18 +1064,19 @@ Please note that --` + MetricsHTTPFlag.Name + ` must be set to start the server. Value: "", } ECBP1100Flag = &cli.Uint64Flag{ - Name: "ecbp1100", - Usage: "Configure ECBP-1100 (MESS) block activation number", - Value: math.MaxUint64, + Name: "ecbp1100", // should have been override.ecbp1100, but maintained now for backwards compatibility + Usage: "Manually specify the ECBP-1100 (MESS) block activation number, overriding the bundled setting", + Category: flags.EthCategory, } - ECBP1100DeactivateFlag = &cli.Uint64Flag{ - Name: "ecbp1100.disable", - Usage: "Disable ECBP-1100 (MESS) block activation number", - Value: math.MaxUint64, + OverrideECBP1100DeactivateFlag = &cli.Uint64Flag{ + Name: "override.ecbp1100.deactivate", + Usage: "Manually specify the ECBP-1100 (MESS) deactivation block number, overriding the bundled setting", + Category: flags.EthCategory, } ECBP1100NoDisableFlag = &cli.BoolFlag{ - Name: "ecbp1100.nodisable", - Usage: "Short-circuit ECBP-1100 (MESS) disable mechanisms; (yields a permanent-once-activated state, deactivating auto-shutoff mechanisms)", + Name: "ecbp1100.nodisable", + Usage: "Short-circuit ECBP-1100 (MESS) disable mechanisms; (yields a permanent-once-activated state, deactivating auto-shutoff mechanisms)", + Category: flags.DeprecatedCategory, } MetricsEnableInfluxDBV2Flag = &cli.BoolFlag{ diff --git a/eth/backend.go b/eth/backend.go index 6f87819815..f8232de2e6 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -20,7 +20,6 @@ package eth import ( "errors" "fmt" - "math" "math/big" "runtime" "sync" @@ -231,18 +230,16 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { } eth.bloomIndexer.Start(eth.blockchain) // Handle artificial finality config override cases. - if config.ECBP1100 != nil { - if n := config.ECBP1100.Uint64(); n != math.MaxUint64 { - if err := eth.blockchain.Config().SetECBP1100Transition(&n); err != nil { - return nil, err - } + if n := config.ECBP1100; n != nil { + v := n.Uint64() + if err := eth.blockchain.Config().SetECBP1100Transition(&v); err != nil { + return nil, err } } - if config.ECBP1100Deactivate != nil { - if n := config.ECBP1100Deactivate.Uint64(); n != math.MaxUint64 { - if err := eth.blockchain.Config().SetECBP1100DeactivateTransition(&n); err != nil { - return nil, err - } + if n := config.OverrideECBP1100Deactivate; n != nil { + v := n.Uint64() + if err := eth.blockchain.Config().SetECBP1100DeactivateTransition(&v); err != nil { + return nil, err } } diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 626f20716a..417b70f8c8 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -219,7 +219,7 @@ type Config struct { // Manual configuration field for ECBP1100 activation number. Used for modifying genesis config via CLI flag. ECBP1100 *big.Int // Manual configuration field for ECBP1100's disablement block number. Used for modifying genesis config via CLI flag. - ECBP1100Deactivate *big.Int + OverrideECBP1100Deactivate *big.Int // ECBP1100NoDisable overrides // When this value is *true, ECBP100 will not (ever) be disabled; when *false, it will never be enabled. diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index 109a8666f0..fc71033021 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -119,7 +119,7 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.Checkpoint = c.Checkpoint enc.CheckpointOracle = c.CheckpointOracle enc.ECBP1100 = c.ECBP1100 - enc.ECBP1100Disable = c.ECBP1100Deactivate + enc.ECBP1100Disable = c.OverrideECBP1100Deactivate enc.ECBP1100NoDisable = c.ECBP1100NoDisable enc.OverrideShanghai = c.OverrideShanghai @@ -326,7 +326,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { c.ECBP1100 = dec.ECBP1100 } if dec.ECBP1100Disable != nil { - c.ECBP1100Deactivate = dec.ECBP1100Disable + c.OverrideECBP1100Deactivate = dec.ECBP1100Disable } if dec.ECBP1100NoDisable != nil { c.ECBP1100NoDisable = dec.ECBP1100NoDisable