Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,66 @@ jobs:
EOF
uvx --from actionlint-py actionlint

packaging:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the sibling jobs gate on needs: static; this is the only one that does not. I think it's worth gating here, too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for adding these additional checks, Guru!

Can we plz also add easy local verification of these steps by adding these checks to the Justfile instead? In particular, workflow-yaml-inline scripts make it hard to verify locally.

Every other test job here is a one-liner delegating to a just recipe; this is the only one with inline logic, including ~18 lines of Python in a heredoc that no linter or type checker ever sees. Moving the whole job into a just test-packaging recipe would match the other nine jobs, make the checks runnable locally before pushing (#3236 is exactly the class of bug you want to catch at the desk), and give the embedded Python a lintable home in .github/scripts/, which already has a tested-scripts convention via just test-ci-scripts.

Suggested shape:

# --- Packaging ---

# Build every workspace wheel into .just/dist
[group('packaging')]
build-wheels:
    uv build --wheel --all-packages --out-dir "{{ output_dir }}/dist"

# Smoke-test the built wheels: clean-venv install, real t8n run, spec-wheel-alone import check
[group('packaging')]
test-packaging: build-wheels
    # 1. install both wheels by explicit path into a fresh venv
    # 2. run the Frontier t8n transition, assert result.json
    # 3. install the spec wheel alone, run .github/scripts/import_check.py

The packaging group is forward looking: a future publish-wheels or a version-lockstep check would land in the same group, each independently runnable and clustered together in just --list. Note the doc comment above each recipe must be a single line; just shows only the line immediately above the recipe in the listing.

The job then reduces to checkout, setup-uv, run: just test-packaging (plus needs: static, see the other comment). One tradeoff: the four named steps collapse into one, so per-step timing and failure attribution moves from the UI into the log. The step comments here (why --all-packages, why explicit wheel paths, why a real transition instead of --help) are good and should move into the recipe with the logic.

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/setup-uv
with:
python-version: "3.14"
# Build every workspace member, so a dependency on a sibling package
# resolves against the wheel built here rather than against an index.
- name: Build the workspace wheels
run: uv build --wheel --all-packages --out-dir dist
# Install into a bare venv, deliberately outside the uv workspace.
# Both wheels are passed by explicit path: resolving either through an
# index could silently substitute a published PyPI version for the
# branch's own build.
- name: Install the wheels into a clean environment
run: |
uv venv "$RUNNER_TEMP/wheel-venv"
uv pip install --python "$RUNNER_TEMP/wheel-venv/bin/python" \
dist/ethereum_execution_testing-*.whl \
dist/ethereum_execution-*.whl
# Run a real transition rather than `--help`, which returns inside
# argparse without ever reaching the imports that t8n needs. The output
# basedir is emptied before the run, so keep it out of the source tree.
- name: Smoke-test ethereum-spec-evm t8n
run: |
mkdir -p "$RUNNER_TEMP/t8n-out"
"$RUNNER_TEMP/wheel-venv/bin/ethereum-spec-evm" t8n \
--state.fork=Frontier \
--input.alloc=tests/evm_tools/t8n_build/alloc.json \
--input.env=tests/evm_tools/t8n_build/env.json \
--input.txs=tests/evm_tools/t8n_build/txs.json \
Comment on lines +101 to +103

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that t8n lives in the testing package, I think these new fixtures should be there too?

Suggested home: packages/testing/src/execution_testing/evm_tools/tests/fixtures/t8n_build/. This follows the existing convention in the package (client_clis/tests/fixtures/, specs/tests/fixtures/, tools/tests/test_filling/fixtures/).

These three lines are the only references repo-wide. The exclude = ["*tests*"] rule keeps the files out of the wheel, and this job reads them from the checkout, so only the paths here change.

It would also leave tests/evm_tools/ holding nothing but spec-tools tests, which makes the tests/spec_tools/ rename follow-up a pure git mv.

(One caution: not the top-level execution_testing/fixtures/, which is the fixture-format code subpackage.)

@danceratopz danceratopz Aug 6, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Justification about the move/rename of ./tests/evm_tools/ to ./tests/spec_tools/ here #3307 (comment)

--output.basedir="$RUNNER_TEMP/t8n-out"
test -s "$RUNNER_TEMP/t8n-out/result.json"
Comment thread
spencer-tb marked this conversation as resolved.
# Install the spec wheel on its own: the spec package must never
# import the testing package, or standalone spec installs break
# again (#3236). Every module is imported, rather than a fixed
# list, so additions are covered automatically. The exceptions:
# `docc` plugins only load once the `doc` group installs docc,
# and importing a `__main__` would run it.
- name: Import-check the spec wheel alone

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My friend and I tested this step against the pre-fix wheels: built the forks/amsterdam spec wheel, installed it alone into a clean venv, and ran this exact walk-import script. It passes (exit 0) on the broken code.

The reason: the old execution_testing imports in evm_tools were all function-scoped (t8n/cli.py:214, :266, :314-322), deliberately, to avoid an import cycle. So every module imports cleanly, and #3236 only fired at runtime inside build_t8n_from_cli_options. That is exactly the traceback in the issue. A module-level import walk cannot see this form.

The step is still worth keeping. It catches future module-level leaks (now the likely form, since the cycle that motivated function-scoping is gone) and general wheel breakage.

To ensure the invariant "./src/ never imports execution_testing" does not get broken in the future, we could add an ethereum-spec-lint rule that rejects any such import, top-level or function-scoped. An AST check sees both forms, and it runs locally via just static. That might be a bit heavy though, so a quick alternative is ! grep -rn "execution_testing" src/, which passes as of this branch.

run: |
uv venv "$RUNNER_TEMP/spec-venv"
uv pip install --python "$RUNNER_TEMP/spec-venv/bin/python" \
dist/ethereum_execution-*.whl
"$RUNNER_TEMP/spec-venv/bin/python" - <<'EOF'
import importlib
import pkgutil

import ethereum
import ethereum_spec_tools

SKIP = {"ethereum_spec_tools.docc"}
for pkg in (ethereum, ethereum_spec_tools):
for mod in pkgutil.walk_packages(pkg.__path__, f"{pkg.__name__}."):
if mod.name in SKIP or mod.name.endswith(".__main__"):
continue
importlib.import_module(mod.name)
EOF

fill:
name: fill (${{ matrix.label }})
runs-on: [self-hosted-ghr, size-xl-x64]
Expand Down
3 changes: 2 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ spec-tools *args: (_tmp "spec-tools")
uv run pytest \
-n {{ xdist_workers }} \
--basetemp="{{ output_dir }}/spec-tools/tmp" \
--ignore=tests/evm_tools/test_count_opcodes.py \
"$@" \
tests/evm_tools

@spencer-tb spencer-tb Aug 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move tests/evm_tools somewhere else in the repo? I think we should try to aim for src/ only including the spec and tests/ only including the spec/bench tests

Definitely follow ups!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The folder name is a bit misleading. Happy to fix in a follow up

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick win for clarity, potentially in this PR: rename tests/evm_tools to tests/spec_tools, matching the just recipe name (spec-tools). After the move the directory only holds spec-tools tests anyway (test_lint.py, test_new_fork.py, test_docc_shards.py).

The rename touches three places: the recipe at Justfile:219, the fill default ignores at packages/testing/src/execution_testing/cli/pytest_commands/fill.py:143, and the three t8n_build paths in the packaging job. If the t8n_build inputs move to the testing package (see the comment above on the workflow), the last one disappears and this becomes a git mv plus two lines.


Expand All @@ -227,6 +226,7 @@ test-tests *args: (_tmp "test-tests")
cd packages/testing && uv run pytest \
-n {{ xdist_workers }} \
--basetemp="{{ output_dir }}/test-tests/tmp" \
--ignore=src/execution_testing/evm_tools/tests/test_count_opcodes.py \
"$@" \
src

Expand All @@ -237,6 +237,7 @@ test-tests-pypy *args: (_tmp "test-tests-pypy")
-n auto --maxprocesses 6 \
--basetemp="{{ output_dir }}/test-tests-pypy/tmp" \
--ignore=src/execution_testing/cli/pytest_commands/plugins/filler/tests/test_benchmarking.py \
--ignore=src/execution_testing/evm_tools/tests/test_count_opcodes.py \
"$@" \
src

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ just shell-completions

Python 3.11–3.14 are supported; 3.12 tends to be the smoothest for local setup (pre-built wheels are available across the dependency set). For alternative `just` installation paths, macOS-specific installation notes, and troubleshooting, see [Installation](docs/getting_started/installation.md).

## Reference EVM CLI

`ethereum-spec-evm` — a `t8n` transition tool, `b11r` block builder, and state-test runner that execute the spec directly — is provided by the `ethereum-execution-testing` workspace package rather than by `ethereum-execution`. Within a checkout it is available as `uv run ethereum-spec-evm`; for standalone installation (e.g. in client CI or fuzzing setups), see [packages/testing/README.md](packages/testing/README.md).

## Documentation

- **Repo documentation (default branch/fork)**: <https://steel.ethereum.foundation/docs/execution-specs/>
Expand Down
4 changes: 2 additions & 2 deletions docs/dev/deps_and_packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ The repo is a `uv` workspace with two members, each defined by its own `pyprojec

| Package | `pyproject.toml` | Contents |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `ethereum-execution` | [`pyproject.toml`](https://github.com/ethereum/execution-specs/blob/a830dab6f130151ab9023a473b7543120aa21961/pyproject.toml) | The Python specs (`src/ethereum/`) and associated tools. |
| `ethereum-execution-testing` | [`packages/testing/pyproject.toml`](https://github.com/ethereum/execution-specs/blob/a830dab6f130151ab9023a473b7543120aa21961/packages/testing/pyproject.toml) | The EEST test framework under `packages/testing/`. |
| `ethereum-execution` | [`pyproject.toml`](https://github.com/ethereum/execution-specs/blob/a830dab6f130151ab9023a473b7543120aa21961/pyproject.toml) | The Python specs (`src/ethereum/`) and spec-maintenance tools (`src/ethereum_spec_tools/`). |
| `ethereum-execution-testing` | [`packages/testing/pyproject.toml`](https://github.com/ethereum/execution-specs/blob/a830dab6f130151ab9023a473b7543120aa21961/packages/testing/pyproject.toml) | The EEST test framework under `packages/testing/`, including the `ethereum-spec-evm` CLI (`t8n`, `b11r`, state-test runner). |

A single [`uv.lock`](https://github.com/ethereum/execution-specs/blob/a830dab6f130151ab9023a473b7543120aa21961/uv.lock) at the repo root pins dependencies for both packages.

Expand Down
2 changes: 1 addition & 1 deletion docs/filling_tests/transition_tool_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following transition tools are supported by the framework:
| Client | `t8n` Tool | Tracing Support |
| -------| ---------- | --------------- |
| [ethereum/evmone](https://github.com/ethereum/evmone) | `evmone t8n` | Yes |
| [ethereum/execution-specs](https://github.com/ethereum/execution-specs) | [`ethereum-spec-evm t8n`](https://github.com/ethereum/execution-specs/tree/a48e0b381d5225a6c3de2d06cd9ee7ae0b6ca9bb/src/ethereum_spec_tools/evm_tools/t8n) | Yes |
| [ethereum/execution-specs](https://github.com/ethereum/execution-specs) | [`ethereum-spec-evm t8n`](https://github.com/ethereum/execution-specs/tree/forks/amsterdam/packages/testing/src/execution_testing/evm_tools/t8n) | Yes |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we permalink/SHA pin this? This points at tree/forks/amsterdam/..., which will break at the next fork rollover when the default branch moves on.

| [ethereumjs](https://github.com/ethereumjs/ethereumjs-monorepo) | [`ethereumjs-t8ntool.sh`](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/vm/test/t8n) | No |
| [ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) | [`evm t8n`](https://github.com/ethereum/go-ethereum/tree/master/cmd/evm) | Yes |
| [besu-eth/besu](https://github.com/besu-eth/besu/tree/main/ethereum/evmtool) | [`evmtool t8n-server`](https://github.com/besu-eth/besu/tree/main/ethereum/evmtool) | Yes |
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/repository_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Contains the implementation of the Ethereum consensus tests available in this re

#### `packages/execution_testing/`

Contains the `execution_testing` package which provides tools to define test cases and to interface with `t8n` command interfaces that are required to generate tests. Additionally, it contains packages that enable test case execution by customizing pytest which acts as the test framework.
Contains the `execution_testing` package which provides tools to define test cases and to interface with `t8n` command interfaces that are required to generate tests. Additionally, it contains packages that enable test case execution by customizing pytest which acts as the test framework. It also ships the reference EVM `t8n` implementation, which `fill` runs in-process to generate the fixtures in this repository, and which external consumers can drive through the `ethereum-spec-evm` CLI.

#### `docs/`

Expand Down
3 changes: 3 additions & 0 deletions docs/library/execution_testing_evm_tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# EVM Tools Package

::: execution_testing.evm_tools
1 change: 1 addition & 0 deletions docs/library/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Execution spec tests consists of several packages that implement helper classes
- [`execution_testing.test_types`](./execution_testing_test_types.md) - provides Ethereum types built on top of the base types which are used to define test cases and interact with other libraries.
- [`execution_testing.vm`](./execution_testing_vm.md) - provides definitions for the Ethereum Virtual Machine (EVM) as used to define bytecode in test cases.
- [`execution_testing.client_clis`](./execution_testing_client_clis.md) - a wrapper for the transition (`t8n`) tool.
- [`execution_testing.evm_tools`](./execution_testing_evm_tools.md) - the `ethereum-spec-evm` CLI: `t8n`, `b11r`, and state-test tools that run the execution specs directly.
- [`pytest_plugins`](./pytest_plugins/index.md) - contains pytest customizations that provide additional functionality for generating test fixtures.
1 change: 1 addition & 0 deletions docs/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
* [Execution Testing Test Types Package](library/execution_testing_test_types.md)
* [Execution Testing VM Package](library/execution_testing_vm.md)
* [Execution Testing Client CLIs Package](library/execution_testing_client_clis.md)
* [Execution Testing EVM Tools Package](library/execution_testing_evm_tools.md)
* [Pytest Plugins](library/pytest_plugins/index.md)
* [Filler](library/pytest_plugins/filler.md)
* [Forks](library/pytest_plugins/forks.md)
Expand Down
37 changes: 37 additions & 0 deletions packages/testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# The `ethereum-execution-testing` Package

Test generation and execution framework for the [Ethereum Execution Layer Specifications (EELS)](https://github.com/ethereum/execution-specs), derived from [ethereum/execution-spec-tests](https://github.com/ethereum/execution-spec-tests).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a reference to the archived EEST repo here.

Suggested change
Test generation and execution framework for the [Ethereum Execution Layer Specifications (EELS)](https://github.com/ethereum/execution-specs), derived from [ethereum/execution-spec-tests](https://github.com/ethereum/execution-spec-tests).
Test generation and execution framework for the [Ethereum Execution Layer Specifications (EELS)](https://github.com/ethereum/execution-specs).


The package provides:

- The `execution_testing` library: base types, fork definitions, and test-spec primitives used to write consensus test cases.
- The pytest-based commands that generate and run test fixtures against execution clients: `fill`, `execute`, `consume`, and friends.
- `ethereum-spec-evm` — the reference EVM CLI that executes the spec directly: a `t8n` transition tool (also available as a daemon), a `b11r` block builder, and a state-test runner.

## Installing `ethereum-spec-evm` standalone

This package depends on `ethereum-execution` (the spec itself), and the two are developed in lockstep: the spec releases published on PyPI only carry forks that are live on mainnet and generally cannot satisfy this package's dependency pins. Install both packages from the same clone.

With `uv` (resolves the sibling spec package from the checkout automatically):

```console
git clone https://github.com/ethereum/execution-specs
uv tool install ./execution-specs/packages/testing
```

With `pip`, in a virtual environment:

```console
pip install ./execution-specs ./execution-specs/packages/testing
```

With `pipx`:

```console
pipx install ./execution-specs
pipx inject --include-apps ethereum-execution ./execution-specs/packages/testing
```

## Documentation

Repository documentation, including this framework's reference documentation: <https://steel.ethereum.foundation/docs/execution-specs/>
2 changes: 2 additions & 0 deletions packages/testing/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ dev = [
]

[project.scripts]
ethereum-spec-evm = "execution_testing.evm_tools:main"
fill = "execution_testing.cli.pytest_commands.fill:fill"
phil = "execution_testing.cli.pytest_commands.fill:phil"
execute = "execution_testing.cli.pytest_commands.execute:execute"
Expand Down Expand Up @@ -141,6 +142,7 @@ markers = [
"some_mark: Test marker for parametrizer tests",
"eip_checklist: Custom marker for EIP checklist tests",
"slow: Marks tests as slow running",
"evm_tools: marks tests as evm_tools (deselect with '-m \"not evm_tools\"')",
]

[tool.uv]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from execution_testing.forks import Fork

if TYPE_CHECKING:
from ethereum_spec_tools.evm_tools.t8n import ForkCache
from execution_testing.evm_tools.t8n import ForkCache


class ExecutionSpecsTransitionTool(TransitionTool):
Expand Down Expand Up @@ -60,7 +60,7 @@ def __init__(
def fork_cache(self) -> "ForkCache":
"""Lazily import and instantiate the EELS fork cache on first use."""
if self._fork_cache is None:
from ethereum_spec_tools.evm_tools.t8n import ForkCache
from execution_testing.evm_tools.t8n import ForkCache

self._fork_cache = ForkCache()
return self._fork_cache
Expand All @@ -80,7 +80,7 @@ def version(self) -> str:

def is_fork_supported(self, fork: Fork) -> bool:
"""Return True if the fork is supported by the tool."""
from ethereum_spec_tools.evm_tools.utils import get_supported_forks
from ethereum_spec_tools.utils import get_supported_forks

return fork.transition_tool_name() in get_supported_forks()

Expand All @@ -100,14 +100,14 @@ def _evaluate(
— and ``T8N.run()`` returns the ``TransitionToolOutput``
directly.
"""
from ethereum_spec_tools.evm_tools.t8n import T8N
from ethereum_spec_tools.evm_tools.t8n.evm_trace.count import (
from execution_testing.evm_tools.t8n import T8N
from execution_testing.evm_tools.t8n.evm_trace.count import (
CountTracer,
)
from ethereum_spec_tools.evm_tools.t8n.evm_trace.eip3155 import (
from execution_testing.evm_tools.t8n.evm_trace.eip3155 import (
Eip3155Tracer,
)
from ethereum_spec_tools.evm_tools.t8n.evm_trace.group import (
from execution_testing.evm_tools.t8n.evm_trace.group import (
GroupTracer,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from typing import Optional, Sequence, Text, TextIO

from ethereum import __version__
from ethereum_spec_tools.utils import get_supported_forks

from .b11r import B11R, b11r_arguments
from .daemon import Daemon, daemon_arguments
from .statetest import StateTest, state_test_arguments
from .t8n import ForkCache
from .t8n.cli import run_t8n_cli, t8n_arguments
from .utils import get_supported_forks

DESCRIPTION = """
This is the EVM tool for execution specs. The EVM tool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
import json
from typing import Optional, TextIO

from ethereum.crypto.hash import keccak256
from ethereum_rlp import rlp
from ethereum_spec_tools.utils import get_stream_logger
from ethereum_types.bytes import Bytes32

from ethereum.crypto.hash import keccak256

from ..utils import get_stream_logger
from .b11r_types import Body, Header


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
import json
from typing import Any, List, Optional, Tuple

from ethereum.crypto.hash import Hash32, keccak256
from ethereum.utils.hexadecimal import hex_to_bytes, hex_to_bytes8
from ethereum_rlp import rlp
from ethereum_spec_tools.utils import parse_hex_or_int
from ethereum_types.bytes import Bytes, Bytes8, Bytes20, Bytes32, Bytes256
from ethereum_types.numeric import U64, U256, Uint

from ethereum.crypto.hash import Hash32, keccak256
from ethereum.utils.hexadecimal import hex_to_bytes, hex_to_bytes8

from ..utils import parse_hex_or_int

DEFAULT_TRIE_ROOT = (
"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
)

from ethereum.utils.hexadecimal import hex_to_bytes
from ethereum_spec_tools.utils import get_supported_forks

from ..t8n import ForkCache
from ..t8n.cli import build_t8n_from_cli_options
from ..utils import get_supported_forks

if TYPE_CHECKING:
from execution_testing.client_clis.cli_types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@
TypeVar,
)

from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U64, U256, Uint
from typing_extensions import override

from ethereum import trace
from ethereum.exceptions import EthereumException, InvalidBlock
from ethereum.fork_criteria import ByBlockNumber, ByTimestamp, Unscheduled
from ethereum_rlp import rlp
from ethereum_spec_tools.forks import (
ForkOverrides,
Hardfork,
TemporaryHardfork,
)
from ethereum_spec_tools.loaders.fixture_loader import Load
from ethereum_spec_tools.loaders.transaction_loader import (
TransactionLoad,
UnsupportedTxError,
)
from ethereum_spec_tools.utils import get_stream_logger, resolve_fork
from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U64, U256, Uint
from typing_extensions import override

from ..loaders.fixture_loader import Load
from ..loaders.transaction_loader import TransactionLoad, UnsupportedTxError
from ..utils import get_stream_logger, resolve_fork
from .block_environment import Ommer, build_block_environment
from .evm_trace.group import GroupTracer
from .result import build_result, record_rejected_tx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, List, Optional

from ethereum.crypto.hash import Hash32, keccak256
from ethereum_rlp import rlp
from ethereum_types.bytes import Bytes8, Bytes20, Bytes32, Bytes256
from ethereum_types.numeric import U64, U256, Uint

from ethereum.crypto.hash import Hash32, keccak256

if TYPE_CHECKING:
from execution_testing.test_types import Environment as TestingEnvironment
from ethereum_spec_tools.loaders.fork_loader import ForkLoad

from ..loaders.fork_loader import ForkLoad
from execution_testing.test_types import Environment as TestingEnvironment


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
from typing import Any, Dict, List, Optional, TextIO, Tuple

from ethereum_rlp import rlp
from ethereum_spec_tools.forks import Hardfork
from ethereum_spec_tools.loaders.fork_loader import ForkLoad
from ethereum_spec_tools.utils import FatalError, find_fork, parse_hex_or_int
from ethereum_types.bytes import Bytes
from ethereum_types.numeric import U64

from ethereum_spec_tools.forks import Hardfork

from ..loaders.fork_loader import ForkLoad
from ..utils import FatalError, find_fork, parse_hex_or_int
from . import T8N, ForkCache
from .block_environment import Ommer
from .evm_trace.count import CountTracer
Expand Down Expand Up @@ -307,10 +306,6 @@ def build_t8n_from_cli_options(
testing pydantic types, bundles them into a ``TransitionToolData``,
builds the tracer group, and hands them to ``T8N``.
"""
# Function-scoped imports: ``execution_testing/__init__`` eagerly
# imports ``.specs`` which transitively imports ``client_clis``,
# which imports ``ExecutionSpecsTransitionTool`` — top-level imports
# from ``execution_testing`` would cycle back into spec-tools.
from execution_testing.base_types.composite_types import BlobSchedule

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import-cycle note that lived here was deleted, but two comments in this file still point at it: lines 212 and 264 both read # Function-scoped: see import-cycle note in build_t8n_from_cli_options.

They now reference nothing, and these bare function-scoped imports invite a future hoist-to-module-level cleanup.

I would either restore a short note here (updated for the new home) or repoint the two comments. result.py:24-28 kept and updated its equivalent note in this PR and reads well as the model.

from execution_testing.client_clis.transition_tool import TransitionTool
from execution_testing.test_types import (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
EVM Trace Implementations.

See the spec's `ethereum.trace` module for the trace event definitions.
"""
Loading
Loading