Uh oh!
There was an error while loading. Please reload this page.
Do not force-close channels when we cannot communicate with peers - #1429
Conversation
dba08e5 to
6741021CompareCodecov Report
@@ Coverage Diff @@## main #1429 +/- ##
=======================================
Coverage 90.88% 90.88% =======================================
Files 75 75 Lines 41517 41517 Branches 41517 41517 =======================================
Hits 37734 37734 Misses 3783 3783 Continue to review full report at Codecov.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| assert_eq!(nodes[1].node.list_channels().len(), 1); | ||
| check_closed_event!(nodes[0], 1, ClosureReason::CommitmentTxConfirmed); | ||
| check_closed_event!(nodes[1], 1, ClosureReason::DisconnectedPeer); | ||
| check_closed_event!(nodes[1], 1, ClosureReason::HolderForceClosed); |
There was a problem hiding this comment.
FWIW, I think after this we we'll be missing test coverage of ClosureReason::DisconnectedPeer
There was a problem hiding this comment.
Right, well this doesn't change coverage of it for the "peer disconnected before confirmation" reason, only the no_connection_possible reason, so it doesn't really change coverage.
6902ccb72c29ff to
6902ccbCompareTheBlueMatt
commented
Apr 19, 2022
Squashed |
Uh oh!
There was an error while loading. Please reload this page.
TheBlueMatt
commented
Apr 20, 2022
Squashed. |
e15c339 to
5033f80CompareTheBlueMatt
commented
Apr 27, 2022
Oops missed that this now depends on #1435. |
5033f80 to
99f0855CompareIn general, we should never be automatically force-closing our users' channels unless there is some immediate risk of funds loss (ie because of some HTLC(s) which are timing out soon). In any other case, we should trust the user to be able to figure out what is going on and close their channels manually instead of trying to be overly clever and automate closures if we think the channel is useless. In this case, even if a peer has some required feature that does not allow us to communicate with them, there is a strong possibility that some LDK upgrade may allow us to in the future. In the mean time, there is no reason to go on-chain unless the user needs funds immediately. In such a case, the user should already have logic to force-close channels with peers which are not available for any reason.
99f0855 to
e39d63cCompareTheBlueMatt
commented
Apr 28, 2022
Not really sure why this ended up based on #1435, but that landed now so rebased this. |
In general, we should never be automatically force-closing our
users' channels unless there is some immediate risk of funds loss
(ie because of some HTLC(s) which are timing out soon). In any
other case, we should trust the user to be able to figure out what
is going on and close their channels manually instead of trying to
be overly clever and automate closures if we think the channel is
useless.
In this case, even if a peer has some required feature that does
not allow us to communicate with them, there is a strong
possibility that some LDK upgrade may allow us to in the future. In
the mean time, there is no reason to go on-chain unless the user
needs funds immediately. In such a case, the user should already
have logic to force-close channels with peers which are not
available for any reason.