refactor: remove orphaned shielded nullifier-changes subsystem#3823
Conversation
After #3819 the wallet detects spends via the note scan, so the server-side nullifier-CHANGES machinery has no remaining consumer. This removes it entirely. Removed: - rs-drive: the recent + compacted nullifier-changes trees and the trunk/branch nullifier-set scan — store/fetch/compact/cleanup ops, prove_* (x4), verify_* (x4), the grovedb changes-tree structure (shielded pool 8 -> 5 children), and the per-block changes write (store_nullifiers_for_block, dropped from insert_nullifiers). - rs-drive-abci: the cleanup_recent_block_storage_nullifiers block event, the 4 query handlers + their service.rs methods + shielded/mod.rs declarations. - dapi-grpc: the 4 RPCs (getRecentNullifierChanges, getRecentCompactedNullifierChanges, getNullifiersTrunkState, getNullifiersBranchState) + their messages from platform.proto, build.rs versioned-message arrays, and the regenerated nodejs/web/python/objc/java clients. - rs-platform-version: the nullifier-changes method/query/verify/prove versions (kept the sibling address-balance fields in DriveSavedBlockTransactionsMethodVersions). Kept (unchanged): - The permanent consensus nullifier SET: insert_nullifiers / has_nullifier / validate_nullifiers / getShieldedNullifiers — double-spend prevention. - The address-balance saved_block_transactions subsystem (still in use). Pre-release v12 shielded pool: the pool subtree structure changes (app-hash differs; dev/test state rebuilds), but the permanent nullifier set, the commitment-tree anchor, and double-spend enforcement are unchanged. Estimated-cost weights updated to match the new 5-child layout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR removes non-shielded nullifier RPCs, generated client bindings, Rust query/proof/storage/verification paths, and related platform-version fields. It also updates shielded pool structure metadata, storage wiring, and remaining address-balance/notes-count versioning. ChangesRemove non-shielded nullifier surface
Sequence Diagram(s)Not applicable. Estimated code review effort🎯 5 (Critical) | ⏱️ ~90+ minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3.1-dev #3823 +/- ##
============================================
+ Coverage 87.04% 87.06% +0.02%
============================================
Files 2677 2639 -38
Lines 329918 327034 -2884
============================================
- Hits 287182 284739 -2443
+ Misses 42736 42295 -441
🚀 New features to boost your workflow:
|
The shielded-gated outgoing-notes load path in platform-wallet-ffi returned `String.into()` / `format!(...).into()` as its error, but `PersistenceError` does not implement `From<String>`, so the crate failed to compile under the `shielded` feature (E0277). Construct `PersistenceError::backend(...)` to match the surrounding error sites. Regression from #3819 (only triggered with the `shielded` feature, which the congested CI on that PR didn't exercise). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
✅ DashSDKFFI.xcframework built for this PR.
SwiftPM (host the zip at a stable URL, then use): .binaryTarget(
name: "DashSDKFFI",
url: "https://your.cdn.example/DashSDKFFI.xcframework.zip",
checksum: "3650cf50c5329639ff31e658677769af871a157e61600ee5ca393176f8d58497"
)Xcode manual integration:
|
Drops the 4 removed RPCs (getNullifiersTrunkState, getNullifiersBranchState, getRecentNullifierChanges, getRecentCompactedNullifierChanges) from .github/grpc-queries-cache.json. The cache is committed as regenerated by check-grpc-coverage.py against the updated proto (which also picked up 3 queries now detected as implemented), so the post-merge coverage run produces no diff — the workflow's auto-commit is disabled, so a stale cache would otherwise stay perpetually dirty. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Reviewed |
…ness Resolves the modify/delete conflicts from #3823 (which removed the shielded nullifier-changes subsystem) by accepting the deletions: the shielded half of this fix (prove/verify_compacted_nullifier_changes) is moot now that the subsystem no longer exists. The PR is hereby rescoped to the address-balance boundary-authentication fix only (fetch_compacted_address_balances, verify_compacted_address_balance_changes, queries.rs, and the shared util/common compacted_key helper — still used by 4 address-balance modules). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Issue being fixed or feature implemented
Follow-up cleanup to #3819. That PR made the shielded (Orchard) wallet detect spends by matching nullifiers already present in the note scan, and removed the client-side consumption of the nullifier-sync RPCs. This PR removes the now-orphaned server-side nullifier-changes machinery, which has no remaining consumer.
This is a pre-release v12 shielded-pool change — no deployed network depends on the prior behavior.
What was done?
Removed the nullifier-changes subsystem (recent + compacted change logs, and the trunk/branch nullifier-set scan):
store_nullifiers/fetch_nullifiers/fetch_compacted_nullifiers/compact_nullifiers/cleanup_expired_nullifier_compactions,prove_*(×4),verify_*(×4); the grovedb changes-tree structure (shielded pool 8 → 5 children); and the per-block changes write (store_nullifiers_for_block, dropped frominsert_nullifiers).cleanup_recent_block_storage_nullifiersblock event (+ its call inrun_block_proposal), the 4 query handlers, and theirservice.rsmethods +query/shielded/mod.rsdeclarations.getRecentNullifierChanges,getRecentCompactedNullifierChanges,getNullifiersTrunkState,getNullifiersBranchState) + their messages fromplatform.proto, thebuild.rsversioned-message arrays, and the regenerated nodejs/web/python/objc/java clients.drive_versions/vN.rs+ mocks).Kept, unchanged:
insert_nullifiers/has_nullifier/validate_nullifiers/getShieldedNullifiers— the authority for double-spend prevention.saved_block_transactionssubsystem (still in use; shares the version struct, so only the nullifier fields were removed).98 files: 40 deleted, 58 modified.
This changes the shielded pool grovedb subtree structure (8 → 5 children → app-hash differs) and the estimated-cost metering. Verified invariants:
[64]is still created in the pool structure and still written byinsert_nullifiers_v0(only the changes-write call was removed).count_sum_trees 1→0(recent),non_sum_trees 5→3(dropped compacted + expiration), permanent-nullifiers weight unchanged, subtree count 7→4, balanced Merk depth still 3.How Has This Been Tested?
Local (CI runners are congested):
cargo check --workspaceclean;cargo fmt --all;cargo clippyon the touched crates — no warnings.cargo test -p drive --lib shielded→ 147 passed;insert_nullifiers/has_nullifierpass.cargo test -p drive-abci --lib identity_create_from_shielded→ 5 passed.cargo test -p platform-version→ 7 passed.rvolosatovs/protoc:4.0.0codegen; the 4 RPCs are gone from all generated clients.Pre-existing failures (NOT caused by this PR):
cargo test -p drive-abci --lib shieldedhas 12shielded_transfer/unshieldfailures — a minimum-shielded-fee calibration drift (test funding amounts vs the current fee schedule, e.g. funding130548800< min131425600). These reproduce byte-identically on the clean base tree; the min-fee is driven bySHIELDED_STORAGE_BYTES_PER_ACTION+ proof cost, which this PR does not touch. (This is also why v3.1-dev's ownTestsCI is currently red.)Breaking Changes
None for any deployed network — pre-release v12 (shielded pool not active anywhere). The on-chain shielded pool subtree structure changes (loses the recent/compacted/expiration trees), so the app-hash differs and dev/test state must be rebuilt (no migration — acceptable pre-release). The permanent nullifier set, double-spend enforcement, and the commitment-tree anchor are unchanged. Not consensus-breaking per the consensus-only
!convention.Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
Summary by CodeRabbit
getNullifiersTrunkState,getNullifiersBranchState,getRecentNullifierChanges, andgetRecentCompactedNullifierChanges.getShieldedNullifiersendpoint.