You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Send channel_resstablish that causes lnd to force-close if we don't have the channel #1565
lnd is now the only major lightning implementation that deliberately ignores error messages, causing it to not force-close channels even though we ask the peer to. lnd themselves works around this when trying to restart with their "static channel backups" (which are not, in fact, channel backups...) by sending a channel_reestablish message that is bogus (I don't recall exactly how, so would need to dig on that first). As much as I really hate to create yet another workaround in our code just because lnd continues to ignore the common spec that no one else has a problem with, it is kinda important we can make our peer broadcast the latest state if we ask, so we should probably send a similar channel_reestablish any time we receive a channel_reestablish from a peer for a channel we dont (any longer) have.
Since we may send channel_reestablish prior to receiving the remote's and we can't determine whether the remote is running lnd, we may need to introduce a new state for such channels in which we attempt this behavior?
It depends on how lnd handles the reestablish message, I think ideally we'd just always follow an error with a channel_reestablish right afterwards no matter who the peer is, but I dunno if lnd will still interpret that and force-close or if it will ignore it since we're already in a normal/running state.
Related to this, would be great if we had a way to give a set of ChannelMonitors and it would send the channel_resstablish message to have the channels closed, without needing a channel manager. This would allow ldk to have a version of static channel backups but with more safety.
As #2401, can you comment there a bit more why we should do that vs users using VSS? I kinda don't want to do it unless we have a very specific user in mind who can't do anything better.
Activity
wpaulino commentedon Jun 23, 2022
I might pick this up at some point since I'm familiar with how
lndworks regarding this. Here's howlndcrafts aChannelReestablishto make the remote party force close: https://github.com/lightningnetwork/lnd/blob/3e5b5d52f08e67110fc55ac6a68204ac5428b2e6/channeldb/channel.go#L1163wpaulino commentedon May 30, 2023
Since we may send
channel_reestablishprior to receiving the remote's and we can't determine whether the remote is running lnd, we may need to introduce a new state for such channels in which we attempt this behavior?TheBlueMatt commentedon May 30, 2023
It depends on how lnd handles the reestablish message, I think ideally we'd just always follow an error with a
channel_reestablishright afterwards no matter who the peer is, but I dunno if lnd will still interpret that and force-close or if it will ignore it since we're already in a normal/running state.benthecarman commentedon Jun 7, 2023
Related to this, would be great if we had a way to give a set of
ChannelMonitors and it would send thechannel_resstablishmessage to have the channels closed, without needing a channel manager. This would allow ldk to have a version of static channel backups but with more safety.TheBlueMatt commentedon Jul 8, 2023
As #2401, can you comment there a bit more why we should do that vs users using VSS? I kinda don't want to do it unless we have a very specific user in mind who can't do anything better.
TheBlueMatt commentedon May 8, 2024
Done in #2658