Skip to content

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

Closed

Description

@TheBlueMatt

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.

Activity

  1. added this to the 0.1 milestone on Jun 23, 2022
  2. wpaulino commented on Jun 23, 2022

    @wpaulino
    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

  3. wpaulino commented on May 30, 2023

    @wpaulino
    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?

  4. TheBlueMatt commented on May 30, 2023

    @TheBlueMatt
    CollaboratorAuthor

    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.

  5. benthecarman commented on Jun 7, 2023

    @benthecarman
    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.

  6. TheBlueMatt commented on Jul 8, 2023

    @TheBlueMatt
    CollaboratorAuthor

    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.

  7. TheBlueMatt commented on May 8, 2024

    @TheBlueMatt
    CollaboratorAuthor

    Done in #2658

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions