Skip to content
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

Send channel_resstablish that causes lnd to force-close if we don't have the channel #1565

Closed
TheBlueMatt opened this issue Jun 23, 2022 · 6 comments
Milestone

Comments

@TheBlueMatt
Copy link
Collaborator

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.

@TheBlueMatt TheBlueMatt added this to the 0.1 milestone Jun 23, 2022
@wpaulino
Copy link
Contributor

I might pick this up at some point since I'm familiar with how lnd works regarding this. Here's how lnd crafts a ChannelReestablish to make the remote party force close: https://github.com/lightningnetwork/lnd/blob/3e5b5d52f08e67110fc55ac6a68204ac5428b2e6/channeldb/channel.go#L1163

@wpaulino
Copy link
Contributor

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?

@TheBlueMatt
Copy link
Collaborator Author

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.

@benthecarman
Copy link
Contributor

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.

@TheBlueMatt
Copy link
Collaborator Author

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
Copy link
Collaborator Author

Done in #2658

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants