Skip to content

Update EIP-2780: account for EIP-7623 calldata floor base - #11836

Merged
eth-bot merged 1 commit into
ethereum:masterfrom
misilva73:update-eip-2780
Jun 25, 2026
Merged

eth-bot merged 1 commit into
ethereum:masterfrom
misilva73:update-eip-2780

Conversation

@misilva73

Copy link
Copy Markdown
Contributor

EIP-7623's calldata floor rests on the flat 21,000 that EIP-2780 decomposes. This adds 7623 to requires and an interactions bullet specifying the floor's base is now the decomposed regular-gas intrinsic (state-gas charge stays out).

@misilva73
misilva73 requested a review from eth-bot as a code owner June 25, 2026 14:48
@github-actions github-actions Bot added c-update Modifies an existing proposal s-draft This EIP is a Draft t-core labels Jun 25, 2026
@eth-bot

eth-bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Collaborator

✅ All reviewers have approved.

@eth-bot
eth-bot enabled auto-merge (squash) June 25, 2026 14:49

@eth-bot eth-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

@eth-bot
eth-bot merged commit 9920740 into ethereum:master Jun 25, 2026
10 checks passed
@misilva73
misilva73 deleted the update-eip-2780 branch July 9, 2026 14:00
rakita added a commit to alloy-rs/evm2 that referenced this pull request Jul 30, 2026
)

Aligns Amsterdam to the **glamsterdam devnet-7** spec and the
`tests-glamsterdam-devnet@v7.2.0` 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`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c-update Modifies an existing proposal s-draft This EIP is a Draft t-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants