-
Notifications
You must be signed in to change notification settings - Fork 179
SIMD-0297: Relax Invalid Nonced Transactions Constraint #297
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
Open
tao-stones
wants to merge
5
commits into
solana-foundation:main
Choose a base branch
from
tao-stones:relax-invalid-nonce
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
simd: '0297' | ||
title: Relax Invalid Nonced Transactions Constraint | ||
authors: Tao Zhu (Anza) | ||
category: Standard | ||
type: Core | ||
status: Review | ||
created: 2025-06-05 | ||
feature: | ||
--- | ||
|
||
## Summary | ||
|
||
This proposal relaxes the handling of invalid durable nonce transactions during | ||
block replay. Instead of rejecting the entire block when an invalid nonce is | ||
encountered, the transaction should be marked as failed, skipped for state | ||
modifications, but still committed to the block without charging a transaction | ||
fee. | ||
|
||
## Motivation | ||
|
||
The current consensus behavior specifies that invalid durable nonce transactions | ||
should result in block failure during replay. This behavior hinders forward | ||
compatibility with asynchronous block execution. The goal is to align invalid | ||
nonce handling with the treatment of other soft transaction failures (e.g., | ||
relax fee payer, relax ALT, etc). | ||
|
||
## New Terminology | ||
|
||
None | ||
|
||
## Detailed Design | ||
|
||
### Current Behavior | ||
|
||
A transaction using a durable nonce fails block replay (causing the entire | ||
block to be rejected) if any of the following occurs: | ||
|
||
- The nonce account is not a statically included account. | ||
- The nonce account does not exist. | ||
- The nonce account is not properly initialized. | ||
- The stored nonce does not match the transaction's recent blockhash. | ||
- The transaction fails to advance the nonce. | ||
|
||
|
||
### Proposed Change | ||
|
||
Update replay logic to treat invalid nonce transactions — those failing the | ||
checks above — as non-state-modifying and non-fee-charging failures, as follows: | ||
|
||
- The transaction is not executed. | ||
- The transaction’s CU cost still applies to the block limit. | ||
- The transaction is not charged with fee. | ||
- The transaction is recorded in the block (marked as failed). | ||
- No account state is modified, including the nonce account (i.e., nonce is | ||
not advanced). | ||
- The block is not rejected as long as all other transactions replay | ||
successfully. | ||
|
||
## Alternatives Considered | ||
|
||
- Only relax a subset of errors (e.g., missing nonce account but not mismatched | ||
blockhash). Adds complexity and partial gains. | ||
|
||
## Impact | ||
|
||
- Invalid nonced transactions will be included in blocks but will not be charged | ||
fees. | ||
|
||
## Security Considerations | ||
|
||
The relaxed model still prevents nonce reuse and enforces single-use semantics, | ||
as the transaction does not advance the nonce if it fails. There is no impact | ||
on replay safety, and the ledger remains consistent across nodes. | ||
|
||
## Backward Compatibility | ||
|
||
This change is **not backward compatible** with current validator behavior. It | ||
must be activated via a feature gate and coordinated with a network upgrade. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 included in status cache as well?
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.
My initial thought was to exclude these transactions from the status cache, since that aligns better with their non-state-modifying nature. The downside, however, is that invalid transactions might be re-executed multiple times, and their status may not be immediately available via RPC.
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.
Good catch. This definitely needs to be mentioned in the SIMD.
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.
If no objection of excluding such transactions from status cache, I'll add it to spec.