Commit Graph
30 Commits
Author SHA1 Message Date
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