From 2109bce0ba098c69a51267f9df8ee9113d4ba31f Mon Sep 17 00:00:00 2001 From: spencer-tb Date: Tue, 30 Jul 2024 21:18:50 +0100 Subject: [PATCH] feat(tests|fw): use verkle for forkname. --- src/ethereum_test_forks/__init__.py | 4 ++-- src/ethereum_test_forks/forks/forks.py | 14 ++++++------- src/ethereum_test_specs/blockchain.py | 4 ++-- src/evm_transition_tool/transition_tool.py | 4 ++-- .../consume/hive_simulators/ruleset.py | 20 +++++++++++++++++-- .../eip6800_verkle_tree/__init__.py | 2 +- .../test_verkle_from_mpt_conversion.py | 0 .../eip6800_verkle_tree/tracker.md | 0 8 files changed, 32 insertions(+), 16 deletions(-) rename tests/{osaka => verkle}/eip6800_verkle_tree/__init__.py (71%) rename tests/{osaka => verkle}/eip6800_verkle_tree/test_verkle_from_mpt_conversion.py (100%) rename tests/{osaka => verkle}/eip6800_verkle_tree/tracker.md (100%) diff --git a/src/ethereum_test_forks/__init__.py b/src/ethereum_test_forks/__init__.py index 27185fd4f3..eeb46a3927 100644 --- a/src/ethereum_test_forks/__init__.py +++ b/src/ethereum_test_forks/__init__.py @@ -20,7 +20,7 @@ Paris, Prague, Shanghai, - ShanghaiEIP6800, + Verkle, ) from .forks.transition import ( BerlinToLondonAt5, @@ -62,7 +62,7 @@ "MuirGlacier", "Shanghai", "ShanghaiToCancunAtTime15k", - "ShanghaiEIP6800", + "Verkle", "EIP6800Transition", "Cancun", "Prague", diff --git a/src/ethereum_test_forks/forks/forks.py b/src/ethereum_test_forks/forks/forks.py index 7d7511a9ac..5953039c15 100644 --- a/src/ethereum_test_forks/forks/forks.py +++ b/src/ethereum_test_forks/forks/forks.py @@ -630,14 +630,14 @@ def engine_forkchoice_updated_version( return 3 -class ShanghaiEIP6800( +class Verkle( Shanghai, - transition_tool_name="Prague", - blockchain_test_network_name="Prague", + transition_tool_name="Verkle", + blockchain_test_network_name="Verkle", solc_name="shanghai", ): """ - Shanghai + EIP-6800 (Verkle) fork + Verkle fork. Built on top of Shanghai. To update when the exact fork is known. """ @classmethod @@ -675,11 +675,11 @@ def pre_allocation_blockchain(cls) -> Mapping: return new_allocation | super(Shanghai, cls).pre_allocation_blockchain() -# TODO: move back to transition.py after filling and executing ShanghaiEIP6800 tests successfully -@transition_fork(to_fork=ShanghaiEIP6800, at_timestamp=32) +# TODO: move back to transition.py after filling and executing Verkle tests successfully +@transition_fork(to_fork=Verkle, at_timestamp=32) class EIP6800Transition( Shanghai, - blockchain_test_network_name="ShanghaiToPragueAtTime32", + blockchain_test_network_name="ShanghaiToVerkleAtTime32", ): """ Shanghai to Verkle transition at Timestamp 32. diff --git a/src/ethereum_test_specs/blockchain.py b/src/ethereum_test_specs/blockchain.py index 33dcdfd03c..ede436b916 100644 --- a/src/ethereum_test_specs/blockchain.py +++ b/src/ethereum_test_specs/blockchain.py @@ -36,7 +36,7 @@ FixtureWithdrawalRequest, InvalidFixtureBlock, ) -from ethereum_test_forks import EIP6800Transition, Fork, ShanghaiEIP6800 +from ethereum_test_forks import EIP6800Transition, Fork, Verkle from ethereum_test_types import ( Alloc, ConsolidationRequest, @@ -517,7 +517,7 @@ def generate_block_data( requests = Requests(root=block.requests) header.requests_root = requests.trie_root - if fork.fork_at(env.number, env.timestamp) == ShanghaiEIP6800: + if fork.fork_at(env.number, env.timestamp) == Verkle: env = Environment( **( env.model_dump(exclude_none=True) diff --git a/src/evm_transition_tool/transition_tool.py b/src/evm_transition_tool/transition_tool.py index f341452d1f..752094d992 100644 --- a/src/evm_transition_tool/transition_tool.py +++ b/src/evm_transition_tool/transition_tool.py @@ -309,7 +309,7 @@ def _evaluate_filesystem( ] # TODO: Verkle specific logic, update when Verkle fork is confirmed. - if t8n_data.fork_name == "Prague": + if t8n_data.fork_name == "Verkle": output_paths["vkt"] = os.path.join("output", "vkt.json") args.extend(["--output.vkt", output_paths["vkt"]]) if t8n_data.vkt is not None: @@ -448,7 +448,7 @@ def construct_args_stream( ] # TODO: Verkle specific logic, update when Verkle fork is confirmed. - if t8n_data.fork_name == "Prague": + if t8n_data.fork_name == "Verkle": args.append("--output.vkt=stdout") if t8n_data.vkt is not None: args.append("--input.vkt=stdin") diff --git a/src/pytest_plugins/consume/hive_simulators/ruleset.py b/src/pytest_plugins/consume/hive_simulators/ruleset.py index a4088a3ad2..fce16899ea 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, }, - "ShanghaiToPragueAtTime32": { # TODO: Make this verkle specific + "ShanghaiToVerkleAtTime32": { "HIVE_FORK_HOMESTEAD": 0, "HIVE_FORK_TANGERINE": 0, "HIVE_FORK_SPURIOUS": 0, @@ -335,7 +335,23 @@ "HIVE_FORK_MERGE": 0, "HIVE_TERMINAL_TOTAL_DIFFICULTY": 0, "HIVE_SHANGHAI_TIMESTAMP": 0, - "HIVE_PRAGUE_TIMESTAMP": 32, + "HIVE_VERKLE_TIMESTAMP": 32, + }, + "Verkle": { + "HIVE_FORK_HOMESTEAD": 0, + "HIVE_FORK_TANGERINE": 0, + "HIVE_FORK_SPURIOUS": 0, + "HIVE_FORK_BYZANTIUM": 0, + "HIVE_FORK_CONSTANTINOPLE": 0, + "HIVE_FORK_PETERSBURG": 0, + "HIVE_FORK_ISTANBUL": 0, + "HIVE_FORK_BERLIN": 0, + "HIVE_FORK_LONDON": 0, + "HIVE_FORK_MERGE": 0, + "HIVE_TERMINAL_TOTAL_DIFFICULTY": 0, + "HIVE_SHANGHAI_TIMESTAMP": 0, + "HIVE_CANCUN_TIMESTAMP": 0, + "HIVE_VERKLE_TIMESTAMP": 0, }, "Prague": { "HIVE_FORK_HOMESTEAD": 0, diff --git a/tests/osaka/eip6800_verkle_tree/__init__.py b/tests/verkle/eip6800_verkle_tree/__init__.py similarity index 71% rename from tests/osaka/eip6800_verkle_tree/__init__.py rename to tests/verkle/eip6800_verkle_tree/__init__.py index 41c353dafa..4c220dccaa 100644 --- a/tests/osaka/eip6800_verkle_tree/__init__.py +++ b/tests/verkle/eip6800_verkle_tree/__init__.py @@ -2,5 +2,5 @@ Test cases for all EIPs in Verkle """ -VERKLE_FORK_NAME = "ShanghaiEIP6800" +VERKLE_FORK_NAME = "Verkle" VERKLE_TRANSITION_FORK_NAME = "EIP6800Transition" diff --git a/tests/osaka/eip6800_verkle_tree/test_verkle_from_mpt_conversion.py b/tests/verkle/eip6800_verkle_tree/test_verkle_from_mpt_conversion.py similarity index 100% rename from tests/osaka/eip6800_verkle_tree/test_verkle_from_mpt_conversion.py rename to tests/verkle/eip6800_verkle_tree/test_verkle_from_mpt_conversion.py diff --git a/tests/osaka/eip6800_verkle_tree/tracker.md b/tests/verkle/eip6800_verkle_tree/tracker.md similarity index 100% rename from tests/osaka/eip6800_verkle_tree/tracker.md rename to tests/verkle/eip6800_verkle_tree/tracker.md