Commit Graph

19606 Commits

Author SHA1 Message Date
Elle Mouton
15e17e1270 graph/db: remove NodeRTx ForEachChannel method 2025-08-06 09:52:10 +02:00
Elle Mouton
699e335954 autopilot: remove the ForEachChannel method from Node interface
And instead make use of the new ForEachNodesChannels method which
uses a much more efficient method for iterating through nodes&channels.
2025-08-06 09:52:09 +02:00
Elle Mouton
ce7fe84da7 autopilot: add ForEachNodesChannels method to ChannelGraph interface
This is in preparation for removing the ForEachChannel method from the
Node interface.
2025-08-06 09:50:58 +02:00
Elle Mouton
5727bfa688 graph/db: let ForEachNodeCached maybe fetch node addresses
Here we adjust the ForEachNodeCached graph DB method to pass in a node's
addresses into the provided call-back if requested. This will allow us
to improve the performance of node/channel iteration in the autopilot
subserver.
2025-08-06 09:50:54 +02:00
ziggie
a19e7f2e5f docs: add release-notes 2025-08-06 09:37:09 +02:00
ziggie
28f286a2c1 docs: fix 19.2 release-notes 2025-08-06 09:37:09 +02:00
ziggie
5c22e5eb25 itest: add payment test with max htlc restriction 2025-08-06 09:37:09 +02:00
ziggie
e2a9b17254 multi: skip range check in pathfinder and switch for custom htlc payments 2025-08-06 09:37:08 +02:00
Oliver Gugger
c4db070e5f Merge pull request #10119 from guggero/remote-signing-imported-tapscript
wallet: fix imported tapscript address behavior in watch-only mode
2025-08-05 10:34:27 -06:00
Oliver Gugger
d1f79953b6 docs: add release notes 2025-08-05 16:41:29 +02:00
Oliver Gugger
f5280491ab mod: update btcwallet to version with fix 2025-08-05 16:41:01 +02:00
Oliver Gugger
cce2df9018 itest: run FundPsbt test with imported account
This demonstrates that the "imported" account behaves differently for a
wallet that's watch-only vs. normal. The testTaprootImportTapscriptFullKeyFundPsbt
test case succeeds in a normal run but fails in a remote-signing setup.

For some reason, an imported tapscript address ends up in the "default"
account when remote-signing but in the "imported" account for a normal
wallet.
2025-08-05 16:41:01 +02:00
Oliver Gugger
c214575de1 itest: run normal FundPsbt test case in remote-signer mode
This makes sure there is no general issue with running the pay-join
FundPsbt test case in a remote signer setup.
2025-08-05 16:41:00 +02:00
Elle Mouton
ae566744c4 graph/db+autopilot: remove NodeRTx FetchNode method
In this commit, we remove the need for the NodeRTx interface to have the
FetchNode method on it.
2025-08-05 09:59:13 +02:00
Elle Mouton
70b8c8ec78 autopilot: convert Peer to route.Vertex
In preparation for removing the ForEachNode/ForEachChannel call pattern,
we refactor the autopilot subserver by simplifying the `ChannelEdge`
such that it no longer returns the `Node` type which has a
`ForEachChannel` method on it. The aim is to completely remove the
`ForEachChannel` usage.
2025-08-05 09:59:12 +02:00
Elle
d9ff94a250 Merge pull request #10123 from ellemouton/graphPerf7
[6] graph/db: use batch fetching to improve ForEachNode* performance
2025-08-05 09:57:48 +02:00
Yong
3db93f5b29 Merge pull request #10117 from yyforyongyu/keep-exclusive
contractcourt+sweep: make anchor inputs exclusive
2025-08-05 14:57:26 +08:00
Elle Mouton
0850bf4781 graph/db: batch fetch channel data in forEachNodeChannel
Update the forEachNodeChannel helper to batch fetch channel data.
2025-08-05 08:00:19 +02:00
Elle Mouton
dc6f9256bc graph/db: batch fetch channels in ForEachNodeCached
Previously, ForEachNodeCached would batch fetch node _feature_ data but
would still fetch the channel set of each node in a node-by-node fashion
which is not ideal. So this commit updates this method to make use of
the new sqldb.ExecuteCollectAndBatchWithSharedDataQuery helper. It lets
us batch load channel data for a range of node IDs.

This _greatly_ improves the performance of the method.
2025-08-05 08:00:19 +02:00
Elle Mouton
3b60d33ac8 sqlc: add ListChannelsForNodeIDs batch query
Add a ListChannelsForNodeIDs query which will let us fetch all channels
belonging to a set of nodes.
2025-08-05 08:00:19 +02:00
Elle Mouton
ada349dcf2 graph/db: batch collect node feature data
In this commit, we update the SQLStore's ForEachNodeCacheable and
ForEachNodeCached methods to use batch collection for node feature bits.

This results in the following performance gains:

```
name                                      old time/op  new time/op  delta

ForEachNodeCacheable-native-sqlite-10     184ms ± 2%   145ms ±10%  -21.45%  (p=0.000 n=10+10)
ForEachNodeCacheable-native-postgres-10   697ms ± 8%    51ms ± 4%  -92.68%  (p=0.000 n=9+10)
```
2025-08-05 08:00:19 +02:00
Elle Mouton
6ac19b4330 graph/db: cover more DB methods in benchmark test
So that we can properly measure upcoming performance improvements.
2025-08-05 08:00:18 +02:00
Elle
3ab47625a2 Merge pull request #10121 from ellemouton/graphPerf6
[5] sqldb+graph/db: add and use new paginate & batch helper
2025-08-05 07:48:45 +02:00
Elle Mouton
ae13158b68 graph/db: update ForEachChannel to use new sqldb helper
Refactor to let ForEachChannel make use of the new
sqldb.ExecuteCollectAndBatchWithSharedDataQuery helper.
2025-08-05 06:36:36 +02:00
Elle Mouton
1219cdb7f1 graph/db: use sqldb helper for ForEachNode
A pure refactor commit which updates the ForEachNode method to make use
of the new sqldb.ExecuteCollectAndBatchWithSharedDataQuery helper.
2025-08-05 06:36:34 +02:00
Elle Mouton
905941067e sqldb: add ExecuteCollectAndBatchWithSharedDataQuery helper
In this commit we add a new helper method in the sqldb package:
ExecuteCollectAndBatchWithSharedDataQuery. This can be used to paginate
through items in the database while at the same time performing batch
data collection for those items.
2025-08-05 06:34:38 +02:00
Elle Mouton
1a60edbd33 make+graph/db: add -short helper and skip tests in short mode
In this commit, we add a makefile helper that can be used to add the
"-short" flag to the "go test" command when running unit tests via "make
unit ...".

Tests can then be expanded with a `testing.Short()` check to potentially
skip the test in short mode. This is useful for if a dev wants to
quickly run most of the tests in a package but would like to opt out of
running the longer form tests such as stress tests or rapid generation
tests.

This commit adds this check to two graph/db tests.
2025-08-05 06:34:38 +02:00
Oliver Gugger
e10cb0174e docs: explain what "visual symmetry" means 2025-08-04 16:34:18 +02:00
Oliver Gugger
46b1897d03 docs: document formatting for slice definitions
Adds more clarity around when to use what style for using inline
slice definitions.
2025-08-04 16:26:41 +02:00
Oliver Gugger
7152224b22 Merge pull request #10118 from ellemouton/graphPerf5
[4] sqldb+graph/db: add and use new pagination helper
2025-08-04 05:04:50 -06:00
Yong
21726f0179 Merge pull request #9826 from ziggie1984/refactor-payments-code-02
Refactor Payment PR 2
2025-08-04 17:01:30 +08:00
yyforyongyu
4d7622ab05 docs: add and update release notes for 0.19.3 2025-08-04 16:50:34 +08:00
yyforyongyu
ab8e0354ab sweep: fix typos 2025-08-04 16:50:34 +08:00
yyforyongyu
3da4093012 itest: fix tests re the new anchor behavior 2025-08-04 16:50:31 +08:00
Elle
8f94929a27 Merge pull request #9993 from MPins/issue-9904-9915
Validate UTF-8 description and empty route hints when parsing BOLT-11 invoices
2025-08-04 10:32:07 +02:00
yyforyongyu
5ee54b34ce sweep: only remove the other input from the exclusive group
We now make sure when removing inputs identified by the exclusive group
ID, we only remove the other one, not the one that invoked the removal.
2025-08-04 16:20:25 +08:00
yyforyongyu
ae08a75410 contractcourt+sweep: make anchor inputs exclusive
We now make sure to sweep each anchor input in its own sweeping tx, if
economically feasible.
2025-08-04 16:07:33 +08:00
Yong
6c39b9a3d4 Merge pull request #10097 from Roasbeef/gossip-block-fix
multi: make gossip filter sends non-blocking, only allow a single backlog catch up goroutine per peer
2025-08-04 15:43:33 +08:00
Yong
149a81911a Merge pull request #10087 from starius/estimate-feerate-allow-1
walletrpc: allow conf_target=1 in EstimateFee and FundPsbt
2025-08-04 14:08:42 +08:00
ziggie
2b3b27f5a9 multi: fix linter issues 2025-08-02 13:24:27 +02:00
ziggie
0aef5fa44c multi: unify all payment related kv data
All interactions related to the payment db are now part of the
kvPaymentDB struct.
2025-08-02 13:24:27 +02:00
ziggie
aaa1ee0b74 channeldb: move kv related code
We move all kv particular code which was in the payments.go file
to the kv related file. Code which will be backend independant
will remain in the payments.go file although only the kv backend
is currently supported.
2025-08-02 13:24:25 +02:00
ziggie
e120110470 lnd: introduce separate key-value payment db
We also addd this new db on the server level to use it in the
following commit to do all the payment related queries of the
rpcserver.
We add a new payment db instance on the server level. Which we
will you for the payment related queries in a following commit.
2025-08-02 13:21:48 +02:00
ziggie
84b2a94da2 multi: fix linter issues 2025-08-02 13:21:45 +02:00
ziggie
8bd4744ee8 channeldb: rename pControl to paymentDB in tests 2025-08-02 11:48:01 +02:00
ziggie
2d07d44d1a channeldb: rename PaymentControl struct
In the following commits we will gradually unify the current
payment db operations into an interface to later down the road
support both backends (sql+kv).
2025-08-02 11:24:59 +02:00
Boris Nagaev
aacb94c6d3 doc: add release note (EstimateFee conf_target 1) 2025-08-01 17:16:02 -03:00
Boris Nagaev
c22768283c walletrpc: allow conf_target=1 in FundPsbt
Modified 'fund_psbt' itest to test this scenario.
2025-08-01 17:16:02 -03:00
Boris Nagaev
cd6e648a7f itest: add test for walletrpc.EstimateFee
Make sure conf_target=1 is accepted, but conf_target=0 is not.
2025-08-01 17:16:00 -03:00
Boris Nagaev
b0e9a4b79f walletrpc: allow conf_target=1 in EstimateFee
See https://github.com/lightningnetwork/lnd/pull/9611#issuecomment-3082770038
2025-08-01 17:15:09 -03:00