Generate subtree inclusion proofs#226
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #226 +/- ##
===========================================
- Coverage 89.33% 57.68% -31.66%
===========================================
Files 7 8 +1
Lines 497 605 +108
===========================================
- Hits 444 349 -95
- Misses 48 251 +203
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
codecov is complaining, but it's using 4ebea17 as a baseline, which is over two years old. |
7b03e29 to
ebffc12
Compare
AlCutter
approved these changes
Jun 2, 2026
Contributor
Author
|
I had to re-push the branch because commit I've now removed them, but I need another approval. |
AlCutter
approved these changes
Jun 3, 2026
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.
Towards #225.
This PR introduces
SubtreeInclusionand allows generating inclusion proofs for a leaf in a given subtree. Verification will come in a later PR.This implementation:
The tests for this function are based on the existing tests of Inclusion, with the addition of:
bit_ceil(end-start). I believe this is enough. Specifically, I don't think that we need to add tests shifted byx*bit_ceil(end-start). We can always add more tests later if need be. We should probably add subtree tests insidetestonly/as well.Alternatives explored:
nodesfunction to acceptstartandendindex. It added complexity to that function without clear benefits. I doubt that the performance would be noticeable.InclusioncallSubtreeInclusion: this works, but adds unnecessary checks toInclusion. I like how simpleInclusionis today.SubtreeInclusion, run some input validation checks, then callInclusionwhich would call further input validation tests, then shift nodes back. This would just make error message more confusing, with little benefits.Let me know what you think, and we'll take it from there.