Skip to content

fix(test-client-clis): write empty trace placeholder for rejected txs#2772

Open
leolara wants to merge 1 commit intoethereum:forks/amsterdamfrom
leolara:leolara/bug-verify-traces-disk-asymmetry
Open

fix(test-client-clis): write empty trace placeholder for rejected txs#2772
leolara wants to merge 1 commit intoethereum:forks/amsterdamfrom
leolara:leolara/bug-verify-traces-disk-asymmetry

Conversation

@leolara
Copy link
Copy Markdown
Member

@leolara leolara commented Apr 28, 2026

🗒️ Description

Extends #2709 to fix a disk/in-memory asymmetry that caused --verify-traces to report spurious divergences for transactions that produce a receipt but no TransactionEnd tracer event (e.g. EIP-3607 collisions, CREATE-into-non-empty failures during process_transaction).

#2709 made the in-memory collect_traces tolerant of a missing trace-N-<hash>.jsonl by appending an empty TransactionTraces. The same placeholder was not written to --evm-dump-dir, so a later --verify-traces run loaded a different shape from disk and the comparator's outer length check fired a TransactionCountMismatch for every affected test.

This PR makes the on-disk representation symmetric with the in-memory one (Option A from the issue):

  • TransitionTool.collect_traces: when the missing-file branch runs and debug_output_path is set, write a zero-byte trace-{i}-{hash}.jsonl placeholder.
  • TransactionTraces.from_file: return an empty TransactionTraces for empty files (the loader path used by _load_traces_from_dump_dir).

Verification

The issue's reproducer (the three EIP-3607 / CREATE-collision tests) now compares clean:

Before:  Total: 24, Equivalent:  0, Divergent: 24   (per-test from issue)
After:   Total: 78, Equivalent: 78, Divergent:  0   (all 3 tests, exact-no-stack)

Unit coverage added:

  • test_transition_tool.py: placeholder is written when debug_output_path is set; not written when it is None (in-memory padding still happens).
  • test_verify_traces.py: loader reads an empty placeholder file as an empty TransactionTraces slot.

🔗 Related Issues or PRs

Fixes #2758. Extends #2709.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

Quokka at Rottnest Island

Quokka at Rottnest (cropped) — Pikuan, CC BY-SA 3.0, via Wikimedia Commons

…d txs

Extends ethereum#2709. When a tx produces a receipt but no TransactionEnd
tracer event fires (e.g. EIP-3607 collisions), the in-memory
collect_traces appends an empty TransactionTraces, but no matching
file was written to --evm-dump-dir. A later --verify-traces run
loaded a different shape from disk and reported spurious
transaction-count mismatches for the entire class of failed-during-
execution tests.

Write a zero-byte placeholder when debug_output_path is set, and
make TransactionTraces.from_file tolerant of empty files so the
loader produces a matching empty TransactionTraces.

Fixes ethereum#2758.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

verify-traces: asymmetry between in-memory and disk-loaded traces for failed-during-execution txs (extend #2709)

1 participant