-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[bug]: can't bump fee of a coop closed channel #8391
Comments
If the fee rate of the transaction you want to bump is below the current mempool exclusion rate, then CPFP may not work. For CPFP to work, the node you're sending the tx to needs to have the parent transaction. It won't have the parent transaction if it was "dropped from the mempool". There's an upcoming improvement to the protocol that enables the co-op close txn to be RBF'd. This would help your case as the parent transaction is 2 sat/vbyte rn. |
Can't both txs be broadcasted together so that their combined fee rate is above the purge limit? Also, shouldn't there be at least some error reported back from that command? Currently it's impossible to tell whether it worked or not and why. And what should I do now to recover the funds? |
In theory yes, but in practice no. The Bitcoin protocol doesn't yet support "package relay", which is the feature that would allow both of them to be broadcasted in tandem.
After we merge #8345 we'll detect situations like this up front. But with the way the "mempool" works, we won't know for sure. You only know when something is mined. Even if the first peer accept the txn, all their peers may have a
Unfortunately, all you can do is wait (lower fees to the point where the parent tx is accepted by itself), or try to use some "transaction acceleration" service. |
Thanks for the comprehensive answer! This is truly sad. Does lnd rebroadcast this tx automatically until the tx gets into mempool or should I restart it to do that? I remember some fixes in this area but not sure if they cover this situation. |
Yeah, I wish we had better tools at this point in the venture :/
Yeah lnd will automatically rebroadcast. One thing I'm working on in the background is a tx accelerator that can operate purely over LN, so keysend to bump a fee for something. Needs some additional entities involved though. |
Good, then I suppose nothing can be done about it now. Thanks for the help! |
So, the channel has finally been closed as the fees dropped. However, the issue was still standing. I tried |
The Did you specify a fee rate when using |
I suppose it wouldn't be hard to extend it to co-op closes as well? We know our output and we can perform CPFP. Otherwise I need to manually look up the close tx and my output.
I specified |
This PR will allow for natively doing a fee bump (via RBF) on a co-op close channel: #8453 |
Depends if it fell out of the mempool or not. Architecture wise, it is possible, the first step is that the sweeping module is made aware of the co-op close outputs. We can morph this issue to track the implementation of that feature. |
I'm not against that, but I'd still like to know about the fee estimation quirk. Could it have happened because the original coop close tx was purged and rebroadcast later? Or maybe there was some other edge case? I found this in the log when I bumped the fee:
It was confirmed almost 16 hours after that, clearly the fee wasn't correct. It's not easy now to reconstruct the mempool structure at that time, but as I wrote the recent blocks had 18 sat/vB median fee and my tx was put more than 6 blocks away from the tip. It doesn't make sense no matter how you look at it if I requested it to confirm in 2 blocks. I understand that it's gonna always be random but my tx should at least be in the second mempool block, not 7-8th. Otherwise it's strictly impossible to confirm in 2 blocks. Either the web API calculates incorrectly, or there's something wrong with the CPFP scenario, maybe an edge case of sorts. |
The fee estimation we're hitting is just vanilla
Confirming in 2 block basically requires bidding at the very top of the mempool. This isn't something that you always want to do. We'll also take into account exactly how much we'll receive on the other side as well, to ensure we don't spend all the funds to fees. |
I don't see any spikes in that time frame, it was pretty smooth between 18 and 20 sat/vB.
Weird, does it mean that the option
The yield is 4947053 sats, I don't think this applies here. The fee was set to 2868 sats and the effective fee rate was 10 sat/vB. If it were 5200 sats, the effective rate would have been 18.4, and at the time that'd have made sure it's in the first block (unless it gets pushed back before it's mined but we can't do anything about it). I'm not convinced the current logic is correct and/or documented properly. |
Not that it doesn't work, but that "getting into the next two blocks" is always a moving target. If you bid 10 sat/byte, but the min is at 50 sat/byte, bumping is needed to get the fee to that point. The PR I linked above, and #8148 (the entire series) will resolve this (dynamic fee bumping, RBF for coop close). |
Background
The channel point: https://mempool.space/tx/e49ddf72ead7445430f8e3dae014fa415282fd4c28ebced17d41a7606293abb0#vout=1
It was coop closed by Boltz long ago, right before the ordinals spam began. The tx never confirmed and was purged from my mempool I suppose. Now I try to bump the fee using
lncli wallet bumpclosefee --conf_target 6 e49ddf72ead7445430f8e3dae014fa415282fd4c28ebced17d41a7606293abb0:1
, however the command exits without any errors or success messages (I expect{}
if it succeeds), there are no messages in the log either. I expect this command to use CPFP to bump my tx by spending my output but it doesn't seem to happen.Your environment
lnd
lnd-v0.17.3uname -a
on *Nix) Raspbian arm64btcd
,bitcoind
, or other backendbitcoind v25.0.0
The text was updated successfully, but these errors were encountered: