Skip to content

Commit

Permalink
adds default value for number of hashers in ShredDeduper
Browse files Browse the repository at this point in the history
  • Loading branch information
behzadnouri committed Jan 3, 2025
1 parent a9ff2c8 commit 47c84f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions turbine/src/retransmit_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl RetransmitStats {
}
}

struct ShredDeduper<const K: usize> {
struct ShredDeduper<const K: usize = 2> {
deduper: Deduper<K, /*shred:*/ [u8]>,
shred_id_filter: Deduper<K, (ShredId, /*0..MAX_DUPLICATE_COUNT:*/ usize)>,
}
Expand Down Expand Up @@ -189,7 +189,7 @@ fn retransmit(
quic_endpoint_sender: &AsyncSender<(SocketAddr, Bytes)>,
stats: &mut RetransmitStats,
cluster_nodes_cache: &ClusterNodesCache<RetransmitStage>,
shred_deduper: &mut ShredDeduper<2>,
shred_deduper: &mut ShredDeduper,
max_slots: &MaxSlots,
rpc_subscriptions: Option<&RpcSubscriptions>,
slot_status_notifier: Option<&SlotStatusNotifier>,
Expand Down Expand Up @@ -302,7 +302,7 @@ fn retransmit(
fn retransmit_shred(
shred: Vec<u8>,
root_bank: &Bank,
shred_deduper: &ShredDeduper<2>,
shred_deduper: &ShredDeduper,
cache: &HashMap<Slot, (/*leader:*/ Pubkey, Arc<ClusterNodes<RetransmitStage>>)>,
socket_addr_space: &SocketAddrSpace,
socket: &UdpSocket,
Expand Down Expand Up @@ -391,7 +391,7 @@ pub fn retransmitter(
CLUSTER_NODES_CACHE_TTL,
);
let mut rng = rand::thread_rng();
let mut shred_deduper = ShredDeduper::<2>::new(&mut rng, DEDUPER_NUM_BITS);
let mut shred_deduper = ShredDeduper::new(&mut rng, DEDUPER_NUM_BITS);
let mut stats = RetransmitStats::new(Instant::now());
#[allow(clippy::manual_clamp)]
let num_threads = get_thread_count().min(8).max(sockets.len());
Expand Down

0 comments on commit 47c84f7

Please sign in to comment.