Skip to content

Commit ca09671

Browse files
authored
Revert "Get electra_op_pool up to date (#5756)" (#5757)
This reverts commit ab9e58a.
1 parent ab9e58a commit ca09671

File tree

12 files changed

+108
-307
lines changed

12 files changed

+108
-307
lines changed

beacon_node/beacon_chain/src/attestation_verification.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,11 +1309,10 @@ pub fn obtain_indexed_attestation_and_committees_per_slot<T: BeaconChainTypes>(
13091309
attesting_indices_electra::get_indexed_attestation(&committees, att)
13101310
.map(|attestation| (attestation, committees_per_slot))
13111311
.map_err(|e| {
1312-
let index = att.committee_index();
1313-
if e == BlockOperationError::BeaconStateError(NoCommitteeFound(index)) {
1312+
if e == BlockOperationError::BeaconStateError(NoCommitteeFound) {
13141313
Error::NoCommitteeForSlotAndIndex {
13151314
slot: att.data.slot,
1316-
index,
1315+
index: att.committee_index(),
13171316
}
13181317
} else {
13191318
Error::Invalid(e)

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,28 +1612,11 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
16121612
/// Returns an aggregated `Attestation`, if any, that has a matching `attestation.data`.
16131613
///
16141614
/// The attestation will be obtained from `self.naive_aggregation_pool`.
1615-
pub fn get_aggregated_attestation_base(
1615+
pub fn get_aggregated_attestation(
16161616
&self,
16171617
data: &AttestationData,
16181618
) -> Result<Option<Attestation<T::EthSpec>>, Error> {
1619-
let attestation_key = crate::naive_aggregation_pool::AttestationKey::new_base(data);
1620-
if let Some(attestation) = self.naive_aggregation_pool.read().get(&attestation_key) {
1621-
self.filter_optimistic_attestation(attestation)
1622-
.map(Option::Some)
1623-
} else {
1624-
Ok(None)
1625-
}
1626-
}
1627-
1628-
// TODO(electra): call this function from the new beacon API method
1629-
pub fn get_aggregated_attestation_electra(
1630-
&self,
1631-
data: &AttestationData,
1632-
committee_index: CommitteeIndex,
1633-
) -> Result<Option<Attestation<T::EthSpec>>, Error> {
1634-
let attestation_key =
1635-
crate::naive_aggregation_pool::AttestationKey::new_electra(data, committee_index);
1636-
if let Some(attestation) = self.naive_aggregation_pool.read().get(&attestation_key) {
1619+
if let Some(attestation) = self.naive_aggregation_pool.read().get(data) {
16371620
self.filter_optimistic_attestation(attestation)
16381621
.map(Option::Some)
16391622
} else {
@@ -1645,21 +1628,16 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
16451628
/// `attestation.data.tree_hash_root()`.
16461629
///
16471630
/// The attestation will be obtained from `self.naive_aggregation_pool`.
1648-
///
1649-
/// NOTE: This function will *only* work with pre-electra attestations and it only
1650-
/// exists to support the pre-electra validator API method.
1651-
pub fn get_pre_electra_aggregated_attestation_by_slot_and_root(
1631+
pub fn get_aggregated_attestation_by_slot_and_root(
16521632
&self,
16531633
slot: Slot,
16541634
attestation_data_root: &Hash256,
16551635
) -> Result<Option<Attestation<T::EthSpec>>, Error> {
1656-
let attestation_key =
1657-
crate::naive_aggregation_pool::AttestationKey::new_base_from_slot_and_root(
1658-
slot,
1659-
*attestation_data_root,
1660-
);
1661-
1662-
if let Some(attestation) = self.naive_aggregation_pool.read().get(&attestation_key) {
1636+
if let Some(attestation) = self
1637+
.naive_aggregation_pool
1638+
.read()
1639+
.get_by_slot_and_root(slot, attestation_data_root)
1640+
{
16631641
self.filter_optimistic_attestation(attestation)
16641642
.map(Option::Some)
16651643
} else {

0 commit comments

Comments
 (0)