should_extend_payload fix

This commit is contained in:
Eitan Seri-Levi
2026-04-30 15:14:02 +02:00
parent 2585096de6
commit c9c5a9e7ab
2 changed files with 12 additions and 3 deletions

View File

@@ -116,6 +116,10 @@ impl<T: BeaconChainTypes> GossipVerifiedInclusionList<T> {
return Err(GossipInclusionListError::InvalidSignature); return Err(GossipInclusionListError::InvalidSignature);
} }
// TODO(focil): Per spec p2p-interface.md rule 5, the first OR second valid message
// should be allowed (to enable equivocation detection in the cache). Currently this
// rejects any second message, making the cache's equivocation logic dead code.
// See: https://github.com/ethereum/consensus-specs/blob/master/specs/heze/p2p-interface.md#inclusion_list
if chain.inclusion_list_seen(signed_il) { if chain.inclusion_list_seen(signed_il) {
return Err(GossipInclusionListError::PriorInclusionListKnown); return Err(GossipInclusionListError::PriorInclusionListKnown);
} }

View File

@@ -1510,9 +1510,14 @@ impl ProtoArray {
proto_node: &ProtoNode, proto_node: &ProtoNode,
proposer_boost_root: Hash256, proposer_boost_root: Hash256,
) -> Result<bool, Error> { ) -> Result<bool, Error> {
// If the block's inclusion list satisfaction has been recorded as false, // Per spec: is_payload_inclusion_list_satisfied returns false unless the
// do not extend the payload. // root is in the map AND the value is true.
if self.payload_inclusion_list_satisfaction.get(&fc_node.root) == Some(&false) { if !self
.payload_inclusion_list_satisfaction
.get(&fc_node.root)
.copied()
.unwrap_or(false)
{
return Ok(false); return Ok(false);
} }