mpt: Remove val from inclusion proof#75
Open
rozbb wants to merge 1 commit into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ported from rsc/tmp#21
We've been basing WAICT's transparency log on this MPT design (our spec uses a more functional-style def, but it's identical). In our inclusion proofs, we serve leaf data that the client then hashes to get the leaf
val. For us, there is no reason for the MPT inclusion proof to also have a copy ofval. At best, it is a redundancy, and at worst it is a potential area for implementations to differ on behavior.More generally, I suspect anyone using this MPT structure will have their own way of conveying the value of a leaf. So I think
valshould be left outside the proof.This PR removes
valfrom MPT inclusion proofs, and updates the implementation accordingly. I've also taken the liberty of breaking up theVerifyfunction intoVerifyInclusionandVerifyNoninclusion, since they inherently have different type signatures and I didn't see a need to have them unified as one function (I've never seen a use case where a client doesn't know which one to expect). Also I removed thevalreturn value fromVerifyNoninclusionsince it's not clear what someone would do with the value of a key adjacent to the one being queried.Let me know what you think!