Skip to content

routing: last hop restriction#3739

Merged
joostjager merged 4 commits intolightningnetwork:masterfrom
joostjager:incoming-restriction
Nov 19, 2019
Merged

routing: last hop restriction#3739
joostjager merged 4 commits intolightningnetwork:masterfrom
joostjager:incoming-restriction

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

@joostjager joostjager commented Nov 18, 2019

This PR adds an optional last hop restriction to payments.

Previously both paths were equal cost, so it could also be a
coincedence that the path with the outgoing restriction would be chosen.
@joostjager joostjager requested a review from Roasbeef as a code owner November 18, 2019 11:14
@joostjager joostjager removed the request for review from Roasbeef November 18, 2019 11:15
@joostjager joostjager force-pushed the incoming-restriction branch 2 times, most recently from 9f28670 to 59ec4fe Compare November 18, 2019 11:58
@joostjager joostjager self-assigned this Nov 18, 2019
@joostjager joostjager added this to the 0.9.0 milestone Nov 18, 2019
Copy link
Copy Markdown
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Very nice and clean PR! This will allow us to craft rebalance payments without external tools, right?
LGTM, there's only a small comment that is non-blocking.

@joostjager joostjager force-pushed the incoming-restriction branch 2 times, most recently from 190416d to a21c7d7 Compare November 18, 2019 16:12
@joostjager
Copy link
Copy Markdown
Contributor Author

Very nice and clean PR! This will allow us to craft rebalance payments without external tools, right?

In combination with #3736 it does.

Also we can use this to loop into a specific channel.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we care about validating whether this is an existing node in the graph? Path finding would result in unable to find a path to destination, which can be ambiguous.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We also don't do this for the outgoing channel restriction. As this is advanced functionality, I am ok with leaving it up to the caller to make sure this doesn't happen. What do you think?

Maybe if we start fixing #1680, we can add two new payment failures:
no_outgoing_channel (with enough balance and not filtered out) and no_last_hop (with enough capacity and not filtered out).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can defer it until then.

@joostjager joostjager merged commit a00a360 into lightningnetwork:master Nov 19, 2019
C-Otto added a commit to C-Otto/rebalance-lnd that referenced this pull request Jan 17, 2020
nova-smith702prv5 added a commit to nova-smith702prv5/rebalance-lnd that referenced this pull request Sep 29, 2025
gas-optimizer380m added a commit to gas-optimizer380m/rebalance-lnd that referenced this pull request Oct 20, 2025
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.

3 participants