lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.64k stars 2.08k forks source link

[feature]: Settings to force anchor channels only that rejects legacy static_to_remote channels requests. #8075

Open hazrulnizam opened 11 months ago

hazrulnizam commented 11 months ago

Is your feature request related to a problem? Please describe. The Bcash_Is_Trash node is wreaking havoc with force closes. They opened a lot of static_to_remote channels to other nodes, including mine, then due to a protocol misbehaviour triggered their peers to force close the channel with a very low commitment fee, leaving the peers with no way to speed up the force close confirmation.

This was what happened to my node:

2023-10-03 12:50:42.916 [ERR] HSWC: ChannelLink(2f1fba221a8daf6217e86d00e74943bc127f61e60ff8616ccec140a502320871:8): failing link: ChannelPoint(2f1fba221a8daf6217e86d00e74943bc127f61e60ff8616ccec140a502320871:8): unable to accept new commitment: commitment fee per kw 250 sat/kw below fee floor 253 sat/kw with error: invalid commitment
2023-10-03 12:50:42.916 [ERR] HSWC: ChannelLink(2f1fba221a8daf6217e86d00e74943bc127f61e60ff8616ccec140a502320871:8): link failed, exiting htlcManager
2023-10-03 12:50:42.916 [INF] HSWC: ChannelLink(2f1fba221a8daf6217e86d00e74943bc127f61e60ff8616ccec140a502320871:8): exited
2023-10-03 12:50:42.916 [INF] HSWC: ChannelLink(2f1fba221a8daf6217e86d00e74943bc127f61e60ff8616ccec140a502320871:8): stopping
2023-10-03 12:50:42.917 [WRN] PEER: Peer(0298f6074a454a1f5345cb2a7c6f9fce206cd0bf675d177cdbf0ca7508dd28852f): Force closing link(723985:1100:8)

and here is the resulting transaction: https://mempool.space/tx/db1ecbd132b815505db3a6cee4beebc7c9e00cf6a36e6d44797099c969e667c3

Tried to find contact details for the Bcash_Is_Trash node operator to ask them to CPFP the transaction but it is proving to be futile. Some other people are resorting to sending messages on amboss.space to beg and plead for a CPFP:

image

Here are some other examples of this tragedy taking place: https://mempool.space/tx/be065bb22552ca53f26841733ea844da70fba72dd08506245cbb234e34e59c84#vin=0 https://mempool.space/tx/cadc7bbdf7499f86bd12f867107c9ee8efcff4d3dcfd7cd1d3ce36e3b1258685#vin=0 https://mempool.space/tx/7d027ca0bdd411b613ce68b567dc1d62689bd5e5e86cc0787093da73d36e881e#vin=0 https://mempool.space/tx/f58bc779bd8a74dd33f6ca2e80da1d62865f0ccd2af6c4094737ac7b85e3ad3e#vin=0 https://mempool.space/tx/7bb78ab6d9b9e4606b20b5c5b49c1bce3d8daec621ff767c6bec754913a94630#vin=0 https://mempool.space/tx/f9c55670f53f471f5dd759baf4679bb954a48617915b1172850e531db7ca52ed#vin=0 https://mempool.space/tx/1f0cb7d5da42bb2d76f13a2578c1ec2f71fb57a979c57ab14993b8a36345207d#vin=0 https://mempool.space/tx/6eb0b9127af4af4cf533238fad6f49559ef91f7e2bc29707aa91cb8688ed98e7#vin=0 https://mempool.space/tx/ae109dd3eccb1b7611e0f46c73e4f697153adc156a48bc3e5714e23c884f2df0#vin=0 https://mempool.space/tx/22a5c21790379a4a10b88b7551b3adb1774e93a6b231049139c6c1efe1670a70#vin=0 https://mempool.space/tx/6368fea16448e7fb5284e8ce0453ba044145eb4e07d7b52d601cb1b3e1590f43#vin=0

Describe the solution you'd like I would like there to be a simple setting where we can set static_to_remote.accept = false, force_anchor_channels = true, or something similar, so that we only accept channel open requests for anchor channels, that will enable us to CPFP our own force closes and to protect our nodes from misbehaving nodes such as Bcash_Is_Trash.

Describe alternatives you've considered This was discussed briefly in https://github.com/lightningnetwork/lnd/issues/7488, where it was suggested to use channel-acceptor as a solution but I think this solution is too technically-involved for the layperson node-runner.

Additional context

guggero commented 11 months ago

I propose a new flag protocol.force-anchors right next to the existing protocol.no-anchors (the two flags would of course be mutually exclusive).

bota87 commented 11 months ago

What about deprecate the boolean protocol.no-anchors in favor of a 3 state setting like protocol.anchors: