mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Merge branch 'beacon-api-electra' into p2p-electra
This commit is contained in:
@@ -14,11 +14,11 @@ use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
use tokio::time::{sleep, sleep_until, Duration, Instant};
|
||||
use tree_hash::TreeHash;
|
||||
use types::ForkName;
|
||||
use types::{
|
||||
attestation::AttestationBase, AggregateSignature, Attestation, AttestationData, BitList,
|
||||
ChainSpec, CommitteeIndex, EthSpec, Slot,
|
||||
};
|
||||
use types::{AttestationElectra, BitVector, ForkName};
|
||||
|
||||
/// Builds an `AttestationService`.
|
||||
pub struct AttestationServiceBuilder<T: SlotClock + 'static, E: EthSpec> {
|
||||
@@ -383,11 +383,32 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
|
||||
return None;
|
||||
}
|
||||
|
||||
let mut attestation = Attestation::Base(AttestationBase {
|
||||
aggregation_bits: BitList::with_capacity(duty.committee_length as usize).unwrap(),
|
||||
data: attestation_data.clone(),
|
||||
signature: AggregateSignature::infinity(),
|
||||
});
|
||||
let fork_name = self
|
||||
.context
|
||||
.eth2_config
|
||||
.spec
|
||||
.fork_name_at_slot::<E>(attestation_data.slot);
|
||||
|
||||
let mut attestation = if fork_name >= ForkName::Electra {
|
||||
let mut committee_bits: BitVector<E::MaxCommitteesPerSlot> = BitVector::default();
|
||||
committee_bits
|
||||
.set(duty.committee_index as usize, true)
|
||||
.unwrap();
|
||||
Attestation::Electra(AttestationElectra {
|
||||
aggregation_bits: BitList::with_capacity(duty.committee_length as usize)
|
||||
.unwrap(),
|
||||
data: attestation_data.clone(),
|
||||
committee_bits,
|
||||
signature: AggregateSignature::infinity(),
|
||||
})
|
||||
} else {
|
||||
Attestation::Base(AttestationBase {
|
||||
aggregation_bits: BitList::with_capacity(duty.committee_length as usize)
|
||||
.unwrap(),
|
||||
data: attestation_data.clone(),
|
||||
signature: AggregateSignature::infinity(),
|
||||
})
|
||||
};
|
||||
|
||||
match self
|
||||
.validator_store
|
||||
|
||||
Reference in New Issue
Block a user