Skip to content

fix(dash-spv): re-anchor incompatible shared storage#910

Draft
llbartekll wants to merge 1 commit into
devfrom
codex/spv-cache-reanchor
Draft

fix(dash-spv): re-anchor incompatible shared storage#910
llbartekll wants to merge 1 commit into
devfrom
codex/spv-cache-reanchor

Conversation

@llbartekll

Copy link
Copy Markdown
Contributor

Summary

  • compare the current wallets' required SPV start height with the existing network-scoped storage range during DashSpvClient construction
  • clear and re-anchor the coherent SPV store when the cache starts after the oldest required wallet history
  • preserve compatible caches and retain the mainnet HD-wallet floor
  • add regression coverage for recent-cache → old-wallet import, compatible cache reuse, and mainnet floor behavior

User-visible effect

After a near-tip wallet is deleted, importing an older wallet into the same app installation automatically discards the too-recent shared SPV cache and scans the required historical range. No manual Clear & resync or app restart is required.

Test plan

  • older_testnet_wallet_reanchors_recent_shared_storage_to_genesis
  • storage_that_starts_before_wallet_requirement_is_preserved
  • mainnet_reanchor_respects_hd_wallet_sync_floor

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 34c2d4f3-8d62-4374-b5f5-46e32b78ea66

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/spv-cache-reanchor

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.

@llbartekll
llbartekll requested a review from ZocoLini July 21, 2026 05:57
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.19355% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.49%. Comparing base (19690d3) to head (2a067e9).

Files with missing lines Patch % Lines
dash-spv/src/client/mod.rs 99.12% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #910      +/-   ##
==========================================
- Coverage   74.54%   74.49%   -0.05%     
==========================================
  Files         327      327              
  Lines       75032    75152     +120     
==========================================
+ Hits        55936    55988      +52     
- Misses      19096    19164      +68     
Flag Coverage Δ
core 77.29% <ø> (ø)
ffi 50.36% <ø> (-0.59%) ⬇️
rpc 20.00% <ø> (ø)
spv 91.22% <99.19%> (+0.01%) ⬆️
wallet 74.41% <ø> (ø)
Files with missing lines Coverage Δ
dash-spv/src/client/lifecycle.rs 92.50% <100.00%> (+0.23%) ⬆️
dash-spv/src/client/mod.rs 99.41% <99.12%> (-0.59%) ⬇️

... and 18 files with indirect coverage changes

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.

1 participant