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

Avoid force-close: ping peer before sending HTLC #6482

Closed
C-Otto opened this issue Apr 30, 2022 · 5 comments
Closed

Avoid force-close: ping peer before sending HTLC #6482

C-Otto opened this issue Apr 30, 2022 · 5 comments

Comments

@C-Otto
Copy link
Contributor

C-Otto commented Apr 30, 2022

Background

My node often (21x since 08/Feb/2022) force-closes channels because my peer didn't settle/fail a HTLC in time, where this HTLC is only included in my peer's force close transaction (remote commitment).

I believe this happens if my node sends out a HTLC, but my peer simply doesn't respond. As such I believe it would help (in most, but not all cases) to ping my peer and request a pong response before sending out a signed commitment with the new HTLC (update_add_HTLC and commitment_signed?).

The corresponding message:

[INF] CNCT: ChannelArbitrator(CHANPOINT): immediately failing htlc=HTLCID from remote commitment

Before:

[DBG] HSWC: ChannelLink(CHANPOINT): queueing keystone of ADD open circuit: (Chan ID=..., HTLC ID=...)->(Chan ID=..., HTLC ID=...)
[ERR] HSWC: ChannelLink(CHANPOINT): failing link: unable to complete dance with error: remote unresponsive

Background:
https://bitcoin.stackexchange.com/q/113335/7214

Your environment

  • version of lnd: 0.14.3-beta-rc1

  • which operating system (uname -a on *Nix): Linux server 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 GNU/Linux

  • version of btcd, bitcoind, or other backend: bitcoind v23

Steps to reproduce

Send HTLC to peer. Shutdown peer after receiving my signed transaction but before sending back the response (which is the force-close transaction including the HTLC, signed by my peer, that I could use to force-close the channel).

Expected behaviour

I'd expect lnd to not send the HTLC to a peer that is unresponsive.

Actual behaviour

lnd sends out the HTLC and, once it times out, force-closes the channel.

@Roasbeef
Copy link
Member

Roasbeef commented May 2, 2022

Closing as duplicate of #2992

@Roasbeef Roasbeef closed this as completed May 2, 2022
@Roasbeef
Copy link
Member

Roasbeef commented May 2, 2022

Also FWIW, the remote peer being unresponsive isn't what caused the channel to force close in this case. This isn't an error we'll force close on.

@C-Otto
Copy link
Contributor Author

C-Otto commented May 2, 2022

Are you 100% sure about this? I see more than one example where a force-close happened just after this message. The code also looks like this is the case, and I see plenty of good reasons to close a channel so that my peer can't settle the HTLC in the far future.

@C-Otto
Copy link
Contributor Author

C-Otto commented May 2, 2022

@Roasbeef
Copy link
Member

Roasbeef commented May 4, 2022

Are you 100% sure about this?

I was referring to the fact that us sending that error won't trigger an auto shutdown. However if for some reason we aren't always cancelling back that HTLC (w/ mailbox auto expiry) then a force close may be resulting. We're tracking that in #6485

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

2 participants