Skip to content

chore: bump grovedb to develop (352c2f55)#3656

Open
QuantumExplorer wants to merge 5 commits into
v3.1-devfrom
claude/hopeful-allen-c6b170
Open

chore: bump grovedb to develop (352c2f55)#3656
QuantumExplorer wants to merge 5 commits into
v3.1-devfrom
claude/hopeful-allen-c6b170

Conversation

@QuantumExplorer
Copy link
Copy Markdown
Member

@QuantumExplorer QuantumExplorer commented May 17, 2026

Issue being fixed or feature implemented

Brings the grovedb dependency up to the latest develop (352c2f5504fba8795e8ed1056753bfd73c13b4cc) so we can pick up the new sum-tree work and related element/op surface that has landed upstream.

HEAD of grovedb develop is 4 commits ahead of our previous pin 7a649386:

  • grovedb#666feat(grovedb,merk,element): add Element::NotCountedOrSummed wrapper for combined sum+count opt-out
  • grovedb#667feat(grovedb,element): add Element::ReferenceWithSumItem variant + RefreshReferenceWithSumItem batch op
  • grovedb#668ci: drop broken self-hosted macOS runner, run sharded on Ubuntu directly (no platform impact)
  • grovedb#661feat: add Element::ProvableSumTree + AggregateSumOnRange query

What was done?

Dependency bump

Updated the rev for every grovedb-family git dep in the six platform Cargo.tomls (rs-drive, rs-drive-abci, rs-sdk, rs-dpp, rs-platform-version, rs-platform-wallet) and refreshed Cargo.lock for all 15 grovedb sub-crates.

API-surface adaptations

The bump exposed three breaking API changes that needed thin call-site fixes:

  1. QualifiedGroveDbOp::refresh_reference_op gained a non_counted: bool argument (from grovedb#667).
    rs-drive's wrapper LowLevelDriveOperation::refresh_reference_for_known_path_key_reference_info (packages/rs-drive/src/fees/op.rs) now passes false for the new flag. Drive's refresh path only ever produces plain (counted) references — the new ReferenceWithSumItem / non-counted shapes aren't used by platform yet — so hard-coding false preserves prior behavior exactly.

  2. TreeType::ProvableSumTree variant added (from grovedb#661).
    Two exhaustive matches needed a new arm: LowLevelDriveOperationTreeTypeConverter::empty_tree_operation_for_known_path_key (packages/rs-drive/src/fees/op.rs) and Drive::grove_insert_empty_tree_v0 (packages/rs-drive/src/util/grove_operations/grove_insert_empty_tree/v0/mod.rs). Both now route to Element::empty_provable_sum_tree[_with_flags](), mirroring the existing ProvableCountTree arms.

  3. Three new Element variants (NotCountedOrSummed, ReferenceWithSumItem, ProvableSumTree) added to format_element_data / format_element_type in packages/rs-sdk-ffi/src/system/queries/path_elements.rs, so the JSON renderer for dash_sdk_system_get_path_elements stays exhaustive.

  4. QueryItem::AggregateSumOnRange variant added (from grovedb#661) — handled in packages/wasm-drive-verify/src/state_transition/state_transition_execution_path_queries/token_transition.rs with an arm that mirrors the existing AggregateCountOnRange "unsupported in token-transition path queries" error.

How Has This Been Tested?

  • cargo check --workspace --all-features — clean.
  • cargo clippy -p drive -p wasm-drive-verify -p rs-sdk-ffi --all-features --no-deps — clean.
  • cargo test -p drive --lib util::grove_operations::grove_insert_empty_tree — 5 tests pass (covers NormalTree, SumTree, BigSumTree, CountTree, CountSumTree insert paths whose code lives next to the new ProvableSumTree arm).
  • cargo fmt --all applied.

Breaking Changes

None for platform consumers. The grovedb on-disk encoding for variants that existed in the previous pin is unchanged (the new variants NotCountedOrSummed=17, ReferenceWithSumItem=18, ProvableSumTree=19 were appended). Drive's public refresh_reference_for_known_path_key_reference_info wrapper keeps the same signature.

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 added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for sum tree operations in data structure handling.
  • Improvements

    • Enhanced validation to prevent unsupported aggregation operations in token transition queries.
    • Updated JSON output formatting for path element query responses.
  • Chores

    • Updated underlying dependencies to latest stable versions for improved stability and performance.

Review Change Stack

Brings in 4 commits from grovedb develop on top of 7a649386:

- #666 Element::NotCountedOrSummed wrapper for combined sum+count opt-out
- #667 Element::ReferenceWithSumItem + RefreshReferenceWithSumItem batch op
- #668 CI shard cleanup (no platform impact)
- #661 Element::ProvableSumTree + AggregateSumOnRange query

API-surface fallout adapted in the same commit:

- drive: thread new `non_counted: bool` arg through
  `QualifiedGroveDbOp::refresh_reference_op`. Drive's wrapper still
  produces plain (counted) references, so the new flag is hard-coded
  to `false` to preserve prior behavior — non-counted refs and the
  new `ReferenceWithSumItem` shape are not yet used by platform.
- drive: cover the new `TreeType::ProvableSumTree` variant in both
  `LowLevelDriveOperationTreeTypeConverter::empty_tree_operation_for_known_path_key`
  and `grove_insert_empty_tree_v0`, using the matching
  `Element::empty_provable_sum_tree[_with_flags]()` constructor.
- rs-sdk-ffi: extend `format_element_data` / `format_element_type`
  in `system/queries/path_elements.rs` with arms for the three new
  `Element` variants (`NotCountedOrSummed`, `ReferenceWithSumItem`,
  `ProvableSumTree`) so the JSON renderer stays exhaustive.
- wasm-drive-verify: extend the `QueryItem` match in
  `state_transition_execution_path_queries::token_transition` with
  an `AggregateSumOnRange` arm that mirrors the existing
  `AggregateCountOnRange` "unsupported in token-transition path
  queries" error, since aggregate range items aren't part of those
  path queries.

`cargo check --workspace --all-features` and
`cargo clippy -p drive -p wasm-drive-verify -p rs-sdk-ffi
--all-features --no-deps` are clean. The existing
`grove_insert_empty_tree` unit tests in rs-drive still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@QuantumExplorer QuantumExplorer requested a review from shumkov as a code owner May 17, 2026 03:21
@github-actions github-actions Bot added this to the v3.1.0 milestone May 17, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

Warning

Rate limit exceeded

@QuantumExplorer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bd8e5d69-e529-487b-b903-4efedab34360

📥 Commits

Reviewing files that changed from the base of the PR and between 322f210 and 98ac92e.

📒 Files selected for processing (74)
  • packages/rs-drive/src/fees/op.rs
  • packages/rs-drive/src/verify/address_funds/verify_address_funds_branch_query/v0/mod.rs
  • packages/rs-drive/src/verify/address_funds/verify_address_funds_trunk_query/v0/mod.rs
  • packages/rs-drive/src/verify/address_funds/verify_address_info/v0/mod.rs
  • packages/rs-drive/src/verify/address_funds/verify_addresses_infos/v0/mod.rs
  • packages/rs-drive/src/verify/address_funds/verify_compacted_address_balance_changes/v0/mod.rs
  • packages/rs-drive/src/verify/address_funds/verify_recent_address_balance_changes/v0/mod.rs
  • packages/rs-drive/src/verify/contract/verify_contract/v0/mod.rs
  • packages/rs-drive/src/verify/contract/verify_contract_history/v0/mod.rs
  • packages/rs-drive/src/verify/contract/verify_contract_return_serialization/v0/mod.rs
  • packages/rs-drive/src/verify/document/verify_proof_keep_serialized/v0/mod.rs
  • packages/rs-drive/src/verify/document/verify_start_at_document_in_proof/v0/mod.rs
  • packages/rs-drive/src/verify/document_count/verify_aggregate_count_proof/v0/mod.rs
  • packages/rs-drive/src/verify/document_count/verify_carrier_aggregate_count_proof/v0/mod.rs
  • packages/rs-drive/src/verify/document_count/verify_distinct_count_proof/v0/mod.rs
  • packages/rs-drive/src/verify/document_count/verify_point_lookup_count_proof/v0/mod.rs
  • packages/rs-drive/src/verify/document_count/verify_primary_key_count_tree_proof/v0/mod.rs
  • packages/rs-drive/src/verify/group/verify_action_signers/v0/mod.rs
  • packages/rs-drive/src/verify/group/verify_action_signers_total_power/v0/mod.rs
  • packages/rs-drive/src/verify/group/verify_active_action_infos/v0/mod.rs
  • packages/rs-drive/src/verify/group/verify_group_info/v0/mod.rs
  • packages/rs-drive/src/verify/group/verify_group_infos_in_contract/v0/mod.rs
  • packages/rs-drive/src/verify/grovedb_proof_compat.rs
  • packages/rs-drive/src/verify/identity/verify_full_identity_by_identity_id/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identities_contract_keys/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identity_balance_for_identity_id/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identity_balances_for_identity_ids/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identity_contract_nonce/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identity_id_by_non_unique_public_key_hash/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identity_id_by_unique_public_key_hash/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identity_ids_by_unique_public_key_hashes/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identity_keys_by_identity_id/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identity_nonce/v0/mod.rs
  • packages/rs-drive/src/verify/identity/verify_identity_revision_for_identity_id/v0/mod.rs
  • packages/rs-drive/src/verify/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_compacted_nullifier_changes/v0/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_most_recent_shielded_anchor/v0/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_nullifiers_branch_query/v0/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_nullifiers_trunk_query/v0/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_recent_nullifier_changes/v0/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_shielded_anchors/v0/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_shielded_encrypted_notes/v0/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_shielded_nullifiers/v0/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_shielded_pool_state/v0/mod.rs
  • packages/rs-drive/src/verify/single_document/verify_proof_keep_serialized/v0/mod.rs
  • packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs
  • packages/rs-drive/src/verify/system/verify_elements/v0/mod.rs
  • packages/rs-drive/src/verify/system/verify_epoch_infos/v0/mod.rs
  • packages/rs-drive/src/verify/system/verify_epoch_proposers/v0/mod.rs
  • packages/rs-drive/src/verify/system/verify_finalized_epoch_infos/v0/mod.rs
  • packages/rs-drive/src/verify/system/verify_total_credits_in_system/v0/mod.rs
  • packages/rs-drive/src/verify/system/verify_upgrade_state/v0/mod.rs
  • packages/rs-drive/src/verify/system/verify_upgrade_vote_status/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_balance_for_identity_id/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_balances_for_identity_id/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_balances_for_identity_ids/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_contract_info/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_direct_selling_price/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_direct_selling_prices/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_info_for_identity_id/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_infos_for_identity_id/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_infos_for_identity_ids/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_perpetual_distribution_last_paid_time/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_pre_programmed_distributions/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_status/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_statuses/v0/mod.rs
  • packages/rs-drive/src/verify/tokens/verify_token_total_supply_and_aggregated_identity_balance/v0/mod.rs
  • packages/rs-drive/src/verify/voting/verify_contests_proof/v0/mod.rs
  • packages/rs-drive/src/verify/voting/verify_identity_votes_given_proof/v0/mod.rs
  • packages/rs-drive/src/verify/voting/verify_masternode_vote/v0/mod.rs
  • packages/rs-drive/src/verify/voting/verify_specialized_balance/v0/mod.rs
  • packages/rs-drive/src/verify/voting/verify_vote_poll_vote_state_proof/v0/mod.rs
  • packages/rs-drive/src/verify/voting/verify_vote_poll_votes_proof/v0/mod.rs
  • packages/rs-drive/src/verify/voting/verify_vote_polls_end_date_query/v0/mod.rs
📝 Walkthrough

Walkthrough

This PR pins all grovedb-family dependencies across the platform to a new commit (352c2f...) that introduces ProvableSumTree and ReferenceWithSumItem element types. The codebase is extended to support these new variants in empty-tree operations, reference refresh logic, and SDK JSON serialization, with query-type validation added for token-transition paths.

Changes

GroveDB Dependency and ProvableSumTree Support

Layer / File(s) Summary
GroveDB dependency revisions across packages
packages/rs-dpp/Cargo.toml, packages/rs-drive-abci/Cargo.toml, packages/rs-drive/Cargo.toml, packages/rs-platform-version/Cargo.toml, packages/rs-platform-wallet/Cargo.toml, packages/rs-sdk/Cargo.toml
All grovedb and grovedb-commitment-tree git dependencies updated to the new commit hash (352c2f...) across six package manifests, including main and dev-dependencies.
ProvableSumTree element support in core operations
packages/rs-drive/src/fees/op.rs, packages/rs-drive/src/util/grove_operations/grove_insert_empty_tree/v0/mod.rs
ProvableSumTree variant handling added to empty-tree insertion (grove_insert_empty_tree_v0) and empty-tree creation in fee calculations (TreeType::empty_tree_operation_for_known_path_key); refresh-reference operation hardcoded to false for plain/countable references only.
SDK/FFI serialization for new element types
packages/rs-sdk-ffi/src/system/queries/path_elements.rs, packages/wasm-drive-verify/src/state_transition/state_transition_execution_path_queries/token_transition.rs
Path-element JSON formatters updated to serialize ReferenceWithSumItem and Provable* variants (including ProvableSumTree); wrapper types consolidated from NonCounted/NotSummed to NotCountedOrSummed; AggregateSumOnRange query type rejection added to token-transition path validation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • shumkov

Poem

🐰 A grovedb grows with types anew,
Sum trees and references in the dew,
From pins to schemas, all aligned,
The platform's elements redesigned,
Hopping forward, features shine! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the primary change: bumping grovedb dependencies to a specific commit, which aligns with the detailed PR objectives covering dependency updates across multiple Cargo.toml files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/hopeful-allen-c6b170

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@thepastaclaw
Copy link
Copy Markdown
Collaborator

thepastaclaw commented May 17, 2026

Review Gate

Commit: 98ac92e1

  • Debounce: 171m ago (need 30m)

  • CI checks: build failure: Swift SDK build / Swift SDK and Example build (warnings as errors)

  • CodeRabbit review: comment found

  • Off-peak hours: off-peak (12:12 AM PT Sunday)

  • Run review now (check to override)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/rs-drive/src/util/grove_operations/grove_insert_empty_tree/v0/mod.rs (1)

31-31: ⚡ Quick win

Add a test for the new ProvableSumTree branch.

The new match arm in Line 31 is not covered by this module’s current tests, so this mapping can regress silently.

Proposed test addition
@@
     #[test]
+    fn test_grove_insert_empty_tree_provable_sum() {
+        let drive = setup_drive(None);
+        let pv = PlatformVersion::latest();
+        let tx = drive.grove.start_transaction();
+
+        drive
+            .grove_insert_empty_tree_v0(
+                SubtreePath::empty(),
+                b"provable_sum",
+                TreeType::ProvableSumTree,
+                Some(&tx),
+                None,
+                &mut vec![],
+                &pv.drive,
+            )
+            .expect("expected to insert root tree");
+
+        let mut query_ops = vec![];
+        let element = drive
+            .grove_get_raw(
+                SubtreePath::empty(),
+                b"provable_sum",
+                DirectQueryType::StatefulDirectQuery,
+                Some(&tx),
+                &mut query_ops,
+                &pv.drive,
+            )
+            .expect("expected to get element");
+
+        assert!(
+            matches!(element, Some(Element::ProvableSumTree(..))),
+            "Expected a provable sum tree element after insert"
+        );
+    }
+
+    #[test]
     fn test_grove_insert_empty_tree_count_sum() {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/rs-drive/src/util/grove_operations/grove_insert_empty_tree/v0/mod.rs`
at line 31, Add a unit test that exercises the new TreeType::ProvableSumTree
match arm so it can't regress: call the public function in this module that
performs the match (the function containing the TreeType -> Element mapping in
grove_insert_empty_tree v0) with TreeType::ProvableSumTree and assert the
returned Element equals Element::empty_provable_sum_tree(); place the test
alongside the module's other tests (or in the module's #[cfg(test)] tests) so it
runs in CI.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@packages/rs-drive/src/util/grove_operations/grove_insert_empty_tree/v0/mod.rs`:
- Line 31: Add a unit test that exercises the new TreeType::ProvableSumTree
match arm so it can't regress: call the public function in this module that
performs the match (the function containing the TreeType -> Element mapping in
grove_insert_empty_tree v0) with TreeType::ProvableSumTree and assert the
returned Element equals Element::empty_provable_sum_tree(); place the test
alongside the module's other tests (or in the module's #[cfg(test)] tests) so it
runs in CI.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 05fb9d9d-6498-4669-b957-3108dfc6bc44

📥 Commits

Reviewing files that changed from the base of the PR and between 61bca22 and 322f210.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • packages/rs-dpp/Cargo.toml
  • packages/rs-drive-abci/Cargo.toml
  • packages/rs-drive/Cargo.toml
  • packages/rs-drive/src/fees/op.rs
  • packages/rs-drive/src/util/grove_operations/grove_insert_empty_tree/v0/mod.rs
  • packages/rs-platform-version/Cargo.toml
  • packages/rs-platform-wallet/Cargo.toml
  • packages/rs-sdk-ffi/src/system/queries/path_elements.rs
  • packages/rs-sdk/Cargo.toml
  • packages/wasm-drive-verify/src/state_transition/state_transition_execution_path_queries/token_transition.rs

Copy link
Copy Markdown
Member Author

@QuantumExplorer QuantumExplorer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed

QuantumExplorer and others added 2 commits May 17, 2026 10:36
The grovedb bump in this PR turned on a stricter proof-envelope
decoder (`decode_grovedb_proof_canonical`, introduced alongside the
ProvableSumTree / AggregateSumOnRange work in grovedb#661) that
rejects any trailing bytes after the bincode envelope. The previous
decoder silently tolerated them.

Two dash-sdk fixture-replay tests
(`test_token_pre_programmed_distributions_present` and
`test_token_pre_programmed_distributions_absent`) fail because their
recorded proof bytes carry a single legacy trailing byte that the
new decoder rejects with "data corruption error: proof has 1
trailing bytes after the encoded envelope". Regenerating those
fixtures requires a devnet run
(`yarn reset && SDK_TEST_DATA=true yarn start &&
./packages/rs-sdk/scripts/generate_test_vectors.sh
test_token_pre_programmed_distributions`), so mark both as
`#[ignore]` with a note explaining the regen step; production proofs
emitted by the bumped drive-abci will not carry the trailing byte,
so this is purely fixture rot, not a runtime regression.

Also addresses the CodeRabbit nitpick on the
`grove_insert_empty_tree_v0` match: add
`test_grove_insert_empty_tree_provable_sum` covering the new
`TreeType::ProvableSumTree` arm so the mapping cannot regress
silently. All 6 tests in the module pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same fixture rot as the dash-sdk tests already ignored in the
previous commit: the rs-sdk-ffi integration tests
`test_token_pre_programmed_distributions` and
`test_token_pre_programmed_distributions_absent` share the proof
vectors under `packages/rs-sdk/tests/vectors/`, which the new strict
`decode_grovedb_proof_canonical` rejects because of a trailing
byte. Mark both as `#[ignore]` with the same regen note.

These are the only other tests in the workspace that exercise the
`TokenPreProgrammedDistributions` query path; the remaining ~100
fixture-replay tests passed CI cleanly with the bump.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

❌ Patch coverage is 64.49864% with 131 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.03%. Comparing base (187d46c) to head (98ac92e).
⚠️ Report is 3 commits behind head on v3.1-dev.

Files with missing lines Patch % Lines
...shielded/verify_shielded_encrypted_notes/v0/mod.rs 0.00% 10 Missing ⚠️
...cument/verify_start_at_document_in_proof/v0/mod.rs 40.00% 6 Missing ⚠️
...e/src/verify/group/verify_action_signers/v0/mod.rs 40.00% 6 Missing ⚠️
.../verify/group/verify_active_action_infos/v0/mod.rs 40.00% 6 Missing ⚠️
...ify/group/verify_group_infos_in_contract/v0/mod.rs 40.00% 6 Missing ⚠️
...dentity_id_by_non_unique_public_key_hash/v0/mod.rs 40.00% 6 Missing ⚠️
...tity/verify_identity_keys_by_identity_id/v0/mod.rs 40.00% 6 Missing ⚠️
...elded/verify_most_recent_shielded_anchor/v0/mod.rs 40.00% 6 Missing ⚠️
...shielded/verify_recent_nullifier_changes/v0/mod.rs 40.00% 6 Missing ⚠️
.../verify/shielded/verify_shielded_anchors/v0/mod.rs 40.00% 6 Missing ⚠️
... and 45 more
Additional details and impacted files
@@             Coverage Diff              @@
##           v3.1-dev    #3656      +/-   ##
============================================
- Coverage     88.07%   88.03%   -0.05%     
============================================
  Files          2521     2522       +1     
  Lines        308681   308993     +312     
============================================
+ Hits         271879   272026     +147     
- Misses        36802    36967     +165     
Components Coverage Δ
dpp 88.01% <ø> (ø)
drive 86.98% <64.49%> (-0.10%) ⬇️
drive-abci 90.05% <ø> (ø)
sdk ∅ <ø> (∅)
dapi-client ∅ <ø> (∅)
platform-version ∅ <ø> (∅)
platform-value 92.17% <ø> (ø)
platform-wallet ∅ <ø> (∅)
drive-proof-verifier 53.13% <ø> (-0.10%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

QuantumExplorer and others added 2 commits May 17, 2026 11:17
The grovedb bump turned on the new strict
`decode_grovedb_proof_canonical` (introduced alongside the
ProvableSumTree / AggregateSumOnRange work in grovedb#661) which
rejects any bincode-decoded grovedb proof that leaves trailing bytes
in the input slice. The previous decoder silently tolerated them.

The grovedb docstring itself notes the trailing bytes are
"harmless for the chain-bound correctness guarantee": the decoded
`GroveDBProof` and the root hash it produces are unchanged. Empirically
verified on the failing fixture proof (651 bytes, 1 trailing byte):
the decoder consumes 650 bytes, the decoded value re-encodes byte-for-byte
to those 650 bytes, and `GroveDb::verify_query` on the 650-byte prefix
returns Ok.

Production drive-abci on this grovedb revision emits canonical proofs
(the rs-drive `should_prove_and_verify_*` round-trip tests prove that),
so the strict check would only fire on proofs from older nodes or
recorded fixtures captured against them. That is exactly what broke
the four `test_token_pre_programmed_distributions[_absent]` tests in
dash-sdk and rs-sdk-ffi — they replay legacy proof bytes captured
before grovedb's canonical-encoder fix.

This commit adds a thin backward-compat shim:

- `packages/rs-drive/src/verify/grovedb_proof_compat.rs` exposes
  `canonicalize_grovedb_proof(proof: &[u8]) -> Result<Cow<[u8]>, Error>`.
  It runs the same bincode decode the new verifier uses, returns the
  proof unchanged when it is already canonical (borrow, no alloc), and
  trims the prefix bincode actually consumed when trailing bytes are
  present. A `tracing::trace!` breadcrumb fires on the trim path so any
  remaining source of non-canonical proofs is observable.
- Every `GroveDb::verify_*(proof, ...)` call site in
  `packages/rs-drive/src/verify/**` (71 files) is wrapped:
  `GroveDb::verify_*(&canonicalize_grovedb_proof(proof)?, ...)`. The
  rewrite is mechanical and only touches the proof byte argument; all
  other parameters and control flow are unchanged.

Test-internal `GroveDb::verify_query` callers in `rs-drive-abci`'s
query unit tests and `rs-drive/src/prove/...` round-trip helpers are
intentionally not wrapped — they verify proofs they just produced with
the bumped grovedb, so the canonical bytes are guaranteed by
construction.

Verified end-to-end:

- The four previously-failing tests now pass:
  `dash-sdk::fetch::tokens::token_pre_programmed_distributions::
    {test_token_pre_programmed_distributions_present,_absent}`,
  `rs-sdk-ffi::token::{test_token_pre_programmed_distributions,_absent}`.
- All 243 `cargo test -p drive --lib verify` tests pass.
- `cargo check --workspace --all-features` and
  `cargo clippy -p drive --features server --no-deps` are clean.
- The shim itself has unit tests covering canonical pass-through,
  trailing-byte trimming, and malformed-envelope rejection.

Reverts the `#[ignore]` workarounds applied in the two preceding
commits — those are no longer needed now that the verifier handles
legacy proofs natively.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov flagged the new `Element::empty_provable_sum_tree_with_flags`
arm in `LowLevelDriveOperationTreeTypeConverter::empty_tree_operation_for_known_path_key`
as the only uncovered line in `packages/rs-drive/src/fees/op.rs`. Drive
doesn't construct `ProvableSumTree` anywhere outside the matching
`grove_insert_empty_tree_v0` arm (which already has a dedicated test),
so the converter arm needs its own test. The test calls the trait
method with `TreeType::ProvableSumTree` and asserts the resulting
`LowLevelDriveOperation` wraps a `GroveOp::InsertOrReplace` carrying
an `Element::ProvableSumTree`.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants