Commit Graph

14541 Commits

Author SHA1 Message Date
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
Oliver Gugger
fe24f195b8 Merge pull request #7508 from positiveblue/fix-linter
multi: make linter happy
v0.16.0-beta.rc3
2023-03-13 10:04:26 +01:00
positiveblue
4a0a15586b multi: make linter happy
Fix all the linter problems for the `v0.16.0-beta.rc3`.
2023-03-11 23:29:41 -08:00
Olaoluwa Osuntokun
840c939464 build: bump version to v0.16.0-rc3 2023-03-10 19:09:32 -08:00
Olaoluwa Osuntokun
75ee5574a9 Merge pull request #7448 from Roasbeef/tx-rebroadcaster
lnwallet: add new rebroadcaster interface, use for background tx publish
2023-03-10 19:08:38 -08:00
Olaoluwa Osuntokun
8754547ded lnwallet: add tests for the new rebroadcaster logic
We needed to copy some mocks from elsewhere in the codebase, as
otherwise we'd run into an import cycle.
2023-03-10 19:07:50 -08:00
Olaoluwa Osuntokun
e007125f78 lnutils: add RecvOrTimeout
This abstracts out a common pattern where we wait for a send on a
channel, and timeout otherwise.
2023-03-10 19:07:45 -08:00
Olaoluwa Osuntokun
6b8a1f1d67 docs/release-notes: add note for new tx rebroadcast 2023-03-10 19:07:42 -08:00
Olaoluwa Osuntokun
42343184f4 lnd: hook up neutrino's rebroadcaster for full node backends
Neutrino already runs this rebroadcaster in the background, so we don't
need to create it again if we're running in that operating mode.
2023-03-10 19:07:40 -08:00
Olaoluwa Osuntokun
10929d80cc lnwallet: add new rebroadcaster interface, use for background tx publish
In this commit, we add a new Rebroadcaster interface to be used for
publishing transactions passively in the background until they've been
confirmed on chain. This is useful if a tx drops out of the mempool, but
then the pool clears down and has more space available to accept the tx
at the current fee level.
2023-03-10 19:07:35 -08:00
Oliver Gugger
dcf69169e5 Merge pull request #7492 from yyforyongyu/gossip-add-log
Add trace logs for `discovery` to catch test flakes
2023-03-09 12:52:01 +01:00
Oliver Gugger
d5942bf692 Merge pull request #7499 from Roasbeef/bump-go-version
build: bump min Go version to 1.19
2023-03-09 10:35:47 +01:00
Olaoluwa Osuntokun
0bbbd9b911 build: bump min Go version to 1.19
Fixes https://github.com/lightningnetwork/lnd/issues/7495
2023-03-08 18:02:57 -08:00
yyforyongyu
b8373f5628 lntest: use trace log level for discovery 2023-03-08 21:03:37 +08:00
yyforyongyu
f22b25a1bf discovery+server: add more trace log 2023-03-08 21:02:53 +08:00
Oliver Gugger
a28fbd4690 Merge pull request #7491 from ellemouton/fillInTowerToSessionIDIndex
watchtower/wtdb: add tower-to-session index entry for all towers
2023-03-08 13:17:05 +01:00