-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature request: Limitation of outgoing htlcs per channel #61
Comments
This certainly does make sense, however, there are few serious caveats. Maybe @ziggie1984 can help with the API, I just took a quick look and couldn't find any effective ways to query unresolved HTLCs. The ways to obtain them:
Perhaps since we do ListChannels anyway during the initial preparation, we can as well gather the existing HTLCs at that stage. Note, that it can still either be plagued with race conditions or contain false information, or the implementation would be pretty complex. Race condition: we made sure there's space for more HTLCs in a particular channel, but before we attempt a payment another instance of regolancer did the same and added their HTLC (or maybe we have to forward someone else's). It's not bulletproof really. Or add a new API endpoint into upstream that returns all pending HTLCs, which shouldn't be hard technically I think but it'd require justification and this one problem is probably not enough. In general, you can (and probably should) limit the number of in-flight HTLCs with a circuit breaker. Because even if you only limit regolancer you can still forward other payments through those channels and accumulate many stuck HTLCs. In conclusion, not really sure this is in scope but if it's not hard to implement I welcome a PR. Otherwise increased complexity for a niche use case that can't even be reliably solved like this isn't worth it. |
Very good explanation of the issues! Thanks! |
I am running regolancer simultaneously with 6 workers.
Sometimes a channel or the connection to the peer gets buggy and the different regolancer sessions do not limit the outgoing amount of htlcs so it is accumulating the payment htlcs on the buggy channel. See example: Nordicrails with 7 pending payment htlcs.
Especially in high-fee onchain environment a FC can get very expensive.
So it would be great to have a general check for stuck htlcs (e.g. allowing a configurable maximum of 2-3 stuck payments) on the outgoing channel before establishing new payments htlcs.
The text was updated successfully, but these errors were encountered: