Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ members = [
]

[workspace.dependencies]
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "70d4bf8e36057c58e02d56769a6e9760f701dd06" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "70d4bf8e36057c58e02d56769a6e9760f701dd06" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "70d4bf8e36057c58e02d56769a6e9760f701dd06" }
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "70d4bf8e36057c58e02d56769a6e9760f701dd06" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "70d4bf8e36057c58e02d56769a6e9760f701dd06" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "70d4bf8e36057c58e02d56769a6e9760f701dd06" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "70d4bf8e36057c58e02d56769a6e9760f701dd06" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "70d4bf8e36057c58e02d56769a6e9760f701dd06" }
dashcore = { git = "https://github.com/bfoss765/rust-dashcore", rev = "b5dff6de05e4a354680e5b01a54bae9e642a6ad0" }
dash-network-seeds = { git = "https://github.com/bfoss765/rust-dashcore", rev = "b5dff6de05e4a354680e5b01a54bae9e642a6ad0" }
dash-spv = { git = "https://github.com/bfoss765/rust-dashcore", rev = "b5dff6de05e4a354680e5b01a54bae9e642a6ad0" }
key-wallet = { git = "https://github.com/bfoss765/rust-dashcore", rev = "b5dff6de05e4a354680e5b01a54bae9e642a6ad0" }
key-wallet-ffi = { git = "https://github.com/bfoss765/rust-dashcore", rev = "b5dff6de05e4a354680e5b01a54bae9e642a6ad0" }
key-wallet-manager = { git = "https://github.com/bfoss765/rust-dashcore", rev = "b5dff6de05e4a354680e5b01a54bae9e642a6ad0" }
dash-network = { git = "https://github.com/bfoss765/rust-dashcore", rev = "b5dff6de05e4a354680e5b01a54bae9e642a6ad0" }
dashcore-rpc = { git = "https://github.com/bfoss765/rust-dashcore", rev = "b5dff6de05e4a354680e5b01a54bae9e642a6ad0" }
Comment on lines +55 to +62

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: Repin the temporary contributor-fork dependencies before merge

All eight rust-dashcore workspace dependencies now use bfoss765/rust-dashcore at b5dff6de05e4a354680e5b01a54bae9e642a6ad0. The head commit explicitly describes this as a temporary pin and states that dashpay/rust-dashcore#924 must land; that producer PR is currently open and unmerged, with this revision as its contributor-fork head. Merging this exact head would make clean production builds depend on a contributor-controlled repository rather than the project's governed upstream. After #924 lands, repin these entries to the resulting revision in https://github.com/dashpay/rust-dashcore and update Cargo.lock in the same commit.

source: ['codex']

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Acknowledged, and the finding is correct — but it resolves upstream rather than by a change on this branch, so the pin is deliberately unchanged.

State verified just now via the API:

There is no governed-upstream revision to point at yet: both producer PRs originate from the contributor fork into dashpay/rust-dashcore:dev, so every revision containing take_persistence_receiver() exists only on the fork today. Repinning now would mean reverting this PR's root-cause fix back onto the lossy broadcast path that caused #4069 in the first place.

So this is a genuine merge blocker and should stay flagged — the resolution is sequencing, not a code change here. Once #909 and #924 land on dashpay/rust-dashcore:dev, this branch repins all eight workspace entries to https://github.com/dashpay/rust-dashcore at the merged revision, with Cargo.lock updated in the same commit. Happy to keep this thread open as that gate.

One note for whoever performs the repin, found while verifying the above: the pinned revision b5dff6de has diverged from #924's current head (20 ahead / 1 behind). #924 has since gained f0ab7d89, which makes the persistence channel opt-in — the send half is None until take_persistence_receiver() lazily creates it. This consumer already satisfies that contract (the manager takes the receiver exactly once, before it is published to producers), so no adaptation is needed here, but the repin should target the merged dev revision rather than a rebase of b5dff6de.


tokio-metrics = "0.5"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,14 @@ internal object WalletManagerNative {
external fun identitySyncStop(managerHandle: Long)
external fun identitySyncIsRunning(managerHandle: Long): Boolean

/**
* Whether the durable sync watermark has been frozen this session because
* persistence events were dropped or a store was rejected — the persisted
* `syncedHeight` is held behind the chain tip and a rescan is pending on
* the next launch. Latches for the process lifetime.
*/
external fun syncFaultDetected(managerHandle: Long): Boolean

/** Shielded loop — only present when the native library is built with shielded. */
external fun shieldedSyncStart(managerHandle: Long)
external fun shieldedSyncStop(managerHandle: Long)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,21 @@ class PlatformWalletManager(
mapNativeErrors { WalletManagerNative.platformAddressSyncIsRunning(managerHandle) }
}

/**
* Whether the native manager has frozen its durable sync watermark this
* session (dashpay/platform#4069). `true` means the wallet-event adapter
* dropped record-bearing events, or a persistence `store()` was rejected,
* so the persisted `syncedHeight` is deliberately held behind the chain
* tip and a rescan is pending on the next launch. Poll this to surface a
* hard "verification failed / rescan pending" state instead of leaving
* the fault visible only in the error logs.
*
* The flag latches: once `true` it stays `true` for the process lifetime.
*/
suspend fun syncFaultDetected(): Boolean = withContext(Dispatchers.IO) {
mapNativeErrors { WalletManagerNative.syncFaultDetected(managerHandle) }
}

/**
* Reset the platform-address (BLAST) sync state — the native side of the
* Sync tab's "Clear" action (#3959), port of Swift
Expand Down
24 changes: 24 additions & 0 deletions packages/rs-platform-wallet-ffi/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,30 @@ pub unsafe extern "C" fn platform_wallet_manager_persistence_capabilities(
PlatformWalletFFIResult::ok()
}

/// Whether the manager has frozen its durable sync watermark this session
/// (dashpay/platform#4069).
///
/// `true` means the wallet-event adapter dropped record-bearing events (a
/// broadcast lag) or had a persistence `store()` rejected, so the persisted
/// `syncedHeight` is deliberately held behind the chain tip and a rescan is
/// pending on the next launch. Hosts poll this to surface a hard
/// "verification failed / rescan pending" state instead of the fault being
/// visible only in error logs.
///
/// The flag latches: once `true` it stays `true` for the process lifetime.
#[no_mangle]
pub unsafe extern "C" fn platform_wallet_manager_sync_fault_detected(
handle: Handle,
out_detected: *mut bool,
) -> PlatformWalletFFIResult {
check_ptr!(out_detected);

let option =
PLATFORM_WALLET_MANAGER_STORAGE.with_item(handle, |manager| manager.sync_fault_detected());
*out_detected = unwrap_option_or_return!(option);
PlatformWalletFFIResult::ok()
}

/// Map the C `has_x: bool` + `x` companion-pair idiom to a Rust `Option<u32>`.
///
/// `has == true` yields `Some(value)` — including `Some(0)`, kept distinct
Expand Down
20 changes: 13 additions & 7 deletions packages/rs-platform-wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,8 @@ tokio = { version = "1", features = ["sync", "rt", "time", "macros"] }
tokio-util = { version = "0.7.12" }
dash-async = { path = "../rs-dash-async" }

# Logging. `log` sits alongside `tracing` for on-device (Android)
# diagnostics: the JNI layer installs `android_logger` as the global `log`
# logger (logcat tag `DashSDK`), while the only `tracing` subscriber the
# Kotlin SDK installs (`dash_sdk_enable_logging`) writes to stdout, which
# Android discards — so breadcrumbs that must be visible in logcat are
# emitted through BOTH facades. See `network/encrypted_document.rs`.
# Logging
tracing = "0.1"
log = "0.4"

# Encoding
hex = "0.4"
Expand All @@ -56,6 +50,18 @@ image = { version = "0.25", default-features = false, features = ["png", "jpeg",
# Security
zeroize = "1"

# `log` facade. `changeset/core_bridge.rs` emits watermark-freeze breadcrumbs
# through `log` so they reach Android logcat (the JNI layer installs
# `android_logger` as the global `log` logger, tag `DashSDK`; the Kotlin SDK's
# only `tracing` subscriber writes to stdout, which Android discards).
# Declared here — deliberately NOT inside the `tracing` block above — so this
# crate owns the dependency independently of the encrypted-txMetadata change
# (#4277) that first introduced a `log` line: that change was reverted on
# v4.2-dev (#4279), and a `log` line living in that reverted region gets
# dropped by the 3-way merge, leaving the `log::` calls in core_bridge.rs
# undeclared (E0433). Keeping it in this untouched region makes it survive.
log = "0.4"

# Shielded pool (optional, behind `shielded` feature)
grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", tag = "v5.0.1", optional = true }
# Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set
Expand Down
Loading
Loading