Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat(fw,fill,cli): Default evm logs #999

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,7 @@ assets
*.html

# Environment
env.yaml
env.yaml

# Framework logs
logs/
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Test fixtures for use by clients are available for each release on the [Github r
- ✨ Add framework changes for EIP-7742, required for Prague devnet-5 ([#931](https://github.com/ethereum/execution-spec-tests/pull/931)).
- ✨ Add the `eest make env` command that generates a default env file (`env.yaml`)([#996](https://github.com/ethereum/execution-spec-tests/pull/996)).
- ✨ Generate Transaction Test type ([#933](https://github.com/ethereum/execution-spec-tests/pull/933)).
- ✨ Add a default location for evm logs (`--evm-dump-dir`) when filling tests ([#999](https://github.com/ethereum/execution-spec-tests/pull/999)).

### πŸ”§ EVM Tools

Expand Down
4 changes: 2 additions & 2 deletions docs/filling_tests/debugging_t8n_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

There are two flags that can help debugging `t8n` tools or the execution-spec-tests framework:

1. `--evm-dump-dir`: Write debug information from `t8n` tool calls to the specified directory.
1. `--evm-dump-dir` (Default: <repo>/logs/evm): Write debug information from `t8n` tool calls to the specified directory.
2. `--traces`: Collect traces of the execution from the transition tool.
3. `--verify-fixtures`: Run go-ethereum's `evm blocktest` command to verify the generated test fixtures.

## EVM Dump Directory

The `--evm-dump-dir` flag tells the framework to write the inputs and outputs of every call made to the `t8n` command to the specified output directory. The aim is to help debugging or simply understand how a test is interacting with the EVM.
The `--evm-dump-dir` flag tells the framework to write the inputs and outputs of every call made to the `t8n` command to the specified output directory. The aim is to help debugging or simply understand how a test is interacting with the EVM. The default location is `logs/evm` in the project root.

Each test case receives its own sub-directory under the `--evm-dump-dir` that contains these files which can be easily accessed from the HTML test report generated by `fill` (located by default in the root of the `--output` directory).

Expand Down
2 changes: 1 addition & 1 deletion docs/filling_tests/filling_tests_command_line.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Arguments defining filler location and output:

Arguments defining debug behavior:
--evm-dump-dir EVM_DUMP_DIR, --t8n-dump-dir EVM_DUMP_DIR
Path to dump the transition tool debug output.
Path to dump the transition tool debug output. (Default: <repo>/logs/evm)

Specify the fork range to generate fixtures for:
--forks Display forks supported by the test framework and exit.
Expand Down
8 changes: 8 additions & 0 deletions src/config/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- AppConfig: Holds configurations for the application framework.
"""

from pathlib import Path

from pydantic import BaseModel


Expand All @@ -15,3 +17,9 @@ class AppConfig(BaseModel):

version: str = "3.0.0"
"""The version of the application framework."""

DEFAULT_LOGS_DIR: Path = Path(__file__).resolve().parent.parent.parent / "logs"
"""The default directory where log files are stored."""

DEFAULT_EVM_LOGS_DIR: Path = DEFAULT_LOGS_DIR / "evm"
"""The default directory where EVM log files are stored."""
8 changes: 6 additions & 2 deletions src/pytest_plugins/filler/filler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from pytest_metadata.plugin import metadata_key # type: ignore

from cli.gen_index import generate_fixtures_index
from config import AppConfig
from ethereum_clis import TransitionTool
from ethereum_test_base_types import Alloc, ReferenceSpec
from ethereum_test_fixtures import BaseFixture, FixtureCollector, TestInfo
Expand Down Expand Up @@ -182,8 +183,11 @@ def pytest_addoption(parser: pytest.Parser):
"--t8n-dump-dir",
action="store",
dest="base_dump_dir",
default="",
help="Path to dump the transition tool debug output.",
default=AppConfig().DEFAULT_EVM_LOGS_DIR,
help=(
"Path to dump the transition tool debug output. "
f"(Default: {AppConfig().DEFAULT_EVM_LOGS_DIR})"
),
)


Expand Down
Loading