Repository navigation
fix: enforce succinctness and completeness for non-Merk V1 proof verification - #415
Conversation
…fication MMR, BulkAppendTree, and DenseTree verifiers now check that proofs contain exactly the entries requested by the query — no extras (soundness) and no missing (completeness). Also adds the missing DenseAppendOnlyFixedSizeTree arm in check_subtree_exists and fixes potential u64 overflow in range expansion helpers. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR enhances GroveDB's proof operations by extending get path handling to treat DenseAppendOnlyFixedSizeTree equivalently to BulkAppendTree, implementing comprehensive soundness and completeness verification checks across multiple lower-layer proof types (MMR, BulkAppendTree, DenseTree), and adding corresponding regression and V1 proof tests. Changes
Sequence DiagramsequenceDiagram
participant Client as Client/Caller
participant Verify as Verification Logic
participant SubQuery as Sub-Query Derivation
participant Check as Soundness/Completeness Check
participant Layer as Lower-Layer Proof
participant Result as Result Set
Client->>Verify: Verify proof with query items
Verify->>SubQuery: Derive sub-query items for path
SubQuery->>SubQuery: Expand items to position set
SubQuery-->>Check: Return expected positions
Verify->>Layer: Extract proven indices/positions
Layer-->>Check: Return proven positions
Check->>Check: Validate completeness<br/>(all expected present?)
Check->>Check: Validate soundness<br/>(no unrequested items?)
alt Validation passes
Check->>Result: Filter results by query match
Result-->>Client: Return verified results
else Validation fails
Check-->>Client: Return error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
check_subtree_existsmatch arm, fixingis_empty_treeand other APIs that rely on this check for dense tree subtree pathss + 1replaced withs.saturating_add(1)to prevent panic whens == u64::MAXTest plan
test_bulk_append_tree_v1_proof_disjoint_query_succinctness,test_dense_tree_v1_proof_disjoint_query_succinctness,test_mmr_tree_v1_proof_disjoint_query_succinctnesstest_is_empty_tree_dense_tree_subtree🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests