Skip to content

feat(exec): skip recoverable invalid transactions via fallback - #111

Merged
AshinGau merged 2 commits into
Galxe:mainfrom
AshinGau:feat/skipped-transaction-fallback
Jul 22, 2026
Merged

feat(exec): skip recoverable invalid transactions via fallback#111
AshinGau merged 2 commits into
Galxe:mainfrom
AshinGau:feat/skipped-transaction-fallback

Conversation

@AshinGau

@AshinGau AshinGau commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Represent transaction results as either executed or skipped with a stable skip reason.
  • Fall back to sequential execution when parallel execution encounters a recoverable invalid transaction.
  • Skip nonce and insufficient-balance errors without applying state changes, then continue executing the remaining transactions.
  • Keep database, commit, and unknown EVM errors fatal.
  • Add sequential-reference, native-transfer, and EIP-7702 coverage for skipped transactions and fallback behavior.

Validation

  • Compared fallback results and final state against a fully sequential executor that skips invalid transactions.
  • Replayed Ethereum mainnet and hardfork-coverage fixtures through parallel and sequential execution.

@AshinGau
AshinGau force-pushed the feat/skipped-transaction-fallback branch 3 times, most recently from 876f9c5 to 97888e1 Compare July 16, 2026 03:41
@AshinGau
AshinGau requested a review from nekomoto911 July 16, 2026 08:53
@AshinGau
AshinGau force-pushed the feat/skipped-transaction-fallback branch from 97888e1 to 60678c7 Compare July 20, 2026 01:57
@AshinGau
AshinGau force-pushed the feat/skipped-transaction-fallback branch from 60678c7 to dedf9cc Compare July 20, 2026 03:12
@AshinGau
AshinGau merged commit f7dacd1 into Galxe:main Jul 22, 2026
2 checks passed
nekomoto911 pushed a commit to Galxe/gravity-reth that referenced this pull request Jul 28, 2026
## Background

follow Galxe/grevm#111, resolve Galxe/gravity-audit#838

Gravity uses pipeline execution: consensus may build the next block before the previous block has been committed by the execution layer. A transaction that passed the consensus-side filter can therefore become invalid against the final execution state—for example, an EIP-7702 delegated call may change another account's nonce before that account's transaction is executed.

Previously, recoverable errors such as nonce mismatch or insufficient balance were returned as block-level execution errors. This could stop block execution and leave the validator without a safe way to handle a transaction that consensus had already included.

## Design

This PR adds a last-resort execution-layer safeguard for recoverable invalid transactions:

- grevm classifies a fixed set of recoverable transaction errors and returns `TxExecutionOutcome::Skipped(reason)`.
- If parallel execution encounters one of these errors, grevm rolls back the speculative execution and re-executes the block through its sequential fallback.
- gravity-reth keeps the transaction in the block but applies it as a no-op: no state changes and no gas charged.
- A skipped transaction receives a failed receipt with unchanged cumulative gas and one versioned `GravityTxSkipped(uint16,uint16)` log.
- The log uses a protocol-reserved emitter address so indexers and operators can reliably identify the transaction and decode its skip reason.
- Unknown transaction errors, database errors, and commit errors remain fatal instead of being silently skipped.
- The `disable_grevm` path uses the same grevm sequential executor, keeping skipped-transaction semantics identical across both execution modes.

Skipped transactions remain persisted and queryable through Ethereum RPC by transaction hash and receipt. Execution continues with subsequent transactions in the block.

## Validation

- Added receipt encoding and decoding tests.
- Added executor tests covering skipped transactions, zero gas usage, unchanged state, and continued execution.
- Added EIP-7702 pipeline end-to-end tests for both parallel grevm and `disable_grevm` modes.
- Upgraded grevm to the revision that provides recoverable-error classification and sequential fallback behavior.
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