-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not force-close channels when we cannot communicate with peers #1429
Do not force-close channels when we cannot communicate with peers #1429
Conversation
dba08e5
to
6741021
Compare
Codecov 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.
|
@@ -2170,15 +2170,15 @@ fn channel_monitor_network_test() { | |||
assert_eq!(nodes[0].node.list_channels().len(), 0); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I think after this we we'll be missing test coverage of ClosureReason::DisconnectedPeer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good feature to have!
6902ccb
72c29ff
to
6902ccb
Compare
Squashed |
Squashed. |
e15c339
to
5033f80
Compare
Oops missed that this now depends on #1435. |
5033f80
to
99f0855
Compare
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.
99f0855
to
e39d63c
Compare
Not really sure why this ended up based on #1435, but that landed now so rebased this. |
…-no-conn-possible
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.