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: shielded funding holds shield_guard through the unbounded ChainLock wait, blocking other shield-class operations #5518
While a shielded fund-from-asset-lock waits for its funding transaction's ChainLock, independent operations that take shield_guard (install_shielded_views, shield-from-account, abandon_shielded_identity_debit, …) can proceed. The user-facing funding flows keep their documented policy: a broadcast lock is pending, never failed, so the wait itself stays unbounded.
Current Behavior
shielded_fund_from_asset_lock takes shield_guard before funding and holds it to the end (fund_from_asset_lock.rs). Two branches wait for a ChainLock inside it with cl_wait = None from user-facing callers:
the IS-lock timeout fallback (resolve_chain_proof_after_is_timeout);
For that whole time every other operation behind shield_guard waits.
Possible Solution
Separate the finality wait from the guarded phases in both branches: release the guard for the ChainLock wait, then re-acquire it and re-validate what the guard protects (shielded key binding, attachment, the tracked lock's state, removal) before building and submitting with the ChainLock proof. A regression test should park finality, let independent guarded work proceed, and check that a removal during the wait prevents a stale submit.
Steps to Reproduce
Not reproduced as a separate symptom; found in review of #5460. Shape: shield from Core with a balance of ~80+ small coins so the InstantSend proof is too large; while it waits for the ChainLock, start another shield-class operation on the same wallet: it waits until the first finishes.
Context
Raised by thepastaclaw on #5460 (suggestion, non-blocking). Related: #5460, dashwallet-ios#1042.
Note from the review of #6203, for whoever takes this: a bind is one of the operations that waits here, and it waits holding more than shield_guard's other waiters do.
bind_shielded (and the persisted and add-account forms) takes the wallet generation's lifecycle gate, the coordinator's operation admission and shielded_config_lock, and only then, as the first step of the install, shield_guard. A re-bind that arrives while a funding waits for its ChainLock therefore parks with all three in hand. Until the funding returns:
a removal of the wallet waits (the gate);
a shielded Clear is refused with ShieldedOperationInProgress (the admission);
another bind, an account add, a tip address preparation and a token pool transfer or unshield of that wallet stall (the configuration lock).
Spends admitted through admit_shielded_spend used to stall there too; #6203 stops them taking the configuration lock, so they no longer do. The rest is this issue's to fix. The regression test suggested above could park a bind behind the finality wait as well, and check that a removal and a Clear are not held by it.
Correction to my note above: #6203 stops only three payments from waiting for the configuration lock (a token purchase from the shielded pool, the payment for a private contact request, a private document create), which never took it before. The seven credit pool spends admitted through admit_shielded_spend keep the lock for their binding check, as merged in #6178, so they still stall behind a bind queued on a funding. Releasing shield_guard during the finality wait, as this issue proposes, frees them too.
Activity
QuantumExplorer commentedon Nov 24, 2026
Note from the review of #6203, for whoever takes this: a bind is one of the operations that waits here, and it waits holding more than
shield_guard's other waiters do.bind_shielded(and the persisted and add-account forms) takes the wallet generation's lifecycle gate, the coordinator's operation admission andshielded_config_lock, and only then, as the first step of the install,shield_guard. A re-bind that arrives while a funding waits for its ChainLock therefore parks with all three in hand. Until the funding returns:ShieldedOperationInProgress(the admission);Spends admitted through
admit_shielded_spendused to stall there too; #6203 stops them taking the configuration lock, so they no longer do. The rest is this issue's to fix. The regression test suggested above could park a bind behind the finality wait as well, and check that a removal and a Clear are not held by it.QuantumExplorer commentedon Nov 24, 2026
Correction to my note above: #6203 stops only three payments from waiting for the configuration lock (a token purchase from the shielded pool, the payment for a private contact request, a private document create), which never took it before. The seven credit pool spends admitted through
admit_shielded_spendkeep the lock for their binding check, as merged in #6178, so they still stall behind a bind queued on a funding. Releasingshield_guardduring the finality wait, as this issue proposes, frees them too.