-
Notifications
You must be signed in to change notification settings - Fork 148
Add test covering HashKey rlp encoding when data contains embedded trie node #3578
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8592802
Fix rlp encoding of HashKey type.
bhartnett 6d9e0d4
Merge branch 'master' into fix-hashkey-rlp-encoding
bhartnett dc20527
Add test which covers trie root calculations for embedded trie node i…
bhartnett b254482
Revert change to Hashkey type.
bhartnett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
@chirag-parmar Do you know of any reason why this might be encoding values as a list rather than a blob?
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 is the code that decodes the trie nodes and expects a blob to be present in each of the branch node indexes, not a list:
nimbus-eth1/execution_chain/db/aristo/aristo_proof.nim
Line 243 in d584afb
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 is weird.
All I can say is that
HashKeyis being encoded as a list because the overloading resolution algorithm at the time of compilation uses the generic method defined here https://github.com/status-im/nim-eth/blob/master/eth/rlp/writer.nim#L202 for serializing it. At the time of compilation, for some unknown reason, it doesn'tmixintheappendmethod defined indesc_identifiers.nim.I have been facing a similar issue #3572. Even here, the score gets serialized as a list (because it is an object: UInt256) UNLESS I include that one magical line of code.
So I think the change you made has nothing to do with the incorrect serialization. This is just my educated guess (even
writeBlobcallsappendRawBytesinternally)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 see, well thanks for the info. I'll keep looking into it as it would be good to know definitively the root cause.