Repository navigation
fix(proof): prove a path through an empty provable tree at every grove version - #1011
Conversation
…e version #1010 gated its prover change behind proof.empty_tree_above_aggregate_terminal so GROVE_V1..V3 kept their behaviour, but that behaviour was a failure: proving an aggregate-on-range query whose path runs through an empty provable tree above the terminal always ended in "Cannot create proof for empty tree". No proof that generated before changes, so the gate protected nothing and cost a public version field, a dispatcher, and GROVE_V3 users keeping the failure. prove_subqueries_v1 now descends into an empty aggregate tree only when it is the aggregate terminal, at every grove version that proves aggregate queries (GROVE_V3 and later; GROVE_V1 and V2 use the untouched V0 prover). The slot, its values in GROVE_V1..V4 and the dispatcher are removed; the tests run under GROVE_V3 and GROVE_V4; the changelog entry and the book paragraph drop the version. The slot was never released, so nothing breaks relative to the last release. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (9)
💤 Files with no reviewable changes (5)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughProof generation no longer uses a GroveVersion setting to decide whether to descend into empty aggregate trees. It descends only when the empty tree is the aggregate terminal. Tests cover parent-layer proofs at GROVE_V3 and GROVE_V4, and documentation removes the V4-only boundary. ChangesEmpty aggregate-tree proofs
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change makes proofs through empty aggregate trees work at GROVE_V3 and later, and it removes an unreleased version setting. No merge-blocking issue was found. Code built against develop that sets the removed slot will need to drop it. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change preserves the inspected proof-authentication controls and does not establish a new security weakness. It nevertheless changes GROVE_V3 failure behavior and removes a public configuration field; downstream integration compatibility remains unconfirmed. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 2 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
Waiting for bot review — coderabbitai ✓ · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
🕓 Review not started yet because the new head is waiting for the 30-minute push debounce.
Commit 1e3c230. Normal review starts when eligible; priority review starts as soon as a slot is available. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1011 +/- ##
===========================================
- Coverage 93.19% 93.18% -0.01%
===========================================
Files 336 336
Lines 105687 105653 -34
===========================================
- Hits 98490 98449 -41
- Misses 7197 7204 +7
🚀 New features to boost your workflow:
|
Basic explanation
#1010 fixed range totals that could not be proved when their path ran through an empty provable count or sum tree, but only from
GROVE_V4. That version gate is not needed, so this removes it: the prover now proves such a path at every grove version that proves aggregate queries (GROVE_V3and later). Nothing that already worked changes, because every proof the fix touches used to fail.Issue being fixed or feature implemented
#1010 gated its prover change behind a new slot,
proof.empty_tree_above_aggregate_terminal(0 inGROVE_V1..GROVE_V3, 1 inGROVE_V4), so that released grove versions kept their exact behaviour. That behaviour was a failure: underGROVE_V3, proving an aggregate-on-range query whose path runs through an empty provable tree above the terminal always ends in "Cannot create proof for empty tree". Gating it kept an error, not a proof anyone could rely on.The gate only protects bytes no caller has, and it costs a public field in
GroveDBOperationsProofVersions, a v0/v1 dispatcher, andGROVE_V3users (Dash Platform's shipped protocol versions) keeping the failure.Before (
GROVE_V3, path[.., "widget", "brand", "acme", "color"],brandan emptyProvableCountTree):After (
GROVE_V3andGROVE_V4alike):What was done?
prove_subqueries_v1decides directly whether to descend into an empty aggregate tree: only when it is the aggregate terminal (validated.aggregate_at_depth(path.len() + 1)), asGROVE_V4did. Thedescends_into_empty_aggregate_treedispatcher and its_v0/_v1are removed.GroveDBOperationsProofVersions::empty_tree_above_aggregate_terminalis removed, with its value inGROVE_V1..GROVE_V4and its notes ingrovedb_versions.rsandv4.rs.GROVE_V1andGROVE_V2use the V0 prover, which this does not touch.an_empty_aggregate_terminal_is_proved_identically_under_grove_v3_and_v4). Verifiers are unchanged.How Has This Been Tested?
grovedb/src/tests/aggregate_through_empty_tree_tests.rs, over every empty provable tree type with each aggregate it serves:proves_a_leaf_aggregate_through_an_empty_aggregate_tree,proves_a_carrier_aggregate_whose_path_ends_in_an_empty_aggregate_treeandproves_a_carrier_key_that_is_an_empty_aggregate_tree_above_the_terminalnow run underGROVE_V3andGROVE_V4: the proof generates with no lower layer under the empty tree, equals the single-key query's proof, verifies withverify_queryto the real root, and the aggregate verifiers' refusal is pinned.an_empty_aggregate_terminal_is_proved_identically_under_grove_v3_and_v4anda_populated_tree_cannot_be_passed_off_as_the_empty_tree_on_the_pathare unchanged.GROVE_V3refusal test and the unknown-slot-version test are removed with the slot.proves_*tests fail.cargo test -p grovedb -p grovedb-version,cargo clippy -p grovedb -p grovedb-version --all-targets -- -D warningsandcargo fmt --all -- --checkpass.Breaking Changes
None relative to the last release:
empty_tree_above_aggregate_terminalwas added by #1010 and has not been released. Code built againstdevelopsince #1010 that sets the field by hand must drop it. UnderGROVE_V3, queries that failed to prove now produce a proof; no proof that generated before changes.Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
1e3c230/skip-botsproceeds without the ones not yet reported/self-reviewedWhen every box is checked the
PR Hygienecheck passes and this can merge.Summary by CodeRabbit