diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c8953d1e975..771f885edd1 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -85,7 +85,8 @@ Release tarball changes: - ✨ Modify `valid_at_transition_to` marker to add keyword arguments `subsequent_transitions` and `until` to fill a test using multiple transition forks ([#1081](https://github.com/ethereum/execution-spec-tests/pull/1081)). - 🐞 fix(consume): use `"HIVE_CHECK_LIVE_PORT"` to signal hive to wait for port 8551 (Engine API port) instead of the 8545 port when running `consume engine` ([#1095](https://github.com/ethereum/execution-spec-tests/pull/1095)). - ✨ `state_test`, `blockchain_test` and `blockchain_test_engine` fixtures now contain the `blobSchedule` from [EIP-7840](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7840.md), only for tests filled for Cancun and Prague forks ([#1040](https://github.com/ethereum/execution-spec-tests/pull/1040)). -- 🔀 Change `--dist` flag to the default value, `load`, for better parallelism handling during test filling ([#1118](https://github.com/ethereum/execution-spec-tests/pull/1118)) +- 🔀 Change `--dist` flag to the default value, `load`, for better parallelism handling during test filling ([#1118](https://github.com/ethereum/execution-spec-tests/pull/1118)). +- 🔀 Refactor framework code to use the [`ethereum-rlp`](https://pypi.org/project/ethereum-rlp/) package instead of `ethereum.rlp`, previously available in ethereum/execution-specs ([#1180](https://github.com/ethereum/execution-spec-tests/pull/1180)). ### 🔧 EVM Tools diff --git a/pyproject.toml b/pyproject.toml index d13a9565352..2d6eee55e13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ dependencies = [ # https://ethereum.github.io/execution-spec-tests/main/dev/interactive_usage/ "questionary @ git+https://github.com/tmbo/questionary@ff22aeae1cd9c1c734f14329934e349bec7873bc", "prompt_toolkit>=3.0.48,<4", # ensure we have a new enough version for ipython - "ethereum-rlp==0.1.3", + "ethereum-rlp>=0.1.3,<0.2", ] [project.urls] diff --git a/src/ethereum_test_fixtures/blockchain.py b/src/ethereum_test_fixtures/blockchain.py index 07214a23e0a..04a8f77a5a1 100644 --- a/src/ethereum_test_fixtures/blockchain.py +++ b/src/ethereum_test_fixtures/blockchain.py @@ -14,7 +14,7 @@ get_type_hints, ) -from ethereum import rlp as eth_rlp +import ethereum_rlp as eth_rlp from ethereum_types.numeric import Uint from pydantic import AliasChoices, Field, PlainSerializer, computed_field diff --git a/src/ethereum_test_types/helpers.py b/src/ethereum_test_types/helpers.py index a4196641a64..52b8cf96e92 100644 --- a/src/ethereum_test_types/helpers.py +++ b/src/ethereum_test_types/helpers.py @@ -3,7 +3,7 @@ from dataclasses import MISSING, dataclass, fields from typing import List, SupportsBytes -from ethereum.rlp import encode +import ethereum_rlp as eth_rlp from ethereum_test_base_types.base_types import Address, Bytes, Hash from ethereum_test_base_types.conversions import BytesConvertible, FixedSizeBytesConvertible @@ -44,7 +44,7 @@ def compute_create_address( address = Address(address) if nonce is None: nonce = 0 - hash_bytes = Bytes(encode([address, int_to_bytes(nonce)])).keccak256() + hash_bytes = Bytes(eth_rlp.encode([address, int_to_bytes(nonce)])).keccak256() return Address(hash_bytes[-20:]) if opcode == Op.CREATE2: return compute_create2_address(address, salt, initcode) diff --git a/src/ethereum_test_types/types.py b/src/ethereum_test_types/types.py index 1fe493b1d3f..15d40229d02 100644 --- a/src/ethereum_test_types/types.py +++ b/src/ethereum_test_types/types.py @@ -6,8 +6,8 @@ from functools import cached_property from typing import Any, ClassVar, Dict, Generic, List, Literal, Sequence, SupportsBytes, Tuple +import ethereum_rlp as eth_rlp from coincurve.keys import PrivateKey, PublicKey -from ethereum import rlp as eth_rlp from ethereum.frontier.fork_types import Account as FrontierAccount from ethereum.frontier.fork_types import Address as FrontierAddress from ethereum.frontier.state import State, set_account, set_storage, state_root diff --git a/uv.lock b/uv.lock index 5763039a09a..c59800c02cf 100644 --- a/uv.lock +++ b/uv.lock @@ -559,7 +559,7 @@ requires-dist = [ { name = "coincurve", specifier = ">=20.0.0,<21" }, { name = "colorlog", specifier = ">=6.7.0,<7" }, { name = "ethereum", git = "https://github.com/ethereum/execution-specs" }, - { name = "ethereum-rlp", specifier = "==0.1.3" }, + { name = "ethereum-rlp", specifier = ">=0.1.3,<0.2" }, { name = "ethereum-spec-evm-resolver", git = "https://github.com/petertdavies/ethereum-spec-evm-resolver" }, { name = "ethereum-types", specifier = ">=0.2.1,<0.3" }, { name = "filelock", specifier = ">=3.15.1,<4" },