Skip to content

refactor(handler): validate state before tracking gas - #3815

Merged
rakita merged 2 commits into
mainfrom
codex/state-validation-before-tx-gas
Jul 22, 2026
Merged

rakita merged 2 commits into
mainfrom
codex/state-validation-before-tx-gas

Conversation

@klkvr

@klkvr klkvr commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Moves caller state validation and fee deduction into Handler::validate so chain-specific intrinsic gas adjustments finish before GasTracker is constructed.

This lets handler implementations customize state-based intrinsic gas without overriding run_without_catch_error, while preserving pre_execution’s InitialAndFloorGas hook for authorization-list metering.

Tests: cargo fmt --all --check; cargo test -p revm-handler -p revm-inspector

@codspeed

codspeed Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 3.63%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 180 untouched benchmarks
⏩ 1 skipped benchmark1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation transact_1000tx_commit_inner_every_40 2.4 ms 2.5 ms -3.63%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/state-validation-before-tx-gas (16c0ece) with main (f47a3e9)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩

@rakita
rakita marked this pull request as ready for review July 22, 2026 17:49
@rakita

rakita commented Jul 22, 2026

Copy link
Copy Markdown
Member

CI error not related.

PR lgtm

@rakita
rakita merged commit bb518a0 into main Jul 22, 2026
31 of 34 checks passed
This was referenced Jul 22, 2026
RealiCZ added a commit to megaeth-labs/revm that referenced this pull request Sep 16, 2026
@RealiCZ RealiCZ mentioned this pull request Sep 18, 2026
43 tasks done
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