Skip to content

Commit

Permalink
RPC: fix numNonVoteTransactions in getPerformanceSamples
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry committed May 5, 2024
1 parent 7daa369 commit dc15383
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,12 +686,13 @@ pub struct Bank {
/// slots to hard fork at
hard_forks: Arc<RwLock<HardForks>>,

/// The number of transactions processed without error
/// The number of committed transactions since genesis.
transaction_count: AtomicU64,

/// The number of non-vote transactions processed without error since the most recent boot from
/// snapshot or genesis. This value is not shared though the network, nor retained within
/// snapshots, but is preserved in `Bank::new_from_parent`.
/// The number of non-vote transactions committed since the most
/// recent boot from snapshot or genesis. This value is only stored in
/// blockstore for the RPC method "getPerformanceSamples". It is not
/// retained within snapshots, but is preserved in `Bank::new_from_parent`.
non_vote_transaction_count_since_restart: AtomicU64,

/// The number of transaction errors in this slot
Expand Down Expand Up @@ -3815,13 +3816,14 @@ impl Bank {
// replay could occur
signature_count += u64::from(tx.message().header().num_required_signatures);
executed_transactions_count += 1;

if !is_vote {
executed_non_vote_transactions_count += 1;
}
}

match execution_result.flattened_result() {
Ok(()) => {
if !is_vote {
executed_non_vote_transactions_count += 1;
}
executed_with_successful_result_count += 1;
}
Err(err) => {
Expand Down

0 comments on commit dc15383

Please sign in to comment.