Commit Graph

19603 Commits

Author SHA1 Message Date
ziggie
e22b898c1e paymentsdb: move db interface dependant tests to different file
This commit starts reusing test cases which are not dependant on
the kv db backend. So they can be later used with the native db
implementation as well.
2025-08-20 09:07:52 +02:00
ziggie
39b7417797 paymentsdb: use querypayments method to make test db agnostic 2025-08-20 09:07:52 +02:00
ziggie
46500f94e0 multi: fix comment of InitPayment method 2025-08-20 09:07:51 +02:00
ziggie
9f824fe1ee multi: introduce interface for payment database 2025-08-20 09:07:48 +02:00
Yong
9a4968656a Merge pull request #8825 from Abdulkbk/restore-node-announcement
lnd: use persisted node announcement settings across restarts
2025-08-18 18:21:00 +08:00
Abdullahi Yunus
fbac73011f docs: add release note 2025-08-16 16:39:53 +01:00
Abdullahi Yunus
2dc9ca43f3 itest: test for node ann persistence
This commit adds an itest that verify the behaviour of correctly
reusing persisted node ann configs across restarts. It also ensures
that the node ann configs are applied using the correct hierarchy.
2025-08-16 16:39:53 +01:00
Abdullahi Yunus
75895dbe3a lnd: use saved node ann config from previous run
This commit ensures that we start with the alias, node color,
addresses, and features as advertised in the node's previous
runtime. This approach maintains consistency in the node's
advertised information across restarts.
2025-08-16 16:39:52 +01:00
Oliver Gugger
fb1adfc218 Merge pull request #10160 from mohamedawnallah/increase-wait-wallet-sync-timeout
lnwallet/test: increase wait for wallet to sync to `30s` to match with the returned error in case of timeout
2025-08-15 06:54:11 -06:00
Oliver Gugger
365f1788e5 Merge pull request #10157 from ziggie1984/remove-pgp-key
remove expired key
2025-08-15 01:10:05 -06:00
Oliver Gugger
c428b7f430 Merge pull request #10158 from ellemouton/graphTest
graph/db: expand TestPopulateViaMigration for easy testing
2025-08-15 00:52:51 -06:00
Mohamed Awnallah
e8283e958c lnwallet/test: make the timeout err msg and actual timeout consistent 2025-08-15 06:05:21 +00:00
Yong
3841d55549 Merge pull request #10112 from GustavoStingelin/check-pgp-keys-expiry
CI: add pgp keys expiry check
2025-08-15 12:12:33 +08:00
Yong
dfc29b3f71 Merge pull request #9847 from ziggie1984/refactor-payments-code-04
Refactor Payment PR 4
2025-08-15 12:03:33 +08:00
Gustavo Stingelin Cardoso Filho
7ba28c4961 CI: add pgp keys expire check 2025-08-14 15:36:10 -03:00
Gustavo Stingelin Cardoso Filho
29bfeb2084 scripts: add pgp keys expire check 2025-08-14 15:35:55 -03:00
ziggie
2b856f036e multi: fix linter 2025-08-14 19:53:18 +02:00
ziggie
e24ae0d7f3 paymentsdb: add missing comments for variables 2025-08-14 19:53:18 +02:00
ziggie
df9bac2ecf multi: move PaymentCreationInfo to payment pkg 2025-08-14 19:53:18 +02:00
ziggie
d138e23919 multi: move FailureReason to payment package 2025-08-14 19:53:18 +02:00
ziggie
d77b2f9c26 mulit: move payment query code to separate file
We also rename the struct since it is now in its own package
there is no need to prefix it.
2025-08-14 19:53:18 +02:00
ziggie
03af9858d2 multi: move payment related code into own package
This commit moves most of the code into its own package. It is
the smallest code move possible without moving import cycles and
keeping the changes to the code base as small as possible during
refactor.
2025-08-14 19:53:15 +02:00
Oliver Gugger
31fc556507 Merge pull request #10155 from ziggie1984/add-missing-invoice-settle-index
Add missing invoice index for native sql
2025-08-14 09:23:37 -06:00
Elle Mouton
ec17f8bc4e graph/db: expand TestPopulateViaMigration for easy testing
Expand the test and make it easily configurable for the purposes of
locally testing the graph SQL migration.
2025-08-14 16:31:04 +02:00
Oliver Gugger
4b3ede5cb0 Merge pull request #10154 from ellemouton/graphPerf11
graph/db: use batch validation to improve SQL migration performance
2025-08-14 05:54:21 -06:00
ziggie
35e9979d67 docs: add schema update doc 2025-08-14 12:00:40 +02:00
ziggie
b98cc24cfe docs: add release-notes 2025-08-14 12:00:40 +02:00
ziggie
ea9fb80eff sqldb: use the new schema
We put this new schema update into the main line and change the
versions of the schema updates which are currently only available
in dev builds. The schemas need to be chronological therefore we
also need to rename the file numbers.
2025-08-14 11:59:09 +02:00
ziggie
dccb669ad1 scripts: remove expired key 2025-08-14 09:37:53 +02:00
ziggie
506d226eb3 sqldb: add missing index for settled invoices 2025-08-14 08:17:15 +02:00
ziggie
22fbbee837 sqldb: delete wrong index names and add missing one 2025-08-14 08:17:15 +02:00
ziggie
77a6b577eb channeldb: move helper function to codec.go
This method is not only used by the payment logic so we need to
move it to a generalized place because in the following commits
we move payment related code into its own package.
2025-08-14 08:08:51 +02:00
ziggie
4bb21a7284 channeldb: export pagination method
We export some methods related to the pagination logic be the
kv store implemenation of the payment data will live in another
package.
2025-08-14 08:08:50 +02:00
Elle Mouton
f560c4d95b sqldb: use uint32 for config values 2025-08-14 08:03:28 +02:00
Elle Mouton
d5729845d0 graph/db: remove outdated TODO 2025-08-14 08:00:07 +02:00
Elle Mouton
b1c643f4f1 graph/db: add migration timing logs
Time the full duration of each graph migration step for the purposes of
logging.
2025-08-14 08:00:07 +02:00
Elle Mouton
5b06474744 graph/db+sqldb: batch validation for zombie index migration
Finally, we update the migrateZombieIndex function to use batch
validation just like was done in the previous commits. Here, we
additionally make sure to validate the entire zombie index entry and not
just the SCID.
2025-08-14 08:00:07 +02:00
Elle Mouton
a490e03479 graph/db+sqldb: use batch validation for closed SCID migration
As was done in the previous commits for nodes & channels, we update the
migrateClosedSCIDIndex function here so that it validates migrated
entries in batches rather than one-by-one.
2025-08-14 08:00:06 +02:00
Elle Mouton
8554f17b3f graph/db+sqldb: validate prune log migration using batching
As was done in the previous commits for nodes & channels, we update the
migratePruneLog function here so that it validates migrated entries in
batches rather than one-by-one.
2025-08-14 08:00:06 +02:00
Elle Mouton
81c54611c1 graph/db+sqldb: use batch fetching during channel&policy migration
Restructue the `migrateChannelsAndPolicies` function so that it does the
validation of migrated channels and policies in batches. So instead of
fetching channel and its policies individually after migrating it, we
wait for a minimum batch size to be reached and then validate a batch of
them together. This lets us make way fewer DB round trips.
2025-08-14 08:00:06 +02:00
Elle Mouton
03ef2740a6 graph/db+sqldb: use batch validation for node migration
Restructue the `migrateNodes` function so that it does the validation of
migrated nodes in batches. So instead of fetching each node individually
after migrating it, we wait for a minimum batch size to be reached and
then validate a batch of nodes together. This lets us make way fewer DB
round trips.
2025-08-14 08:00:06 +02:00
Elle Mouton
218aa9eaa8 graph/db: move sanity check out of insertChannel
We do this so that this lookup is only done in the situation it is
actually needed. During a migration, we dont need to special case this
AlreadyExists error since we will terminate the transaction either way.
So there is no need for the extra lookup during the migration.

A timing analysis showed that this query was significantly impacting the
performance of the migration when run with a postgres backend.
2025-08-14 07:57:33 +02:00
Elle
5f3055944a Merge pull request #10148 from ellemouton/graphPerf10
graph/db+sqldb: different defaults for SQLite and Postgres query options
2025-08-14 07:56:28 +02:00
Elle Mouton
b1deddec44 multi: remove DefaultQueryConfig
And always make use of either the new DefaultSQLiteConfig or
DefaultPostgresConfig.
2025-08-13 14:43:31 +02:00
Elle Mouton
1082eaaeb3 graph/db: fix progress logs 2025-08-13 14:43:31 +02:00
Elle Mouton
6a31e06817 graph/db+sqldb: find best default query cfg values for sqlite & postgres
This commit adds a BenchmarkFindOptimalSQLQueryConfig test in the
graph/db package which runs ForEachNode and ForEachChannel queries
against a local backend using various different values for the sql
QueryConfig struct. This is done to determine good default values to
use for the config options for sqlite vs postgres.
2025-08-13 14:43:31 +02:00
Elle Mouton
185166b8d3 sqldb+config: validate maximum batch size config value
Now that the SQL query config values are configurable, we add some
validation to make sure that the user doesnt set a max batch size that
is larger than the limits for sqlite/postgres that have been determined
by the TestSQLSliceQueries test.
2025-08-13 14:43:31 +02:00
Elle Mouton
ee292786b1 config+sqldb: make native SQL query config options configurable
Here, we make the sql query option params (batch size and pagination
size) configurable. The defaults for SQLite vs Postgres are still the
same but will be changed in an upcoming commit.
2025-08-13 14:43:31 +02:00
Yong
c6a9116e3a Merge pull request #9844 from ziggie1984/refactor-payments-code-03
Refactor Payment PR 3
2025-08-13 06:05:01 -04:00
Elle Mouton
75691163a9 graph: remove outdated TODO
This todo has been addressed.
2025-08-13 08:45:52 +02:00