Commit Graph

127 Commits

Author SHA1 Message Date
Joost Jager
b6170788ea
routerrpc: add SendToRouteV2 that returns an HTLCAttempt message
Unify data structure with SendPayment/ListPayments.
2020-05-12 19:56:54 +02:00
Joost Jager
674c199047
routing: return full htlc attempt from router 2020-05-12 19:56:52 +02:00
Joost Jager
8e7c0757ec
routerrpc: expose preimage on the htlc level 2020-05-12 19:56:49 +02:00
Joost Jager
c33d94ff27
routing+routerrpc: add multiple outgoing channel restriction 2020-05-12 07:17:24 +02:00
Oliver Gugger
272598a706
lnrpc: generate gateway and swagger for all RPCs 2020-05-08 14:33:59 +02:00
Oliver Gugger
71c58c2c04
lnrpc: replace /// and /** with // and /* 2020-05-08 14:33:34 +02:00
Oliver Gugger
0800386138
lnrpc: unify proto style by moving services to top of file 2020-05-08 14:33:04 +02:00
carla
e229717025
lnrpc: add failure detail none to link event rpc 2020-05-04 09:33:25 +02:00
Joost Jager
f6b2410011
routing+routerrpc: rename max_shards to max_parts
Don't introduce a new term and align with the P in MPP.
2020-04-22 14:49:19 +02:00
Joost Jager
d51bb65536
routerrpc+lncli: add flag to suppress in-flight updates
This is a preparation for enabling the REST interface on routerrpc.
It provides REST clients that don't support server-side streaming
via keep-alive connections to use the streaming endpoint in the
typical request/response pattern. The url just needs to contain
?no_inflight_updates=true and only the terminal response is sent
back before the connection is closed.
2020-04-21 17:02:09 -07:00
Joost Jager
7fe100bcfb
routerrpc: bring back legacy track and send rpcs
To soften the transition for routerrpc users to the V2 messages.
2020-04-21 20:37:45 +02:00
Joost Jager
d451ef4ee1
routerrpc: rename rpcs to SendPaymentV2 and TrackPaymentV2
The message in the response stream changed. Rename the calls themselves,
to prevent older applications from getting decode errors. Especially
troublesome is the case where the request is executed (send payment),
but the application can't read the outcome (payment sent or not?)
2020-04-21 20:36:58 +02:00
Joost Jager
969eecc7d2
routing+routerrpc+lncli: rename MaxHtlcs to MaxShards 2020-04-14 10:31:59 +02:00
Joost Jager
e61ff2202d
lnrpc: report total fees paid
Fixes a bug where only the fees of the last route where reported.
2020-04-10 11:05:55 +02:00
Joost Jager
06f73c0a66
lnrpc: remove deprecated payment path
Not applicable anymore on the payment level with multi-part sends.
2020-04-10 11:05:52 +02:00
Olaoluwa Osuntokun
363caa441a
rpc: allow wumbo invoices
In this commit, we remove the restriction surrounding the largest
invoices that we'll allow a user to create. After #3967 has landed,
users will be able to send in _aggregate_ a payment larger than the
current max HTLC size limit in the network. As a result, we can just
treat that value as the system's MTU, and allow users to request
payments it multiples of that MTU value.

A follow up to this PR at a later time will also allow wumbo _channels_.
However, that requires us to tweak the way we scale CSV values, as post
wumbo, there is no true channel size limit, only the
_local_ limit of a given node. We also need to implement a way for nodes
to signal to other nodes their accepted max channel size.
2020-04-09 19:02:08 -07:00
Joost Jager
e9bd691e6a
routerrpc+routing: adapt payment session for multi shard send
Modifies the payment session to launch additional pathfinding attempts
for lower amounts. If a single shot payment isn't possible, the goal is
to try to complete the payment using multiple htlcs. In previous
commits, the payment lifecycle has been prepared to deal with
partial-amount routes returned from the payment session. It will query
for additional shards if needed.

Additionally a new rpc payment parameter is added that controls the
maximum number of shards that will be used for the payment.
2020-04-09 08:20:49 +02:00
Joost Jager
af4abe7d58
routing+routerrpc: notify full payment structures
This commit fixes the inconsistency between the payment state as
reported by routerrpc.SendPayment/routerrpc.TrackPayment and the main
rpc ListPayments call.

In addition to that, payment state changes are now sent out for every
state change. This opens the door to user interfaces giving more
feedback to the user about the payment process. This is especially
interesting for multi-part payments.
2020-04-08 09:26:33 +02:00
Joost Jager
351d8e174c
lnrpc: expose payment failure reason 2020-04-08 08:53:59 +02:00
Joost Jager
327634e9f7
routerrpc: move payment marshalling 2020-04-08 08:53:57 +02:00
Joost Jager
acefb64207
routerrpc: remove payment-level route field
With multi-part payments, a payment-level route field does not make
sense anymore.
2020-03-31 21:41:30 +02:00
Joost Jager
ffa7bed7f0
build+routerrpc+lncli: remove routerrpc conditional compilation 2020-03-31 21:41:22 +02:00
Joost Jager
e11a3b24d8
lnrpc/routerrpc: rename RoutingConfig file 2020-03-31 21:41:20 +02:00
Joost Jager
bc7ee9a7d0
routerrpc: fix empty payment request bug 2020-03-31 21:41:18 +02:00
carla
5516a53728
routerrpc: run rpc-format on routerrpc 2020-03-20 11:11:45 +02:00
carla
0a5b918db2
routerrpc: add htlcnotifier subscription 2020-03-13 09:47:19 +02:00
carla
aa70d5d02a
routerrpc: add quit channel to signal shutdown 2020-03-13 09:36:39 +02:00
carla
67d4bad73f
rpcserver+routerrpc: add subscribe events to router backend
Add SubscribeHtlcEvents to RouterBackend in preparation for the
addition of a HtlcNotifier stream.
2020-03-13 09:30:16 +02:00
Oliver Gugger
fdcb30e57f
lnrpc: run clang-format 2020-03-10 20:19:08 +01:00
Joost Jager
c0cb05d7b4
lnrpc: expose raw htlc failure
Adds a new rpc field to the payment htlc proto message and populates it
with data that is now stored in the db.
2020-03-09 18:31:41 +01:00
Joost Jager
e6e9e44e6f
routerrpc: extract wire error marshalling
Preparation for marshalling wire errors as part of rpc payment lookups.
2020-03-09 11:43:36 +01:00
Joost Jager
3f5ba35dea
routerrpc: move marshall functions out of conditionally compiled file
These functions will (indirectly) be called by the main rpc server and
can no longer stay conditionally compiled.
2020-03-09 11:43:34 +01:00
Joost Jager
6aab6c0bac
routerrpc+lnrpc: move htlc failure messages
In a later commit, htlc raw failure messages will be exposed through the
main rpc. This is a preparation for that.
2020-03-09 11:43:32 +01:00
Oliver Gugger
1b543f0d50
routerrpc: format router.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to
JSON in lncli and REST. The jsonpb has a setting to use the
original name as defined in the proto file and the explicit
json_name definition is not necessary any more.
The jsonpb setting is called OrigName and needs to be true.
2020-03-07 11:23:07 +01:00
Carsten Otto
a908a74acb Fix typos 2020-01-17 21:18:20 +00:00
Carla Kirk-Cohen
7d356458e3
Merge pull request #3843 from carlaKC/htlcnotifier-0-switcherrors
[htlcnotifier 1/4]: Introduce Internal Errors
2020-01-15 08:46:38 +02:00
Joost Jager
5de308c4b5
routerrpc: update final cltv delta default
The default was increased for the main sendpayment RPC in commit
d3fa9767a9729756bab9b4a1121344b265410b1a. This commit sets the
same default for QueryRoutes, routerrpc.SendPayment and
router.EstimateRouteFee.
2020-01-14 21:03:24 +01:00
carla
b5a2d75465
htlcswitch+routing: type check on ClearTextError
Update the type check used for checking local payment
failures to check on the ClearTextError interface rather
than on the ForwardingError type. This change prepares
for splitting payment errors up into Link and Forwarding
errors.
2020-01-14 15:07:42 +02:00
carla
102f9b003f
htlcswitch: add ClearTextError interface
This commit adds a ClearTextError interface
which is implemented by non-opaque errors that
we know the underlying wire failure message for.
This interface is implemented by ForwardingErrors,
because we can fully decrypt the onion blob to
obtain the underlying failure reason. This interface
will also be implemented by errors which originate
at our node in following commits, because we know
the failure reason when we fail the htlc.

The lnwire interface is un-embedded in the
ForwardingError struct in favour of implementing
this interface. This change is made to protect
against accidental passing of a ForwardingError
to the wire, where the embedded FailureMessage
interface will present as wire failure but
will not serialize properly.
2020-01-14 15:07:41 +02:00
Joost Jager
81bf6e15b3
routing+lnrpc: add missing query routes parameters 2020-01-14 11:21:31 +01:00
carla
b6f546503a
routerrpc: add MppTimeout code to failures 2019-12-20 13:02:19 +02:00
Conner Fromknecht
e6db31f267
routerrpc: allow dest_features graph fallback 2019-12-19 16:28:57 -08:00
Conner Fromknecht
35dd5f354d
routerrpc: parse dest_features bits for manual SendPayment 2019-12-18 23:57:38 -08:00
Conner Fromknecht
457fda6095
routerrpc: add dest_features to SendPaymentRequest 2019-12-18 23:57:23 -08:00
Conner Fromknecht
f868bc128b
rpcserver+routerrpc: thread features + payment addr to SendPayment 2019-12-18 23:56:59 -08:00
Joost Jager
d16476e477
routerrpc+record: move custom set validation 2019-12-12 17:49:34 +01:00
Joost Jager
c37289cd94
routing: pass custom records into pathfinding 2019-12-12 00:15:00 +01:00
Joost Jager
d02de70d20
multi: do not use tlv.Record outside wire format handling
This commit prepares for more manipulation of custom records. A list of
tlv.Record types is more difficult to use than the more basic
map[uint64][]byte.

Furthermore fields and variables are renamed to make them more
consistent.
2019-12-12 00:14:58 +01:00
Joost Jager
8b5bb0ac63
record: move CustomRecordSet 2019-12-12 00:12:19 +01:00
Olaoluwa Osuntokun
392c1a9a1b
lnrpc/routerrpc: make SendToRoute consistent with other payment RPCs
In this commitment, we make the `SendToRoute` RPC call consistent with
all the other payment RPCs which will properly adhere to the current max
payment sat limit. This is a prep commit for the future wumbo soft cap
that will eventually land in lnd.
2019-12-04 15:10:44 -08:00