Skip to content

Commit 3537b50

Browse files
committed
refactor(all): rename 'engine reorg' to 'engine x'
1 parent bb814ac commit 3537b50

File tree

9 files changed

+47
-51
lines changed

9 files changed

+47
-51
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Users can select any of the artifacts depending on their testing needs for their
3131

3232
- ✨ Add the `ported_from` test marker to track Python test cases that were converted from static fillers in [ethereum/tests](https://github.com/ethereum/tests) repository [#1590](https://github.com/ethereum/execution-spec-tests/pull/1590).
3333
- ✨ Add a new pytest plugin, `ported_tests`, that lists the static fillers and PRs from `ported_from` markers for use in the coverage Github Workflow [#1634](https://github.com/ethereum/execution-spec-tests/pull/1634).
34-
- ✨ Enable two-phase filling of fixtures with shared pre-allocation groups and add a `BlockchainEngineReorgFixture` format [#1606](https://github.com/ethereum/execution-spec-tests/pull/1706).
34+
- ✨ Enable two-phase filling of fixtures with shared pre-allocation groups and add a `BlockchainEngineXFixture` format [#1606](https://github.com/ethereum/execution-spec-tests/pull/1706).
3535
- 🔀 Refactor: Encapsulate `fill`'s fixture output options (`--output`, `--flat-output`, `--single-fixture-per-file`) into a `FixtureOutput` class ([#1471](https://github.com/ethereum/execution-spec-tests/pull/1471),[#1612](https://github.com/ethereum/execution-spec-tests/pull/1612)).
3636
- ✨ Don't warn about a "high Transaction gas_limit" for `zkevm` tests ([#1598](https://github.com/ethereum/execution-spec-tests/pull/1598)).
3737
- 🐞 `fill` no longer writes generated fixtures into an existing, non-empty output directory; it must now be empty or `--clean` must be used to delete it first ([#1608](https://github.com/ethereum/execution-spec-tests/pull/1608)).

docs/running_tests/test_formats/blockchain_test_engine_x.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# Blockchain Engine Reorg Tests <!-- markdownlint-disable MD051 (MD051=link-fragments "Link fragments should be valid") -->
1+
# Blockchain Engine X Tests <!-- markdownlint-disable MD051 (MD051=link-fragments "Link fragments should be valid") -->
22

3-
The Blockchain Engine Reorg Test fixture format tests are included in the fixtures subdirectory `blockchain_tests_engine_reorg`, and use Engine API directives with optimized shared pre-allocation for improved execution performance.
3+
The Blockchain Engine X Test fixture format tests are included in the fixtures subdirectory `blockchain_tests_engine_x`, and use Engine API directives with optimized shared pre-allocation for improved execution performance.
44

55
These are produced by the `StateTest` and `BlockchainTest` test specs when using the `--generate-shared-pre` and `--use-shared-pre` flags.
66

77
## Description
88

9-
The Blockchain Engine Reorg Test fixture format is an optimized variant of the [Blockchain Engine Test](./blockchain_test_engine.md) format designed for large-scale test execution with performance optimizations.
9+
The Blockchain Engine X Test fixture format is an optimized variant of the [Blockchain Engine Test](./blockchain_test_engine.md) format designed for large-scale test execution with performance optimizations.
1010

11-
It uses the Engine API to test block validation and consensus rules while leveraging **shared pre-allocation state** to significantly reduce test execution time and resource usage. Tests are grouped by their initial state (fork + environment + pre-allocation) and share common genesis states through blockchain reorganization.
11+
It uses the Engine API to test block validation and consensus rules while leveraging **shared pre-allocation state** to significantly reduce test execution time and resource usage. Tests are grouped by their initial state (fork + environment + pre-allocation). Each groups are executed against the same client instance using a common genesis state.
1212

1313
The key optimization is that **clients need only be started once per group** instead of once per test (as in the original engine fixture format), dramatically improving execution performance for large test suites.
1414

1515
Instead of including large pre-allocation state in each test fixture, this format references a shared pre-allocation folder (`pre_alloc`) which includes all different pre-allocation combinations used for any test fixture group.
1616

17-
A single JSON fixture file is composed of a JSON object where each key-value pair is a different [`ReorgFixture`](#reorgfixture) test object, with the key string representing the test name.
17+
A single JSON fixture file is composed of a JSON object where each key-value pair is a different [`BlockchainTestEngineXFixture`](#BlockchainTestEngineXFixture) test object, with the key string representing the test name.
1818

1919
The JSON file path plus the test name are used as the unique test identifier.
2020

2121
## Shared Pre-Allocation File
2222

23-
The `blockchain_tests_engine_reorg` directory contains a special directory `pre_alloc` that stores shared pre-allocation state file used by all tests in this format, one per pre-allocation group with the name of the pre-alloc hash. This folder is essential for test execution and must be present alongside the test fixtures.
23+
The `blockchain_tests_engine_x` directory contains a special directory `pre_alloc` that stores shared pre-allocation state file used by all tests in this format, one per pre-allocation group with the name of the pre-alloc hash. This folder is essential for test execution and must be present alongside the test fixtures.
2424

2525
### Pre-Allocation File Structure
2626

@@ -48,7 +48,7 @@ Each file in the `pre_alloc` folder corresponds to a pre-allocation hash to shar
4848

4949
## Consumption
5050

51-
For each [`ReorgFixture`](#reorgfixture) test object in the JSON fixture file, perform the following steps:
51+
For each [`BlockchainTestEngineXFixture`](#BlockchainTestEngineXFixture) test object in the JSON fixture file, perform the following steps:
5252

5353
1. **Load Shared Pre-Allocation**:
5454
- Read the appropriate file from the `pre_alloc` folder in the same directory
@@ -76,7 +76,7 @@ For each [`ReorgFixture`](#reorgfixture) test object in the JSON fixture file, p
7676

7777
## Structures
7878

79-
### `ReorgFixture`
79+
### `BlockchainTestEngineXFixture`
8080

8181
#### - `network`: [`Fork`](./common_types.md#fork)
8282

@@ -100,7 +100,7 @@ List of `engine_newPayloadVX` directives to be processed after the genesis block
100100

101101
#### - `syncPayload`: [`Optional`](./common_types.md#optional)`[`[`FixtureEngineNewPayload`](#fixtureenginenewpayload)`]`
102102

103-
Optional synchronization payload used for blockchain reorganization scenarios. When present, this payload is typically used to sync the chain to a specific state before or after the main payload sequence.
103+
Optional synchronization payload. When present, this payload is typically used to sync the chain to a specific state before or after the main payload sequence.
104104

105105
#### - `lastblockhash`: [`Hash`](./common_types.md#hash)
106106

@@ -120,7 +120,7 @@ To reconstruct the final state:
120120

121121
#### - `config`: [`FixtureConfig`](#fixtureconfig)
122122

123-
Chain configuration object to be applied to the client running the blockchain engine reorg test.
123+
Chain configuration object to be applied to the client running the blockchain engine x test.
124124

125125
### `FixtureConfig`
126126

@@ -142,4 +142,3 @@ Engine API payload structure identical to the one defined in [Blockchain Engine
142142
- The `pre_alloc` folder is essential and must be distributed with the test fixtures
143143
- Tests are grouped by identical (fork + environment + pre-allocation) combinations
144144
- The format is optimized for Engine API testing (post-Paris forks)
145-
- Reorganization scenarios are supported through the `forkChoiceUpdate` mechanism

src/cli/show_pre_alloc_group_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def display_stats(stats: Dict, console: Console, verbose: int = 0):
452452
@click.argument(
453453
"pre_alloc_folder",
454454
type=click.Path(exists=True, path_type=Path),
455-
default="fixtures/blockchain_tests_engine_reorg/pre_alloc",
455+
default="fixtures/blockchain_tests_engine_x/pre_alloc",
456456
)
457457
@click.option(
458458
"--verbose",

src/ethereum_test_fixtures/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .blockchain import (
55
BlockchainEngineFixture,
66
BlockchainEngineFixtureCommon,
7-
BlockchainEngineReorgFixture,
7+
BlockchainEngineXFixture,
88
BlockchainFixture,
99
BlockchainFixtureCommon,
1010
)
@@ -19,7 +19,7 @@
1919
"BaseFixture",
2020
"BlockchainEngineFixture",
2121
"BlockchainEngineFixtureCommon",
22-
"BlockchainEngineReorgFixture",
22+
"BlockchainEngineXFixture",
2323
"BlockchainFixture",
2424
"BlockchainFixtureCommon",
2525
"EOFFixture",

src/ethereum_test_fixtures/blockchain.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def validate_post_state_fields(self):
6464
if mode == "after":
6565
# Determine which fields to check
6666
if alternate_field:
67-
# For reorg fixtures: check post_state vs post_state_diff
67+
# For engine x fixtures: check post_state vs post_state_diff
6868
field1_name, field2_name = "post_state", alternate_field
6969
else:
7070
# For standard fixtures: check post_state vs post_state_hash
@@ -560,19 +560,16 @@ class BlockchainEngineFixture(BlockchainEngineFixtureCommon):
560560

561561

562562
@post_state_validator(alternate_field="post_state_diff")
563-
class BlockchainEngineReorgFixture(BlockchainEngineFixtureCommon):
563+
class BlockchainEngineXFixture(BlockchainEngineFixtureCommon):
564564
"""
565-
Engine reorg specific test fixture information.
565+
Engine X specific test fixture information.
566566
567-
Uses shared pre-allocations and blockchain reorganization for efficient
567+
Uses shared pre-allocations (and a shared client instance) for efficient
568568
test execution without client restarts.
569569
"""
570570

571-
format_name: ClassVar[str] = "blockchain_test_engine_reorg"
572-
description: ClassVar[str] = (
573-
"Tests that generate a blockchain test fixture for use with a shared pre-state and engine "
574-
"reorg execution."
575-
)
571+
format_name: ClassVar[str] = "blockchain_test_engine_x"
572+
description: ClassVar[str] = "Tests that generate a Blockchain Test Engine X fixture."
576573

577574
pre_hash: str
578575
"""Hash of the shared pre-allocation group this test belongs to."""

src/ethereum_test_specs/blockchain.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from ethereum_test_fixtures import (
2929
BaseFixture,
3030
BlockchainEngineFixture,
31-
BlockchainEngineReorgFixture,
31+
BlockchainEngineXFixture,
3232
BlockchainFixture,
3333
FixtureFormat,
3434
LabeledFixtureFormat,
@@ -308,7 +308,7 @@ class BlockchainTest(BaseTest):
308308
supported_fixture_formats: ClassVar[Sequence[FixtureFormat | LabeledFixtureFormat]] = [
309309
BlockchainFixture,
310310
BlockchainEngineFixture,
311-
BlockchainEngineReorgFixture,
311+
BlockchainEngineXFixture,
312312
]
313313
supported_execute_formats: ClassVar[Sequence[LabeledExecuteFormat]] = [
314314
LabeledExecuteFormat(
@@ -630,7 +630,7 @@ def make_hive_fixture(
630630
t8n: TransitionTool,
631631
fork: Fork,
632632
fixture_format: FixtureFormat = BlockchainEngineFixture,
633-
) -> BlockchainEngineFixture | BlockchainEngineReorgFixture:
633+
) -> BlockchainEngineFixture | BlockchainEngineXFixture:
634634
"""Create a hive fixture from the blocktest definition."""
635635
fixture_payloads: List[FixtureEngineNewPayload] = []
636636

@@ -722,8 +722,8 @@ def make_hive_fixture(
722722
}
723723

724724
# Add format-specific fields
725-
if fixture_format == BlockchainEngineReorgFixture:
726-
# For reorg format, exclude pre (will be provided via shared state)
725+
if fixture_format == BlockchainEngineXFixture:
726+
# For Engine X format, exclude pre (will be provided via shared state)
727727
# and prepare for state diff optimization
728728
fixture_data.update(
729729
{
@@ -733,7 +733,7 @@ def make_hive_fixture(
733733
"pre_hash": "", # Will be set by BaseTestWrapper
734734
}
735735
)
736-
return BlockchainEngineReorgFixture(**fixture_data)
736+
return BlockchainEngineXFixture(**fixture_data)
737737
else:
738738
# Standard engine fixture
739739
fixture_data.update(
@@ -760,7 +760,7 @@ def generate(
760760
t8n.reset_traces()
761761
if fixture_format == BlockchainEngineFixture:
762762
return self.make_hive_fixture(t8n, fork, fixture_format)
763-
elif fixture_format == BlockchainEngineReorgFixture:
763+
elif fixture_format == BlockchainEngineXFixture:
764764
return self.make_hive_fixture(t8n, fork, fixture_format)
765765
elif fixture_format == BlockchainFixture:
766766
return self.make_fixture(t8n, fork)

src/pytest_plugins/filler/filler.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from ethereum_test_base_types import Account, Address, Alloc, ReferenceSpec
2727
from ethereum_test_fixtures import (
2828
BaseFixture,
29-
BlockchainEngineReorgFixture,
29+
BlockchainEngineXFixture,
3030
FixtureCollector,
3131
FixtureConsumer,
3232
LabeledFixtureFormat,
@@ -55,7 +55,7 @@ def calculate_post_state_diff(post_state: Alloc, genesis_state: Alloc) -> Alloc:
5555
"""
5656
Calculate the state difference between post_state and genesis_state.
5757
58-
This function enables significant space savings in reorg fixtures by storing
58+
This function enables significant space savings in Engine X fixtures by storing
5959
only the accounts that changed during test execution, rather than the full
6060
post-state which may contain thousands of unchanged shared accounts.
6161
@@ -878,17 +878,17 @@ def __init__(self, *args, **kwargs):
878878
self._request = request
879879

880880
# Phase 1: Generate shared pre-state
881-
if fixture_format is BlockchainEngineReorgFixture and request.config.getoption(
881+
if fixture_format is BlockchainEngineXFixture and request.config.getoption(
882882
"generate_shared_pre"
883883
):
884884
self.update_shared_pre_state(
885885
request.config.shared_pre_state, fork, request.node.nodeid
886886
)
887887
return # Skip fixture generation in phase 1
888888

889-
# Phase 2: Use shared pre-state (only for BlockchainEngineReorgFixture)
889+
# Phase 2: Use shared pre-state (only for BlockchainEngineXFixture)
890890
pre_alloc_hash = None
891-
if fixture_format is BlockchainEngineReorgFixture and request.config.getoption(
891+
if fixture_format is BlockchainEngineXFixture and request.config.getoption(
892892
"use_shared_pre"
893893
):
894894
pre_alloc_hash = self.compute_shared_pre_alloc_hash(fork=fork)
@@ -911,9 +911,9 @@ def __init__(self, *args, **kwargs):
911911
fixture_format=fixture_format,
912912
)
913913

914-
# Post-process for reorg format (add pre_hash and state diff)
914+
# Post-process for Engine X format (add pre_hash and state diff)
915915
if (
916-
fixture_format is BlockchainEngineReorgFixture
916+
fixture_format is BlockchainEngineXFixture
917917
and request.config.getoption("use_shared_pre")
918918
and pre_alloc_hash is not None
919919
):
@@ -968,28 +968,28 @@ def pytest_generate_tests(metafunc: pytest.Metafunc):
968968
use_shared_pre = metafunc.config.getoption("use_shared_pre", False)
969969

970970
if generate_shared_pre or use_shared_pre:
971-
# When shared alloc flags are set, only generate BlockchainEngineReorgFixture
971+
# When shared alloc flags are set, only generate BlockchainEngineXFixture
972972
supported_formats = [
973973
format_item
974974
for format_item in test_type.supported_fixture_formats
975975
if (
976-
format_item is BlockchainEngineReorgFixture
976+
format_item is BlockchainEngineXFixture
977977
or (
978978
isinstance(format_item, LabeledFixtureFormat)
979-
and format_item.format is BlockchainEngineReorgFixture
979+
and format_item.format is BlockchainEngineXFixture
980980
)
981981
)
982982
]
983983
else:
984-
# Filter out BlockchainEngineReorgFixture if shared alloc flags not set
984+
# Filter out BlockchainEngineXFixture if shared alloc flags not set
985985
supported_formats = [
986986
format_item
987987
for format_item in test_type.supported_fixture_formats
988988
if not (
989-
format_item is BlockchainEngineReorgFixture
989+
format_item is BlockchainEngineXFixture
990990
or (
991991
isinstance(format_item, LabeledFixtureFormat)
992-
and format_item.format is BlockchainEngineReorgFixture
992+
and format_item.format is BlockchainEngineXFixture
993993
)
994994
)
995995
]

src/pytest_plugins/filler/fixture_output.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88
from pydantic import BaseModel, Field
99

10-
from ethereum_test_fixtures.blockchain import BlockchainEngineReorgFixture
10+
from ethereum_test_fixtures.blockchain import BlockchainEngineXFixture
1111

1212

1313
class FixtureOutput(BaseModel):
@@ -64,8 +64,8 @@ def is_stdout(self) -> bool:
6464
@property
6565
def shared_pre_alloc_folder_path(self) -> Path:
6666
"""Return the path for shared pre-allocation state file."""
67-
reorg_dir = BlockchainEngineReorgFixture.output_base_dir_name()
68-
return self.directory / reorg_dir / "pre_alloc"
67+
engine_x_dir = BlockchainEngineXFixture.output_base_dir_name()
68+
return self.directory / engine_x_dir / "pre_alloc"
6969

7070
@staticmethod
7171
def strip_tarball_suffix(path: Path) -> Path:

src/pytest_plugins/forks/tests/test_forks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_all_forks({StateTest.pytest_parameter_name()}):
4545
fixture_format_label = fixture_format.format_name.lower()
4646
if (
4747
not fixture_format.supports_fork(fork)
48-
or "blockchain_test_engine_reorg" in fixture_format_label
48+
or "blockchain_test_engine_x" in fixture_format_label
4949
):
5050
expected_passed -= 1
5151
assert f":test_all_forks[fork_{fork}-{fixture_format_label}]" not in stdout
@@ -91,7 +91,7 @@ def test_all_forks({StateTest.pytest_parameter_name()}):
9191
fixture_format_label = fixture_format.format_name.lower()
9292
if (
9393
not fixture_format.supports_fork(fork)
94-
or "blockchain_test_engine_reorg" in fixture_format_label
94+
or "blockchain_test_engine_x" in fixture_format_label
9595
):
9696
expected_passed -= 1
9797
assert f":test_all_forks[fork_{fork}-{fixture_format_label}]" not in stdout
@@ -137,7 +137,7 @@ def test_all_forks({StateTest.pytest_parameter_name()}):
137137
fixture_format_label = fixture_format.format_name.lower()
138138
if (
139139
not fixture_format.supports_fork(fork)
140-
or "blockchain_test_engine_reorg" in fixture_format_label
140+
or "blockchain_test_engine_x" in fixture_format_label
141141
):
142142
expected_passed -= 1
143143
assert f":test_all_forks[fork_{fork}-{fixture_format_label}]" not in stdout
@@ -178,7 +178,7 @@ def test_all_forks({StateTest.pytest_parameter_name()}):
178178
fixture_format = fixture_format.format
179179
else:
180180
fixture_format_label = fixture_format.format_name.lower()
181-
if "blockchain_test_engine_reorg" in fixture_format_label:
181+
if "blockchain_test_engine_x" in fixture_format_label:
182182
expected_passed -= 1
183183
assert f":test_all_forks[fork_{fork}-{fixture_format_label}]" not in stdout
184184
continue

0 commit comments

Comments
 (0)