Repository navigation
Conversation
rakita
marked this pull request as draft
July 29, 2026 13:03
rakita
added a commit
that referenced
this pull request
Jul 30, 2026
) Aligns Amsterdam to the **glamsterdam devnet-7** spec and the `[email protected]` fixtures. All Amsterdam `state_tests` and `blockchain_tests` pass (interpreter + JIT + AOT); no regressions in earlier-fork state suites or the unit/ee-test suite. Ports bluealloy/revm#3795 to evm2's architecture. ## EIP-2780 runtime gas phase (ethereum/EIPs#11844) State-dependent transaction charges move from the intrinsic phase to a runtime phase applied as the first frame is entered. Running out of gas there is an **included out-of-gas halt** consuming all regular gas, not a transaction rejection. - **Create transactions**: account-creation state gas is charged at the create frame's entry (`execute_create_message`), conditional on the destination not already existing. The intrinsic `create_state_gas` and its refund path are removed. - **EIP-7702**: the intrinsic per-auth charge drops to the state-independent `REGULAR_PER_AUTH_BASE_COST` (7,816); `ACCOUNT_WRITE`, new-account, and delegation-bytes state gas are charged per authority at runtime on a transaction-level `GasTracker` (the `RuntimeAuthCharges` accounting), stopping at the first unaffordable charge. A runtime out-of-gas reverts the applied delegations and includes the tx as an OOG halt. - **Delegated recipient (depth 0)**: resolution is deferred into the frame (`apply_eip2780_call_charges`) and the target load is gated on gas (`skip_cold_load`, as nested calls do), so a cold, unafforded target stays out of the EIP-7928 block access list. `MessageResult::runtime_gas_oog` signals a recipient-charge OOG back to the 7702 handler so it drops the delegations too. The CALL/CREATE runtime charges live in the shared `execute_call_message` / `execute_create_message` (gated on `depth == 0` + feature, not tx type), so **all transaction types** get them; only the authorization-specific charges are in the 7702 handler. ## Devnet-7 spec alignment - **ethereum/EIPs#11836**: calldata floor anchored on the decomposed intrinsic base instead of flat `TX_BASE`. - **ethereum/EIPs#11891**: 7702 `ACCOUNT_WRITE` charged once per authority, skipped when already paid (sender / value-recipient / a preceding valid authorization). - **ethereum/EIPs#11858**: `CREATE`/`CREATE2` account-creation state gas charged conditionally at access (endowment/nonce pre-check + a single destination read), refilled on failure. Mirrored in the JIT builtin. - **ethereum/EIPs#11854**: `SSTORE` covers the slot's access cost before the implicit read; an unaffordable cold access skips the read (`Evm::sstore` now honors `skip_cold_load`). - **EIP-8282**: builder deposit/exit system-contract addresses updated. - **EIP-7623** floor binds the block regular-gas component (`TxResult::regular_gas_spent = max(total - state, floor)`). ## Cleanups - Remove the superseded devnet-6 create accounting (`create_initial_state_gas`, `refund_create_state_gas`, `MessageResult::created_target_was_alive`, `settle_gas`'s `is_create` path). - Remove `rollback_failed_execution`: failed execution is already rolled back to the message's own checkpoint (and halt gas zeroed) inside `execute_message`, so it was redundant. ## Follow-up refactors - **Message construction**: `Message` now carries its `destination` — the CREATE/CREATE2 address is derived when the message is constructed (`Message::derive_destination`) instead of being re-derived at frame entry. - **EIP-7702 authorization unification**: both gas regimes share one `apply_auth_list` loop (validate → account → apply) driven by an `AuthAccounting` strategy — `RuntimeAuthCharges` (EIP-2780 runtime metering, abortable mid-list) and `AuthRefunds` (pre-Amsterdam pessimistic-intrinsic refunds, owning the EIP-8037 gating). The handler tail funnels every exit through a single `settle` closure (`settle_oog` for the runtime OOG halts), and `initial_gas_and_reservoir` loses its always-zero `state_refund` parameter — the pre-Amsterdam state refund is credited straight to the reservoir at the call site, matching execution-specs `set_delegation`. Crate constants are now `pub`. The `Message`-carries-bytecode refactor (with the EIP-8037 create depth check) and the regular→execution gas rename are split out into the stacked PR #329. ## Fixtures / harness - Bump devnet fixtures to v7.2.0 (setup script, CI, `AGENTS.md`). - eest: honor an explicit per-transaction `chainId` (v7 fixtures test type-0 `INVALID_CHAINID`). ## Testing - Amsterdam `state_tests`: 406/406; `blockchain_tests`: 657/657. - JIT + AOT Amsterdam state suites pass on v7.2.0. - Unit + ee-tests: 2829/2829; Prague/Osaka/Cancun/Berlin/London/Shanghai state suites unchanged. Two revm changes were no-ops in evm2: EIP-7708 (already implemented) and `JournalEntry::CodeChange` recording prior code (evm2's `AccountChange` already snapshots the full prior `AccountInfo`).
rakita
marked this pull request as ready for review
July 30, 2026 12:10
rakita
force-pushed
the
execute-message-refactor
branch
from
August 3, 2026 10:22
de6f30e to
86c5900
Compare
rakita
marked this pull request as draft
August 6, 2026 07:47
This was referenced Aug 10, 2026
Member
DaniPopes
added a commit
that referenced
this pull request
Aug 10, 2026
This is the bytecode-carrying portion of #329, split out for review. Each `Message` now carries the bytecode it executes, including top-level and test messages. The test cleanup standardizes `Message { ..., code: ... }` construction. Credit to @rakita for the original implementation in #329. --------- Co-authored-by: rakita <[email protected]>
onbjerg
added a commit
that referenced
this pull request
Aug 11, 2026
This is the remaining portion of #329, stacked on #352. It keeps the transaction handler and runtime-gas changes out of the bytecode-only PR, including the regular-gas to execution-gas rename. Credit to @rakita for the original implementation in #329. Co-authored-by: rakita <[email protected]>
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.
Stacked on #315 (base:
glam-devnet-7). Moves theexecute_message/Messagerefactors and the gas-dimension rename out of the devnet-7 PR — they are not devnet-7 spec changes. The final tree is byte-identical to whatglam-devnet-7contained before the split.Commits
Message.code, soexecute_messageand the interpreter no longer thread a separate bytecode argument; the EIP-2780 first-frame runtime charges move out of frame entry intoprepare_initial_frameon the handler side. Also checks the call-depth limit alongside the EIP-8037 endowment/nonce pre-checks before reading the destination inCREATE/CREATE2— a too-deep create previously read (and charged) the destination, leaking it into the EIP-7928 block access list and warm set. Mirrored in the JIT builtin; regression test asserts the read is skipped.MessageExt::derive_destination/init_code_hash_slowwith a standalonederive_create_destinationso the created address can be derived before the message exists; the interpreter create opcode and the JIT create builtin construct the fully-populatedMessageright beforeexecute_message, dropping the placeholder fields and the mutate-after-build dance.GasTracker, the transaction handlers, block gas accounting, and docs (TxResult::regular_gas_spent→execution_gas_spent). No functional change.Testing
glam-devnet-7head (git diffis empty), which passed the full devnet v7.2.0 suites.cargo fmt --check, and the unit/ee-test suite.