You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
swift-sdk: shieldedIdentityDebitRecoveryRecords parks a thread with no deadline, and token pool watch/unwatch are not admitted #6177
Carried over from #6060 so that issue can close with the spend wrappers.
1. shieldedIdentityDebitRecoveryRecords waits for the store lock with no deadline
PlatformWalletManager.shieldedIdentityDebitRecoveryRecords(walletId:) (PlatformWalletManagerShieldedRecovery.swift) runs its FFI call from Task.detached. The export's block_on_worker parks that thread while the coordinator waits for the shielded store lock, and a scan holds the write lock across its network batches. Reopening or refreshing a screen that reads the records during a slow scan can stack parked threads. SwiftExampleApp coalesces these reads (#6051), which limits it but does not remove it.
localShieldedBalanceSnapshot already does both halves of the fix: its native lock wait is bounded (100 ms) and it is admitted as a native operation. The recovery read should do the same. The bound belongs in Rust (the coordinator read behind platform_wallet_manager_shielded_identity_debit_recovery_records), not in Swift.
Admitting the read without the bound would be worse than today: shutdown() would then wait for a read parked behind a scan, and deleteWallet would be refused for as long. That is why the spend wrapper change left it alone.
2. shieldedTokenPoolWatch and shieldedTokenPoolUnwatch are not admitted
Both change durable wallet state (the set of token pools a wallet scans) from Task.detached without admitNativeOp / finishNativeOp, so shutdown() does not wait for them and deleteWallet is not refused while one runs. They are not payments, so they were left out of the spend wrapper change. PlatformWalletNativeShieldedSpendCalls and ShieldedSpendAdmissionTests give the pattern and the test harness.
syncShieldedNow and syncShieldedWalletNow are also unadmitted; #6004 owns that decision.
Activity