Skip to content

feat(exec): skip recoverable invalid transactions#393

Open
AshinGau wants to merge 1 commit into
Galxe:mainfrom
AshinGau:feat/skipped-transaction-receipts
Open

feat(exec): skip recoverable invalid transactions#393
AshinGau wants to merge 1 commit into
Galxe:mainfrom
AshinGau:feat/skipped-transaction-receipts

Conversation

@AshinGau

@AshinGau AshinGau commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Background

follow Galxe/grevm#111, resolve https://github.com/Galxe/gravity-audit/issues/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.

@AshinGau
AshinGau force-pushed the feat/skipped-transaction-receipts branch from e0295ce to 210cd06 Compare July 16, 2026 07:33
@AshinGau
AshinGau force-pushed the feat/skipped-transaction-receipts branch from 210cd06 to 380548d Compare July 16, 2026 07:34
@AshinGau
AshinGau requested a review from nekomoto911 July 16, 2026 08:53
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.

1 participant