fix(evm): restore memory and gas correctness - #610
Open
ys8888john wants to merge 3 commits into
Open
ys8888john wants to merge 3 commits into
ys8888john wants to merge 3 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: 194 benchmarks, 0 regressions |
ys8888john
added a commit
to ys8888john/DTVM
that referenced
this pull request
Sep 21, 2026
Parse state files into a temporary host so malformed input fails cleanly instead of aborting, and commit parsed data atomically. Start the temporary host from the caller's tx_context so a state file without tx_context (or with missing fields) keeps the values the caller already established; fields present in the JSON are overlaid on top. Treat explicitly loaded empty accounts as empty for EIP-161 instead of inferring non-emptiness from a non-zero code hash. Pre-warm the Cancun KZG point evaluation precompile (0x0a) per EIP-4844, keeping the precompile range revision-aware. Keep the JIT cached memory base/size in sync after no-expand KECCAK helpers, including the specialized two-word, caller-slot, and calldata-slot macro-op paths, so direct memory operations that follow never read a stale base pointer. Add regression tests for issues DTVMStack#592, DTVMStack#593, DTVMStack#594, DTVMStack#601, DTVMStack#602, DTVMStack#603, DTVMStack#606, and DTVMStack#610, plus tx_context preservation/overlay and KECCAK macro-op coverage in both interpreter and multipass JIT modes. fix DTVMStack#591, DTVMStack#592, DTVMStack#593, DTVMStack#594, DTVMStack#595, DTVMStack#601, DTVMStack#602, DTVMStack#603, DTVMStack#606 Co-authored-by: DTCoder <noreply@dtcoder.local>
ys8888john
force-pushed
the
fix/evm-runtime-and-state-issues
branch
from
September 21, 2026 03:08
f2db932 to
41d4651
Compare
Parse state files into a temporary host so malformed input fails cleanly instead of aborting, and commit parsed data atomically. Start the temporary host from the caller's tx_context so a state file without tx_context (or with missing fields) keeps the values the caller already established; fields present in the JSON are overlaid on top. Treat explicitly loaded empty accounts as empty for EIP-161 instead of inferring non-emptiness from a non-zero code hash. Pre-warm the Cancun KZG point evaluation precompile (0x0a) per EIP-4844, keeping the precompile range revision-aware. Keep the JIT cached memory base/size in sync after no-expand KECCAK helpers, including the specialized two-word, caller-slot, and calldata-slot macro-op paths, so direct memory operations that follow never read a stale base pointer. Add regression tests for issues DTVMStack#592, DTVMStack#593, DTVMStack#594, DTVMStack#601, DTVMStack#602, DTVMStack#603, DTVMStack#606, and DTVMStack#610, plus tx_context preservation/overlay and KECCAK macro-op coverage in both interpreter and multipass JIT modes. fix DTVMStack#591, DTVMStack#592, DTVMStack#593, DTVMStack#594, DTVMStack#595, DTVMStack#601, DTVMStack#602, DTVMStack#603, DTVMStack#606 Co-authored-by: DTCoder <noreply@dtcoder.local>
ys8888john
force-pushed
the
fix/evm-runtime-and-state-issues
branch
from
September 21, 2026 04:31
41d4651 to
6c93d43
Compare
Replay the EIP-2930 access list on the caller's host after the atomic loadState commit. Account warmth lives in the host access journal, so warming the temporary parsing host discarded access-list entries and execution charged cold-access gas for warm accounts. Malformed entries are validated into a temporary list during parsing and applied only after the parsed state is committed. Keep the cached memory base pointer/size in sync after the CODECOPY and CALLDATACOPY no-expand helpers as well. The no-expand helpers run on a proven range, but the instance memory backing buffer may still be materialized or rebased on first use, so direct memory operations that follow must not read a stale base pointer or size. This makes the reload-after-helper contract uniform across all no-expand helper call sites whose execution continues (RETURN/REVERT end the frame and are excluded). Add regression test AccessListPrewarmSurvivesLoadState covering account warmth, storage-key warmth, and malformed-entry tolerance in loadState. Co-authored-by: DTCoder <noreply@dtcoder.local>
The revision-aware EIP-2929 prewarm range stopped at Cancun KZG point evaluation precompile (0x0a), so on Prague the BLS12-381 precompiles at 0x0b-0x10 stayed cold and the first CALL/STATICCALL to such a precompile charged cold-access gas at transaction start. Extend the warm precompile range to 0x10 for EVMC_PRAGUE per EIP-2537 and keep 0x11 and above cold. Cover the Prague range, the pre-Prague boundary, and the 0x11 boundary with regression tests. Co-authored-by: DTCoder <noreply@dtcoder.local>
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.
0x3fffffffa4dabfffwei (~4.6e18) out of thin air (total supply doubles) #593, DTVM Multipass exits with code 9 #594, DTVM EVM Bug:--load-stateaborts (SIGABRT) on a uint256 field longer than 32 bytes — parse exception is never caught #601, KZG point-evaluation precompile (0x0a) not pre-warmed at transaction start (EIP-2929 / EIP-4844) #602, A crash in EVM's multipass mode #603, DTVM EVM Bug: CALL with value to an explicitly-loaded empty account does not charge G_newaccount (25000) — EIP-161 #606, and fix(evm): restore memory and gas correctness #6101. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
fix #591, #592, #593, #594, #595, #601, #602, #603, #606
2. What is the scope of this PR (e.g. component or file name):
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:
6. Release note