Commit Graph

15672 Commits

Author SHA1 Message Date
Elle Mouton
4348f2062a
wtclient+lnrpc: move Stats to Manager
Move the `Stats` method from the `Client` to the `Manager` interface.
2023-11-28 09:54:02 +02:00
Elle Mouton
f38b5cf258
lnrpc+wtclient: refactor ClientStats
This commit removes the mutex from ClientStats and instead puts that in
clientStats which wraps ClientStats with a mutex. This is so that the
tower client interface can return a ClientStats struct without worrying
about copying a mutex.
2023-11-28 09:54:02 +02:00
Elle Mouton
a5e7d35af2
wtclient+lnrpc: move RemoveTower to Manager
Simiarly to the previous commit, this commit moves the RemoveTower
method from the Client to the TowerClientManager interface. The manager
handles any DB related handling. The manager will first attempt to
remove the tower from the in-memory state of each client and then will
attempt to remove the tower from the DB. If the removal from the DB
fails, the manager will re-add the tower to the in-memory state of each
client.
2023-11-28 09:54:02 +02:00
Elle Mouton
a44bf381c4
multi: move AddTower to Tower Client Manager
In this commit we move the AddTower method from the Client interface to
the TowerClientManager interface. The wtclientrpc is updated to call the
`AddTower` method of the Manager instead of calling the `AddTower`
method of each individual client. The TowerClient now is also only
concerned with adding a new tower (or new tower address) to its
in-memory state; the tower Manager will handle adding the tower to the
DB.
2023-11-28 09:54:02 +02:00
Elle Mouton
2abc422aac
watchtower+server: let manager Start & Stop the clients
In this commit, the `Stop` and `Start` methods are removed from the
`Client` interface and instead added to the new `Manager`. Callers now
only need to call the Manager to start or stop the clients instead of
needing to call stop/start on each individual client.
2023-11-28 09:54:01 +02:00
Elle Mouton
ab0375e0c1
wtclient+server: introduce tower client Manager
Introduce a wtclient `Manager` which handles tower clients. It indexes
clients by the policy used. The policy field is thus removed from the
`Config` struct which configures the Manager and is instead added to a
new `towerClientCfg` which configures a specific client managed by the
manager. For now, only the `NewClient` method is added to the Manager.
It can be used to construct a new `TowerClient`. The Manager currently
does notthing with the clients added to it.
2023-11-28 09:51:15 +02:00
Yong
80684eccbd
Merge pull request #8222 from ellemouton/wtclientStartupPerf
wtclient+migration: start storing chan max height in channel details bucket
2023-11-28 15:38:27 +08:00
Oliver Gugger
9ce543fb05
Merge pull request #8209 from vuittont60/master
docs: fix typos [skip ci]
2023-11-27 23:54:17 +01:00
Oliver Gugger
db0b612734
Merge pull request #8224 from yyforyongyu/fix-musig2-session
input: fix `fatal error: concurrent map writes`
2023-11-27 23:40:53 +01:00
yyforyongyu
3934844cc6
docs: add release notes for v0.17.3 2023-11-28 03:19:37 +08:00
Elle Mouton
3642cb6d40
docs: update release notes 2023-11-27 20:01:17 +02:00
Elle Mouton
4131ced707
wtdb/migration8: migrate channel max heights 2023-11-27 20:01:17 +02:00
Elle Mouton
fee94ae5af
watchtower: start using the new channel max heights
This commit also adds tests for the DB changes made in the previous
commit since we can now read the new field with the FetchChanInfos
method.

The commit following this one does the backfill migration.
2023-11-27 20:01:17 +02:00
Elle Mouton
01ba2661db
watchtower/wtdb: start populating channel max commitment
In this commit, a new key, cChanMaxCommitmentHeight, is added to the
channel details bucket. This key will hold the highest commitment number
that the tower has been handed for this channel. In this commit, we
start writing to it in the two places where a backup is first persisted
in the tower client db: 1) CommitUpdate and 2) in the Queue's `addItem`
method. The logic for both 1 & 2 is tested in the next commit which adds
a DB helper that allows us to read the new field.

A follow up commit will do a migration to back-fill the new field.
2023-11-27 20:01:17 +02:00
yyforyongyu
9cc57fa371
lntest: add verbose logging when node fails to shutdown 2023-11-25 07:25:18 +08:00
yyforyongyu
ae09ab2a21
input: use lnutils.SyncMap to store musig2 sessions 2023-11-25 07:25:18 +08:00
Yong
f005b248ce
Merge pull request #8181 from ProofOfKeags/docs/comprehensive-lncli
docs/comprehensive lncli
2023-11-22 06:58:48 +08:00
Keagan McClelland
9fd18a7fd2 docs: update release notes 2023-11-20 14:51:59 -07:00
Keagan McClelland
a2cb3da145 meta: update PR template to remind contributors about lncli docs 2023-11-20 14:48:26 -07:00
Keagan McClelland
545b8913c7 lnrpc: fix watchtowerrpc doc tags to enable lncli api doc generation 2023-11-20 14:45:37 -07:00
Keagan McClelland
dae80f5db7 lnrpc: add top level command doc tags to enable lncli api doc generation 2023-11-20 14:44:30 -07:00
Keagan McClelland
ba4438b923 lnrpc: add devrpc doc tags to enable lncli api doc generation 2023-11-20 14:44:25 -07:00
Keagan McClelland
4eca04e6a0 lnrpc: add wtclientrpc doc tags to enable lncli api doc generation 2023-11-20 14:43:59 -07:00
Keagan McClelland
179295e441 lnrpc: add routerrpc doc tags to enable lncli api doc generation 2023-11-20 14:43:24 -07:00
Keagan McClelland
305e27d7a1 lnrpc: add neutrinorpc doc tags to enable lncli api doc generation 2023-11-20 14:42:17 -07:00
Keagan McClelland
bba09e320c lnrpc: add invoicesrpc doc tags to enable lncli api doc generation 2023-11-20 14:41:54 -07:00
Keagan McClelland
b855566e6b lnrpc: add autopilotrpc doc tags to enable lncli api doc generation 2023-11-20 14:41:14 -07:00
Keagan McClelland
c0da9ca1b0 lnrpc: add walletrpc doc tags to enable lncli api doc generation 2023-11-20 14:40:37 -07:00
vuittont60
e3e2515b83
docs: fix typos [skip ci] 2023-11-20 15:35:56 +08:00
Olaoluwa Osuntokun
d9b88fba67
Merge pull request #8198 from morehouse/brontide_startup_race_test
peer: test for startup writeHander data race
2023-11-17 16:01:16 -08:00
Yong
e8bdf01fef
Merge pull request #8201 from yyforyongyu/flake-fix
itest: fix flake in `multi_hop_htlc_remote_chain_claim`
2023-11-18 00:44:02 +08:00
Yong
3ee33ba561
Merge pull request #8173 from morehouse/simplify_tlv
tlv: simplify encoding functions
2023-11-17 20:37:15 +08:00
yyforyongyu
ded9fe6a84
itest: fix flake in multi_hop_htlc_remote_chain_claim 2023-11-17 17:29:53 +08:00
Matt Morehouse
f0ae5b2456
peer: add test for startup race on writeMessage
The test reliably detects
https://github.com/lightningnetwork/lnd/issues/8184.
2023-11-16 17:33:44 -06:00
Matt Morehouse
08fff28504
peer: enable mockMessageConn to detect data races
We use unsynchronized counters to trigger a report under the race
detector if multiple reads or writes happen concurrently.
2023-11-16 17:32:19 -06:00
Matt Morehouse
c4e0daa274
peer: add missing Close() method to mockMessageConn 2023-11-16 17:31:18 -06:00
Olaoluwa Osuntokun
64753b01d1
Merge pull request #8186 from Crypt-iQ/issue_8184_2
peer: send reestablish, shutdown messages before starting writeHandler
2023-11-16 12:58:12 -08:00
Eugene Siegel
7556402ea4
peer: send reestablish, shutdown messages before starting writeHandler
This is to avoid a potential race on WriteMessage and Flush internals.
Because there is no locking on WriteMessage and Flush, if we allow
writeMessage calls in Start after the writeHandler has started,
the writeMessage calls may call WriteMessage/Flush at the same time
that writeMessage calls from the writeHandler does. Since there is
no locking, internals like b.nextHeaderSend can race and cause
panics.
2023-11-16 12:07:10 -05:00
Elle
ed179e3e7d
Merge pull request #8180 from carlaKC/8128-brontideflake
peer/test: fix race in TestHandleNewPendingChannel
2023-11-16 10:10:24 +02:00
Keagan McClelland
0759b2657c meta: add build tags to workspace settings for lsp support 2023-11-14 17:10:31 -08:00
Carla Kirk-Cohen
a8a86b290c
peer/test: setup clean peer for each TestHandleNewPendingChannel case
Running test cases in parallel with shared state means that they
can intermingle if they're run at the same time and set up incorrect
values when we assert on the number of channels we have. Moving the
peer setup into the parallel test run fixes this because no single
test case can interfere with the other.
2023-11-14 15:45:19 -05:00
Elle
5e369a02bb
Merge pull request #8171 from ellemouton/zombieChansUseCorrectChanID
channeldb+discovery: pass correct SCID to `MarkEdgeLive`
2023-11-14 11:05:57 +02:00
Elle Mouton
ac58100558
docs: update release notes 2023-11-13 20:58:27 +02:00
Elle Mouton
7ff4a8b157
discovery: use correct channel ID for MarkEdgeLive
In processZombieUpdate, the SCID passed to MarkEdgeLive should _not_ be
derived from the ChannelEdgeInfo ChannelID field since this field will
not be populated when GetChannelByID returns a ChannelEdgeInfo along
with an ErrZombieEdge error. So this commit ensures that a usable
SCID is provided to processZombieUpdate.
2023-11-13 20:58:06 +02:00
Elle Mouton
0193274c10
multi: return error from MarkEdgeLive if not found
Let MarkEdgLive return a new ErrNotZombieEdge error if an entry with the
given channel ID cannot be found. In processZombieUpdate, we then
check for this error and log accordingly.
2023-11-13 20:58:06 +02:00
Elle Mouton
034283db10
channeldb: update TestGraphZombieIndex to use require 2023-11-13 20:58:05 +02:00
Olaoluwa Osuntokun
e02fd39ce6
Merge pull request #8170 from yyforyongyu/0-18-staging-missed
Add missing commits from `0-18-staging`
2023-11-13 10:38:23 -08:00
Matt Morehouse
e796922a82
tlv: simplify encoding functions
The typeless functions can directly call the typed functions after the
type check.
2023-11-13 11:30:17 -06:00
yyforyongyu
5168af55a9
itest: fix flake in max_htlc_pathfind
```
lnd_max_htlcs_test.go:149:
        	Error Trace:	/home/runner/work/lnd/lnd/itest/lnd_max_htlcs_test.go:149
        	            				/home/runner/work/lnd/lnd/itest/lnd_max_htlcs_test.go:40
        	            				/home/runner/work/lnd/lnd/lntest/harness.go:286
        	            				/home/runner/work/lnd/lnd/itest/lnd_test.go:136
        	Error:      	Not equal:
        	            	expected: 3
        	            	actual  : 0
        	Test:       	TestLightningNetworkDaemon/tranche01/60-of-134/btcd/max_htlc_pathfind
        	Messages:   	expected accepted
```
2023-11-13 16:11:07 +08:00
yyforyongyu
678f416008
routing+docs: make sure non-MPP cannot use skipTempErr 2023-11-13 16:11:06 +08:00