diff --git a/consensus/swap_or_not_shuffle/src/shuffle_list.rs b/consensus/swap_or_not_shuffle/src/shuffle_list.rs index 3e93974fe0..8202b35cde 100644 --- a/consensus/swap_or_not_shuffle/src/shuffle_list.rs +++ b/consensus/swap_or_not_shuffle/src/shuffle_list.rs @@ -96,8 +96,7 @@ pub fn shuffle_list( loop { buf.set_round(r); - let pivot = buf.raw_pivot() as usize % list_size; - + let pivot = (buf.raw_pivot() % list_size as u64) as usize; let mirror = (pivot + 1) >> 1; buf.mix_in_position(pivot >> 8); diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index 7289a817a3..2a5d183a50 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -11,7 +11,7 @@ const MAX_SUBNET_ID: usize = 64; /// The number of bits in a Discovery `NodeId`. This is used for binary operations on the node-id /// data. -const NODE_ID_BITS: u64 = 256; +const NODE_ID_BITS: u32 = 256; static SUBNET_ID_TO_STRING: LazyLock> = LazyLock::new(|| { let mut v = Vec::with_capacity(MAX_SUBNET_ID); @@ -102,7 +102,7 @@ impl SubnetId { spec: &ChainSpec, ) -> impl Iterator { // The bits of the node-id we are using to define the subnets. - let prefix_bits = spec.attestation_subnet_prefix_bits as u64; + let prefix_bits = spec.attestation_subnet_prefix_bits as u32; let node_id = U256::from_be_slice(&raw_node_id); // calculate the prefixes used to compute the subnet and shuffling