Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/beacon-node/src/chain/errors/payloadAttestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export enum PayloadAttestationErrorCode {
NOT_CURRENT_SLOT = "PAYLOAD_ATTESTATION_ERROR_NOT_CURRENT_SLOT",
PAYLOAD_ATTESTATION_ALREADY_KNOWN = "PAYLOAD_ATTESTATION_ERROR_PAYLOAD_ATTESTATION_ALREADY_KNOWN",
UNKNOWN_BLOCK_ROOT = "PAYLOAD_ATTESTATION_ERROR_UNKNOWN_BLOCK_ROOT",
INVALID_BLOCK_SLOT = "PAYLOAD_ATTESTATION_ERROR_INVALID_BLOCK_SLOT",
INVALID_BLOCK = "PAYLOAD_ATTESTATION_ERROR_INVALID_BLOCK",
INVALID_ATTESTER = "PAYLOAD_ATTESTATION_ERROR_INVALID_ATTESTER",
INVALID_SIGNATURE = "PAYLOAD_ATTESTATION_ERROR_INVALID_SIGNATURE",
Expand All @@ -18,6 +19,7 @@ export type PayloadAttestationErrorType =
blockRoot: RootHex;
}
| {code: PayloadAttestationErrorCode.UNKNOWN_BLOCK_ROOT; blockRoot: RootHex}
| {code: PayloadAttestationErrorCode.INVALID_BLOCK_SLOT; blockRoot: RootHex; blockSlot: Slot; slot: Slot}
| {code: PayloadAttestationErrorCode.INVALID_BLOCK; blockRoot: RootHex}
| {code: PayloadAttestationErrorCode.INVALID_ATTESTER; attesterIndex: ValidatorIndex}
| {code: PayloadAttestationErrorCode.INVALID_SIGNATURE};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ async function validatePayloadAttestationMessage(
});
}

// [IGNORE] The block referenced by `data.beacon_block_root` is at slot `data.slot`,
// i.e. the block has `block.slot == data.slot`.
if (block.slot !== data.slot) {
throw new PayloadAttestationError(GossipAction.IGNORE, {
code: PayloadAttestationErrorCode.INVALID_BLOCK_SLOT,
blockRoot: toRootHex(data.beaconBlockRoot),
blockSlot: block.slot,
slot: data.slot,
});
}
Copy link
Copy Markdown
Member Author

@nflaig nflaig May 30, 2026

Choose a reason for hiding this comment

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

it's bit strange that this ignore is above the reject on L84 (anyways not relevant) but that's how the spec orders the checks, but pretty sure having "The message's block data.beacon_block_root passes validation." before slot check against that block is correct, @ensi321 is the spec ordering intended?


// [REJECT] The message's block `data.beacon_block_root` passes validation.
// TODO GLOAS: implement this. Technically if we cannot get proto block from fork choice,
// it is possible that the block didn't pass the validation
Expand Down
Loading