Repository navigation
fix(drive): bump grovedb so a ranking over an unwritten pinned prefix proves an empty page - #4753
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (14)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe query system now treats never-written pinned prefixes as authenticated empty pages at ChangesAuthenticated empty pinned pages
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant QueryExecutor
participant branched_envelope
participant read_branched_union
participant GroveDb
participant verify_branched_union
QueryExecutor->>branched_envelope: Build pinned branch envelope
QueryExecutor->>read_branched_union: Execute branched PathQuery
read_branched_union->>GroveDb: Read branch entries
GroveDb-->>read_branched_union: Return entries or authenticated absence
QueryExecutor->>verify_branched_union: Verify proof envelope
verify_branched_union->>GroveDb: Verify PathQuery
GroveDb-->>verify_branched_union: Return verified branches and root hash
Merge Risk: ⚪ Minimal · up to The alleged multi-null query failure is not supported by GroveDB’s path semantics, so no concrete merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
|
🕓 Queued for automated review — 24th in line, estimated start in ~2.7 h (commit ab3caab)
|
|
📖 Book Preview built successfully. Download the preview from the workflow artifacts. Updated at 2026-09-14T22:50:27.519Z |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## v4.2-dev #4753 +/- ##
============================================
- Coverage 87.32% 79.64% -7.69%
============================================
Files 2827 2827
Lines 371564 400800 +29236
============================================
- Hits 324476 319222 -5254
- Misses 47088 81578 +34490
🚀 New features to boost your workflow:
|
9a0a406 to
32f68b1
Compare
… proves an empty page
A ranked (top-K) or having-range query pinned to a prefix value tree no
document has written yet failed on both the unproved read and the prover.
The reported case is a windowed leaderboard: `IN_TIME_RANGE newest` on a
`range == step` grid resolves to the current bucket's start, and that
bucket's value tree only comes into existence with the first document
written under it (contract registration creates only the level trees, and
TTL drops buckets again), so until the day's first like the single-path
axis read had no indexed tree to descend into. GroveDB refused to generate
the proof ("a single-path axis read must produce exactly one axis descent
... the path does not name an indexed tree carrying that axis") and every
such request surfaced to clients as an internal error. The same failure
hit any `==` pin on a never-written value (a hashtag nobody has used) on
both surfaces.
The refusal was GroveDB's: key selection and the branched axis shape
already answered an absent path with an authenticated empty result, and
the single-path axis read was the one provable shape that did not.
dashpay/grovedb#965 fixes it there, so this bumps the pin to its merge on
develop (6816457d -> a579d52f, which also carries the 6.0.1 crate
versions): the reader, the prover and the verifier now all answer an
absent path with the traversal's empty page, absence authenticated by the
layers the walk emits. Drive's query shapes are unchanged; only the
executor docs and the book describe the new semantics. Because the
single-path shape keeps its skip attestation, this also covers
`OFFSET > 0` over an unwritten prefix.
The GroveDB git pins now live once in `[workspace.dependencies]`, like the
rust-dashcore ones, and the six consuming crates take them with
`workspace = true` (keeping their own `optional` and `features`;
`default-features = false` for `grovedb` moves to the workspace
declaration, where Cargo actually honours it). The next bump is one line.
Tests: ranked and having pinned-prefix tests for a never-written `==` pin
(read, prove, verify against the live root hash, including an offset page
that verifies empty at skip 0); a time-range e2e test for an unwritten
window that later fills; and an ABCI entry-point test verifying an empty
window through the SDK. The having test that pinned the old "error rather
than empty page" rule is flipped.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
32f68b1 to
ab3caab
Compare
Issue being fixed or feature implemented
A ranked (top-K) or having-range document query pinned to a prefix value tree that no document has written yet failed on both the unproved read and the prover, and reached clients as an internal error. The reported case is the Yappr windowed leaderboard on moutai:
{ "documentTypeName": "like", "groupBy": "postId", "aggregate": { "type": "count" }, "direction": "desc", "limit": 20, "timeRange": [{ "field": "$createdAt", "selector": "newest", "grid": { "range": 86400, "step": 86400 } }] }IN_TIME_RANGE neweston arange == stepgrid resolves to the current bucket's start, so the query descends.../like/$createdAt#86400#86400/<bucket start>/postId. That bucket's value tree only comes into existence with the first document written under it (contract registration creates the level tree only, and TTL drops buckets again), so until the day's first like there was no indexed tree at the path. The same failure hit any==pin on a never-written value (a hashtag nobody has used) on both the ranked and the having-range surface.The refusal was GroveDB's. Key selection and the branched axis shape already answer an absent path with an authenticated empty result; the single-path axis read was the one provable shape that did not (its prover refused to generate, its reader failed with a storage error). That is fixed by dashpay/grovedb#965 (merged), and this PR takes it.
What was done?
6816457dtoa579d52f, the merge of fix: answer a single-path axis read over an absent path with the empty result grovedb#965 ondevelop. The delta also carries GroveDB's 6.0.1 crate version bump and CI chores; nothing else.[workspace.dependencies], like the rust-dashcore ones, and the six consuming crates take them withworkspace = truewhile keeping their ownoptionalandfeatures.default-features = falseforgrovedbmoves to the workspace declaration, where Cargo actually honours it (a crate-level setting on a workspace dependency is ignored). The next bump is a one-line change; the lock file resolves identically.skipped: 0), the absence authenticated by the layers the proof walk emits. Drive's query shapes are unchanged, so theOFFSET > 0page over an unwritten prefix is covered too (the single-path shape keeps its skip attestation). A path that exists but does not lead to an indexed tree is still an error.execute_top_k.rs,execute_range.rs) and the book (document-ranked-trees.md,time-range-ttl.md) describe the new absence rule.An earlier revision of this PR worked around the refusal on the Drive side by serving single-branch pinned reads through GroveDB's branched envelope with one key; that is gone in favour of the GroveDB fix.
How Has This Been Tested?
New tests:
pinned_prefix::an_absent_equality_pin_reads_empty_and_proves_empty: a never-written==pin reads empty, proves empty and verifies against the live root hash; a written prefix still returns its entry with noin_key; an offset page over the unwritten prefix reads and verifies empty at skip 0.pinned_prefix::unknown_prefix_value_reads_empty_and_proves_empty(flipped from the test that pinned the old "error rather than empty page" rule).time_range_index_e2e_tests::an_unwritten_window_ranks_empty_and_proves_it: a ranked windowed index whose current window holds no documents ranks empty with a verified proof, reads under a caller transaction, and serves the leaderboard once a document lands in the window.an_unwritten_window_ranks_empty_through_the_entry_point: aBY_STARTwindow no post falls into verifies as an empty page at rank 0 through the SDK entry point.Ran against the merged pin:
cargo test -p drive --lib -- drive_document_ranked_query drive_document_having_query time_range_index_e2e_tests(135 passed),cargo test -p drive-abci --lib -- ranked having time_range(57 passed),cargo clippy -p drive --all-targets -- -D warnings,cargo check -p drive --no-default-features --features verify,cargo checkof the five other crates that consume GroveDB through the workspace (Cargo.lockunchanged by the move,grovedbdefault features confirmed off viacargo tree -e features),cargo fmt --check --all. With the previous pin the three new Drive tests fail with the reported errors.Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code