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
platform-wallet: token purchase, private contact request and private document payments do not hold the shielded coordinator's operation admission #6176
A shielded Clear (NetworkShieldedCoordinator::clear) excludes an operation only if that operation holds the coordinator's operation admission (operation_guard(), the read side of operation_admission). On v5.1-dev three spends from a shielded pool hold the wallet generation's lifecycle gate, so a wallet removal waits for them, but not that admission:
So a Clear issued while one of them is proving or broadcasting is neither refused nor made to wait. It can purge the notes the payment reserved, its saved transition in shielded_pending_spends, and for a private contact request its journal record, while the payment still goes on to broadcast and then writes its activity and settlement into a store that was reset under it.
Evidence
operation_guard() is acquired in packages/rs-platform-wallet/src/wallet/platform_wallet.rs by bind_shielded, bind_shielded_from_persisted, shielded_add_account, shielded_token_transfer, shielded_token_unshield, write_dashpay_profile, and in wallet/shielded/tips.rs by the tip account preparation. The three functions above take generation_payment_guard() and check is_current_generation() only.
The asset-lock funded paths (shielded_fund_from_asset_lock, the wallet drain, the CoinJoin drain, shielded_seed_pool_notes) hold neither the lifecycle gate nor the admission; they hold shield_guard only. #5516 tracks the removal side of that.
Why it was not fixed with the credit pool spends
The pull request that gives the seven credit pool spends both guards (transfer, unshield, withdraw, identity top-up, identity create, shield from account, shield from identity) leaves these out on purpose:
A private contact request payment runs inside the DashPay send, which takes the lifecycle gate in a callback after the host's signature returns (wallet/identity/network/contact_requests.rs). Adding a second write-preferring lock there needs its own ordering analysis against bind_shielded (gate, then admission, then shielded_config_lock, then shield_guard) and against Clear.
Asset-lock funding can wait for a ChainLock with no deadline. Holding the admission across that wait would make Clear refuse (or wait) for as long.
Suggested fix
Take coordinator.operation_guard() right after the liveness check in the three functions, in the same order the credit pool spends use (PlatformWallet::admit_shielded_spend), after confirming no caller already holds it. Add the paused-spend test used for the credit pool spends: while the spend is held, the coordinator reports an admitted operation.
Activity