Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
v1.14: reduce WARN logging to only necessary scenario (backport of #3…
Browse files Browse the repository at this point in the history
…3408) (#33444)

reduce WARN logging to only necessary scenario (#33408)

(cherry picked from commit cc4e928)

Co-authored-by: Tao Zhu <[email protected]>
  • Loading branch information
mergify[bot] and tao-stones authored Sep 28, 2023
1 parent fcd8a70 commit 5bf2219
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions runtime/src/prioritization_fee_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,17 @@ impl PrioritizationFeeCache {
// block minimum fee.
let (result, slot_finalize_time) = measure!(
{
// Only retain priority fee reported from optimistically confirmed bank
let pre_purge_bank_count = slot_prioritization_fee.len() as u64;
slot_prioritization_fee.retain(|id, _| id == bank_id);
let post_purge_bank_count = slot_prioritization_fee.len() as u64;
metrics.accumulate_total_purged_duplicated_bank_count(
pre_purge_bank_count.saturating_sub(post_purge_bank_count),
);
if post_purge_bank_count == 0 {
warn!("Prioritization fee cache unexpected finalized on non-existing bank. slot {slot} bank id {bank_id}");
// It should be rare that optimistically confirmed bank had no prioritized
// transactions, but duplicated and unconfirmed bank had.
if pre_purge_bank_count > 0 && post_purge_bank_count == 0 {
warn!("Finalized bank has empty prioritization fee cache. slot {slot} bank id {bank_id}");
}

let mut block_prioritization_fee = slot_prioritization_fee
Expand Down

0 comments on commit 5bf2219

Please sign in to comment.