lnrouter/lnworker: move liquidity hint update to htlc removal callbacks - #10774
Merged
Conversation
Update the channel liquidity hints in the `htlc_fulfilled`/`htlc_failed` callbacks instead of the htlc log handler (`_process_htlc_log()`). `_process_htlc_log()` would raise `PaymentSuccess()` on the first fulfilled htlc, removing the inflight htlcs counted in `LiquidityHintMgr` only for this htlc's route. All other htlcs that arrive later would leak and not get removed anywhere, so the inflight htlc counter didn't get decreased and successful routes would be punished by the penalty.
f321x
marked this pull request as draft
July 27, 2026 15:11
f321x
commented
Jul 27, 2026
f321x
marked this pull request as ready for review
July 27, 2026 15:16
SomberNight
approved these changes
Jul 29, 2026
Comment on lines
-2097
to
-2100
| # TODO: report every route to liquidity hints for mpp | ||
| # in the case of success, we report channels of the | ||
| # route as being able to send the same amount in the future, | ||
| # as we assume to not know the capacity |
Member
There was a problem hiding this comment.
I would say this comment contains important information needed to understand what assumptions the liquidity hints make and should be kept (somewhere). It is no longer a TODO but it is still valuable. Could be moved to e.g. the docstring of update_liquidity_hints.
Member
There was a problem hiding this comment.
I will add it back in a followup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move the liquidity hint updates from the htlc log processing to the htlc removal callbacks so they
get called for all htlcs we sent out.
On master we would decrement the inflight htlc counter on the liquidity hint only for the first
successful htlc's route, after which
PaymentSuccesswould end the payment flow.The remaining (successful) routes used for the other htlcs of a payment wouldn't get their counter decremented and
be penalized for this in subsequent payment attempts until the in-memory liquidity hints get reset through a restart.