@@ -407,10 +407,16 @@ async function validateAttestationNoSignatureCheck(
407407 if ( ! isForkPostElectra ( fork ) ) {
408408 // The validity of aggregation bits are already checked above
409409 assert . notNull ( aggregationBits ) ;
410- const bitIndex = aggregationBits . getSingleTrueBit ( ) ;
411- assert . notNull ( bitIndex ) ;
412410
413- validatorIndex = committeeValidatorIndices [ bitIndex ] ;
411+ if ( attestationOrCache . attestation ) {
412+ const bitIndex = aggregationBits . getSingleTrueBit ( ) ;
413+ assert . notNull ( bitIndex ) ;
414+
415+ validatorIndex = committeeValidatorIndices [ bitIndex ] ;
416+ } else {
417+ validatorIndex = attestationOrCache . cache . attesterIndex ;
418+ }
419+
414420 // [REJECT] The number of aggregation bits matches the committee size
415421 // -- i.e. len(attestation.aggregation_bits) == len(get_beacon_committee(state, data.slot, data.index)).
416422 // > TODO: Is this necessary? Lighthouse does not do this check.
@@ -420,7 +426,10 @@ async function validateAttestationNoSignatureCheck(
420426 } ) ;
421427 }
422428 } else {
423- validatorIndex = ( attestationOrCache . attestation as SingleAttestation < ForkPostElectra > ) . attesterIndex ;
429+ validatorIndex = attestationOrCache . attestation
430+ ? ( attestationOrCache . attestation as SingleAttestation < ForkPostElectra > ) . attesterIndex
431+ : attestationOrCache . cache . attesterIndex ;
432+
424433 // [REJECT] The attester is a member of the committee -- i.e.
425434 // `attestation.attester_index in get_beacon_committee(state, attestation.data.slot, index)`.
426435 // If `aggregationBitsElectra` exists, that means we have already cached it. No need to check again
@@ -498,6 +507,7 @@ async function validateAttestationNoSignatureCheck(
498507 chain . seenAttestationDatas . add ( attSlot , committeeIndex , attDataKey , {
499508 committeeValidatorIndices,
500509 committeeIndex,
510+ attesterIndex : validatorIndex ,
501511 signingRoot : signatureSet . signingRoot ,
502512 subnet : expectedSubnet ,
503513 // precompute this to be used in forkchoice
0 commit comments