Uh oh!
There was an error while loading. Please reload this page.
refactor(drive)!: route ranked and having-range proofs through grovedb's unified PathQuery surface - #4488
Conversation
…b's unified PathQuery surface grovedb is retiring the standalone indexed-axis provers/verifiers from its public API (dashpay/grovedb#839) so the standalone envelope wire format never becomes consensus-frozen — the unified PathQuery surface (prove_query / verify_path_query over new_axis_top_k / new_axis_bounded) is the only public proof surface for indexed-axis reads. This switches the four remaining direct call sites: - execute_top_k_with_proof: prove_indexed_axis_top_k_paginated → prove_query(PathQuery::new_axis_top_k) - verify_ranked_top_k_proof/v0: verify_indexed_axis_top_k_paginated → verify_path_query, destructuring VerifiedPathQuery::AxisEntries - execute_range_with_proof: prove_indexed_{count,sum,avg}_query → prove_query(PathQuery::new_axis_bounded) - verify_having_range_proof/v0: verify_indexed_{count,sum,avg}_query → verify_path_query Wire format changes (standalone envelopes → GroveDBProof V1 with an axis descent); both surfaces are unreleased and prover+verifier switch together in this commit. The semantic core of the proofs is byte-identical between the two envelopes (pinned by grovedb's envelope_byte_equality_tests, dashpay/grovedb#837). Consequences pinned by updated tests: - AxisRangeBounds::merk_query is retired: grovedb's shared bounded-axis lowering is now the prover/verifier agreement artifact on both sides (AxisRangeBounds::i128_bounds feeds it losslessly), so the two repos can no longer drift on the bounds-to-keyspace translation. - Having-range over a completely empty secondary now PROVES instead of erroring (the unified prover carries the empty-secondary convention the ranked paginated prover already had); an_empty_match_set_reads_empty_and_proves_empty flipped to the round-trip its comment promised, and drive-abci's empty_ranking_proof_rejection remains as a backstop. - The unified verifier is query-as-input rather than echo-checked: a proof verifies under any query whose answer it correctly attests, so the limit-tamper arm of a_proof_does_not_verify_under_different_bounds now pins that the same bytes verify under an answer-equivalent limit (to the correct answer) while answer-changing tampers (bounds, direction) still fail closed. - prove_query proves committed state and takes no transaction; the executors keep their TransactionArg for signature stability (the query dispatch passes None on this surface). Tests: drive ranked (72) + having (38) + drive-abci document_query (108) + dash-platform-queries (37) all pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
ℹ️ Review skipped (commit a2faef1) |
…ath_query; bump grovedb to 6b34ea81
grovedb is also retiring the per-axis trusted-read wrappers
(indexed_*_top_k_paginated_keys, indexed_*_range_keys, ...) to
crate-internal engine status: run_path_query over the same axis
PathQuery is the only public read surface, so one request shape serves
reads (run_path_query), proving (prove_query) and verification
(verify_path_query).
- execute_top_k_no_proof: indexed_*_top_k_paginated_keys →
run_path_query(PathQuery::new_axis(AxisQuery::top_k(..).keys_only()))
destructuring PathQueryRun::AxisKeys { keys, skipped }
- execute_range_no_proof: indexed_*_range_keys →
run_path_query(PathQuery::new_axis(AxisQuery::bounded(..).keys_only()))
- test helpers in ranked_index_e2e_tests and ranked_group_drain moved
off the retired wrappers onto the same route
The keys-only projection preserves the old wrappers' read cost: the
ranking pairs come straight off the pinned secondary view, no primary
values resolved.
Requires the attested-skip field on PathQueryRun's axis variants
(grovedb #836), so the grovedb pin moves 753a11f1 → 6b34ea81 (current
grovedb develop; merged commits only). rs-drive gains a direct
grovedb-query dependency at the same rev for the AxisQuery builder
(grovedb re-exports it at the root only after dashpay/grovedb#839).
Fallout from the bump: grovedb #833 made transaction
commit/rollback/savepoint return grovedb_storage::Error directly, so
drive-abci's three RocksDBError(e) re-wraps become StorageError(e).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>grovedb #839 (squashed as 6c882c3e) retires the standalone indexed-axis provers/verifiers, leaving PathQuery as the only public proof surface. This PR already routes everything through PathQuery, so the bump is a pin move from develop~1 (6b34ea81) with no platform code changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
The unified-PathQuery grovedb pin (#4488) changed rollback_to_savepoint()'s error type so the RocksDBError wrap went away, leaving |e| StorageError(e) closures that clippy 1.92 rejects as redundant_closure under CI's -D warnings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
What
Switches the four remaining direct indexed-axis call sites onto grovedb's unified
PathQuerysurface —prove_query/verify_path_queryoverPathQuery::new_axis_top_k/new_axis_bounded:execute_top_k_with_proofprove_indexed_axis_top_k_paginatedprove_query(new_axis_top_k)verify_ranked_top_k_proof/v0verify_indexed_axis_top_k_paginatedverify_path_query→VerifiedPathQuery::AxisEntriesexecute_range_with_proofprove_indexed_{count,sum,avg}_queryprove_query(new_axis_bounded)verify_having_range_proof/v0verify_indexed_{count,sum,avg}_queryverify_path_query→VerifiedPathQuery::AxisEntriesWhy
grovedb is retiring the standalone indexed-axis provers/verifiers from its public API (dashpay/grovedb#839) so their standalone envelope wire format never becomes consensus-frozen — only the GroveDBProof V1 axis-descent format ships with GROVE_V4. This PR is the platform half of that retirement; grovedb pinned the byte-level relationship between the two envelope families first (dashpay/grovedb#837: the semantic core — secondary proof bytes, target chains, root bindings — is byte-identical; only the outer envelope differs), so this is a proven envelope swap, not a behavioral leap.
The change compiles against the current grovedb pin (the unified surface already exists there), so this PR does not require a grovedb bump — but the next grovedb bump past dashpay/grovedb#839 requires this PR.
Wire format changes (unreleased surface)
The proof bytes for ranked/having responses change from the standalone envelopes to
GroveDBProof::V1. Both surfaces exist only on this feature branch (#3740, unreleased), and prover + verifier switch together in this commit.Behavioral deltas, pinned by updated tests
AxisRangeBounds::merk_queryis retired. The prover/verifier agreement artifact is now grovedb's own bounded-axis lowering, shared by both proof sides inside grovedb; platform feeds itAxisRangeBounds::i128_bounds(lossless widening). The two repos can no longer drift on the bounds→keyspace translation.an_empty_match_set_reads_empty_and_proves_emptyflipped to the round-trip its own comment promised; drive-abci'sempty_ranking_proof_rejectionstays as the backstop it was already documented to be.a_proof_does_not_verify_under_different_boundsnow pins that the same bytes verify under an answer-equivalent limit — to that query's own correct answer, capped by the verifier's ≤-limit shape check.prove_queryproves committed state (no transaction parameter). The executors keep theirTransactionArgfor signature stability; the query dispatch passesNoneon this surface anyway.Trusted-read call sites (
indexed_*_top_k_paginated_keys,indexed_*_range_keys) are untouched — grovedb's trusted-read surface remains public.Trusted reads (second commit)
The no-proof executors and the platform tests calling grovedb trusted reads directly now also route through the unified surface — grovedb is retiring those wrappers to crate-internal engine status (second commit on dashpay/grovedb#839):
execute_top_k_no_proof:indexed_*_top_k_paginated_keys→run_path_query(PathQuery::new_axis(AxisQuery::top_k(..).keys_only())), destructuringPathQueryRun::AxisKeys { keys, skipped }.execute_range_no_proof:indexed_*_range_keys→ the bounded equivalent.This needs the attested-skip field on
PathQueryRun(grovedb #836), so the grovedb pin moves 753a11f1 → 6b34ea81 (current grovedb develop, merged commits only), and rs-drive gains a directgrovedb-querydep at the same rev for theAxisQuerybuilder. Bump fallout: grovedb #833 made transaction commit/rollback/savepoint returngrovedb_storage::Errordirectly, so drive-abci's threeRocksDBError(e)re-wraps becomeStorageError(e).Tests
driveranked: 72 passed (incl. prove+verify round trips, empty-index proving, tamper rejection)drivehaving: 38 passeddrive-abcidocument_query: 108 passeddash-platform-queries: 37 passeddrivebuilds clean underserver,verifyandverify-only feature cuts🤖 Generated with Claude Code