-
-
Notifications
You must be signed in to change notification settings - Fork 479
fix: require imported payload for index==1 attestation gossip #9611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -319,10 +319,17 @@ async function validateAttestationNoSignatureCheck( | |
| // [REJECT] If `attestation.data.index == 1` (payload present for a past | ||
| // block), the execution payload for `block` passes validation. | ||
| // [IGNORE] When `attestation.data.index == 1` (payload present for a past block), | ||
| // the corresponding execution payload for `block` has been seen (a client MAY queue | ||
| // attestations for processing once the payload is retrieved and SHOULD request the | ||
| // payload envelope via `ExecutionPayloadEnvelopesByRoot`). | ||
| 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`: | ||
| // it is true only once the SignedExecutionPayloadEnvelope has been imported and verified, | ||
| // not merely seen on gossip. A client MAY queue attestations until the payload is imported | ||
| // and SHOULD request the payload envelope via `ExecutionPayloadEnvelopesByRoot`. | ||
| if ( | ||
| block !== null && | ||
| attData.index === 1 && | ||
| !chain.forkChoice.hasPayloadHexUnsafe(toRootHex(attData.beaconBlockRoot)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Please apply the same imported-payload gate to aggregate validation as well. Useful? React with 👍 / 👎.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes we do queue |
||
| ) { | ||
| throw new AttestationError(GossipAction.IGNORE, { | ||
| code: AttestationErrorCode.EXECUTION_PAYLOAD_NOT_SEEN, | ||
| beaconBlockRoot: toRootHex(attData.beaconBlockRoot), | ||
|
|
||
There was a problem hiding this comment.
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