Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
GeemoCandama committed Oct 7, 2023
1 parent ab2d4c7 commit 0c65f3d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions beacon_node/operation_pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,14 @@ impl<T: EthSpec> OperationPool<T> {
.collect();
*num_valid += aggregates.len() as i64;

// derive cliques for current attestation data
let cliques = bron_kerbosch(&aggregates, is_compatible);

// aggregate each cliques corresponding attestaiions
let mut clique_aggregates: Vec<CompactIndexedAttestation<_>> = cliques
let mut clique_aggregates: Vec<CompactIndexedAttestation<_>> = bron_kerbosch(&aggregates, is_compatible)
.iter()
.map(|clique| {
let mut res_att = aggregates[clique[0]].clone();
for ind in clique.iter().skip(1) {
res_att.aggregate(&aggregates[*ind]);
}
res_att
clique.iter().skip(1).fold(aggregates[clique[0]].clone(), |mut acc, &ind| {
acc.aggregate(&aggregates[ind]);
acc
})
})
.collect();
let mut indices_to_remove = Vec::new();
Expand Down

0 comments on commit 0c65f3d

Please sign in to comment.