mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 23:04:53 +00:00
Merge branch 'release-v7.0.0' into v7-backmerge
This commit is contained in:
@@ -42,8 +42,8 @@ impl<E: EthSpec> SyncCommitteeContribution<E> {
|
||||
///
|
||||
/// - `message`: A single `SyncCommitteeMessage`.
|
||||
/// - `subcommittee_index`: The subcommittee this contribution pertains to out of the broader
|
||||
/// sync committee. This can be determined from the `SyncSubnetId` of the gossip subnet
|
||||
/// this message was seen on.
|
||||
/// sync committee. This can be determined from the `SyncSubnetId` of the gossip subnet
|
||||
/// this message was seen on.
|
||||
/// - `validator_sync_committee_index`: The index of the validator **within** the subcommittee.
|
||||
pub fn from_message(
|
||||
message: &SyncCommitteeMessage,
|
||||
|
||||
@@ -3,7 +3,7 @@ use smallvec::smallvec;
|
||||
|
||||
impl<N: Unsigned + Clone> TestRandom for BitList<N> {
|
||||
fn random_for_test(rng: &mut impl RngCore) -> Self {
|
||||
let initial_len = std::cmp::max(1, (N::to_usize() + 7) / 8);
|
||||
let initial_len = std::cmp::max(1, N::to_usize().div_ceil(8));
|
||||
let mut raw_bytes = smallvec![0; initial_len];
|
||||
rng.fill_bytes(&mut raw_bytes);
|
||||
|
||||
@@ -24,7 +24,7 @@ impl<N: Unsigned + Clone> TestRandom for BitList<N> {
|
||||
|
||||
impl<N: Unsigned + Clone> TestRandom for BitVector<N> {
|
||||
fn random_for_test(rng: &mut impl RngCore) -> Self {
|
||||
let mut raw_bytes = smallvec![0; std::cmp::max(1, (N::to_usize() + 7) / 8)];
|
||||
let mut raw_bytes = smallvec![0; std::cmp::max(1, N::to_usize().div_ceil(8))];
|
||||
rng.fill_bytes(&mut raw_bytes);
|
||||
// If N isn't divisible by 8
|
||||
// zero out bits greater than N
|
||||
|
||||
Reference in New Issue
Block a user