Skip to content

Commit

Permalink
reduce WARN logging to only necessary scenario (solana-labs#33408)
Browse files Browse the repository at this point in the history
  • Loading branch information
tao-stones authored Sep 28, 2023
1 parent ec36369 commit cc4e928
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 @@ -322,14 +322,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 cc4e928

Please sign in to comment.