Skip to content

sweep: finalize and enhance the new sweeper's functionality #8680

@yyforyongyu

Description

@yyforyongyu

With the new sweeper in place, we still have some TODOs that need to be fixed in 0.18.1,

  • 1. remove the hacks used in itest - there are lots of hacks used in the multi-hop and sweeper itests due to block sync issues among different subsystems, which should be fixed. Covered with mutil: introduce simple BlockBeat to fix itest flakes #8717
  • 2. reconstruct the input set from the mempool tx, which is the missing part that gives the sweeper the ability to recover its state from a restart.
  • 3. properly lock wallet utxos in sweeper using LeaseOutput and ReleaseOutput - we need to make sure the wallet utxo is not locked forever, which means we should release the output when the sweeping tx fails. On the other hand, since the RBF can take hundreds of blocks, we need to figure out how long the wallet utxo should be locked.
  • 4. add breach outputs to the sweeper, should be straightforward.
  • 5. anchor channel fee rate should be min relay fee to maximize the utility provided by the fee bumper:

    lnd/htlcswitch/link.go

    Lines 1341 to 1345 in d4c1937

    newCommitFee := l.channel.IdealCommitFeeRate(
    netFee, minRelayFee,
    l.cfg.MaxAnchorsCommitFeeRate,
    l.cfg.MaxFeeAllocation,
    )
  • 6. kick out the bad input from failed sweeping txns - we need to analyze the broadcast failure and decide whether to regroup the input or remove it.
  • 7. update PendingSweeps to return inputs in InputSet, which gives users more info about the sweeping tx, so better decisions can be made when calling BumpFee.
  • 8. address editorial comments in readme.
  • 9. construct starting feerate before offering it to the fee func, as suggested here.

Think the last item may be fixed in future releases?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions