Skip to content

chore(swift-sdk): remove dash-spv-ffi crate usage, spv is wrapped by platform-wallet#3644

Open
ZocoLini wants to merge 1 commit into
v3.1-devfrom
chore/remove-spv-ffi-crate
Open

chore(swift-sdk): remove dash-spv-ffi crate usage, spv is wrapped by platform-wallet#3644
ZocoLini wants to merge 1 commit into
v3.1-devfrom
chore/remove-spv-ffi-crate

Conversation

@ZocoLini
Copy link
Copy Markdown
Collaborator

@ZocoLini ZocoLini commented May 14, 2026

If we are planning to wrap all dash-spv logic in platform-wallet and platform-wallet-ffi, it makes more sense to remove this symbols from the final binary so nobody can use them

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

  • Breaking Changes

    • Removed initializeSPVLogging() public method from Swift SDK. Migrate code to use enableLogging(level:) for logging initialization instead.
  • Refactor

    • Updated internal FFI layer and dependency architecture to streamline SDK components.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

📝 Walkthrough

Walkthrough

The PR removes the dash-spv-ffi workspace dependency and replaces it with dash-network. Configuration changes update cbindgen to stop exporting SPV-specific FFI types. Swift SDK code is updated to use unified logging and new FFI function names instead of SPV-specific implementations.

Changes

Replace dash-spv-ffi with dash-network

Layer / File(s) Summary
Build configuration for new FFI exports
packages/rs-sdk-ffi/cbindgen.toml
Cbindgen configuration is updated to remove dash_spv_ffi_* from included FFI type patterns and to reflect that only key-wallet-ffi types are excluded to avoid duplication.
Swift SDK logging and FFI function migration
packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/SDKLogger.swift, packages/swift-sdk/Sources/SwiftDashSDK/KeyWallet/WalletManager.swift
Swift SDK logging is initialized via the new unified SDK.enableLogging(level:) API instead of SPV-specific initializeSPVLogging. Wallet manager cleanup transitions from dash_spv_ffi_wallet_manager_free to wallet_manager_free.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A swift hop away from SPV's old ways,
Dash-network now guides through the upgrade's maze,
FFI calls refactored, configuration light,
The migration hops onward, crisp and bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective of the pull request: removing dash-spv-ffi crate usage across multiple packages because SPV functionality is now wrapped by platform-wallet.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-spv-ffi-crate

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.

@github-actions github-actions Bot added this to the v3.1.0 milestone May 14, 2026
@ZocoLini ZocoLini marked this pull request as ready for review May 14, 2026 21:51
@thepastaclaw
Copy link
Copy Markdown
Collaborator

thepastaclaw commented May 14, 2026

✅ Review complete (commit 25c0e3d)

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.24%. Comparing base (3b9fe6b) to head (25c0e3d).
⚠️ Report is 7 commits behind head on v3.1-dev.

Additional details and impacted files
@@             Coverage Diff              @@
##           v3.1-dev    #3644      +/-   ##
============================================
- Coverage     88.25%   88.24%   -0.01%     
============================================
  Files          2494     2506      +12     
  Lines        304580   307938    +3358     
============================================
+ Hits         268812   271745    +2933     
- Misses        35768    36193     +425     
Components Coverage Δ
dpp 88.00% <92.17%> (+0.01%) ⬆️
drive 87.33% <76.72%> (-0.04%) ⬇️
drive-abci 90.24% <94.62%> (+0.07%) ⬆️
sdk ∅ <ø> (∅)
dapi-client ∅ <ø> (∅)
platform-version ∅ <ø> (∅)
platform-value 92.17% <ø> (ø)
platform-wallet ∅ <ø> (∅)
drive-proof-verifier 53.62% <4.16%> (-0.60%) ⬇️
🚀 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.

@github-actions
Copy link
Copy Markdown
Contributor

✅ 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: "b58a3d0ea1a24481a957edca4a5b2048a3d0fae8d96948a230758b3cfe759dd8"
)

Xcode manual integration:

  • Download 'DashSDKFFI.xcframework' artifact from the run link above.
  • Drag it into your app target (Frameworks, Libraries & Embedded Content) and set Embed & Sign.
  • If using the Swift wrapper package, point its binaryTarget to the xcframework location or add the package and place the xcframework at the expected path.

Copy link
Copy Markdown
Collaborator

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

This PR mostly does the intended surface cleanup: it removes direct dash-spv-ffi exposure and routes Swift through platform-wallet instead. The one confirmed regression is logging: the new SDK.enableLogging() path no longer enables the platform_wallet and dash_spv tracing targets, so SPV/platform-wallet diagnostics disappear for Swift callers. The other proposed FFI compatibility findings do not hold up as review comments on this SHA: one is an intentional breaking-surface removal, and the other is not introduced by this PR at all.

Reviewed commit: 25c0e3d

🟡 1 suggestion(s)

1 additional finding

🟡 suggestion: `dash_sdk_enable_logging` drops platform-wallet and SPV tracing targets

packages/rs-sdk-ffi/src/lib.rs (lines 103-106)

LoggingPreferences.configure() now calls SDK.enableLogging(level: .info) after initializeSPVLogging() was removed. In this implementation, the fallback EnvFilter only enables dash_sdk, rs_sdk, rs_sdk_ffi, dapi_grpc, h2, tower, hyper, and tonic. It does not enable platform_wallet or dash_spv, even though SPV is now wrapped by platform-wallet and those crates still emit tracing output. Because EnvFilter defaults unspecified targets to off, Swift clients that follow the new API lose the platform-wallet/SPV diagnostics they previously got from the old SPV logging initializer.

💡 Suggested change
    let filter_string = format!(
        "dash_sdk={log_level},rs_sdk={log_level},rs_sdk_ffi={log_level},\
         platform_wallet={log_level},platform_wallet_ffi={log_level},dash_spv={log_level},\
         dapi_grpc={log_level},h2={log_level},tower={log_level},\
         hyper={log_level},tonic={log_level}"
    );
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-sdk-ffi/src/lib.rs`:
- [SUGGESTION] lines 103-106: `dash_sdk_enable_logging` drops platform-wallet and SPV tracing targets
  `LoggingPreferences.configure()` now calls `SDK.enableLogging(level: .info)` after `initializeSPVLogging()` was removed. In this implementation, the fallback `EnvFilter` only enables `dash_sdk`, `rs_sdk`, `rs_sdk_ffi`, `dapi_grpc`, `h2`, `tower`, `hyper`, and `tonic`. It does not enable `platform_wallet` or `dash_spv`, even though SPV is now wrapped by `platform-wallet` and those crates still emit tracing output. Because `EnvFilter` defaults unspecified targets to `off`, Swift clients that follow the new API lose the platform-wallet/SPV diagnostics they previously got from the old SPV logging initializer.

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