Repository navigation
docs(bulk-append): explain why completed-chunk-length check isn't needed - #740
Conversation
Document at the verification site that the "validate completed chunk blob holds exactly chunk_item_count entries" check (issue #688) is intentionally omitted because completed chunk content is already bound to the state root via leaf_hash -> mmr_root -> state_root, and every caller compares the computed root against a trusted value. Prevents future (AI) audits from re-flagging it. Closes the need for PR #729. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #740 +/- ##
========================================
Coverage 91.43% 91.43%
========================================
Files 236 236
Lines 67111 67111
========================================
Hits 61364 61364
Misses 5747 5747
🚀 New features to boost your workflow:
|
Summary
Replaces #729. Instead of adding a runtime check (and version flag) to validate that completed bulk-append chunk blobs hold exactly
chunk_item_countentries, this adds a code comment at the verification site explaining why that check is not needed, so future audits (human or AI) don't re-flag it.Why the check (issue #688) is redundant
A completed chunk's contents are fully bound to the state root: the MMR recomputes
leaf_hash(blob)from the blob bytes →mmr_root→compute_state_root. A short/truncated/tampered chunk blob therefore produces a different computed root. Every caller binds that root to a trusted value:verify/verify_against_querycompare the computed root againstexpected_state_root;So a bad blob is rejected by the root comparison, never reaching a length check. The existing test
test_verify_and_compute_root_rejects_corrupted_chunk_leafalready demonstrates that internally-consistent-but-wrong data is caught by the root comparison.Contrast with the adjacent
dense_count == 0empty-buffer check, which is required: unused buffer data is not hashed into the root (unbound, smuggle-able). Completed chunk bytes are bound, so they cannot be.The only scenario a length check would help is a caller that trusts
total_countbut verifies against an attacker-chosen root — outside the trust model. (BulkAppendTree/CommitmentTree are also unreleased, so there is no live exposure regardless.)Changes
grovedb-bulk-append-tree/src/proof/mod.rs(verify_and_compute_root). No behavior change.🤖 Generated with Claude Code