From 99fb731f79bacd4fb9093046fba174360f99b839 Mon Sep 17 00:00:00 2001 From: Mukul Kolpe Date: Fri, 19 Jan 2024 00:54:11 +0530 Subject: [PATCH] chore: Updated fork name from Merge -> Paris (#363) * chore: Updated fork names from Merge -> Paris * chore: Allow merge to still be used from the command line. --------- Co-authored-by: spencer-tb --- .vscode/launch.recommended.json | 17 +- docs/CHANGELOG.md | 1 + .../executing_tests_command_line.md | 2 +- docs/tutorials/state_transition.md | 2 +- docs/tutorials/state_transition_bad_opcode.md | 2 +- src/ethereum_test_forks/__init__.py | 8 +- src/ethereum_test_forks/forks/forks.py | 15 +- src/ethereum_test_forks/forks/transition.py | 6 +- src/ethereum_test_forks/tests/test_forks.py | 70 +++--- src/ethereum_test_tools/tests/test_filler.py | 4 +- ...ve.json => chainid_paris_filled_hive.json} | 4 +- src/pytest_plugins/forks/forks.py | 11 +- .../tests/test_bad_command_line_options.py | 4 +- .../forks/tests/test_bad_validity_markers.py | 22 +- src/pytest_plugins/forks/tests/test_forks.py | 41 +++- src/pytest_plugins/test_filler/test_filler.py | 6 +- .../test_filler/tests/test_test_filler.py | 221 +++++++++--------- .../test_reentrancy_selfdestruct_revert.py | 2 +- tests/merge/__init__.py | 3 - tests/paris/__init__.py | 3 + tests/{merge => paris}/security/__init__.py | 0 .../security/test_selfdestruct_balance_bug.py | 2 +- .../test_warm_coinbase.py | 2 +- 23 files changed, 243 insertions(+), 205 deletions(-) rename src/ethereum_test_tools/tests/test_fixtures/{chainid_merge_filled_hive.json => chainid_paris_filled_hive.json} (99%) delete mode 100644 tests/merge/__init__.py create mode 100644 tests/paris/__init__.py rename tests/{merge => paris}/security/__init__.py (100%) rename tests/{merge => paris}/security/test_selfdestruct_balance_bug.py (98%) diff --git a/.vscode/launch.recommended.json b/.vscode/launch.recommended.json index fd6f050916..da2885969c 100644 --- a/.vscode/launch.recommended.json +++ b/.vscode/launch.recommended.json @@ -2,7 +2,6 @@ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - // If the VS Code "Run and Debug" button, respecively launch selector are not visible, see this answer: // https://stackoverflow.com/a/74245823 // @@ -41,7 +40,7 @@ "${input:testPathOrId}" ], "cwd": "${workspaceFolder}" - }, + }, { "name": "Launch fill --until Shanghai", "type": "python", @@ -80,7 +79,11 @@ "type": "python", "request": "launch", "module": "pytest", - "args": ["-c", "pytest.ini", "--test-help"], + "args": [ + "-c", + "pytest.ini", + "--test-help" + ], "cwd": "/home/dtopz/code/github/danceratopz/execution-spec-tests" }, ], @@ -118,15 +121,15 @@ "id": "fork", "description": "Which fork do you want to use?", "options": [ - "Frontier", - "Homestead", + "Frontier", + "Homestead", "Byzantium", "Constantinople", "ConstantinopleFix", "Istanbul", "Berlin", "London", - "Merge", + "Paris", "Shanghai", "Cancun", ], @@ -139,4 +142,4 @@ "default": "test_" } ] -} +} \ No newline at end of file diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 3b641d1d45..1af17facb9 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -49,6 +49,7 @@ Test fixtures for use by clients are available for each release on the [Github r - ✨ `StateTestOnly`, spec format is now available and its only difference with `StateTest` is that it does not produce a `BlockchainTest` ([#368](https://github.com/ethereum/execution-spec-tests/pull/368)) - ✨ Add a helper class `ethereum_test_tools.TestParameterGroup` to define test parameters as dataclasses and auto-generate test IDs ([#364](https://github.com/ethereum/execution-spec-tests/pull/364)). - 🔀 Change custom exception classes to dataclasses to improve testability ([#386](https://github.com/ethereum/execution-spec-tests/pull/386)). +- 🔀 Updates fork name from Merge to Paris ([#363](https://github.com/ethereum/execution-spec-tests/pull/363)). ### 🔧 EVM Tools diff --git a/docs/getting_started/executing_tests_command_line.md b/docs/getting_started/executing_tests_command_line.md index 553c3b577c..1293659c43 100644 --- a/docs/getting_started/executing_tests_command_line.md +++ b/docs/getting_started/executing_tests_command_line.md @@ -71,7 +71,7 @@ fill tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py::test_warm_coinb or, for a test function and specific parameter combination: ```console -fill tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py::test_warm_coinbase_gas_usage[fork_Merge-DELEGATECALL] +fill tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py::test_warm_coinbase_gas_usage[fork_Paris-DELEGATECALL] ``` ## Execution for Development Forks diff --git a/docs/tutorials/state_transition.md b/docs/tutorials/state_transition.md index 14afa1f786..97f3e7af40 100644 --- a/docs/tutorials/state_transition.md +++ b/docs/tutorials/state_transition.md @@ -62,7 +62,7 @@ In this case, the decorator is a custom [pytest fixture](https://docs.pytest.org and to execute it for a specific fork range, we can provide the `--from` and `--until` command-line arguments: ```console - fill -k test_yul --from London --until Merge + fill -k test_yul --from London --until Paris ``` ```python diff --git a/docs/tutorials/state_transition_bad_opcode.md b/docs/tutorials/state_transition_bad_opcode.md index 5cb20b9eb9..e770562a14 100644 --- a/docs/tutorials/state_transition_bad_opcode.md +++ b/docs/tutorials/state_transition_bad_opcode.md @@ -74,7 +74,7 @@ We don't know what will be the fork names after Shanghai, so it is easiest to sp We don't need to worry about forks prior to London because the decorator for this test says it is only valid from London. ```python - if fork in {"london", "merge"} and opc==0x5F: + if fork in {"london", "paris"} and opc==0x5F: ``` Python has a [set data structure](https://docs.python.org/3/tutorial/datastructures.html#sets). diff --git a/src/ethereum_test_forks/__init__.py b/src/ethereum_test_forks/__init__.py index 47300c273d..22885932a6 100644 --- a/src/ethereum_test_forks/__init__.py +++ b/src/ethereum_test_forks/__init__.py @@ -15,13 +15,13 @@ Homestead, Istanbul, London, - Merge, MuirGlacier, + Paris, Shanghai, ) from .forks.transition import ( BerlinToLondonAt5, - MergeToShanghaiAtTime15k, + ParisToShanghaiAtTime15k, ShanghaiToCancunAtTime15k, ) from .helpers import ( @@ -51,8 +51,8 @@ "InvalidForkError", "Istanbul", "London", - "Merge", - "MergeToShanghaiAtTime15k", + "Paris", + "ParisToShanghaiAtTime15k", "MuirGlacier", "Shanghai", "ShanghaiToCancunAtTime15k", diff --git a/src/ethereum_test_forks/forks/forks.py b/src/ethereum_test_forks/forks/forks.py index 08abd09b73..1facf91f81 100644 --- a/src/ethereum_test_forks/forks/forks.py +++ b/src/ethereum_test_forks/forks/forks.py @@ -280,34 +280,33 @@ class GrayGlacier(ArrowGlacier): pass -class Merge( +class Paris( London, transition_tool_name="Merge", blockchain_test_network_name="Merge", - solc_name="Paris", ): """ - Merge fork + Paris (Merge) fork """ @classmethod def header_prev_randao_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: """ - Prev Randao is required starting from Merge. + Prev Randao is required starting from Paris. """ return True @classmethod def header_zero_difficulty_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: """ - Zero difficulty is required starting from Merge. + Zero difficulty is required starting from Paris. """ return True @classmethod def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: """ - Merge updates the reward to 0. + Paris updates the reward to 0. """ return 0 @@ -316,12 +315,12 @@ def engine_new_payload_version( cls, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """ - Starting at the merge, payloads can be sent through the engine API + Starting at Paris, payloads can be sent through the engine API """ return 1 -class Shanghai(Merge): +class Shanghai(Paris): """ Shanghai fork """ diff --git a/src/ethereum_test_forks/forks/transition.py b/src/ethereum_test_forks/forks/transition.py index 08b09091ff..b32b4e7252 100644 --- a/src/ethereum_test_forks/forks/transition.py +++ b/src/ethereum_test_forks/forks/transition.py @@ -2,7 +2,7 @@ List of all transition fork definitions. """ from ..transition_base_fork import transition_fork -from .forks import Berlin, Cancun, London, Merge, Shanghai +from .forks import Berlin, Cancun, London, Paris, Shanghai # Transition Forks @@ -16,9 +16,9 @@ class BerlinToLondonAt5(Berlin): @transition_fork(to_fork=Shanghai, at_timestamp=15_000) -class MergeToShanghaiAtTime15k(Merge, blockchain_test_network_name="MergeToShanghaiAtTime15k"): +class ParisToShanghaiAtTime15k(Paris, blockchain_test_network_name="ParisToShanghaiAtTime15k"): """ - Merge to Shanghai transition at Timestamp 15k + Paris to Shanghai transition at Timestamp 15k """ pass diff --git a/src/ethereum_test_forks/tests/test_forks.py b/src/ethereum_test_forks/tests/test_forks.py index 0d37ef98b8..31638264e4 100644 --- a/src/ethereum_test_forks/tests/test_forks.py +++ b/src/ethereum_test_forks/tests/test_forks.py @@ -5,8 +5,8 @@ from typing import Mapping, cast from ..base_fork import Fork -from ..forks.forks import Berlin, Cancun, Frontier, London, Merge, Shanghai -from ..forks.transition import BerlinToLondonAt5, MergeToShanghaiAtTime15k +from ..forks.forks import Berlin, Cancun, Frontier, London, Paris, Shanghai +from ..forks.transition import BerlinToLondonAt5, ParisToShanghaiAtTime15k from ..helpers import ( forks_from, forks_from_until, @@ -29,8 +29,8 @@ def test_transition_forks(): Test transition fork utilities. """ assert transition_fork_from_to(Berlin, London) == BerlinToLondonAt5 - assert transition_fork_from_to(Berlin, Merge) is None - assert transition_fork_to(Shanghai) == [MergeToShanghaiAtTime15k] + assert transition_fork_from_to(Berlin, Paris) is None + assert transition_fork_to(Shanghai) == [ParisToShanghaiAtTime15k] # Test forks transitioned to and from assert BerlinToLondonAt5.transitions_to() == London @@ -41,24 +41,24 @@ def test_transition_forks(): # Default values of transition forks is the transition block assert BerlinToLondonAt5.transition_tool_name() == "London" - assert MergeToShanghaiAtTime15k.transition_tool_name(0, 14_999) == "Merge" - assert MergeToShanghaiAtTime15k.transition_tool_name(0, 15_000) == "Shanghai" - assert MergeToShanghaiAtTime15k.transition_tool_name() == "Shanghai" + assert ParisToShanghaiAtTime15k.transition_tool_name(0, 14_999) == "Merge" + assert ParisToShanghaiAtTime15k.transition_tool_name(0, 15_000) == "Shanghai" + assert ParisToShanghaiAtTime15k.transition_tool_name() == "Shanghai" assert BerlinToLondonAt5.header_base_fee_required(4, 0) is False assert BerlinToLondonAt5.header_base_fee_required(5, 0) is True - assert MergeToShanghaiAtTime15k.header_withdrawals_required(0, 14_999) is False - assert MergeToShanghaiAtTime15k.header_withdrawals_required(0, 15_000) is True + assert ParisToShanghaiAtTime15k.header_withdrawals_required(0, 14_999) is False + assert ParisToShanghaiAtTime15k.header_withdrawals_required(0, 15_000) is True - assert MergeToShanghaiAtTime15k.engine_new_payload_version(0, 14_999) == 1 - assert MergeToShanghaiAtTime15k.engine_new_payload_version(0, 15_000) == 2 + assert ParisToShanghaiAtTime15k.engine_new_payload_version(0, 14_999) == 1 + assert ParisToShanghaiAtTime15k.engine_new_payload_version(0, 15_000) == 2 def test_forks_from(): # noqa: D103 - assert forks_from(Merge) == [Merge, LAST_DEPLOYED] - assert forks_from(Merge, deployed_only=True) == [Merge, LAST_DEPLOYED] - assert forks_from(Merge, deployed_only=False) == [Merge, LAST_DEPLOYED] + DEVELOPMENT_FORKS + assert forks_from(Paris) == [Paris, LAST_DEPLOYED] + assert forks_from(Paris, deployed_only=True) == [Paris, LAST_DEPLOYED] + assert forks_from(Paris, deployed_only=False) == [Paris, LAST_DEPLOYED] + DEVELOPMENT_FORKS def test_forks(): @@ -67,50 +67,50 @@ def test_forks(): """ assert forks_from_until(Berlin, Berlin) == [Berlin] assert forks_from_until(Berlin, London) == [Berlin, London] - assert forks_from_until(Berlin, Merge) == [ + assert forks_from_until(Berlin, Paris) == [ Berlin, London, - Merge, + Paris, ] # Test fork names assert London.name() == "London" - assert MergeToShanghaiAtTime15k.name() == "MergeToShanghaiAtTime15k" + assert ParisToShanghaiAtTime15k.name() == "ParisToShanghaiAtTime15k" assert f"{London}" == "London" - assert f"{MergeToShanghaiAtTime15k}" == "MergeToShanghaiAtTime15k" + assert f"{ParisToShanghaiAtTime15k}" == "ParisToShanghaiAtTime15k" # Merge name will be changed to paris, but we need to check the inheriting fork name is still # the default - assert Merge.transition_tool_name() == "Merge" + assert Paris.transition_tool_name() == "Merge" assert Shanghai.transition_tool_name() == "Shanghai" - assert Merge.blockchain_test_network_name() == "Merge" + assert Paris.blockchain_test_network_name() == "Merge" assert Shanghai.blockchain_test_network_name() == "Shanghai" - assert MergeToShanghaiAtTime15k.blockchain_test_network_name() == "MergeToShanghaiAtTime15k" + assert ParisToShanghaiAtTime15k.blockchain_test_network_name() == "ParisToShanghaiAtTime15k" # Test some fork properties assert Berlin.header_base_fee_required(0, 0) is False assert London.header_base_fee_required(0, 0) is True - assert Merge.header_base_fee_required(0, 0) is True + assert Paris.header_base_fee_required(0, 0) is True # Default values of normal forks if the genesis block - assert Merge.header_base_fee_required() is True + assert Paris.header_base_fee_required() is True # Transition forks too assert cast(Fork, BerlinToLondonAt5).header_base_fee_required(4, 0) is False assert cast(Fork, BerlinToLondonAt5).header_base_fee_required(5, 0) is True - assert cast(Fork, MergeToShanghaiAtTime15k).header_withdrawals_required(0, 14_999) is False - assert cast(Fork, MergeToShanghaiAtTime15k).header_withdrawals_required(0, 15_000) is True - assert cast(Fork, MergeToShanghaiAtTime15k).header_withdrawals_required() is True + assert cast(Fork, ParisToShanghaiAtTime15k).header_withdrawals_required(0, 14_999) is False + assert cast(Fork, ParisToShanghaiAtTime15k).header_withdrawals_required(0, 15_000) is True + assert cast(Fork, ParisToShanghaiAtTime15k).header_withdrawals_required() is True # Test fork comparison - assert Merge > Berlin - assert not Berlin > Merge - assert Berlin < Merge - assert not Merge < Berlin - - assert Merge >= Berlin - assert not Berlin >= Merge - assert Berlin <= Merge - assert not Merge <= Berlin + assert Paris > Berlin + assert not Berlin > Paris + assert Berlin < Paris + assert not Paris < Berlin + + assert Paris >= Berlin + assert not Berlin >= Paris + assert Berlin <= Paris + assert not Paris <= Berlin assert London > Berlin assert not Berlin > London diff --git a/src/ethereum_test_tools/tests/test_filler.py b/src/ethereum_test_tools/tests/test_filler.py index b1223e7254..640200c892 100644 --- a/src/ethereum_test_tools/tests/test_filler.py +++ b/src/ethereum_test_tools/tests/test_filler.py @@ -9,7 +9,7 @@ import pytest from semver import Version -from ethereum_test_forks import Berlin, Fork, Istanbul, London, Merge, Shanghai +from ethereum_test_forks import Berlin, Fork, Istanbul, London, Paris, Shanghai from evm_transition_tool import FixtureFormats, GethTransitionTool from ..code import Yul @@ -96,7 +96,7 @@ def test_make_genesis(fork: Fork, hash: bytes): # noqa: D103 [ (Istanbul, False, "chainid_istanbul_filled.json"), (London, False, "chainid_london_filled.json"), - (Merge, True, "chainid_merge_filled_hive.json"), + (Paris, True, "chainid_paris_filled_hive.json"), (Shanghai, True, "chainid_shanghai_filled_hive.json"), ], ) diff --git a/src/ethereum_test_tools/tests/test_fixtures/chainid_merge_filled_hive.json b/src/ethereum_test_tools/tests/test_fixtures/chainid_paris_filled_hive.json similarity index 99% rename from src/ethereum_test_tools/tests/test_fixtures/chainid_merge_filled_hive.json rename to src/ethereum_test_tools/tests/test_fixtures/chainid_paris_filled_hive.json index ab96ff9a91..6abac2957e 100644 --- a/src/ethereum_test_tools/tests/test_fixtures/chainid_merge_filled_hive.json +++ b/src/ethereum_test_tools/tests/test_fixtures/chainid_paris_filled_hive.json @@ -1,5 +1,5 @@ { - "000/my_chain_id_test/Merge": { + "000/my_chain_id_test/Paris": { "network": "Merge", "genesisBlockHeader": { "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -82,4 +82,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/pytest_plugins/forks/forks.py b/src/pytest_plugins/forks/forks.py index 61e7b70374..8bf23e4f3e 100644 --- a/src/pytest_plugins/forks/forks.py +++ b/src/pytest_plugins/forks/forks.py @@ -176,9 +176,14 @@ def pytest_configure(config): for d in fork_covariant_descriptors: config.addinivalue_line("markers", f"{d.marker_name}: {d.description}") - single_fork = config.getoption("single_fork") - forks_from = config.getoption("forks_from") - forks_until = config.getoption("forks_until") + def get_fork_option(config, option_name): + """Post-process get option to allow for external fork conditions.""" + option = config.getoption(option_name) + return "Paris" if option == "Merge" else option + + single_fork = get_fork_option(config, "single_fork") + forks_from = get_fork_option(config, "forks_from") + forks_until = get_fork_option(config, "forks_until") show_fork_help = config.getoption("show_fork_help") all_forks = get_forks() diff --git a/src/pytest_plugins/forks/tests/test_bad_command_line_options.py b/src/pytest_plugins/forks/tests/test_bad_command_line_options.py index 3444edd8ce..10ba0b7b14 100644 --- a/src/pytest_plugins/forks/tests/test_bad_command_line_options.py +++ b/src/pytest_plugins/forks/tests/test_bad_command_line_options.py @@ -44,8 +44,8 @@ ( "invalid_fork_range", ( - ("--from", "Merge", "--until", "Frontier"), - "--from Merge --until Frontier creates an empty fork range", + ("--from", "Paris", "--until", "Frontier"), + "--from Paris --until Frontier creates an empty fork range", ), ), ) diff --git a/src/pytest_plugins/forks/tests/test_bad_validity_markers.py b/src/pytest_plugins/forks/tests/test_bad_validity_markers.py index f6815b5c1e..f2dad60612 100644 --- a/src/pytest_plugins/forks/tests/test_bad_validity_markers.py +++ b/src/pytest_plugins/forks/tests/test_bad_validity_markers.py @@ -10,8 +10,8 @@ ( """ import pytest - @pytest.mark.valid_from("Merge") - @pytest.mark.valid_from("Merge") + @pytest.mark.valid_from("Paris") + @pytest.mark.valid_from("Paris") def test_case(state_test): assert 0 """, @@ -23,8 +23,8 @@ def test_case(state_test): ( """ import pytest - @pytest.mark.valid_until("Merge") - @pytest.mark.valid_until("Merge") + @pytest.mark.valid_until("Paris") + @pytest.mark.valid_until("Paris") def test_case(state_test): assert 0 """, @@ -36,8 +36,8 @@ def test_case(state_test): ( """ import pytest - @pytest.mark.valid_at_transition_to("Merge") - @pytest.mark.valid_at_transition_to("Merge") + @pytest.mark.valid_at_transition_to("Paris") + @pytest.mark.valid_at_transition_to("Paris") def test_case(state_test): assert 0 """, @@ -85,7 +85,7 @@ def test_case(state_test): ( """ import pytest - @pytest.mark.valid_from("Merge", "Merge") + @pytest.mark.valid_from("Paris", "Paris") def test_case(state_test): assert 0 """, @@ -97,7 +97,7 @@ def test_case(state_test): ( """ import pytest - @pytest.mark.valid_until("Merge", "Merge") + @pytest.mark.valid_until("Paris", "Paris") def test_case(state_test): assert 0 """, @@ -109,7 +109,7 @@ def test_case(state_test): ( """ import pytest - @pytest.mark.valid_at_transition_to("Merge", "Merge") + @pytest.mark.valid_at_transition_to("Paris", "Paris") def test_case(state_test): assert 0 """, @@ -158,7 +158,7 @@ def test_case(state_test): """ import pytest @pytest.mark.valid_at_transition_to("Cancun") - @pytest.mark.valid_from("Merge") + @pytest.mark.valid_from("Paris") def test_case(state_test): assert 0 """, @@ -183,7 +183,7 @@ def test_case(state_test): ( """ import pytest - @pytest.mark.valid_from("Merge") + @pytest.mark.valid_from("Paris") @pytest.mark.valid_until("Frontier") def test_case(state_test): assert 0 diff --git a/src/pytest_plugins/forks/tests/test_forks.py b/src/pytest_plugins/forks/tests/test_forks.py index 1d9ddbcc67..7e6c4e0f66 100644 --- a/src/pytest_plugins/forks/tests/test_forks.py +++ b/src/pytest_plugins/forks/tests/test_forks.py @@ -6,7 +6,7 @@ from ethereum_test_forks import ( ArrowGlacier, - Merge, + Paris, forks_from_until, get_deployed_forks, get_forks, @@ -44,7 +44,7 @@ def test_all_forks({StateTest.pytest_parameter_name()}): stdout = "\n".join(result.stdout.lines) for fork in forks_under_test: for fixture_format in StateTest.fixture_formats(): - if fixture_format.name.endswith("HIVE") and fork < Merge: + if fixture_format.name.endswith("HIVE") and fork < Paris: expected_passed -= 1 assert f":test_all_forks[fork_{fork}-{fixture_format.name.lower()}]" not in stdout continue @@ -58,7 +58,7 @@ def test_all_forks({StateTest.pytest_parameter_name()}): ) -@pytest.mark.parametrize("fork", ["London", "Merge"]) +@pytest.mark.parametrize("fork", ["London", "Paris"]) def test_from_london_option_no_validity_marker(pytester, fork_map, fork): """ Test test parametrization with: @@ -82,7 +82,7 @@ def test_all_forks({StateTest.pytest_parameter_name()}): stdout = "\n".join(result.stdout.lines) for fork in forks_under_test: for fixture_format in StateTest.fixture_formats(): - if fixture_format.name.endswith("HIVE") and fork < Merge: + if fixture_format.name.endswith("HIVE") and fork < Paris: expected_passed -= 1 assert f":test_all_forks[fork_{fork}-{fixture_format.name.lower()}]" not in stdout continue @@ -120,7 +120,7 @@ def test_all_forks({StateTest.pytest_parameter_name()}): expected_passed -= len(StateTest.fixture_formats()) for fork in forks_under_test: for fixture_format in StateTest.fixture_formats(): - if fixture_format.name.endswith("HIVE") and fork < Merge: + if fixture_format.name.endswith("HIVE") and fork < Paris: expected_passed -= 1 assert f":test_all_forks[fork_{fork}-{fixture_format.name.lower()}]" not in stdout continue @@ -131,3 +131,34 @@ def test_all_forks({StateTest.pytest_parameter_name()}): skipped=0, errors=0, ) + + +def test_from_merge_until_merge_option_no_validity_marker(pytester, fork_map): + """ + Test test parametrization with: + - --from Merge command-line option, + - --until Merge command-line option, + - no fork validity marker. + """ + pytester.makepyfile( + f""" + import pytest + + def test_all_forks({StateTest.pytest_parameter_name()}): + pass + """ + ) + pytester.copy_example(name="pytest.ini") + result = pytester.runpytest("-v", "--from", "Merge", "--until", "Merge") + forks_under_test = forks_from_until(fork_map["Paris"], fork_map["Paris"]) + expected_passed = len(forks_under_test) * len(StateTest.fixture_formats()) + stdout = "\n".join(result.stdout.lines) + for fork in forks_under_test: + for fixture_format in StateTest.fixture_formats(): + assert f":test_all_forks[fork_{fork}-{fixture_format.name.lower()}]" in stdout + result.assert_outcomes( + passed=expected_passed, + failed=0, + skipped=0, + errors=0, + ) diff --git a/src/pytest_plugins/test_filler/test_filler.py b/src/pytest_plugins/test_filler/test_filler.py index d96d64fb88..9c8fd0460b 100644 --- a/src/pytest_plugins/test_filler/test_filler.py +++ b/src/pytest_plugins/test_filler/test_filler.py @@ -11,7 +11,7 @@ import pytest -from ethereum_test_forks import Fork, Merge, get_development_forks +from ethereum_test_forks import Fork, Paris, get_development_forks from ethereum_test_tools import SPEC_TYPES, BaseTest, FixtureCollector, TestInfo, Yul from evm_transition_tool import FixtureFormats, TransitionTool from pytest_plugins.spec_version_checker.spec_version_checker import EIPSpecTestItem @@ -465,7 +465,7 @@ def pytest_generate_tests(metafunc): @pytest.hookimpl(trylast=True) def pytest_collection_modifyitems(config, items): """ - Remove pre-Merge tests parametrized to generate hive type fixtures; these + Remove pre-Paris tests parametrized to generate hive type fixtures; these can't be used in the Hive Pyspec Simulator. This can't be handled in this plugins pytest_generate_tests() as the fork @@ -474,7 +474,7 @@ def pytest_collection_modifyitems(config, items): for item in items[:]: # use a copy of the list, as we'll be modifying it if isinstance(item, EIPSpecTestItem): continue - if item.callspec.params["fork"] < Merge: + if item.callspec.params["fork"] < Paris: # Even though the `state_test` test spec does not produce a hive STATE_TEST, it does # produce a BLOCKCHAIN_TEST_HIVE, so we need to remove it here. # TODO: Ideally, the logic could be contained in the `FixtureFormat` class, we create diff --git a/src/pytest_plugins/test_filler/tests/test_test_filler.py b/src/pytest_plugins/test_filler/tests/test_test_filler.py index d8db47539d..8b6eb071e3 100644 --- a/src/pytest_plugins/test_filler/tests/test_test_filler.py +++ b/src/pytest_plugins/test_filler/tests/test_test_filler.py @@ -25,26 +25,26 @@ def count_keys_in_fixture(file_path): # noqa: D103 return len(data) -test_module_merge = textwrap.dedent( +test_module_paris = textwrap.dedent( """\ import pytest from ethereum_test_tools import Account, Environment, TestAddress, Transaction - @pytest.mark.valid_from("Merge") + @pytest.mark.valid_from("Paris") @pytest.mark.valid_until("Shanghai") - def test_merge_one(state_test): + def test_paris_one(state_test): state_test(env=Environment(), pre={TestAddress: Account(balance=1_000_000)}, post={}, tx=Transaction()) - @pytest.mark.valid_from("Merge") + @pytest.mark.valid_from("Paris") @pytest.mark.valid_until("Shanghai") - def test_merge_two(state_test): + def test_paris_two(state_test): state_test(env=Environment(), pre={TestAddress: Account(balance=1_000_000)}, post={}, tx=Transaction()) """ ) -test_count_merge = 4 +test_count_paris = 4 test_module_shanghai = textwrap.dedent( """\ @@ -52,14 +52,14 @@ def test_merge_two(state_test): from ethereum_test_tools import Account, Environment, TestAddress, Transaction - @pytest.mark.valid_from("Merge") + @pytest.mark.valid_from("Paris") @pytest.mark.valid_until("Shanghai") def test_shanghai_one(state_test): state_test(env=Environment(), pre={TestAddress: Account(balance=1_000_000)}, post={}, tx=Transaction()) @pytest.mark.parametrize("x", [1, 2, 3]) - @pytest.mark.valid_from("Merge") + @pytest.mark.valid_from("Paris") @pytest.mark.valid_until("Shanghai") def test_shanghai_two(state_test, x): state_test(env=Environment(), @@ -68,8 +68,7 @@ def test_shanghai_two(state_test, x): ) test_count_shanghai = 8 - -total_test_count = test_count_merge + test_count_shanghai +total_test_count = test_count_paris + test_count_shanghai @pytest.mark.parametrize( @@ -78,12 +77,12 @@ def test_shanghai_two(state_test, x): pytest.param( [], [ - Path("fixtures/blockchain_tests/merge/module_merge/merge_one.json"), - Path("fixtures/blockchain_tests_hive/merge/module_merge/merge_one.json"), - Path("fixtures/state_tests/merge/module_merge/merge_one.json"), - Path("fixtures/blockchain_tests/merge/module_merge/merge_two.json"), - Path("fixtures/blockchain_tests_hive/merge/module_merge/merge_two.json"), - Path("fixtures/state_tests/merge/module_merge/merge_two.json"), + Path("fixtures/blockchain_tests/paris/module_paris/paris_one.json"), + Path("fixtures/blockchain_tests_hive/paris/module_paris/paris_one.json"), + Path("fixtures/state_tests/paris/module_paris/paris_one.json"), + Path("fixtures/blockchain_tests/paris/module_paris/paris_two.json"), + Path("fixtures/blockchain_tests_hive/paris/module_paris/paris_two.json"), + Path("fixtures/state_tests/paris/module_paris/paris_two.json"), Path("fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_one.json"), Path("fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_one.json"), Path("fixtures/state_tests/shanghai/module_shanghai/shanghai_one.json"), @@ -97,12 +96,12 @@ def test_shanghai_two(state_test, x): pytest.param( ["--flat-output"], [ - Path("fixtures/blockchain_tests/merge_one.json"), - Path("fixtures/blockchain_tests_hive/merge_one.json"), - Path("fixtures/state_tests/merge_one.json"), - Path("fixtures/blockchain_tests/merge_two.json"), - Path("fixtures/blockchain_tests_hive/merge_two.json"), - Path("fixtures/state_tests/merge_two.json"), + Path("fixtures/blockchain_tests/paris_one.json"), + Path("fixtures/blockchain_tests_hive/paris_one.json"), + Path("fixtures/state_tests/paris_one.json"), + Path("fixtures/blockchain_tests/paris_two.json"), + Path("fixtures/blockchain_tests_hive/paris_two.json"), + Path("fixtures/state_tests/paris_two.json"), Path("fixtures/blockchain_tests/shanghai_one.json"), Path("fixtures/blockchain_tests_hive/shanghai_one.json"), Path("fixtures/state_tests/shanghai_one.json"), @@ -116,12 +115,12 @@ def test_shanghai_two(state_test, x): pytest.param( ["--flat-output", "--output", "other_fixtures"], [ - Path("other_fixtures/blockchain_tests/merge_one.json"), - Path("other_fixtures/blockchain_tests_hive/merge_one.json"), - Path("other_fixtures/state_tests/merge_one.json"), - Path("other_fixtures/blockchain_tests/merge_two.json"), - Path("other_fixtures/blockchain_tests_hive/merge_two.json"), - Path("other_fixtures/state_tests/merge_two.json"), + Path("other_fixtures/blockchain_tests/paris_one.json"), + Path("other_fixtures/blockchain_tests_hive/paris_one.json"), + Path("other_fixtures/state_tests/paris_one.json"), + Path("other_fixtures/blockchain_tests/paris_two.json"), + Path("other_fixtures/blockchain_tests_hive/paris_two.json"), + Path("other_fixtures/state_tests/paris_two.json"), Path("other_fixtures/blockchain_tests/shanghai_one.json"), Path("other_fixtures/blockchain_tests_hive/shanghai_one.json"), Path("other_fixtures/state_tests/shanghai_one.json"), @@ -136,49 +135,49 @@ def test_shanghai_two(state_test, x): ["--single-fixture-per-file"], [ Path( - "fixtures/blockchain_tests/merge/module_merge/merge_one__fork_Merge_blockchain_test.json" + "fixtures/blockchain_tests/paris/module_paris/paris_one__fork_Paris_blockchain_test.json" ), Path( - "fixtures/state_tests/merge/module_merge/merge_one__fork_Merge_state_test.json" + "fixtures/state_tests/paris/module_paris/paris_one__fork_Paris_state_test.json" ), Path( - "fixtures/blockchain_tests_hive/merge/module_merge/merge_one__fork_Merge_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/paris/module_paris/paris_one__fork_Paris_blockchain_test_hive.json" ), Path( - "fixtures/blockchain_tests/merge/module_merge/merge_one__fork_Shanghai_blockchain_test.json" + "fixtures/blockchain_tests/paris/module_paris/paris_one__fork_Shanghai_blockchain_test.json" ), Path( - "fixtures/state_tests/merge/module_merge/merge_one__fork_Shanghai_state_test.json" + "fixtures/state_tests/paris/module_paris/paris_one__fork_Shanghai_state_test.json" ), Path( - "fixtures/blockchain_tests_hive/merge/module_merge/merge_one__fork_Shanghai_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/paris/module_paris/paris_one__fork_Shanghai_blockchain_test_hive.json" ), Path( - "fixtures/blockchain_tests/merge/module_merge/merge_two__fork_Merge_blockchain_test.json" + "fixtures/blockchain_tests/paris/module_paris/paris_two__fork_Paris_blockchain_test.json" ), Path( - "fixtures/state_tests/merge/module_merge/merge_two__fork_Merge_state_test.json" + "fixtures/state_tests/paris/module_paris/paris_two__fork_Paris_state_test.json" ), Path( - "fixtures/blockchain_tests_hive/merge/module_merge/merge_two__fork_Merge_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/paris/module_paris/paris_two__fork_Paris_blockchain_test_hive.json" ), Path( - "fixtures/blockchain_tests/merge/module_merge/merge_two__fork_Shanghai_blockchain_test.json" + "fixtures/blockchain_tests/paris/module_paris/paris_two__fork_Shanghai_blockchain_test.json" ), Path( - "fixtures/state_tests/merge/module_merge/merge_two__fork_Shanghai_state_test.json" + "fixtures/state_tests/paris/module_paris/paris_two__fork_Shanghai_state_test.json" ), Path( - "fixtures/blockchain_tests_hive/merge/module_merge/merge_two__fork_Shanghai_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/paris/module_paris/paris_two__fork_Shanghai_blockchain_test_hive.json" ), Path( - "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_one__fork_Merge_blockchain_test.json" + "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_one__fork_Paris_blockchain_test.json" ), Path( - "fixtures/state_tests/shanghai/module_shanghai/shanghai_one__fork_Merge_state_test.json" + "fixtures/state_tests/shanghai/module_shanghai/shanghai_one__fork_Paris_state_test.json" ), Path( - "fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_one__fork_Merge_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_one__fork_Paris_blockchain_test_hive.json" ), Path( "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_one__fork_Shanghai_blockchain_test.json" @@ -190,31 +189,31 @@ def test_shanghai_two(state_test, x): "fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_one__fork_Shanghai_blockchain_test_hive.json" ), Path( - "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_x_1.json" + "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_x_1.json" ), Path( - "fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_state_test_x_1.json" + "fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_state_test_x_1.json" ), Path( - "fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_hive_x_1.json" + "fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_hive_x_1.json" ), Path( - "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_x_2.json" + "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_x_2.json" ), Path( - "fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_state_test_x_2.json" + "fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_state_test_x_2.json" ), Path( - "fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_hive_x_2.json" + "fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_hive_x_2.json" ), Path( - "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_x_3.json" + "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_x_3.json" ), Path( - "fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_state_test_x_3.json" + "fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_state_test_x_3.json" ), Path( - "fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_hive_x_3.json" + "fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_hive_x_3.json" ), Path( "fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Shanghai_blockchain_test_x_1.json" @@ -251,49 +250,49 @@ def test_shanghai_two(state_test, x): ["--single-fixture-per-file", "--output", "other_fixtures"], [ Path( - "other_fixtures/blockchain_tests/merge/module_merge/merge_one__fork_Merge_blockchain_test.json" + "other_fixtures/blockchain_tests/paris/module_paris/paris_one__fork_Paris_blockchain_test.json" ), Path( - "other_fixtures/state_tests/merge/module_merge/merge_one__fork_Merge_state_test.json" + "other_fixtures/state_tests/paris/module_paris/paris_one__fork_Paris_state_test.json" ), Path( - "other_fixtures/blockchain_tests_hive/merge/module_merge/merge_one__fork_Merge_blockchain_test_hive.json" + "other_fixtures/blockchain_tests_hive/paris/module_paris/paris_one__fork_Paris_blockchain_test_hive.json" ), Path( - "other_fixtures/blockchain_tests/merge/module_merge/merge_one__fork_Shanghai_blockchain_test.json" + "other_fixtures/blockchain_tests/paris/module_paris/paris_one__fork_Shanghai_blockchain_test.json" ), Path( - "other_fixtures/state_tests/merge/module_merge/merge_one__fork_Shanghai_state_test.json" + "other_fixtures/state_tests/paris/module_paris/paris_one__fork_Shanghai_state_test.json" ), Path( - "other_fixtures/blockchain_tests_hive/merge/module_merge/merge_one__fork_Shanghai_blockchain_test_hive.json" + "other_fixtures/blockchain_tests_hive/paris/module_paris/paris_one__fork_Shanghai_blockchain_test_hive.json" ), Path( - "other_fixtures/blockchain_tests/merge/module_merge/merge_two__fork_Merge_blockchain_test.json" + "other_fixtures/blockchain_tests/paris/module_paris/paris_two__fork_Paris_blockchain_test.json" ), Path( - "other_fixtures/state_tests/merge/module_merge/merge_two__fork_Merge_state_test.json" + "other_fixtures/state_tests/paris/module_paris/paris_two__fork_Paris_state_test.json" ), Path( - "other_fixtures/blockchain_tests_hive/merge/module_merge/merge_two__fork_Merge_blockchain_test_hive.json" + "other_fixtures/blockchain_tests_hive/paris/module_paris/paris_two__fork_Paris_blockchain_test_hive.json" ), Path( - "other_fixtures/blockchain_tests/merge/module_merge/merge_two__fork_Shanghai_blockchain_test.json" + "other_fixtures/blockchain_tests/paris/module_paris/paris_two__fork_Shanghai_blockchain_test.json" ), Path( - "other_fixtures/state_tests/merge/module_merge/merge_two__fork_Shanghai_state_test.json" + "other_fixtures/state_tests/paris/module_paris/paris_two__fork_Shanghai_state_test.json" ), Path( - "other_fixtures/blockchain_tests_hive/merge/module_merge/merge_two__fork_Shanghai_blockchain_test_hive.json" + "other_fixtures/blockchain_tests_hive/paris/module_paris/paris_two__fork_Shanghai_blockchain_test_hive.json" ), Path( - "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_one__fork_Merge_blockchain_test.json" + "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_one__fork_Paris_blockchain_test.json" ), Path( - "other_fixtures/state_tests/shanghai/module_shanghai/shanghai_one__fork_Merge_state_test.json" + "other_fixtures/state_tests/shanghai/module_shanghai/shanghai_one__fork_Paris_state_test.json" ), Path( - "other_fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_one__fork_Merge_blockchain_test_hive.json" + "other_fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_one__fork_Paris_blockchain_test_hive.json" ), Path( "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_one__fork_Shanghai_blockchain_test.json" @@ -305,31 +304,31 @@ def test_shanghai_two(state_test, x): "other_fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_one__fork_Shanghai_blockchain_test_hive.json" ), Path( - "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_x_1.json" + "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_x_1.json" ), Path( - "other_fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_state_test_x_1.json" + "other_fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_state_test_x_1.json" ), Path( - "other_fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_hive_x_1.json" + "other_fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_hive_x_1.json" ), Path( - "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_x_2.json" + "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_x_2.json" ), Path( - "other_fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_state_test_x_2.json" + "other_fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_state_test_x_2.json" ), Path( - "other_fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_hive_x_2.json" + "other_fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_hive_x_2.json" ), Path( - "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_x_3.json" + "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_x_3.json" ), Path( - "other_fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Merge_state_test_x_3.json" + "other_fixtures/state_tests/shanghai/module_shanghai/shanghai_two__fork_Paris_state_test_x_3.json" ), Path( - "other_fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Merge_blockchain_test_hive_x_3.json" + "other_fixtures/blockchain_tests_hive/shanghai/module_shanghai/shanghai_two__fork_Paris_blockchain_test_hive_x_3.json" ), Path( "other_fixtures/blockchain_tests/shanghai/module_shanghai/shanghai_two__fork_Shanghai_blockchain_test_x_1.json" @@ -365,30 +364,30 @@ def test_shanghai_two(state_test, x): pytest.param( ["--flat-output", "--single-fixture-per-file"], [ - Path("fixtures/blockchain_tests/merge_one__fork_Merge_blockchain_test.json"), - Path("fixtures/state_tests/merge_one__fork_Merge_state_test.json"), + Path("fixtures/blockchain_tests/paris_one__fork_Paris_blockchain_test.json"), + Path("fixtures/state_tests/paris_one__fork_Paris_state_test.json"), Path( - "fixtures/blockchain_tests_hive/merge_one__fork_Merge_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/paris_one__fork_Paris_blockchain_test_hive.json" ), - Path("fixtures/blockchain_tests/merge_one__fork_Shanghai_blockchain_test.json"), - Path("fixtures/state_tests/merge_one__fork_Shanghai_state_test.json"), + Path("fixtures/blockchain_tests/paris_one__fork_Shanghai_blockchain_test.json"), + Path("fixtures/state_tests/paris_one__fork_Shanghai_state_test.json"), Path( - "fixtures/blockchain_tests_hive/merge_one__fork_Shanghai_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/paris_one__fork_Shanghai_blockchain_test_hive.json" ), - Path("fixtures/blockchain_tests/merge_two__fork_Merge_blockchain_test.json"), - Path("fixtures/state_tests/merge_two__fork_Merge_state_test.json"), + Path("fixtures/blockchain_tests/paris_two__fork_Paris_blockchain_test.json"), + Path("fixtures/state_tests/paris_two__fork_Paris_state_test.json"), Path( - "fixtures/blockchain_tests_hive/merge_two__fork_Merge_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/paris_two__fork_Paris_blockchain_test_hive.json" ), - Path("fixtures/blockchain_tests/merge_two__fork_Shanghai_blockchain_test.json"), - Path("fixtures/state_tests/merge_two__fork_Shanghai_state_test.json"), + Path("fixtures/blockchain_tests/paris_two__fork_Shanghai_blockchain_test.json"), + Path("fixtures/state_tests/paris_two__fork_Shanghai_state_test.json"), Path( - "fixtures/blockchain_tests_hive/merge_two__fork_Shanghai_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/paris_two__fork_Shanghai_blockchain_test_hive.json" ), - Path("fixtures/blockchain_tests/shanghai_one__fork_Merge_blockchain_test.json"), - Path("fixtures/state_tests/shanghai_one__fork_Merge_state_test.json"), + Path("fixtures/blockchain_tests/shanghai_one__fork_Paris_blockchain_test.json"), + Path("fixtures/state_tests/shanghai_one__fork_Paris_state_test.json"), Path( - "fixtures/blockchain_tests_hive/shanghai_one__fork_Merge_blockchain_test_hive.json" + "fixtures/blockchain_tests_hive/shanghai_one__fork_Paris_blockchain_test_hive.json" ), Path("fixtures/blockchain_tests/shanghai_one__fork_Shanghai_blockchain_test.json"), Path("fixtures/state_tests/shanghai_one__fork_Shanghai_state_test.json"), @@ -396,25 +395,25 @@ def test_shanghai_two(state_test, x): "fixtures/blockchain_tests_hive/shanghai_one__fork_Shanghai_blockchain_test_hive.json" ), Path( - "fixtures/blockchain_tests/shanghai_two__fork_Merge_blockchain_test_x_1.json" + "fixtures/blockchain_tests/shanghai_two__fork_Paris_blockchain_test_x_1.json" ), - Path("fixtures/state_tests/shanghai_two__fork_Merge_state_test_x_1.json"), + Path("fixtures/state_tests/shanghai_two__fork_Paris_state_test_x_1.json"), Path( - "fixtures/blockchain_tests_hive/shanghai_two__fork_Merge_blockchain_test_hive_x_1.json" + "fixtures/blockchain_tests_hive/shanghai_two__fork_Paris_blockchain_test_hive_x_1.json" ), Path( - "fixtures/blockchain_tests/shanghai_two__fork_Merge_blockchain_test_x_2.json" + "fixtures/blockchain_tests/shanghai_two__fork_Paris_blockchain_test_x_2.json" ), - Path("fixtures/state_tests/shanghai_two__fork_Merge_state_test_x_2.json"), + Path("fixtures/state_tests/shanghai_two__fork_Paris_state_test_x_2.json"), Path( - "fixtures/blockchain_tests_hive/shanghai_two__fork_Merge_blockchain_test_hive_x_2.json" + "fixtures/blockchain_tests_hive/shanghai_two__fork_Paris_blockchain_test_hive_x_2.json" ), Path( - "fixtures/blockchain_tests/shanghai_two__fork_Merge_blockchain_test_x_3.json" + "fixtures/blockchain_tests/shanghai_two__fork_Paris_blockchain_test_x_3.json" ), - Path("fixtures/state_tests/shanghai_two__fork_Merge_state_test_x_3.json"), + Path("fixtures/state_tests/shanghai_two__fork_Paris_state_test_x_3.json"), Path( - "fixtures/blockchain_tests_hive/shanghai_two__fork_Merge_blockchain_test_hive_x_3.json" + "fixtures/blockchain_tests_hive/shanghai_two__fork_Paris_blockchain_test_hive_x_3.json" ), Path( "fixtures/blockchain_tests/shanghai_two__fork_Shanghai_blockchain_test_x_1.json" @@ -453,24 +452,24 @@ def test_fixture_output_based_on_command_line_args( - each fixture file contains the expected number of fixtures. The modules above generate the following test cases: - tests/merge/test_module_merge.py::test_merge_one[fork_Merge] PASSED - tests/merge/test_module_merge.py::test_merge_one[fork_Shanghai] PASSED - tests/merge/test_module_merge.py::test_merge_two[fork_Merge] PASSED - tests/merge/test_module_merge.py::test_merge_two[fork_Shanghai] PASSED - tests/shanghai/test_module_shanghai.py::test_shanghai_one[fork_Merge] PASSED + tests/paris/test_module_paris.py::test_paris_one[fork_Paris] PASSED + tests/paris/test_module_paris.py::test_paris_one[fork_Shanghai] PASSED + tests/paris/test_module_paris.py::test_paris_two[fork_Paris] PASSED + tests/paris/test_module_paris.py::test_paris_two[fork_Shanghai] PASSED + tests/shanghai/test_module_shanghai.py::test_shanghai_one[fork_Paris] PASSED tests/shanghai/test_module_shanghai.py::test_shanghai_one[fork_Shanghai] PASSED - tests/shanghai/test_module_shanghai.py::test_shanghai_two[fork_Merge-x=1] PASSED - tests/shanghai/test_module_shanghai.py::test_shanghai_two[fork_Merge-x=2] PASSED - tests/shanghai/test_module_shanghai.py::test_shanghai_two[fork_Merge-x=3] PASSED + tests/shanghai/test_module_shanghai.py::test_shanghai_two[fork_Paris-x=1] PASSED + tests/shanghai/test_module_shanghai.py::test_shanghai_two[fork_Paris-x=2] PASSED + tests/shanghai/test_module_shanghai.py::test_shanghai_two[fork_Paris-x=3] PASSED tests/shanghai/test_module_shanghai.py::test_shanghai_two[fork_Shanghai-x=1] PASSED tests/shanghai/test_module_shanghai.py::test_shanghai_two[fork_Shanghai-x=2] PASSED tests/shanghai/test_module_shanghai.py::test_shanghai_two[fork_Shanghai-x=3] PASSED """ tests_dir = testdir.mkdir("tests") - merge_tests_dir = tests_dir.mkdir("merge") - test_module = merge_tests_dir.join("test_module_merge.py") - test_module.write(test_module_merge) + paris_tests_dir = tests_dir.mkdir("paris") + test_module = paris_tests_dir.join("test_module_paris.py") + test_module.write(test_module_paris) shanghai_tests_dir = tests_dir.mkdir("shanghai") test_module = shanghai_tests_dir.join("test_module_shanghai.py") diff --git a/tests/cancun/eip6780_selfdestruct/test_reentrancy_selfdestruct_revert.py b/tests/cancun/eip6780_selfdestruct/test_reentrancy_selfdestruct_revert.py index 891ab6ffd9..8b6fe75b1d 100644 --- a/tests/cancun/eip6780_selfdestruct/test_reentrancy_selfdestruct_revert.py +++ b/tests/cancun/eip6780_selfdestruct/test_reentrancy_selfdestruct_revert.py @@ -32,7 +32,7 @@ def env(): # noqa: D103 ) -@pytest.mark.valid_from("Merge") +@pytest.mark.valid_from("Paris") @pytest.mark.parametrize("first_suicide", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL]) @pytest.mark.parametrize("second_suicide", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL]) def test_reentrancy_selfdestruct_revert( diff --git a/tests/merge/__init__.py b/tests/merge/__init__.py deleted file mode 100644 index 57393da90f..0000000000 --- a/tests/merge/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Test cases for EVM functionality introduced in the Merge. -""" diff --git a/tests/paris/__init__.py b/tests/paris/__init__.py new file mode 100644 index 0000000000..2fd68e2b89 --- /dev/null +++ b/tests/paris/__init__.py @@ -0,0 +1,3 @@ +""" +Test cases for EVM functionality introduced in Paris (Merge). +""" diff --git a/tests/merge/security/__init__.py b/tests/paris/security/__init__.py similarity index 100% rename from tests/merge/security/__init__.py rename to tests/paris/security/__init__.py diff --git a/tests/merge/security/test_selfdestruct_balance_bug.py b/tests/paris/security/test_selfdestruct_balance_bug.py similarity index 98% rename from tests/merge/security/test_selfdestruct_balance_bug.py rename to tests/paris/security/test_selfdestruct_balance_bug.py index 349c55d62a..fbeccd9f94 100644 --- a/tests/merge/security/test_selfdestruct_balance_bug.py +++ b/tests/paris/security/test_selfdestruct_balance_bug.py @@ -26,7 +26,7 @@ from ethereum_test_tools.vm.opcode import Opcodes as Op -@pytest.mark.compile_yul_with("Merge") # Shanghai refuses to compile SELFDESTRUCT +@pytest.mark.compile_yul_with("Paris") # Shanghai refuses to compile SELFDESTRUCT @pytest.mark.valid_from("Constantinople") def test_tx_selfdestruct_balance_bug(blockchain_test: BlockchainTestFiller, yul: YulCompiler): """ diff --git a/tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py b/tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py index 516b1fec56..f3812f29ce 100644 --- a/tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py +++ b/tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py @@ -211,7 +211,7 @@ def test_warm_coinbase_call_out_of_gas( ] -@pytest.mark.valid_from("Merge") # these tests fill for fork >= Berlin +@pytest.mark.valid_from("Paris") # these tests fill for fork >= Berlin @pytest.mark.parametrize( "opcode,code_gas_measure", gas_measured_opcodes,