Fix infinite loop when closing a pre-funding channel (channel-establishment, channel-funding)
https://github.com/lightningdevkit/rust-lightning/pull/2760
Host: jbesraa -
Notes
Creating a channel involves exchanging multiple messages with a connected peer, which does not always end up successfully. Specifically, in the current implementation an infinite loop might occur in the funding step. This bug was resulted from ldk/2077.
ldk/2760 Addresses this bug.
+-------+ +-------+
| |--(1)- open_channel ---->| |
| |<-(2)- accept_channel ----| |
| |--(3)- funding_created ->| |
| |<-(4)- funding_signed ---| |
| |--(5)- channel_ready --->| |
| A |<-(6)- channel_ready ---| B |
+-------+ +-------+
- Channel establishment(v1) is the process of creating a channel with a connected peer, as detailed here lightning/bolt02.
Questions
- Did you review the PR? Concept ACK, approach ACK, tested ACK, or NACK?
- In the original code we have a loop inside
close_channel_internal
, in which scenario it goes indefintly? - Why are we able to drop
force_close_channel_with_peer
fromclose_channel_internal
, andfunding_created
msg fromSignerResumeUpdate
? - What was the reasoning for promoting an
OutboundV1Channel
to aChannel
before receivingfunding_signed
prior to this PR? Why do we no only do that promotion after receivingfunding_signed
?