Subscribe to the correct subnets for electra attestations (#5782)

* subscribe to the correct att subnets for electra

* subscribe to the correct att subnets for electra
This commit is contained in:
Eitan Seri-Levi
2024-05-15 08:37:20 +03:00
committed by realbigsean
parent 793764f066
commit fc15736fcb
4 changed files with 13 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
//! Identifies each shard by an integer identifier.
use crate::{AttestationData, ChainSpec, CommitteeIndex, Epoch, EthSpec, Slot};
use crate::{AttestationRef, ChainSpec, CommitteeIndex, Epoch, EthSpec, Slot};
use safe_arith::{ArithError, SafeArith};
use serde::{Deserialize, Serialize};
use std::ops::{Deref, DerefMut};
@@ -37,16 +37,16 @@ impl SubnetId {
id.into()
}
/// Compute the subnet for an attestation with `attestation_data` where each slot in the
/// Compute the subnet for an attestation where each slot in the
/// attestation epoch contains `committee_count_per_slot` committees.
pub fn compute_subnet_for_attestation_data<E: EthSpec>(
attestation_data: &AttestationData,
pub fn compute_subnet_for_attestation<E: EthSpec>(
attestation: &AttestationRef<E>,
committee_count_per_slot: u64,
spec: &ChainSpec,
) -> Result<SubnetId, ArithError> {
Self::compute_subnet::<E>(
attestation_data.slot,
attestation_data.index,
attestation.data().slot,
attestation.committee_index(),
committee_count_per_slot,
spec,
)