Commit Graph

65 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
b85c92d8d5
lnrpc/routerrpc: add payment addr to SendPaymentRequest
Fixes #4692
2021-01-05 19:04:57 -08:00
Olaoluwa Osuntokun
d996607470
routing+lnrpc: extend BuildRoute to accept raw payAddr
In this commit, we extend the `BuildRoute` method and RPC on the router
sub-server to accept a raw payment address which will be included as
part of an MPP payload for the finla hop. This change actually also
allows users to craft their own MPP paths using BuildRoute+SendToRoute.
Our primary goal however, was to fix some broken itests since we now
require the payAddr to be present for ALL payments other than key send
payments.
2020-11-25 16:32:02 -08:00
Juan Pablo Civile
033c5b7a3f htlcswitch,rpc: expose onion blob for intercepts 2020-10-31 14:09:52 -03:00
Joost Jager
2903505164
htlcswitch: expose custom records on intercepted packet 2020-06-27 11:00:46 +02:00
Joost Jager
363142de33
htlcswitch: expose additional fields for intercepted packets 2020-06-27 11:00:44 +02:00
Joost Jager
607927634d
routerrpc: remove redundant htlc prefix from proto field
The message name already sets the context to an htlc.
2020-06-27 10:59:06 +02:00
Joost Jager
f6f8e3221b
routerrpc: clarify proto fields to be outgoing 2020-06-27 10:59:04 +02:00
yyforyongyu
987edc9d81 multi: add a rpc endpoint to track the recovery process 2020-06-25 15:49:54 +08:00
Roei Erez
7b56268f70 rpc: implement RPC htlc interceptor.
In this commit we add the ability to intercept forwarded htlc packets
straight from the RPC layer. The RPC layer handles a bidrectional stream
that comminucates to the client the intercepted packets and handles its
response by coordinating with the interceptable switch.
2020-06-18 15:20:07 +03:00
Oliver Gugger
19e3dc6378
routerrpc: format proto 2020-06-04 08:50:44 +02:00
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
c33d94ff27
routing+routerrpc: add multiple outgoing channel restriction 2020-05-12 07:17:24 +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
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
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
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
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
Oliver Gugger
fdcb30e57f
lnrpc: run clang-format 2020-03-10 20:19:08 +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
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
457fda6095
routerrpc: add dest_features to SendPaymentRequest 2019-12-18 23:57:23 -08:00
Joost Jager
352334d470
lnrpc: re-enable custom records
This commit also renames the rpc field for consistency. As it wasn't
functional and the id doesn't change, this isn't considered a breaking
change.
2019-12-04 13:27:33 +01:00
Joost Jager
97344af8f3
routing: local balance check 2019-12-04 09:45:07 +01:00
Joost Jager
2d19201ede
lnrpc+routerrpc+lncli: add allow_self_payments safety flag 2019-11-26 10:15:46 +01:00
Joost Jager
cdf1aa5bc1
routing: track amt ranges in mc 2019-11-22 11:17:28 +01:00
Joost Jager
62f8cca75b
routing+routerrpc: also expose amt for success results in mc 2019-11-22 11:17:26 +01:00
Conner Fromknecht
68916eb4b7
routerrpc: add HTLCAttempts to PaymentStatus 2019-11-19 20:42:38 -08:00
Joost Jager
f28941c7e4
routing+routerrpc+lncli: enable last hop restriction for payments 2019-11-18 21:03:03 +01:00
Joost Jager
09b3101b80
lnrpc+routerrpc+lncli: add amt and fee limit msat fields 2019-11-13 10:32:35 +01:00
Joost Jager
fb57255b5c
routerrpc: add mc probability query rpc
Probabilities are no longer returned for querymc calls. To still provide
some insight into the mission control internals, this commit adds a new
rpc that calculates a success probability estimate for a specific node
pair and amount.
2019-10-29 12:32:19 +01:00
Joost Jager
04e7c98461
routerrpc: create pair data proto message
With a separate proto message, it becomes possible to also return the
pair data for a single pair. This prepares for the new mc probability
querying rpc.
2019-10-29 12:32:17 +01:00
Joost Jager
fab13900e2
routing+routerrpc: remove probability estimates from mc state snapshot
Probability estimates are amount dependent. Previously we assumed an
amount, but that starts to make less sense when we make probability more
dependent on amounts in the future.
2019-10-22 15:52:36 +02:00
Daniel McNally
f437b35fc6
lnrpc: set JS_STRING option for chan_id
This sets the `jstype` option to `JS_STRING` for all `chan_id` fields
in the proto rpc definition. `chan_id` is a 64 bit integer, which is
not natively supported by javascript's floating-point `number` with
only 52 bit precision. Nevertheless, by default protobuf will use the
`number` type for 64 bit integer fields in javascript, which can cause
loss of precision problems with `chan_id`. Explicitly setting the type
for javascript as a string will prevent these issues, and should not
interfere with its use as an identifier.
2019-10-14 14:53:54 -04:00
Wilmer Paulino
0fc401de19
routing+routerrpc: take max cltv limit into account within path finding
With the introduction of the max CLTV limit parameter, nodes are able to
reject HTLCs that exceed it. This should also be applied to path
finding, otherwise HTLCs crafted by the same node that exceed it never
left the switch. This wasn't a big deal since the previous max CLTV
limit was ~5000 blocks. Once it was lowered to 1008, the issue became
more apparent. Therefore, all of our path finding attempts now have a
restriction of said limit in in order to properly carry out HTLCs to the
network.
2019-10-11 18:04:49 -04:00
Joost Jager
2d405d56a4
routerrpc: fix failure message marshalling 2019-10-10 20:27:12 +02:00
Joost Jager
299821152a
routing+routerrpc: add BuildRoute function 2019-09-24 10:00:44 +02:00
Joost Jager
f60e4b1e14
lnwire+htlcswitch: report height for invalid payment details failure
Extends the invalid payment details failure with the new accept height
field. This allows sender to distinguish between a genuine invalid
details situation and a delay caused by intermediate nodes.
2019-09-16 10:10:20 +02:00
Olaoluwa Osuntokun
ebb3e987b1
lnrpc/routerrpc: complete JSON naming for mc responses 2019-08-23 16:36:35 -07:00
Joost Jager
ff0c5a0d5e
routing: process successes in mission control
This commit modifies paymentLifecycle so that it not only feeds
failures into mission control, but successes as well.
This allows for more accurate probability estimates. Previously,
the success probability for a successful pair and a pair with
no history was equal. There was no force that pushed towards
previously successful routes.
2019-08-23 09:15:41 +02:00
Olaoluwa Osuntokun
763cb6c09d
lnrpc+lnrpc/routerrpc: add a new TLV record field to the Hop proto
In this commit, we add a new field to the Hop proto to allow callers to
be able to specify TLV records for the SendToRoute call, and also to be
able to display TLV records that were used during regular path finding.

We also update SendPayment to support dest TLV records.
2019-08-22 18:53:03 -07:00