lightninglabs / lightninglabs/wavelength

walletrpc: startup recovery does not surface already-confirmed boarding outputs until next block

Open
#565 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

boarding P2 wallet
Dominant language
Go
Stars
47
Forks
14
Avg merge
2d 6h
Merged PRs (30d)
103

Description

Environment

  • darepo-client: aa3e33e1ca91e85d8d45f8c3f7cc541a89b4c039
  • Version string: v0.0.2-alpha-13-gaa3e33e1
  • Network: signet
  • Wallet backend: lwwallet
  • Ark server: arkd-signet.testnet.lightningcluster.com:443
  • Esplora: https://mempool-signet.testnet.lightningcluster.com/api/

Summary

If a persisted boarding address receives funds while the daemon is offline, and
the daemon is restarted after the funding transaction is already confirmed, the
confirmed funds are not surfaced by wallet APIs until a later chain tip arrives.

This can make a funded wallet appear empty for an arbitrary amount of time on
low-activity networks.

Expected Behavior

After restart, darepod should scan persisted boarding addresses at the current
known chain tip and surface already-confirmed boarding outputs in balance,
activity, or the raw wallet transaction surfaces without waiting for another
block.

Actual Behavior

After restarting at signet tip 306233, all wallet views stayed empty:

  • confirmed_sat=0
  • pending_in_sat=0
  • no activity rows
  • no VTXOs
  • no local transactions

When the next signet block arrived at height 306234, the daemon detected the
previously confirmed outputs and started boarding.

Evidence

Funding transaction
18983d5d6f9c2dbf5166174777162f97797bed3e59d5f63b80a58833ea5391a0 was already
confirmed in block 306231 and paid two outputs of 990,064 sat to the
boarding address. A later transaction added another 283,605 sat output.

After block 306234, logs showed:

Detected new boarding UTXO
Boarding request accepted boarding_balance=2263733

Reproduction

  1. Start a fresh signet lwwallet SwapDK wallet.
  2. Run darepocli recv --onchain.
  3. Stop darepod.
  4. Fund the returned boarding address and wait for confirmation.
  5. Restart darepod.
  6. Before another block arrives, compare Esplora address state with:
    • darepocli balance
    • darepocli activity
    • darepocli dev daemon GetBalance
    • darepocli ark listtransactions

Impact

Wallets can show zero funds after restart even though the user has confirmed
deposits. This is especially confusing during onboarding, and makes recovery
look broken until a new block happens to arrive.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the restart scenario with darepod and compare darepocli balance, activity, dev daemon GetBalance, and ark listtransactions against Esplora at the current signet tip. Trace startup recovery and the boarding-address scan, then verify that already-confirmed outputs appear in wallet surfaces immediately after restart, without waiting for another block.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend, blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.