lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.15k stars 363 forks source link

Disconnect peers which don't respond to commitment signed after a while #2282

Closed TheBlueMatt closed 1 year ago

TheBlueMatt commented 1 year ago

It seems common wisdom in the plebnet crowd is that lnd sometimes just gets stuck and holds onto htlcs and the only way to fix it is disconnect+reconnect to peers. I saw this on two separate channels over the past few days (trying to get debug logs so I can open an lnd issue), including one channel which I ended up force-closing at high fees because the peer hadn't responded to a commitment_signed in days (despite being connected and ping+pong'ing just fine).

Given disconnect+reconnect manages to kick lnd and get it going again, we should probably implement this - if we're in a waiting state for a few blocks and connected, tell the PM to disconnect and let it reconnect eventually.

TheBlueMatt commented 1 year ago

lnd issue at https://github.com/lightningnetwork/lnd/issues/7682

TheBlueMatt commented 1 year ago

When we do this, we should also disconnect peers that haven't sent a channel_reestablish after a while if we expect one. I think this may fix some other lnd bugs that I've seen once or twice.