Remove activated evict_invalid_stakes_cache_entries feature (#25739)

This commit is contained in:
Justin Starry 2022-06-03 07:04:54 +10:00 committed by GitHub
parent 81231a89b9
commit 6fc057c1d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 16 deletions

View File

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

View File

@ -119,7 +119,6 @@ impl StakesCache {
&self,
invalid_stake_keys: DashMap<Pubkey, InvalidCacheEntryReason>,
invalid_vote_keys: DashMap<Pubkey, InvalidCacheEntryReason>,
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),