Skip to content

Commit c631bf4

Browse files
chore(fill): disable writing evm debug information to ./logs/ by default (#1874)
Co-authored-by: danceratopz <[email protected]>
1 parent 6684295 commit c631bf4

File tree

10 files changed

+14
-27
lines changed

10 files changed

+14
-27
lines changed

.github/actions/build-fixtures/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ runs:
3434
- name: Generate fixtures using fill
3535
shell: bash
3636
run: |
37-
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} --solc-version=${{ steps.properties.outputs.solc }} --skip-evm-dump ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.release_name }}.tar.gz --build-name ${{ inputs.release_name }}
37+
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} --solc-version=${{ steps.properties.outputs.solc }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.release_name }}.tar.gz --build-name ${{ inputs.release_name }}
3838
- name: Wrap ethereum/tests fixtures with eofwrap tool
3939
shell: bash
4040
if: ${{ steps.properties.outputs.eofwrap }}

.github/scripts/fill_introduced_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FILL_UNTIL="${4:-Cancun}"
1616
# As when we translate from yul/solidity some dup/push opcodes could become untouched
1717
files="$CHANGED_TEST_FILES tests/homestead/coverage/test_coverage.py"
1818

19-
uv run fill $files --clean --until=$FILL_UNTIL --evm-bin evmone-t8n --skip-evm-dump --block-gas-limit $BLOCK_GAS_LIMIT -m "state_test or blockchain_test" --output $PATCH_TEST_PATH > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
19+
uv run fill $files --clean --until=$FILL_UNTIL --evm-bin evmone-t8n --block-gas-limit $BLOCK_GAS_LIMIT -m "state_test or blockchain_test" --output $PATCH_TEST_PATH > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
2020

2121
if grep -q "FAILURES" filloutput.log; then
2222
echo "Error: failed to generate .py tests."

.github/scripts/fill_prepatched_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ echo "$MODIFIED_DELETED_FILES"
2727
rm -rf fixtures
2828
rm -f filloutput.log
2929

30-
uv run fill $MODIFIED_DELETED_FILES --clean --until=$FILL_UNTIL --evm-bin evmone-t8n --skip-evm-dump --block-gas-limit $BLOCK_GAS_LIMIT -m "state_test or blockchain_test" --output $BASE_TEST_PATH > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
30+
uv run fill $MODIFIED_DELETED_FILES --clean --until=$FILL_UNTIL --evm-bin evmone-t8n --block-gas-limit $BLOCK_GAS_LIMIT -m "state_test or blockchain_test" --output $BASE_TEST_PATH > >(tee -a filloutput.log) 2> >(tee -a filloutput.log >&2)
3131

3232
if grep -q "FAILURES" filloutput.log; then
3333
echo "Error: failed to generate .py tests from before the PR."

docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ The output behavior of `fill` has changed ([#1608](https://github.com/ethereum/e
2222
- Before: `fill` wrote fixtures into the directory specified by the `--output` flag (default: `fixtures`). This could have many unintended consequences, including unexpected errors if old or invalid fixtures existed in the directory (for details see [#1030](https://github.com/ethereum/execution-spec-tests/issues/1030)).
2323
- Now: `fill` will exit without filling any tests if the specified directory exists and is not-empty. This may be overridden by adding the `--clean` flag, which will first remove the specified directory.
2424

25+
Additionally, writing debugging information to the EVM "dump directory" by default has been disabled. To obtain debug output, the `--evm-dump-dir` flag must now be explicitly set. As a consequence, the now redundant `--skip-evm-dump` option was removed ([#1874](https://github.com/ethereum/execution-spec-tests/pull/1874)). This undoes functionality originally introduced in [#999](https://github.com/ethereum/execution-spec-tests/pull/999) and [#1150](https://github.com/ethereum/execution-spec-tests/pull/1150).
26+
2527
#### Feature `zkevm` updated to `benchmark`
2628

2729
Due to the crossover between `zkevm` and `benchmark` tests, all instances of the former have been replaced with the latter nomenclature. Repository PR labels and titles are additionally updated to reflect this change.
@@ -49,6 +51,7 @@ Users can select any of the artifacts depending on their testing needs for their
4951
- 🐞 `zkevm` marked tests have been removed from `tests-deployed` tox environment into its own separate workflow `tests-deployed-zkevm` and are filled by `evmone-t8n` ([#1617](https://github.com/ethereum/execution-spec-tests/pull/1617)).
5052
- ✨ Field `postStateHash` is now added to all `blockchain_test` and `blockchain_test_engine` tests that use `exclude_full_post_state_in_output` in place of `postState`. Fixes `evmone-blockchaintest` test consumption and indirectly fixes coverage runs for these tests ([#1667](https://github.com/ethereum/execution-spec-tests/pull/1667)).
5153
- 🔀 Changed INVALID_DEPOSIT_EVENT_LAYOUT to a BlockException instead of a TransactionException ([#1773](https://github.com/ethereum/execution-spec-tests/pull/1773)).
54+
- 🔀 Disabled writing debugging information to the EVM "dump directory" to improve performance. To obtain debug output, the `--evm-dump-dir` flag must now be explicitly set. As a consequence, the now redundant `--skip-evm-dump` option was removed ([#1874](https://github.com/ethereum/execution-spec-tests/pull/1874)).
5255

5356
#### `consume`
5457

docs/filling_tests/debugging_t8n_tools.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

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

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

99
## EVM Dump Directory
1010

11-
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.
11+
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. Debug output is only generated when this flag is explicitly specified.
1212

1313
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).
1414

src/config/app.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,5 @@ def version(self) -> str:
2525
DEFAULT_LOGS_DIR: Path = Path(__file__).resolve().parent.parent.parent / "logs"
2626
"""The default directory where log files are stored."""
2727

28-
DEFAULT_EVM_LOGS_DIR: Path = DEFAULT_LOGS_DIR / "evm"
29-
"""The default directory where EVM log files are stored."""
30-
3128
ROOT_DIR: Path = Path(__file__).resolve().parents[2]
3229
"""The root directory of the project."""

src/pytest_plugins/consume/tests/test_consume_args.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def fill_tests(
6161
[
6262
"-c",
6363
"pytest.ini",
64-
"--skip-evm-dump",
6564
"-m",
6665
"not blockchain_test_engine",
6766
f"--from={fill_fork_from}",

src/pytest_plugins/filler/filler.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from pytest_metadata.plugin import metadata_key # type: ignore
2121

2222
from cli.gen_index import generate_fixtures_index
23-
from config import AppConfig
2423
from ethereum_clis import TransitionTool
2524
from ethereum_clis.clis.geth import FixtureConsumerTool
2625
from ethereum_test_base_types import Account, Address, Alloc, ReferenceSpec
@@ -273,20 +272,12 @@ def pytest_addoption(parser: pytest.Parser):
273272
"--t8n-dump-dir",
274273
action="store",
275274
dest="base_dump_dir",
276-
default=AppConfig().DEFAULT_EVM_LOGS_DIR,
275+
default=None,
277276
help=(
278277
"Path to dump the transition tool debug output. "
279-
f"(Default: {AppConfig().DEFAULT_EVM_LOGS_DIR})"
278+
"Only creates debug output when explicitly specified."
280279
),
281280
)
282-
debug_group.addoption(
283-
"--skip-evm-dump",
284-
"--skip-t8n-dump",
285-
action="store_true",
286-
dest="skip_dump_dir",
287-
default=False,
288-
help=("Skip dumping the the transition tool debug output."),
289-
)
290281

291282

292283
def pytest_sessionstart(session: pytest.Session):
@@ -663,8 +654,6 @@ def evm_fixture_verification(
663654
@pytest.fixture(scope="session")
664655
def base_dump_dir(request: pytest.FixtureRequest) -> Path | None:
665656
"""Path to base directory to dump the evm debug output."""
666-
if request.config.getoption("skip_dump_dir"):
667-
return None
668657
base_dump_dir_str = request.config.getoption("base_dump_dir")
669658
if base_dump_dir_str:
670659
return Path(base_dump_dir_str)

src/pytest_plugins/filler/tests/test_output_directory.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def _run_fill(output_dir: Path, clean: bool = False, expect_failure: bool = Fals
3838
args = [
3939
"-c",
4040
"pytest.ini",
41-
"--skip-evm-dump",
4241
"-m",
4342
"(not blockchain_test_engine) and (not eip_version_check)",
4443
f"--from={fill_fork_from}",

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ description = Fill test cases in ./tests/ for deployed mainnet forks, except for
8383
setenv =
8484
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI)
8585
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:}
86-
commands = pytest -n auto -m "not slow and not benchmark" --skip-evm-dump --output=/tmp/fixtures-tox --clean
86+
commands = pytest -n auto -m "not slow and not benchmark" --output=/tmp/fixtures-tox --clean
8787

8888
[testenv:tests-deployed-benchmark]
8989
description = Fill benchmarking test cases in ./tests/ for deployed mainnet forks, using evmone-t8n.
90-
commands = pytest -n auto -m "benchmark" --skip-evm-dump --block-gas-limit 36000000 --output=/tmp/fixtures-tox --clean --evm-bin=evmone-t8n
90+
commands = pytest -n auto -m "benchmark" --block-gas-limit 36000000 --output=/tmp/fixtures-tox --clean --evm-bin=evmone-t8n
9191

9292
[testenv:tests-develop]
9393
description = Fill test cases in ./tests/ for deployed and development mainnet forks
9494
setenv =
9595
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI)
9696
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:}
97-
commands = pytest -n auto --until={[forks]develop} -k "not slow and not benchmark" --skip-evm-dump --output=/tmp/fixtures-tox --clean
97+
commands = pytest -n auto --until={[forks]develop} -k "not slow and not benchmark" --output=/tmp/fixtures-tox --clean
9898

9999
# ----------------------------------------------------------------------------------------------
100100
# ALIAS ENVIRONMENTS
@@ -158,4 +158,4 @@ setenv =
158158
commands =
159159
{[testenv:spellcheck]commands}
160160
{[testenv:markdownlint]commands}
161-
{[testenv:mkdocs]commands}
161+
{[testenv:mkdocs]commands}

0 commit comments

Comments
 (0)