mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Send unagg attestation based on fork
This commit is contained in:
committed by
realbigsean
parent
a8088f1bfa
commit
82858bc04e
@@ -18,6 +18,7 @@ use types::{
|
|||||||
attestation::AttestationBase, AggregateSignature, Attestation, AttestationData, BitList,
|
attestation::AttestationBase, AggregateSignature, Attestation, AttestationData, BitList,
|
||||||
ChainSpec, CommitteeIndex, EthSpec, Slot,
|
ChainSpec, CommitteeIndex, EthSpec, Slot,
|
||||||
};
|
};
|
||||||
|
use types::{AttestationElectra, BitVector, ForkName};
|
||||||
|
|
||||||
/// Builds an `AttestationService`.
|
/// Builds an `AttestationService`.
|
||||||
pub struct AttestationServiceBuilder<T: SlotClock + 'static, E: EthSpec> {
|
pub struct AttestationServiceBuilder<T: SlotClock + 'static, E: EthSpec> {
|
||||||
@@ -378,11 +379,32 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
|
|||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut attestation = Attestation::Base(AttestationBase {
|
let fork_name = self
|
||||||
aggregation_bits: BitList::with_capacity(duty.committee_length as usize).unwrap(),
|
.context
|
||||||
data: attestation_data.clone(),
|
.eth2_config
|
||||||
signature: AggregateSignature::infinity(),
|
.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
|
match self
|
||||||
.validator_store
|
.validator_store
|
||||||
|
|||||||
Reference in New Issue
Block a user