lnd/sweep
yyforyongyu a7e9c08baf
sweep: make sweeper block-driven instead of time-driven
This commit changes the source that drives the state changes in the
sweeper. Previously we used a ticker with default interval of 30s to
trigger sweepings periodically. The assumption is, within this 30s we'd
batch multiple inputs into one transaction to maximize profits. However,
the efficacy of this batch is questionable.

At a high level, we can put our inputs into two categories - one that's
forced, and one that's not. For forced inputs, we should sweep them
immediately as the force flag indicates they are very urgent, eg,
CPFPing the force closing tx. For non-forced inputs, such as anchors
or HTLCs with CLTV that's far away, we can wait to sweep them till a new
block comes in and triggers the sweeping process.

Eventually, all inputs will be deadline-aware, and the sweeper will
consult our fee bumper about the most economical fee rate to be used for
a given deadline. Since the deadlines here are blockstamp, it's also
easier to manage them if the sweeper is also using blockstamp instead of
timestamp.
2024-04-19 21:33:24 +08:00
..
aggregator.go sweep+lnd: introduce UtxoAggregator to handle clustering inputs 2024-04-19 21:33:21 +08:00
aggregator_test.go sweep+lnd: introduce UtxoAggregator to handle clustering inputs 2024-04-19 21:33:21 +08:00
backend_mock_test.go sweep: remove conflicted sweep txns from the rebroadcaster 2023-04-21 11:53:08 -07:00
bucket_list.go sweep: do not combine exclusive and non-exclusive inputs 2020-09-16 08:17:36 +02:00
defaults.go sweep+itest: change MaxFeeRate to use SatPerVbyte 2023-10-06 16:34:47 -07:00
fee_estimator_mock_test.go multi: merge DetermineFeePerKw and Estimate 2024-04-19 21:33:21 +08:00
interface.go sweep: remove conflicted sweep txns from the rebroadcaster 2023-04-21 11:53:08 -07:00
log.go multi: modify sweeper.CreateSweepTx to accept conf target, style changes 2018-10-18 18:08:27 -07:00
mocks.go sweep+lnd: introduce UtxoAggregator to handle clustering inputs 2024-04-19 21:33:21 +08:00
setup_test.go channeldb/test: test with postgres 2021-10-29 10:54:44 +02:00
store.go sweep: add new methods GetTx and DeleteTx to manage TxRecord 2024-04-19 21:33:20 +08:00
store_mock.go sweep: use testify/mock for MockSweeperStore 2024-04-19 21:33:20 +08:00
store_test.go sweep: use testify/mock for MockSweeperStore 2024-04-19 21:33:20 +08:00
sweeper.go sweep: make sweeper block-driven instead of time-driven 2024-04-19 21:33:24 +08:00
sweeper_test.go sweep: make sweeper block-driven instead of time-driven 2024-04-19 21:33:24 +08:00
test_utils.go sweep: make sweeper block-driven instead of time-driven 2024-04-19 21:33:24 +08:00
tx_input_set.go sweep: use p2tr output as change weight 2023-12-14 12:15:34 -05:00
tx_input_set_test.go sweep: use p2tr output as change weight 2023-12-14 12:15:34 -05:00
txgenerator.go sweep: return fees from method createSweepTx 2024-04-19 21:33:19 +08:00
txgenerator_test.go multi: make sure CPFP won't exceed max allowed fee rate 2023-10-06 16:34:47 -07:00
walletsweep.go sweep+lnrpc: add new interface FeePreference 2024-04-19 21:33:21 +08:00
walletsweep_test.go multi: rename FeePreference to FeeEstimateInfo 2024-04-19 21:33:21 +08:00
weight_estimator.go multi: make sure CPFP won't exceed max allowed fee rate 2023-10-06 16:34:47 -07:00
weight_estimator_test.go multi: make sure CPFP won't exceed max allowed fee rate 2023-10-06 16:34:47 -07:00