Skip to content

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
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions proposals/0297-relax-invalid-nonce.md
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.

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.


## 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.
Loading