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]: fees default to 253sat/kw if fees cannot be downloaded from feeurl #8688
Comments
I think we should return the error here to be handled by the callers instead of returning the fee floor, lnd/lnwallet/chainfee/estimator.go Lines 778 to 790 in 2089a88
Looking at other implementations of |
We should also smooth/clamp the updates as well. This way we avoid adjusting too sharply in either direction. |
I wonder what's the best strategy to clamp the fee-rate, percentage of the current feerate seems to be not the best design when values are small hmm ? Moreover maybe we should unify the behaviour for example for the bitcoind estimator we will return the fallback fee in case there is an error while fetching the data. |
As @yyforyongyu said, best thing in case of error is to accept what the other party suggests. And in case the other party doesn't provide any value, just use the latest ones retrived. In case of sudden change but no error, yes, it is probably better to clamp it over the course of, for example, 6 blocks. For any of the two cases, you would need to store the information of the latest feeurl retrived, probably in a small separate file. You would also need to return an error if too much time has passed since the last retrival happened. Again, I would suggest returning an error after 6 blocks without retriving anything. Also an error should be provided just at the beginning, exiting the app, if the first retrival fails and the file with the stored values does not exist or is too old. |
This caused all our LDK nodes who had channels with our LSP (which runs LND) to be force closed. This is a catastrophic bug, I hope a fix is prioritized.
|
Background
Continuing from this bug #8675 which is also commented here ElementsProject/lightning#7254 it seems that LND defaults to 253sat/kw when the feeurl cannot be downloaded because of some reason, like bad internet connection or timeout from the feeurl server.
From that moment on, all channels get disabled because of extremely low fees, and LND nodes are able to reconnect and renegotiate when feeurl works again, but for some reason, CLN nodes connected aren't able to renegotiate the new fees.
Your environment
lnd
0.17Steps to reproduce
Make feeurl not available temporarily or timeout it, either at startup or during operation, and check how negotiated fees go down to 253sat/kw.
Second, if there is any channel open with a CLN node, watch how the renegotiation becomes imposible, and channels got disabled. If there is a pending HTLC then the channel gets force closed at timeout.
Expected behaviour
At least use the previous sane retrived fees, or do not try to renegotiate fees with any channel, returning a warning and waiting until they can be retrived.
Actual behaviour
Tries to renegotiate fees at ridiculous values, and cannot renegotiate fees with CLN when they come to normal.
The text was updated successfully, but these errors were encountered: