Skip to content

Commit

Permalink
Some small changes (sigp#5739)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethDreamer authored and realbigsean committed Jun 25, 2024
1 parent 30ed62e commit b322b89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions beacon_node/beacon_chain/src/attestation_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1330,7 +1331,7 @@ pub fn obtain_indexed_attestation_and_committees_per_slot<T: BeaconChainTypes>(
chain: &BeaconChain<T>,
attestation: AttestationRef<T::EthSpec>,
) -> Result<(IndexedAttestation<T::EthSpec>, 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
Expand Down Expand Up @@ -1384,7 +1385,7 @@ pub fn obtain_indexed_attestation_and_committees_per_slot<T: BeaconChainTypes>(
/// from disk and then update the `shuffling_cache`.
fn map_attestation_committees<T, F, R>(
chain: &BeaconChain<T>,
attestation: &AttestationRef<T::EthSpec>,
attestation: AttestationRef<T::EthSpec>,
map_fn: F,
) -> Result<R, Error>
where
Expand Down
1 change: 1 addition & 0 deletions beacon_node/operation_pool/src/attestation_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ impl<E: EthSpec> AttestationMap<E> {
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.
Expand Down

0 comments on commit b322b89

Please sign in to comment.