@@ -103,14 +103,14 @@ pub mod attesting_indices_electra {
103
103
104
104
let committee_count_per_slot = committees. len ( ) as u64 ;
105
105
let mut participant_count = 0 ;
106
- for index in committee_indices {
106
+ for committee_index in committee_indices {
107
107
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 ) ) ?;
110
110
111
111
// 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 ) ) ;
114
114
}
115
115
participant_count. safe_add_assign ( beacon_committee. committee . len ( ) as u64 ) ?;
116
116
let committee_attesters = beacon_committee
@@ -127,6 +127,12 @@ pub mod attesting_indices_electra {
127
127
} )
128
128
. collect :: < HashSet < u64 > > ( ) ;
129
129
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
+
130
136
attesting_indices. extend ( committee_attesters) ;
131
137
committee_offset. safe_add_assign ( beacon_committee. committee . len ( ) ) ?;
132
138
}
0 commit comments