Skip to content

fix(version)!: gate the store range reads, proofs and creation estimates on GROVE_V5, not V4 - #1029

Merged
QuantumExplorer merged 1 commit into
developfrom
claude/grove-v5-store-gates
Nov 5, 2026
Merged

QuantumExplorer merged 1 commit into
developfrom
claude/grove-v5-store-gates

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Basic explanation

What this does: Two recent changes, #1026 and #1027, switched on inside GROVE_V4 after GroveDB 6.1.1 shipped it. This moves both to the new GROVE_V5, so V4 behaves again as 6.1.1 shipped it. #1027 lets a private document store's entries be read and proved by position. #1026 makes cost estimates charge correctly for creating a store.

Value: Dash Platform 5.0 runs GROVE_V4 (protocol version 14). Any node must get the same answer as every other node at a given version, so V4 cannot change after release. With this, a node built from develop and one built from 6.1.1 agree on everything V4 does. The new features stay available from V5.

Risks: Medium for Platform, low for GroveDB. Platform's protocol version 15 currently selects GROVE_V4, and its private document reads use #1027's store proofs. Platform has to select GROVE_V5 for protocol version 15 when it bumps GroveDB past this, or those reads stop working (they fail closed: a clear error, never a wrong answer). Inside GroveDB nothing changes at V5, and V1..V3 are untouched.

Issue being fixed or feature implemented

Follows #1028, which added GROVE_V5 identical to GROVE_V4.

Dash Platform v5.0.0 pins GroveDB 2128ea18 (6.1.1), and protocol version 14 selects GROVE_V4. Since then:

Both changed what GROVE_V4 does after it shipped.

What was done?

Store range reads and proofs (#1027): get_range and range_proof are 0 in GROVE_V4 and 1 in GROVE_V5. At slot 0, the code #1027 added already refuses everything 6.1.1 refused, with the same error variants:

// A V1 proof whose subquery descends into a store.
db.prove_query(&store_subquery, None, &GROVE_V4)
// 6.1.1:                  Err(NotSupported("V1 proofs do not yet support subqueries into PrivateDocumentStore elements"))
// develop before this PR: Ok(proof)
// after this PR:          Err(NotSupported("V1 proofs do not support subqueries into PrivateDocumentStore elements at this grove version"))
db.prove_query(&store_subquery, None, &GROVE_V5) // Ok(proof)

db.private_document_store_get_range(&[b"root"], b"docs", 0, 5, None, &GROVE_V4)
// 6.1.1: no such method. develop before this PR: Ok(entries). After: Err(VersionError(..))

The verifier side matches: at V4 a store's lower layer is refused with NotSupported, as 6.1.1 refused it. #1027's hardening that refuses a mistyped lower layer under a store or a commitment tree at every version is kept.

Store creation estimates (#1026): the v1 estimators are restored byte for byte to 6.1.1 (git diff 2128ea18 on both files is empty). The store pricing is a new v2, selected by average_case_merk_insert_element: 1 and worst_case_merk_insert_element: 1 in GROVE_V5 (both 0 everywhere else, and the dispatchers refused anything but 0 until now).

insert a PrivateDocumentStore, average case, at:  GROVE_V4             GROVE_V5
  seeks                                            n                    n + 1
  hash calls                                       h                    h + 2
insert a plain tree                                same at both versions

Docs: the two in-place entries in v4.rs move to v5.rs, which now lists its four flipped slots. The CHANGELOG's two entries now say V5.

How Has This Been Tested?

New tests:

  • test_private_document_store_subquery_proofs_refused_at_grove_v4: at GROVE_V4, proving or verifying into a store, prove_bulk_position_range on a store and the range read all fail as above. This was feat(private-document-store)!: read and prove a store's entries by position range (GROVE_V4) #1027's "without the slot" test on a hand-made version; it now uses GROVE_V4 itself.
  • test_private_document_store_creation_estimate_is_gated_to_grove_v5: a store's creation at V5 is estimated one seek and two hashes above V4 (average) and at least that in the worst case; a plain tree is estimated the same at both.
  • grovedb-version: private_document_store_range_slots_are_gated_to_v5, store_creation_estimates_are_gated_to_v5, and v5_matches_v4_apart_from_its_gates, which now lists the four V5 slots.

Runs:

  • cargo test -p grovedb-version: 59 passed.
  • cargo test -p grovedb --all-features --lib filtered to private_document_store, append_family_cost_bound, estimated_costs, proof, and the modules that loop over every version: 1249 passed.
  • cargo clippy -p grovedb -p grovedb-version --all-features --all-targets -- -D warnings: clean. cargo build --no-default-features --features verify -p grovedb: builds.

The full workspace suite is left to CI.

Breaking Changes

Consensus-relevant for anyone on develop since #1026/#1027: GROVE_V4 no longer reads or proves a store's range and keeps the 6.1.1 store creation estimates. Use GROVE_V5 for both. No public type changes.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · 909f4e6

  • Bots — coderabbitai not yet · thepastaclaw not yet — /skip-bots proceeds without the ones not yet reported
  • Self-review — post /self-reviewed
  • Build running
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

…tes on GROVE_V5, not V4

GroveDB 6.1.1 shipped GROVE_V4, and Dash Platform 5.0 runs it. #1027
(a store's position-range read and V1 range proofs) and #1026 (the insert
estimators pricing a store's creation as the apply does) landed after
6.1.1 and changed V4 in place. They move to GROVE_V5:

- private_document_store.get_range and range_proof are 0 in GROVE_V4, as
  6.1.1 had no such read or proof, and 1 in GROVE_V5. At V4 the range read
  fails closed and a V1 proof neither carries nor accepts a lower layer
  under a store, as 6.1.1 refused them.
- The average- and worst-case merk_insert_element v1 estimators are back to
  their 6.1.1 bytes. The store pricing is v2, selected by the new values
  average_case_merk_insert_element: 1 and worst_case_merk_insert_element: 1
  in GROVE_V5. Average v2 runs v1 and adds the existence check and the
  empty root's two hashes; worst v2 prices a store as a layered tree with
  those charges and hands every other element to v1.

Verifier hardening from #1027 that refuses a mistyped lower layer at every
version stays as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2316d799-21fe-4ad1-8160-05ca96ca0acf
Commits

Reviewing files that changed from the base of the PR and between d062b7c and 909f4e6.

Files selected for processing: 12

  • CHANGELOG.md
  • grovedb-version/src/tests.rs
  • grovedb-version/src/version/v4.rs
  • grovedb-version/src/version/v5.rs
  • grovedb/src/estimated_costs/average_case_costs/merk_insert_element/mod.rs
  • grovedb/src/estimated_costs/average_case_costs/merk_insert_element/v1.rs
  • grovedb/src/estimated_costs/average_case_costs/merk_insert_element/v2.rs
  • grovedb/src/estimated_costs/worst_case_costs/merk_insert_element/mod.rs
  • grovedb/src/estimated_costs/worst_case_costs/merk_insert_element/v1.rs
  • grovedb/src/estimated_costs/worst_case_costs/merk_insert_element/v2.rs
  • grovedb/src/tests/append_family_cost_bound_tests.rs
  • grovedb/src/tests/private_document_store_tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Waiting for bot review — coderabbitai not yet · thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 5, 2026
@QuantumExplorer
QuantumExplorer merged commit 2019675 into develop Nov 5, 2026
10 of 11 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/grove-v5-store-gates branch November 5, 2026 09:59
@thepastaclaw

Copy link
Copy Markdown
Contributor

🕓 Review not started yet because the new head is waiting for the 30-minute push debounce.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 909f4e6. Normal review starts when eligible; priority review starts as soon as a slot is available.

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.84615% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.23%. Comparing base (d062b7c) to head (909f4e6).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...osts/average_case_costs/merk_insert_element/mod.rs 57.14% 9 Missing ⚠️
..._costs/worst_case_costs/merk_insert_element/mod.rs 57.14% 9 Missing ⚠️
...d_costs/worst_case_costs/merk_insert_element/v2.rs 87.87% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1029      +/-   ##
===========================================
- Coverage    93.24%   93.23%   -0.01%     
===========================================
  Files          356      358       +2     
  Lines       109298   109370      +72     
===========================================
+ Hits        101912   101974      +62     
- Misses        7386     7396      +10     
Components Coverage Δ
grovedb-core 91.61% <78.84%> (-0.01%) ⬇️
merk 94.18% <ø> (ø)
storage 91.68% <ø> (ø)
commitment-tree 95.62% <ø> (ø)
mmr 95.24% <ø> (ø)
bulk-append-tree 94.48% <ø> (ø)
element 97.39% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

QuantumExplorer added a commit that referenced this pull request Nov 5, 2026
Brings in #1029, which moved the store range reads, range proofs and
store creation estimates from GROVE_V4 to GROVE_V5. v5.rs now flips both
sets of slots; v5_matches_v4_apart_from_its_gates resets all seven, so
local_offsets_only_change_the_v5_query_slots keeps only its own slot
values. CHANGELOG keeps both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QuantumExplorer added a commit to dashpay/platform that referenced this pull request Nov 7, 2026
… at protocol version 15

GroveDB 12adbd35 brings GROVE_V5 (dashpay/grovedb#1028), moves the
store range reads, proofs and creation estimates from GROVE_V4 to it
(dashpay/grovedb#1029), and lets a batch carry the same keyless append
more than once under it (dashpay/grovedb#1032).

DRIVE_VERSION_V10, which only protocol version 15 selects, now runs
GROVE_V5 (note 26 of v15.rs). Protocol version 14 keeps GROVE_V4, which
the bump leaves as GroveDB 6.1.1 shipped it.

QualifiedGroveDbOp::verify_consistency_of_operations now takes the
GroveDB version and returns a Result. Drive's two batch appliers and
GroveDbOpBatch::verify_consistency_of_operations pass the drive
version's; GROVE_V1 to GROVE_V4 count every operation for repeats, so
the check refuses what it did through protocol version 14.

A Drive test appends two identical entries in one batch. The duplicate
entry error's doc no longer gives GroveDB's refusal as its reason: basic
structure keeps refusing identical entries, as copies a recipient drops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-bots Waiting for the review bots to report on this head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants