sweep: bounded batching of CPFP children of pre-signed second-level HTLC txs

Open
#11,576 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
12/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
backend, payments

Research direction

The issue names no files or tests, so start from the anchor-child registration referenced in #11094 and the package submission side in #11124. Read how children are registered with NoInputBatch and how a failed child is handled today. The issue asks for tests showing that a healthy anchor is reoffered when a sibling's parent goes missing, and that wallet inputs are recovered on rebuild. Settling the batching design first is needed before any code change.

Written by the indexing model from the issue text.

Description

Each anchor child of a pre-signed second-level HTLC tx (#11094) is registered with NoInputBatch, so every child ties up its own confirmed wallet UTXO while it sits unconfirmed. A peer that triggers many HTLC resolutions at once can exhaust the confirmed inputs that other urgent sweeps need, even with plenty of BTC in unconfirmed change.

The per-child tx exists for failure isolation: a parent that gets evicted or replaced must only fail its own child, never the sweeps batched with it.

A bounded batch of CPFP-only inputs would keep that property while using fewer wallet inputs:

  • ordinary sweep inputs stay outside these batches
  • when one parent disappears, the child is rebuilt without that anchor instead of failing the batch
  • the wallet inputs of the failed child are released for the rebuild

Needs tests that a healthy anchor in such a batch is reoffered when a sibling's parent goes missing, and that the wallet inputs are recovered when the child is rebuilt.

Raised by @yyforyongyu in the review of #11094. Refs #11124 for the package submission side.

Dominant language
Go
Stars
8.2k
Forks
2.3k
Avg merge
1d 11h
Merged PRs (30d)
103

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

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.

More from lightningnetwork/lnd

All issues in lightningnetwork/lnd

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.