Repository navigation
feat: glamsterdam devnet-8 gas repricing - #357
Merged
Merged
Conversation
Backport of bluealloy/revm#3850, aligning Amsterdam with execution-specs forks/amsterdam at glamsterdam devnet-8 (fixtures [email protected]). EIP-8038 repricing (interpreter::gas): - ACCOUNT_WRITE 8,000 -> 9,000 - COLD_STORAGE_ACCESS 3,000 -> 2,100 (total cold charge, warm folded in) - CREATE_ACCESS 11,000 -> 12,000 (now ACCOUNT_WRITE + COLD_ACCOUNT_ACCESS) - ACCESS_LIST_ADDRESS_COST 3,000 -> 2,900 (cold - warm) - ACCESS_LIST_STORAGE_KEY_COST 3,000 -> 2,000 (cold - warm) - STORAGE_CLEAR_REFUND (derived) 12,480 -> 11,616 - CALL_VALUE (derived) 10,300 -> 11,300 EIP-2780 value-charge fold: - TX_VALUE_COST 4,244 -> 6,000; TRANSFER_LOG_COST (1,756) deleted. - Calls with value stay at 21,000 intrinsic total; create transactions no longer pay any value-based charge (24,000 flat). - The TxTransferLogCost GasId is removed. The EIP-7708 transfer-log emission itself is unchanged. Devnet fixtures bumped to [email protected].
DaniPopes
approved these changes
Aug 13, 2026
DaniPopes
pushed a commit
that referenced
this pull request
Aug 13, 2026
## Summary Fixes the JIT failure surfaced by the devnet-8 `[email protected]` fixtures on #357 (`eip8024_dupn_swapn_exchange/eip_vectors/vector_push_in_immediate_masks_jumpdest`). The bug predates the fixture bump; the v8.1.0 `eip_vectors` are just the first fixtures to exercise it. EIP-8024 leaves JUMPDEST analysis unchanged: only PUSH data is skipped, DUPN/SWAPN/EXCHANGE immediates are analyzed as if they were opcodes. The bytecode parser instead marked every decoded JUMPDEST instruction as a valid jump target, and the decoder *does* consume EIP-8024 immediates, so the two disagreed once such an immediate entered the stream. In `e6605b` (`[DUPN, PUSH1 0x5b]`) the analysis masks the `0x5b` behind the PUSH1, but decoding yielded it as a JUMPDEST instruction and the JIT accepted the jump the interpreter rejects. ## Fix - Compute the valid-jump-target bitmap with the legacy scan over the raw bytes, decoupled from instruction decoding. - Generalize the existing DUPN-immediate rewind: any analysis-valid target swallowed by a consumed immediate (a DUPN-family immediate byte, or a `0x5b` inside desynchronized PUSH data) is re-yielded so jumps have an instruction to land on. Analysis-aligned PUSH data never contains valid targets, so pre-EIP-8024 bytecode never rewinds. - Exclude analysis-masked decoded JUMPDESTs from the dynamic jump dispatch table. Execution cannot fall through into rewound bytes: every immediate that desynchronizes decoding from the analysis is an invalid DUPN/SWAPN/EXCHANGE encoding (`decode_single`/`decode_pair` reject 91..=127, which covers `0x5b` and all PUSH opcodes), so the opcode preceding them halts at runtime. ## Validation - New codegen matrix tests: static + dynamic jump to a PUSH-masked `0x5b` after DUPN (must be invalid), and a jump to an analysis-valid `0x5b` inside desynchronized PUSH data (must land). - All 2,226 `evm2-jit-codegen` tests and the 30 `.evm` snapshot tests pass; workspace suite passes. - With this fix cherry-picked onto #357 (so the fixtures match the gas schedule): the full `for_amsterdam` devnet state-test corpus (2,737 files, `EVM2_COMPILED_EEST_SUBSET=all`) passes through the JIT — the configuration the `jit ubuntu jit` CI job runs. Note: #357's JIT job needs this fix to go green (rebase or merge-order either way).
Merging this PR will improve performance by 10.54%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | erc20_transfer |
50.8 ms | 46 ms | +10.54% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing glamsterdam-devnet-8 (77e1314) with main (524a268)
This branch was previously deployed
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.
Summary
Backport of bluealloy/revm#3850, aligning Amsterdam with execution-specs
forks/amsterdamat glamsterdam devnet-8 (fixtures[email protected]).EIP-8038 repricing (
interpreter::gas)ACCOUNT_WRITECOLD_STORAGE_ACCESSCREATE_ACCESSAW + COLD_STORAGE)AW + COLD_ACCOUNT)ACCESS_LIST_ADDRESS_COSTACCESS_LIST_STORAGE_KEY_COSTSTORAGE_CLEAR_REFUND(derived)CALL_VALUE(derived)EIP-2780 value-charge fold
TX_VALUE_COST4,244 → 6,000;TRANSFER_LOG_COST(1,756) deleted (folded per spec).TX_BASE + CREATE_ACCESS).TxTransferLogCostGasId is removed. The EIP-7708 transfer-log emission itself is unchanged.Misc
[email protected]insetup_test_fixtures.py,ci.yml, and AGENTS.md.Validation
[email protected]: all 33,079 interpreter EEST tests pass (480 usual skips).statetests::aot,blockchain_tests::aot, and the JIT smoke sets all pass.Note: v8.1.0 fixtures were cut pre-freeze; a follow-up release carrying the frozen repricing (ethereum/EIPs PR-12083) is expected. Since
CREATE_ACCESS,CALL_VALUE, and the refunds are derived, a renumber should only touch the base constants.