Fix non-canonical payload attestation processing

This commit is contained in:
Michael Sproul
2026-05-14 13:23:51 +10:00
parent 1a68631180
commit c03c045f8b
11 changed files with 500 additions and 374 deletions

View File

@@ -363,6 +363,30 @@ pub fn indexed_payload_attestation_signature_set<'a, 'b, E, F>(
indexed_payload_attestation: &'b IndexedPayloadAttestation<E>,
spec: &'a ChainSpec,
) -> Result<SignatureSet<'a>>
where
E: EthSpec,
F: Fn(usize) -> Option<Cow<'a, PublicKey>>,
{
let fork = state.fork();
indexed_payload_attestation_signature_set_from_pubkeys(
get_pubkey,
signature,
indexed_payload_attestation,
&fork,
state.genesis_validators_root(),
spec,
)
}
pub fn indexed_payload_attestation_signature_set_from_pubkeys<'a, 'b, E, F>(
get_pubkey: F,
signature: &'a AggregateSignature,
indexed_payload_attestation: &'b IndexedPayloadAttestation<E>,
fork: &Fork,
genesis_validators_root: Hash256,
spec: &'a ChainSpec,
) -> Result<SignatureSet<'a>>
where
E: EthSpec,
F: Fn(usize) -> Option<Cow<'a, PublicKey>>,
@@ -378,12 +402,7 @@ where
.data
.slot
.epoch(E::slots_per_epoch());
let domain = spec.get_domain(
epoch,
Domain::PTCAttester,
&state.fork(),
state.genesis_validators_root(),
);
let domain = spec.get_domain(epoch, Domain::PTCAttester, fork, genesis_validators_root);
let message = indexed_payload_attestation.data.signing_root(domain);