-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: add an additional constraint of empty leafHash field to the em…
…pty proof definition (#192) ## Overview Closes #181 The updates made by this PR will result in a breaking change, as empty proofs with a non-empty `leafHash` field will no longer be considered valid. This means that their verification through `VerifyNamespace` will fail. Example: ```go nIDSize := 1 tree := exampleNMT(nIDSize, 1, 2, 3, 4) root, err := tree.Root() require.NoError(t, err) hasher := proof := Proof{ start: 0, end: 0, nodes: nil, leafHash: tree.leafHashes[0], } res := proof.VerifyNamespace(tree.treeHasher.baseHasher, []byte{0}, [][]byte{}, root) require.True(res) // this is false with the changes in this PR, however, previously, it was true ``` ## Checklist - [x] New and updated code has appropriate documentation - [x] New and updated code has new and/or updated testing - [x] Required CI checks are passing - [x] Visual proof for any user facing features like CLI or documentation updates - [x] Linked issues closed with keywords
- Loading branch information
Showing
2 changed files
with
118 additions
and
29 deletions.
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