@@ -103,14 +103,14 @@ pub mod attesting_indices_electra {
103103
104104 let committee_count_per_slot = committees. len ( ) as u64 ;
105105 let mut participant_count = 0 ;
106- for index in committee_indices {
106+ for committee_index in committee_indices {
107107 let beacon_committee = committees
108- . get ( index as usize )
109- . ok_or ( Error :: NoCommitteeFound ( index ) ) ?;
108+ . get ( committee_index as usize )
109+ . ok_or ( Error :: NoCommitteeFound ( committee_index ) ) ?;
110110
111111 // This check is new to the spec's `process_attestation` in Electra.
112- if index >= committee_count_per_slot {
113- return Err ( BeaconStateError :: InvalidCommitteeIndex ( index ) ) ;
112+ if committee_index >= committee_count_per_slot {
113+ return Err ( BeaconStateError :: InvalidCommitteeIndex ( committee_index ) ) ;
114114 }
115115 participant_count. safe_add_assign ( beacon_committee. committee . len ( ) as u64 ) ?;
116116 let committee_attesters = beacon_committee
@@ -127,6 +127,12 @@ pub mod attesting_indices_electra {
127127 } )
128128 . collect :: < HashSet < u64 > > ( ) ;
129129
130+ // Require at least a single non-zero bit for each attesting committee bitfield.
131+ // This check is new to the spec's `process_attestation` in Electra.
132+ if committee_attesters. is_empty ( ) {
133+ return Err ( BeaconStateError :: EmptyCommittee ) ;
134+ }
135+
130136 attesting_indices. extend ( committee_attesters) ;
131137 committee_offset. safe_add_assign ( beacon_committee. committee . len ( ) ) ?;
132138 }
0 commit comments