Skip to content

Commit

Permalink
Fix aggregate and proof aggregator not in committee validation bug fo…
Browse files Browse the repository at this point in the history
…r post-Electra aggregates
  • Loading branch information
povi committed Nov 4, 2024
1 parent a72cc49 commit ca1f0c0
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions fork_choice_store/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1275,14 +1275,30 @@ impl<P: Preset> Store<P> {
},
);

let committee = accessors::beacon_committee(&target_state, slot, index)?;
let committee = if let Some(committee_bits) = aggregate.committee_bits() {
let committee_indices = misc::get_committee_indices::<P>(*committee_bits);

let mut committees = vec![];

for committee_index in committee_indices {
let committee = accessors::beacon_committee(&target_state, slot, committee_index)?;

committees.extend(committee);
}

committees.into()
} else {
accessors::beacon_committee(&target_state, slot, index)?
.into_iter()
.collect::<Box<[_]>>()
};

// > The aggregator's validator index is within the committee
ensure!(
committee.into_iter().contains(&aggregator_index),
committee.contains(&aggregator_index),
Error::AggregatorNotInCommittee {
aggregate_and_proof,
committee: committee.into_iter().collect(),
committee,
},
);

Expand Down

0 comments on commit ca1f0c0

Please sign in to comment.