Commit Graph

13927 Commits

Author SHA1 Message Date
Oliver Gugger
d2d3cf3408
Merge pull request #6956 from ellemouton/configureChanReserve
multi: configurable remote chan reserve
2022-10-13 15:39:40 +02:00
Oliver Gugger
d55f861107
Merge pull request #6928 from ellemouton/wtclientMemPerf
multi: remove AckedUpdates & CommittedUpdates from ClientSession struct
2022-10-13 15:34:35 +02:00
Oliver Gugger
c2d89bd9f5
Merge pull request #7032 from guggero/autopilot-test-fix
autopilot: fix loop variables, use require
2022-10-13 15:31:31 +02:00
Elle Mouton
e6eed56827
docs: update release notes for #6928 2022-10-13 14:42:51 +02:00
Elle Mouton
75e5339217
watchtower: remove CommittedUpdates from ClientSession
In this commit, the new ListClientSession functional options and new
FetchSessionCommittedUpdates function are utilised in order to allow us
to completely remove the CommittedUpdates member from the ClientSession
struct.
2022-10-13 14:41:26 +02:00
Oliver Gugger
fcdb2b545f
docs: add release notes 2022-10-13 14:40:43 +02:00
Oliver Gugger
8d6befd797
autopilot: fix loop variables, use require
With this commit we fix a few occurrences of loop variables being
accessed in closures.
While we touch the code, we also migrate it to using the require
library.
2022-10-13 14:40:43 +02:00
Elle Mouton
fe3d9174ea
watchtower: add FetchSessionCommittedUpdates func to DB
In this commit, a new tower client db function is added that can be used
to fetch all the committed updates for a given session ID. This is done
in preparation for an upcoming commit where the CommittedUpdates will be
removed from the ClientSession struct.
2022-10-13 14:39:23 +02:00
Elle Mouton
15858cae1c
watchtower+lnrpc: remove AckedUpdates from ClientSession struct
In this commit, we start making use of the new ListClientSession
functional options added in the previous commit. We use the functional
options in order to calculate the max commit heights per channel on the
construction of the tower client. We also use the options to count the
total number of acked and committed updates. With this commit, we are
also able to completely remove the AckedUpdates member of the
ClientSession since it is no longer used anywhere in the code.
2022-10-13 14:36:33 +02:00
Elle Mouton
40e0ebf417
watchtower: add ListClientSessions functional options
This commit adds functional options to the ListClientSessions call that
can be used to perform a variety of extra operations during the DB
query. These functional options are not yet used in this commit.
2022-10-13 14:35:34 +02:00
Elle Mouton
3ac3b6a90d
watchtower: refactor getClientSession helper funcs
Small refactor to some of the tower client db helper functions in order
to simplify upcoming commits.
2022-10-13 14:35:03 +02:00
Oliver Gugger
707546e2f0
Merge pull request #6972 from ellemouton/wtclientTowerDb
watchtower: add towerID-to-sessionID index
2022-10-13 13:09:12 +02:00
Oliver Gugger
3b44afcd49
Merge pull request #6864 from Juneezee/test/t.Cleanup
test: replace defer cleanup with `t.Cleanup`
2022-10-13 12:45:34 +02:00
Eng Zer Jun
4a464c2aaf
docs: add release note entry for #6864
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:04 +08:00
Eng Zer Jun
604a355db6
lnd: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:04 +08:00
Eng Zer Jun
228f1e36c4
watchtower: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:04 +08:00
Eng Zer Jun
22cd790586
tor: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:04 +08:00
Eng Zer Jun
ff3f477ebf
routing: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:04 +08:00
Eng Zer Jun
7070be52b7
queue: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:04 +08:00
Eng Zer Jun
5e6690107e
pool: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Eng Zer Jun
f8ae8318c6
peer: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Eng Zer Jun
1133643927
macaroons: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Eng Zer Jun
889cb0af47
kvdb/etcd: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Eng Zer Jun
945180f0ea
invoices: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Eng Zer Jun
8d50d54ade
htlcswitch: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Eng Zer Jun
19b1eb9617
funding: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Eng Zer Jun
100839fcea
cluster: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Eng Zer Jun
c70e39cd21
multi: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:46:54 +08:00
Elle Mouton
2294e11b7a
docs: update release notes 2022-10-13 11:30:27 +02:00
Elle Mouton
105c44df9b
watchtower: use more efficient session query on startup
In this commit, the functions used to fetch candidate sessions and
towers on creation of the watchtower Client are changed to make use of
the more efficient lookup functions. Previously, all sessions were
listed from the DB and then these were used to collect the active
towers which in certain situations lead to some users getting the
"tower not found" error on start up. With this commit, we instead first
list all Towers in the DB and then we fetch the sessions for each of
those towers.
2022-10-13 11:30:27 +02:00
Elle Mouton
ecd2eb965a
watchtower: make use of the new tower-to-session index
In this commit, the towerID-to-sessionID index added in the previous
commit is put to use in order to make session lookup more efficient in
certain places. In the process, 2 TODO's are also removed from the code.
2022-10-13 11:30:27 +02:00
Elle Mouton
354a3b16bd
watchtower/wtdb: add new towerID-to-sessionID index
This commit adds a new towerID-to-sessionID index to the wtclient DB.
The commit also contains the necessary migration required in order to
build the index for an existing client.
This index will greatly improve the lookup of sessions for a given tower
ID.
2022-10-13 11:30:27 +02:00
Elle Mouton
c60ecaccbf
watchtower: always populate Tower in ClientSession
In this commit, we make sure to always populate the Tower member of a
ClientSession. This is done for consistency.
2022-10-13 11:30:27 +02:00
Elle Mouton
e150bb83d1
watchtower/wtdb: check tower exists on session create
Before creating a new session, first check that the TowerID that the
ClientSession is referencing refers to an existing tower. This is done
to prevent the situation where RemoveTower is called right before
CreateClientSession is called which would, before this commit, lead to
the session being created with a tower ID that does not refer to any
existing tower.
2022-10-13 11:30:26 +02:00
Elle Mouton
5dabf7cb3e
watchtower/wtdb: update tests to use require package
In this commit, all the tests in the wtdb package are updated in order
to make use of the `require` package where appropriate.
2022-10-13 11:30:26 +02:00
Elle Mouton
f815c88ee4
watchtower: fix formatting
In order to make upcoming commits in the PR easier to parse, this commit
makes some basic formatting changes to some of the watchtower files.
2022-10-13 11:30:22 +02:00
Eng Zer Jun
5c5997935d
chanbackup: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:01:35 +08:00
Eng Zer Jun
cac8f54a45
chainntnfs: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:01:35 +08:00
Eng Zer Jun
b796b747ed
brontide: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:01:35 +08:00
Eng Zer Jun
1dcc7d74e6
autopilot: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:01:31 +08:00
Oliver Gugger
4b827179bb
Merge pull request #5561 from guggero/database-migration-lndinit
kvdb: refactor as preparation for DB migration command in lndinit
2022-10-13 10:59:38 +02:00
Oliver Gugger
4e42ef0ab2
docs: add release notes 2022-10-13 09:45:07 +02:00
Oliver Gugger
696758a660
lncfg: export database namespace names
For the data migration tool we need to know what database namespaces
there are so we can loop over them.
2022-10-13 09:45:07 +02:00
Oliver Gugger
fc2d652261
channeldb: check for tombstone before opening DB
To avoid running a channel DB that was successfully migrated to another
system by accident, we check if there is a tombstone marker before we
open the DB for use.
2022-10-13 09:45:07 +02:00
Oliver Gugger
7e76326b97
channeldb: export DB migration related functions
We'll need to know whether a database was migrated to the latest version
in our upcoming data migration tool. To be able to determine the current
version of a DB and the total number of migrations in existence, we need
to export some of the functions in channeldb.
We also add some helper functions for adding tombstone and other markers
to a database.
2022-10-13 09:45:07 +02:00
Oliver Gugger
28c8e8b6dd
channeldb: remove unused tx argument 2022-10-13 09:37:53 +02:00
Oliver Gugger
ee9d6f21bd
etcd: add SequenceKey function 2022-10-13 09:37:52 +02:00
Oliver Gugger
d576184fdb
etcd: extract NewEtcdClient into exported function
In order for us to be able to re-use the code for initializing an etcd
client connection, we extract and export the NewEtcdClient function.
2022-10-13 09:37:52 +02:00
Oliver Gugger
98f359c5b7
etcd: fix typos 2022-10-13 09:37:52 +02:00
Oliver Gugger
b51b1e2f73
Merge pull request #6931 from morehouse/refactor_funding_manager
funding: create waitForPeerOnline helper
2022-10-13 09:37:01 +02:00