mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 19:23:50 +00:00
Add committee_len to attestation data
This commit is contained in:
@@ -6,5 +6,5 @@ pub struct AttestationDuty {
|
||||
pub slot: Slot,
|
||||
pub shard: Shard,
|
||||
pub committee_index: usize,
|
||||
pub comittee_size: usize,
|
||||
pub committee_len: usize,
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ impl EpochCache {
|
||||
slot,
|
||||
shard,
|
||||
committee_index: k,
|
||||
committee_len: crosslink_committee.committee.len(),
|
||||
};
|
||||
attestation_duties[*validator_index] = Some(attestation_duty)
|
||||
}
|
||||
|
||||
@@ -33,9 +33,11 @@ impl BooleanBitfield {
|
||||
}
|
||||
|
||||
/// Create a new bitfield with the given length `initial_len` and all values set to `bit`.
|
||||
pub fn from_elem(inital_len: usize, bit: bool) -> Self {
|
||||
pub fn from_elem(initial_len: usize, bit: bool) -> Self {
|
||||
// BitVec can panic if we don't set the len to be a multiple of 8.
|
||||
let len = ((initial_len + 7) / 8) * 8;
|
||||
Self {
|
||||
0: BitVec::from_elem(inital_len, bit),
|
||||
0: BitVec::from_elem(len, bit),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user