Skip to content
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

pay: Share channel_hints across payments and plugins #7487

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cdecker
Copy link
Member

@cdecker cdecker commented Jul 23, 2024

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_hints to track these failures and compile
the 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_hints as notifications since we
might 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 untrusted
sources, 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:

graph TD;
    CLN7487 --> CLN7494;
    click CLN7487 "https://github.com/ElementsProject/lightning/pull/7487"
    click CLN7494 "https://github.com/ElementsProject/lightning/pull/7494"
    style CLN7487 fill:#AAFFAA
Loading

@cdecker cdecker force-pushed the 202407-pay-channel-hint-notifications branch 3 times, most recently from 1fa5a3f to 1601835 Compare July 25, 2024 13:29
@cdecker cdecker force-pushed the 202407-pay-channel-hint-notifications branch from 7ea5480 to 1c9886a Compare July 26, 2024 12:53
The `pay` plugin, as well as other plugins making use of the tree-pay
executor, will now emit their observations as they see them. The
notifications are sent on the `channel_hint_updated` topic, and any
subscriber will get them.

We also added a `timestamp` to the `struct channel_hint`, as these
observations now outlive the `pay` call, and have to be attenuated /
relaxed as they age, until we can eliminate them completely (when the
restriction is equal to the structural information gathered from the
gossip).

Changelog-Added: pay: Payments now emit `channel_hint_updated` notification to share inferred balances and observations across multiple payments.
We were missing the `short_channel_id_dir` helpers.
@cdecker cdecker force-pushed the 202407-pay-channel-hint-notifications branch from 1c9886a to a22375e Compare July 26, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant