diff --git a/eth2/state_processing/benching_utils/src/beacon_block_bencher.rs b/eth2/state_processing/benching_utils/src/beacon_block_bencher.rs index 3eafdc0c9..46e822baa 100644 --- a/eth2/state_processing/benching_utils/src/beacon_block_bencher.rs +++ b/eth2/state_processing/benching_utils/src/beacon_block_bencher.rs @@ -92,18 +92,20 @@ impl BeaconBlockBencher { // - The slot is too old to be included in a block at this slot. // - The `MAX_ATTESTATIONS`. loop { - if attestations_added == spec.max_attestations { - break; - } if state.slot >= slot + spec.slots_per_epoch { break; } for (committee, shard) in state.get_crosslink_committees_at_slot(slot, spec)? { - committees.push((slot, committee.clone(), committee.clone(), *shard)) + if attestations_added >= spec.max_attestations { + break; + } + + committees.push((slot, committee.clone(), committee.clone(), *shard)); + + attestations_added += 1; } - attestations_added += 1; slot -= 1; }