lnd/contractcourt
Yong 939375f1a5
sweeper: relax anchor sweeping when there's no deadline pressure (#7965)
* sweep: use longer variable name for clarity in `addToState`

* sweeper: add more docs and debug logs

* sweep: prioritize smaller inputs when adding wallet UTXOs

This commit sorts wallet UTXOs by their values when using them for
sweeping inputs. This way we'd avoid locking large UTXOs when sweeping
inputs and also provide an opportunity to aggregate wallet UTXOs.

* contractcourt+itest: relax anchor sweeping for CPFP purpose

This commit changes from always sweeping anchor for a local force close
to only do so when there is an actual time pressure. After this change,
a forced anchor sweeping will only be attempted when the deadline is
less than 144 blocks.

* docs: update release notes

* itest: update test `testMultiHopHtlcLocalChainClaim` to skip CPFP

Since we now only perform CPFP when both the fee rate is higher and the
deadline is less than 144, we need to update the test to reflect that
Bob will not CPFP the force close tx for the channle Alice->Bob.

* itest: fix `testMultiHopRemoteForceCloseOnChainHtlcTimeout`

* itest: update related tests to reflect anchor sweeping

This commit updates all related tests to reflect the latest anchor
sweeping behavior. Previously, anchor sweeping is always attempted as
CPFP when a force close is broadcast, while now it only happens when the
deadline is less than 144. For non-CPFP purpose sweeping, it will happen
after one block is mined after the force close transaction is confirmed
as the anchor will be resent to the sweeper with a floor fee rate, hence
making it economical to sweep.
2023-10-12 17:18:59 +02:00
..
anchor_resolver.go contractcourt: update the anchor resolver for taproot chans 2023-08-22 16:33:32 -07:00
breach_resolver.go server+contractcourt: add breachResolver that subscribes to breacharbiter 2022-01-25 15:42:20 -05:00
breacharbiter_test.go contractcourt: update breach arbiter to support taproot chans 2023-08-22 16:33:40 -07:00
breacharbiter.go multi: add debug logs to catch slow shutdown 2023-10-06 16:34:47 -07:00
briefcase_test.go contractcourt: store new taproot resolution info in new key 2023-08-22 16:33:30 -07:00
briefcase.go multi: fix linter errors 2023-08-22 16:34:15 -07:00
chain_arbitrator_test.go multi: replace defer cleanup with t.Cleanup 2022-10-13 17:46:54 +08:00
chain_arbitrator.go multi: add debug logs to catch slow shutdown 2023-10-06 16:34:47 -07:00
chain_watcher_test.go lnwallet+htlcswitch: add NewCommitState struct, modify send/recv sig to accept 2023-08-22 16:31:18 -07:00
chain_watcher.go lnwallet: update channel state machine to use new ScriptDescriptor interface 2023-08-22 16:33:46 -07:00
channel_arbitrator_test.go lnwallet+contractcourt: gracefully handle auto force close post data loss 2023-09-15 18:29:09 -07:00
channel_arbitrator.go sweeper: relax anchor sweeping when there's no deadline pressure (#7965) 2023-10-12 17:18:59 +02:00
commit_sweep_resolver_test.go multi: replace defer cleanup with t.Cleanup 2022-10-13 17:46:54 +08:00
commit_sweep_resolver.go multi: fix linter errors 2023-08-22 16:34:15 -07:00
contract_resolvers.go contractcourt: handle sweeping script-enforced leased channel outputs 2021-10-19 18:30:37 -07:00
htlc_incoming_contest_resolver.go contractcourt: modify the incoming contest resolver to use concurrent queue 2023-09-25 18:48:30 -05:00
htlc_incoming_resolver_test.go multi: update channel db HTLC OnionBlob to array 2023-06-02 11:01:43 -04:00
htlc_lease_resolver.go contractcourt: unify the lease specific HTLC sweeping logic 2022-06-01 16:42:33 -07:00
htlc_outgoing_contest_resolver_test.go multi: update channel db HTLC OnionBlob to array 2023-06-02 11:01:43 -04:00
htlc_outgoing_contest_resolver.go contractcourt: return htlcResolution when currentHeight has reached expiry 2022-10-27 01:11:35 +08:00
htlc_success_resolver_test.go multi: update channel db HTLC OnionBlob to array 2023-06-02 11:01:43 -04:00
htlc_success_resolver.go multi: fix linter errors 2023-08-22 16:34:15 -07:00
htlc_timeout_resolver_test.go multi: replace defer cleanup with t.Cleanup 2022-10-13 17:46:54 +08:00
htlc_timeout_resolver.go contractcourt: make sure we force sweep outgoing htlcs 2023-09-08 20:30:43 +08:00
interfaces.go multi: extend InvoiceDB methods with a context argument (#8066) 2023-10-11 13:42:59 +02:00
log.go multi: move breach arbiter and utxo nursery into contractcourt package 2021-09-27 19:10:31 -07:00
mock_htlcnotifier_test.go multi: create channeldb/models package 2023-01-16 07:14:55 -08:00
mock_registry_test.go multi: extend InvoiceDB methods with a context argument (#8066) 2023-10-11 13:42:59 +02:00
nursery_store_test.go multi: add new build tag integration 2023-02-23 21:56:09 +08:00
nursery_store.go multi: fix linter issues 2022-07-14 09:30:53 +02:00
setup_test.go channeldb/test: test with postgres 2021-10-29 10:54:44 +02:00
taproot_briefcase_test.go contractcourt: fix test flake in TestTaprootBriefcase 2023-09-05 07:44:02 +08:00
taproot_briefcase.go multi: fix linter warnings with updated linter 2023-08-22 16:34:47 -07:00
utils_test.go multi: replace defer cleanup with t.Cleanup 2022-10-13 17:46:54 +08:00
utxonursery_test.go contractcourt: add tests for mempool rejection. 2023-07-26 00:03:17 +02:00
utxonursery.go multi: add debug logs to catch slow shutdown 2023-10-06 16:34:47 -07:00