-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
core/state: do not ignore null addr while iterative dump #27320
core/state: do not ignore null addr while iterative dump #27320
Conversation
core/state/dump.go
Outdated
if addr != (common.Address{}) { | ||
dumpAccount.Address = &addr | ||
} | ||
dumpAccount.Address = &addr |
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.
This isn't good either, because the addr
is not a pointer, so the "we don't have it" null-element is the zero-address.
So as it is on master
, it will fail by not showing the 0x000..0
-address in the output. Which is wrong.
In this PR, however, it will fail by showing accounts for which we do not have the preimage (address), as if they were 0x00..00
.
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.
Fixed, ptal
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.
I understand the fix, but the fix will break t8n
: https://github.com/ethereum/go-ethereum/tree/master/cmd/evm:
s.DumpToCollector(collector, nil) |
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.
Fixed to make evmtools happy.
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
) fixes bug which caused the zero-address to be ignored during an iterative state-dump. --------- Co-authored-by: Martin Holst Swende <[email protected]>
…ereum#27320)" This reverts commit 8686762.
…ereum#27320)" This reverts commit 8686762.
This PR fixes bug which null address is ignored while doing iterative dump.
Null address is excluded in the
jsonl
result, which makes preimage(null address) not included in the final output.This PR also adds test for testing iterative dump functionality.
Example
Iterative dump without the fix:
You may observe that address value is not included for null address(third line of
jsonl
output).Iterative dump with the fix: