This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
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.
Merkle tree misc fixes #47
Merkle tree misc fixes #47
Changes from all commits
ea63dbf
a3ec7c0
a72a4a3
05d1252
3c56a29
6e3635d
5ee2f97
e0900b1
8adacbd
22cbaaa
eeca2f6
4185852
cb65f75
dcb3159
e3854c3
73378ae
0f1f238
16e468d
d3d1688
a746d0d
37d911c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It would be helpful to specify how it's the same as RFC 6962. Specifically, that the tree is unbalanced when there isn't 2^x leaves. The next sentence is describing properties of all Merkle trees.
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.
Ah nvm, it's specified here.
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.
One last nitpick: You implicitly assuming that data
d
is a structure as well namelystruct{namespaceID, raw_data}
. And that last line is still ambiguous to what gets hashed in the end: ifh(0x00, d.raw_data)
orh(0x00, d.namespaceID||d.raw_data))
(or whatever the result ofserialize(d)
is).Note: as far as I understand both
h(0x00, d.raw_data)
orh(0x00, d.namespaceID||d.raw_data))
correctly define a NMT but I think we should be explicit here.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.
Technically, the serialization of shares is defined as a special case: https://github.com/lazyledger/lazyledger-specs/blob/adlerjohn-merkle_tree_fixes/specs/data_structures.md#share-serialization.
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.
Ah I missed that. But that doesn't address that you implicitly assume that
d
has to have a structure (namely two fields) but I guess the important part is covered in the spec (how the shares end up in the tree ...).