Skip to content

fix(platform-wallet): spv client clear storage works after stopping the client#4042

Merged
ZocoLini merged 1 commit into
v4.1-devfrom
fix/swift-spv-clear
Jul 8, 2026
Merged

fix(platform-wallet): spv client clear storage works after stopping the client#4042
ZocoLini merged 1 commit into
v4.1-devfrom
fix/swift-spv-clear

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

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

Summary by CodeRabbit

  • Bug Fixes

    • Improved confidence that SPV storage can be cleared safely after stopping synchronization, helping prevent leftover data from affecting future runs.
  • Tests

    • Added integration coverage for stopping SPV, clearing its stored data, and starting it again to verify the storage is fully reset.

@github-actions github-actions Bot added this to the v4.1.0 milestone Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ZocoLini, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a2bf1ab2-3e1a-4b5e-99d9-104f3dbc8b0f

📥 Commits

Reviewing files that changed from the base of the PR and between e5b7e8f and c55e63f.

📒 Files selected for processing (3)
  • packages/rs-platform-wallet/src/spv/runtime.rs
  • packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/PlatformWalletManagerSPV.swift
  • packages/swift-sdk/SwiftTests/SwiftDashSDKIntegrationTests/Core/SpvClearStorageIntegrationTests.swift
📝 Walkthrough

Walkthrough

Removes a stale documentation line in PlatformWalletManagerSPV.swift and adds a new Swift integration test file that verifies SPV storage clearing wipes on-disk data after stopping the SPV client, including a helper for computing deterministic directory signatures.

Changes

SPV Storage Clear Verification

Layer / File(s) Summary
Doc comment cleanup
packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/PlatformWalletManagerSPV.swift
Removes an outdated doc comment line stating the SPV client must be running, between `stopSpv()` and `clearSpvStorage()`.
Storage clear integration test
packages/swift-sdk/SwiftTests/SwiftDashSDKIntegrationTests/Core/SpvClearStorageIntegrationTests.swift
Adds a test that starts SPV, waits for sync, captures a disk signature, stops SPV, clears storage, verifies the signature changed, and restarts/stops SPV to confirm no leftover lock; adds a dirSignature helper enumerating files for deterministic comparison.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • dashpay/platform#3712: Both PRs introduce/extend the Swift SDK integration testing framework that the new SPV clear-storage test relies on.

Suggested labels: Client Only

Suggested reviewers: QuantumExplorer, shumkov, thepastaclaw

🚥 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 clearly matches the main change: SPV storage clearing now works after the client is stopped.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/swift-spv-clear

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.

@thepastaclaw

thepastaclaw commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

✅ Review complete (commit c55e63f)

@ZocoLini ZocoLini force-pushed the fix/swift-spv-clear branch from e5b7e8f to c55e63f Compare July 8, 2026 11:51
@ZocoLini ZocoLini requested a review from lklimek as a code owner July 8, 2026 11:51
@ZocoLini ZocoLini merged commit 09af5ae into v4.1-dev Jul 8, 2026
16 checks passed
@ZocoLini ZocoLini deleted the fix/swift-spv-clear branch July 8, 2026 12:17

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code Review

Source: reviewers: claude opus general (failed), codex gpt-5.5 general (ok; wrapper rc=5 after valid JSON), claude opus rust-quality (failed), codex gpt-5.5 rust-quality (ok). Verifier: codex gpt-5.5 (ok; wrapper rc=5 after valid JSON).

Carried-Forward Prior Findings: none; prior-1 is FIXED because current SpvRuntime::clear_storage no longer requires a live client and falls back to a cached ClientConfig after stopSpv(). New Findings In Latest Delta: none. I verified the Swift call path through FFI into the updated Rust runtime; cargo check -p platform-wallet could not complete because the required network escalation for Tenderdash proto sources was rejected.

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.

3 participants