execution/p2p, execution/engineapi: fail-fast NewPayload backward download when gap exceeds limit#21489
Merged
Merged
Conversation
…nload when gap exceeds limit bbd.go's early-exit check was one-sided (`currentHead > headerNum`), so when the EL was behind the new payload by more than chainLengthLimit (the dominant failure in #21311 / #20419), the download still ran loadPeers + a 500-header batch fetch before failing on the post-batch chain-length check. Replace with a symmetric `AbsoluteDifference` so the check fires in both directions. Additionally, short-circuit `NewPayloadTrigger` in EngineBlockDownloader when the gap to the local head exceeds MaxReorgDepth so we don't spawn the bbd goroutine at all. Demote the resulting log line to INFO since this is expected behaviour — the EL is waiting on a later FCU or staged sync to close the gap. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
taratorio
approved these changes
May 28, 2026
Member
|
@yperbasis this is great, thanks! I had exact same thoughts and it was on my list. I would recommend we cherry-pick this to release/3.4 too |
Member
|
@yperbasis cherry picked in #21502 |
taratorio
added a commit
that referenced
this pull request
May 29, 2026
…ard download when gap exceeds limit (#21502) Cherry-pick of #21489 to `release/3.4`. ## r3.4-specific adaptations - `execution/engineapi/engine_block_downloader/block_downloader_test.go` did not exist on `release/3.4` (file was introduced by #21362, not backported). The cherry-pick keeps only the new `TestNewPayloadGapExceedsLimit` test added by #21489; the unrelated `TestBadHeader_*` tests from #21362 are not pulled in. Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tightens the EngineBlockDownloader's behaviour when a NewPayload arrives
for a block whose parent is more than `MaxReorgDepth` blocks away from
the local head — the scenario behind #21311 / #20419.
was one-sided (`currentHead > headerNum`), so when the EL was behind
the new payload the check was skipped and the download wasted a
`loadPeers` + 500-header batch fetch per slot before failing on the
post-batch `chainLen > limit` check. Replaced with a symmetric
`AbsoluteDifference` so the check fires in both directions.
added a short-circuit at the top of `downloadBlocks` for
`NewPayloadTrigger`. When `abs(currentHead - parent) > MaxReorgDepth`
we return `ErrChainLengthExceedsLimit` without spawning the bbd
goroutine.
than WARN, since per @taratorio's triage on [EngineBlockDownloader] could not process backward download request #21311 it's expected
behaviour, not an error — the EL relies on a later FCU (unbounded
download) or staged sync to close the gap.
The underlying "Prysm doesn't always send a follow-up FCU" issue is
unchanged; that part remains tracked under #20419.
Test plan
fail-fast check in both directions (EL behind / EL ahead).
`execution/engineapi/engine_block_downloader/block_downloader_test.go`
covers the boundary conditions of the predicate.
Closes #21309 (duplicate of #21311). Partial fix toward #21311 / #20419
— full resolution of those issues still needs the FCU side handled.
🤖 Generated with Claude Code