Skip to content

Commit

Permalink
Get electra_op_pool up to date (sigp#5756)
Browse files Browse the repository at this point in the history
* fix get attesting indices (sigp#5742)

* fix get attesting indices

* better errors

* fix compile

* only get committee index once

* Ef test fixes (sigp#5753)

* attestation related ef test fixes

* delete commented out stuff

* Fix Aggregation Pool for Electra (sigp#5754)

* Fix Aggregation Pool for Electra

* Remove Outdated Interface

* fix ssz (sigp#5755)

---------

Co-authored-by: realbigsean <sean@sigmaprime.io>
  • Loading branch information
ethDreamer and realbigsean committed Jun 25, 2024
1 parent 3d47cb3 commit 7e21f6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
11 changes: 4 additions & 7 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1677,17 +1677,14 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}
}

// TODO(electra): call this function from the new beacon API method
pub fn get_aggregated_attestation_electra(
&self,
slot: Slot,
attestation_data_root: &Hash256,
data: &AttestationData,
committee_index: CommitteeIndex,
) -> Result<Option<Attestation<T::EthSpec>>, Error> {
let attestation_key = crate::naive_aggregation_pool::AttestationKey::new_electra(
slot,
*attestation_data_root,
committee_index,
);
let attestation_key =
crate::naive_aggregation_pool::AttestationKey::new_electra(data, committee_index);
if let Some(attestation) = self.naive_aggregation_pool.read().get(&attestation_key) {
self.filter_optimistic_attestation(attestation)
.map(Option::Some)
Expand Down
7 changes: 4 additions & 3 deletions beacon_node/beacon_chain/src/naive_aggregation_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type SyncDataRoot = Hash256;
#[derive(Debug, Clone, PartialEq)]
pub struct AttestationKey {
data_root: Hash256,
committee_index: Option<CommitteeIndex>,
committee_index: Option<u64>,
slot: Slot,
}

Expand Down Expand Up @@ -96,9 +96,10 @@ impl AttestationKey {
}
}

pub fn new_electra(slot: Slot, data_root: Hash256, committee_index: CommitteeIndex) -> Self {
pub fn new_electra(data: &AttestationData, committee_index: u64) -> Self {
let slot = data.slot;
Self {
data_root,
data_root: data.tree_hash_root(),
committee_index: Some(committee_index),
slot,
}
Expand Down

0 comments on commit 7e21f6a

Please sign in to comment.