Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: bank transaction counts #2382

Merged
merged 2 commits into from
Aug 4, 2024

Conversation

jstarry
Copy link

@jstarry jstarry commented Aug 1, 2024

Problem

Hard to follow how transaction counts are used throughout the runtime

Summary of Changes

  • Extract a few new structs for tracking transaction counts: ExecuteAndCommitTransactionsCounts and ProcessTransactionsCounts
  • Switch to u64 from usize for a number of counts

Fixes #

@jstarry jstarry force-pushed the refactor/bank-counts branch 4 times, most recently from dce1a4f to 621a7a1 Compare August 2, 2024 01:04
@jstarry jstarry requested a review from apfitzge August 2, 2024 01:05
@jstarry jstarry force-pushed the refactor/bank-counts branch from 621a7a1 to 1141ded Compare August 2, 2024 08:29
apfitzge
apfitzge previously approved these changes Aug 2, 2024
Copy link

@apfitzge apfitzge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only nits, changes look fine to me. think the new struct(s) help readability

// All transactions that were executed but then failed record because the
// slot ended
pub failed_commit_count: usize,
// Total transaction counts tracked for reporting `LeaderSlotMetrics`. See
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consistent with other comments so fine to leave as is, but why would all the comments on theese fields not be doc-comments?

@@ -60,6 +50,48 @@ pub(crate) struct ProcessTransactionsSummary {
pub max_prioritization_fees: u64,
}

#[derive(Debug, Default, PartialEq)]
pub struct ProcessTransactionsCounts {
// Total number of transactions that were passed as candidates for execution
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// doc-comments here too?

core/src/banking_stage/consumer.rs Show resolved Hide resolved
@jstarry jstarry merged commit ccabfcf into anza-xyz:master Aug 4, 2024
42 checks passed
@jstarry jstarry deleted the refactor/bank-counts branch August 14, 2024 05:49
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants