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

routing: local balance check before path finding #3749

Merged

Conversation

joostjager
Copy link
Contributor

Fixes #1680

@joostjager joostjager force-pushed the extended-routing-failures branch 2 times, most recently from 962616c to 7939a9d Compare November 21, 2019 19:00
Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

nice commit structure, only question i have is whether or not to also begin exposing the tlv failures as a specific rpc destination failure rather than no route found. it's not super in line with this pr, so may be best in a follow up

routing/pathfind.go Outdated Show resolved Hide resolved
routing/payment_session.go Outdated Show resolved Hide resolved
routing/payment_lifecycle.go Show resolved Hide resolved
@joostjager joostjager force-pushed the extended-routing-failures branch 2 times, most recently from 05ffb0f to bbd7cd5 Compare November 26, 2019 09:35
@joostjager joostjager self-assigned this Nov 26, 2019
@joostjager joostjager added this to the 0.9.0 milestone Nov 26, 2019
channeldb/payments.go Outdated Show resolved Hide resolved
@joostjager
Copy link
Contributor Author

Todo: add test

Copy link
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.

Great work, the changes were very easy to follow.
This fix should really improve the UX of lnd, especially for beginners.
There are only two small things that should be fixed IMO, the rest is non-blocking.

routing/pathfind_test.go Show resolved Hide resolved
routing/errors.go Outdated Show resolved Hide resolved
channeldb/payments.go Outdated Show resolved Hide resolved
routing/pathfind.go Show resolved Hide resolved
Copy link
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.

LGTM 💯

Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

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

LGTM 👍

// ErrTargetNotInNetwork is returned when the target of a path-finding
// or payment attempt isn't known to be within the current version of
// the channel graph.
ErrTargetNotInNetwork
ErrTargetNotInNetwork errorCode = iota
Copy link
Contributor

Choose a reason for hiding this comment

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

preexisting, but errorCode should be exported if ErrTargetNotInNetwork is also exported for godocs

Copy link
Contributor

Choose a reason for hiding this comment

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

could be made into a trivial follow up

@cfromknecht
Copy link
Contributor

two of the async benchmarks failed, perhaps an indicator that this introduces a performance regression?

@joostjager
Copy link
Contributor Author

two of the async benchmarks failed, perhaps an indicator that this introduces a performance regression?

Manually checked the timing of a queryroutes call on testnet, didn't see a difference with master. Restarted itests

@joostjager
Copy link
Contributor Author

Yes, does seem to be failing consistently. Will check it out.

A unified policy differs between local channels and other channels on
the network. There is more information available for local channels and
this is used in the unified policy.

Previously we used the pathfinding source pubkey to determine whether to
apply the local channel logic or not. If queryroutes is executed with a
source node that isn't the self node, this wouldn't work.
@joostjager
Copy link
Contributor Author

Turned out to be a deadlock with getting the source node. Fixed now

@joostjager joostjager merged commit 883f9e5 into lightningnetwork:master Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages payments Related to invoices/payments routing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect payment error message
3 participants