Skip to content

Commit

Permalink
✨ feat(fw,fill,cli): Default evm logs
Browse files Browse the repository at this point in the history
  • Loading branch information
raxhvl committed Dec 5, 2024
1 parent 2c5c008 commit 60b08c7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
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 @@ -58,6 +58,7 @@ Test fixtures for use by clients are available for each release on the [Github r
- ✨ Add the `eest make test` command, an interactive CLI that helps users create a new test module and function ([#950](https://github.com/ethereum/execution-spec-tests/pull/950)).
- ✨ Add the `eest clean` command that helps delete generated files and directories from the repository ([#980](https://github.com/ethereum/execution-spec-tests/pull/980)).
- ✨ Add framework changes for EIP-7742, required for Prague devnet-5 ([#931](https://github.com/ethereum/execution-spec-tests/pull/931)).
- ✨ 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

0 comments on commit 60b08c7

Please sign in to comment.