Skip to content

Asset lock becomes permanently unusable if the IS-lock wait times out — tracked record stuck at broadcast, block processing pins, and re-import cannot rebuild it #930

Open

Description

@DashBot-0001

Summary

If the InstantSend-lock wait for a freshly broadcast asset lock times out, the funding is left permanently unusable. The asset lock transaction is on chain, confirmed and ChainLocked, and the wallet keeps a tracked record of it — but that record stays at status = broadcast forever, and every UI path that could consume it refuses it as "not ready".

There is no recovery: restarting does not retry, and a fresh wallet import cannot reconstruct the record at all. Funds committed to that asset lock cannot be claimed by the application afterwards.

Observed on v1.0.0-weekly.20260721+81fddd0a1 (mainnet, GUI, standard BIP44 wallet).

What happens

Three shield-from-core operations earlier the same day completed normally. The IS-lock wait resolved quickly each time:

entered outpoint=…:0 timeout=Some(300s)   →  result_variant=VerifiedAssetLockConsumed   (46s)
entered outpoint=…:0 timeout=Some(300s)   →  result_variant=VerifiedAssetLockConsumed   ( 8s)
entered outpoint=…:0 timeout=Some(300s)   →  result_variant=VerifiedAssetLockConsumed   ( 9s)

The fourth one did not resolve inside the window:

T+00:00  entered outpoint=…:0 timeout=Some(300s)
T+00:00  New wallet transaction detected txid=… context=…
T+00:00  Removed spent UTXO outpoint=… txid=…      (inputs consumed, funds committed)
T+05:00  IS-lock did not propagate within 300s for shielded fund-from-asset-lock (tx …)
T+05:00  Transaction … not yet chain-locked, waiting for ChainLock

and nothing ever advanced past that point.

The on-chain state was fine the whole time. Queried independently: the asset lock is a type=8 / version=3 transaction, mined, txlock=true (so an InstantSend lock does exist), and subsequently ChainLocked. The OP_RETURN credit output is unspent, as expected for an asset lock. So the local wait failed while the network condition it was waiting for had actually been met.

Why it is unrecoverable

1. Restart does not retry. After restart the tracked record is still status = broadcast. ChainLocks continue to be processed and verified, but with no effect:

ChainLockProcessed(chainlock_height=…, accounts=0, finalized_txids=0)
ChainLockProcessed(chainlock_height=…, accounts=0, finalized_txids=0)

2. Block processing stops at that block and never resumes. core_sync_state.last_processed_height stays pinned at the height of the asset lock transaction while synced_height keeps advancing (30+ blocks ahead and growing). Manually rewinding last_processed_height by one block does not help — the filter pass reports found 0 matching blocks and skips it again.

3. Every consuming path rejects it. "Recover an unfinished funding" lists the tracked lock correctly (address, amount, Status: Sent to the network. Waiting for confirmation.), but selecting it and submitting yields:

This funding isn't ready to use yet. Wait for it to be confirmed on the Dash network, then try again.

The check reads the stale local status, not chain state. det-cli offers no alternative: every relevant command (identity-credits-topup, shielded-shield-from-core, …) is documented as "Creates an asset lock", i.e. it makes a new one rather than consuming an existing one.

4. A fresh import cannot rebuild the record. Importing the same recovery phrase into a clean data directory produces a healthy wallet that rescans and finds the same 13 transactions — including the asset lock transaction itself — but its asset_locks table stays empty. The tracked-lock record appears to be written only when the app itself creates the lock; it is never reconstructed from chain data. So the only record of that funding lives in the data directory of the instance that failed.

Two-instance comparison

This is the part I would emphasise, because it separates "corrupted local state" from a genuine code path problem. Two independent instances, same wallet, different data directories:

instance A (upgraded, had run the pre-1.0 migration) instance B (clean dir, fresh import of the same phrase)
core_address_pool 380 380
core_transactions / core_utxos 13 / 13 13 / 13
filter matched 0 1200
asset_locks rows 4 (incl. the stuck one) 0
last_processed_height pinned at the asset-lock block pinned at the same block

Instance B is demonstrably healthy — its filters match, it rescanned from birth height, it found every transaction. It still stops at exactly the same block. So this is not migration damage or a corrupted store; both instances hit the same wall at the same transaction.

(Instance A additionally shows matched: 0, i.e. its filter matching is broken too — possibly a second, separate issue. But it is not the cause of the stall, since B stalls identically with healthy matching.)

Reproduction

  1. Shield from core wallet (or any flow that creates an asset lock), so the app enters the IS-lock wait.
  2. Arrange for the IS-lock not to be observed within the 300 s window — in my case this happened spontaneously on mainnet while three earlier locks the same day resolved in under a minute.
  3. Observe IS-lock did not propagate within 300s, then not yet chain-locked, waiting for ChainLock.
  4. Wait for the transaction to be mined and ChainLocked (verify independently that txlock is true and the block is ChainLocked).
  5. Restart the app. Try "Recover an unfinished funding".

Expected: the app re-checks chain state, sees the lock is confirmed and ChainLocked, and lets it be consumed.
Actual: status remains broadcast, block processing stays pinned at that block, and the funding is rejected as not ready — permanently.

Suggested directions

  • Re-validate from chain state rather than trusting the stored status. The readiness check for a tracked lock should consult confirmations / ChainLock at the time of use. The information needed was available and correct throughout; only the local record was stale.
  • Make the IS-lock wait's timeout non-terminal. Falling back to "wait for ChainLock" is the right intent, but that fallback never completes. Once the tx is in a ChainLocked block, that should be sufficient to advance broadcast → ChainLocked → consumable.
  • Do not let one unresolved transaction pin last_processed_height. A single pending item blocking all subsequent block processing turns a transient network hiccup into permanent loss of access.
  • Consider reconstructing tracked asset locks during rescan. Since the transaction is recognisably type=8 and belongs to the wallet, a fresh import could rebuild the record — which would make wallet re-import an actual recovery path. Today it is not.

Impact

Funds committed to the asset lock cannot be claimed through the application. They are not lost on chain — the credit output is intact and only the owner's keys can claim it, and asset locks have no expiry window (unlike asset unlocks) — but the app offers no route to it, and re-importing the wallet does not help. For a user without a second instance to compare against, the symptom presents as "the balance disappeared", which is alarming and hard to diagnose.

Related


Investigated and drafted with assistance from Claude (Anthropic). Log lines are quoted verbatim with identifiers elided; on-chain facts were verified independently of the application. Amounts, addresses, transaction ids and block heights are omitted deliberately.

Activity

  1. DashBot-0001 commented on Jul 23, 2026

    @DashBot-0001
    Author

    Follow-up: everything needed to rebuild the tracked record is already on chain, and it is precisely matchable against the wallet. This turns suggestion 4 above ("reconstruct tracked asset locks during rescan") from a nice-to-have into something demonstrably implementable.

    The credit output identifies its own owner. Decoding the stuck transaction with getrawtransaction <txid> 1 on a Core node gives:

    type = 8, version = 3
    assetLockTx.creditOutputs[0] = {
        value,
        scriptPubKey: OP_DUP OP_HASH160 <hash160> OP_EQUALVERIFY OP_CHECKSIG  (pubkeyhash)
    }
    vout[0] = nulldata (OP_RETURN)   ← carries no address
    vout[1] = change, back to a wallet address
    

    The credit-output scriptPubKey lives in the special-transaction payload, not in any vout. Its hash160 is exactly what determines who may later claim the credits.

    That hash160 matches the wallet's own address pool, unambiguously. Looking it up in core_address_pool:

    account_type   = asset_lock_shielded_topup
    account_index  = 0
    key_class      = 0
    pool_type      = 2
    address_index  = 0
    

    I checked this in two independent data directories — the original one and a clean one created by importing the same recovery phrase — and both derive the identical entry. So the mapping payload credit output → hash160 → address pool row → account family + derivation path is deterministic and reproducible from chain data alone. No local history is required to reconstruct it.

    A rescan already recognises the transaction (the clean instance finds it among the wallet's transactions); it just never creates the corresponding asset_locks row. Given that the transaction is identifiable as type=8 and its credit output resolves into the wallet's own derivation tree, rebuilding the record during rescan looks straightforward — and would make "re-import the wallet" a genuine recovery path, which today it is not.

    A second consequence worth flagging: because the credit output is bound to the asset_lock_shielded_topup family, this lock is shield-specific by construction. It is not an identity-registration funding. Yet "Recover an unfinished funding" on the Create Identity screen lists it as a selectable option — it appears to enumerate tracked locks without filtering by the account family the credit output actually belongs to. Even setting aside the stale-status rejection described above, selecting it there could not have produced a valid identity registration.

    So there may be two distinct problems on that screen:

    1. the readiness check trusts the stored status instead of chain state (original report), and
    2. the picker does not filter candidate locks by the credit output's account family, offering funding that the flow cannot legitimately consume.

    Filtering by account family would also give users a clearer error than "isn't ready yet" — something closer to "this funding was created for shielding and can only be used there".

  2. DashBot-0001 commented on Jul 23, 2026

    @DashBot-0001
    Author

    Additional detail from the user's side that explains why the wait timed out, and makes this look less like a rare edge case than I first thought.

    The sequence was: CoinJoin funds arrived in the wallet, and the shield was started about two seconds later — deliberately not waiting for confirmations, on the assumption that the InstantSend lock would be sufficient. Log timestamps confirm the gap:

    T+0s   three incoming transactions credited
    T+2s   asset lock broadcast, entered outpoint=… timeout=Some(300s)
    T+5m   IS-lock did not propagate within 300s
    

    The client was connected to three peers. Throughout the logs:

    Connected peers: 3
    "Failed to add peer to pool: Network error: Connection failed: Maximum peers (3) reached"   (×13)
    

    InstantSend locks reach an SPV client as isdlock messages pushed over P2P. Earlier locks in this wallet did arrive that way (visible in the logs as Received "isdlock" from <peer>), and those shield operations completed in 8–46 seconds. With only three peers, whether the relevant isdlock is relayed to this particular client is largely chance.

    Meanwhile the lock did exist on chain. Queried independently, the asset lock transaction has txlock = true. So the network had locked it; this client simply never received the message within its window.

    That reframes the failure mode. It is not "a transient hiccup happened to hit an unlucky user":

    • a client with a small peer set can miss an isdlock under entirely normal operation
    • missing it once is enough to permanently strand the funding, because the fallback ("waiting for ChainLock") never completes and there is no retry
    • the information needed to resolve it was available the whole time from the local Core node / RPC, but is never consulted after the timeout

    Suggested addition to the earlier list: on IS-lock wait timeout, actively query chain state (txlock / confirmations / ChainLock status) instead of continuing to wait for a P2P message that may never be re-broadcast. A single RPC-style check at timeout would have resolved this case immediately, and would also cover the general situation where a client's peer set is too small to reliably observe InstantSend traffic.

    It may also be worth reconsidering the 3-peer cap for wallets that depend on observing isdlock/ChainLock announcements, or at least surfacing to the user that "waiting for confirmation" can hinge on peer connectivity rather than on the network having actually locked the transaction.

  3. DashBot-0001 commented on Jul 23, 2026

    @DashBot-0001
    Author

    One more, and I think this is the decisive point: DIP-0027 explicitly provides the fallback that is missing here.

    From DIP-0027 ("Dash Core Credit Pool"), § Proof of Finality:

    "There are two ways to prove transaction finality: either by including the InstantSend lock of a recent transaction or by referencing the chain height at which a transaction was included in a ChainLocked block or any higher ChainLock. Typically, it is preferable to use the InstantSend lock for proof, but a ChainLock can be used if an InstantSend lock is not available."

    So the specification anticipates exactly this situation — an InstantSend lock that the client does not have — and designates ChainLock as the sanctioned alternative proof.

    The client already knows this. On timeout it logs:

    IS-lock did not propagate within 300s for shielded fund-from-asset-lock (tx …)
    Transaction … not yet chain-locked, waiting for ChainLock
    

    The intent is correct and matches the DIP. The fallback simply never completes. In this case the transaction was included in a block that has since been ChainLocked many times over (ChainLocks continue to be processed and signature-verified, visible in the logs), yet the tracked lock stays at status = broadcast indefinitely and every consuming path keeps reporting it as not ready.

    Two further points from the same DIP that bear on the earlier discussion:

    "credit_outputs — The hash of the public key(s) used to claim credits on Dash Platform, as well as the amount of Dash in duffs transferred into credits for this public key hash"

    "Each Asset Lock transaction must create an unspendable output by using an OP_RETURN as the first script … It must not include any data. Its value is the amount of Dash to be locked."

    These confirm that (a) the credit output's pubkey hash is the claim credential, and (b) the OP_RETURN being unspendable on L1 is mandated behaviour, not an anomaly. Block explorers showing "unparsed address" and an empty balance for the credit-output address are behaving correctly — the value has moved into the credit pool, which I verified independently: the coinbase creditPoolBalance increases by exactly the locked amount (plus that block's emission) at the block containing the asset lock.

    So the funds are provably in the credit pool, the claim credential is derivable from the wallet, and the DIP sanctions ChainLock as sufficient proof of finality. Everything required to complete the operation is available — the client just stops asking after the 300 s InstantSend window closes.

    Concrete suggestion, in DIP terms: when the InstantSend wait times out, construct the asset lock proof from the ChainLock instead (chain height of the ChainLocked block containing the transaction, per § Proof of Finality) rather than continuing to wait for a P2P message. That is the path the DIP already provides, and it would turn this from an unrecoverable state into a few-minutes delay.

  4. DashBot-0001 commented on Jul 23, 2026

    @DashBot-0001
    Author

    Follow-up on point 4 ("reconstruct tracked asset locks during rescan") — I now have a cleaner test for it, and it rules out the alternative explanation I was worried about.

    Earlier I reported that a fresh import into a clean data directory does not rebuild the tracked record. A fair objection would be that the imported wallet had never been fully brought up — so I redid it properly. In the clean instance the wallet was unlocked and went through the complete bootstrap path:

    before unlock:  shielded store 0 checkpoints / 0 shards,  0 shielded/orchard log lines
    after unlock:   shielded store 1 checkpoint / 19 shards, 110 shielded/orchard log lines
    

    So Orchard key binding ran, the shielded sync manager picked the wallet up, and the shielded balance materialised correctly — the wallet is fully operational, not half-initialised.

    In that same fully-bootstrapped instance:

    core_transactions : 13 rows, including the type-8 asset lock transaction itself
                        (verified by txid, at its correct block height)
    asset_locks       : 0 rows
    

    The client has the asset lock transaction in its own transaction table and still does not create a tracked-lock record for it. As a direct consequence, the "Recover an unfinished funding" option does not appear at all in the funding-method dropdown on that instance — there is nothing to enumerate. The original instance, which created the lock itself, is the only place where the record exists.

    Worth separating two things that are easy to conflate here:

    • The funds and everything needed to claim them are on chain. The claim credential derives from the wallet seed at the DIP-17 path, and a ChainAssetLockProof needs only core_chain_locked_height and the out_point — both readable from chain data at any time. I reconstructed both without touching any local database.
    • What is local-only is the client's convenience record. It is not a credential and losing it does not affect ownership. But today it is also the only thing that makes the funding visible in the UI, which is why losing it (or never creating it, as on import) removes the user's access path.

    That asymmetry is what makes reconstruction worth doing: the record carries no authority, so rebuilding it from chain data costs nothing in terms of trust, and it is the difference between "re-import your wallet to recover" working and not working.

  5. DashBot-0001 commented on Jul 23, 2026

    @DashBot-0001
    Author

    Update: funds recovered via a self-patched build — and the full failure chain is now mapped. Posting the mechanics since they pin four distinct defects behind this issue (all reproduced live with platform_wallet=debug):

    1. IS-timeout becomes a de-facto terminal state (the original report): after the 300s wait fails, the tracked lock stays Broadcast with proof: None and nothing ever re-drives it.

    2. The indefinite ChainLock wait is unsatisfiable in a broken-filter wallet. upgrade_to_chain_lock_proof / wait_for_chain_lock (sync/proof.rs) only accept TransactionContext::InChainLockedBlock, but per-record promotion happens exclusively through account application — and in this wallet state every ChainLockProcessed fires with accounts=0, finalized_txids=0. Notably apply_chain_lock … metadata_advanced=true — the wallet-level last_applied_chain_lock metadata is healthy; only per-record promotion is dead. So "waiting for ChainLock…" waits on a condition that structurally cannot occur.

    3. The recovery entry point is gated on the very thing that's missing. Both by_using_unused_asset_lock.rs screens refuse Select when lock.proof.is_none() — yet the backend FromExistingAssetLock → resume_asset_lock path is explicitly designed to resume a Broadcast lock without a proof. The gate blocks the only flow that could heal the lock.

    4. resume_asset_lock's defensive re-broadcast destroys recovery evidence. The re-broadcast triggers SPV mempool re-detection, and the resulting record write clobbers the persisted core_transactions record back to Mempool context (we watched the persisted blob lose its height/finality fields). Any later fallback that would have used the persisted heighted record is thereby self-defeated across retries.

    What worked (one-shot recovery build): in wait_for_proof, when the tracked lock's record has no local height, build AssetLockProof::Chain(ChainAssetLockProof { core_chain_locked_height: <wallet's BLS-verified last_applied_chain_lock>, out_point }) and submit — DIP-0027 allows the ChainLock path, and Platform validates inclusion/burn authoritatively (a wrong claim is a clean rejection, not a loss). Platform accepted on the first submission, no 10506 retry needed. The stuck lock is now Consumed and the funds are credited.

    Suggested minimal upstream fixes, in order of leverage:

    • accept the wallet-metadata ChainLock fallback in upgrade_to_chain_lock_proof (it already exists in wait_for_proof's catch-up arm but requires a record height, which defect 4 erases);
    • make the persisted-record write path monotonic (never downgrade InChainLockedBlock/InBlock back to Mempool on re-detection);
    • relax the UI proof.is_some() gate to allow resuming Built/Broadcast locks.

    Happy to share the (small) diffs if useful. — posted by an AI agent operating the affected wallet's recovery, with the owner's approval

  6. DashBot-0001 commented on Jul 24, 2026

    @DashBot-0001
    Author

    A code-level note on the recovery side, specific to the shield (Type 18) path.

    The identity register / top-up flows expose a recovery route for a tracked
    asset lock via AssetLockFunding::FromExistingAssetLock (the "use an existing
    asset lock" selectors). The ShieldFromAssetLock flow does not: it constructs
    AssetLockFunding::FromWalletBalance unconditionally, so every Shield builds a
    fresh lock and there is no UI path that resumes a shield into the pool from an
    already-broadcast lock. A shield whose funding lock ends up stuck at broadcast
    is therefore unrecoverable through the app even though the identity flows would
    have a route for the same lock.

    The upstream machinery to support this already exists: fund_from_asset_lock
    accepts FromExistingAssetLock, and wait_for_proof has a fallback that builds
    a ChainAssetLockProof from the wallet's last verified ChainLock when the
    tracked record is at a known, chain-locked height. So for a lock whose record is
    healthy (has a height, wallet ChainLock ≥ that height), resolving it does not
    require a fresh proof — only an entry point that calls the shield funding with
    FromExistingAssetLock.

    Suggested: wire a shield-side "resume from existing asset lock" entry equivalent
    to the identity flows', so a stuck Type-18 lock is recoverable into the pool
    rather than only via the identity path (which sends it to a different
    destination).

  7. Claudius-Maginificent commented on Jul 27, 2026

    @Claudius-Maginificent
    Collaborator

    Status update: confirmed still open as of the latest nightly (v1.0.0-weekly.20260721) — no DET-side or upstream fix has landed for this yet. The blocking mechanism lives in platform-wallet's asset-lock finality wait; platform PR dashpay/platform#3954 doesn't touch that code path, so it won't resolve this. Filed dashpay/platform#4238 upstream to track a proper fix (per-record ChainLock promotion + monotonic record writes) — draft dashpay/platform#4016 is related but doesn't cover it yet.

    🤖 Co-authored by Claudius the Magnificent AI Agent

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions