Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumas committed Dec 5, 2024
1 parent 2c16c66 commit 0865733
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 20 additions & 4 deletions block_producer/src/block_producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,18 +847,34 @@ impl<P: Preset, W: Wait> BlockBuildContext<P, W> {
{
ContiguousList::default()
} else {
// TODO(feature/electra): don't ignore errors
let attestations = attestations
.into_iter()
.filter_map(|attestation| {
operation_pools::convert_to_electra_attestation(attestation).ok()
match operation_pools::convert_to_electra_attestation(attestation) {
Ok(electra_attestation) => Some(electra_attestation),
Err(error) => {
warn!("unable to convert to electra attestation: {error:?}");
None
}
}
})
.chunk_by(|attestation| attestation.data);
.chunk_by(|attestation| {
(
attestation.data,
misc::get_committee_indices::<P>(attestation.committee_bits).next(),
)
});

let attestations = attestations
.into_iter()
.filter_map(|(_, attestations)| {
Self::compute_on_chain_aggregate(attestations).ok()
match Self::compute_on_chain_aggregate(attestations) {
Ok(electra_aggregate) => Some(electra_aggregate),
Err(error) => {
warn!("unable to compute on chain aggregate: {error:?}");
None
}
}
})
.take(P::MaxAttestationsElectra::USIZE);

Expand Down
2 changes: 1 addition & 1 deletion operation_pools/src/attestation_agg_pool/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<P: Preset, W: Wait> PoolTask for BestProposableAttestationsTask<P, W> {
return Ok(attestations);
}

DebugAttestationPacker.warn("no optimal attestations for slot: {slot}");
DebugAttestationPacker.warn(format_args!("no optimal attestations for slot: {slot}"));

let attestation_packer = AttestationPacker::new(
controller.chain_config().clone_arc(),
Expand Down

0 comments on commit 0865733

Please sign in to comment.