Commit graph

7316 commits

Author SHA1 Message Date
Matt Corallo
b8cdde8af6
Merge pull request #3107 from mhrheaume/mhr/closure_reason_abandoned
Updated `ClosureReason::HolderForceClosed` with whether txn was broadcasted.
2024-06-11 11:55:11 -07:00
Matt Corallo
a6664010fd
Merge pull request #3037 from TheBlueMatt/2024-05-close-on-stale-fees
Force-close channels if their feerate gets stale without any update
2024-06-11 07:20:00 -07:00
valentinewallace
f2237a78ff
Merge pull request #3086 from alecchendev/2024-05-holder-commitment
Add `HolderCommitmentPoint` struct to track commitment points
2024-06-10 18:30:09 -04:00
Alec Chen
cf545b4697 Get per commitment point everywhere else with HolderCommitmentPoint
This includes when building TxCreationKeys, as well as for open_channel
and accept_channel messages. Note: this is only for places where we are
retrieving the current per commitment point, which excludes
channel_reestablish.
2024-06-10 13:06:58 -07:00
Alec Chen
d189cf0e82 Get per commitment point for channel ready using HolderCommitmentPoint 2024-06-10 13:06:58 -07:00
Matthew Rheaume
808d814a76 Updated ClosureReason::HolderForceClosed with broadcasted txn. 2024-06-10 12:09:24 -07:00
Alec Chen
7a115d79ab Use HolderCommitmentPoint for commitment number 2024-06-10 10:39:47 -07:00
Alec Chen
c08aa349f5 Add HolderCommitmentPoint struct to ChannelContext 2024-06-10 10:39:47 -07:00
Matt Corallo
17b77e0bcf Add a test of stale-feerate-force-closure behavior 2024-06-10 15:17:58 +00:00
Matt Corallo
5a1cc288b7 Force-close channels if their feerate gets stale without any update
For quite some time, LDK has force-closed channels if the peer
sends us a feerate update which is below our `FeeEstimator`'s
concept of a channel lower-bound. This is intended to ensure that
channel feerates are always sufficient to get our commitment
transaction confirmed on-chain if we do need to force-close.

However, we've never checked our channel feerate regularly - if a
peer is offline (or just uninterested in updating the channel
feerate) and the prevailing feerates on-chain go up, we'll simply
ignore it and allow our commitment transaction to sit around with a
feerate too low to get confirmed.

Here we rectify this oversight by force-closing channels with stale
feerates, checking after each block. However, because fee
estimators are often buggy and force-closures piss off users, we
only do so rather conservatively. Specifically, we only force-close
if a channel's feerate is below the minimum `FeeEstimator`-provided
minimum across the last day.

Further, because fee estimators are often especially buggy on
startup (and because peers haven't had a chance to update the
channel feerates yet), we don't force-close channels until we have
a full day of feerate lower-bound history.

This should reduce the incidence of force-closures substantially,
but it is expected this will still increase force-closures somewhat
substantially depending on the users' `FeeEstimator`.

Fixes #993
2024-06-10 15:17:58 +00:00
Matt Corallo
66e6ee563b Skip fee reads in full_stack_target when connecting many blocks
When we connect 100 blocks in a row, requiring the fuzz input to
contain 100 fee estimator results is uneccessary, so add a bool
that lets us skip those reads.
2024-06-10 15:12:50 +00:00
Matt Corallo
88c291a9bc Add a new ClosureReason::PeerFeerateTooLow
Closure due to feerate disagreements are a specific closure reason
which admins can understand and tune their config (in the form of
their `FeeEstimator`) to avoid, so having a separate
`ClosureReason` for it is useful.
2024-06-10 15:12:28 +00:00
Matt Corallo
93011c377c Allow ChannelError to specify the ClosureReason
This will allow us to add more granular failure reasons when
returning the general `ChannelError::Close`.
2024-06-10 15:12:28 +00:00
Matt Corallo
3e09d9937e Use ChannelError::close constructor when building a close variant
In the next commit we'll add a second field to
`ChannelError::Close` so here we prep by converting existing calls
to the constructor function, which is almost a full-file sed.
2024-06-10 15:12:27 +00:00
Matt Corallo
73bc0f61b9 Add ChannelError::close constructor 2024-06-10 15:12:02 +00:00
Elias Rohrer
1d0c6c60c6
Merge pull request #3101 from tnull/2024-06-fix-tx-sync
tx-sync: Make confirmables `Deref` and run `rustfmt`
2024-06-10 10:04:49 +02:00
Matt Corallo
c166c2177a
Merge pull request #3111 from tnull/2024-06-rustfmt-fuzz-the-easy-part
`rustfmt`: Reformat the `fuzz` dir – the easy part
2024-06-07 12:44:17 -07:00
Matt Corallo
8ca3259bfa
Merge pull request #3083 from valentinewallace/2024-05-ignore-onion-err-chan-upd
Ignore channel updates in onion errors
2024-06-07 12:25:46 -07:00
Elias Rohrer
99409fb0cd
Still ignore fuzz/src/lib.rs for now 2024-06-07 20:42:37 +02:00
Elias Rohrer
c3ae420b51
rustfmt: src/zbase32.rs 2024-06-07 20:42:36 +02:00
Elias Rohrer
5d0fb36477
rustfmt: src/utils/* 2024-06-07 20:42:36 +02:00
Elias Rohrer
0e7fe0c9aa
rustfmt: fuzz/src/router.rs 2024-06-07 20:42:36 +02:00
Elias Rohrer
64843ae633
rustfmt: fuzz/src/refund_deser.rs 2024-06-07 20:42:36 +02:00
Elias Rohrer
73ebb1bd1b
rustfmt: fuzz/src/process_network_graph.rs 2024-06-07 20:42:36 +02:00
Elias Rohrer
8e1a98183d
rustfmt: fuzz/src/peer_crypt.rs 2024-06-07 20:42:36 +02:00
Elias Rohrer
da99d521b9
rustfmt: fuzz/src/offer_deser.rs 2024-06-07 20:42:27 +02:00
Elias Rohrer
4741731dd3
rustfmt: fuzz/src/offer_deser.rs 2024-06-07 20:41:50 +02:00
Elias Rohrer
b9c52f6941
rustfmt: fuzz/src/msg_targets/* 2024-06-07 20:37:10 +02:00
Elias Rohrer
9db52b69bb
rustfmt: fuzz/src/lib.rs 2024-06-07 20:37:10 +02:00
Elias Rohrer
f1ac0a3d97
rustfmt: fuzz/src/invoice*.rs 2024-06-07 20:37:10 +02:00
Elias Rohrer
9164e835e5
rustfmt: fuzz/src/indexedmap.rs 2024-06-07 20:37:10 +02:00
Elias Rohrer
997e46bde2
rustfmt: fuzz/src/fromstr_to_netaddress.rs 2024-06-07 20:37:09 +02:00
Elias Rohrer
39cc28bfaa
rustfmt: fuzz/src/chanmon_deser.rs 2024-06-07 20:37:09 +02:00
Elias Rohrer
2bcdad779a
rustfmt: fuzz/src/bin/* 2024-06-07 20:37:09 +02:00
Elias Rohrer
6cd3cb2e70
rustfmt: fuzz/src/bech32_parse.rs 2024-06-07 20:37:09 +02:00
Elias Rohrer
c2abfbf5f5
rustfmt: fuzz/src/base32.rs 2024-06-07 20:37:09 +02:00
Elias Rohrer
b1a9410508
Add rustfmt::skip to the target template 2024-06-07 20:37:09 +02:00
Elias Rohrer
fde0d9e718
Add rustfmt::skip to the msg_target template 2024-06-07 20:37:08 +02:00
valentinewallace
88124a901a
Merge pull request #3080 from jkczyz/2024-05-compact-blinded-path-creation-trait
Optional compact blinded path creation
2024-06-07 14:32:24 -04:00
Arik
1e49c4a671
Merge pull request #3096 from alecchendev/2024-06-drop-one-signer-call
Cache commitment point on ExternalHTLCClaim to drop a signer call
2024-06-07 09:26:39 -07:00
Elias Rohrer
97891526cc
Merge pull request #3105 from johncantrell97/johncantrell97/add-peer-dis/connected-to-cmh
add peer_(dis)connected to custom message handler
2024-06-07 18:01:18 +02:00
Elias Rohrer
43b41868bb
Pass our edition to rustfmt
.. as it otherwise doesn't seem to pick up the right one when checkin
integration tests.
2024-06-07 16:55:11 +02:00
Elias Rohrer
21fee20a6d
rustfmt: lightning-transaction-sync/tests/integration_tests.rs 2024-06-07 16:54:30 +02:00
John Cantrell
602921cf37
add peer_(dis)connected to custom message handler 2024-06-07 10:10:01 -04:00
Elias Rohrer
85a82045fe
rustfmt: Reformat lightning-transaction-sync/src/lib.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
915fe195ca
rustfmt: Reformat lightning-transaction-sync/src/error.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
c5cd801f87
rustfmt: Reformat lightning-transaction-sync/src/esplora.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
470085aa2f
rustfmt: Reformat lightning-transaction-sync/src/electrum.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
3ead26323e
rustfmt: Reformat lightning-transaction-sync/src/common.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
777ce7b059
Make confirmables Deref
.. the bindings branch needed a small patch as it doesn't support `dyn`
traits. Here, we opt to use `Deref` in the hopes this works with
bindings, rendering the patch unnecessary.
2024-06-06 09:18:04 +02:00