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) {
cfg.EngineMaxReorgDepth = ctx.Uint64(EngineMaxReorgDepthFlag.Name)
if cfg.EngineMaxReorgDepth != 0 {
log.Info("Set engine API maximum reorg depth", "depth", cfg.EngineMaxReorgDepth)
} else {
log.Info("Engine API reorg depth limit disabled")
}
}
if cfg.EngineMaxReorgDepth != 0 {
log.Info("Engine API maximum reorg depth", "depth", cfg.EngineMaxReorgDepth)
} else {
log.Info("Engine API reorg depth limit disabled")
}
if ctx.Bool(NoDiscoverFlag.Name) {
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
// to an already-canonical ancestor by engine API forkchoiceUpdated calls
// (0 = no limit).
EngineMaxReorgDepth uint64
EngineMaxReorgDepth uint64 `toml:",omitempty"`
// OverrideOsaka (TODO: remove after the fork)
OverrideOsaka *uint64 `toml:",omitempty"`

View file

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