eth/catalyst: allow reorg depth equal to maxReorgDepth (#35391)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

The deep-reorg check used depth >= maxReorgDepth, rejecting reorgs at
exactly the configured limit. Use > so a depth equal to maxReorgDepth is
still accepted.
This commit is contained in:
cui 2026-07-23 22:49:48 +08:00 committed by GitHub
parent f03b91cf28
commit b2ee83931b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -338,7 +338,7 @@ func (api *ConsensusAPI) forkchoiceUpdated(ctx context.Context, update engine.Fo
return valid(nil), nil return valid(nil), nil
} }
depth := api.eth.BlockChain().CurrentBlock().Number.Uint64() - block.NumberU64() depth := api.eth.BlockChain().CurrentBlock().Number.Uint64() - block.NumberU64()
if api.maxReorgDepth > 0 && depth >= api.maxReorgDepth { if api.maxReorgDepth > 0 && depth > api.maxReorgDepth {
log.Warn("Refusing too deep reorg", "depth", depth, "head", update.HeadBlockHash) log.Warn("Refusing too deep reorg", "depth", depth, "head", update.HeadBlockHash)
return engine.STATUS_INVALID, engine.TooDeepReorg.With(fmt.Errorf("reorg depth %d exceeds limit %d", depth, api.maxReorgDepth)) return engine.STATUS_INVALID, engine.TooDeepReorg.With(fmt.Errorf("reorg depth %d exceeds limit %d", depth, api.maxReorgDepth))
} }