Commit Graph

11598 Commits

Author SHA1 Message Date
Oliver Gugger
8224de599b
walletunlocker: extract LoadAndUnlock
As a preparation to do auto-unlock without the unlock RPC, we extract
the relevant part into its own method in the unlocker service.
2021-05-06 10:07:00 +02:00
Olaoluwa Osuntokun
4685341dcb
Merge pull request #5227 from Roasbeef/spent-channs-zombie-index
routing: add chans rejected due to failed chain validation to zombie index
2021-05-05 18:32:13 -07:00
Andras Banki-Horvath
ad586c6bf1
healthcheck: separate lnd/healthcheck into submodule 2021-05-05 15:33:19 +02:00
Andras Banki-Horvath
cee832b749
healthcheck: disable default healthcheck logger
Disable logging by default in the healthcheck submodule to cut
dependency on lnd/build as we are hooking the logger separately
during lnd init.
2021-05-05 15:33:14 +02:00
Olaoluwa Osuntokun
6d66133459
Merge pull request #4998 from bhandras/leader_election
cluster: leader election using etcd backend
2021-05-04 20:05:02 -07:00
Olaoluwa Osuntokun
9d9f420da5
Merge pull request #5246 from joostjager/router-best-height
routing: no backend call to fetch best block
2021-05-04 19:27:37 -07:00
Conner Fromknecht
af289a180c
Merge pull request #5258 from wpaulino/validation-barrier-err-deadlock
routing: return err on validation barrier failure of network update
2021-05-04 10:44:08 -07:00
Andras Banki-Horvath
dd14947154
lint: silence depreciation warnings 2021-05-04 17:33:14 +02:00
Andras Banki-Horvath
80bc46e614
lint: fix proto message no-copy linter warnings 2021-05-04 17:33:14 +02:00
Andras Banki-Horvath
9aacc35989
lnrpc: add GetState to stateservice (v1/state)
This commit adds a new GetState call to the state service in order to
make leader election integrate simply with k8s using a readinessProbe.
2021-05-04 17:33:13 +02:00
Andras Banki-Horvath
7caf26ce94
itest: add itest for failover after forcefull shutdown 2021-05-04 17:33:12 +02:00
Andras Banki-Horvath
5d8488871c
itest: basic failover itest when using leader election on etcd 2021-05-04 17:33:12 +02:00
Andras Banki-Horvath
5e215a7a66
lnrpc: add "waiting to start" state to state service
This commit adds a new "waiting to start" state which may be used to
query if we're still waiting to become the cluster leader. Once leader
we advance the state to "wallet not exist" or "wallet locked" given
wallet availablity.
2021-05-04 17:33:11 +02:00
Andras Banki-Horvath
b6a620e6b2
misc: add ability to store the wallet in the remote DB 2021-05-04 17:33:11 +02:00
Andras Banki-Horvath
08be03367a
walletunlocker: extract method to create the Loader 2021-05-04 17:33:10 +02:00
Andras Banki-Horvath
c190c3d582
etcd: update etcd to 3.4.14 2021-05-04 17:33:09 +02:00
Andras Banki-Horvath
e5f249ad51
mod: integrate latest btcwallet and bump protobuf and grpc 2021-05-04 17:33:09 +02:00
Andras Banki-Horvath
d161b34ee5
lnd: integrate leader elector to lnd main
This commit also changes the order of DB init to be run after the RPC
server is up. This will allow us to later add an RPC endpoint to be used
to query leadership status.
2021-05-04 17:33:08 +02:00
Andras Banki-Horvath
41532ce634
cluster: add etcd based leader elector and factory 2021-05-04 17:33:07 +02:00
Andras Banki-Horvath
e62dbca11a
cluster: add cluster package skeleton and LeaderElector interface 2021-05-04 17:33:07 +02:00
Andras Banki-Horvath
282618441d
etcd: do not try authenticate when using embedded 2021-05-04 17:33:06 +02:00
Andras Banki-Horvath
5441c1bb6d
etcd: fix embbeded etcd connection cfg 2021-05-04 17:33:06 +02:00
Andras Banki-Horvath
9992e5c0b5
etcd: decouple embedded etcd instance startup
This refactor changes how we instantiate the etcd based Backend to allow
separate initialization and startup for the embedded instance.
2021-05-04 17:33:05 +02:00
Andras Banki-Horvath
6757e14998
etcd: refactors to simplify etcd configuration
This refactor removes a redundancy where we had etcd configuration under
kvdb and kvdb/etcd packages.
2021-05-04 17:33:04 +02:00
Andras Banki-Horvath
44e312ace9
etcd: remove (unused) etcd root bucket prefix
This commit removes the unused prefix from the etcd backend config as
etcd key space separation in LND is implemented by using namespaces
instead.
2021-05-04 17:32:59 +02:00
Olaoluwa Osuntokun
e0ce384f02
routing: add new error for failed funding tx validation
In this commit we add a new error for when we fail to validate the
funding transaction (invalid script, etc) and mark it as a zombie like
the other failed validation cases.
2021-05-03 19:06:59 -07:00
Olaoluwa Osuntokun
92c47983cb
routing: add chans rejected due to failed chain validation to zombie index
In this commit, we start to add any channels that fail the normal chain
validation to the zombie index. With this change, we'll ensure that we
won't continue to re-process the same set of spent channels over and
over again.

Fixes #5191.
2021-05-03 19:06:55 -07:00
Olaoluwa Osuntokun
897a19d9df
routing: add new error for invalid funding tx rejection 2021-05-03 19:06:52 -07:00
Olaoluwa Osuntokun
0dc6f8058d
routing: add new error for spent channel UTXOs 2021-05-03 19:06:50 -07:00
Olaoluwa Osuntokun
7b42ad0b0e
channeldb: add new method for adhoc zombie chan creation
In this commit, we add a new method that allows us to mark a channel as
being a zombie on the fly without needing to go through the normal
channel deletion process.
2021-05-03 19:06:45 -07:00
Olaoluwa Osuntokun
99fe0ab150
Merge pull request #4878 from bhandras/etcd_doc_fix
etcd: `disabletls` option for etcd
2021-05-03 18:56:42 -07:00
Olaoluwa Osuntokun
140dd944c0
Merge pull request #5257 from wpaulino/neutrino-update
lncfg: add config options for new neutrino options
2021-04-30 16:54:35 -07:00
Olaoluwa Osuntokun
98b0b34bb4
Merge pull request #5237 from guggero/ws-bi-di
REST: Enable support for bi-directional streaming RPCs over REST, fix ping/pong support
2021-04-29 15:55:00 -07:00
Wilmer Paulino
0ada2288cc
discovery: prevent logging certain validation barrier errors 2021-04-29 15:53:07 -07:00
Wilmer Paulino
eb4413154d
routing: return err on validation failure of network update
This ensures the waiting receiving channel always receives an error to
prevent a deadlock when processing a network update that fails due to
the validation barrier.

On commit d5aedbcbd9db510c974c9f7be5ab177ad6546994:

1000 @ 0x43a285 0x44a38f 0xc42e86 0xc80fda 0xc8682d 0xc976c9 0x46fce1
github.com/lightningnetwork/lnd/routing.(*ChannelRouter).AddNode+0x245                      github.com/lightningnetwork/lnd/routing/router.go:2218
github.com/lightningnetwork/lnd/discovery.(*AuthenticatedGossiper).addNode+0x3b9            github.com/lightningnetwork/lnd/discovery/gossiper.go:1510
github.com/lightningnetwork/lnd/discovery.(*AuthenticatedGossiper).processNetworkAnnouncement+0x574c github.com/lightningnetwork/lnd/discovery/gossiper.go:1554
github.com/lightningnetwork/lnd/discovery.(*AuthenticatedGossiper).networkHandler.func1+0x24github.com/lightningnetwork/lnd/discovery/gossiper.go:1043
2021-04-29 15:52:24 -07:00
Olaoluwa Osuntokun
41c089fbf4
Merge pull request #5224 from bhandras/invoice-gc-errors
invoices: do not fail DeleteInvoice if payment addr isn't indexed
2021-04-29 15:39:35 -07:00
Wilmer Paulino
c59c8d9c19
build: increase global test timeout to 60m
This doesn't affect our travis builds as much as our integration suite
is ran in parellel, but it is needed when running it sequentially.
2021-04-29 13:56:21 -07:00
Wilmer Paulino
f26cfac440
itest: use wait predicate for balance assertion in assertDLPExecuted
This assertion would at times fail if the wallet balance hadn't been
updated yet.
2021-04-29 13:56:20 -07:00
Wilmer Paulino
6bb7b00a80
lntest: decrease broadcast timeout for neutrino-backed integration tests
Since we don't have to worry about network latency within our
integration tests, we can shorten the broadcast timeout for neutrino
integration tests from 5s to 1s.
2021-04-29 13:56:19 -07:00
Wilmer Paulino
2084cb0ad5
lncfg: add config options for new neutrino options 2021-04-29 13:56:17 -07:00
Hampus Sjöberg
64d6d26a1c
build: update to latest version of neutrino
This commit updates neutrino to the latest version.
This is to deal with on-chain transaction issues, where in certain
situations the transaction wouldn't be broadcasted.
2021-04-29 13:55:49 -07:00
Olaoluwa Osuntokun
2a2bc64a12
Merge pull request #5156 from ellemouton/blockcache
blockcache: add blockcache pkg and pass it to all backends
2021-04-29 13:52:39 -07:00
Oliver Gugger
13aed071bd
itest: add test for bi-directional WebSocket 2021-04-29 10:39:55 +02:00
Oliver Gugger
066472fd3e
itest: refactor WS tests into functions 2021-04-29 10:39:55 +02:00
Oliver Gugger
5df69cf93f
config+lnd: make WebSocket interval/wait configurable
To make it possible to adapt the WebSocket ping interval and pong wait
time to custom situations, we add new configuration flags to customize
them.
2021-04-29 10:39:54 +02:00
Oliver Gugger
4b685e4d64
lnd+lnrpc: enable WebSocket ping/pong messages
Fixes #4497 by sending out ping messages in a regular interval to make
sure the connection is still alive.
2021-04-29 10:39:50 +02:00
Oliver Gugger
5e7b905f19
lnrpc: fix WS close error
Fixes the logged error "WS: error closing upgraded conn: tls: failed to
send closeNotify alert (but connection was closed anyway): write tcp4
<ip>-><ip>: write: connection reset by peer" that is caused by the
client closing the connection on its end.
2021-04-29 10:39:12 +02:00
Oliver Gugger
993167f14e
docs+lnrpc: enable bi-directional WebSockets
The grpc-gateway library that is used to transform REST calls into gRPC
uses a different method for reading a request body stream depending on
whether the RPC is a request-streaming one or not. We can't really find
out what kind of RPC the user is calling at runtime, so we add a new
parameter to the proxy that lists all request-streaming RPC calls.
In any case the client _has_ to send one request message initially to
kick off the request processing. Normally this can just be an empty
message. This can lead to problems if that empty message is not
expected by the gRPC server. But for the currently existing two
client-streaming RPCs this will only trigger a warning
(HTLC interceptor) or be ignored (channel acceptor).
2021-04-29 10:39:12 +02:00
Elle Mouton
f8de10511e chainntnfs: add block cache to NeutrinoNotifier
This commit adds gives BtcdNotifier access to the block cache and wraps
its GetBlock method so that the block cache's mutex map for the specific
hash is used.
2021-04-28 09:59:50 +02:00
Elle Mouton
6ad5781bf1 routing: add block cache to CfFilteredChainView
This commit adds the block cache to the CfFilteredChainView struct
and wraps its GetBlock function so that block cache mutex map is used
when the call to neutrino's GetBlock function is called.
2021-04-28 09:46:11 +02:00