tools: Add option to dump state-diff in state tests - #1722
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1722 +/- ##
==========================================
- Coverage 97.98% 97.98% -0.01%
==========================================
Files 182 183 +1
Lines 16778 16850 +72
Branches 3832 3856 +24
==========================================
+ Hits 16440 16510 +70
Misses 250 250
- Partials 88 90 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
9945ee2 to
400b836
Compare
chfast
left a comment
There was a problem hiding this comment.
I'd split the two features. the log hash check and output is no-brainer. for the state diff I have some questions.
6721480 to
08e3150
Compare
|
Splited. I make them dependent only because I need to have two changes in one branch. They are independent. |
08e3150 to
85534b5
Compare
chfast
left a comment
There was a problem hiding this comment.
Some general comments:
- Do you want to use the "standardized" state diff JSON format?
- I think this should rather go to the summary JSON as dedicated field next to state root hash and logs hash. The --statediff param would force --summary.
- We are reworking this code to be testable via unit tests: this applies here, but is not required: it's better to pass
std::ostreamto run_state_test() to be able to capture summary output and test these in unit tests.
b596463 to
01332c9
Compare
|
01332c9 to
5ddc30c
Compare
0930802 to
38bc015
Compare
|
Redone |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
User-facing documentation misidentifies the output stream and overstates the precision of StateDiff.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds JSON state-diff reporting to state-test trace summaries.
Changes:
- Serializes transaction
StateDiffobjects to JSON. - Emits state diffs after trace summaries.
- Adds export and runner tests.
| File | Description |
|---|---|
tools/evmone/main.cpp |
Updates CLI help. |
test/utils/test_driver.hpp |
Documents trace-summary behavior. |
test/utils/statetest.hpp |
Declares StateDiff serialization. |
test/utils/statetest_runner.cpp |
Emits transaction state diffs. |
test/utils/statetest_export.cpp |
Implements JSON serialization. |
test/unittests/statetest_runner_test.cpp |
Updates expected summary output. |
test/unittests/statediff_export_test.cpp |
Tests StateDiff serialization. |
test/unittests/CMakeLists.txt |
Registers the new tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fdf872a to
5f11306
Compare
dbda981 to
c085973
Compare
e5dd294 to
841c525
Compare
841c525 to
7c60cb6
Compare
7c60cb6 to
fdd0069
Compare

Add new flag
--state-difftoevmone test. If used, the execution summary is extended with JSON encoded transaction state diff.