Commit Graph

42 Commits

Author SHA1 Message Date
Conner Fromknecht
e0e57642b6
wtclient/client: fix missed prefix log 2021-01-04 08:33:34 -08:00
Conner Fromknecht
1d3535582b
wtclient/seseion_queue: add prefix logging 2021-01-04 08:32:34 -08:00
Conner Fromknecht
de09b8d9bd
wtclient/session_negotiator: add prefix logging 2021-01-04 08:32:34 -08:00
Conner Fromknecht
505901d7b8
wtclient/task_pipeline: add prefix logging 2021-01-04 08:32:31 -08:00
Olaoluwa Osuntokun
94f8311667
Merge pull request #4782 from cfromknecht/anchor-wtserver
watchtower: anchor channel support
2020-11-30 17:49:32 -08:00
Conner Fromknecht
5aa59906b5
wtclient: schedule ForceQuit first during Stop
Currently the ForceQuit call is scheduled after trying to stop the
backup queue. In certain cases, the call to stop the queue never
finishes, which means the force quit is never scheduled. We rememdy by
scheduling this call before any other operations to ensure we can always
exit ungracefully if necessary.
2020-11-30 13:08:04 -08:00
Conner Fromknecht
7fc4c7c412
wtclient: prefix client logs w/ legacy or anchor 2020-11-25 15:39:14 -08:00
Conner Fromknecht
781c6e5bea
wtclient: add anchor-aware session negotiation and filtering 2020-11-25 15:05:36 -08:00
Conner Fromknecht
dd325f04d2
watchtower/wtclient: parameterize backup task with channel type 2020-11-25 15:04:12 -08:00
Conner Fromknecht
b9f031b3e3
Merge pull request #4746 from wpaulino/tower-last-addr
watchtower: prevent removal of last tower addr
2020-11-11 09:27:54 -08:00
Wilmer Paulino
d3157bcaf8
watchtower: prevent removal of last tower addr
This addresses a potential panic when a tower has one of its candidate
sessions chosen, but its only reachable address was removed by a
user-initiated RPC before the fact.
2020-11-04 15:43:18 -08:00
yyforyongyu
ef38b12fda
multi: use timeout field in dialer 2020-09-16 11:50:04 +08:00
Oliver Gugger
f97e7b9951
watchtower: use ECDH interface for watchtower session 2020-05-20 09:06:57 +02:00
Oliver Gugger
6f702a43aa
watchtower: extend and rename SecretKeyRing 2020-05-20 09:05:15 +02:00
Oliver Gugger
b0cb110e86
watchtower: rename SessionPrivKey to SessionKeyECDH 2020-05-20 09:05:15 +02:00
Wilmer Paulino
ec5c941512
wtclient: filter out inactive sessions upon adding existing/new tower 2020-05-14 13:35:02 -07:00
Wilmer Paulino
75c2ebd794
wtclient: load missing info into client sessions upon new tower
This addresses a potential panic in where we relied on this missing info
being populated.
2020-05-14 13:35:00 -07:00
Wilmer Paulino
01ab551b22
wtclient: refactor existing candidate session filtering into method 2020-05-14 13:34:59 -07:00
Olaoluwa Osuntokun
4b65aea306
watchtower+htlcswitch: update client tower logic to recognize safu commitments
In this commit, we update the tower+link logic to tag a commitment as
the new (tweakless) format if it applies. In order to do this, the
BackupTask method has gained an additional parameter to indicate the
type of commitment that we're attempting to upload. This new tweakless
bool is then threaded through all the way to back up task creation to
ensure that we make the proper input.Input.

Finally, we've added a new test case for each existing test case to test
each case w/ and w/o the tweakless modifier.
2019-09-25 18:25:55 -07:00
Wilmer Paulino
0431701262
multi: only allow specifying towers to TowerClient through RPC
With the introduction of the WatchtowerClient RPC subserver, the lnd
configuration flag to specify private watchtowers for the client is no
longer needed and can lead to confusion upon users. Therefore, we remove
the flag completely, and only rely on the watchtower client being active
through a new --wtclient.active flag.
2019-07-30 15:18:17 -07:00
Wilmer Paulino
359b2049b6
watchtower: load persisted towers upon TowerClient creation
We do this as a convenience for WatchtowerClient users so that they do
not need to re-add towers upon restarts. We ensure not to re-add towers
that have been previously removed by determining whether it has any
lingering active sessions.
2019-07-30 15:18:17 -07:00
Wilmer Paulino
c57128097e
watchtower/wtclient: extend TowerClient with CRUD operations for towers
In this commit, we extend the wtclient.Client interface with the
following methods:

  * AddTower
  * RemoveTower
  * RegisteredTowers
  * LookupTower
  * Stats

Care has been taken to ensure that any in-memory state updates are
_only_ performed after a successful database update.

These methods are currently unused, but they serve as a dependency for
the upcoming WatchtowerClient RPC subserver.
2019-07-30 15:18:13 -07:00
Wilmer Paulino
06d10d8100
watchtower/wtclient: extend TowerCandidateIterator to update candidates 2019-07-30 15:13:24 -07:00
Wilmer Paulino
1d73a6564f
watchtower: extend client databse with CRUD operations for towers
These operations are currently unused, but will be integrated into the
TowerClient at a later point as future preparation for the
WatchtowerClient RPC subserver, which will allow users to add, remove,
and list the watchtowers currntly in use.
2019-07-30 15:13:23 -07:00
Wilmer Paulino
56d66c80a1
watchtower: extend client db to filter sessions for a specific tower
This currently takes O(N) time as there does not exist an index of
active client sessions for each watchtower within the client's database.
This index is likely to be added in the future.
2019-07-30 15:13:22 -07:00
Wilmer Paulino
4abadc82f3
watchtower/wtclient: export clientStats 2019-07-30 15:13:21 -07:00
Wilmer Paulino
159883665d
wtclient: refactor client creation after database calls 2019-07-30 15:13:20 -07:00
Conner Fromknecht
bf042f1271
watchtower/wtclient: filter non-target towers from candidates 2019-06-20 18:17:23 -07:00
Conner Fromknecht
997023cd7a
Merge pull request #3226 from cfromknecht/wtclient-log-fixups
watchtower/multi: fix logging in wtclient
2019-06-20 14:10:02 -07:00
Conner Fromknecht
3a4aba463b
routing+watchtower/wtclient: prints stats once per minute 2019-06-19 20:07:11 -07:00
Conner Fromknecht
fad8932d75
watchtower/multi: fix logging in wtclient 2019-06-19 19:57:59 -07:00
Conner Fromknecht
7cabe2667f
watchtower/wtclient/client: use existing session with same TxPolicy
This commit modifies the client's filtering when selecting from existing
sessions. The new logic compares the configured TxPolicy with the
TxPolicy of the candidate sessions, which has the effect of ignoring
operational parameters such as MaxUpdates. Prior, changing MaxUpdates
would cause the client to request a new session even if it had perfectly
good slots available in a policy with an equal TxPolicy.
2019-06-13 19:54:21 -07:00
Conner Fromknecht
9b365567b6
watchtower/wtclient/client: avoid over requesting sessions
This commit fixes a bug that would cause us to request more sessions
that needed from the session negotiator. With the current stat ticker,
we'd ask the negotiator for a new session every 30s if session
session negotiation did not return before printing the stats. Now we'll
avoid requesting to sessions by jumping back into the select loop.
2019-06-13 19:54:20 -07:00
Conner Fromknecht
d2f3d5ef6c
server: add watchtower client 2019-06-13 19:54:18 -07:00
Conner Fromknecht
ab4a4b77f5
watchtower/wtclient/session_queue: unify logging 2019-06-13 19:54:17 -07:00
Conner Fromknecht
9157c88f93
watchtower/wtclient: dedup backups across restarts
Now that the committed and acked updates are persisted across restarts,
we will use them to filter out duplicate commit heights presented by the
client.
2019-05-24 18:24:41 -07:00
Conner Fromknecht
b35a5b8892
watchtower/wtclient: integrate ClientChannelSummaries
In this commit, we utilize the more generic ClientChanSummary instead of
exposing methods that only allow us to set and fetch sweep pkscripts.
2019-05-23 20:48:50 -07:00
Conner Fromknecht
17b2140cb5
multi: fix spelling mistakes 2019-05-04 15:35:37 -07:00
Conner Fromknecht
71f72894f8
watchtower/wtclient/client: ensure dispatcher can force quit...
during session creation.
2019-04-23 20:07:46 -07:00
Conner Fromknecht
bebe6461a9
watchtower/wtclient: use HD session key derivation 2019-04-23 20:04:55 -07:00
Conner Fromknecht
7d99005dde
watchtower/wtclient/interface: add LoadTower and mock impl 2019-04-23 19:17:21 -07:00
Conner Fromknecht
f00b4c5e96
watchtower/wtclient/client: hook up full client pipeline 2019-03-15 02:32:27 -07:00