From 376c40845753f782bca5ab1cc910a6b734050c41 Mon Sep 17 00:00:00 2001 From: geemo Date: Tue, 14 Nov 2023 07:30:05 -0600 Subject: [PATCH] avoid deadlock by sequential iter and collecting then par iter --- beacon_node/operation_pool/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beacon_node/operation_pool/src/lib.rs b/beacon_node/operation_pool/src/lib.rs index 8f45fb9846e..37b8e44f950 100644 --- a/beacon_node/operation_pool/src/lib.rs +++ b/beacon_node/operation_pool/src/lib.rs @@ -259,7 +259,7 @@ impl OperationPool { return Ok(vec![]); }; let mut cliques_from_aggregates: Vec<_> = aggregate_attestations - .into_par_iter() + .iter() .filter(|(data, _)| { data.slot + spec.min_attestation_inclusion_delay <= state.slot() && state.slot() <= data.slot + T::slots_per_epoch() @@ -272,6 +272,8 @@ impl OperationPool { num_valid.fetch_add(aggregates.len(), Ordering::Relaxed); (data, aggregates) }) + .collect::>() + .into_par_iter() .map(|(data, mut aggregates)| { // Take the N aggregates with the highest number of set bits // This is needed to avoid the bron_kerbosch algorithm generating millions of