Cap self-built payload envelopes at one per valid proposer per slot - #17433
Open
potuz wants to merge 1 commit into
Open
Cap self-built payload envelopes at one per valid proposer per slot#17433potuz wants to merge 1 commit into
potuz wants to merge 1 commit into
Conversation
Self-built execution payload envelopes bypassed both queue caps (maxPendingPayloadRoots and maxPendingBuildersPerRoot) in queuePendingPayloadEnvelope, and all self-build envelopes share one builder-index constant so the per-root dedup never fired across roots. A malicious current-slot proposer could sign unbounded self-build envelopes with distinct beacon block roots, each firing a sendBatchRootRequest, flooding peers with spurious block-by-root requests and getting us banned. Dedup self-build envelopes on the head-state proposer index for the current slot, recorded only after a successful signature check so a bad envelope cannot reserve a proposer's slot. This caps self-build at one queued payload (and one root request) per valid proposer per slot while still allowing one per distinct valid proposer across forks. Co-Authored-By: Claude Opus 4.8 <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.
Problem
In
queuePendingPayloadEnvelope, both capacity caps (maxPendingPayloadRoots=128,maxPendingBuildersPerRoot=2) are gated behind!isSelfBuild, and all self-build envelopes share one builder-index constant (BuilderIndexSelfBuild) so the per-rootinner[builderIdx]dedup never fires across roots.A malicious current-slot proposer holds the proposer key and can sign an unbounded number of self-build envelopes, each with a different
beacon_block_root, all validly signed. Each new root both adds a pending-map entry and fires asendBatchRootRequestgoroutine to fetch the unknown block. The resulting flood of spurious block-by-root requests gets us banned by our peers.Fix
Cap self-build at one queued payload per valid proposer index per slot, keyed on the head-state proposer for the current slot (
helpers.BeaconProposerIndexAtSlot). A valid self-build signature already ties the envelope to exactly that proposer, so the key is deterministic and not attacker-controlled.maxSelfBuildSigFailuresbudget is retained to bound bad-signature floods from non-proposers.queuePendingPayloadEnvelopeFromRootRequestneeds no change — it already enforces the caps and never fires a root request.Tests
Added to
pending_payload_envelope_test.go:Pre-existing
SelfBuildBypasses*tests still pass, confirming honest self-build is never starved by the external-builder caps; the new per-proposer bound is orthogonal.🤖 Generated with Claude Code