-
Notifications
You must be signed in to change notification settings - Fork 239
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
Rename types and metrics from executed to processed #2435
Conversation
pub(crate) processed_count: u64, | ||
// Total number of the processed transactions that returned success/not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a processed transaction have failed? I think this parameter counts the number of transaction that succeeded (were executed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a processed transaction have failed?
Yes a processed transaction could have had "failure" result meaning that we definitely validated the fee payer but may or may not have executed it successfully.
I think this parameter counts the number of transaction that succeeded (were executed)
This parameter used to count the number of transactions that were executed (whether the execution result was success or failure, is irrelevant). Now it counts the number of transactions that were "processed" (meaning valid for including in a block) whether they were executed or not.
runtime/src/bank.rs
Outdated
Ok(()) => { | ||
execution_counts.executed_successfully_count += 1; | ||
processed_counts.processed_successfully += 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to my comment above, are you considering that a transaction whose execution has failed has been successfully processed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, only transactions that were executed with a successful result are considered to have been "processed successfully" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "processed successfully" mean valid for including in a block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it means that they were executed with a successful execution result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed to processed_with_successful_result_count
core/src/banking_stage/consumer.rs
Outdated
@@ -1665,9 +1666,9 @@ mod tests { | |||
assert_eq!( | |||
transaction_counts, | |||
ExecuteAndCommitTransactionsCounts { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this struct not be renamed too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sure, I renamed to LeaderProcessedTransactionCounts
@@ -145,7 +147,7 @@ impl Committer { | |||
let batch_transaction_indexes: Vec<_> = commit_results | |||
.iter() | |||
.map(|commit_result| { | |||
if commit_result.was_executed() { | |||
if commit_result.was_committed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be was_processed
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Committed implies processed. I think committed is more appropriate here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, think that committed is probably more appropriate here. This is meant to gather and communicate state changes, which will only occur if the tx is committed.
core/src/banking_stage/consumer.rs
Outdated
@@ -71,15 +72,15 @@ pub struct ExecuteAndCommitTransactionsOutput { | |||
} | |||
|
|||
#[derive(Debug, Default, PartialEq)] | |||
pub struct ExecuteAndCommitTransactionsCounts { | |||
pub struct LeaderProcessedTransactionCounts { | |||
// Total number of transactions that were passed as candidates for execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Total number of transactions that were passed as candidates for execution | |
// Total number of transactions that were passed as candidates for processing |
if execution_result.was_executed() { | ||
.filter_map(|(processing_result, tx)| { | ||
if processing_result.was_processed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case not only is the function name changing, but also the semantics. The was_executed()
can be false even if the fee validation has passed, but was_processed()
would be true in that case, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's correct
core/src/banking_stage/consumer.rs
Outdated
ExecuteAndCommitTransactionsCounts { | ||
attempted_execution_count: 1, | ||
LeaderProcessedTransactionCounts { | ||
attempted_processing_count: 1, | ||
// Transactions was still executed, just wasn't committed, so should be counted here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Transactions was still executed, just wasn't committed, so should be counted here. | |
// Transaction was still processed, just wasn't committed, so should be counted here. |
fn was_processed(&self) -> bool { | ||
self.is_ok() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are considering not processed if self is err, but you also replaced NotExecuted
by Err
. Are you accounting for the case where a processed transaction may have not been executed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet in this change. That change to support processing transactions that may not have been executed will come next in #2425. See https://github.com/anza-xyz/agave/pull/2425/files#diff-5eb12bc3fc00b926c18e4204f316d650074ce4fe4bce7d664459c3cf340af5aeR21-R24
d17ae1a
to
b94019a
Compare
force pushed to rebase on master in order to pick up new |
Problem
Once we implement solana-foundation/solana-improvement-documents#82 we will need to distinguish between valid transactions that were executed and those that were not able to be executed (but still able valid for committing to a block).
Summary of Changes
TransactionExecutionResult
with a type aliasTransactionProcessingResult
which for now only wraps anExecutedTransaction
but in the future will wrap an enum that additionally has variants for valid transactions that were not executed.Fixes #