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: load transaction result supports fee only transactions #2527

Merged
merged 4 commits into from
Aug 13, 2024

Conversation

jstarry
Copy link

@jstarry jstarry commented Aug 9, 2024

Problem

In order to support fee validated transactions that aren't executable, transaction account loading needs to be able to indicate the difference between fee validation errors and other account loading errors that happen post-fee validation

Summary of Changes

  • Replaced the TransactionLoadResult type alias with an enum that includes a variant for FeeOnly transactions which have passed fee validation but cannot be executed due to an account loading error
  • Created a FeesOnlyTransaction struct which holds all relevant details for committing the aforementioned "fee-only" transactions to the ledger. Note that these details aren't used yet since this PR doesn't actually change any behavior to allow such transactions to be committed, this is just plumbing for now.. we still reject transactions unless they are executable.

Fixes #

@jstarry jstarry force-pushed the refactor/load-transaction branch from 6182a23 to 194fc18 Compare August 9, 2024 18:05
@jstarry jstarry requested review from apfitzge and Lichtso August 9, 2024 18:07
Comment on lines 40 to 50
pub enum TransactionLoadResult {
Loaded(LoadedTransaction),
FeesOnly(FeesOnlyTransaction),
NotLoaded(TransactionError),
}
Copy link

@apfitzge apfitzge Aug 12, 2024

Choose a reason for hiding this comment

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

Having brief descriptions of each variant would be great here imo.
Particularly good to mention that FeesOnly is still committed and also will affect nonce (not strictly fees only?).

edit: I guess rn they are not, so maybe we don't need to mention that 🤦‍♂️

Copy link
Author

Choose a reason for hiding this comment

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

Let me know what you think of the description I added. I think you're right that documenting how nonces are handled for fees-only transactions is going to be really important to avoid confusion, probably during the PR that adds support for committing such transactions

Copy link
Author

Choose a reason for hiding this comment

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

Nvm, I just added a bit more to the FeesOnly comment to talk about nonces as well.

apfitzge
apfitzge previously approved these changes Aug 12, 2024
apfitzge
apfitzge previously approved these changes Aug 13, 2024
@jstarry jstarry merged commit 8e747d5 into anza-xyz:master Aug 13, 2024
41 checks passed
@jstarry jstarry deleted the refactor/load-transaction branch August 13, 2024 14:01
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.

2 participants