Skip to content

fix: reconcile sibling state gas refills - #3893

Merged
rakita merged 1 commit into
mainfrom
rakita/fix-state-gas-sibling-refill
Sep 7, 2026
Merged

rakita merged 1 commit into
mainfrom
rakita/fix-state-gas-sibling-refill

Conversation

@rakita

@rakita rakita commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • reconcile a returned child reservoir against outstanding parent state-gas spills in LIFO order
  • restore gas-left-funded state gas to regular gas without double-adjusting signed state-gas spend
  • cover partial/excess reservoir absorption and the sibling A-set/B-clear frame flow
  • add an end-to-end sibling DELEGATECALL regression that checks the parent GAS value

Tests

  • cargo test -p revm-context-interface returned_reservoir_restores_spilled_state_gas_first
  • cargo test -p revm-handler sibling_refill_restores_parent_regular_gas
  • cargo test -p revm-ee-tests eip8037
  • cargo test -p revm-ee-tests eip2780
  • cargo clippy -p revm-context-interface -p revm-handler --all-targets --all-features
  • cargo fmt --all --check

@codspeed

codspeed Bot commented Sep 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 218 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing rakita/fix-state-gas-sibling-refill (0b3614a) with main (6014612)

Open in CodSpeed

Footnotes

  1. 9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@rakita
rakita merged commit d23bb3a into main Sep 7, 2026
34 checks passed
DaniPopes pushed a commit to alloy-rs/evm2 that referenced this pull request Sep 7, 2026
Ports [bluealloy/revm#3893](bluealloy/revm#3893)
to evm2. When one child creates storage using execution gas and a
sibling clears it, the returned reservoir now restores the parent's
spilled execution gas before retaining any excess. Reconciliation
happens after merging the successful child's counters and does not
double-adjust signed state-gas spend.

Adds the upstream partial/excess reservoir and sibling-frame
regressions, plus a full transaction test comparing the parent's
returned `GAS` value with EIP-8037 enabled and disabled. Both sibling
regressions were confirmed to fail with the old merge behavior and pass
with the fix.

Also includes the fixture bump from
[#414](#414): the
downloader default, CI override, and documented EF/EEST fixture version
now use `[email protected]`.

Validation:

- `cargo test -p evm2 --lib`: 490 passed.
- `cargo test -p evm2 --lib --no-default-features --features std,parse`:
490 passed.
- `cargo +nightly clippy -p evm2 --all-targets --all-features`: passed.
- `cargo +nightly fmt --all --check`: passed.
- Fixture bump: verified the v8.1.4 release asset, executed the
downloader's fixture-plan construction, checked its generated URL, and
ran `git diff --check`. The full EEST suite was not run locally.

Prompted by: @rakita

---------

Co-authored-by: rakita <[email protected]>
@rakita
rakita deleted the rakita/fix-state-gas-sibling-refill branch September 7, 2026 14:42
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