Merge branch 'release-v7.0.0' into v7-backmerge

This commit is contained in:
Mac L
2025-04-04 13:32:58 +11:00
29 changed files with 65 additions and 54 deletions

View File

@@ -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,

View File

@@ -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