lightningdevkit / rust-lightning

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

Channel link unrecoverable after updating commit fee (over-expose to dust-in-flight) #2315

Closed silenzara closed 1 year ago

silenzara commented 1 year ago

I just had a channel force close on me which started after my LND 0.16.2 node tried to update the channel commit fee which resulted in an error:

2023-05-23 15:51:06.183 [INF] HSWC: ChannelLink(556bcc6f01bbd72c49ec81735445a955a0f7d88408eede7905ab3add4fd69726:2): updating commit fee to 16191 sat/kw sat/kw
2023-05-23 15:51:06.502 [ERR] HSWC: ChannelLink(556bcc6f01bbd72c49ec81735445a955a0f7d88408eede7905ab3add4fd69726:2): failing link: ChannelPoint(556bcc6f01bbd72c49ec81735445a955a0f7d88408eede7905ab3add4fd69726:2): received error from peer: chan_id=2697d64fdd3aab0579
deee0884d8f7a055a945547381ec492cd7bb016fcc6b57, err=Peer sent update_fee with a feerate (16191) which may over-expose us to dust-in-flight on our own transactions (totaling 11638750 msat) with error: remote error
2023-05-23 15:51:06.502 [ERR] HSWC: ChannelLink(556bcc6f01bbd72c49ec81735445a955a0f7d88408eede7905ab3add4fd69726:2): link failed, exiting htlcManager

After this the channel link could not be reestablished, logs with relevant lines here: https://pastebin.com/raw/AiurbjkD

I'm not sure if this behavior is intended and since I could not find any issues related to "over-expose us to dust-in-flight on our own transactions" I'd thought to report it here.

Closing tx: https://mempool.space/tx/1521dfe44106225d2aa7d3cd45df6128eab55daa05444ab386bdf4c2d3a708c7

A 11,638 sat HTLC was involved as you can see in the closing tx.

TheBlueMatt commented 1 year ago

Yea, sadly its kinda intended - we have to limit our total max dust exposure at any one time to ensure we're not vulnerable to dust-inflation attacks by a mining counterparty (I believe all lightning implementations do this in one way or another). That said, with current feerate spikes dust issues are too easy to hit today. #2261 talks about how we need to bump the default dust exposure threshold config knob, which might have saved you here, and further this is not a reachable error in the post-anchors world, which we also intend to ship in the next release.

Sadly in the pre-anchors lightning protocol there's not a lot we can do to address this, aside from making it more rare and migrating to 0-fee-htlc-anchors.

silenzara commented 1 year ago

Thanks for the explanation, makes sense.

I thought it was related to the other dust issues but since I'm not familiar enough with LDK I wasn't sure this was the same thing. At least this specific issue will come up if someone searches for the specific error I got (Peer sent update_fee with a feerate...).

Cheers.