-
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]: unable to forward, wrong "insufficient bandwidth" #7108
Comments
The available local balance (msat), as parsed from lnd's log messages:
|
Note that I was able to forward 200,104 sat after the first failure (a few days later, 2022-10-29 10:54:17+02). As far as I can tell, the channel didn't move any sats between the first error and this outgoing forward. |
@C-Otto I guess not but is there is any htlc in flight blocking the channel liquidity? |
No, not according to the logs, and not right now (see |
Note that all "available local balance" values end with 999msat, so I guess it's this code: |
Note that I'm able to send payments out via the channel, which could be a related bug. |
FWIW, that's a static key channel (legacy), so any HTLC needs to be able to pay fees for itself at the given fee rate, this can cause you to be unable to send even though it looks like you can. Anchor channels allow the second level HTLC to be zero fees, so you don't need to commit as much since you just care about the impact of the output and not also the second level transaction itself. Not sure how many HTLCs you had at the time (or prior instance), but this also jumps out:
AFAICT, you're not the initaitor in this channel, and in one of the instance the remote party had a very low balance:
If they can't pay for the fees of an HTLC added, then we won't allow that to proceed as we can get into a situation where they only have dust or no amount left over in the channel. The reserve also comes into play as well: even if they can pay the fee, we can't let them dip below the reserve. |
I don't think that Yes, the remote party has a very low balance, especially considering the reserve. However, I don't understand why this stops me from sending funds to their side, i.e. creating a more balanced channel. It feels like the channel drove itself into a dead end? Assuming that there's a good reason for lnd to reject forwards, why am I able to use the channel for outgoing payments, initiated by me? Was this luck? Did I pick a suitable amount by chance? Is it a bug, i.e. should lnd also not allow these payments? All in all I'm rather confused and don't understand how the protection idea ("HTLC needs to be able to pay fees for itself") is supposed to work out in this situation if my node doesn't allow the remote balance to increase. |
So the initiator pays fees for a commitment transaction the entire time. They need to have enough fees to pay for a force close assigned, and also they pay all the fees for a co-op close. Each time you add an HTLC, they need to have enough funds to pay for that HTLC (it increases the size of the commitment transaction). This is the case even if they aren't the one adding an HTLC. In the case above, the initiator only has 100,078 sats on their side. The reserve itself is just 78 sats below that at 100k. As as a result, the channel can't be utilized unless the fee rate (for the commitment) transaction is reduced to the point that it can support another HTLC, then things can be rebalanced somewhat. The relationship between the fees paid, HTLC weight and the reserve mostly works on the spec level. However, there're some degenerate cases when a channel isn't able to be used due to the initiator not being able to pay fees. I think what happened is that they tried to send everything out of the channel, realized the reserve was there, then played around to send the most they could out, leaving that amount. Returning to the line you linked above: https://github.com/lightningnetwork/lnd/blob/master/lnwallet/channel.go#L7030-L7035 Since There is a way to get around this though: send a small amount continually back to yourself as a rebalance. If the amount is below dust, then no HTLC is added, so no extra fees are required. Prior spec discussion related to this issue can be found here: lightning/bolts#728. |
We added that logic to fix issues like this: #3787. In this case, the router would keep trying to send across that link, but it can't support it due to fees. Now we'll just ignore that and try another link. There were also prior cases of things like the reserve being violated, an output taking too many fees and becoming unspendable ("negative" balance). |
If I may chime in. I am running the node on the other side and initiated the channel a few weeks ago. |
Thanks a lot for the explanation. I think the discussion in lightning/bolts#728 is really helpful, and @Roasbeef's comment above puts this into the context of lnd's code. Personally, I think that this issue could be closed (see below), as it's a weird edge case without an obvious solution. The only two things missing:
@U-got-IT please switch to anchor channels, if possible. If not, please campaign for it to be supported. |
also see discussion in lightningnetwork#7108
I now have the same issue with at least five (!) other peers, all of them are anchor channels, though! I managed to send out 10k sat via rebalance-lnd in all cases. Other users are affected, too. I received one report via Twitter and two via Telegram. In all cases, the situations matches mine (low remote balance, log message indicating x999msat for values <500sat even though there's far more on the local side). |
Your ability to send is a function of the fee rate on the commitment transaction, which is controlled by the initiator. If the fees are low, you might be able to send, otherwise you might not be able to. I think the scenario laid about above is pretty clear, and also the work around as well (trickle payments to unstuck the channel). |
Isn't that fee rate the same for forwarded transactions? I don't see why forwards are blocked, while payments initiated by me are OK. |
Were the forwards and the initiated payment of the same amount? Re the fee rate I mean if they were done at different times, then the applied fee rate would differ. On the code level, both forwards and local adds go through pretty much the same code pathway: Lines 538 to 558 in f6ae63f
Which ends up calling |
The forwards had larger amounts, my initiated payments (rebalances) had 5k or 10k sat. I just did a test just two minutes after an observed failure: I don't think network conditions changed a lot in this timeframe (although one new block got mined in between). I'll try to do another test with less delay (no new block), and using a similar/higher amount. FYI, here's a list of remote-initiated channels that have less than 500sat on the remote side (updated every 30min): https://c-otto.de/lnd/low-remote.txt |
also see discussion in lightningnetwork#7108
Hello, foton node here. I am having the same behavior described here on v0.15.4, I noticed it with one node (Mushi) but reviewing in detail this is happening with some others. I get HTLC errors with Insufficient Balance but liquidity is on my side. Weird is I get this messages (I received in the last 24h, 55 HTLC errors to Mushi) but I had 8 successful transactions as well with this node. All the problematic channels have all the liquidity on my side. Best, |
also see discussion in lightningnetwork#7108
I have same issue.
It has occurred several times, usually at "353999 mSAT". |
Superseeded by #7721. |
~10% of my channels are presently unusable by this bug, or in other terms 60% of my local liquidity (outgoing) is frozen and cannot be rebalanced, forwarded or sent. Issue that supercedes appears to be an inversion of this bug, for low local balances. I have high local balances (98%+) and receive this error, I don't believe that this issue has been resolved.
|
Background
I have more than enough liquidity in one of my channels and should be able to serve outgoing forward requests. However, this doesn't work. Instead, lnd reports "insufficient bandwidth". Details below.
Your environment
Steps to reproduce
Get forwarding request out via channel X.
Expected behaviour
Forwarding request is served, fees are earned, local balance is reduced.
Actual behaviour
"insufficient bandwidth to route htlc: x is larger than y" (canSendHtlc in link.go)
First observed failure:
Balance at 2022-10-25 18:29:25+02:
Most recent failure:
Balance at 2022-11-03 13:14:47+01:
lncli listchannels
:lncli getchaninfo
:The text was updated successfully, but these errors were encountered: