We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8f4cf2 commit e2c6ff8Copy full SHA for e2c6ff8
operation_pools/src/attestation_agg_pool/attestation_packer.rs
@@ -138,6 +138,16 @@ impl<P: Preset> AttestationPacker<P> {
138
// - <https://en.wikipedia.org/wiki/Set_packing>
139
// - <https://cstheory.stackexchange.com/questions/21448/set-packing-with-maximum-coverage-objective>
140
// We use a greedy algorithm.
141
+
142
+ candidates.sort_by_cached_key(|attestation| {
143
+ self.added_weight(
144
+ attestation,
145
+ &previous_epoch_participation,
146
+ ¤t_epoch_participation,
147
+ )
148
+ .ok()
149
+ });
150
151
let attestations = core::iter::from_fn(move || {
152
let attestation = candidates.pop()?;
153
0 commit comments