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: committed tx may not have been executed #2525

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

jstarry
Copy link

@jstarry jstarry commented Aug 9, 2024

Problem

Refactor CommittedTransaction struct to allow representing transactions that were not executed but still committed

Summary of Changes

  • Flatten out execution_details field in CommittedTransaction to remove the notion that those fields came from an execution
  • Remove TransactionCommitResultExtensions::transaction_result method since it is easy to misuse given that it flattens processing and execution errors
  • Add new serializable TransactionCommitDetails struct for the bank_hash_details module that mirrors CommittedTransaction so that CommittedTransaction itself doesn't need to be serializable

Fixes #

@jstarry jstarry force-pushed the refactor/committed-tx branch 2 times, most recently from 75b9c2a to e8a5f54 Compare August 9, 2024 12:54
@jstarry jstarry force-pushed the refactor/committed-tx branch from e8a5f54 to 6487f28 Compare August 9, 2024 18:06
@jstarry jstarry requested review from seanyoung and bw-solana August 9, 2024 18:07
@bw-solana
Copy link

The code looks good to me, but can you enlighten me re: the higher level context?

Is this setting the stage for async execution? Charging fees for transactions we don't execute? Something else?

@jstarry
Copy link
Author

jstarry commented Aug 10, 2024

The code looks good to me, but can you enlighten me re: the higher level context?

Is this setting the stage for async execution? Charging fees for transactions we don't execute? Something else?

Yup, charging fees for transactions that we didn't execute which is a step on the way to async execution. You can see how the code will be used here: https://github.com/anza-xyz/agave/pull/2425/files#diff-ed47b4a0198313377e091bb3957bbbc63d937805426d1b2b6de39d0a50d32a0cR3901

Copy link

@seanyoung seanyoung left a comment

Choose a reason for hiding this comment

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

Looks good, makes sense to me

@@ -51,7 +50,7 @@ impl ExecutedTransaction {
}
}

#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct TransactionExecutionDetails {

Choose a reason for hiding this comment

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

It would be nice if we could remove this struct entirely, now that we have struct CommittedTransaction which is almost identical.

I think we've got too many struct types :)

Copy link
Author

Choose a reason for hiding this comment

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

Sorry I'm a struct maxi

Copy link

@bw-solana bw-solana left a comment

Choose a reason for hiding this comment

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

LGTM

@jstarry jstarry merged commit 71c8433 into anza-xyz:master Aug 12, 2024
41 checks passed
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