Commit Graph

14556 Commits

Author SHA1 Message Date
Oliver Gugger
a266c3a4a9 itest: add assertion for PSBT change outputs
With this commit we add more specific assertions to our PSBT signing
test in order to make sure change outputs have the proper PSBT metadata
associated with them, depending on their address type.
2023-03-20 19:22:37 +01:00
Oliver Gugger
c4c1f1ac92 Merge pull request #7069 from ellemouton/deleteSessions
watchtower: start using the DeleteSession message
2023-03-20 18:45:36 +01:00
Elle Mouton
ab98fc43fe docs: add release note for 7069 2023-03-20 16:51:51 +02:00
Elle Mouton
6f4034f7d1 lntest/itest: add session deletion itest 2023-03-20 16:51:51 +02:00
Elle Mouton
31beacc2c4 lnrpc/wtclientrpc: populate sessions from legacy channels 2023-03-20 16:51:51 +02:00
Elle Mouton
bad80ff583 multi: make tower MaxUpdates configurable
This is helpful in an itest environment where we want to quickly
saturate a session.
2023-03-20 16:51:51 +02:00
Elle Mouton
d840761cc4 watchtower: dont load closed channel details
In this commit, the FetchChanSummaries method is adapted to skip loading
any channel summaries if the channel has been marked as closed.
2023-03-20 16:51:51 +02:00
Elle Mouton
26e628c0fe watchtowers: handle closable sessions
Add a routine to the tower client that informs towers of sessions they
can delete and also deletes any info about the session from the client
DB.
2023-03-20 16:51:51 +02:00
Elle Mouton
8478b56ce6 watchtower: method to dial tower and send DeleteSession
This commit adds a deleteSessionFromTower method which can be used to
dial the tower that we created a given session with and then sends that
tower the DeleteSession method.
2023-03-20 16:51:33 +02:00
Elle Mouton
0209e6feb8 watchtower/wtclient: add Copy method to AddressIterator 2023-03-20 16:51:32 +02:00
Elle Mouton
2b08d3443f watchtowers: add thread safe min-heap
In this commit, a thread-safe min-heap is implemented. It will carry
sessionCloseItems which carry a sessionID and a block height at which
the session should be closed.
2023-03-20 16:51:32 +02:00
Elle Mouton
16008c0032 watchtower: handle channel closures
Add a channel-close handler that waits for channel close events and
marks channels as closed in the tower client DB.
2023-03-20 16:51:25 +02:00
Elle Mouton
41e36c7ec7 watchtower: add wtclient.ClientSession constructor 2023-03-20 10:46:53 +02:00
Elle Mouton
0ed5c750c8 watchtower: add GetTower to tower iterator
Add a GetTower method to the tower iterator.
2023-03-20 10:46:53 +02:00
Elle Mouton
e432261dab watchtower: add DeleteSession method
Add a DeleteSession method to the tower client DB. This can be used to
delete a closable session along with any references to the session.
2023-03-20 10:46:52 +02:00
Elle Mouton
3577c829d3 watchtower: add ListClosableSessions method
This commit adds a new ListClosableSessions method to the tower client
DB. This method will return a map of sessionIDs to block heights. The
IDs belong to sessions that are considered closable and the block
heights are the block height at which the last associated channel for
the session was closed in.
2023-03-20 10:46:52 +02:00
Elle Mouton
571966440c watchtower: add MarkChannelClosed db method
This commit adds a `MarkChannelClosed` method to the tower client DB.
This function can be called when a channel is closed and it will
check the channel's associated sessions to see if any of them are
"closable". Any closable sessions are added to a new
`cClosableSessionsBkt` bucket so that they can be evaluated in future.
Note that only the logic for this function is added in this commit and
it is not yet called.
2023-03-20 10:46:52 +02:00
Elle Mouton
a3050ed213 watchtower: add GetClientSession func to DB
This commit adds a new `GetClientSession` method to the tower client DB
which can be used to fetch a session by its ID from the DB.
2023-03-20 10:46:52 +02:00
Elle Mouton
5283e2c341 watchtower/wtdb: remove unnecessary tower load 2023-03-20 10:46:52 +02:00
Elle Mouton
ee0353dd24 watchtower: build channel to sessionIDs index
In this commit, a migration is added that adds an index from channel to
sessionIDs (using the DB-assigned session IDs). This will make it easier
in future to know which sessions have updates for which channels.
2023-03-20 10:46:52 +02:00
Elle Mouton
b16df45076 watchtower: add sessionID index
In this commit, a new session-ID index is added to the tower client db
with the help of a migration. This index holds a mapping from a
db-assigned-ID (a uint64 encoded using BigSize encoding) to real session
ID (33 bytes). This mapping will help us save space in future when
persisting references to sessions.
2023-03-20 10:46:52 +02:00
Oliver Gugger
ae39cd9e91 Merge pull request #7514 from yyforyongyu/rpc-verbose-log
itest+rpcserver: fix itest flake in `3rd_party_anchor_spend`
2023-03-17 08:48:40 +01:00
yyforyongyu
ef4b5dba85 docs: update release note 2023-03-17 10:01:42 +08:00
yyforyongyu
9bd0dcd121 rpcserver: add debug log for rpc calls 2023-03-17 10:01:42 +08:00
yyforyongyu
c87da1ff01 itest: fix flake in testAnchorThirdPartySpend 2023-03-17 03:17:36 +08:00
Oliver Gugger
2e8dc7bf94 Merge pull request #7439 from ellemouton/bolt3-test-vectors
lnwallet: update Bolt3 test vectors
2023-03-16 18:47:19 +01:00
Oliver Gugger
2869b70808 Merge pull request #7059 from ellemouton/sessionFiltering
multi+towers: add ClientSessionFilterFn option
2023-03-16 16:58:04 +01:00
Elle Mouton
05793e5591 docs: add release note 2023-03-16 17:27:39 +02:00
Elle Mouton
b607db30f9 lnwallet: add zero-fee-htlc-tx test vectors 2023-03-16 17:27:05 +02:00
Elle Mouton
6774b72913 lnwallet: add same amount and preimage anchors test vector 2023-03-16 17:27:05 +02:00
Elle Mouton
a41f6d5a73 lnwallet: add same amount and preimage legacy test vector 2023-03-16 17:27:04 +02:00
Elle Mouton
4f14193ca9 lnwallet: add new htlc set for test vectors
Add a new test htlc set comprised of htlc 1 from the original set and
two new htlcs, 5 and 6, that use the same preimage and have the same
output value (in sats). This htlc set is used in tests that assert the
ordering of htlcs  that have the same preimage and output value.
2023-03-16 17:27:04 +02:00
Elle Mouton
dbc19b24e5 lnwallet: add funding amount assertion to tests
In this commit, an assertion is added to the bolt 3 commitment tx tests
that ensures that the local and remote balances add up to the expected
funding amount. Adding this assertion uncovered a borked test vector
which is also fixed in this commit.
2023-03-16 17:27:04 +02:00
Elle Mouton
09ff853b9c lnwallet: lint bolt 3 test vectors func 2023-03-16 17:27:04 +02:00
Elle Mouton
15da50df10 lnwallet: remove dead code 2023-03-16 17:27:04 +02:00
Elle Mouton
b5d281dca8 lnwallet: run commitment tx tests in parallel 2023-03-16 17:27:03 +02:00
Elle Mouton
bc868fe270 docs: update release notes with 7059 2023-03-16 15:00:26 +02:00
Elle Mouton
b635629e3c lnrpc/wtclientrpc: correctly merge tower client info
Prior to this commit, the wtclient would request tower info from both
the legacy client and the anchors client and would then merge the
results returned. This is incorrect since the two clients will have
different session info and different "active" statuses for the same
tower. This commit thus ensures that we dont lose this info.
2023-03-16 14:59:08 +02:00
Elle Mouton
c1be420696 watchtower: make use of the new ClientSessionFilterFn option
In this commit, the wtclient starts making use of the new
ClientSessionFilterFn to do any session filtering instead of doing it in
memory.
2023-03-16 14:59:08 +02:00
Elle Mouton
40ac82e439 watchtower: add ClientSessionFilterFn to session requests
In this commit, a new ClientSessionFilterFn parameter is added to the
DB's ListClientSession method which can be used to allow the caller to
specify a filter function for filtering sessions read from the DB.
Currently all filtering of sessions are done after the sessions have
been read from the DB, so adding this option should provide some
efficiency.
2023-03-16 14:59:08 +02:00
Oliver Gugger
8a2999c789 Merge pull request #7500 from yyforyongyu/coverage-test-flags
Makefile: add testing_flags to coverage test
2023-03-16 10:07:20 +01:00
Oliver Gugger
51680c5677 Merge pull request #7490 from yyforyongyu/replace-6417
Return FEE_INSUFFICIENT before checking balance for incoming low-fee HTLCs
2023-03-16 10:05:58 +01:00
Tommy Volk
7853cf0a43 docs: update release notes 2023-03-16 08:31:59 +08:00
yyforyongyu
4054ace4e1 htlcswitch: return FEE_INSUFFICIENT before checking balance 2023-03-16 08:30:38 +08:00
yyforyongyu
941a33af31 Makefile: add testing_flags to coverage test 2023-03-16 04:23:07 +08:00
Oliver Gugger
dbf667d8fc Merge pull request #7511 from yyforyongyu/fix-state-check-itest
itest+lntest: make sure states are cleaned when tests end
2023-03-14 18:58:59 +01:00
yyforyongyu
20e53e85b4 itest+lntest: make sure states are cleaned when tests end
This commit changes how the node's state is updated to make sure the
test cleans up the node's state.

Also `testLookupHtlcResolution` is fixed with a cleanup.
2023-03-15 00:01:40 +08:00
Oliver Gugger
098bb36114 Merge pull request #7510 from guggero/fund-psbt-unconfirmed
lncli: allow specifying `--min_confs` in `wallet psbt fund` to select unconfirmed inputs
2023-03-14 13:45:05 +01:00
Oliver Gugger
1ed63a85b3 docs: add release notes 2023-03-13 12:46:05 +01:00
Oliver Gugger
1a3be78471 cmd/lncli: add --num_confs to wallet psbt fund command 2023-03-13 12:45:58 +01:00