pay: Share channel_hints across payments and plugins #7487
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.
While performing a payment we attempt to get several HTLCs through
from the sender to the destination. Some of these attempts may fail,
due to temporary unavailability, insufficient balance, or many other
reasons. We use
channel_hint
s to track these failures and compilethe observations into a more detailed view of the network.
So far we were just forgetting all of the inferred information once
the payment is done, however this information is useful for later
payments too, as it allows us to skip attempts that are unlikely to
succeed, and essentially continue the exploration where the previous
payments have left off.
The main issue we face is how do we relax the hints over time, such
that we maximize their usefulness by allowing us to skip channels that
are unlikely to succeed, while at the same time minimizing the false
negative rate where we skip a channel that would have worked, based on
the prior observations. We implement it here as a linear decay, in
line with the leaky bucket rate limiting algorithm.
We model the sharing of the
channel_hint
s as notifications since wemight want to share observations across multiple plugins, and maybe
even across multiple nodes, if they are operated by the same
operator. DO NOT accept
channel_hint
notifications from untrustedsources, as they can be used directly to steer the route selection.
Changelog-Added: pay: Payments now emit
channel_hint_updated
notification to share inferred balances and observations across multiple payments.This is part of the following PR set: