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

Autoclose channels that have not been reestablished for a long time #196

Merged
merged 4 commits into from
Dec 12, 2023

Commits on Nov 24, 2023

  1. Configuration menu
    Copy the full SHA
    2d584c1 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. multi: Track ChannelReestablish wait time

    This adds tracking for how long a peer has been online, while NOT
    reestasblishing a channel through the use of ChannelReestablish P2P
    messages.
    
    If a peer has been online for a long time without sending a
    ChannelReestablish, this is a hint that perhaps their end of the channel
    is borked and cannot be used anymore.  One situation where this occurs
    is when the peer restores its node without use of an SCB file, in which
    case the ChannelReestablish messages the local peer sends are ignored
    and the remote peer does not reply with their own ChannelReestablish.
    matheusd committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    e577924 View commit details
    Browse the repository at this point in the history
  2. multi: Expose total channel reestablish wait time

    This exposes the recently introduced per-channel total channel
    reestablish wait time through the ListChannels RPC interface.
    
    This is a useful debug feature for users.
    matheusd committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    678f2cb View commit details
    Browse the repository at this point in the history
  3. multi: Automatically close non-reestablished channels

    This adds automation for closing channels that haven't been
    reestablished for some time using the recently introduced metric.
    
    Channels with peers that have been online for some time but which have
    NOT been reestablished though the use of ChannelReestablish messages are
    good candidates for being force closed, because it is likely the remote
    peer has lost the ability to use them.
    
    Given that the metric tracks the total time across restarts and only
    while the remote peer is online, we use a default of 72h for the
    threshold to auto close the channel.  This should be a reasonable
    compromise between not closing too fast on hubs (that are online 24/7)
    and ephemeral nodes (that may be online only for an hour or two a day).
    
    A config parameter is added to control the threshold time used for
    autoclosing and an itest is added that asserts the correct behavior.
    matheusd committed Dec 4, 2023
    Configuration menu
    Copy the full SHA
    2e6ca2c View commit details
    Browse the repository at this point in the history