Skip to content

[r3.4] execution/p2p, execution/engineapi: fail-fast NewPayload backward download when gap exceeds limit#21502

Merged
taratorio merged 1 commit into
release/3.4from
cherry-pick-21489-to-release-3.4
May 29, 2026
Merged

[r3.4] execution/p2p, execution/engineapi: fail-fast NewPayload backward download when gap exceeds limit#21502
taratorio merged 1 commit into
release/3.4from
cherry-pick-21489-to-release-3.4

Conversation

@taratorio

Copy link
Copy Markdown
Member

Cherry-pick of #21489 to release/3.4.

r3.4-specific adaptations

…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)
@taratorio taratorio merged commit 4c7849f into release/3.4 May 29, 2026
22 of 23 checks passed
@taratorio taratorio deleted the cherry-pick-21489-to-release-3.4 branch May 29, 2026 04:22
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants