Commit Graph
11122 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun a9afd86a5b Merge pull request #5127 from alexbosworth/patch-15
rpcserver: revert target conf to previous behavior
2021-03-24 16:53:17 -07:00
Olaoluwa Osuntokun 901c192e9f lnrpc/routerrpc: use x prefix as REST sub-path for ImportMissionControl
A small change to better indicate that this is a different class of RPCs
on the REST interface.
2021-03-23 16:41:00 -07:00
Olaoluwa Osuntokun abea1146a6 Merge pull request #5120 from Roasbeef/invoice-deletion-errors
channeldb: return more detailed errors in DeleteInvoice
2021-03-23 16:14:23 -07:00
Olaoluwa Osuntokun 6f3e14a545 Merge pull request #5061 from carlaKC/4483-importmissioncontrol
routing: add mission control import rpc
2021-03-23 15:22:27 -07:00
Alex Bosworth 069de38186 itest: add support for specifying chain fee rate 2021-03-22 13:08:38 -07:00
Alex Bosworth 61f79d890c rpcserver: revert target conf to previous behavior
Previously the rpcserver would not use the remote conf target as its local conf target and this behavior is desirable.
2021-03-19 18:43:07 -07:00
Johan T. Halseth b1309277b9 Merge pull request #4590 from hsjoberg/signal-proper-shutdown-glob
signal: handle shutdown properly
2021-03-18 19:09:31 +01:00
Hampus Sjöberg ada1bc701c signal: handle shutdown properly
This addresses issues related to the mobile lnd builds, where
calling `stopDaemon` and subsequently calling LndMobile's `Start`
results in crash.
2021-03-18 12:54:25 +01:00
carla cb977622c6 lncli: add mission control import command 2021-03-18 10:52:23 +02:00
carla d0e7164c07 routerrpc: add mission control import 2021-03-18 10:51:45 +02:00
carla 22491ad567 routing: add mission control import functionality 2021-03-18 10:46:45 +02:00
Johan T. Halseth 6046c5cf86 Merge pull request #5119 from ellemouton/lncli-start-signal-interceptor
lncli: start signal interceptor in getContext
2021-03-18 09:30:11 +01:00
Johan T. Halseth d53633eab5 Merge pull request #5005 from halseth/walletunlocker-unify-staterpc
[RPC] SubscribeState RPC for getting unlocking state of wallet and RPC
2021-03-18 08:41:07 +01:00
Olaoluwa Osuntokun 0a1d592cf9 channeldb: return more detailed errors in DeleteInvoice
This PR was created in order to help to debug the failures in:
https://github.com/lightningnetwork/lnd/issues/5113

We add some more contextual errors so we can figure out where the
assumptions of the current scan to delete function in the invoice
registry is incorrect.
2021-03-17 14:22:46 -07:00
Elle Mouton 000516ec4d lncli: start signal interceptor in getContext
signal Intercept function needs to be called if the signal shutdown
channel will be listened on.
2021-03-17 22:44:45 +02:00
Conner Fromknecht e2690918a0 Merge pull request #5002 from akovalenko/master
lncli addinvoice: allow specifying msat with --amt_msat
2021-03-17 10:03:56 -07:00
Conner Fromknecht 482ca0ddc4 Merge pull request #5068 from wpaulino/gossip-rate-limit-config
lncfg: expose channel update rate limiting options
2021-03-17 09:58:53 -07:00
Johan T. Halseth b4bc6f918e lncli: add state command 2021-03-17 12:09:38 +01:00
Johan T. Halseth 9ef556624e lnrpc: add StateService 2021-03-17 12:09:38 +01:00
Johan T. Halseth 419ad86209 Merge pull request #5112 from halseth/walletunlocker-mac-responsechan-close
lnd: close MacResponseChan when wallet is unlocked
2021-03-17 10:40:25 +01:00
Oliver Gugger 05342f25b8 Merge pull request #5097 from ellemouton/lncli-interrupt-handler
lncli: cancel RPC context on OS interrupts
2021-03-17 10:31:08 +01:00
Wilmer Paulino 022d44f776 itest: test new channel update rate limiting options 2021-03-16 12:08:18 -07:00
Wilmer Paulino dcac5a87f4 lncfg: expose channel update rate limiting options 2021-03-16 11:42:29 -07:00
Conner Fromknecht b4aa661d16 Merge pull request #5064 from ellemouton/set-coop-close-target-confs
multi: allow setting target confs for co-op close
2021-03-16 11:14:15 -07:00
Conner Fromknecht 53c1175407 Merge pull request #5111 from yyforyongyu/fix-feature-check
routing: check payment.DestFeatures against nil
2021-03-16 10:01:00 -07:00
yyforyongyu 541fbbb054 routing: check payment.DestFeatures against nil 2021-03-17 00:14:20 +08:00
Johan T. Halseth ad6673c21d lnd: close MacResponseChan when wallet is unlocked
After unification of the WalletUnlocker and RPC services on the same gRPC
server, the WalletUnlocker will no longer be shut down after the wallet
has been unlocked.

In case --no-macaroons was used, this lead to the caller getting stuck
after unlocking the wallet, since we would wait for a response on the
MacResponseChan. Earlier we would close the MacResponseChan always
when shutting down the WalletUnlocker, but this is no longer done.

To fix this we close this channel after the wallet is unlocked,
regardless of which combination of --no-macaroons and --noseedbackup
that is being used.
2021-03-16 14:47:02 +01:00
whythat 54c93b1b86 lncli: cancel RPC context on OS interrupts 2021-03-12 10:07:49 +02:00
Johan T. Halseth fa4155c126 Merge pull request #5086 from halseth/mobile-graceful-exit
mobile: gracefully exit if lnd fails to start
2021-03-11 20:02:11 +01:00
Johan T. Halseth fd76b879a2 Merge pull request #4985 from halseth/walletunlocker-unify-jan21
[gRPC] WalletUnlocker and RPCServer unification
2021-03-11 14:00:00 +01:00
Johan T. Halseth 148f1be75f itest: add RPC errors to whitelist
Since we now log RPC errors as the first thing in our interceptor chain,
more benign errors bubble up. We add them to the whitelist.
2021-03-11 13:05:24 +01:00
Johan T. Halseth b2e0a7d684 rpcperms: export macaroon interceptor methods
Since we need access to these methods from external subservers in some
cases, we export them.
2021-03-11 13:05:24 +01:00
Johan T. Halseth 2877511fce rpcperms+lnd: gate RPC calls on RPC state
This commit makes us gate the calls to the RPC servers according to the
current RPC state. This ensures we won't try to call the RPC server
before it has been fully initialized, and that we won't call the
walletUnlocker after the wallet already has been unlocked.
2021-03-11 13:05:24 +01:00
Johan T. Halseth 0d7763fb96 walletunlocker: expose WalletExists 2021-03-11 13:05:24 +01:00
Johan T. Halseth 5e9e03858d lntest/node: call FetchNode info in wait.NoError after init
In case we call it before the RPC server is fully active.
2021-03-11 13:05:24 +01:00
Johan T. Halseth 4bbf5c4b6d rpcserver: use same grpc server for both services
This commit achieves what we have been building up to: running the
WalletUnlockerService and the LightningService on the same gRPC server
simultaneously!

To achieve this, we first create the RPC server in a "interface only"
way, only creating the struct and setting the dependencies we have
available before the wallet has been unlocked. After the wallet has been
unlocked and we have created all the subsystems we need, we add those to
the RPC server, and start the sub-servers.

This means that the WalletUnlockerService and the LightningService both
will be registered and available at all times on the gRPC server.
However, before the wallet has been unlocked, the LightningService
should not be used since the RPC server is not yet ready to handle the
calls. Similarly, after the wallet has been unlocked, the
WalletUnlockerService should not be used. This we will ensure in
following commits.
2021-03-11 13:05:24 +01:00
Johan T. Halseth 82fb22eda2 lnd+rpc: define external subserver config only once
We don't have to define the external subserver config more than once, so
it is not needed to be defined for every listener. Instead we move it to
the ListenerConfig.
2021-03-11 13:05:24 +01:00
Johan T. Halseth 73711941ad rpcperms: add macaroon whitelist
We extract common macaroon validating code into a method, and add a
method whitelist, for methods that won't need macaroons.

This give us explicit control over which methods don't require
macaroons, to avoid inadvertently adding RPCs that are unauthenticated.

For now this whitelist contains the WalletUnlocker methods, as the
wallet password is required to open the macaroon db.
2021-03-11 13:05:23 +01:00
Johan T. Halseth 3c81a5dd73 rpcperms: add RPC interceptor chain
This adds a new package rpcperms which houses the InterceptorChain
struct.  This is a central place where we'll craft interceptors to use
for the GRPC server, which includes macaroon enforcement.

This let us add the interceptor chain to the GRPC server before the
macaroon service is ready, allowing us to avoid tearing down the GRPC
server after the wallet has been unlocked.
2021-03-11 13:05:23 +01:00
Johan T. Halseth 4ea494e8c5 lnrpc: wrap subservers in GrpcHandler
In order to be able to register the subservers with the root grpc server
before we have all dependencies available, we wrap them in an
GrpcHandler struct. This struct will initially hold an empty reference
to the subservers, which allows us to register with the GRPC server, and
later populate and create the subserver instance.
2021-03-11 13:05:23 +01:00
Oliver Gugger c623d21bd2 Merge pull request #5083 from guggero/psbt-size-fix
lncli: allow PSBT to be read from file
2021-03-10 23:02:02 +01:00
Conner Fromknecht 7e33548e8b Merge pull request #4775 from halseth/input-tx-size-constants
[input/size] Check tx size constants
2021-03-10 09:23:40 -08:00
Oliver Gugger f55aae0068 itest: add new neutrino error to whitelist 2021-03-10 16:55:49 +01:00
Oliver Gugger b3dfe5d1af lncli: allow PSBT to be read from file
Fixes #5080.

The N_TTY_BUF_SIZE kernel parameter dictates how many characters can be
pasted into a terminal window. This cannot be circumvented by reading
the input in a different manner.
To avoid the problem fully, we instead allso allow the user to type in a
path to a text file that is read if it exists. That way the PSBT can be
as long as needed.
2021-03-10 12:46:33 +01:00
Olaoluwa Osuntokun 65b0bbcd53 Merge pull request #5033 from robot-dreams/set-channel-status
Add lncli command / RPC for manually setting channel state
2021-03-09 18:12:08 -08:00
Olaoluwa Osuntokun dd13dbe613 Merge pull request #5072 from cfromknecht/fix-tlv-bench
tlv: fix ESatPerKw in benchmark
2021-03-09 16:42:58 -08:00
Johan T. Halseth 8038e9f322 mobile: gracefully exit if lnd fails to start
Instead of killing the app, report an error back to the application.
2021-03-09 14:25:46 +01:00
Eugene 6dca38c561 Merge pull request #5073 from Crypt-iQ/writemessage_03042021
lnwire: remove MaxPayloadLength from lnwire.Message interface
2021-03-09 04:50:40 -08:00
Yaacov Akiba Slama 4bab68a808 lnrpc: add timestamp_ns field to ForwardingEvent msg
This allows to use FowardingHistory rpc method to receive the data exactly
as it's stored in lnd and to synchronize incrementally the history to an
external database.
2021-03-05 16:26:28 -08:00
Olaoluwa Osuntokun 3c14e3d71d Merge pull request #4517 from Crypt-iQ/2659_keyloc
multi: store KeyLocator in OpenChannel, use ECDH instead of DerivePrivKey
2021-03-05 16:12:49 -08:00