From 6fc057c1d9c66dd909b22fbb5700aedf3546d210 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Fri, 3 Jun 2022 07:04:54 +1000 Subject: [PATCH] Remove activated evict_invalid_stakes_cache_entries feature (#25739) --- runtime/src/bank.rs | 4 ---- runtime/src/stakes.rs | 15 +++------------ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 77aed2fcac..92043564a2 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -3085,13 +3085,9 @@ impl Bank { metrics.invalid_cached_vote_accounts += invalid_cached_vote_accounts; metrics.invalid_cached_stake_accounts += invalid_cached_stake_accounts; metrics.vote_accounts_cache_miss_count += vote_accounts_cache_miss_count; - let evict_invalid_stakes_cache_entries = self - .feature_set - .is_active(&feature_set::evict_invalid_stakes_cache_entries::id()); self.stakes_cache.handle_invalid_keys( invalid_stake_keys, invalid_vote_keys, - evict_invalid_stakes_cache_entries, self.slot(), ); vote_with_stake_delegations_map diff --git a/runtime/src/stakes.rs b/runtime/src/stakes.rs index 50b902121c..f692af8152 100644 --- a/runtime/src/stakes.rs +++ b/runtime/src/stakes.rs @@ -119,7 +119,6 @@ impl StakesCache { &self, invalid_stake_keys: DashMap, invalid_vote_keys: DashMap, - should_evict_invalid_entries: bool, current_slot: Slot, ) { if invalid_stake_keys.is_empty() && invalid_vote_keys.is_empty() { @@ -128,16 +127,10 @@ impl StakesCache { // Prune invalid stake delegations and vote accounts that were // not properly evicted in normal operation. - let mut maybe_stakes = if should_evict_invalid_entries { - Some(self.0.write().unwrap()) - } else { - None - }; + let mut stakes = self.0.write().unwrap(); for (stake_pubkey, reason) in invalid_stake_keys { - if let Some(stakes) = maybe_stakes.as_mut() { - stakes.remove_stake_delegation(&stake_pubkey); - } + stakes.remove_stake_delegation(&stake_pubkey); datapoint_warn!( "bank-stake_delegation_accounts-invalid-account", ("slot", current_slot as i64, i64), @@ -147,9 +140,7 @@ impl StakesCache { } for (vote_pubkey, reason) in invalid_vote_keys { - if let Some(stakes) = maybe_stakes.as_mut() { - stakes.remove_vote_account(&vote_pubkey); - } + stakes.remove_vote_account(&vote_pubkey); datapoint_warn!( "bank-stake_delegation_accounts-invalid-account", ("slot", current_slot as i64, i64),