[r3.4] execution/p2p, execution/engineapi: fail-fast NewPayload backward download when gap exceeds limit#21502
Merged
Conversation
…nload when gap exceeds limit (#21489) 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. - **\`execution/p2p/bbd.go\`** — \`downloadInitialHeader\`'s early-exit check 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. - **\`execution/engineapi/engine_block_downloader/block_downloader.go\`** — added a short-circuit at the top of \`downloadBlocks\` for \`NewPayloadTrigger\`. When \`abs(currentHead - parent) > MaxReorgDepth\` we return \`ErrChainLengthExceedsLimit\` without spawning the bbd goroutine. - \`download()\` now logs the chain-length-exceeded case at INFO rather than WARN, since per @taratorio's triage on #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. - [x] New unit tests in \`execution/p2p/bbd_test.go\` cover the symmetric fail-fast check in both directions (EL behind / EL ahead). - [x] New \`TestNewPayloadGapExceedsLimit\` table test in \`execution/engineapi/engine_block_downloader/block_downloader_test.go\` covers the boundary conditions of the predicate. - [x] \`make lint && make erigon integration\` clean. - [ ] CI: \`sync-with-externalcl\` no longer log-spams the WARN line per slot. 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](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> (cherry picked from commit bc12fe0)
4 tasks
AskAlexSharov
approved these changes
May 29, 2026
yperbasis
added a commit
that referenced
this pull request
Jun 1, 2026
Adds the **v3.4.3** section to `ChangeLog.md`, covering the user-facing changes merged to `release/3.4` since v3.4.2, and sets the v3.4.2 header to its release date (2026-05-22). **Bugfixes** - #21538 — second fix for the post-reorg `gas used mismatch` / state-leak still hitting v3.4.2 users - #21507 — `debug_getModifiedAccountsByHash` / `ByNumber` now match Geth semantics - #21389 — `--rpc.logs.maxresults` (documented in 3.4.0) now takes effect via the CLI **Improvements** - #21502 — fail-fast on oversized `engine_newPayload` backward download (less per-slot log spam / wasted fetches) Docs-only / internal PRs (#21451, #21408) are intentionally omitted. Version bump tracked separately in #21547. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (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.
Cherry-pick of #21489 to
release/3.4.r3.4-specific adaptations
execution/engineapi/engine_block_downloader/block_downloader_test.godid not exist onrelease/3.4(file was introduced by execution/engineapi: replay cached validation error on bad-block short-circuit #21362, not backported). The cherry-pick keeps only the newTestNewPayloadGapExceedsLimittest added by execution/p2p, execution/engineapi: fail-fast NewPayload backward download when gap exceeds limit #21489; the unrelatedTestBadHeader_*tests from execution/engineapi: replay cached validation error on bad-block short-circuit #21362 are not pulled in.