-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log calculated world state contents upon state root mismatch #8099
Conversation
Signed-off-by: Simon Dudley <[email protected]>
Collect trielog rolling exceptions and display upon state root mismatch Tidy up assertions and world state logging Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
Example output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good; I just added comments regarding how the world state is displayed.
.map( | ||
e -> | ||
Map.entry( | ||
e.getKey().orElse(UInt256.ZERO), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
displaying zero is not true, I will prefer return Bytes.EMPTY in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me. Note, ZERO was somewhat following suit with
besu/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java
Line 581 in ff5266a
.sorted(Comparator.comparing(o -> o.getAddress().orElse(Address.ZERO).toHexString())) |
if (!storageEntries.isEmpty()) { | ||
accountJson.set("storage", storageJson); | ||
} | ||
worldStateJson.set(account.getAddress().orElse(Address.ZERO).toHexString(), accountJson); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, I don't think we will trigger this case but I will prefer to see that it was empty and no think that the address is the ZERO one
Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR description
When running EEST tests with our referenceTests runner, if we get a state root mismatch, then dump the world state contents to make it easy to see the "post state".
Together with this recently merged EEST change: ethereum/execution-spec-tests#1064
We should be able to do a direct comparison of the calculated versus expected post state.
"Collect" exceptions during trie log rolling validation and assert together with the state root.