xpay: stop retrying a node that repeats unknown_next_peer - #9592
Open
vincenzopalazzo wants to merge 2 commits into
Open
vincenzopalazzo wants to merge 2 commits into
vincenzopalazzo wants to merge 2 commits into
Conversation
unknown_next_peer means the reporting node cannot forward, which is
what lnd returns when the next peer is offline. xpay only disables the
failed channel, so getroutes hands back every other channel through the
same node.
This test fails a hub with four exits using that code. On current xpay
it walks all four:
Failed after 4 attempts. We got a weird error (unknown_next_peer)
for 131x1x0/1 ... 124x1x0/1 ... 117x1x0/1 ... 110x2x0/0
assert 4 <= 2
Marked xfail until the next commit excludes the node after the repeat.
Changelog-None.
The previous commit fails because xpay disables only the channel. A
second unknown_next_peer from the same node now calls
askrene-disable-node on this payment's private layer, so getroutes
stops handing back the rest of its channels.
The first failure still only disables that channel. One stale scid
must not take a well-connected node out of every path.
temporary_channel_failure and fee or CLTV errors are unchanged.
Removes the xfail from test_xpay_unknown_next_peer_excludes_node.
With the fix that test stops after two attempts:
Repeated unknown_next_peer from <hub>: disabling node for this payment
Fixes ElementsProject#9590.
Changelog-Fixed: xpay no longer retries every channel through a node that keeps returning unknown_next_peer.
vincenzopalazzo
force-pushed
the
fix/xpay-unknown-next-peer
branch
from
September 30, 2026 22:02
bab20a2 to
a97e697
Compare
This branch has not been deployed
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.
Summary
xpaytreatedunknown_next_peeras a single-channel failure. That is the code lnd returns when the next peer is offline, so a well-connected node was retried on every other channel untilretry_forexpired. Fixes Bug:xpayfails because it keeps retrying paths over the same node #9590.unknown_next_peerfrom the same node callsaskrene-disable-nodeon the private payment layer, sogetroutesstops handing back the rest of its channels.Test plan
test_xpay_unknown_next_peer_excludes_nodefails on master: 4 attempts, oneunknown_next_peerper hub channel (assert 4 <= 2)Repeated unknown_next_peer from <hub>: disabling node for this payment