fix: ignore PTC attestations for empty assigned slots#9427
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new error code INVALID_BLOCK_SLOT and adds validation to ensure that the block referenced by a payload attestation matches the attestation's slot. The reviewer pointed out a potential runtime TypeError because getBlockHexDefaultStatus can return undefined (which would bypass the block === null check), and suggested caching the redundant toRootHex calls to optimize performance.
Performance Report✔️ no performance regression detected Full benchmark results
|
| blockSlot: block.slot, | ||
| slot: data.slot, | ||
| }); | ||
| } |
There was a problem hiding this comment.
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?
see ethereum/consensus-specs#5281