Commit Graph

9870 Commits

Author SHA1 Message Date
Conner Fromknecht
ef9068319b
multi: rename ReadCursor to RCursor 2020-05-26 18:21:08 -07:00
Conner Fromknecht
455ddfebdb
multi: rename: ReadBucket to RBucket 2020-05-26 18:21:08 -07:00
Conner Fromknecht
d0d2ca403d
multi: rename ReadTx to RTx 2020-05-26 18:20:37 -07:00
Olaoluwa Osuntokun
03e6a18212
Merge pull request #4317 from bhandras/testclock_improvement
clock: optionally wait until tickers are registered in TestClock
2020-05-26 18:02:25 -07:00
Olaoluwa Osuntokun
797d0f9368
Merge pull request #4316 from gcomte/master
lncli: Fix typos in closechannel help dialog
2020-05-26 18:01:12 -07:00
Conner Fromknecht
6a02fa1107
invoices/invoiceregistry: properly synchronize backlog
This commit moves the db calls for retrieving add and settle backlogs
outide of the main event loop. All other db operations are performed
outside of the event loop and synchronized via the invoice registry's
mutex, which also synchronizes the order in which events submitted to be
processed.

This resolves various concurrency issues where notifications can be
missed of inconsistent reads against the databse. This is especially
important in this case because we are actually making two separate
database calls.
2020-05-26 17:50:46 -07:00
Conner Fromknecht
5b747715fc
invoices: return error from SubscribeNotifications on shutdown 2020-05-26 17:50:45 -07:00
Conner Fromknecht
1332575482
channeldb/invoices: ignore error when no settles exist
This fixes a bug that would cause no backlog to be delivered at all.
2020-05-26 17:50:45 -07:00
Andras Banki-Horvath
337d282a3f clock+test: convert checks to testify asserts 2020-05-26 23:55:28 +02:00
Andras Banki-Horvath
e81061bda4 clock: optionally wait until tickers are registered in TestClock 2020-05-26 23:55:26 +02:00
Olaoluwa Osuntokun
d32c7a4814
Merge pull request #4309 from Roasbeef/restore-open-time
lnd: fix regression in DB open time logs
2020-05-26 11:27:17 -07:00
Carla Kirk-Cohen
35d40efd52
Merge pull request #4315 from carlaKC/gomod-tidy
gomod: tidy dependencies
2020-05-26 11:29:14 +02:00
Gabriel Comte
7a4b783fc8
lncli: Fix typos in closechannel help dialog 2020-05-25 16:32:49 +02:00
carla
79265ddff0
gomod: tidy dependencies 2020-05-25 15:24:18 +02:00
carla
210a0f428b
lncli: add label transaction command to walletkit cli
Two additional errors are added to the itest error whitelist because we
are specifically trigerring these errors.
2020-05-25 11:33:41 +02:00
carla
97a843f3cd
walletrpc: add LabelTransaction rpc 2020-05-25 11:33:33 +02:00
carla
baeef63aab
lnwallet: add label transaction to WalletController interface 2020-05-25 08:38:05 +02:00
Olaoluwa Osuntokun
bbc4f06872
lnd: fix regression in DB open time logs
In this commit, we fix a regression in our DB open time logging that was
introduced in #4015. Obtaining the target backend from the configuration
will actually also open the database, so we need to include that in the time
delta as well.
2020-05-22 15:18:23 -07:00
András Bánki-Horváth
7f1a450a7f
Merge pull request #4015 from bhandras/kv-etcd
kvdb wrapper for etcd
2020-05-22 14:00:06 +02:00
Andras Banki-Horvath
b53475da14 lncfg+lnd: prefix etcd db with only network name instead of full path 2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
c3fcfd1530 etcd: add namespace support to separate key spaces
This commit extends etcd db with namespaces without additional storage
space requirements. This is simply done by instead of using an all zero
root bucket id, we use the sha256 hash of the name space as our root
bucket id.
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
bce0597643 channeldb: silence linter 2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
85aee9b064 kvdb+lncfg: fully move etcd behind build tag
This commit separates all etcd related sources (sans a few stubs and
config) from the rest of the source tree and makes compilation conditional
depending on whether the kvdb_etcd build tag is specified.
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
3ef331e016 lncfg+etcd: add TLS config
This commit extends lncfg with etcd TLS config and passes these
parameters to the etcd client upon construction.
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
b54f8a1b97 kvdb+channeldb: create ExtendedBackend interface to allow rich tx logic
This commit adds the ExtendedBackend interface which is an extension to
the walletdb.DB interface. This paves the way to using etcd.db.View and
etcd.db.Update in the global View and Update functions without much code
rewrite.
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
23fcb59a2b channeldb: convert payment tests to use test backend 2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
02f9d91e49 kvdb+etcd: only lock on bucket path mod revision for reads and writes
This commit reduces the compare set size the STM will submit in
transactions by adding only the bucket keys along the bucket path to a
specific lock set. This lock set then used to filter the read set,
effectively removing all read only keys from the transaction predicate
that are not bucket keys.
By tracking if a read-write tx actually changes something, we can also
"bump" the mod revision of the bucket keys.
With this trick we essentially implement a read-write lock for our
bucket structure greatly reducing transaction processing time.
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
0e3629e2c7 channeldb+lnd: make channeldb backend configurable
This commit adds support for user configured channeldb backend.
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
9d57c1a6b4 lncfg: add configuration for user specified db backend
This commit extends lncfg to support user specified database backend.
This supports configuration for both bolt and etcd (while only allowing
one or the other).
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
859a457e48 kvdb+etcd: extend kvdb and STM with stats
The commit itslef adds stats to the transactions such that we can see
how LND behaves with and etcd backend.
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
248a00f211 kvdb+etcd: enable channeldb testing with both bdb/etcd 2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
3b7525659c channeldb+kvdb: add walletdb interface test
This commit adds walletdb interface test suite to the existing test set.
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
6a24a03cec channeldb+kvdb: walletdb/kvdb interface etcd implementation
This commit adds a full interface implementation of the walletdb/kvdb
interface with detailed tests.
2020-05-22 11:26:25 +02:00
Andras Banki-Horvath
137dee04e8 channeldb+kvdb: an extended STM on top of etcd clientv3
This commit adds an extended STM, similar to what available in etcd's
clientv3 module. This incarnation of said STM supports additional
features, like positioning in key intervals while taking into account
deletes and writes as well. This is a preliminary work to support all
features of the kvdb interface.
2020-05-22 11:26:24 +02:00
Joost Jager
a8d5c32983
Merge pull request #4132 from joostjager/itests-on-routerrpc
itest: switch over to routerrpc.SendPaymentV2
2020-05-22 08:56:10 +02:00
Olaoluwa Osuntokun
53da66a6fc
Merge pull request #4302 from wpaulino/btcwallet-fetchinputinfo-bounds-check
btcwallet: add transaction outputs bounds check to FetchInputInfo
2020-05-21 17:22:25 -07:00
Olaoluwa Osuntokun
c2e7ca9b5f
Merge pull request #4300 from guggero/no-fastsha
channeldb+htlcswitch: don't use fastsha256 in tests
2020-05-21 17:21:50 -07:00
Wilmer Paulino
77a4bc97a7
Merge pull request #4304 from guggero/peer-alignment
peer: fix struct alignment
2020-05-21 19:05:21 +00:00
Oliver Gugger
42ac187932
peer: fix struct alignment
Integers used atomically MUST be aligned properly, otherwise the
sync library will crash on purpose. Therefore non-aligned struct
members must come later.
2020-05-21 11:28:49 +02:00
Conner Fromknecht
64b8aa8f11
Merge pull request #4227 from guggero/signing-abstraction
multi: Remove need for DerivePrivKey from watchtower, brontide, netann and sphinx package
2020-05-20 16:07:44 -07:00
Wilmer Paulino
f287ac3cea
btcwallet: add transaction outputs bounds check to FetchInputInfo
This prevents a panic when providing an incompatible output index for
the transaction.
2020-05-20 11:42:12 -07:00
Joost Jager
d2f6140818
itest: extend whitelist 2020-05-20 17:24:36 +02:00
Joost Jager
e201ed8106
itest: switch over to routerrpc.SendPaymentV2 2020-05-20 17:23:52 +02:00
Joost Jager
ca9c58aec9
Merge pull request #4183 from joostjager/sync-local-payment
htlcswitch: sync local payment hand-off to link
2020-05-20 11:23:15 +02:00
Oliver Gugger
a17ddc5dd1
channeldb+htlcswitch: don't use fastsha256 in tests
The btcsuite/fastsha256 registers itself in the crypto package of
golang as a replacement for sha256. This causes problems in TLS1.3
connections that require the hash implementations to be serializable
and results in the "tls: internal error: failed to clone hash" error.
By removing all uses of the library we fix that error.
2020-05-20 11:07:38 +02:00
Oliver Gugger
3afaed8b5c
rpcserver: fix linter error 2020-05-20 09:12:53 +02:00
Oliver Gugger
36b90382d3
lnd+server+keychain: remove unused code 2020-05-20 09:07:21 +02:00
Oliver Gugger
08d6a61e2a
signrpc: use DigestSigner interface for signing 2020-05-20 09:06:59 +02:00
Oliver Gugger
4003f25281
signrpc: use ECDH interface for shared key generation 2020-05-20 09:06:58 +02:00
Oliver Gugger
f97e7b9951
watchtower: use ECDH interface for watchtower session 2020-05-20 09:06:57 +02:00