Commit Graph

11414 Commits

Author SHA1 Message Date
Conner Fromknecht
9020a4d2a5
lnrpc/invoicesrpc: extract paymentHashAndPreimage helper 2021-05-10 16:55:12 -07:00
Olaoluwa Osuntokun
0d3253c410
Merge pull request #5281 from guggero/router-chain-sync
itest flakes: fix multiple issues around router subsystem being out of sync
2021-05-10 13:11:37 -07:00
Oliver Gugger
6c37cae639
lntest+routing: update best height after graph pruning
It seems #5246 introduced a subtle bug that lead to the error "out of
order block: expecting height=1, got height=XXX" some times during
startup. Apparently it can happen that during pruning of the graph tip
some blocks can come in before we start our chain view and the new block
subscription. By querying the chain backend for the best height before
syncing with the graph we ensure that we never miss a block.
2021-05-10 16:46:28 +02:00
Oliver Gugger
8147b270d4
lntest: wait for chain sync in switch test 2021-05-10 16:46:28 +02:00
Oliver Gugger
ea4ef204a0
rpcserver: add router synced to synced_to_chain flag
The router has a lot of work to do for each block. So it might be
possible that it isn't yet up to date with the most recent block,
even if the wallet is. This can happen in environments with high CPU
load (such as parallel itests). Since the `synced_to_chain` flag in
the response of this call is used by many wallets (and also our
itests) to make sure everything's up to date, we add the router's
state to it. So the flag will only toggle to true once the router was
also able to catch up.
2021-05-10 16:46:28 +02:00
Oliver Gugger
9f0228b21c
router: add SyncedHeight() method
The router subsystem has its own goroutine that receives chain updates
and then does its (quite time consuming) work on each new block. To make
it possible to find out what block the router currently is synced to, we
export its internal best height through a new method.
2021-05-10 16:46:27 +02:00
Johan T. Halseth
6f2f23aae6
Merge pull request #5284 from yuki-js/master
lnrpc: Change State -> state in GetState
2021-05-10 10:41:09 +02:00
yuki-js
241f62fbb6 lnrpc: Change State -> state in GetState
protobuf and rest field's first letter should be lower case
2021-05-09 22:50:10 +00:00
Olaoluwa Osuntokun
1868c7dec1
Merge pull request #5231 from Crypt-iQ/unsigned_ack_patch_04212021
lnwallet: use tail not tip in getUnsignedAckedUpdates
2021-05-07 12:46:48 -07:00
Johan T. Halseth
b1d9525d29
Merge pull request #5269 from bhandras/healthcheck_module
kvdb: separate healthcheck module
2021-05-07 14:05:48 +02:00
Johan T. Halseth
a8d813a4e5
Merge pull request #5277 from guggero/neutrino-update
mod: bump neutrino dep to latest version
2021-05-07 13:56:55 +02:00
Johan T. Halseth
2f99cd7ba1
Merge pull request #5268 from yyforyongyu/fix-whitelist
trivial: update log_error_whitelist
2021-05-07 13:56:21 +02:00
Johan T. Halseth
683a3f952a
Merge pull request #5275 from halseth/mod-update-btcd
mod: update btcd to latest master
2021-05-07 13:55:39 +02:00
Johan T. Halseth
99c609c1a8
mod: update btcd to latest master 2021-05-07 11:36:46 +02:00
yyforyongyu
270984b7d5
trivial: update log_error_whitelist 2021-05-07 13:20:54 +08:00
Conner Fromknecht
6e5ccb4efb
Merge pull request #5229 from halseth/breacharbiter-twoway-handoff
breacharbiter<->chainwatcher two-way handoff
2021-05-06 16:17:03 -07:00
Oliver Gugger
10eb52909b
mod: bump neutrino dep to latest version
We update the Neutrino dependency to the latest version that fixed a
struct alignment and several loop variable as pointer issues found by
the linter.
2021-05-06 22:55:12 +02:00
Johan T. Halseth
ac49031396
chainwatcher: only continue breach handling after successfully marked
closed

This commit makes the handoff procedure between the breachabiter and
chainwatcher use a function closure to mark the channel pending closed
in the DB. Doing it this way we know that the channel has been markd
pending closed in the DB when ProcessACK returns.

The reason we do this is that we really need a "two-way ACK" to have the
breacharbiter know it can go on with the breach handling. Earlier it
would just send the ACK on the channel and continue. This lead to a race
where breach handling could finish before the chain watcher had marked
the channel pending closed in the database, which again lead to the
breacharbiter failing to mark the channel fully closed.

We saw this causing flakes during itests.
2021-05-06 12:37:11 +02:00
Johan T. Halseth
bdc1f3100d
breachabirter+contraccourt: convert ProcessACK to function closure 2021-05-06 12:37:11 +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