diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4f03047d258..7528eae34e8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -30,6 +30,7 @@ Release tarball changes: - 🔀 Update EIP-7002 according to [spec updates](https://github.com/ethereum/EIPs/pull/9119) ([#1024](https://github.com/ethereum/execution-spec-tests/pull/1024)). - 🔀 Update EIP-2935 according to [spec updates](https://github.com/ethereum/EIPs/pull/9144) ([#1046](https://github.com/ethereum/execution-spec-tests/pull/1046)) - ✨ [EIP-7691](https://eips.ethereum.org/EIPS/eip-7691) Blob throughput increase tests by parametrization of existing EIP-4844 tests ([#1023](https://github.com/ethereum/execution-spec-tests/pull/1023), [#1082](https://github.com/ethereum/execution-spec-tests/pull/1082)) +- 🔀 Update EIP-7702 test expectations according to [spec updates](https://github.com/ethereum/EIPs/pull/9248) ([#1129](https://github.com/ethereum/execution-spec-tests/pull/1129)) - ✨ Port [calldatacopy test](https://github.com/ethereum/tests/blob/ae4791077e8fcf716136e70fe8392f1a1f1495fb/src/GeneralStateTestsFiller/VMTests/vmTests/calldatacopyFiller.yml) ([#1056](https://github.com/ethereum/execution-spec-tests/pull/1056)). - ✨ [EIP-152](https://eips.ethereum.org/EIPS/eip-152) Add tests for Blake2 compression function `F` precompile ([#1067](https://github.com/ethereum/execution-spec-tests/pull/1067)) diff --git a/tests/prague/eip7702_set_code_tx/spec.py b/tests/prague/eip7702_set_code_tx/spec.py index 1a8ab6f0ae1..70af73dba02 100644 --- a/tests/prague/eip7702_set_code_tx/spec.py +++ b/tests/prague/eip7702_set_code_tx/spec.py @@ -28,7 +28,6 @@ class Spec: PER_AUTH_BASE_COST = 12_500 PER_EMPTY_ACCOUNT_COST = 25_000 DELEGATION_DESIGNATION = Bytes("ef0100") - DELEGATION_DESIGNATION_READING = Bytes("ef01") RESET_DELEGATION_ADDRESS = Address(0) MAX_AUTH_CHAIN_ID = 2**256 - 1 diff --git a/tests/prague/eip7702_set_code_tx/test_set_code_txs.py b/tests/prague/eip7702_set_code_tx/test_set_code_txs.py index 37914570d52..bfdcaf4c7d9 100644 --- a/tests/prague/eip7702_set_code_tx/test_set_code_txs.py +++ b/tests/prague/eip7702_set_code_tx/test_set_code_txs.py @@ -1075,11 +1075,15 @@ def test_ext_code_on_set_code( raise ValueError(f"Unsupported set code type: {set_code_type}") callee_storage = Storage() - callee_storage[slot_ext_code_size_result] = len(Spec.DELEGATION_DESIGNATION_READING) - callee_storage[slot_ext_code_hash_result] = Spec.DELEGATION_DESIGNATION_READING.keccak256() - callee_storage[slot_ext_code_copy_result] = Spec.DELEGATION_DESIGNATION_READING.ljust( - 32, b"\x00" - )[:32] + callee_storage[slot_ext_code_size_result] = len( + Spec.delegation_designation(set_code_to_address) + ) + callee_storage[slot_ext_code_hash_result] = Spec.delegation_designation( + set_code_to_address + ).keccak256() + callee_storage[slot_ext_code_copy_result] = Hash( + Spec.delegation_designation(set_code_to_address), right_padding=True + ) callee_storage[slot_ext_balance_result] = balance tx = Transaction( @@ -1144,11 +1148,15 @@ def test_ext_code_on_self_set_code( set_code_address = pre.deploy_contract(set_code) set_code_storage = Storage() - set_code_storage[slot_ext_code_size_result] = len(Spec.DELEGATION_DESIGNATION_READING) - set_code_storage[slot_ext_code_hash_result] = Spec.DELEGATION_DESIGNATION_READING.keccak256() - set_code_storage[slot_ext_code_copy_result] = Spec.DELEGATION_DESIGNATION_READING.ljust( - 32, b"\x00" - )[:32] + set_code_storage[slot_ext_code_size_result] = len( + Spec.delegation_designation(set_code_address) + ) + set_code_storage[slot_ext_code_hash_result] = Spec.delegation_designation( + set_code_address + ).keccak256() + set_code_storage[slot_ext_code_copy_result] = Hash( + Spec.delegation_designation(set_code_address), right_padding=True + ) set_code_storage[slot_ext_balance_result] = balance tx = Transaction( @@ -1364,11 +1372,13 @@ def test_ext_code_on_self_delegating_set_code( callee_address = pre.deploy_contract(callee_code) callee_storage = Storage() - callee_storage[slot_ext_code_size_result] = len(Spec.DELEGATION_DESIGNATION_READING) - callee_storage[slot_ext_code_hash_result] = Spec.DELEGATION_DESIGNATION_READING.keccak256() - callee_storage[slot_ext_code_copy_result] = Spec.DELEGATION_DESIGNATION_READING.ljust( - 32, b"\x00" - )[:32] + callee_storage[slot_ext_code_size_result] = len(Spec.delegation_designation(auth_signer)) + callee_storage[slot_ext_code_hash_result] = Spec.delegation_designation( + auth_signer + ).keccak256() + callee_storage[slot_ext_code_copy_result] = Hash( + Spec.delegation_designation(auth_signer), right_padding=True + ) callee_storage[slot_ext_balance_result] = balance tx = Transaction( @@ -1443,18 +1453,22 @@ def test_ext_code_on_chain_delegating_set_code( callee_address = pre.deploy_contract(callee_code) callee_storage = Storage() - callee_storage[slot_ext_code_size_result_1] = len(Spec.DELEGATION_DESIGNATION_READING) - callee_storage[slot_ext_code_hash_result_1] = Spec.DELEGATION_DESIGNATION_READING.keccak256() - callee_storage[slot_ext_code_copy_result_1] = Spec.DELEGATION_DESIGNATION_READING.ljust( - 32, b"\x00" - )[:32] + callee_storage[slot_ext_code_size_result_1] = len(Spec.delegation_designation(auth_signer_2)) + callee_storage[slot_ext_code_hash_result_1] = Spec.delegation_designation( + auth_signer_2 + ).keccak256() + callee_storage[slot_ext_code_copy_result_1] = Hash( + Spec.delegation_designation(auth_signer_2), right_padding=True + ) callee_storage[slot_ext_balance_result_1] = auth_signer_1_balance - callee_storage[slot_ext_code_size_result_2] = len(Spec.DELEGATION_DESIGNATION_READING) - callee_storage[slot_ext_code_hash_result_2] = Spec.DELEGATION_DESIGNATION_READING.keccak256() - callee_storage[slot_ext_code_copy_result_2] = Spec.DELEGATION_DESIGNATION_READING.ljust( - 32, b"\x00" - )[:32] + callee_storage[slot_ext_code_size_result_2] = len(Spec.delegation_designation(auth_signer_1)) + callee_storage[slot_ext_code_hash_result_2] = Spec.delegation_designation( + auth_signer_1 + ).keccak256() + callee_storage[slot_ext_code_copy_result_2] = Hash( + Spec.delegation_designation(auth_signer_1), right_padding=True + ) callee_storage[slot_ext_balance_result_2] = auth_signer_2_balance tx = Transaction( diff --git a/tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py b/tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py index 891cac00a2b..2cc923b6110 100644 --- a/tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py +++ b/tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py @@ -254,22 +254,20 @@ def test_pointer_measurements(blockchain_test: BlockchainTestFiller, pre: Alloc) + Op.SSTORE(storage_normal.store_next(100, "balance"), Op.BALANCE(pointer)) + Op.STOP, ) - + delegation_designation = Spec.delegation_designation(pointer_code) contract_measurements_pointer = pre.deploy_contract( code=Op.EXTCODECOPY(pointer, 0, 0, 32) + Op.SSTORE( - storage_pointer.store_next( - Spec.DELEGATION_DESIGNATION_READING.keccak256(), "extcodehash" - ), + storage_pointer.store_next(delegation_designation.keccak256(), "extcodehash"), Op.EXTCODEHASH(pointer), ) + Op.SSTORE( - storage_pointer.store_next(len(Spec.DELEGATION_DESIGNATION_READING), "extcodesize"), + storage_pointer.store_next(len(delegation_designation), "extcodesize"), Op.EXTCODESIZE(pointer), ) + Op.SSTORE( storage_pointer.store_next( - Hash(Spec.DELEGATION_DESIGNATION_READING, right_padding=True), "extcodecopy" + Hash(delegation_designation, right_padding=True), "extcodecopy" ), Op.MLOAD(0), )