🎉 feat: Add MerkleTree with proof length validation#264
Merged
roninjin10 merged 1 commit intomainfrom Jan 4, 2026
Merged
Conversation
Fixes #111: MerkleTree proof verification now validates that proof.siblings.length === proof.treeDepth. Changes: - Create MerkleTree module with from(), getProof(), verify() functions - verify() throws InvalidProofLengthError if proof length doesn't match expected tree depth - Add Proof.verifyWithDepth() to Zig for depth-validated verification - Comprehensive tests for proof length validation For a balanced tree with n leaves, depth = ceil(log2(n)). A proof with incorrect length is rejected. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
roninjin10
commented
Jan 4, 2026
Contributor
Author
roninjin10
left a comment
There was a problem hiding this comment.
Automated review summary for PR #264 — 🎉 feat: Add MerkleTree with proof length validation\n\nTouched areas: MerkleTree, Proof | Files changed: 8 (+829/-0)\n\n- Tests: yes\n- Types & API: yes\n- Docs: ensure behavior is documented where user-facing.\n- Performance: consider micro-allocations in tight loops.\n\nFocus points:\n - State hash fn and leaf ordering (sorted vs indexed).\n - Verify proof length matches depth; test invalid length/order.\n - Align with MerkleTree proofs; reject malformed nodes and lengths.\n\nOutcome: Comment-only review; no blocking issues spotted. Please consider the above suggestions.\n
4 tasks
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.
Summary
Test plan
🤖 Generated with Claude Code