cmd/utils, eth/ethconfig: polish

This commit is contained in:
Gary Rong 2026-07-14 14:45:19 +08:00
parent 5e8c2aa302
commit 439929b975
3 changed files with 8 additions and 8 deletions

View file

@ -1923,11 +1923,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
} }
if ctx.IsSet(EngineMaxReorgDepthFlag.Name) { if ctx.IsSet(EngineMaxReorgDepthFlag.Name) {
cfg.EngineMaxReorgDepth = ctx.Uint64(EngineMaxReorgDepthFlag.Name) cfg.EngineMaxReorgDepth = ctx.Uint64(EngineMaxReorgDepthFlag.Name)
if cfg.EngineMaxReorgDepth != 0 { }
log.Info("Set engine API maximum reorg depth", "depth", cfg.EngineMaxReorgDepth) if cfg.EngineMaxReorgDepth != 0 {
} else { log.Info("Engine API maximum reorg depth", "depth", cfg.EngineMaxReorgDepth)
log.Info("Engine API reorg depth limit disabled") } else {
} log.Info("Engine API reorg depth limit disabled")
} }
if ctx.Bool(NoDiscoverFlag.Name) { if ctx.Bool(NoDiscoverFlag.Name) {
cfg.EthDiscoveryURLs, cfg.SnapDiscoveryURLs = []string{}, []string{} cfg.EthDiscoveryURLs, cfg.SnapDiscoveryURLs = []string{}, []string{}

View file

@ -207,7 +207,7 @@ type Config struct {
// EngineMaxReorgDepth is the maximum depth the chain head can be rewound // EngineMaxReorgDepth is the maximum depth the chain head can be rewound
// to an already-canonical ancestor by engine API forkchoiceUpdated calls // to an already-canonical ancestor by engine API forkchoiceUpdated calls
// (0 = no limit). // (0 = no limit).
EngineMaxReorgDepth uint64 EngineMaxReorgDepth uint64 `toml:",omitempty"`
// OverrideOsaka (TODO: remove after the fork) // OverrideOsaka (TODO: remove after the fork)
OverrideOsaka *uint64 `toml:",omitempty"` OverrideOsaka *uint64 `toml:",omitempty"`

View file

@ -63,7 +63,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
RPCGasCap uint64 RPCGasCap uint64
RPCEVMTimeout time.Duration RPCEVMTimeout time.Duration
RPCTxFeeCap float64 RPCTxFeeCap float64
EngineMaxReorgDepth uint64 EngineMaxReorgDepth uint64 `toml:",omitempty"`
OverrideOsaka *uint64 `toml:",omitempty"` OverrideOsaka *uint64 `toml:",omitempty"`
OverrideAmsterdam *uint64 `toml:",omitempty"` OverrideAmsterdam *uint64 `toml:",omitempty"`
OverrideBPO1 *uint64 `toml:",omitempty"` OverrideBPO1 *uint64 `toml:",omitempty"`
@ -181,7 +181,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
RPCGasCap *uint64 RPCGasCap *uint64
RPCEVMTimeout *time.Duration RPCEVMTimeout *time.Duration
RPCTxFeeCap *float64 RPCTxFeeCap *float64
EngineMaxReorgDepth *uint64 EngineMaxReorgDepth *uint64 `toml:",omitempty"`
OverrideOsaka *uint64 `toml:",omitempty"` OverrideOsaka *uint64 `toml:",omitempty"`
OverrideAmsterdam *uint64 `toml:",omitempty"` OverrideAmsterdam *uint64 `toml:",omitempty"`
OverrideBPO1 *uint64 `toml:",omitempty"` OverrideBPO1 *uint64 `toml:",omitempty"`