Skip to content

routerrpc: add more failure reasons and route hints#3156

Merged
Roasbeef merged 4 commits into
lightningnetwork:masterfrom
joostjager:extended-fail
Jul 9, 2019
Merged

routerrpc: add more failure reasons and route hints#3156
Roasbeef merged 4 commits into
lightningnetwork:masterfrom
joostjager:extended-fail

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

@joostjager joostjager commented Jun 4, 2019

Changes:

  • FailureReasonError added. This is returned in case we get an unexpected response to our payment attempt for which it does not make sense to try different routes.
  • FailureReasonIncorrectPaymentDetails added. This is returned in case the payment hash is unknown, the amount is incorrect and/or the final cltv expiry is incorrect. The route that triggered this failure is returned along side the failure message itself.
  • Route hints can be passed into routerrpc.SendPayment. Previously this was only possible when the route hints were encoded in a payment request. Fixes Allow hop hints to be specified in routerrpc sendPayment #3202

These changes allow probing destinations (that may require route hints) with an unknown payment hash. By inspecting the route when a probe succeeds, a realistic fee and time lock estimate can be obtained.

Comment thread cmd/lncli/commands.go
@joostjager joostjager force-pushed the extended-fail branch 4 times, most recently from 74a78fd to 770373d Compare June 11, 2019 08:36
@Roasbeef Roasbeef added gRPC P3 might get fixed, nice to have payments Related to invoices/payments routing rpc Related to the RPC interface labels Jun 18, 2019
@joostjager joostjager changed the title routing+channeldb: add more failure reasons routerrpc: add more failure reasons and route hints Jun 18, 2019
Comment thread channeldb/payments.go Outdated
Comment thread routing/payment_lifecycle.go Outdated
Comment thread lnrpc/routerrpc/router.proto Outdated
Comment thread routing/control_tower.go Outdated
Comment thread lnrpc/routerrpc/router_server.go Outdated
Comment thread lnrpc/routerrpc/router.proto Outdated
Comment thread lnrpc/routerrpc/router_backend.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't attempt to also parse the route hints from the regular payment request.

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.

Payment request route hints are appended to the list of hints further down. This allows you to augment the encoded hints with a few more.

@joostjager
Copy link
Copy Markdown
Contributor Author

@Roasbeef ptal

@wpaulino wpaulino added this to the 0.7.1 milestone Jul 2, 2019
@wpaulino wpaulino added the v0.7.1 label Jul 2, 2019
Copy link
Copy Markdown
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 diff, pretty straightforward. some minor comments

Comment thread routing/router.go Outdated
Comment thread channeldb/payments.go Outdated
Comment thread routing/payment_lifecycle.go Outdated
Comment thread routing/payment_lifecycle.go Outdated
Copy link
Copy Markdown
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 🎉

Copy link
Copy Markdown
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🐡

@Roasbeef Roasbeef merged commit ba5fbb3 into lightningnetwork:master Jul 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gRPC P3 might get fixed, nice to have payments Related to invoices/payments routing rpc Related to the RPC interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow hop hints to be specified in routerrpc sendPayment

5 participants