feat(test-execute): Add --verify-traces flag for trace comparison against baselines#2535
Open
leolara wants to merge 5 commits intoethereum:forks/amsterdamfrom
Open
feat(test-execute): Add --verify-traces flag for trace comparison against baselines#2535leolara wants to merge 5 commits intoethereum:forks/amsterdamfrom
leolara wants to merge 5 commits intoethereum:forks/amsterdamfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2535 +/- ##
===================================================
+ Coverage 86.01% 86.35% +0.33%
===================================================
Files 599 599
Lines 36904 36904
Branches 3771 3771
===================================================
+ Hits 31744 31868 +124
+ Misses 4551 4485 -66
+ Partials 609 551 -58
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description
Add a
--verify-traces <folder>flag to thefillcommand that compares EVM execution traces from a baseline run against the current run. This enables developers to confirm that test modifications haven't changed underlying EVM execution behavior.Comparators:
exact— compares all fields including gas and gas_cost. Detects any difference, including opcode gas cost changes.exact-no-gas(default) — excludesgas,gas_cost, andgas_usedfields, and applies GAS opcode stack pollution cleanup viaremove_gas(). This tolerates remaining gas differences when transaction gas amounts change, but also tolerates opcode gas cost changes since those fields are excluded. Use theexactcomparator when gas cost changes need to be detected.Multiple comparators can be run simultaneously via
--verify-traces-comparator exact,exact-no-gasto see how each test differs under different comparison strategies.Design decisions:
Diagnostic, not failing: Unlike the original issue which proposed failing tests on mismatch, this implementation reports all results across all comparators without failing. This lets developers see the full picture — a test might show DIFFERENT under
exactbut EQUIVALENT underexact-no-gas, which immediately tells them the only changes are gas-related. Failing on the first mismatch would hide this information.Pluggable comparator architecture: The ABC + factory pattern supports future comparators beyond exact matching:
In-memory traces:
--verify-tracesenables trace collection without writing files to disk (unless--evm-dump-diris also passed). Baseline traces are loaded from disk; current traces are compared from memory.Cache-aware: The t8n output cache now restores traces on cache hits, so verification works correctly even for cached test formats.
🔗 Related Issues or PRs
Fixes #2506.
Follow-up work:
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.Cute Animal Picture