Skip to content

refactor(specs,tests): Remove intrinsic state gas concept - #17

Merged
gurukamath merged 5 commits into
gurukamath:eip-2780/process-auth-in-top-framefrom
marioevz:eip-2780/process-auth-in-top-frame-remove-intrinsic-state-gas
Jul 9, 2026
Merged

refactor(specs,tests): Remove intrinsic state gas concept#17
gurukamath merged 5 commits into
gurukamath:eip-2780/process-auth-in-top-framefrom
marioevz:eip-2780/process-auth-in-top-frame-remove-intrinsic-state-gas

Conversation

@marioevz

@marioevz marioevz commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Remove the "intrinsic state gas" concept from the Amsterdam fork. Under EIP-8037's two-dimensional gas model, the intrinsic cost was previously split into a regular and a state component, with the state portion accounting for account creation, storage set, and authorization state growth up front. In practice none of these costs are truly intrinsic: they all depend on the actual state touched during execution, so following EIP-2780 they are charged at the top frame instead. This series drops the now-redundant intrinsic state gas plumbing so the intrinsic cost is a single regular value again.

The change spans three layers:

  • Specs (src/ethereum/forks/amsterdam/)refactor(specs): Remove intrinsic state gas concept

    • Drop the state field from IntrinsicGasCost and fold the recipient and authorization costs into a single regular intrinsic value in calculate_intrinsic_cost.
    • Remove intrinsic_regular_gas / intrinsic_state_gas from TransactionEnvironment, and stop seeding intrinsic state gas in process_transaction and process_unchecked_system_transaction. The transaction's state gas now comes solely from tx_output.state_gas_used.
  • Test forks (packages/testing/)refactor(test-forks): Remove intrinsic state gas

    • Delete the transaction_intrinsic_state_gas classmethod from BaseFork and its EIP2780 / EIP8037 overrides, which are no longer referenced now that these costs are computed at the top frame.
  • Tests (tests/amsterdam/)fix(tests): Fix intrinsic state gas usages

    • Update state-gas tests (create, delegation pointer, pricing, reservoir, set-code auth gas, tx gas limit) to reflect that account-creation and authorization state growth is accounted at the top frame rather than as intrinsic gas.

@marioevz
marioevz requested a review from gurukamath July 9, 2026 01:35
…ests

The two migrated delegation-pointer tests re-target an authority that
already has a delegation and whose account nonce (1, from the delegation
setup) no longer matches the authorization's nonce=0, so the
authorization is invalid and charges no top-frame state gas. Setting
writes_delegation/first_write to True added a phantom AUTH_BASE to
state_gas_reservoir that was silently refunded, contradicting the
AuthorizationTuple.first_write contract (False for invalid
authorizations) and the spec's AUTH_BASE gate (not delegated_before_tx).

Set both flags to False so the reserved state gas matches what the top
frame actually charges, and reuse the single authorization object in
test_delegation_pointer_new_account_state_gas instead of building a
second inline tuple.
The execute plugin's _compute_deploy_gas_limit still called the removed
transaction_intrinsic_state_gas, which failed mypy (and CI static).
On every concrete fork that value was zero (BaseFork default, or forced
to zero once EIP-2780 moves the created account's NEW_ACCOUNT to the top
frame), and the intrinsic calculator already returns the regular-only
cost, so the back-out was a no-op. Remove it, keeping the deploy gas
limit unchanged.
@gurukamath
gurukamath merged commit 6c5480c into gurukamath:eip-2780/process-auth-in-top-frame Jul 9, 2026
14 of 25 checks passed
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