Skip to content

Commit 7e21f6a

Browse files
Get electra_op_pool up to date (sigp#5756)
* 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 <[email protected]>
1 parent 3d47cb3 commit 7e21f6a

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,17 +1677,14 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
16771677
}
16781678
}
16791679

1680+
// TODO(electra): call this function from the new beacon API method
16801681
pub fn get_aggregated_attestation_electra(
16811682
&self,
1682-
slot: Slot,
1683-
attestation_data_root: &Hash256,
1683+
data: &AttestationData,
16841684
committee_index: CommitteeIndex,
16851685
) -> Result<Option<Attestation<T::EthSpec>>, Error> {
1686-
let attestation_key = crate::naive_aggregation_pool::AttestationKey::new_electra(
1687-
slot,
1688-
*attestation_data_root,
1689-
committee_index,
1690-
);
1686+
let attestation_key =
1687+
crate::naive_aggregation_pool::AttestationKey::new_electra(data, committee_index);
16911688
if let Some(attestation) = self.naive_aggregation_pool.read().get(&attestation_key) {
16921689
self.filter_optimistic_attestation(attestation)
16931690
.map(Option::Some)

beacon_node/beacon_chain/src/naive_aggregation_pool.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type SyncDataRoot = Hash256;
1919
#[derive(Debug, Clone, PartialEq)]
2020
pub struct AttestationKey {
2121
data_root: Hash256,
22-
committee_index: Option<CommitteeIndex>,
22+
committee_index: Option<u64>,
2323
slot: Slot,
2424
}
2525

@@ -96,9 +96,10 @@ impl AttestationKey {
9696
}
9797
}
9898

99-
pub fn new_electra(slot: Slot, data_root: Hash256, committee_index: CommitteeIndex) -> Self {
99+
pub fn new_electra(data: &AttestationData, committee_index: u64) -> Self {
100+
let slot = data.slot;
100101
Self {
101-
data_root,
102+
data_root: data.tree_hash_root(),
102103
committee_index: Some(committee_index),
103104
slot,
104105
}

0 commit comments

Comments
 (0)