You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None of the current proof verification functions i.e.,VerifyNamespace and VerifyInclusion verify the consistency between the namespace ID of the leaves and the queried name ID (this inconsistency gets caught later in the root calculation). This can be addressed by incorporating a check at the beginning of the functions, which not only makes the code more clear and easier to maintain and debug, but also saves a significant amount of time by preventing unnecessary root calculations from invalid inputs and allowing for early returns from the function call.
The text was updated successfully, but these errors were encountered:
Update: VerifyNamespace does check the NID of the leaves against the queried NID in this line prior to hashing. Nothing to be done in this method. VerifyInclusion does not have to do any check since the leaves passed as argument to this method are not namespaced, and get namespaced within the method (hence no check needed).
The only method that can do the check but does not is the, soon to be exposed, VerifyLeafHashes. However, incorporating this check depends on our decision on the following issue #110, so going to mark it as blocked until the other one gets concluded.
Update: VerifyLeafHashes should be revised to include a check that ensures the namespace of the leafHashes parameter (if it is present) matches the queried namespace. This required behavior should remain consistent regardless of whether the proof is a partial absence proof or a full absence proof (in the case of an absence proof, leafHashes will be empty). I will proceed with implementing this modification.
…es (#207)
## Overview
Closes#183. The modifications in this PR are also in line with
empowering light clients to furnish BEFPs for proofs that encounter
unsuccessful verification outcomes (where the early termination of
verification upon encountering invalid leaf hashes, with mismatching
namespaces, gives a clear indication of the failure root cause, enabling
them to decide on whether to craft BEFPs or not accordingly).
## 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
Problem
None of the current proof verification functions i.e.,
VerifyNamespace
andVerifyInclusion
verify the consistency between the namespace ID of the leaves and the queried name ID (this inconsistency gets caught later in the root calculation). This can be addressed by incorporating a check at the beginning of the functions, which not only makes the code more clear and easier to maintain and debug, but also saves a significant amount of time by preventing unnecessary root calculations from invalid inputs and allowing for early returns from the function call.The text was updated successfully, but these errors were encountered: