diff --git a/beacon_node/beacon_chain/src/attestation_verification.rs b/beacon_node/beacon_chain/src/attestation_verification.rs index 5ffe4b04893..f80d74aec44 100644 --- a/beacon_node/beacon_chain/src/attestation_verification.rs +++ b/beacon_node/beacon_chain/src/attestation_verification.rs @@ -583,6 +583,7 @@ impl<'a, T: BeaconChainTypes> IndexedAggregatedAttestation<'a, T> { })?; if let Some(committee) = committee { + // TODO(electra): // Note: this clones the signature which is known to be a relatively slow operation. // // Future optimizations should remove this clone. @@ -622,7 +623,7 @@ impl<'a, T: BeaconChainTypes> IndexedAggregatedAttestation<'a, T> { let indexed_attestation = match map_attestation_committees( chain, - &attestation, + attestation, get_indexed_attestation_with_committee, ) { Ok(indexed_attestation) => indexed_attestation, @@ -1330,7 +1331,7 @@ pub fn obtain_indexed_attestation_and_committees_per_slot( chain: &BeaconChain, attestation: AttestationRef, ) -> Result<(IndexedAttestation, CommitteesPerSlot), Error> { - map_attestation_committees(chain, &attestation, |(committees, committees_per_slot)| { + map_attestation_committees(chain, attestation, |(committees, committees_per_slot)| { match attestation { AttestationRef::Base(att) => { let committee = committees @@ -1384,7 +1385,7 @@ pub fn obtain_indexed_attestation_and_committees_per_slot( /// from disk and then update the `shuffling_cache`. fn map_attestation_committees( chain: &BeaconChain, - attestation: &AttestationRef, + attestation: AttestationRef, map_fn: F, ) -> Result where diff --git a/beacon_node/operation_pool/src/attestation_storage.rs b/beacon_node/operation_pool/src/attestation_storage.rs index 33bf4580307..04eb6c0db10 100644 --- a/beacon_node/operation_pool/src/attestation_storage.rs +++ b/beacon_node/operation_pool/src/attestation_storage.rs @@ -239,6 +239,7 @@ impl AttestationMap { let attestation_map = self.checkpoint_map.entry(checkpoint).or_default(); let attestations = attestation_map.attestations.entry(data).or_default(); + // TODO(electra): // Greedily aggregate the attestation with all existing attestations. // NOTE: this is sub-optimal and in future we will remove this in favour of max-clique // aggregation.