lnd icon indicating copy to clipboard operation
lnd copied to clipboard

[bug]: RBF cooperative close allows reducing the fee rate

Open ZZiigguurraatt opened this issue 8 months ago • 5 comments

I try to close a channel

132cfa64874d:/$ lncli closechannel --chan_point bd47c6b90d0f36325ca473806c020c9fd8120d8bc654a41a0e8dfc423571bf61:0 --sat_per_vbyte 1
Channel close successfully initiated
Channel close transaction broadcasted: 474a2e1f4b6157024c69f01b802efc4d325f9577f543832b2bf92fef636d0cb1
{
    "closing_txid": "474a2e1f4b6157024c69f01b802efc4d325f9577f543832b2bf92fef636d0cb1"
}
132cfa64874d:/$ 

Then I try to increase the fee

132cfa64874d:/$ lncli closechannel --chan_point bd47c6b90d0f36325ca473806c020c9fd8120d8bc654a41a0e8dfc423571bf61:0 --sat_per_vbyte 2
Channel close successfully initiated
Channel close transaction broadcasted: 474a2e1f4b6157024c69f01b802efc4d325f9577f543832b2bf92fef636d0cb1
{
    "closing_txid": "474a2e1f4b6157024c69f01b802efc4d325f9577f543832b2bf92fef636d0cb1"
}
132cfa64874d:/$ 

then I try to reduce the fee

132cfa64874d:/$ lncli closechannel --chan_point bd47c6b90d0f36325ca473806c020c9fd8120d8bc654a41a0e8dfc423571bf61:0 --sat_per_vbyte 1
Channel close successfully initiated
Channel close transaction broadcasted: 474a2e1f4b6157024c69f01b802efc4d325f9577f543832b2bf92fef636d0cb1
{
    "closing_txid": "474a2e1f4b6157024c69f01b802efc4d325f9577f543832b2bf92fef636d0cb1"
}
132cfa64874d:/$ 

which works, but I should expect an error or warning here. I don't know that this makes sense to be able to reduce the fee.

Keep in mind that https://github.com/lightningnetwork/lnd/issues/9827 and https://github.com/lightningnetwork/lnd/issues/9828 are causing a weird closing_txid to be shown above.

ZZiigguurraatt avatar May 19 '25 14:05 ZZiigguurraatt

Did the fee bump really work since the txid is the same in all three examples?

hieblmi avatar May 19 '25 15:05 hieblmi

Did the fee bump really work since the txid is the same in all three examples?

I don't know because of the other issues referenced.

ZZiigguurraatt avatar May 19 '25 15:05 ZZiigguurraatt

I don't know that this makes sense to be able to reduce the fee.

It doesn't make sense because the lower fee transaction "should" never be mined, but the peer also has no incentive to agree to this if they aren't the one that paid the original higher fee because they should always want the highest fee TX to be the only one in the mempool.

ZZiigguurraatt avatar May 19 '25 15:05 ZZiigguurraatt

Did the fee bump really work since the txid is the same in all three examples?

I don't know because of the other issues referenced.

Based on the workflow described in https://github.com/lightningnetwork/lnd/issues/9827#issuecomment-2892294210, I think it is reducing the fee because the TXID changes. However, gRPC does not stream close_pending updates, which makes it even more sneaky.

ZZiigguurraatt avatar May 19 '25 21:05 ZZiigguurraatt

You can't actually reduce the fee rate due to RBF rules.

When you propose an RBF update, it's just for your version of the closing txn. Now with the RBF coop close flow, each side can obtain their own version of the closing transaction.

Each time you update, you use your own fees. So there's no concern re a peer not accepting your update.

Roasbeef avatar May 19 '25 23:05 Roasbeef