@@ -54,15 +54,23 @@ message SendPaymentRequest {
5454 uint64 outgoing_chan_id = 8 ;
5555
5656 /**
57- An optional maximum total time lock for the route. If zero, there is no
58- maximum enforced.
57+ An optional maximum total time lock for the route. This should not exceed
58+ lnd's `--max-cltv-expiry` setting. If zero, then the value of
59+ `--max-cltv-expiry` is enforced.
5960 */
6061 int32 cltv_limit = 9 ;
6162
6263 /**
6364 Optional route hints to reach the destination through private channels.
6465 */
6566 repeated lnrpc.RouteHint route_hints = 10 [json_name = "route_hints" ];
67+
68+ /**
69+ An optional field that can be used to pass an arbitrary set of TLV records
70+ to a peer which understands the new records. This can be used to pass
71+ application specific data during the payment attempt.
72+ */
73+ map <uint64 , bytes > dest_tlv = 11 ;
6674}
6775
6876message TrackPaymentRequest {
@@ -173,7 +181,7 @@ message Failure {
173181 */
174182 RESERVED = 0 ;
175183
176- UNKNOWN_PAYMENT_HASH = 1 ;
184+ INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1 ;
177185 INCORRECT_PAYMENT_AMOUNT = 2 ;
178186 FINAL_INCORRECT_CLTV_EXPIRY = 3 ;
179187 FINAL_INCORRECT_HTLC_AMOUNT = 4 ;
@@ -194,6 +202,7 @@ message Failure {
194202 TEMPORARY_NODE_FAILURE = 19 ;
195203 PERMANENT_NODE_FAILURE = 20 ;
196204 PERMANENT_CHANNEL_FAILURE = 21 ;
205+ EXPIRY_TOO_FAR = 22 ;
197206
198207 /**
199208 The error source is known, but the failure itself couldn't be decoded.
@@ -232,6 +241,9 @@ message Failure {
232241 the failure message. Position zero is the sender node.
233242 **/
234243 uint32 failure_source_index = 8 ;
244+
245+ /// A failure type-dependent block height.
246+ uint32 height = 9 ;
235247}
236248
237249
@@ -323,9 +335,13 @@ message ResetMissionControlResponse{}
323335
324336message QueryMissionControlRequest {}
325337
326- /// QueryMissionControlResponse contains mission control state per node .
338+ /// QueryMissionControlResponse contains mission control state.
327339message QueryMissionControlResponse {
328- repeated NodeHistory nodes = 1 ;
340+ /// Node-level mission control state.
341+ repeated NodeHistory nodes = 1 [json_name = "nodes" ];
342+
343+ /// Node pair-level mission control state.
344+ repeated PairHistory pairs = 2 [json_name = "pairs" ];
329345}
330346
331347/// NodeHistory contains the mission control state for a particular node.
@@ -336,26 +352,67 @@ message NodeHistory {
336352 /// Time stamp of last failure. Set to zero if no failure happened yet.
337353 int64 last_fail_time = 2 [json_name = "last_fail_time" ];
338354
339- /// Estimation of success probability for channels not in the channel array.
340- float other_chan_success_prob = 3 [json_name = "other_chan_success_prob" ];
355+ /**
356+ Estimation of success probability of forwarding towards peers of this node
357+ for which no specific history is available.
358+ **/
359+ float other_success_prob = 3 [json_name = "other_success_prob" ];
341360
342- /// Historical information of particular channels.
343- repeated ChannelHistory channels = 4 [json_name = "channels" ];
361+ reserved 4 ;
344362}
345363
346- /// NodeHistory contains the mission control state for a particular channel .
347- message ChannelHistory {
348- /// Short channel id
349- uint64 channel_id = 1 [json_name = "channel_id " ];
364+ /// PairHistory contains the mission control state for a particular node pair .
365+ message PairHistory {
366+ /// The source node pubkey of the pair.
367+ bytes node_from = 1 [json_name ="node_from " ];
350368
351- /// Time stamp of last failure.
352- int64 last_fail_time = 2 [json_name = "last_fail_time" ];
369+ /// The destination node pubkey of the pair.
370+ bytes node_to = 2 [json_name ="node_to" ];
371+
372+ /// Time stamp of last result.
373+ int64 timestamp = 3 [json_name = "timestamp" ];
374+
375+ /// Minimum penalization amount (only applies to failed attempts).
376+ int64 min_penalize_amt_sat = 4 [json_name = "min_penalize_amt_sat" ];
377+
378+ /// Estimation of success probability for this pair.
379+ float success_prob = 5 [json_name = "success_prob" ];
380+
381+ /// Whether the last payment attempt through this pair was successful.
382+ bool last_attempt_successful = 6 [json_name = "last_attempt_successful" ];
383+ }
384+
385+ message BuildRouteRequest {
386+ /**
387+ The amount to send expressed in msat. If set to zero, the minimum routable
388+ amount is used.
389+ */
390+ int64 amt_msat = 1 ;
353391
354- /// Minimum penalization amount.
355- int64 min_penalize_amt_sat = 3 [json_name = "min_penalize_amt_sat" ];
392+ /**
393+ CLTV delta from the current height that should be used for the timelock
394+ of the final hop
395+ */
396+ int32 final_cltv_delta = 2 ;
397+
398+ /**
399+ The channel id of the channel that must be taken to the first hop. If zero,
400+ any channel may be used.
401+ */
402+ uint64 outgoing_chan_id = 3 ;
403+
404+ /**
405+ A list of hops that defines the route. This does not include the source hop
406+ pubkey.
407+ */
408+ repeated bytes hop_pubkeys = 4 ;
409+ }
356410
357- /// Estimation of success probability for this channel.
358- float success_prob = 4 [json_name = "success_prob" ];
411+ message BuildRouteResponse {
412+ /**
413+ Fully specified route that can be used to execute the payment.
414+ */
415+ lnrpc.Route route = 1 ;
359416}
360417
361418service Router {
@@ -397,4 +454,11 @@ service Router {
397454 It is a development feature.
398455 */
399456 rpc QueryMissionControl (QueryMissionControlRequest ) returns (QueryMissionControlResponse );
457+
458+ /**
459+ BuildRoute builds a fully specified route based on a list of hop public
460+ keys. It retrieves the relevant channel policies from the graph in order to
461+ calculate the correct fees and time locks.
462+ */
463+ rpc BuildRoute (BuildRouteRequest ) returns (BuildRouteResponse );
400464}
0 commit comments