Skip to content

chore: update dashcore deps#3408

Open
shumkov wants to merge 1 commit intov3.1-devfrom
chore/dashcore-08ade6e8
Open

chore: update dashcore deps#3408
shumkov wants to merge 1 commit intov3.1-devfrom
chore/dashcore-08ade6e8

Conversation

@shumkov
Copy link
Copy Markdown
Collaborator

@shumkov shumkov commented Mar 26, 2026

Issue being fixed or feature implemented

Update rust-dashcore dependency from 8cbae416 to 08ade6e8 (v0.42-dev HEAD). Brings mempool support, EventHandler pattern, TransactionContext restructure, and wallet event improvements.

What was done?

  • Update all rust-dashcore workspace deps to rev 08ade6e8
  • Remove key-wallet-manager from workspace deps (merged into key-wallet::manager)
  • Remove "std" feature from dashcore dep in rs-dpp (removed upstream)
  • Fix key-wallet-manager imports → key_wallet::manager in rs-dpp and rs-platform-wallet
  • Fix DMNState.serviceOption<SocketAddr>: keep MasternodeStateV0.service as SocketAddr, change From to TryFrom with error when service is None
  • Fix WalletTransactionChecker signature: add update_balance param
  • Add mark_instant_send_utxos and monitor_revision to WalletInfoInterface impl
  • Update rs-sdk-ffi/unified.rs: pass FFIEventCallbacks to dash_spv_ffi_client_new
  • Regenerate Cargo.lock

How Has This Been Tested?

  • cargo check -p dpp --all-features passes
  • cargo check -p drive -p wasm-dpp -p simple-signer -p platform-value passes
  • Full workspace CI pending

Breaking Changes

  • key-wallet-manager crate no longer exists — use key_wallet::manager
  • DMNState.service is now Option<SocketAddr> — requires -deprecatedrpc=service flag on Core v24+
  • WalletInterface::process_mempool_transaction signature changed
  • DashSpvClient::new takes EventHandler parameter

Summary by CodeRabbit

  • Chores

    • Updated workspace dependency revisions and removed an obsolete wallet-manager workspace entry.
    • Rewired internal wallet-manager feature surface.
  • New Features

    • Added wallet monitoring methods for instant-send UTXO tracking and revision monitoring.
    • Unified SDK now accepts core event callbacks; SPV client accepts event handlers at construction and exposes a manual initial progress trigger.
  • Bug Fixes

    • Transaction checks can now optionally update balances during core transaction validation.

@github-actions github-actions bot added this to the v3.1.0 milestone Mar 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Updated workspace dependency revisions and removed key-wallet-manager; rewired features/re-exports to key-wallet::manager. Added FFI core_callbacks. Extended platform wallet interfaces and changed transaction checker signature to accept a mutable wallet and balance update flag. Swift SPV client now takes event handlers at init.

Changes

Cohort / File(s) Summary
Workspace manifest updates
Cargo.toml
Bumped git rev for dashcore, dash-spv, dash-spv-ffi, key-wallet, dashcore-rpc. Removed key-wallet-manager workspace entry.
rs-dpp manifest & lib
packages/rs-dpp/Cargo.toml, packages/rs-dpp/src/lib.rs
Removed dashcore "std" feature, removed optional key-wallet-manager dep; core_key_wallet_manager feature now uses dep:key-wallet + key-wallet/manager. Feature-gated re-export changed to key_wallet::manager.
rs-platform-wallet manifests, examples & lib
packages/rs-platform-wallet/Cargo.toml, packages/rs-platform-wallet/src/lib.rs, packages/rs-platform-wallet/examples/basic_usage.rs
Removed optional key-wallet-manager dependency; manager feature set to []. Crate-root re-export under manager now exposes key_wallet::manager. Deleted basic_usage.rs example.
Platform wallet implementations
packages/rs-platform-wallet/src/platform_wallet_info/...
Added mark_instant_send_utxos(&mut self, txid: &Txid) -> bool and monitor_revision(&self) -> u64. Changed check_core_transaction to accept wallet: &mut Wallet and new update_balance: bool parameter, and forward both update flags.
FFI unified config & headers
packages/rs-sdk-ffi/src/unified.rs, packages/rs-sdk-ffi/build.rs, packages/rs-sdk-ffi/include/dash_sdk_ffi.h, packages/rs-sdk-ffi/build_ios.sh
Added core_callbacks: FFIEventCallbacks to UnifiedSDKConfig and pass it to SPV client creation. Generated header now uses forward typedefs (e.g., FFIClientConfig, FFIDashSpvClient) instead of including dash_spv_ffi.h. build_ios.sh updated to handle missing headers, exclude key-wallet-manager from hash/clean steps, and generate missing FFI headers when needed.
Swift SDK SPV client & event handling
packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVClient.swift, .../SPVEventHandler.swift, .../Services/WalletService.swift
SPVClient initializer now accepts optional event handlers (progress/sync/network/wallet) and stores them; removed runtime setter/clear methods; added triggerProgressUpdate(). Added buildFFIEventCallbacks(...) helper and extended C callback signatures to carry extra data; WalletService now passes handlers at construction and triggers initial progress update.

Sequence Diagram(s)

sequenceDiagram
    participant App as Swift App
    participant SPV as SPVClient (Swift)
    participant FFI as FFI layer (UnifiedSDK)
    participant Core as dash_spv_ffi / Core SPV

    App->>SPV: init(..., progressHandler?, syncHandler?, networkHandler?, walletHandler?)
    SPV->>FFI: buildFFIEventCallbacks(...) / dash_spv_ffi_client_new(configPtr, callbacks)
    FFI->>Core: create SPV client with callbacks
    Core-->>FFI: invoke callbacks on events
    FFI-->>SPV: converted callbacks invoked (via FFIEventCallbacks)
    SPV-->>App: call stored Swift handlers (progress/sync/network/wallet)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped through Cargo and C,

Swapped managers for a friend named key,
Callbacks tucked into the core,
Mutable wallets learn to roar,
A tiny rabbit laughs with glee.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 97.06% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The PR title 'chore: update dashcore deps' is partially related to the changeset but lacks specificity; it refers to a real aspect (dependency updates) but omits critical context like removal of key-wallet-manager, API signature changes, and the specific update destination.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/dashcore-08ade6e8

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.

Copy link
Copy Markdown
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-drive-abci/tests/strategy_tests/masternodes.rs (2)

528-530: ⚠️ Potential issue | 🟠 Major

Same issue as regular masternodes: HPMN IP update logic needs Option handling.

This code has the same potential type mismatch as the regular masternode IP update logic on lines 351-354.

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

In `@packages/rs-drive-abci/tests/strategy_tests/masternodes.rs` around lines 528
- 530, The HPMN IP update assumes state.service is always present but it may be
an Option; update the logic around hpmn_list_item_b.state.service so it handles
the Option case (e.g., match or map the Option), preserving the existing port
when Some(SocketAddr) and leaving None untouched (or creating
Some(SocketAddr::new(IpAddr::V4(random_ip), old_port)) only when there is an
existing address). Refer to identifiers hpmn_list_item_b, state.service,
SocketAddr::new and IpAddr::V4(random_ip) when locating and fixing the code.

351-354: ⚠️ Potential issue | 🔴 Critical

Fix type mismatch: DMNState.service is Option<SocketAddr>, but code accesses it as bare SocketAddr.

Lines 351-354 call .port() directly on state.service and assign a bare SocketAddr without wrapping in Some(). Since DMNState.service is Option<SocketAddr>, this code will not compile. Update to:

Suggested fix
let old_port = masternode_list_item_b.state.service.as_ref().map(|s| s.port()).unwrap_or(1234);
masternode_list_item_b.state.service = Some(SocketAddr::new(IpAddr::V4(random_ip), old_port));

Same issue exists at line 528 for hpmn_list_item_b.

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

In `@packages/rs-drive-abci/tests/strategy_tests/masternodes.rs` around lines 351
- 354, DMNState.service is an Option<SocketAddr> but the code treats it as a
bare SocketAddr; change the reads to safely extract the port (e.g.,
masternode_list_item_b.state.service.as_ref().map(|s|
s.port()).unwrap_or(<default_port>)) and when assigning set the field to
Some(SocketAddr::new(...)) instead of a bare SocketAddr; apply the same change
for hpmn_list_item_b to unwrap the old port safely and wrap the new SocketAddr
in Some().
packages/rs-sdk-ffi/src/unified.rs (1)

368-372: ⚠️ Potential issue | 🟠 Major

Test is missing the new core_callbacks field — will not compile.

The UnifiedSDKConfig struct now requires a core_callbacks: FFIEventCallbacks field (added at lines 22-23), but the test at line 368-372 does not include it. This will cause a compilation error when the core feature is enabled.

🐛 Proposed fix
         let unified_config = UnifiedSDKConfig {
             core_config: core_config_ptr,
+            core_callbacks: FFIEventCallbacks::default(), // or appropriate test callbacks
             platform_config,
             enable_integration: true,
         };

Note: This fix assumes FFIEventCallbacks implements Default. If not, you'll need to construct an appropriate instance with the required callback function pointers.

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

In `@packages/rs-sdk-ffi/src/unified.rs` around lines 368 - 372, The test
constructs UnifiedSDKConfig without the new core_callbacks field causing a
compile error; update the UnifiedSDKConfig instantiation in the test to include
core_callbacks: either supply FFIEventCallbacks::default() (if Default is
implemented) or construct a suitable FFIEventCallbacks value with the required
callback pointers, e.g. add core_callbacks: <constructed_value> alongside
core_config: core_config_ptr, platform_config and enable_integration when
creating UnifiedSDKConfig.
🧹 Nitpick comments (1)
packages/rs-sdk-ffi/src/unified.rs (1)

18-28: Document the new core_callbacks field for FFI consumers.

The addition of core_callbacks: FFIEventCallbacks to the #[repr(C)] struct is a breaking change for FFI consumers. Consider adding a doc comment explaining the purpose of this field and how consumers should initialize it.

📝 Suggested documentation
 /// Unified SDK configuration combining both Core and Platform settings
 #[repr(C)]
 pub struct UnifiedSDKConfig {
     /// Core SDK configuration (ignored if core feature disabled)
     pub core_config: *const FFIClientConfig,
-    /// Event callbacks for core SPV client
+    /// Event callbacks for core SPV client.
+    /// These callbacks are invoked by the SPV client to notify the caller of events
+    /// such as sync progress, new blocks, and transaction updates.
     pub core_callbacks: FFIEventCallbacks,
     /// Platform SDK configuration
     pub platform_config: DashSDKConfig,
     /// Whether to enable cross-layer integration
     pub enable_integration: bool,
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rs-sdk-ffi/src/unified.rs` around lines 18 - 28, Add a doc comment
to the UnifiedSDKConfig struct that documents the new core_callbacks field:
explain that core_callbacks is an FFIEventCallbacks struct pointer value
consumers must populate when the core feature is enabled (or set to the
default/zeroed callbacks when not used), describe expected ownership/lifetime
and how it will be read by the runtime, and note compatibility impact for
existing consumers; update the struct definition comment near UnifiedSDKConfig
and reference the exact field name core_callbacks and the type FFIEventCallbacks
so callers know how to construct/initialize it correctly for FFI usage.
🤖 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-sdk-ffi/src/unified.rs`:
- Line 77: The UnifiedSDKConfig initialization is missing the required
core_callbacks field and the code calls .clone() on config.core_callbacks which
may not be Clone; update the test to include core_callbacks: <appropriate
FFIEventCallbacks value> when constructing UnifiedSDKConfig and remove the
.clone() call when calling dash_spv_ffi_client_new (use config.core_callbacks
directly or pass a reference/unsafe pointer as required by
dash_spv_ffi_client_new); specifically adjust the UnifiedSDKConfig construction
and the call site where dash_spv_ffi_client_new(config.core_config,
config.core_callbacks.clone()) is used so it supplies the explicit
core_callbacks field and no clone is invoked.

---

Outside diff comments:
In `@packages/rs-drive-abci/tests/strategy_tests/masternodes.rs`:
- Around line 528-530: The HPMN IP update assumes state.service is always
present but it may be an Option; update the logic around
hpmn_list_item_b.state.service so it handles the Option case (e.g., match or map
the Option), preserving the existing port when Some(SocketAddr) and leaving None
untouched (or creating Some(SocketAddr::new(IpAddr::V4(random_ip), old_port))
only when there is an existing address). Refer to identifiers hpmn_list_item_b,
state.service, SocketAddr::new and IpAddr::V4(random_ip) when locating and
fixing the code.
- Around line 351-354: DMNState.service is an Option<SocketAddr> but the code
treats it as a bare SocketAddr; change the reads to safely extract the port
(e.g., masternode_list_item_b.state.service.as_ref().map(|s|
s.port()).unwrap_or(<default_port>)) and when assigning set the field to
Some(SocketAddr::new(...)) instead of a bare SocketAddr; apply the same change
for hpmn_list_item_b to unwrap the old port safely and wrap the new SocketAddr
in Some().

In `@packages/rs-sdk-ffi/src/unified.rs`:
- Around line 368-372: The test constructs UnifiedSDKConfig without the new
core_callbacks field causing a compile error; update the UnifiedSDKConfig
instantiation in the test to include core_callbacks: either supply
FFIEventCallbacks::default() (if Default is implemented) or construct a suitable
FFIEventCallbacks value with the required callback pointers, e.g. add
core_callbacks: <constructed_value> alongside core_config: core_config_ptr,
platform_config and enable_integration when creating UnifiedSDKConfig.

---

Nitpick comments:
In `@packages/rs-sdk-ffi/src/unified.rs`:
- Around line 18-28: Add a doc comment to the UnifiedSDKConfig struct that
documents the new core_callbacks field: explain that core_callbacks is an
FFIEventCallbacks struct pointer value consumers must populate when the core
feature is enabled (or set to the default/zeroed callbacks when not used),
describe expected ownership/lifetime and how it will be read by the runtime, and
note compatibility impact for existing consumers; update the struct definition
comment near UnifiedSDKConfig and reference the exact field name core_callbacks
and the type FFIEventCallbacks so callers know how to construct/initialize it
correctly for FFI usage.
🪄 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: e076b88b-9332-4e5a-8950-c54e65f46e1c

📥 Commits

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

⛔ 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/execution/platform_events/core_based_updates/update_masternode_identities/update_operator_identity/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs
  • packages/rs-drive-abci/src/platform_types/masternode/mod.rs
  • packages/rs-drive-abci/src/platform_types/masternode/v0/mod.rs
  • packages/rs-drive-abci/src/platform_types/validator/v0/mod.rs
  • packages/rs-drive-abci/tests/strategy_tests/masternode_list_item_helpers.rs
  • packages/rs-drive-abci/tests/strategy_tests/masternodes.rs
  • packages/rs-platform-wallet/Cargo.toml
  • 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/src/unified.rs

@shumkov shumkov force-pushed the chore/dashcore-08ade6e8 branch 4 times, most recently from c986d22 to 6099764 Compare March 26, 2026 14:31
@codecov
Copy link
Copy Markdown

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 (7db14fa).
⚠️ 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    #3408      +/-   ##
============================================
- 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.

@shumkov shumkov force-pushed the chore/dashcore-08ade6e8 branch from 6099764 to b435010 Compare March 26, 2026 14:53
Copy link
Copy Markdown
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 (2)
packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift (1)

165-181: ⚠️ Potential issue | 🟠 Major

Recreated clients should publish a fresh progress snapshot too.

init(...) immediately calls triggerProgressUpdate(), but this path does not. After stopSync() / switchNetwork() / clearSpvStorage(), syncProgress can keep the destroyed client's state until the next sync event, which makes the UI stale and can make Line 222 think sync is still running.

Possible fix
       self.spvClient = try! SPVClient(
           network: self.self.network.sdkNetwork,
           dataDir: dataDir,
           startHeight: 0,
           progressHandler: SPVProgressUpdateEventHandlerImpl(walletService: self),
           syncHandler: SPVSyncEventsHandlerImpl(walletService: self),
           networkHandler: SPVNetworkEventsHandlerImpl(walletService: self),
           walletHandler: SPVWalletEventsHandlerImpl(walletService: self)
       )
+      self.spvClient.triggerProgressUpdate()
       
       try! self.spvClient.setMasternodeSyncEnabled(self.masternodesEnabled)
🤖 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 165 - 181, When re-creating SPV and wallet clients the old sync
state can persist; after constructing self.spvClient and initializing
self.walletManager (the same block that currently uses SPVClient(...) and
CoreWalletManager(...)), force-publish a fresh progress snapshot by calling the
same mechanism used in init(...), e.g. invoke triggerProgressUpdate() or
explicitly reset syncProgress to the not-started state and publish it; do this
immediately after the SPVClient and walletManager creation so
stopSync()/switchNetwork()/clearSpvStorage() won't leave stale state visible to
the UI or to code that checks syncProgress.
packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVEventHandler.swift (1)

218-229: ⚠️ Potential issue | 🟠 Major

The new transaction-state signals are discarded instead of forwarded to Swift handlers.

The confirmedTxids and confirmedTxidCount parameters in onSpvBlockProcessedCallbackC (lines 222–223) are never used; the status: FFITransactionContext in onSpvTransactionReceivedCallbackC (line 433) is ignored; and on_transaction_status_changed is wired to nil (line 424). This means mempool/confirmation/InstantSend status updates from dash-spv-ffi never reach the Swift side. Add a transaction-status handler method to SPVWalletEventsHandler and wire it before shipping mempool-status support.

Also applies to: 423-425, 431-457

🤖 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 218 - 229, The callback onSpvBlockProcessedCallbackC currently
ignores confirmedTxids/confirmedTxidCount—decode the confirmedTxids pointer into
a Swift [Data] (using bytePtrIntoData per-entry) and forward them to a new
SPVWalletEventsHandler method (e.g., onTransactionConfirmations or
onTransactionStatusChanged) so block-processed events include confirmed txids;
also update onSpvTransactionReceivedCallbackC to read the FFITransactionContext
status parameter and call that same new handler with the transaction id and
status, and stop passing nil for on_transaction_status_changed (wire the FFI
callback to your Swift wrapper) so mempool/confirmation/InstantSend status
updates from dash-spv-ffi reach Swift. Ensure you add the new method signature
to SPVWalletEventsHandler and invoke it from both onSpvBlockProcessedCallbackC
and onSpvTransactionReceivedCallbackC, preserving existing parameters like
height/hash where applicable.
🤖 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-sdk-ffi/build_ios.sh`:
- Around line 189-219: The fallback host build may not produce
KEY_WALLET_HEADER_PATH or SPV_HEADER_PATH but later the script always writes
module.modulemap including DashSPVFFI and KeyWalletFFI entries; update the
script to either exit non‑zero when the required headers are missing (fail fast)
or conditionally include the DashSPVFFI and KeyWalletFFI module entries only
when SPV_HEADER_PATH and KEY_WALLET_HEADER_PATH exist (i.e., gate the modulemap
generation on the presence checks you already perform), ensuring
module.modulemap is consistent with the copied headers.

---

Outside diff comments:
In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/Services/WalletService.swift`:
- Around line 165-181: When re-creating SPV and wallet clients the old sync
state can persist; after constructing self.spvClient and initializing
self.walletManager (the same block that currently uses SPVClient(...) and
CoreWalletManager(...)), force-publish a fresh progress snapshot by calling the
same mechanism used in init(...), e.g. invoke triggerProgressUpdate() or
explicitly reset syncProgress to the not-started state and publish it; do this
immediately after the SPVClient and walletManager creation so
stopSync()/switchNetwork()/clearSpvStorage() won't leave stale state visible to
the UI or to code that checks syncProgress.

In `@packages/swift-sdk/Sources/SwiftDashSDK/Core/SPV/SPVEventHandler.swift`:
- Around line 218-229: The callback onSpvBlockProcessedCallbackC currently
ignores confirmedTxids/confirmedTxidCount—decode the confirmedTxids pointer into
a Swift [Data] (using bytePtrIntoData per-entry) and forward them to a new
SPVWalletEventsHandler method (e.g., onTransactionConfirmations or
onTransactionStatusChanged) so block-processed events include confirmed txids;
also update onSpvTransactionReceivedCallbackC to read the FFITransactionContext
status parameter and call that same new handler with the transaction id and
status, and stop passing nil for on_transaction_status_changed (wire the FFI
callback to your Swift wrapper) so mempool/confirmation/InstantSend status
updates from dash-spv-ffi reach Swift. Ensure you add the new method signature
to SPVWalletEventsHandler and invoke it from both onSpvBlockProcessedCallbackC
and onSpvTransactionReceivedCallbackC, preserving existing parameters like
height/hash where applicable.
🪄 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: 79c67f3d-c81e-4a11-817b-9aa3030b4642

📥 Commits

Reviewing files that changed from the base of the PR and between c986d22 and b435010.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • Cargo.toml
  • packages/rs-dpp/Cargo.toml
  • packages/rs-dpp/src/lib.rs
  • packages/rs-platform-wallet/Cargo.toml
  • 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.rs
  • packages/rs-sdk-ffi/build_ios.sh
  • packages/rs-sdk-ffi/include/dash_sdk_ffi.h
  • packages/rs-sdk-ffi/src/unified.rs
  • 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 (1)
  • packages/rs-platform-wallet/examples/basic_usage.rs
✅ Files skipped from review due to trivial changes (1)
  • packages/rs-sdk-ffi/include/dash_sdk_ffi.h
🚧 Files skipped from review as they are similar to previous changes (7)
  • packages/rs-platform-wallet/Cargo.toml
  • packages/rs-platform-wallet/src/lib.rs
  • packages/rs-sdk-ffi/src/unified.rs
  • packages/rs-dpp/src/lib.rs
  • packages/rs-platform-wallet/src/platform_wallet_info/wallet_transaction_checker.rs
  • packages/rs-dpp/Cargo.toml
  • Cargo.toml

@shumkov shumkov force-pushed the chore/dashcore-08ade6e8 branch from b435010 to d711c0b Compare March 26, 2026 15:08
@shumkov shumkov changed the title chore: update dashcore deps to 08ade6e8 chore: update dashcore deps Mar 26, 2026
@shumkov shumkov force-pushed the chore/dashcore-08ade6e8 branch from d711c0b to b5441bd Compare March 26, 2026 15:31
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

Verified 2 blocking issues in the checked-in source. The convergent ABI finding is confirmed directly in Rust and the exported C header, and the standalone header regression is also real. I did not include the platform-wallet manager report because this checkout alone does not prove the exact upstream key-wallet API at rev 88eacdf1.

Reviewed commit: b5441bd

🔴 2 blocking

1 additional finding

🔴 blocking: UnifiedSDKConfig in the exported C header no longer matches the Rust ABI

packages/rs-sdk-ffi/include/dash_sdk_ffi.h (lines 687-694)

packages/rs-sdk-ffi/src/unified.rs:19-27 adds a new core_callbacks: FFIEventCallbacks field between core_config and platform_config, and dash_unified_sdk_create now passes config.core_callbacks into dash_spv_ffi_client_new. The checked-in header still declares UnifiedSDKConfig with only core_config, platform_config, and enable_integration, so C/Swift callers will build against the wrong struct size and field offsets.

🤖 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/include/dash_sdk_ffi.h`:
- [BLOCKING] lines 687-694: UnifiedSDKConfig in the exported C header no longer matches the Rust ABI
  `packages/rs-sdk-ffi/src/unified.rs:19-27` adds a new `core_callbacks: FFIEventCallbacks` field between `core_config` and `platform_config`, and `dash_unified_sdk_create` now passes `config.core_callbacks` into `dash_spv_ffi_client_new`. The checked-in header still declares `UnifiedSDKConfig` with only `core_config`, `platform_config`, and `enable_integration`, so C/Swift callers will build against the wrong struct size and field offsets.
- [BLOCKING] lines 15-21: dash_sdk_ffi.h is no longer self-contained after removing dash_spv_ffi.h
  The header comment at lines 15-21 says the file is self-contained, but it now only forward-declares `FFIClientConfig`. Later declarations still expose `FFISyncProgress *`, `FFISpvStats *`, and `FFIBalance *` (`packages/rs-sdk-ffi/include/dash_sdk_ffi.h:880-916`), and none of those typedefs are declared anywhere in this header. Any consumer including `dash_sdk_ffi.h` by itself will hit unknown-type compile errors.

Comment on lines +15 to +21
/* Forward declarations for types from dash-spv-ffi.
* When building the full unified SDK, the merge step in build_ios.sh replaces
* this header with one that includes the complete dash_spv_ffi.h definitions.
* These forward declarations keep the header self-contained for local use. */
#ifndef DASH_SPV_FFI_H
typedef struct FFIClientConfig FFIClientConfig;
#endif
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.

🔴 Blocking: dash_sdk_ffi.h is no longer self-contained after removing dash_spv_ffi.h

The header comment at lines 15-21 says the file is self-contained, but it now only forward-declares FFIClientConfig. Later declarations still expose FFISyncProgress *, FFISpvStats *, and FFIBalance * (packages/rs-sdk-ffi/include/dash_sdk_ffi.h:880-916), and none of those typedefs are declared anywhere in this header. Any consumer including dash_sdk_ffi.h by itself will hit unknown-type compile errors.

source: unknown

🤖 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/include/dash_sdk_ffi.h`:
- [BLOCKING] lines 15-21: dash_sdk_ffi.h is no longer self-contained after removing dash_spv_ffi.h
  The header comment at lines 15-21 says the file is self-contained, but it now only forward-declares `FFIClientConfig`. Later declarations still expose `FFISyncProgress *`, `FFISpvStats *`, and `FFIBalance *` (`packages/rs-sdk-ffi/include/dash_sdk_ffi.h:880-916`), and none of those typedefs are declared anywhere in this header. Any consumer including `dash_sdk_ffi.h` by itself will hit unknown-type compile errors.

@shumkov shumkov force-pushed the chore/dashcore-08ade6e8 branch from b5441bd to fd5e029 Compare March 27, 2026 05:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 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: "3b3fb3d624a293ef533d19d98bc687b1d48c8d08da35214a3b39145643d9712d"
)

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.

@shumkov shumkov force-pushed the chore/dashcore-08ade6e8 branch 3 times, most recently from f740039 to 8883e82 Compare March 27, 2026 14:49
…t-manager)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shumkov shumkov force-pushed the chore/dashcore-08ade6e8 branch from 8883e82 to 7db14fa Compare March 27, 2026 15:11
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