Skip to content

platform-wallet: token purchase, private contact request and private document payments do not hold the shielded coordinator's operation admission #6176

Done

Description

@QuantumExplorer

What happens

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:

  • PlatformWallet::shielded_token_purchase_from_pool (type 28)
  • PlatformWallet::pay_private_contact_request (behind send_private_contact_request, accept_private_contact_request, accept_contact_request_replying_in_kind)
  • PlatformWallet::create_private_document_entry (type 29)

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

  1. added this to the v5.1.0 milestone on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions