fix(runtime): preserve EVM gas semantics during SPP scheduling - #579
Open
abmcar wants to merge 6 commits into
Open
fix(runtime): preserve EVM gas semantics during SPP scheduling#579abmcar wants to merge 6 commits into
abmcar wants to merge 6 commits into
Conversation
⚡ Performance Regression Check Results✅ Performance Check Passed (interpreter)Performance Benchmark Results (threshold: 25%)
Summary: 194 benchmarks, 0 regressions ✅ Performance Check Passed (multipass)Performance Benchmark Results (threshold: 25%)
Summary: 193 benchmarks, 0 regressions |
abmcar
marked this pull request as ready for review
July 28, 2026 08:33
Treat SSTORE as a gas-sensitive boundary when shifting static block costs. EIP-2200 checks gas left before the storage update, so precharging a successor can change success into out-of-gas even when total path cost is unchanged. Add a cache-level regression and an interpreter-versus-multipass replay of mainnet block 21800020 transaction 260 using audited bytecode and calldata fixtures.
Track omitted dynamic successors so SPP cannot charge untaken blocks on a taken path. Bind focused execution revisions and pin storage, log, and gas regression oracles.
Move the mainnet bytecode into a test-only header and document the SPP gas boundaries.
abmcar
force-pushed
the
codex/fix-spp-gas-accounting
branch
from
July 29, 2026 08:15
1ef8b0d to
5894039
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
2. What is the scope of this PR (e.g. component or file name):
EVM cache-build SPP scheduling in
src/evm/evm_cache.cpp, cache anddifferential regressions under
src/tests/, the cache-build moduledocumentation, and the light-tier change document at
docs/changes/2026-07-28-evm-spp-gas-boundaries/README.md.3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
SPP may move a successor block's gas charge into its predecessor. This
preserves whole-path cost only when intermediate gas cannot affect execution
and every runtime successor is represented by the CFG used for compensation.
Two missing barriers violated those conditions:
SSTOREcan fail at the EIP-2200 call-stipend threshold, so precharginglater work before it can change a successful execution into an out-of-gas
failure.
JUMPandJUMPIsources have runtime targets omittedfrom the explicit CFG. Shifting an explicit
JUMPIfallthrough cost ontothe source also charges the taken path without compensating its omitted
target.
This change:
SSTOREas a gas-sensitive SPP boundary;GasBlockpaddingand rejects source-side shifts at those blocks;
dynamic targets;
interpreter-versus-multipass differential regression for unresolved
dynamic
JUMPI;documentation and a light-tier change document.
GasBlockremains 32 bytes. TreatingSSTOREas a boundary before Istanbuland rejecting shifts around unresolved dynamic jumps are intentionally
conservative: they can reduce SPP scheduling opportunities at those
boundaries. No performance claim is made.
Change doc: docs/changes/2026-07-28-evm-spp-gas-boundaries/README.md
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
No API, ABI, configuration, or persisted-data format changes are introduced.
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:
The current head
66305e02bbfd0a6e7cd3fe0417092ddf5aab767dwas verifiedagainst
upstream/mainat8268abb94531b2553d20a77fcb08586cfcc014fc:tools/format.sh checkevmCacheTestsandevmDifferentialTestsbuild cleanly, with no newcompiler warnings
tools/dtvm_local_test.sh --auto --base upstream/main: interpreter unittests 215/215, Cancun state tests 2723/2723, EVM assembly tests 209/209,
and CTest 12/12
git diff --checkThe final test-only commit removes the standalone block 21,800,020
transaction 260 replay test and its embedded data header. The production
src/evm/evm_cache.cppblob remains6ca5d7a55812920d4d0e1de8b258c176c3d3c252.The production implementation also passed a sealed multipass replay of
blocks 21,800,000–21,800,031:
DB-state-access, and fresh-DB assertions all passed
post-state was byte-identical
ac08110078666c3f3667914c9727b4e42ec9f03bbf0454c950209e7d2423e1918f5ece8cfcbb6e3de66846b44dd6ed37aaf02ca7d347ec13adf52c178fcb4d14The replay evidence is intentionally tied to the unchanged production blob;
it does not claim that the later documentation/test-only head was replayed.
6. Release note