diff --git a/src/ethereum_test_base_types/conversions.py b/src/ethereum_test_base_types/conversions.py index 33deb09c3b..c98a61287a 100644 --- a/src/ethereum_test_base_types/conversions.py +++ b/src/ethereum_test_base_types/conversions.py @@ -1,6 +1,7 @@ """ Common conversion methods. """ + from re import sub from typing import Any, List, Optional, SupportsBytes, TypeAlias diff --git a/src/ethereum_test_forks/base_fork.py b/src/ethereum_test_forks/base_fork.py index d39ea48c78..087d0308de 100644 --- a/src/ethereum_test_forks/base_fork.py +++ b/src/ethereum_test_forks/base_fork.py @@ -292,6 +292,14 @@ def fork_at(cls, block_number: int = 0, timestamp: int = 0) -> Type["BaseFork"]: """ return cls + @classmethod + def transition_at(cls) -> int: + """ + Return the timestamp at which the fork will start transitioning to the next fork. + Useful only for transition forks. + """ + return 0 + @classmethod @abstractmethod def transition_tool_name(cls, block_number: int = 0, timestamp: int = 0) -> str: diff --git a/src/ethereum_test_forks/forks/forks.py b/src/ethereum_test_forks/forks/forks.py index ae56ae7c1b..7d7511a9ac 100644 --- a/src/ethereum_test_forks/forks/forks.py +++ b/src/ethereum_test_forks/forks/forks.py @@ -685,7 +685,12 @@ class EIP6800Transition( Shanghai to Verkle transition at Timestamp 32. """ - pass + @classmethod + def transition_at(cls) -> int: + """ + The timestamp at which the fork transition occurs. + """ + return 32 class CancunEIP7692( diff --git a/src/evm_transition_tool/geth.py b/src/evm_transition_tool/geth.py index e9fa10e9c2..32e14163ba 100644 --- a/src/evm_transition_tool/geth.py +++ b/src/evm_transition_tool/geth.py @@ -12,9 +12,9 @@ from re import compile from typing import Optional +from ethereum_test_base_types import to_json from ethereum_test_forks import Fork -from ethereum_test_tools.common.json import to_json -from ethereum_test_tools.common.types import Alloc, VerkleTree +from ethereum_test_types import Alloc, VerkleTree from .transition_tool import FixtureFormats, TransitionTool, dump_files_to_directory diff --git a/src/evm_transition_tool/types.py b/src/evm_transition_tool/types.py index 07de1d9475..f1b7b5613d 100644 --- a/src/evm_transition_tool/types.py +++ b/src/evm_transition_tool/types.py @@ -13,6 +13,7 @@ DepositRequest, Environment, Transaction, + VerkleTree, WithdrawalRequest, ) @@ -88,6 +89,16 @@ class Result(CamelModel): withdrawal_requests: List[WithdrawalRequest] | None = None consolidation_requests: List[ConsolidationRequest] | None = None + # Verkle fields within the result + verkle_conversion_address: Address | None = Field(None, alias="currentConversionAddress") + verkle_conversion_slot_hash: Hash | None = Field(None, alias="currentConversionSlotHash") + verkle_conversion_started: bool | None = Field(None, alias="currentConversionStarted") + verkle_conversion_ended: bool | None = Field(None, alias="currentConversionEnded") + verkle_conversion_storage_processed: bool | None = Field( + None, + alias="currentConversionStorageProcessed", + ) + class TransitionToolInput(CamelModel): """ @@ -97,6 +108,7 @@ class TransitionToolInput(CamelModel): alloc: Alloc txs: List[Transaction] env: Environment + vkt: VerkleTree | None = None class TransitionToolOutput(CamelModel): @@ -107,3 +119,4 @@ class TransitionToolOutput(CamelModel): alloc: Alloc result: Result body: Bytes | None = None + vkt: VerkleTree | None = None diff --git a/src/pytest_plugins/consume/hive_simulators/ruleset.py b/src/pytest_plugins/consume/hive_simulators/ruleset.py index c53493f2c0..a4088a3ad2 100644 --- a/src/pytest_plugins/consume/hive_simulators/ruleset.py +++ b/src/pytest_plugins/consume/hive_simulators/ruleset.py @@ -322,7 +322,7 @@ "HIVE_SHANGHAI_TIMESTAMP": 0, "HIVE_CANCUN_TIMESTAMP": 15000, }, - "ShanghaiToPragueAt32": { # TODO: Make this verkle specific + "ShanghaiToPragueAtTime32": { # TODO: Make this verkle specific "HIVE_FORK_HOMESTEAD": 0, "HIVE_FORK_TANGERINE": 0, "HIVE_FORK_SPURIOUS": 0,