Skip to content

Commit 8991c5e

Browse files
committed
feat(spec-specs): 6) make intrinsic_state_gas immutable for EIP-7702
1 parent 2e74cc3 commit 8991c5e

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/ethereum/forks/amsterdam/vm/eoa_delegation.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def set_delegation(message: Message) -> None:
163163
"""
164164
Set the delegation code for the authorities in the message.
165165
166-
For existing accounts, adjusts intrinsic_state_gas downward since
167-
no account creation is needed (only delegation code write).
166+
For existing accounts, refunds the account-creation component of
167+
state gas to the reservoir (no mutation of intrinsic_state_gas).
168168
169169
Parameters
170170
----------
@@ -199,11 +199,10 @@ def set_delegation(message: Message) -> None:
199199
continue
200200

201201
# For existing accounts, no account creation needed.
202-
# Refund the account creation state gas to the reservoir
203-
# and adjust intrinsic accounting to avoid double-counting.
202+
# Refund the account creation state gas to the reservoir.
203+
# intrinsic_state_gas is immutable after validation.
204204
if account_exists(tx_state, authority):
205205
refund = STATE_BYTES_PER_NEW_ACCOUNT * cost_per_state_byte
206-
message.tx_env.intrinsic_state_gas -= refund
207206
message.state_gas_reservoir += refund
208207

209208
if auth.address == NULL_ADDRESS:

0 commit comments

Comments
 (0)