Skip to content

fix: require imported payload for index==1 attestation gossip - #9611

Merged
nflaig merged 1 commit into
nc/alpha.12from
nc/alpha.12-attestation-payload-verified
Jul 7, 2026
Merged

fix: require imported payload for index==1 attestation gossip#9611
nflaig merged 1 commit into
nc/alpha.12from
nc/alpha.12-attestation-payload-verified

Conversation

@ensi321

@ensi321 ensi321 commented Jul 7, 2026

Copy link
Copy Markdown
Member

…sus-specs #5355)

Attestation gossip with data.index==1 now requires the payload to be fully
imported (forkChoice.hasPayloadHexUnsafe = is_payload_verified) rather than
merely seen, per consensus-specs #5355.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ensi321
ensi321 requested a review from a team as a code owner July 7, 2026 06:26

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the attestation validation logic to ensure that the execution payload for a past block is fully imported and verified (using chain.forkChoice.hasPayloadHexUnsafe) rather than just seen on gossip, aligning with consensus-specs #5355. Additionally, it updates documentation comments in proposerPreferencesPool.ts and attestation.ts to reflect these changes. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe70c83e4f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (
block !== null &&
attData.index === 1 &&
!chain.forkChoice.hasPayloadHexUnsafe(toRootHex(attData.beaconBlockRoot))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce imported-payload rule for aggregates too

Please apply the same imported-payload gate to aggregate validation as well. validateAggregateAndProof still uses chain.seenPayloadEnvelope(...), and seenPayloadEnvelope includes seenPayloadEnvelopeInputCache.hasPayload before importExecutionPayload adds the FULL fork-choice variant, so an index==1 aggregate submitted through publishAggregateAndProofsV2 can still be accepted and re-published after merely seeing a gossip envelope but before DA/EL import has completed. That leaves the #5355 rule enforced for single attestations here but not for aggregated attestations carrying the same payload-present vote.

Useful? React with 👍 / 👎.

if (
block !== null &&
attData.index === 1 &&
!chain.forkChoice.hasPayloadHexUnsafe(toRootHex(attData.beaconBlockRoot))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this code was unreachable anyways because we would queue those attestations and not process them cc @twoeths correct me if that's wrong

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we do queue index=1 gossip attestation awaiting for payload
for api attestation, we did not handle that. We only call await validateGossipFnRetryUnknownRoot(validateFn, network, chain, slot, beaconBlockRoot), which is not enough for gloas.

if (block !== null && attData.index === 1 && !chain.seenPayloadEnvelope(toRootHex(attData.beaconBlockRoot))) {
// the corresponding execution payload for `block` has been fully imported, including its
// data -- i.e. `is_payload_verified(store, beacon_block_root)` returns True (consensus-specs
// #5355). `forkChoice.hasPayloadHexUnsafe` is the equivalent of `root in store.payloads`:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to add a AGENTS.md rule or something to stop these spec reference like consensus-specs #5355, I would rather not have this or have a full URL to the spec PR

@nflaig
nflaig merged commit 8d52dd3 into nc/alpha.12 Jul 7, 2026
14 of 16 checks passed
@nflaig
nflaig deleted the nc/alpha.12-attestation-payload-verified branch July 7, 2026 07:19
ensi321 added a commit that referenced this pull request Jul 23, 2026
Mirror the beacon_attestation is_payload_verified gating (#9611) on the
beacon_aggregate_and_proof topic per
https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.12/specs/gloas/p2p-interface.md#modified-beacon_aggregate_and_proof
An index==1 aggregate was accepted once the envelope was merely seen on
gossip, before it was imported and verified.

Co-Authored-By: Claude Fable 5 <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