Skip to content

Commit 021237a

Browse files
authored
Reduce CLUSTER_NODES_CACHE_NUM_EPOCH_CAP to something reasonable (#6696)
1 parent 0e97629 commit 021237a

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

turbine/src/sigverify_shreds.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ use {
1717
},
1818
solana_perf::{self, deduper::Deduper, packet::PacketBatch, recycler_cache::RecyclerCache},
1919
solana_pubkey::Pubkey,
20-
solana_runtime::{
21-
bank::{Bank, MAX_LEADER_SCHEDULE_STAKES},
22-
bank_forks::BankForks,
23-
},
20+
solana_runtime::{bank::Bank, bank_forks::BankForks},
2421
solana_signer::Signer,
2522
solana_streamer::{evicting_sender::EvictingSender, streamer::ChannelSend},
26-
static_assertions::const_assert_eq,
2723
std::{
2824
collections::HashMap,
2925
num::NonZeroUsize,
@@ -45,10 +41,8 @@ const DEDUPER_RESET_CYCLE: Duration = Duration::from_secs(5 * 60);
4541

4642
// Num epochs capacity should be at least 2 because near the epoch boundary we
4743
// may receive shreds from the other side of the epoch boundary. Because of the
48-
// TTL based eviction it does not make sense to cache more than
49-
// MAX_LEADER_SCHEDULE_STAKES epochs.
50-
const_assert_eq!(CLUSTER_NODES_CACHE_NUM_EPOCH_CAP, 5);
51-
const CLUSTER_NODES_CACHE_NUM_EPOCH_CAP: usize = MAX_LEADER_SCHEDULE_STAKES as usize;
44+
// TTL based eviction it is extremely unlikely that we will ever store > 2 epochs anyway
45+
const CLUSTER_NODES_CACHE_NUM_EPOCH_CAP: usize = 2;
5246
// Because for ClusterNodes::get_retransmit_parent only pubkeys of staked nodes
5347
// are needed, we can use longer durations for cache TTL.
5448
const CLUSTER_NODES_CACHE_TTL: Duration = Duration::from_secs(30);

0 commit comments

Comments
 (0)