Skip to content
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]: max-commit-fee-rate-anchors ignored at force close, much higher fee used. #8299

Open
KnockOnWoodNode opened this issue Dec 20, 2023 · 7 comments
Labels
bug Unintended code behaviour needs triage

Comments

@KnockOnWoodNode
Copy link

KnockOnWoodNode commented Dec 20, 2023

Background

Regarding the outstanding issue that will be fixed by #8096 still waiting to be merged, I finally received a FC by WOS, I was the opener.
Only it was published at 589sat/vB while my max-commit-fee-rate-anchors was set to 25.

Your environment

  • version of lnd0.17.3
  • which operating system (uname -a on *Nix) debian
  • version of btcd, bitcoind, or other backend bitcoind
  • any other relevant environment details

Steps to reproduce

Have channel with WOS, meet above bug, set sane limit for FC fee rate, see it completely ignored when tx is published at almost 24x the set value, overpaying 2x.

Expected behaviour

FC is published at desired max fee.

Actual behaviour

FC makes you pay 100$ in fees.

@KnockOnWoodNode KnockOnWoodNode added bug Unintended code behaviour needs triage labels Dec 20, 2023
@KnockOnWoodNode
Copy link
Author

Closing as "possibly mistaken". Ziggie checked the code for me and their opinion is that this couldn't possibly happen unless I did have that value set to a higher fee rate.
While I had it set high before as a matter of fact, I am fairly sure I decreased it after an ugly expensive FC I got a week ago.
WOS went offline for me after that.
But as I cannot, past any doubt, confirm that I in fact had it lowered in time for WOS to take it up, I am going to terminate the issue for now.

@KnockOnWoodNode
Copy link
Author

Ziggie suggested I reopen the issue 😛
In case someone can check the code with another pair of eyes.
So to sum it up, I had max-commit-fee-rate-anchors set to 1000 once. I got a couple of very ugly FCs, so I lowered it.
I have no means to prove that I had lowered it in time for an update to be sent to WOS, so my standing is less than rock solid.

@ziggie1984
Copy link
Collaborator

The give some background: LND will initiate a feeupdate msg in a timeperiod between 10min and 1h (randomly choosen) after the change of the lnd setting happened. Then for anchor channels we limit the feerate either to the max-commit-fee-rate-anchors when smaller than minrelayfee, the minrelayfee if its bigger than the cap, or the maxAmount we have on the channel when this amount is still smaller than the minrelay fee.

Here poured into code:

https://github.com/lightningnetwork/lnd/blob/master/lnwallet/channel.go#L8477-L8526

@Roasbeef
Copy link
Member

So a user set the max fee rate to 1000 sat/byte, there was a fee rate spike, causing the commit fee rate to go up to 500 sat/byte, then a force closer happened?

Was the value lowered before the fee rate? The value only really needs to be set to a value high enough to widely propagate across the network. In times like this 100, should give a lot of breathing room.

We have some changes planned where the user won't really need to set this value, and we'll dynamically set it based on our own mempool, and the feefilter value of our peers.

@Roasbeef
Copy link
Member

You can search for this in your logs to see when the last fee update happened: updating commit fee

@Roasbeef
Copy link
Member

Made this issue re that feefilter comment above: #8302

@KnockOnWoodNode
Copy link
Author

Was the value lowered before the fee rate?

This I believe was the case, but I am not able to prove it.
The most recent entry of updating commit fee for WOS chanpoint is updating commit fee to 145019 sat/kw which is lower than 589sat/vB...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour needs triage
Projects
None yet
Development

No branches or pull requests

3 participants