Commit Graph

788 Commits

Author SHA1 Message Date
carla
2ae61162db
lnrpc: move initiator enum out of close summary
Move enum out of CloseSummary struct for more general use. This does
not change the encoding of the enum, and will only cause compile time
errors for existing clients. This enum has not been included in a
release yet, so we can make this move without much disruption.
2020-04-03 11:26:11 +02:00
carla
0512b39f23
lnrpc: format protobuf file 2020-04-03 09:09:23 +02:00
Joost Jager
3191b949f5
lnrpc: deprecate SendPayment
There is an alternative in routerrpc now. It doesn't support REST yet,
but the main rpc SendPayment with its bidirectional streaming isn't
usable via REST either.

SendPaymentSync still serves REST users and cannot be deprecated yet.
2020-03-31 21:41:34 +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
Joost Jager
baffe156db
lnrpc: expose commitment type on pending open and waiting close channels 2020-03-31 19:35:52 +02:00
Oliver Gugger
357f5978ad
lnrpc: add new PSBT funding step messages 2020-03-31 09:17:22 +02:00
Andras Banki-Horvath
93cb05142a lnrpc: rename FloatValue to FloatMetric
This commit renames lnrpc.FloatValue to lnrpc.FloatMetric as requested
in the final review of centrality PR.
2020-03-30 16:36:11 +02:00
Andras Banki-Horvath
7e50997bb4 lnrpc: add betweenness centrality to GetNodeMetrics (new RPC call)
This commit extends the RPC interface with GetNodeMetrics will contain
all graph node metrics in the future. Currently only holds betweennes
centrality per node.
2020-03-27 13:56:08 +01:00
carla
9e1cdb78e7
lnrpc: deprecate unused pending closing channels field
The pending closing channels field was present to cover an edge case
where coperatively closed channels were closed before upgrade and
confirmed after the upgrade. This commit deprecates the field and adds
a warning log to cover these edge cases.
2020-03-25 08:48:19 +02:00
carla
8b83c1f7f9
lnrpc: add commit fees to WaitingPendingClose 2020-03-25 08:45:08 +02:00
carla
fd6b397496
lnrpc: add initiator bool to PendingChannel message 2020-03-25 08:42:26 +02:00
Olaoluwa Osuntokun
dbc485f724
lnrpc: add thaw_height to Channel and ChanPointShim 2020-03-23 16:56:54 -07:00
Carla Kirk-Cohen
c3ffdb7af4
Merge pull request #4095 from carlaKC/4036-surfacepushamounts
lnrpc: Add push amount to listchannels
2020-03-23 08:44:53 +02:00
carla
5516a53728
routerrpc: run rpc-format on routerrpc 2020-03-20 11:11:45 +02:00
carla
72e3b0a5d7
lnrpc: add push amount to listchannels 2020-03-19 13:20:26 +02:00
Joost Jager
e2052f7f65
Merge pull request #3758 from joostjager/anchor-output-poc-joost
cnct: anchor output sweeping and fee bumping
2020-03-18 18:59:06 +01:00
Joost Jager
d60303b092
lnrpc: expose commit hashes for waiting close channels
To make it easier to determine which pending sweep to bump in order to
get your anchor commitment tx confirmed.
2020-03-18 12:27:05 +01:00
Joost Jager
ab451f634e
cnct+lnrpc: report anchor resolution 2020-03-18 12:27:03 +01:00
Conner Fromknecht
b6a0bfcabe
Merge pull request #3848 from carlaKC/htlcnotifier-3-addhtlcnotifierrpc
[htlcnotifier 4/4]: lnrpc: Add HTLC Event Subscription
2020-03-17 16:37:52 -07:00
Joost Jager
c376cdb733
input: add anchor witness type 2020-03-17 16:25:35 +01:00
Joost Jager
29e1489179
sweep: leave exclusive group unchanged on parameter update
Exclusive group is a static property that doesn't need to be updated.
Requiring the exclusive group to be passed into UpdateParams creates a
burden for the caller to make sure they supply the existing group.

This change will be beneficial for users that bump anchor sweeps that
have exclusive groups set.
2020-03-17 14:19:39 +01:00
carla
4c48d0361d
lnrpc+lncli: display peer errors in listpeers
This change adds a set of errors to the peer struct returned by list
peers. A latest error boolean is added to allow for more succinct
default lncli responses.
2020-03-17 08:22:50 +02:00
Johan T. Halseth
7d305fdc46
lnrpc: add commitment_type to listchannels 2020-03-13 20:00:48 +01: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
10e247540f
watchtowerrpc: fix typo 2020-03-10 20:19:21 +01:00
Oliver Gugger
1e1b68accf
lnrpc: update README to describe new commands 2020-03-10 20:19:20 +01:00
Oliver Gugger
fdcb30e57f
lnrpc: run clang-format 2020-03-10 20:19:08 +01:00
Conner Fromknecht
7a1013fb9e
make+travis: verify compiled protos on travis 2020-03-10 13:03:01 +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
9aff896b10
lnrpc+rpcserver+lncli: rename RPC fields to previous JSON name 2020-03-07 11:24:13 +01:00
Oliver Gugger
3a5348ea8b
wtclientrpc: format wtclient.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:09 +01:00
Oliver Gugger
ad0fba548f
watchtowerrpc: format watchtower.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:09 +01:00
Oliver Gugger
54fede0ae9
walletrpc: format walletkit.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:08 +01:00
Oliver Gugger
5a35ffa395
signrpc: format signer.proto 2020-03-07 11:23:08 +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
Oliver Gugger
5a6fea31d9
invoicesrpc: format invoices.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
Oliver Gugger
23f5472cd3
chainrpc: format chainnotifier.proto 2020-03-07 11:23:06 +01:00
Oliver Gugger
bcfe92cee1
autopilotrpc: format autopilot.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:06 +01:00
Oliver Gugger
b99a457dd0
lnrpc: format rpc.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:06 +01:00
Conner Fromknecht
11532df5f3
cmd/lncli: add --peer flag to list channels
This commit adds a flag to listchannels that filters by remote pubkey.
2020-03-05 20:44:18 -08:00
Conner Fromknecht
5c9b336a61
lnrpc+rpcserver: expose short chan id on feereport
This commit adds each channel's short chan id to the `feereport` rpc.
Without this, it can be tedious to lookup more info about a particular
channel since most rpcs only accept short chan ids and not channel
points. For instance, now one can take a channel id from `feereport` and
look it up directly via `getchaninfo` to examine the policy in more
detail.
2020-03-04 15:37:17 -08:00
carla
b55470e9a9
lnrpc: add open and close initiator to close summary
Add an initiator enum which allows up to display an unknown value for
channels that are not in the historical chan bucket, rather than having
and ambiguous false value also representing no-value. A both option is
added to cover the case where both parties initiated a close on chain.
2020-02-21 13:53:45 +02:00
Yaacov Akiba Slama
90008386d8 Copy InputIndex into the underlying SignDescriptor struct
When the InputIndex is not 0, the index is not currently copied into the
underlying SignDescriptor structure and the siganture generated is not
valid.
2020-02-09 10:55:50 +02:00
Johan T. Halseth
b39e21f6dd
Merge pull request #3926 from C-Otto/master
Fix typos
2020-01-31 11:34:34 +01:00
Hampus Sjöberg
227e66c469 rpc: Add PendingOpenChannel to SubscribeChannelEvents
This commit adds PendingOpenChannel to SubscribeChannelEvents stream in
the gRPC API.
This is useful for keeping track of channel openings that Autopilot does.
It can also be used for the non-initator side of a channel opening to keep
track of channel openings.
2020-01-24 13:48:18 +01:00
Joost Jager
ae9c6faebf
Merge pull request #3809 from joostjager/anchor-sweeper
sweep: allow force sweeping of negatively yielding inputs
2020-01-23 11:46:46 +01:00
Carsten Otto
a908a74acb Fix typos 2020-01-17 21:18:20 +00:00
Conner Fromknecht
51dbdd3b38
multi: rename key_send, key-send and key send to keysend 2020-01-16 18:37:16 -08:00
Joost Jager
b0aae13d70
sweep: allow force sweeps 2020-01-15 16:56:44 +01:00
Joost Jager
16832cefa3
sweep: allow updating all sweep parameters
This is a preparation for adding additional parameters besides the fee
preference.
2020-01-15 16:56:40 +01: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
Joost Jager
280611ab6e
sweep+walletrpc+lncli: report requested fee preference for pending sweeps
Previously only the fee rate used for the last sweep (the sweep bucket
average) was reported. This commit adds the request fee preference to
the report, which is used to select a bucket and the sweep tx fee rate.
2020-01-09 14:56:08 +01:00
Oliver Gugger
4f98642b5e
signrpc: derive custom shared key
With this commit we add the ability to create a shared DH key by using
a custom node private key instead of the node's identity private key.
If no key locator is specified the node's identity private key will be
used as a fallback.
2020-01-06 14:53:32 +01:00
Olaoluwa Osuntokun
5ade9abe29
Merge pull request #3777 from guggero/shared-key
signrpc: add DeriveSharedKey
2020-01-02 16:02:47 -08:00
Joost Jager
c08865f4ae
lnrpc/invoicesrpc: add is_key_send flag to rpc invoice 2019-12-23 21:51:21 +01:00
Joost Jager
6063dc31fc
lnrpc/invoicesrpc: support empty payment request fields
Prepares for spontaneous key send payments that do not have a payment
request.
2019-12-23 21:51:15 +01:00
Olaoluwa Osuntokun
3eed38d602
lnrpc: add ability to provide chan point shims for funding, new funding modifiers
In this commit, we start to expose some of the new external funding
functionality over the RPC interface.

First, we add a new `funding_shim` field to the regular `OpenChannel`
method. This can be used by a caller to express that certain parameters
of the funding flow have already been negotiated outside the protocol,
and should be used instead. For example, a shim can be provided to use a
particular key for the commitment key (ideally cold) rather than use one
this is generated by the wallet as normal, or signal that signing will
be carried out in an interactive manner (PSBT based).

Next, we add a brand new method: `FundingStateStep`. FundingStateStep is
an advanced funding related call that allows the caller to either
execute some preparatory steps for a funding workflow, or manually
progress a funding workflow. The primary way a funding flow is
identified is via its pending channel ID. As an example, this method can
be used to specify that we're expecting a funding flow for a particular
pending channel ID, for which we need to use specific parameters.
Alternatively, this can be used to interactively drive PSBT signing for
funding for partially complete funding transactions.

The new transition methods (funding state machine modifiers) in this
commit allow a party to register a funding intent that should be used
for a specified incoming pending channel ID. The "responder" to the
external channel flow should use this to prep lnd to be able to handle
the channel flow properly.
2019-12-20 19:09:38 -08:00
Conner Fromknecht
72a49d486a
Merge pull request #3647 from cfromknecht/hex-jsonpb
build+lncli: default to hex encoding for byte slices
2019-12-20 18:23:52 -08:00
carla
b6f546503a
routerrpc: add MppTimeout code to failures 2019-12-20 13:02:19 +02:00
Conner Fromknecht
153cd58c97
lnrpc+lncli: reorder getinfo and use printRespJSON 2019-12-20 01:05:27 -08:00
Oliver Gugger
33e8077181
signrpc: add DeriveSharedKey 2019-12-20 09:25:52 +01:00
Conner Fromknecht
e6db31f267
routerrpc: allow dest_features graph fallback 2019-12-19 16:28:57 -08:00
Joost Jager
5ea63158e0
Merge pull request #3838 from bhandras/i1404
channeldb+invoices: fix what pending invoice means in ChannelDB
2019-12-19 21:02:57 +01:00
Andras Banki-Horvath
fa14ff67ad channeldb+invoices: fix what pending invoice means in ChannelDB
This commits builds on top of PR #3694 to further clarify invoice
state by defining pending invoices as the ones which are not
settled or canceled. Automatic cancellation of expired invoices
makes this possbile. While this change only directly affects
ChannelDB, users of the listinvoices RPC will receive actual
pending invoices when pending_only flag is set.
2019-12-19 17:44:32 +01: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
Wilmer Paulino
7f3771e74f
Merge pull request #3796 from carlaKC/3786-setupfrontshutdown
Add Upfront Shutdown Address to OpenChannelRequest
2019-12-18 11:28:29 -08:00
Joost Jager
7ecbe22531
Merge pull request #3814 from joostjager/sweeper-add-utxo
sweep: add wallet inputs to reach dust limit
2019-12-18 09:53:04 +01:00
carla
eb3a2e63f2
lnrpc: display local upfront shutdown 2019-12-17 23:21:30 +02:00
carla
6eab2a06dd
lnrpc+lncli: add feature bits to GetInfo 2019-12-17 23:21:14 +02:00
carla
a2f029caca
lnrpc: add upfront shutdown address to open channel request 2019-12-17 23:18:25 +02:00
carla
3c28507062
lnrpc: Add subscribe peer events rpc 2019-12-17 21:26:55 +02:00
Joost Jager
77fde0f201
Merge pull request #3840 from joostjager/queryroutes-padding-comment
lnrpc: clarify block padding requirement for QueryRoutes
2019-12-16 15:48:08 +01:00
Joost Jager
9ae02796fa
lnrpc: clarify block padding requirement for QueryRoutes 2019-12-16 13:38:01 +01:00
Conner Fromknecht
b2d276feb8
lnrpc: update all feature vectors to maps 2019-12-14 07:05:21 -08:00
Conner Fromknecht
990bdd6b64
lnrpc: display remote peer features via rpc 2019-12-14 07:05:07 -08:00
Conner Fromknecht
db0029d03d
lnrpc: add node features to LightningNode and NodeInfo 2019-12-14 07:04:51 -08:00
Joost Jager
38adfd7ecc
sweep: create sweep parameters struct
Prepares for adding more input-specific sweep parameters.
2019-12-13 12:02:42 +01:00
Conner Fromknecht
d5d38c6e01
signrpc: fix uncommitted changes from proto 2019-12-12 17:20:33 -08:00
Joost Jager
d16476e477
routerrpc+record: move custom set validation 2019-12-12 17:49:34 +01:00
Joost Jager
75b94dec2b
Merge pull request #3819 from joostjager/fix-custom-record-payment
multi: fix custom record payment
2019-12-12 14:33:05 +01:00
Conner Fromknecht
aba49c9a5a
rpcserver: populate features on lnrpc invoices
In the process, we also move the feature serialization into the
invoicesrpc package, so that it can be shared between the invoicesrpc
and main rpcserver.
2019-12-12 00:12:51 -08:00
Conner Fromknecht
7446495b6d
lnrpc: add features field to invoices 2019-12-12 00:08:18 -08:00
Olaoluwa Osuntokun
338175534e
Merge pull request #3812 from guggero/sign-custom
signrpc: sign and verify messages with custom key
2019-12-11 18:51:55 -08: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
Oliver Gugger
95226771ed
signrpc+rpcserver: add signer macaroon permissions 2019-12-11 22:37:40 +01:00
Oliver Gugger
9a73b9be78
signrpc: sign and verify messages with custom key
To allow signing of messages with any key in the key chain
we add two new methods to the signer RPC. These behave differently
to the methods with the same name in the main RPC as described
in the documentation comment.
2019-12-11 22:37:39 +01:00
Joost Jager
b2f43858c3
invoices: accept mpp payments 2019-12-11 16:14:49 +01:00
Joost Jager
b6eb3a69ba
routing+lnrpc+lncli: allow setting min htlc policy 2019-12-11 00:17:08 +01:00
Conner Fromknecht
1367187454
multi: set invoice feature bits using feature manager 2019-12-10 13:09:52 -08:00
Conner Fromknecht
5defa425e1
lnrpc: add feature bits to PayReq 2019-12-10 13:09:17 -08:00
Oliver Gugger
d47f67d260
signrpc+subserver: add key chain to signer 2019-12-10 09:48:13 +01:00
bluetegu
25caece160
lnrpc: Add optional delivery addresss to close channel
This commit is adapted from @Bluetegu's original
pull request #1462.
2019-12-10 09:12:54 +02:00
Joost Jager
5f4bd136cd
invoices: store custom records in invoice database 2019-12-10 06:54:24 +01:00
Olaoluwa Osuntokun
47235e2f98
lnrpc: add msats to return value of DecodePayReq
In this commit, we add `msats` to the return value of `DecodePayReq` to
ensure we always show full value information as we're moving to do
generally for all RPC calls that deal with off-chain amounts.
2019-12-06 15:48:30 -08:00
Conner Fromknecht
abb7f4fa9e
lnrpc+rpcserver: add payment_addr field to PayReq 2019-12-05 07:59:47 -08:00
Conner Fromknecht
cd27ee7cfc
rpcserver+invoicesrpc: set payment addr on new invoices
This commit modifies Lighting.AddInvoice and InvoicesRPC.AddHoldInvoice
to include the node's supported feature bits on the invoice. For now
this only includes the optional TLV Onion Payload bit.
2019-12-05 07:59:31 -08: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
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
0abc054eb0
routerrpc: refactor hop unmarshall code
Remove code duplication in preparation for additional unmarshalling.
2019-12-04 13:27:31 +01:00
Joost Jager
5d4ceca038
tlv: remove unused error return value
This commit also modifies a previous migration. Because the change is so
limited, we don't consider this a significant risk.
2019-12-04 13:27:29 +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
Olaoluwa Osuntokun
cb2b8b4513
Merge pull request #3693 from cfromknecht/tlv-invoice
migrate to tlv for invoice body
2019-11-25 18:00:52 -06:00
Conner Fromknecht
9287610b83
lnrpc: fix nanonsecond typo 2019-11-22 12:23:35 -08:00
Conner Fromknecht
3b253e05f6
multi: restructure invoice Terms field
This commit restructures an invoice's ContractTerms to better encompass
the restrictions placed on settling. For instance, the final ctlv delta
and invoice expiry are moved from the main invoice body (where
additional metadata is stored). Additionally, it moves the State field
outside of the terms since it is rather metadata about the invoice
instead of any terms offered to the sender in the payment request.
2019-11-22 02:25:02 -08:00
Conner Fromknecht
4c872c438b
channeldb: complete migration 12 for TLV invoices 2019-11-22 02:24:28 -08:00
Conner Fromknecht
76a2dfd8a6
lnrpc: remove receipt field from invoice 2019-11-22 02:23:24 -08: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
063f24f2ed
channeldb+routing: expose HTLCs in payment subscriptions
This commit modifies the FetchPayment method to return MPPayment structs
converted from the legacy on-disk format. This allows us to attach the
HTLCs to the events given to clients subscribing to the outcome of an
HTLC.

This commit also bubbles up to the routerrpc/router_server, by
populating HTLCAttempts in the response and extracting the legacy route
field from the HTLCAttempts.
2019-11-19 20:43:38 -08:00
Conner Fromknecht
68916eb4b7
routerrpc: add HTLCAttempts to PaymentStatus 2019-11-19 20:42:38 -08:00
Conner Fromknecht
01cecb1f27
multi: rename to FailureReasonPaymentDetails
Prior name is too long XD
2019-11-19 20:42:21 -08:00
Conner Fromknecht
997500b08d
lnrpc+rpcserver: populate experimental MPP fields in ListPayment rpc 2019-11-19 20:41:44 -08:00
Conner Fromknecht
d1f245e791
lnrpc: expose new MPP fields on list payments 2019-11-19 20:41:27 -08:00
Joost Jager
f28941c7e4
routing+routerrpc+lncli: enable last hop restriction for payments 2019-11-18 21:03:03 +01:00
Joost Jager
fcbf1bc07a
invoicesrpc+lnrpc: add msat fields to invoices 2019-11-15 08:59:35 +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
e0a3f803d5
lnrpc: extract fee limit calculation 2019-11-12 14:24:53 +01:00
Oliver Gugger
7e9c4f0f87
proto: deprecate duplicate string fields in requests
With this PR we deprecate fields that have been specifically added to
to work around a bug in the gRPC/REST gateway that didn't allow bytes
fields to be encoded in REST requests.
That bug has now been fixed so the fields are no longer required.
To make it more clear how bytes fields have to be used in REST,
comments have been added to all those fields.
2019-11-07 08:53:00 +01:00
Conner Fromknecht
8cb17d5c1f
lnrpc/routerrpc/router_backend: populate and unmarshal mpp fields
This commit parses mpp_total_amt_msat and mpp_payment_addr from the
SendToRoute rpc and populates an MPP record on the internal hop
reprsentation. When the router goes to encode the onion packet, these
fields will be serialized for the destination. We also populate the mpp
fields when marshalling routes in rpc responses.
2019-11-04 15:11:23 -08:00
Conner Fromknecht
92aa78dd5f
lnrpc/rpc.proto: add mpp fields to Hop message
This commit add mpp_total_amt_msat and mpp_payment_addr to the Hop
message. Doing so enables users submitting mpp payments via rpc to
set these parameters for the destination. In addition, it will allow us
to display these fields in rpc responses.
2019-11-04 15:11:07 -08:00
Johan T. Halseth
e0744a3983
Merge pull request #3650 from guggero/update-grpc-gateway
proto+lnrpc: update gRPC-REST gateway to v1.8.6
2019-11-01 09:03:48 +01:00
Olaoluwa Osuntokun
777ed104a3
chainfee: create new chainfee package extracting fees from lnwallet
In this commit, we create a new chainfee package, that houses all fee
related functionality used within the codebase. The creation of this new
package furthers our long-term goal of extracting functionality from the
bloated `lnwallet` package into new distinct packages. Additionally,
this new packages resolves a class of import cycle that could arise if a
new package that was imported by something in `lnwallet` wanted to use
the existing fee related functions in the prior `lnwallet` package.
2019-10-31 16:41:57 -07:00
Oliver Gugger
b6c7ff8183
lnrpc: generate protos with new gateway version 2019-10-31 09:13:38 +01:00
Oliver Gugger
b6b57d1c00
proto: update to grpc-gateway v1.8.6 2019-10-31 09:13:33 +01:00
Joost Jager
fcf81ed8ff
Merge pull request #3556 from joostjager/query-mc-prob
routerrpc: add queryprob rpc
2019-10-31 08:03:29 +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
3d8adaef95
routing: embed TimedPairResult in snapshot data 2019-10-29 12:32:15 +01:00
carla
31bf542276 lnrpc: Add experimential uptime and lifetime fields to list channels
This commit adds the total observed lifetime of a channel and the
totaluptime of its remote peer to the lnrpc channel struct. These
fields are marked as experimential because they are subject to
change.
2019-10-25 11:41:16 +02:00
Oliver Gugger
6a463de7a2
lnrpc: add command for baking new macaroons 2019-10-24 10:25:32 +02:00
Oliver Gugger
c66c4052ec
lnrpc: document missing ForwardingHistory command 2019-10-23 13:28:04 +02:00
Joost Jager
1fac41deed
routing+routerrpc: improve prob. estimation for untried connections
This commit changes mission control to partially base the estimated
probability for untried connections on historical results obtained in
previous payment attempts. This incentivizes routing nodes to keep all
of their channels in good shape.
2019-10-22 15:52:38 +02: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
bitromortac
3af91fc9b9 lnd+lnrpc: add msat forwarding amount fields to ForwardingHistory 2019-10-16 19:50:58 +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
cbf7e4886a
multi: extend QueryRoutes RPC with CLTV limit field 2019-10-11 18:07:39 -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
Conner Fromknecht
acc5104f53
lnrpc+routerrpc: disable custom tlv records via rpc
In order to prevent future unforeseen issues, we are temporarily
disabling the ability to send custom tlv records to the receiver of a
payment. Currently the receiver does not process or expose these
additional fields via rpc or internally, so they are being disabled
until the end-to-end flow is finished and fully validated.
2019-10-03 15:55:45 -07:00
Joost Jager
b58dbb2d70
multi: fix canceled spelling 2019-10-03 17:27:36 +02:00
Lars Lehtonen
8194d260ff
lnrpc: stdlib context 2019-09-28 16:06:34 -07:00
Olaoluwa Osuntokun
8ce76fff51
lnrpc: add new StaticRemoteKey field to ListChannels output 2019-09-25 18:26:07 -07:00
Olaoluwa Osuntokun
820cd2a875
Merge pull request #3540 from wpaulino/wtclient-docs
docs: update watchtower docs to include wtclientrpc info
2019-09-25 16:33:01 -07:00
Olaoluwa Osuntokun
e0d7854432
Merge pull request #3039 from Crypt-iQ/predicate_channel_accept_0428
rpc: bi-directional streaming for predicate-based channel acceptance
2019-09-25 16:29:48 -07:00
Wilmer Paulino
26954b3718
lnrpc: remove remaining wtclientrpc build tags
The tags to expose the lncli wtclient commands were removed, but the RPC
subserver still required them, causing the commands to return an error.
2019-09-25 14:41:25 -07:00
nsa
7c6cee7c4f
lnrpc: updating protos to include ChannelAcceptor 2019-09-25 12:07:28 -04:00
Olaoluwa Osuntokun
18f88cbd8d
Merge pull request #3440 from joostjager/buildroute
routing: add build route functionality
2019-09-24 20:24:24 -07:00
Joost Jager
299821152a
routing+routerrpc: add BuildRoute function 2019-09-24 10:00:44 +02:00
Valentine Wallace
4b9da07e78
rpcserver+lnrpc: allow users to update max HTLC channel policies
In this commit, we enable callers of UpdateChannelPolicy to
specify their desired max HTLC forwarding policy for one or
multiple channels.
2019-09-23 13:07:12 +02:00
Conner Fromknecht
7252e175dc
lncli+wtclientrpc: remove wtclientrpc build tag, compile by default 2019-09-18 17:26:15 -07:00
lieteau2
0ea1b3484e
Rename chainnotifer_server.go to chainnotifier_server.go 2019-09-16 10:57:50 -05: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
fiatjaf
f19b00c4c0
Fix error message for wrong size description_hash. 2019-09-11 11:09:52 -03:00
Joost Jager
3d7de2ad39
multi: remove dead code 2019-09-10 17:21:59 +02:00
Joost Jager
99a920f2a3
routerrpc: report route success probability
The intention of adding this field is to make probability based path
finding more transparent and help understand why a route is returned.
2019-09-05 08:35:04 +02:00
Olaoluwa Osuntokun
7eca7b02a6
Merge pull request #3390 from joostjager/invoice-circuits
channeldb+cnct+invoices: track invoice htlcs
2019-09-04 19:51:37 -07:00
Joost Jager
45cd76e9eb
lnrpc+invoicesrpc: report invoice htlcs 2019-09-04 19:20:33 +02:00
Joost Jager
c1345a4117
multi: use separate cltv expiry field from invoice
Now that the Invoice struct contains the decoded final cltv delta value,
the decoding of payment requests can be removed from the invoice
registry.
2019-09-04 19:20:19 +02:00
Joost Jager
4105142c96
channeldb+invoices: add invoice htlcs
This commit adds a set of htlcs to the Invoice struct and
serializes/deserializes this set to/from disk. It is a preparation for
accurate invoice accounting across restarts of lnd.

A migration is added for the invoice htlcs.

In addition to these changes, separate final cltv delta and expiry
invoice fields are created and populated. Previously it was required
to decode this from the stored payment request. The reason to create
a combined commit is to prevent multiple migrations.
2019-09-04 19:20:17 +02:00
Olaoluwa Osuntokun
3868bdc490
Merge pull request #3405 from wpaulino/chainrpc-sane-defaults
chainntnfs: validate conf/spend ntfn registration parameters
2019-08-26 16:25:06 -07: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
Wilmer Paulino
2cc5891c8c
lnrpc/walletrpc: use current height as height hint for cpfp
In this commit, we address an issue that would cause us to scan from the
genesis block for the spend of an output that we wish to use to raise
the fee of a transaction through CPFP. This was due to setting a 0
height hint when constructing the input required by the sweeper and was
discovered due to the recently added validation checks at the chain
notifier level. We'll now use the current height as the height hint
instead as the sweeper will end up creating a new transaction that
spends the input.
2019-08-22 13:49:42 -07:00
Wilmer Paulino
9e8a1707cc
lnwallet: modify FetchInputInfo to return additional information for utxos 2019-08-22 13:49:41 -07:00
Olaoluwa Osuntokun
d134e0362e
Merge pull request #1734 from joostjager/edgesets
routing: prune based on channel sets instead of channels
2019-08-13 19:14:30 -07:00
Joost Jager
f1769c8c8c
routing: convert to node pair based
Previously mission control tracked failures on a per node, per channel basis.
This commit changes this to tracking on the level of directed node pairs. The goal
of moving to this coarser-grained level is to reduce the number of required
payment attempts without compromising payment reliability.
2019-08-13 19:21:37 +02:00
Joost Jager
395e0596c2
invoices: fix synchronization issue with single invoice subscribers
This commit fixes a synchronization issue where a single invoice
subscriber could receive duplicate and/or out of order invoice updates.
2019-08-13 19:02:55 +02:00
Joost Jager
6ee2c04190
lnrpc/routerrpc: use vertex constructor 2019-08-13 18:45:10 +02:00
Joost Jager
5c52efc0eb
lnrpc/routerrpc: fix line wrap 2019-08-13 18:45:04 +02:00
Conner Fromknecht
9a5ac78912
Merge pull request #3391 from joostjager/always-return-invalid-details
htlcswitch+invoices: always return incorrect_or_unknown_payment_details
2019-08-12 20:14:49 -07:00
Joost Jager
aabd68ebcd
multi: rename FailUnknownPaymentHash to FailIncorrectDetails
Align naming better with the lightning spec. Not the full name of the
failure (FailIncorrectOrUnknownPaymentDetails) is used, because this
would cause too many long lines in the code.
2019-08-08 11:04:17 +02:00
Wilmer Paulino
8ca2c79bfe
rpc: expose graph synced status within GetInfo 2019-08-06 17:56:56 -07:00
Olaoluwa Osuntokun
7767eecbb8 Merge pull request #3164 from joostjager/persistent-mc
routing: persistent mission control
2019-08-02 15:45:49 -07:00
Joost Jager
7e7b620355
routing: persist mission control data 2019-07-31 08:44:00 +02:00
Olaoluwa Osuntokun
8c9c4b52e8
Merge pull request #3184 from wpaulino/wtclient-subserver
multi: add watchtower client RPC subserver
2019-07-30 17:26:22 -07:00
openoms
44a28fe75c lnrpc: remove lncli subscribechannelevents and add regenarated rpc.pb.go 2019-07-30 23:51:04 +01:00
Wilmer Paulino
8f010abac5
multi: add watchtower client RPC subserver 2019-07-30 15:18:15 -07:00
Joost Jager
3dc83d1b6b
routerrpc: embed routing config 2019-07-29 13:42:59 +02:00
Joost Jager
fc337cd34f
routing+routerrpc+lnrpc: add option to use mc in queryroutes
A boolean flag is added to the QueryRoutes rpc that allows feeding
mission control probabilities into path finding.
2019-07-18 15:49:29 +02:00
Joost Jager
7f4c42847c
lnrpc/routerrpc: create mission control interface 2019-07-18 15:49:27 +02:00
Joost Jager
34b264a3d8
routing: create PathFindingConfig for global parameters 2019-07-18 15:49:25 +02:00
Conner Fromknecht
377b7bf3ce
Merge pull request #3316 from cfromknecht/num-zombies-rpc
rpcserver+channeldb: return num zombies in NetworkInfo response
2019-07-17 16:27:48 -07:00
Conner Fromknecht
4b70d6b987
lnrpc: add num_zombie_chans to NetworkInfo response 2019-07-16 16:32:27 -07:00
Joost Jager
37e2751695
routing+routerrpc: isolate payment session source from mission control 2019-07-13 22:38:19 +02:00
Otto Suess
c843835a05
invoicesrpc: fix route hint off-by-one-error
right now it is possible to add 21 route hints which results in an error.
2019-07-12 08:51:30 +02:00
Conner Fromknecht
a4f4ff0f83
Merge pull request #3188 from joostjager/error-source-idx
htlcswitch+routing+routerrpc: error source as index and expose decrypt failure
2019-07-11 13:27:14 -07:00
Joost Jager
2726f50d7c
htlcswitch: do not consider unknown failures an error 2019-07-11 19:49:49 +02:00
Joost Jager
418fe364de
htlcswitch: use distinct error for unreadable failures 2019-07-11 19:49:45 +02:00
Joost Jager
2b47632b26
htlcswitch+routing+routerrpc: return error source as index 2019-07-11 10:37:26 +02:00
ccdle12
a93d63f04b
lnrpc+rpcserver: Adding last_update timestamp to RoutingPolicy
lnrpc/rpc.proto: updates RoutingPolicy last_update number

rpcserver: adding LastUpdate field to marshalDbEdge

This commit adds a LastUpdate field to each RoutingPolicy, it will show
the time each RoutingPolicy was updated.

lnrpc: regenerating proto files
2019-07-11 07:44:28 +01:00
Wilmer Paulino
f9816330c5
Merge pull request #3238 from breez/chan_reserve_fields
rpc: add channel reserve fields in RPC responses.
2019-07-10 16:30:33 -07:00
Roei Erez
404abcbd04 rpc: add channel reserve fields in RPC responses.
In this commit two fields were added to the Channl RPC result in both
open and pending states.
The fields: local_chan_reserve, remote_chan_reserve represents the
reservation the nodes are rquired to keep in both sides of the channel.
This is usefull when calculating the "real" inbound and outbound
liquidity in an accurate way.
2019-07-11 00:03:20 +03:00
Johan T. Halseth
f0cbe46324
lnrpc: make BumpFee doc start with RPC name 2019-07-10 12:56:54 +02:00
Wilmer Paulino
9691f86af0
Merge pull request #3279 from carlaKC/ckc-I1359-listpaymentsMSatFee
lnrpc: Deprecate fee field in payment struct
2019-07-09 14:36:24 -07:00
carla
af10009c93 lnrpc: Deprecate fee field in payment struct 2019-07-09 09:58:20 -04:00
Conner Fromknecht
933e723ec7
Merge pull request #3178 from federicobond/once-refactor
multi: replace manual CAS with sync.Once in several more modules
2019-07-08 20:33:44 -07:00
Olaoluwa Osuntokun
ba5fbb3c27
Merge pull request #3156 from joostjager/extended-fail
routerrpc: add more failure reasons and route hints
2019-07-08 19:12:03 -07:00
Joost Jager
1e79ddc9bc
routerrpc: accept route hints for SendPayment rpc 2019-07-04 09:27:18 +02:00
Joost Jager
5ce04091d8
routing+routerrpc+channeldb: return route on invalid payment details 2019-07-04 09:27:16 +02:00
Joost Jager
ae46fb00cb
routing+channeldb: add more failure reasons 2019-07-04 09:27:12 +02:00
Conner Fromknecht
f727b94e12
lnrpc/watchtowerrpc: prevent watchtowerrpc panic when tower not active 2019-07-02 15:06:12 -07:00
Joost Jager
e2af3c0fa7
routerrpc: fix loop variable binding bug in querymc
This bug caused all node pubkey to be the same.
2019-06-26 16:48:46 +02:00
Olaoluwa Osuntokun
0506b1e587
Merge pull request #3224 from cfromknecht/wtserver-key-family
watchtower: use separate key family for wtserver public key, add watchtower subserver
2019-06-20 18:01:21 -07:00
Conner Fromknecht
ccb2b29b93
lnrpc/watchtowerrpc/driver: register watchtower rpc server on init 2019-06-20 17:04:04 -07:00
Conner Fromknecht
b98bc76878
lnrpc/watchtowerrpc/handler: implement Watchtower gRPC server 2019-06-20 17:04:03 -07:00
Conner Fromknecht
0db39d4fe6
lnrpc/watchtowerrpc: add WatchtowerBackend configs 2019-06-20 16:53:25 -07:00
Conner Fromknecht
72e4fbff97
lnrpc/watchtowerrpc: add protos for GetInfo 2019-06-20 16:53:09 -07:00
Johan T. Halseth
7c4c64fffc
lnrpc/rpc.proto: remove trailing spaces 2019-06-20 14:35:39 +02:00
Olaoluwa Osuntokun
b89b27e6ef
Merge pull request #3212 from cfromknecht/getnodeinfo-hide-chans-default
rpcserver: hide channels in getnodeinfo by default
2019-06-18 17:24:20 -07:00
Olaoluwa Osuntokun
94a20e30e1
lnrpc/walletrpc: reject nil outpoints as args
In this commit, we modify the parsing of user provided outpoints to
ensure that we catch a nil (empty) output early. Otherwise, passing a
set of incorrect arguments would cause `lnd` to crash.
2019-06-17 16:56:16 -07:00
Conner Fromknecht
79e0ca3e44
lnrpc: add include_channels flag to GetNodeInfoRequest 2019-06-17 10:57:45 -07:00
Olaoluwa Osuntokun
d333b2d981
lnrpc: rename non_succeeded to include_incomplete 2019-06-13 16:01:10 -07:00
Olaoluwa Osuntokun
41b7da9bd1
Merge pull request #3190 from halseth/listpayments-status-filter
ListPayments: filter out non-succeeded payments, include payment status
2019-06-14 00:41:35 +02:00
Wilmer Paulino
5af4022b6d
Merge pull request #3140 from wpaulino/sweeper-bumpfee
sweep+rpc: add support to bump fee of inputs/transactions
2019-06-12 12:21:53 -07:00
Federico Bond
0a9141763e multi: replace manual CAS with sync.Once in several more modules 2019-06-12 09:37:26 -03:00
Johan T. Halseth
6794708ed5
lnrpc: expose PaymentStatus for ListPayments
Also make it optional to list non-succeeded payments.
2019-06-12 08:51:51 +02:00
Wilmer Paulino
a4675063b7
lnrpc/walletrpc: expose bumping fee of inputs/transactions over RPC
This RPC exposes the recently added BumpFee functionality to the
UtxoSweeper in order to allow users of the RPC to manually bump fees of
low fee inputs/transactions.
2019-06-11 15:06:40 -07:00
Olaoluwa Osuntokun
0db0c5be93
lnrpc: add RawTxHex field to Transaction message 2019-06-07 07:37:35 -07:00
Wilmer Paulino
d01f88ecdc
lnrpc/walletrpc: expose pending input sweeps within UtxoSweeper over RPC 2019-06-05 12:10:33 -07:00
Joost Jager
f03533c67a
routerrpc: convert sendpayment to async
Modify the routerrpc SendPayment api to asynchronous. This allows
callers to pick up a payment after the rpc connection was lost or lnd
was restarted.
2019-06-05 12:41:53 +02:00
Joost Jager
eb700d35e1
routerrpc: extend payment request parameters
Add missing parameters to routerrpc version of SendPayment.
2019-06-05 12:41:45 +02:00
Joost Jager
19d5f8f82c
routing: move default cltv assignment out of router
This commit lifts default setting up to the rpc server level, in line
with other payment defaults.
2019-06-05 12:41:43 +02:00
Joost Jager
054e42f680
routing+routerrpc: expose mission control parameters in lnd config
This commit exposes the three main parameters that influence mission
control and path finding to the user as command line or config file
flags. It allows for fine-tuning for optimal results.
2019-06-04 13:22:50 +02:00
Joost Jager
f7982f0f4c
routing+routerrpc: expose mission control state over rpc
This commit exposes mission control state for rpc for development
purposes.
2019-06-04 10:00:27 +02:00
Joost Jager
7133f37bb8
routing: global probability based mission control
Previously every payment had its own local mission control state which
was in effect only for that payment. In this commit most of the local
state is removed and payments all tap into the global mission control
probability estimator.

Furthermore the decay time of pruned edges and nodes is extended, so
that observations about the network can better benefit future payment
processes.

Last, the probability function is transformed from a binary output to a
gradual curve, allowing for a better trade off between candidate routes.
2019-06-04 10:00:25 +02:00
Joost Jager
6b70791c2d
routing: use probability source in path finding
This PR replaces the previously used edge and node ignore lists in path
finding by a probability based system. It modifies path finding so that
it not only compares routes on fee and time lock, but also takes route
success probability into account.

Allowing routes to be compared based on success probability is achieved
by introducing a 'virtual' cost of a payment attempt and using that to
translate probability into another cost factor.
2019-06-04 10:00:21 +02:00
Joost Jager
68f2a04f42
routerrpc: expose mission control reset rpc 2019-06-04 10:00:17 +02:00
Olaoluwa Osuntokun
4068e78af6
Merge pull request #2717 from cfromknecht/send-payment-payreq
lnrpc+rpcserver: display payreq via listpayments
2019-05-31 17:09:04 -07:00
Joost Jager
1b5655f7fa
Merge pull request #3113 from joostjager/sendtoroute-error-fix
routing: return structured error for send to route
2019-05-30 23:20:14 +02:00
Conner Fromknecht
db8d63801f
lnrpc: expose payreq in list payments 2019-05-29 16:30:51 -07:00
Joost Jager
1fc01370bf
routerrpc: marshall missing channel update data 2019-05-29 14:07:03 +02:00
Joost Jager
cc88bfb560
routerrpc: proto comments updated 2019-05-29 14:07:01 +02:00
Johan T. Halseth
1df148d8ef
routerrpc test: run make fmt 2019-05-27 12:33:43 +02:00
chokoboko
51dc422721 rpcserver: add channels to GetNodeInfo response 2019-05-23 16:03:39 +03:00
Xavi Soler
ee2e49141e
lnrpc: add color to GetInfoResponse and NodeUpdate 2019-05-23 10:51:59 +02:00
Joost Jager
9a4c0d5699
lnrpc: upgrade to protobuf v1.3.1
This commit upgrades the protobuf version. Compared to the previous
v1.2.0 it generates smaller diffs in generated code. This change was
introduced in:

fffb0f7828
2019-05-20 15:35:14 +02:00
Johan T. Halseth
777f1b7b23
Merge pull request #3076 from sangaman/proto-typos
lnrpc: fix typos
2019-05-20 15:00:55 +02:00
Johan T. Halseth
15bed506b1
routing/route+multi: remove redundant TotalFees field
Instead get it on demand using method TotalFees().
2019-05-16 23:58:32 +02:00
Daniel McNally
7c513f23af
lnrpc: fix typos
This fixes typos in the comments of the rpc proto definition.
2019-05-15 14:49:11 -04:00
Joost Jager
863bf2f91b
Merge pull request #1662 from joostjager/raw
lnrpc: better payment failure reporting
2019-05-15 14:38:52 +02:00
Joost Jager
c97592692c
routerrpc: add SendToRoute with structured failure message 2019-05-15 11:54:46 +02:00
Joost Jager
b2eb2619bf
routerrpc: connect UnmarshallRoute to existing config fields 2019-05-15 11:54:46 +02:00
Joost Jager
ba3fa94268
lnrpc+routing: Only accept a single route for SendToRoute 2019-05-15 11:54:46 +02:00
Johan T. Halseth
c706b9549a
Merge pull request #3019 from sangaman/subscribe-single-invoice-rhashstr
invoicesrpc: SubscribeSingleInvoice check RHashStr
2019-05-14 14:28:31 +02:00
Joost Jager
0b66d56aab
routerrpc: move UnmarshallRoute to sub server 2019-05-13 12:55:56 +02:00
Daniel McNally
c9afa6469f
invoicesrpc: SubcribeSingleInvoiceRequest fix
This fixes a bug where the RHashStr field on the PaymentHash request for
SubscribeSingleInvoice was being ignored. This replaces the PaymentHash
message for the SubscribeSingleInvoice request with a new message called
SubscribeSingleInvoiceRequest that contains only the RHash field.
2019-05-10 22:02:58 -04:00
Joost Jager
7a5bd29a69
lnrpc+routing: remove k shortest path finding 2019-05-07 19:54:06 +02:00
Conner Fromknecht
17b2140cb5
multi: fix spelling mistakes 2019-05-04 15:35:37 -07:00
Johan T. Halseth
ee257fd0eb
multi: move Route to sub-pkg routing/route 2019-04-29 14:52:33 +02:00
Olaoluwa Osuntokun
46aa8503b2
Merge pull request #2892 from wpaulino/verify-chan-backup
rpc: modify VerifyChanBackup to take either a Single or Multi
2019-04-05 14:31:37 -07:00
Wilmer Paulino
b71bb9400a
rpc: modify VerifyChanBackup to take either a Single or Multi 2019-04-05 12:51:16 -07:00
Johan T. Halseth
f1677e7199
lnrpc/routerrpc: make fmt on router backend test 2019-04-05 17:25:49 +02:00
Wilmer Paulino
ca01695330
rpc: expose peer's GossipSyncer sync type 2019-04-03 15:44:47 -07:00
Olaoluwa Osuntokun
6f2087023b
lnrpc: add REST endpoints for new SCB related calls 2019-04-02 20:46:33 -07:00
Olaoluwa Osuntokun
7ab8096d4a
lnrpc: add new VerifyChanBackup command 2019-03-28 17:54:01 -07:00
Olaoluwa Osuntokun
da3625fc02
lnrpc: add series of new methods for exporting, recovering, and subscribing to SBCs 2019-03-28 17:53:22 -07:00
Conner Fromknecht
e3c65e1a49
Merge pull request #2845 from joostjager/routerrpc-log
routerrpc: register router sub server logger
2019-03-27 21:04:32 -07:00
Johan T. Halseth
f96dbd2377
lnrpc: add median_channel_size to NetworkInfo 2019-03-27 15:06:30 +01:00
Joost Jager
6b6dd30aa7
routerrpc: register router sub server logger 2019-03-27 11:44:49 +01:00
Johan T. Halseth
4d8100cc9a
Merge pull request #2640 from joostjager/cltv-limit
routing: add cltv limit
2019-03-27 10:05:02 +01:00
Olaoluwa Osuntokun
6440f39120
Merge pull request #2794 from halseth/autopilot-query-heuristic-no-active-agent
autopilot: move queryHeuristic out of agent
2019-03-21 20:20:51 -07:00
Joost Jager
087de7cc4d
routerrpc: adapt to changed interfaces of routing subsystem 2019-03-21 10:25:55 +01:00
John Griffith
acb8fd4796
lnrpc: add payment cltv limit 2019-03-19 10:36:54 +01:00
Johan T. Halseth
d4813422c9
autopilot+autopilotrpc: ignore local channels if ignore_local_state set 2019-03-18 14:43:40 +01:00
Johan T. Halseth
c7ab6f3603
lnrpc/autopilotrpc: add ignore_local_state flag 2019-03-18 14:42:58 +01:00
Johan T. Halseth
1e2af38f5a
lnrpc+rpcserver: define and implement EstimateFee RPC 2019-03-15 23:47:13 +01:00
Joost Jager
f450929b65
invoicesrpc: add SettleInvoice 2019-03-15 10:09:23 +01:00
Joost Jager
32f2b047e8
htlcswitch: hodl invoice
This commit modifies the invoice registry to handle invoices for which
the preimage is not known yet (hodl invoices). In that case, the
resolution channel passed in from links and resolvers is stored until we
either learn the preimage or want to cancel the htlc.
2019-03-15 10:09:17 +01:00
Joost Jager
fcdc8f0e83
lnrpc/invoices: add hold invoice rpc 2019-03-15 10:08:58 +01:00
Joost Jager
19f79613df
channeldb: store hold invoice 2019-03-15 10:08:55 +01:00
Joost Jager
8392f6d28f
lnrpc/invoicesrpc: remove lnrpc type from add invoice 2019-03-15 10:08:52 +01:00
Joost Jager
b9cc165341
lnrpc: move add invoice logic to subserver 2019-03-15 10:08:49 +01:00
Joost Jager
c4263e7061
lntypes: return a value from constructors
Returning pointers proved inconvenient in almost all cases. This commmit
converts the constructors to returning values.
2019-03-15 10:08:38 +01:00
Joost Jager
2be1051fb6
zpay32: move HopHint and DefaultFinalCLTVDelta 2019-03-15 10:08:32 +01:00
Olaoluwa Osuntokun
a24eeb9135
lnrpc/routerrpc: style fix ups 2019-03-12 21:20:21 -07:00
Joost Jager
293971cd03
routerrpc: move query routes into sub server
This commit moves the query routes backend logic from the main
rpc server into the sub server. It is another step towards splitting up
the main rpc server code.

In addition to this, a unit test is added to verify rpc parameter
parsing.
2019-03-11 09:56:16 +01:00
Joost Jager
6e10c05a82
lnrpc: deprecate QueryRoutes with more than one route
Now that QueryRoutes gained the ability to route from any source node
and takes in edge and node black lists, all pieces are in place to have
users implemented their own k-shortests path algorithm. Or any other algorithm
they might wish to use and currently can't.

This commit marks the num_routes field as deprecated as a preparation
for removing k-shortest for lnd.
2019-03-06 15:31:06 +01:00
Joost Jager
c62c9d64da
routing: add source parameter to query routes
This commit allows execution of QueryRoutes from any source node.
Previously this was restricted to only the self node.
2019-03-06 15:31:03 +01:00
Joost Jager
b09adc3219
lnrpc+routing: add edges and nodes restrictions to query routes
This commit allows the execution of QueryRoutes to be controlled using
lists of black-listed edges and nodes. Any path returned will not pass
through the edges and/or nodes on the list.
2019-03-06 15:30:57 +01:00
Olaoluwa Osuntokun
7703567b0b lnrpc: add new unused address types for NewAddressRequest
In this commit, we add two new address types to `NewAddressRequest`.
These address types will allow the caller to retrieve the last _unused_
address, rather than always rotating to the next address in the
keychain.
2019-03-05 15:34:56 -08:00
Olaoluwa Osuntokun
5d1eaaffa4
lnrpc: rename MaxHtlc to MaxHtlcMsat in lnrpc.RoutingPolicy
In this commit, we rename the new `MaxHtlc` field to `MaxHtlcMsat`. We
do this in order to adhere to the new practice to suffix each amount
related field with their proper unit.
2019-02-25 12:49:47 -03:00
Valentine Wallace
e62a8f3269 lnrpc: add max_htlc to RoutingPolicy 2019-02-21 18:39:32 -08:00