-
Notifications
You must be signed in to change notification settings - Fork 53
Fix proof direction and key bit order #22
Fix proof direction and key bit order #22
Conversation
Can we perhaps add tests to ensure that the keys are added with the correct key bit order? |
Sure, but how specifically would we test for that? I guess we could add two leaves that are one bit apart and the proof needs to be 256 side nodes? |
You could generate some trees, and compare it to the expected trees according to the spec. |
How does that ensure that the keys are added with the correct key bit order? |
It adds a check at the end that the proof is 256 nodes. If traversal isn't done in the correct bit order, the proof would be 256-8 = 248 nodes (maybe off-by-one, but you get the idea). |
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
Idiomatic Co-authored-by: Tomasz Zdybał <[email protected]>
Fixes #20 and conforms to celestiaorg/celestia-specs#129.