-
Notifications
You must be signed in to change notification settings - Fork 2k
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]: Node not Using Correct Fee Estimates During Channel Commitment Updates #8018
Comments
Thanks for this detailed explanation I think I traced down the error in this issue: I think the problem you are facing is, that your channel is drained locally and the default max-fee-allocation size is 0.5 which can lead to case (pretty likely cases when your channel is drained locally) that the feerate goes all the way down to 253sats/kw although your Fee-Estimator is proposing whay higher FeeRates as seen in your case. |
Regarding the code the main problem is here: https://github.com/lightningnetwork/lnd/blob/master/lnwallet/channel.go#L8421 and resulting in the problem here: https://github.com/lightningnetwork/lnd/blob/master/lnwallet/channel.go#L8457-L8458 The PR fixes the Problem and could need some Review. So the fee-estimation is right, but LND calculates the IdealFeeRate and takes into account the FeeAllocation Parameter. |
Thanks @ziggie1984 I will attempt to lower that parameter, and see if it can temporarily fix the issue... At least until my channel gets even more depleted and it locks up again. I will also review your PR soon |
You need to set it to 1 to be sure you do not lower the feerate beyond the old_feerate, lowering the value would even mean you reach lower proposing fees sooner. But keep in mind you will not fix exisiting issues with your channels as of today. The channelstate already progressed, and you need to hope for your Peer to either patch their CLN version (LND does not check the fee-sanity) or weight until the feerates for your Peer reach the proposed levels by yourself which can happen depending on how low the proposing fee was. |
I tried setting it |
Yeah unfortunetly channels which are already messed up cannot be repaired but it will prevent future fee-disagreements. |
This thing has made 4 of my channels go inactive. They connect and reconnect every few minutes, but fees don't change and the other peers refuse to renegotiate them for some reason, or perhaps it is me. I have changed allocation to 1, but no help. Logs:
What do you recommend me to do? |
Issue Description:
User kornpow is encountering issues with on-chain fee rates during channel commitments in different backend setups including bitcoind backend alone and in combination with various feeurls. Despite providing substantially overestimated fees through a custom feeurl, the node seems to be attempting to use significantly lower fee rates than provided, resulting in repeated warnings in the logs. The log messages indicate that the update fee is outside the expected range, and it appears the node is not utilizing the fee rates obtained from the fee backend correctly.
Backends used:
bitcoind (CONVERVATIVE)
bitcoind + LL feeurl
bitcoind + custom fee url configured to overpay
btcd
Details:
Summary from slack thread: https://lightningcommunity.slack.com/archives/C6BDA6DGE/p1695219625262109
Conversation Summary:
kornpow reported repeated warning messages in their logs regarding update fees being outside the expected range in different backend setups.
Peer error message:
err=update_fee 988 outside range 1904-90800 (currently 1760)
kornpow provided details of the fee rates returned by their custom feeurl and expressed confusion as to why the node seems to be offering much lower fees to peers. They also provided some logs from querying the Web API for fee related messages which seemed to return reasonable values.
alexbosworth mentioned the existence of an "Estimate Fee API" available in walletRpc as EstimateFee, but noted that LND doesn't produce its own fees, it relies on the fee backend, except for statically defined fees. They suggested increasing the logging levels and focusing on the LNWL subsystem to trace the issue.
Following alexbosworth's advice, kornpow increased the logging levels and focused on the LNWL subsystem. Kornpow later shared more detailed logs, including those showcasing warning messages from a peer regarding the update fee being outside the expected range.
Kornpow attempted to trace back the issue in the code, focusing on how and where the update_fee lightning messages are generated, and shared links to the relevant sections in the LND GitHub repository.
Logs and Error Messages:
The fee rates from the custom feeurl provided by kornpow were:
This was also a red flag:
Since
5500sat_per_kw == 21.7 sats/vbyte
and my fee url is proposing45 sats/vbyte
Kornpow is actively trying to track the issue in the code, focusing on the parts of the code that handle fee estimation and the sending of update_fee lightning messages.
Action Required
Assist kornpow in tracing the root cause of the issue in the code.
Help identify why the node is not utilizing the correct fee estimates from the backend during channel commitment updates.
Possibly look into the channel link files to check the process of sending update_fee messages and how the fee rates are being determined.
Requested Assistance
Further guidance in tracing the issue in the code.
Expert opinion on possible areas in the code that might be causing the discrepancy in fee estimates being used for channel updates.
Links to Possibly relevent Code Sections
Estimator.go
Update_fee.go
Link.go
Background
Describe your issue here.
Your environment
lnd
0.16.4
Steps to reproduce
This warning message causes CLN to disconnect from me. I can do
connect_peer
api, over and over, and have the same error occur, where it tries to use extremely low fees. In addition, on reboot it attempts to negotiate and disconnects.Expected behaviour
On re-connection it should get the fee from the chain backend or feeurl, and update the channel commitment with a reasonable value.
Actual behaviour
A mysterious fee is used to
update_fee
the channel commitment, which is unclear where the fee comes from. The CLN channel partner can see the fee is way below the mempool minimums, and disconnects.The text was updated successfully, but these errors were encountered: