Commit Graph

11485 Commits

Author SHA1 Message Date
GameXG
2030b506b1 lnd: fix #1990 LND can't read .cookie file in Bitcoin datadir (Windows) 2021-03-24 21:47:55 +08: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
Wilmer Paulino
393111cea9
discovery+routing: cancel dependent jobs if parent validation fails
Previously, we would always allow dependent jobs to be processed,
regardless of the result of its parent job's validation. This isn't
correct, as a parent job contains actions necessary to successfully
process a dependent job. A prime example of this can be found within the
AuthenticatedGossiper, where an incoming channel announcement and update
are both processed, but if the channel announcement job fails to
complete, then the gossiper is unable to properly validate the update.
This commit aims to address this by preventing the dependent jobs to
run.
2021-03-23 11:56:51 -07:00
Wilmer Paulino
e713205eea
discovery: add missing error channel sends in processNetworkAnnouncement
Without the error channel sends, we would block the gossip message
stream upon receiving a premature channel announcement.
2021-03-23 11:56:31 -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
yyforyongyu
2dac77200b
lncli+lnrpc: add payment address to sendpayment 2021-03-17 21:16:17 +08: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
Joost Jager
56238ebc60 routing: remove unnecessary lock in mission control init
The init code is part of the instantiation, so there is no need for
locking yet.
2021-03-17 12:06:12 +01:00
Joost Jager
89751f869f routing: fix mission control deadlock
This commit fixes the following potential deadlock situation:
* Pathfinding holds a database lock and tries to obtain a mission control lock
via GetProbability
* ReportPaymentSuccess/ReportPaymentFail holds a mission control lock
and tries to obtain a database lock to store the payment result.
2021-03-17 12:03:32 +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
Joost Jager
9398220568 walletrpc: add ListLeases 2021-03-13 08:45:52 +01:00
Joost Jager
b8e54fffbf walletrpc: extract leases marshall function 2021-03-13 08:45:52 +01:00
Joost Jager
37331a5ab2 walletrpc: use locked utxo struct from wtxmgr 2021-03-13 08:45:52 +01:00
Joost Jager
927f17be32 walletrpc: parameterize output lease duration 2021-03-13 08:45:52 +01:00
Joost Jager
5ba0f8e355 lnwallet: bump btcwallet 2021-03-13 08:45:52 +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