Skip to content

Commit 35563ad

Browse files
ethDreamerrealbigsean
authored andcommitted
Revert "Get electra_op_pool up to date (sigp#5756)" (sigp#5757)
This reverts commit ab9e58a.
1 parent 7e21f6a commit 35563ad

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
@@ -1358,11 +1358,10 @@ pub fn obtain_indexed_attestation_and_committees_per_slot<T: BeaconChainTypes>(
13581358
attesting_indices_electra::get_indexed_attestation(&committees, att)
13591359
.map(|attestation| (attestation, committees_per_slot))
13601360
.map_err(|e| {
1361-
let index = att.committee_index();
1362-
if e == BlockOperationError::BeaconStateError(NoCommitteeFound(index)) {
1361+
if e == BlockOperationError::BeaconStateError(NoCommitteeFound) {
13631362
Error::NoCommitteeForSlotAndIndex {
13641363
slot: att.data.slot,
1365-
index,
1364+
index: att.committee_index(),
13661365
}
13671366
} else {
13681367
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
@@ -1664,28 +1664,11 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
16641664
/// Returns an aggregated `Attestation`, if any, that has a matching `attestation.data`.
16651665
///
16661666
/// The attestation will be obtained from `self.naive_aggregation_pool`.
1667-
pub fn get_aggregated_attestation_base(
1668-
&self,
1669-
data: &AttestationData,
1670-
) -> Result<Option<Attestation<T::EthSpec>>, Error> {
1671-
let attestation_key = crate::naive_aggregation_pool::AttestationKey::new_base(data);
1672-
if let Some(attestation) = self.naive_aggregation_pool.read().get(&attestation_key) {
1673-
self.filter_optimistic_attestation(attestation)
1674-
.map(Option::Some)
1675-
} else {
1676-
Ok(None)
1677-
}
1678-
}
1679-
1680-
// TODO(electra): call this function from the new beacon API method
1681-
pub fn get_aggregated_attestation_electra(
1667+
pub fn get_aggregated_attestation(
16821668
&self,
16831669
data: &AttestationData,
1684-
committee_index: CommitteeIndex,
16851670
) -> Result<Option<Attestation<T::EthSpec>>, Error> {
1686-
let attestation_key =
1687-
crate::naive_aggregation_pool::AttestationKey::new_electra(data, committee_index);
1688-
if let Some(attestation) = self.naive_aggregation_pool.read().get(&attestation_key) {
1671+
if let Some(attestation) = self.naive_aggregation_pool.read().get(data) {
16891672
self.filter_optimistic_attestation(attestation)
16901673
.map(Option::Some)
16911674
} else {
@@ -1697,21 +1680,16 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
16971680
/// `attestation.data.tree_hash_root()`.
16981681
///
16991682
/// The attestation will be obtained from `self.naive_aggregation_pool`.
1700-
///
1701-
/// NOTE: This function will *only* work with pre-electra attestations and it only
1702-
/// exists to support the pre-electra validator API method.
1703-
pub fn get_pre_electra_aggregated_attestation_by_slot_and_root(
1683+
pub fn get_aggregated_attestation_by_slot_and_root(
17041684
&self,
17051685
slot: Slot,
17061686
attestation_data_root: &Hash256,
17071687
) -> Result<Option<Attestation<T::EthSpec>>, Error> {
1708-
let attestation_key =
1709-
crate::naive_aggregation_pool::AttestationKey::new_base_from_slot_and_root(
1710-
slot,
1711-
*attestation_data_root,
1712-
);
1713-
1714-
if let Some(attestation) = self.naive_aggregation_pool.read().get(&attestation_key) {
1688+
if let Some(attestation) = self
1689+
.naive_aggregation_pool
1690+
.read()
1691+
.get_by_slot_and_root(slot, attestation_data_root)
1692+
{
17151693
self.filter_optimistic_attestation(attestation)
17161694
.map(Option::Some)
17171695
} else {

0 commit comments

Comments
 (0)