Skip to content

feat: glamsterdam devnet-8 gas repricing - #357

Merged
DaniPopes merged 2 commits into
mainfrom
glamsterdam-devnet-8
Aug 13, 2026
Merged

DaniPopes merged 2 commits into
mainfrom
glamsterdam-devnet-8

Conversation

@rakita

@rakita rakita commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Backport of bluealloy/revm#3850, aligning Amsterdam with execution-specs forks/amsterdam at glamsterdam devnet-8 (fixtures [email protected]).

EIP-8038 repricing (interpreter::gas)

Constant devnet-7 devnet-8
ACCOUNT_WRITE 8,000 9,000
COLD_STORAGE_ACCESS 3,000 2,100
CREATE_ACCESS 11,000 (AW + COLD_STORAGE) 12,000 (AW + COLD_ACCOUNT)
ACCESS_LIST_ADDRESS_COST 3,000 (full cold) 2,900 (cold − warm)
ACCESS_LIST_STORAGE_KEY_COST 3,000 (full cold) 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 (folded per spec).
  • Calls with value are unchanged at 21,000 intrinsic total; create transactions no longer pay any value-based charge (24,000 flat = TX_BASE + CREATE_ACCESS).
  • The TxTransferLogCost GasId is removed. The EIP-7708 transfer-log emission itself is unchanged.

Misc

  • Devnet fixtures bumped to [email protected] in setup_test_fixtures.py, ci.yml, and AGENTS.md.

Validation

  • [email protected]: all 33,079 interpreter EEST tests pass (480 usual skips).
  • Compiled suites over the Amsterdam devnet roots: statetests::aot, blockchain_tests::aot, and the JIT smoke sets all pass.
  • Workspace tests, clippy, fmt, docs clean.

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.

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 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).
@codspeed

codspeed Bot commented Aug 13, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 10.54%

⚠️ 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 improved benchmark
✅ 140 untouched benchmarks

Performance Changes

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)

Open in CodSpeed

@DaniPopes
DaniPopes enabled auto-merge (squash) August 13, 2026 21:13
@DaniPopes
DaniPopes merged commit e4bc967 into main Aug 13, 2026
98 of 119 checks passed
@DaniPopes
DaniPopes deleted the glamsterdam-devnet-8 branch August 13, 2026 22:13

This branch was previously deployed

1 inactive deployment
codspeed — 77e13145 Deployed Aug 13, 2026 by DaniPopes via codspeed #591
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