-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: verifies namespace hash format to prevent panic in validateSiblingsNamespaceOrder #185
Merged
Merged
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
e49d7b1
updates criteria of an empty proof
staheri14 5e9091c
replaces slice literal with nID1
staheri14 b6e3cd3
refactors the code to reject invalid empty proof, adds tests
staheri14 5c32cbc
corrects IsOfEmptyProof description
staheri14 84865d7
prefixes min and max with root
staheri14 c8a8059
fixes linter issues
staheri14 8a27636
revises some typos
staheri14 9e3d8de
renames IsOfEmptyProof to IsEmptyProof
staheri14 20b2205
returns immediately on invalid range
staheri14 6222d5f
adds unit tests
staheri14 30cbde4
Merge remote-tracking branch 'origin/master' into verifies-proof-range
staheri14 9fd31f2
considers start=end as invalid
staheri14 167629c
defines a utility function for proof range verification
staheri14 fcd3cd0
returns the error returned by validateRange
staheri14 d11e9c2
adds proof range check
staheri14 bb07d07
incorporates further tests covering new range check
staheri14 d491b52
returns err produced by validateRange
staheri14 e6cb4dc
Merge branch 'verifies-proof-range' into panics-in-verifyleafhashes
staheri14 a449d68
implements the necessary logic to handle empty proofs
staheri14 29007f4
develops tests
staheri14 8fdaab2
revises the err message
staheri14 409f0f8
extracts the NID from the leaf
staheri14 2d504d5
removes an excess line
staheri14 48010b1
Merge branch 'master' into panics-in-verifyleafhashes
staheri14 712ed08
revises tests descriptions
staheri14 e01ce18
declares a variable for nonEmptyProof for readability
staheri14 fc595aa
removes an excess line
staheri14 021adc0
replaces manual extraction of min and max NID with proper func calls
staheri14 951ad75
adds node format validation to the validateSiblingsNamespaceOrder
staheri14 81e86bf
implements test for the invalid siblings format
staheri14 f70d2d7
resolves linter issues
staheri14 53597b9
Merge branch 'master' into resolves-panic-validateSiblings
staheri14 f3076fe
revises the error message
staheri14 fb8ee89
deletes stale comments
staheri14 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 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
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.
[unrelated] since a namespace now consists of a version and an ID, "namespace" may be clearer than "namespace ID". Thoughts on renaming usage of "namespace ID" to "namespace" in this repo so that the term matches its usage in celestia-app. If yes, I can create a new issue.
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 agree that the renaming is a good idea, as long as we're consistent with the terms we use. Regarding the namespace version, would it be something that the nmt lib needs to handle, or is it transparent and won't impact implementation? As far as I understand, the only change is the size of the namespace, and any further parsing of the namespace byte slice would depend on the specific logic of the application, correct?
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.
Won't impact implementation. The NMT lib is already used by celestia-app so no further changes are necessary to support namespaces with versions.
Correct.