-
-
Notifications
You must be signed in to change notification settings - Fork 460
fix: ignore PTC attestations for empty assigned slots #9427
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 1 commit
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 |
|---|---|---|
|
|
@@ -61,13 +61,25 @@ async function validatePayloadAttestationMessage( | |
| // [IGNORE] The message's block `data.beacon_block_root` has been seen (via | ||
| // gossip or non-gossip sources) (a client MAY queue attestation for processing | ||
| // once the block is retrieved. Note a client might want to request payload after). | ||
| if (!chain.forkChoice.hasBlock(data.beaconBlockRoot)) { | ||
| const block = chain.forkChoice.getBlockHexDefaultStatus(toRootHex(data.beaconBlockRoot)); | ||
| if (block === null) { | ||
| throw new PayloadAttestationError(GossipAction.IGNORE, { | ||
| code: PayloadAttestationErrorCode.UNKNOWN_BLOCK_ROOT, | ||
| blockRoot: toRootHex(data.beaconBlockRoot), | ||
| }); | ||
| } | ||
|
|
||
| // [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, | ||
| }); | ||
| } | ||
|
Member
Author
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. 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 |
||
|
|
||
| const state = chain.getHeadState(); | ||
| if (!isStatePostGloas(state)) { | ||
| throw new Error(`Expected gloas+ state for payload attestation validation, got fork=${state.forkName}`); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.