From a74a38889ae99b2e33f571472151a7218b8c8564 Mon Sep 17 00:00:00 2001 From: Richard1048576 <178553006+Richard1048576@users.noreply.github.com> Date: Sat, 11 Jul 2026 13:25:59 +0800 Subject: [PATCH] feat(exec): opt into grevm deterministic skip of tx-level-invalid txns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire ParallelExecutor to grevm's with_skip_invalid_txn(true): a tx-level- invalid tx (EVMError::Transaction, e.g. NonceTooLow from an EIP-7702 delegate-then-CREATE nonce double-bump) is deterministically skipped in grevm's sequential fallback instead of panicking the whole block — closing the execution-induced halt class the pre-execution filter cannot model (gravity-audit#838, durable close-out of #823). STF change (bad tx: halt -> skip); deploy behind a coordinated upgrade. Bumps grevm rev to the grevm#110 branch head for the method; re-point to the merged grevm commit before merge. Co-Authored-By: Claude Opus 4.8 (1M context) --- Cargo.lock | 2 +- Cargo.toml | 7 ++++++- crates/ethereum/evm/src/parallel_execute.rs | 10 +++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 350f1b9a8..d30e66629 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4361,7 +4361,7 @@ dependencies = [ [[package]] name = "grevm" version = "2.2.2" -source = "git+https://github.com/Galxe/grevm?rev=2a42859a56f03197fce5be4ceb475d9f1a7d7c3d#2a42859a56f03197fce5be4ceb475d9f1a7d7c3d" +source = "git+https://github.com/Galxe/grevm?rev=d0d0911ee0ca5ca7397325c9fd42d87710521e7c#d0d0911ee0ca5ca7397325c9fd42d87710521e7c" dependencies = [ "ahash", "alloy-evm", diff --git a/Cargo.toml b/Cargo.toml index 4c2e3f3ea..46b04d3eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -477,7 +477,12 @@ reth-provider = { path = "crates/storage/provider" } reth-prune = { path = "crates/prune/prune" } reth-prune-types = { path = "crates/prune/types", default-features = false } reth-revm = { path = "crates/revm", default-features = false } -grevm = { package = "grevm", git = "https://github.com/Galxe/grevm", rev = "2a42859a56f03197fce5be4ceb475d9f1a7d7c3d" } +# grevm#110's `with_skip_invalid_txn` opt-in (consumed below). NOTE: grevm main is on revm 40 but +# gravity-reth is on revm 29, so #110's PR head (revm 40) is NOT consumable here — this pins the +# revm-29 backport of the same feature (Richard1048576/grevm `feat/skip-invalid-txn-optin-revm29`), +# which also carries the parallel-path commit-detected-skip fix. Re-point to a Galxe/grevm commit +# once the revm-29-vs-40 alignment is decided (backport upstreamed, or gravity-reth upgraded). +grevm = { package = "grevm", git = "https://github.com/Galxe/grevm", rev = "d0d0911ee0ca5ca7397325c9fd42d87710521e7c" } reth-rpc = { path = "crates/rpc/rpc" } reth-rpc-api = { path = "crates/rpc/rpc-api" } reth-rpc-api-testing-util = { path = "crates/rpc/rpc-testing-util" } diff --git a/crates/ethereum/evm/src/parallel_execute.rs b/crates/ethereum/evm/src/parallel_execute.rs index c5f1d8da3..61ad9c28c 100644 --- a/crates/ethereum/evm/src/parallel_execute.rs +++ b/crates/ethereum/evm/src/parallel_execute.rs @@ -114,7 +114,15 @@ where state, false, self.custom_precompiles.clone(), - ); + ) + // Downgrade a tx-level-invalid tx (EVMError::Transaction — e.g. NonceTooLow from an + // EIP-7702 delegate-then-CREATE nonce double-bump) from a whole-block panic to a + // deterministic per-tx skip in grevm's sequential fallback. Closes the + // execution-induced halt class that the pre-execution filter fundamentally cannot + // model (gravity-audit#838, durable close-out of #823). This is an STF change (a bad + // tx goes halt -> skip); deploy behind a coordinated upgrade. Requires grevm built + // with `with_skip_invalid_txn` (Galxe/grevm#110). + .with_skip_invalid_txn(true); executor.parallel_execute(None).map_err(|e| { // `e.txid` is grevm's per-tx index; for block-level errors it can be a // sentinel or out-of-bounds value. Use a saturating lookup so the error