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: Annotate both local alias and real scid with channel hints #6428

Merged

Conversation

cdecker
Copy link
Member

@cdecker cdecker commented Jul 23, 2023

Debugging a number of payments showed that we sometimes waste a number of attempts routing through a channel via its alias, rather than its scid. This is because while we annotate the scid when it has been set, we do not do so for the alias. The alias then is picked for routing despite not having enough capacity, failing the attempt locally.

It can also happen that we alternate between scid and alias, doubling the number of failed attempts before we can make progress.

This patch sets the hint for the alias to a capacity of 0 and disables it as if the peer were offline. This means when available we'll always use the scid, which is also far easier to read in the logs.

Changelog-Fixed: pay: We now track spendable amounts when routing on both the local alias as well as the short channel ID

@cdecker cdecker added this to the v23.08 milestone Jul 23, 2023
Debugging a number of payments showed that we sometimes waste a number
of attempts routing through a channel via its alias, rather than its
scid. This is because while we annotate the scid when it has been set,
we do not do so for the alias. The alias then is picked for routing
despite not having enough capacity, failing the attempt locally.

It can also happen that we alternate between scid and alias, doubling
the number of failed attempts before we can make progress.

This patch sets the hint for the alias to a capacity of 0 and disables
it as if the peer were offline. This means when available we'll always
use the scid, which is also far easier to read in the logs.

Changelog-Fixed: pay: We now track spendable amounts when routing on both the local alias as well as the short channel ID
@cdecker cdecker force-pushed the 20230723-pay-alias-disable branch 3 times, most recently from 3551129 to 4e67a15 Compare July 23, 2023 15:12
The channel selection did not consider the amounts that we are trying
to transfer, which in a multiplexed channel world could end up always
selecting a channel that is too small for the payment. We also log
which channel was selected based on the selector that is passed in,
allowing us to better follow the decisions.

Changelog-Fixed: pay: `sendonion` and `sendpay` will now consider amounts involved when using picking one channel for a peer
@cdecker cdecker force-pushed the 20230723-pay-alias-disable branch from 4e67a15 to b2dd282 Compare July 23, 2023 15:14
Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack b2dd282

@rustyrussell rustyrussell merged commit 5f65378 into ElementsProject:master Jul 23, 2023
38 checks passed
@cdecker cdecker deleted the 20230723-pay-alias-disable branch July 24, 2023 09:50
cdecker added a commit to cdecker/lightning that referenced this pull request Jul 27, 2023
The alias may not be set for non-alias channels after they
confirm. The other branch is safe because we only consider active
channels.

Changelog-None
Fixes ElementsProject#6450
rustyrussell pushed a commit that referenced this pull request Jul 28, 2023
The alias may not be set for non-alias channels after they
confirm. The other branch is safe because we only consider active
channels.

Changelog-None
Fixes #6450
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

2 participants