-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement encoding proof node values (#2819)
Necessary in order to finish #1166 Right now we can decode items from Merkle proofs. This PR implements encoding back these items. While implementing encoding, I've discovered several cases where the decoding was too lenient and was accepting as valid things that shouldn't really be valid. I've fixed this as part of this PR. See the changes in `src/util.rs` and at the bottom of `src/trie/proof_node_codec.rs`. When I say "shouldn't really be valid" I mean that there were multiple different sequences of bytes that could lead to the same decoded struct. Since we're hashing things a lot here and there, it is important that there is a bijection of decoded <-> encoded. The Substrate implementation does the same. cc paritytech/substrate#12417
- Loading branch information
Showing
11 changed files
with
282 additions
and
78 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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.