Repository navigation
Open
Description
Follow-ups deferred from #5512 (fix(swift-sdk)!: start SPV off the main thread), collected from @romchornyi's and thepastaclaw's reviews. None blocked the freeze fix; each is independent.
Status (2026-11-04): item 1 is a duplicate of #5191 and is struck out below; items 2–5 are still open on
v5.1-dev(spvStartsInFlightand the refusals are still Swift-only;PlatformWalletNativeTeardownCallsstill carriesspvStart).
Tracked in platform-wallet-ffi: SPV stop holds the manager registry read guard for its whole run #5191 (same stall, filed first); not part of this issue any more. Note:platform_wallet_manager_spv_stop/spv_clear_storageoutside the registry guard.spv_stopstill holds the guard on purpose today, see the comment onplatform_wallet_manager_spv_stopinrs-platform-wallet-ffi/src/spv.rs, so platform-wallet-ffi: SPV stop holds the manager registry read guard for its whole run #5191 needs the destroy barrier it describes before the guard can go. Both still hold the handle registry's read guard while waiting for the runtime'sshutdownlock, which the start now holds for the whole store open. A native stop overlapping a slow start (Kotlin's blocking stop) parks a queued registry writer and, through parking_lot's writer preference, every later registry reader for the rest of the migration. Pre-existing, but the same stall the start path now avoids; the same treatment (resolve the runtime under the guard, run outside it, owner flag for destroy) would finish the job.- Fail-fast SPV lifecycle admission in the runtime, not the Swift wrapper.
spvStartsInFlightand the refusals of a second start / blocking stop / clear live in Swift; Kotlin reachesSpvRuntimedirectly and observes different outcomes. Move the reservation / typed busy state intors-platform-wallet(try-lock onshutdownmapped to an error code), exposed through the FFI, so every caller gets the same rule and new SPV entry points cannot forget it. - SwiftExampleApp: gate Start/Pause and Clear across in-flight start and stop. During a slow start
spvIsRunningis still false, so the toggle reads "Start", Pause is unreachable and taps are refused; Clear is enabled during an in-flight start and during an async Pause (the client is removed before teardown completes). Disable on the in-flight start/stop state. - SwiftExampleApp: per-network pending stop.
isStoppingSpv/pendingSpvStoponWalletManagerStoreare store-wide, so a Pause on one network's manager disables and delays the start of another network's independent runtime. - Naming:
spvStartlives inPlatformWalletNativeTeardownCalls; the table is no longer teardown-only. - rust-dashcore (separate repo): a storage migration progress/state event, so hosts can show "upgrading storage" instead of a silent multi-second start.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(swift-sdk)!: start SPV off the main thread (#5512)