From 2164db462a31d551ff1b1ff9961b78c2927c82aa Mon Sep 17 00:00:00 2001 From: Guruprasad Kamath Date: Fri, 24 Jan 2025 10:30:47 +0100 Subject: [PATCH] update EXTCODE* behavior in 7702 See https://github.com/ethereum/EIPs/pull/9248/files --- src/ethereum/prague/vm/eoa_delegation.py | 1 - src/ethereum/prague/vm/instructions/environment.py | 7 ------- 2 files changed, 8 deletions(-) diff --git a/src/ethereum/prague/vm/eoa_delegation.py b/src/ethereum/prague/vm/eoa_delegation.py index b06cd144eb..8728375a25 100644 --- a/src/ethereum/prague/vm/eoa_delegation.py +++ b/src/ethereum/prague/vm/eoa_delegation.py @@ -21,7 +21,6 @@ SET_CODE_TX_MAGIC = b"\x05" EOA_DELEGATION_MARKER = b"\xEF\x01\x00" -EOA_DELEGATION_SENTINEL = b"\xEF\x01" EOA_DELEGATION_MARKER_LENGTH = len(EOA_DELEGATION_MARKER) EOA_DELEGATED_CODE_LENGTH = 23 PER_EMPTY_ACCOUNT_COST = 25000 diff --git a/src/ethereum/prague/vm/instructions/environment.py b/src/ethereum/prague/vm/instructions/environment.py index 08d6e9ae0d..6a524f1496 100644 --- a/src/ethereum/prague/vm/instructions/environment.py +++ b/src/ethereum/prague/vm/instructions/environment.py @@ -21,7 +21,6 @@ from ...fork_types import EMPTY_ACCOUNT from ...state import get_account from ...utils.address import to_address -from ...vm.eoa_delegation import EOA_DELEGATION_SENTINEL, is_valid_delegation from ...vm.memory import buffer_read, memory_write from .. import Evm from ..exceptions import OutOfBoundsRead @@ -353,8 +352,6 @@ def extcodesize(evm: Evm) -> None: # OPERATION code = get_account(evm.env.state, address).code - if is_valid_delegation(code): - code = EOA_DELEGATION_SENTINEL codesize = U256(len(code)) push(evm.stack, codesize) @@ -397,8 +394,6 @@ def extcodecopy(evm: Evm) -> None: # OPERATION evm.memory += b"\x00" * extend_memory.expand_by code = get_account(evm.env.state, address).code - if is_valid_delegation(code): - code = EOA_DELEGATION_SENTINEL value = buffer_read(code, code_start_index, size) memory_write(evm.memory, memory_start_index, value) @@ -490,8 +485,6 @@ def extcodehash(evm: Evm) -> None: codehash = U256(0) else: code = account.code - if is_valid_delegation(code): - code = EOA_DELEGATION_SENTINEL codehash = U256.from_be_bytes(keccak256(code)) push(evm.stack, codehash)