Skip to content

chore: bump rust-dashcore dependency to latest commit#3397

Open
ZocoLini wants to merge 3 commits intov3.1-devfrom
chore/bump-dashcore
Open

chore: bump rust-dashcore dependency to latest commit#3397
ZocoLini wants to merge 3 commits intov3.1-devfrom
chore/bump-dashcore

Conversation

@ZocoLini
Copy link
Collaborator

@ZocoLini ZocoLini commented Mar 21, 2026

I am glad to announce, this PR goes through CI

Changes made:

  • Bumped rust-dashcode to latest commit available (today)
  • Updated the event system in swift-sdk to match the new implementation in rust-dashcore
  • Removed unified.rs module, why?? It needed to be updated to match the changes in rust-dashcode but I knew after previous investigation a week ago that the module logic was not being used anywhere and the idea of an unified sdk is coming in a PR that I will be opening soon, fixing:
    • iOS building issues
    • static unified sdk library size (reduced by almost 100MB by removing duplicated symbols using cargo)
    • impossible to read build_ios.sh script
  • Removed explicit declaration of "std" feature in dashcode since its no longer needed to build for std builds
  • key_wallet_manager was merged into key_wallet so the dependency and a couple of features needed to be adjusted. Note about this, in rust_dashcore/key-wallet there is a manager feature to enable the (previously named) key_wallet_manager (the feature is enable by default) AND I am not disabling it. wasm-sdk compiles

How did I test this??

  • Executed cargo build to validate Rust compilation
  • Executed cargo test, as always
  • Compiled wasm-sdk following the guides (I just executed yarn build)
  • Executed build_ios.sh and played a little bit with the app, balance, transactions, sync, network swaps, etc
  • Prayed god while CI was running hoping it would pass and it did

I am open to discuss the changes made in this PR with real humans and adjust the code if needed

Summary by CodeRabbit

Release Notes

  • Breaking Changes

    • SPVClient initialization API now requires SPVEventHandlers parameter for event handling setup
  • Improvements

    • Wallet interface expanded with instant send UTXO tracking and monitor revision queries
    • Core transaction verification now supports balance update processing
  • Removals

    • Unified SDK C-FFI interface layer removed

@ZocoLini ZocoLini marked this pull request as draft March 21, 2026 00:04
@github-actions github-actions bot added this to the v3.1.0 milestone Mar 21, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eb613d93-f5b9-42a5-ac54-aceee9b66496

📥 Commits

Reviewing files that changed from the base of the PR and between 399bc7f and 45b23c9.

📒 Files selected for processing (2)
  • packages/rs-platform-wallet/src/platform_wallet_info/wallet_info_interface.rs
  • packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/rs-platform-wallet/src/platform_wallet_info/wallet_info_interface.rs
  • packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift

📝 Walkthrough

Walkthrough

This PR updates workspace dependency revisions, removes key-wallet-manager and its feature gates across Rust crates, drops the dashcore "std" feature in rs-dpp, removes the unified C-FFI "unified" module, extends PlatformWalletInfo APIs, mutates a transaction-check signature to allow balance updates, and consolidates Swift SPV event handlers into SPVEventHandlers.

Changes

Cohort / File(s) Summary
Workspace Dependency Updates
Cargo.toml
Bumped workspace git rev to 88eacdf19d984c34a4bd8a586ede2c4acf055c54 for dashcore, dash-spv, dash-spv-ffi, key-wallet, dashcore-rpc. Removed key-wallet-manager workspace dependency.
Key-Wallet-Manager Removal (Rust)
packages/rs-dpp/Cargo.toml, packages/rs-dpp/src/lib.rs, packages/rs-platform-wallet/Cargo.toml, packages/rs-platform-wallet/src/lib.rs
Removed optional key-wallet-manager dependency, associated Cargo feature gates (core_key_wallet_manager, manager), and conditional public re-exports; updated default features to exclude manager.
Dashcore Feature Cleanup
packages/rs-dpp/Cargo.toml
Removed "std" from the dashcore dependency features list.
SDK Feature Graph Updates
packages/rs-sdk/Cargo.toml
Removed core_key_wallet_manager feature and removed it from spv-client and wallet feature sets.
Platform Wallet API Changes
packages/rs-platform-wallet/src/platform_wallet_info/wallet_info_interface.rs, packages/rs-platform-wallet/src/platform_wallet_info/wallet_transaction_checker.rs
Added mark_instant_send_utxos(&mut self, txid: &Txid) -> bool and monitor_revision(&self) -> u64. Changed check_core_transaction to take wallet: &mut Wallet and added update_balance: bool parameter (forwards to inner call).
Platform Wallet Example & Docs
packages/rs-platform-wallet/examples/basic_usage.rs, packages/rs-platform-wallet/README.md
Example now unconditionally imports and constructs WalletManager::<PlatformWalletInfo> (removed feature gating). README compatibility and dependency references to key-wallet-manager removed/updated.
Unified SDK FFI Module Removal
packages/rs-sdk-ffi/src/lib.rs, packages/rs-sdk-ffi/src/unified.rs
Deleted the entire unified C-FFI module and its crate-root re-export: removed UnifiedSDKConfig, UnifiedSDKHandle, all dash_unified_sdk_* extern functions, status/version helpers, and related tests.
Build Script Cleanup
packages/rs-sdk-ffi/build_ios.sh
Removed key-wallet-manager from iOS build cleanup package list.
rs-sdk-ffi API pruning
packages/rs-sdk-ffi/src/lib.rs
Removed unified module declaration and pub use unified::*; re-export from crate root.
Swift SDK Event Handler Refactor
packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVClient.swift, .../SPVEventHandler.swift, .../WalletService.swift
Introduced aggregated SPVEventHandlers; SPVClient.init now requires eventHandlers: SPVEventHandlers. Added SPVClientErrorEventsHandler and error callbacks; updated block-processed callback to include confirmedTxids/confirmedTxidCount and transaction callback to accept status. Removed individual set/clear handler methods and updated WalletService to construct/pass SPVEventHandlers at client creation.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 I nibbled old deps, hopped past the glue,

Removed a whole module, lined handlers anew.
Balance now listens, instant-send marks the trail,
Swiftly I bundled the events without fail.
Hooray — clean hops across CI's trail! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main objective: bumping the rust-dashcore dependency to the latest commit, which is the primary driver of all changes in the PR.

✏️ 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/bump-dashcore

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.

@ZocoLini ZocoLini changed the title bump rust-dashcore dependency to latest commit chore: bump rust-dashcore dependency to latest commit Mar 21, 2026
@QuantumExplorer
Copy link
Member

already been done

@ZocoLini
Copy link
Collaborator Author

honestly, I was working on it bcs I know what has changed in rust-dashcode but I can see the commit was just changed to one thats not even merged yet, without updating any other code, and I also saw 2 open PRs and 1 closed trying to update it

@ZocoLini ZocoLini force-pushed the chore/bump-dashcore branch from 3931d0b to 4b1d139 Compare March 26, 2026 19:05
@ZocoLini ZocoLini force-pushed the chore/bump-dashcore branch from 4b1d139 to 9aeef00 Compare March 26, 2026 19:10
@ZocoLini ZocoLini marked this pull request as ready for review March 26, 2026 19:12
Copy link
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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/rs-sdk-ffi/build_ios.sh (1)

81-81: ⚠️ Potential issue | 🟡 Minor

Remove key-wallet-manager/src from hash computation.

Line 81 still includes key-wallet-manager/src in the find command for detecting local rust-dashcore changes, but key-wallet-manager has been removed from the workspace dependencies and the cargo clean loop (line 98). This inconsistency could trigger unnecessary clean builds when key-wallet-manager source changes, even though that crate is no longer used.

Proposed fix
-    CURRENT_HASH=$(find "$RUST_DASHCORE_DIR/dash/src" "$RUST_DASHCORE_DIR/key-wallet/src" "$RUST_DASHCORE_DIR/dash-spv/src" "$RUST_DASHCORE_DIR/dash-spv-ffi/src" "$RUST_DASHCORE_DIR/key-wallet-manager/src" -name '*.rs' 2>/dev/null | sort | xargs cat 2>/dev/null | shasum -a 256 | cut -d' ' -f1)
+    CURRENT_HASH=$(find "$RUST_DASHCORE_DIR/dash/src" "$RUST_DASHCORE_DIR/key-wallet/src" "$RUST_DASHCORE_DIR/dash-spv/src" "$RUST_DASHCORE_DIR/dash-spv-ffi/src" -name '*.rs' 2>/dev/null | sort | xargs cat 2>/dev/null | shasum -a 256 | cut -d' ' -f1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rs-sdk-ffi/build_ios.sh` at line 81, Remove the removed crate from
the hash computation: update the CURRENT_HASH find invocation to exclude
"key-wallet-manager/src" so it matches the workspace changes and the cargo clean
loop; specifically, edit the find arguments referenced by the CURRENT_HASH
variable (the find command that lists "$RUST_DASHCORE_DIR/...") to drop the
"key-wallet-manager/src" entry so local rust-dashcore changes no longer consider
that directory when computing the hash.
packages/rs-platform-wallet/README.md (1)

23-25: ⚠️ Potential issue | 🟡 Minor

Update code example to use the new import path.

The code example still references key_wallet_manager::wallet_manager::WalletManager, but this import path no longer exists after removing key-wallet-manager. The example should use the updated import from key_wallet::manager::WalletManager as shown in examples/basic_usage.rs.

Proposed fix
 use platform_wallet::PlatformWalletInfo;
-use key_wallet_manager::wallet_manager::WalletManager;
+use key_wallet::manager::WalletManager;
 use key_wallet::wallet::managed_wallet_info::wallet_info_interface::WalletInfoInterface;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rs-platform-wallet/README.md` around lines 23 - 25, The README code
example uses the removed import path
key_wallet_manager::wallet_manager::WalletManager; update that import to the new
path key_wallet::manager::WalletManager to match examples/basic_usage.rs and the
current crate layout, ensuring the use statement alongside PlatformWalletInfo
and WalletInfoInterface is adjusted to key_wallet::manager::WalletManager.
packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift (1)

280-292: ⚠️ Potential issue | 🟡 Minor

Consider strengthening concurrency safety for Sendable event handlers storing @MainActor references.

Event handlers (SPVProgressUpdateEventHandlerImpl, SPVSyncEventsHandlerImpl, SPVNetworkEventsHandlerImpl, SPVWalletEventsHandlerImpl, SPVClientErrorEventsHandlerImpl) are marked Sendable but store a reference to WalletService, which is @MainActor. In strict concurrency mode, this creates a type safety violation (non-Sendable reference in Sendable type), even though current mitigations via Task { @mainactor in ... } function correctly for FFI callback dispatch.

While strict concurrency checking is not currently enabled and existing code properly dispatches to the main thread, consider using a weak reference or actor-isolated pattern to future-proof the implementation against strict concurrency enforcement.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift`
around lines 280 - 292, The event handler types (e.g.,
SPVProgressUpdateEventHandlerImpl) are Sendable but hold a strong reference to a
`@MainActor` WalletService, which will break strict concurrency checks; change the
stored walletService to a weak optional (e.g., weak var walletService:
WalletService?) in SPVProgressUpdateEventHandlerImpl (and the other handlers
named in the review), update the initializer to store the weak reference, and in
onProgressUpdate unwrap the optional (guard let ws = walletService else { return
}) before calling Task { `@MainActor` in ws.syncProgress = progress } so the
handler no longer retains a non-Sendable reference while preserving MainActor
dispatch.
🧹 Nitpick comments (6)
packages/rs-platform-wallet/src/platform_wallet_info/wallet_transaction_checker.rs (1)

37-42: Consider using structured logging instead of eprintln!.

The eprintln! macro writes directly to stderr, which is less flexible than structured logging. If the crate uses tracing or log, consider using those for consistency with the rest of the codebase.

This is a minor observation and may be outside the scope of this dependency bump PR.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/rs-platform-wallet/src/platform_wallet_info/wallet_transaction_checker.rs`
around lines 37 - 42, Replace the eprintln! call in
wallet_transaction_checker.rs inside the
fetch_identity_and_contacts_for_asset_lock error branch with the crate's
structured logging macro (e.g., tracing::error! or log::error!) so the failure
is recorded consistently; call tracing::error!("Failed to fetch identity for
asset lock for wallet {:?}, tx {:?}: {:?}", wallet.id, tx.id, e) (or similar
contextual fields available) and add the necessary use/import for tracing::error
(or log::error) at the top of the file to ensure the logger is available.
packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVEventHandler.swift (3)

565-567: Remove trailing semicolon.

Static analysis flagged the trailing semicolon which is not idiomatic Swift.

🔧 Proposed fix
 protocol SPVClientErrorEventsHandler: AnyObject {
-    func onClientError(_ error: String);
+    func onClientError(_ error: String)
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVEventHandler.swift`
around lines 565 - 567, The protocol declaration for SPVClientErrorEventsHandler
contains a trailing semicolon after the method signature in func onClientError(_
error: String); — remove the semicolon so the signature reads func
onClientError(_ error: String) to match Swift style and satisfy static analysis;
update the protocol SPVClientErrorEventsHandler accordingly.

260-271: Unused confirmedTxids and confirmedTxidCount parameters.

The new FFI callback signature includes confirmedTxids and confirmedTxidCount parameters that are not being forwarded to the Swift handler. If this data is relevant, consider extending SPVSyncEventsHandler.onBlocksProcessed to accept the confirmed transaction IDs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVEventHandler.swift`
around lines 260 - 271, The callback onSpvBlockProcessedCallbackC currently
ignores the confirmedTxids and confirmedTxidCount parameters; update the FFI
bridge to convert confirmedTxids (UnsafePointer<Byte32>?) into a Swift [Data]
(using confirmedTxidCount to determine length, similar to bytePtrIntoData) and
forward that array to the SPV sync handler by extending
rawPtrIntoSpvSyncEventsHandler().onBlocksProcessed to accept a confirmedTxids
parameter (e.g.,
onBlocksProcessed(height:hash:newAddressCount:confirmedTxids:)), then update the
call site in onSpvBlockProcessedCallbackC to pass the converted confirmedTxids
array. Ensure null/zero-count handling is safe.

473-500: Unused status: FFITransactionContext parameter.

The status parameter is received from FFI but not passed to handler.onTransactionReceived(...). If transaction status context is meaningful, consider extending SPVWalletEventsHandler.onTransactionReceived to include it.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVEventHandler.swift`
around lines 473 - 500, The FFI `status: FFITransactionContext` parameter in
onSpvTransactionReceivedCallbackC is currently unused; update the SPV event path
to pass it through by adding a corresponding parameter to
SPVWalletEventsHandler.onTransactionReceived and forwarding `status` from
onSpvTransactionReceivedCallbackC into that call (adjusting all implementations
of SPVWalletEventsHandler to accept and handle the new FFITransactionContext
argument), or if you intend to ignore it, explicitly consume it (e.g., assign to
_ or call a mapping function) to avoid unused-parameter warnings; locate the
change at onSpvTransactionReceivedCallbackC and the
SPVWalletEventsHandler.onTransactionReceived declarations/implementations and
update them consistently.
packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift (2)

370-378: Empty error handler implementation - consider logging errors.

SPVClientErrorEventsHandlerImpl.onClientError does nothing with received errors. Consider at minimum logging the error or updating lastSyncError.

♻️ Proposed implementation
 internal final class SPVClientErrorEventsHandlerImpl: SPVClientErrorEventsHandler, Sendable {
     private let walletService: WalletService

     init(walletService: WalletService) {
         self.walletService = walletService
     }

-    func onClientError(_ error: String) {}
+    func onClientError(_ error: String) {
+        SDKLogger.error("SPV client error: \(error)")
+        
+        Task { `@MainActor` in
+            walletService.lastSyncError = SPVError.syncFailed(error)
+        }
+    }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift`
around lines 370 - 378, SPVClientErrorEventsHandlerImpl.onClientError currently
ignores errors; update it to record and surface failures by calling into the
owning WalletService: set or update WalletService.lastSyncError (or an
appropriate error property) with the received error string and emit a log entry
via the walletService logger (or use os_log) including the error text and
context (e.g., "SPV client error"). Ensure you reference
SPVClientErrorEventsHandlerImpl.onClientError and WalletService when
implementing the update so the handler stores the error and logs it for
debugging and state inspection.

107-153: Consider documenting the two-phase initialization pattern.

The init creates an SPVClient with dummy handlers, extracts the wallet manager, destroys it, then recreates with real handlers that reference self. While the comments explain this is necessary for self-referencing handlers, a brief doc comment on WalletService explaining this lifecycle would help future maintainers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift`
around lines 107 - 153, Add a short doc comment to WalletService describing the
two-phase initialization lifecycle: explain that init temporarily constructs an
SPVClient with dummy SPVEventHandlers to obtain the shared CoreWalletManager via
CoreWalletManager(spvClient:spvClient, modelContainer:), then destroys that
client (spvClient.destroy()) and re-initializes a second SPVClient with real
SPVEventHandlers that capture self for event callbacks; mention reasons
(handlers need self) and any implications for error handling or ordering around
self.walletManager and self.spvClient to help future maintainers locate the
pattern around init, SPVClient, SPVEventHandlers, spvClient, and walletManager.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@packages/rs-platform-wallet/src/platform_wallet_info/wallet_info_interface.rs`:
- Around line 115-117: The method mark_instant_send_utxos currently panics via
todo!(); replace it with a delegation to the wrapped wallet info instance used
elsewhere in this impl—call the inner/wrapped object's mark_instant_send_utxos
with the provided &dashcore::Txid and return its bool result (ensure you use the
same field name used by other methods in this impl, e.g., self.inner or
self.wrapped, and respect &mut self for the mutable call).

---

Outside diff comments:
In `@packages/rs-platform-wallet/README.md`:
- Around line 23-25: The README code example uses the removed import path
key_wallet_manager::wallet_manager::WalletManager; update that import to the new
path key_wallet::manager::WalletManager to match examples/basic_usage.rs and the
current crate layout, ensuring the use statement alongside PlatformWalletInfo
and WalletInfoInterface is adjusted to key_wallet::manager::WalletManager.

In `@packages/rs-sdk-ffi/build_ios.sh`:
- Line 81: Remove the removed crate from the hash computation: update the
CURRENT_HASH find invocation to exclude "key-wallet-manager/src" so it matches
the workspace changes and the cargo clean loop; specifically, edit the find
arguments referenced by the CURRENT_HASH variable (the find command that lists
"$RUST_DASHCORE_DIR/...") to drop the "key-wallet-manager/src" entry so local
rust-dashcore changes no longer consider that directory when computing the hash.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift`:
- Around line 280-292: The event handler types (e.g.,
SPVProgressUpdateEventHandlerImpl) are Sendable but hold a strong reference to a
`@MainActor` WalletService, which will break strict concurrency checks; change the
stored walletService to a weak optional (e.g., weak var walletService:
WalletService?) in SPVProgressUpdateEventHandlerImpl (and the other handlers
named in the review), update the initializer to store the weak reference, and in
onProgressUpdate unwrap the optional (guard let ws = walletService else { return
}) before calling Task { `@MainActor` in ws.syncProgress = progress } so the
handler no longer retains a non-Sendable reference while preserving MainActor
dispatch.

---

Nitpick comments:
In
`@packages/rs-platform-wallet/src/platform_wallet_info/wallet_transaction_checker.rs`:
- Around line 37-42: Replace the eprintln! call in wallet_transaction_checker.rs
inside the fetch_identity_and_contacts_for_asset_lock error branch with the
crate's structured logging macro (e.g., tracing::error! or log::error!) so the
failure is recorded consistently; call tracing::error!("Failed to fetch identity
for asset lock for wallet {:?}, tx {:?}: {:?}", wallet.id, tx.id, e) (or similar
contextual fields available) and add the necessary use/import for tracing::error
(or log::error) at the top of the file to ensure the logger is available.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift`:
- Around line 370-378: SPVClientErrorEventsHandlerImpl.onClientError currently
ignores errors; update it to record and surface failures by calling into the
owning WalletService: set or update WalletService.lastSyncError (or an
appropriate error property) with the received error string and emit a log entry
via the walletService logger (or use os_log) including the error text and
context (e.g., "SPV client error"). Ensure you reference
SPVClientErrorEventsHandlerImpl.onClientError and WalletService when
implementing the update so the handler stores the error and logs it for
debugging and state inspection.
- Around line 107-153: Add a short doc comment to WalletService describing the
two-phase initialization lifecycle: explain that init temporarily constructs an
SPVClient with dummy SPVEventHandlers to obtain the shared CoreWalletManager via
CoreWalletManager(spvClient:spvClient, modelContainer:), then destroys that
client (spvClient.destroy()) and re-initializes a second SPVClient with real
SPVEventHandlers that capture self for event callbacks; mention reasons
(handlers need self) and any implications for error handling or ordering around
self.walletManager and self.spvClient to help future maintainers locate the
pattern around init, SPVClient, SPVEventHandlers, spvClient, and walletManager.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVEventHandler.swift`:
- Around line 565-567: The protocol declaration for SPVClientErrorEventsHandler
contains a trailing semicolon after the method signature in func onClientError(_
error: String); — remove the semicolon so the signature reads func
onClientError(_ error: String) to match Swift style and satisfy static analysis;
update the protocol SPVClientErrorEventsHandler accordingly.
- Around line 260-271: The callback onSpvBlockProcessedCallbackC currently
ignores the confirmedTxids and confirmedTxidCount parameters; update the FFI
bridge to convert confirmedTxids (UnsafePointer<Byte32>?) into a Swift [Data]
(using confirmedTxidCount to determine length, similar to bytePtrIntoData) and
forward that array to the SPV sync handler by extending
rawPtrIntoSpvSyncEventsHandler().onBlocksProcessed to accept a confirmedTxids
parameter (e.g.,
onBlocksProcessed(height:hash:newAddressCount:confirmedTxids:)), then update the
call site in onSpvBlockProcessedCallbackC to pass the converted confirmedTxids
array. Ensure null/zero-count handling is safe.
- Around line 473-500: The FFI `status: FFITransactionContext` parameter in
onSpvTransactionReceivedCallbackC is currently unused; update the SPV event path
to pass it through by adding a corresponding parameter to
SPVWalletEventsHandler.onTransactionReceived and forwarding `status` from
onSpvTransactionReceivedCallbackC into that call (adjusting all implementations
of SPVWalletEventsHandler to accept and handle the new FFITransactionContext
argument), or if you intend to ignore it, explicitly consume it (e.g., assign to
_ or call a mapping function) to avoid unused-parameter warnings; locate the
change at onSpvTransactionReceivedCallbackC and the
SPVWalletEventsHandler.onTransactionReceived declarations/implementations and
update them consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4daba1b2-98ed-48a5-b722-a55d3d1374a7

📥 Commits

Reviewing files that changed from the base of the PR and between a0dddb0 and 9aeef00.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • Cargo.toml
  • packages/rs-dpp/Cargo.toml
  • packages/rs-dpp/src/lib.rs
  • packages/rs-drive-abci/src/platform_types/masternode/v0/mod.rs
  • packages/rs-platform-wallet/Cargo.toml
  • packages/rs-platform-wallet/README.md
  • packages/rs-platform-wallet/examples/basic_usage.rs
  • packages/rs-platform-wallet/src/lib.rs
  • packages/rs-platform-wallet/src/platform_wallet_info/wallet_info_interface.rs
  • packages/rs-platform-wallet/src/platform_wallet_info/wallet_transaction_checker.rs
  • packages/rs-sdk-ffi/build_ios.sh
  • packages/rs-sdk-ffi/src/lib.rs
  • packages/rs-sdk-ffi/src/unified.rs
  • packages/rs-sdk/Cargo.toml
  • packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVClient.swift
  • packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVEventHandler.swift
  • packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift
💤 Files with no reviewable changes (5)
  • packages/rs-dpp/src/lib.rs
  • packages/rs-platform-wallet/src/lib.rs
  • packages/rs-sdk-ffi/src/lib.rs
  • packages/rs-dpp/Cargo.toml
  • packages/rs-sdk-ffi/src/unified.rs

@codecov
Copy link

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.93%. Comparing base (e398cd7) to head (45b23c9).
⚠️ Report is 4 commits behind head on v3.1-dev.

Files with missing lines Patch % Lines
.../src/platform_wallet_info/wallet_info_interface.rs 0.00% 6 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##           v3.1-dev    #3397      +/-   ##
============================================
- Coverage     79.93%   79.93%   -0.01%     
============================================
  Files          2861     2861              
  Lines        280230   280236       +6     
============================================
  Hits         223993   223993              
- Misses        56237    56243       +6     
Components Coverage Δ
dpp 71.82% <ø> (ø)
drive 82.30% <ø> (ø)
drive-abci 86.67% <ø> (ø)
sdk 36.55% <ø> (ø)
dapi-client 79.06% <ø> (ø)
platform-version ∅ <ø> (∅)
platform-value 83.36% <ø> (ø)
platform-wallet 76.09% <0.00%> (-0.46%) ⬇️
drive-proof-verifier 55.26% <ø> (ø)
🚀 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
Contributor

github-actions bot commented Mar 26, 2026

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

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.

@ZocoLini ZocoLini force-pushed the chore/bump-dashcore branch from a25b8ca to 399bc7f Compare March 26, 2026 19:39
Copy link
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

Verified 2 findings in the full PR diff (origin/v3.1-dev...HEAD). Both convergent findings are real and directly introduced on this branch. The on_transaction_status_changed report is not included because the source shows the callback slot was added and left nil, but the available repo code does not prove that this now causes a user-visible regression.

Reviewed commit: 399bc7f

🔴 2 blocking

🤖 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/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift`:
- [BLOCKING] lines 123-152: WalletService binds walletManager to an SPV client instance that it immediately destroys
  In the PR diff, `WalletService.init` now creates `self.spvClient` with dummy handlers, constructs `walletManager` from that client, then calls `self.spvClient.destroy()` and replaces it with a second `SPVClient` using real handlers. That leaves `walletManager` backed by the first, destroyed Rust client instead of the live one stored in `self.spvClient`. The later `initializeNewSPVClient()` path recreates `walletManager` after creating the final client, which reinforces that the initializer is inconsistent and likely wrong.

In `packages/rs-sdk-ffi/src/lib.rs`:
- [BLOCKING] lines 32-35: PR removes unified FFI exports but keeps shipped headers declaring `dash_unified_sdk_*`
  The branch deletes `packages/rs-sdk-ffi/src/unified.rs` and removes `mod unified;` / `pub use unified::*;` from `packages/rs-sdk-ffi/src/lib.rs`, so the `dash_unified_sdk_*` symbols are no longer implemented. However, the committed headers still declare those APIs in `packages/rs-sdk-ffi/include/dash_sdk_ffi.h:2148-2219` and `packages/rs-sdk-ffi/test_header.h:1608-1677`, and cbindgen configs still include the `dash_unified_sdk_*` prefix. Consumers compiling against the shipped headers will still expect those symbols and can fail at link/load time.

Comment on lines 32 to 35
mod system;
mod token;
mod types;
mod unified;
mod utils;
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔴 Blocking: PR removes unified FFI exports but keeps shipped headers declaring dash_unified_sdk_*

The branch deletes packages/rs-sdk-ffi/src/unified.rs and removes mod unified; / pub use unified::*; from packages/rs-sdk-ffi/src/lib.rs, so the dash_unified_sdk_* symbols are no longer implemented. However, the committed headers still declare those APIs in packages/rs-sdk-ffi/include/dash_sdk_ffi.h:2148-2219 and packages/rs-sdk-ffi/test_header.h:1608-1677, and cbindgen configs still include the dash_unified_sdk_* prefix. Consumers compiling against the shipped headers will still expect those symbols and can fail at link/load time.

source: codex

🤖 Fix this 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`:
- [BLOCKING] lines 32-35: PR removes unified FFI exports but keeps shipped headers declaring `dash_unified_sdk_*`
  The branch deletes `packages/rs-sdk-ffi/src/unified.rs` and removes `mod unified;` / `pub use unified::*;` from `packages/rs-sdk-ffi/src/lib.rs`, so the `dash_unified_sdk_*` symbols are no longer implemented. However, the committed headers still declare those APIs in `packages/rs-sdk-ffi/include/dash_sdk_ffi.h:2148-2219` and `packages/rs-sdk-ffi/test_header.h:1608-1677`, and cbindgen configs still include the `dash_unified_sdk_*` prefix. Consumers compiling against the shipped headers will still expect those symbols and can fail at link/load time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@QuantumExplorer how are you updating the headers?? any script to generate them or I should use cbindgen cli directly??

@ZocoLini ZocoLini force-pushed the chore/bump-dashcore branch from 399bc7f to 45b23c9 Compare March 27, 2026 02:53
@@ -12,9 +12,6 @@ pub use dashcore;
#[cfg(feature = "core_key_wallet")]
pub use key_wallet;

Copy link
Collaborator

Choose a reason for hiding this comment

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

We stll have manager and there is a feature flag to enable or disable it. For some crates we need it enabled and for some of them - disabled.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tell me one crate that need the manager to be enable and other one that needs it to be disble

shumkov added a commit that referenced this pull request Mar 27, 2026
Update rust-dashcore from 8cbae416 to 88eacdf1 (v0.42-dev HEAD).

Changes:
- Remove key-wallet-manager workspace dep (merged into key-wallet::manager)
- Set key-wallet default-features = false at workspace level for WASM safety
- Add core_key_wallet_manager feature in dpp (enables key-wallet/manager)
- Add core_key_wallet_manager to rs-sdk spv-client feature
- Platform-wallet explicitly enables key-wallet/manager
- Remove "std" feature from dashcore dep in dpp (removed upstream)
- Update WalletInfoInterface: add mark_instant_send_utxos, monitor_revision
- Update WalletTransactionChecker: &mut Wallet, update_balance param
- Swift SDK: migrate to unified FFIEventCallbacks pattern
- build_ios.sh: add header generation fallback, forward declarations
- Remove unified.rs (replaced by direct FFI usage)

Based on colleague's PR #3397 with proper feature gating preserved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shumkov added a commit that referenced this pull request Mar 27, 2026
Update rust-dashcore from 8cbae416 to 88eacdf1 (v0.42-dev HEAD).

Changes:
- Remove key-wallet-manager workspace dep (merged into key-wallet::manager)
- Set key-wallet default-features = false at workspace level for WASM safety
- Add core_key_wallet_manager feature in dpp (enables key-wallet/manager)
- Add core_key_wallet_manager to rs-sdk spv-client feature
- Platform-wallet explicitly enables key-wallet/manager
- Remove "std" feature from dashcore dep in dpp (removed upstream)
- Update WalletInfoInterface: add mark_instant_send_utxos, monitor_revision
- Update WalletTransactionChecker: &mut Wallet, update_balance param
- Swift SDK: migrate to unified FFIEventCallbacks pattern
- build_ios.sh: add header generation fallback, forward declarations
- Remove unified.rs (replaced by direct FFI usage)

Based on colleague's PR #3397 with proper feature gating preserved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shumkov added a commit that referenced this pull request Mar 27, 2026
Update rust-dashcore from 8cbae416 to 88eacdf1 (v0.42-dev HEAD).

Changes:
- Remove key-wallet-manager workspace dep (merged into key-wallet::manager)
- Set key-wallet default-features = false at workspace level for WASM safety
- Add core_key_wallet_manager feature in dpp (enables key-wallet/manager)
- Add core_key_wallet_manager to rs-sdk spv-client feature
- Platform-wallet explicitly enables key-wallet/manager
- Remove "std" feature from dashcore dep in dpp (removed upstream)
- Update WalletInfoInterface: add mark_instant_send_utxos, monitor_revision
- Update WalletTransactionChecker: &mut Wallet, update_balance param
- Swift SDK: migrate to unified FFIEventCallbacks pattern
- build_ios.sh: add header generation fallback, forward declarations
- Remove unified.rs (replaced by direct FFI usage)

Based on colleague's PR #3397 with proper feature gating preserved.

Co-Authored-By: Claude Opus 4.6 (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.

4 participants