Commit Graph

19653 Commits

Author SHA1 Message Date
Yong
84b2c20ea0 Merge pull request #10167 from starius/go124
multi: bump Go to 1.24.6
2025-09-01 20:03:54 +08:00
Elle
cd6971ea17 Merge pull request #10161 from ellemouton/graphRetry
graph/db+sqldb: Make the SQL migration retry-safe/idempotent
2025-09-01 08:23:38 +01:00
Elle Mouton
ce1df9da34 graph/db: let the rapid migration test also tests idempotency 2025-09-01 08:08:00 +02:00
Elle Mouton
f2ed5564ef graph/db+sqldb: improve performance of chan update sql migration
This commit simplifies insertChanEdgePolicyMig. Much of the logic can be
removed given that this method is only used in the context of the graph
SQL migration.

This should improve the performance of the migration quite a lot since
it removes the extra GetChannelAndNodesBySCID call.
2025-09-01 08:07:57 +02:00
Elle Mouton
22bf88e900 graph/db+sqldb: make policy migration idempotent
Finally, we make the channel-policy part of the SQL migration idempotent
by adding a migration-only policy insert query which will not error out
if the policy already exists and does not have a timestamp that is newer
than the existing records timestamp. To keep the commit simple, a
insertChanEdgePolicyMig function is added which is basically identical
to the updateChanEdgePolicy function except for the fact that it uses
the newly added query. In the next commit, it will be simplified even
more.
2025-09-01 08:06:12 +02:00
Elle Mouton
8736fcafa8 graph/db+sqldb: make channel SQL mig retry-safe
In this commit, we make the channel part of the graph SQL migration
idempotent (retry-safe!). We do this by adding a migration-only channel
insert query that will not error out if a the query is called and a
chanenl with the given scid&version already exists. We also ensure that
errors are not thrown if existing channel features & extra types are
re-added.
2025-09-01 08:05:21 +02:00
Elle Mouton
a291d6f1a6 graph/db+sqldb: improve efficiency of node migration
There is no need to use the "collect-then-update" pattern for node
insertion during the SQL migration since if we do have any previously
persisted data for the node and happen to re-run the insertion for that
node, the data will be exactly the same. So we can make use of "On
conflict, no nothing" here too.
2025-09-01 08:02:38 +02:00
Elle Mouton
ddea6d59ce graph/db+sqldb: make node migration idempotent
In this commit, the graph SQL migration is updated so that the node
migration step is retry-safe. This is done by using migration specific
logic & queries that do not use the same node-update-constraint as the
normal node upsert logic. For normal "run-time" logic, we always expect
a node update to have a newer timestamp than any previously stored one.
But for the migration, we will only ever be dealing with a single
announcement for a given node & to make things retry-safe, we dont want
the query to error if we re-insert the exact same node.
2025-09-01 07:56:34 +02:00
Elle Mouton
2c8ac0c92c graph/db: thread through reset call-backs
In preparation for handling retries on the source DB side, we thread
through the `reset` call-backs properly so that we can reset appropriate
variables.
2025-09-01 07:56:09 +02:00
Elle Mouton
aefc9118a4 graph/db: migration test for channels with no policies
In preparation for making the channel & policy migration logic
idempotent in a step-by-step manner, we add a test here that only tests
the migration of channels _without_ policies so that we can first focus
on just making the channel migration idempotent.
2025-09-01 07:56:09 +02:00
Elle Mouton
68e4970fbb graph/db: let migration test test retry safety
Currently, the graph SQL migration is not retry safe. Meaning that if
the source DB exeutes a retry under the hood, this could result in the
migration failing. In preparation for fixing this, we adust the
migration test accordingly.
2025-09-01 07:56:09 +02:00
Elle Mouton
9019bcaddf graph/db: let test policy have some extra opaque data
This will help us test idempotency later on, but it also ensures that
TestMigrateGraphToSQL is properly testing writes to the
graph_channel_policy_extra_types table.
2025-09-01 07:56:08 +02:00
Boris Nagaev
c86826ac5b lntest: fix error check in shutdownAllNodes
Previously the test failed only if the last node failed to shutdown. The code
was updated to fail if any node failed to shutdown.
2025-08-30 14:13:44 -03:00
Boris Nagaev
630108b13d multi: golang.org/x/net/context -> context 2025-08-30 14:13:44 -03:00
Boris Nagaev
dee8ad3754 multi: context.Background() -> t.Context()
Use the new feature of Go 1.24, fix linter warnings.

This change was produced by:
 - running golangci-lint run --fix
 - sed 's/context.Background/t.Context/' -i `git grep -l context.Background | grep test.go`
 - manually fixing broken tests
 - itest, lntest: use ht.Context() where ht or hn is available
 - in HarnessNode.Stop() we keep using context.Background(), because it is
   called from a cleanup handler in which t.Context() is canceled already.
2025-08-30 14:13:44 -03:00
Boris Nagaev
6ffe257004 multi: bump Go to 1.24.6 2025-08-30 14:13:44 -03:00
Boris Nagaev
612ad7da27 multi: fix non-constant input of fmt.Errorf
Fixed multiple cases in which a non-constact string variable was used as a
format string for fmt.Errorf.
2025-08-30 14:13:44 -03:00
Boris Nagaev
f3d52ba7a8 htlcswitch: don't pass err.Error() to failf
It resulted in interpreting the error message as a format string.
Use failf("%v", err) instead.
2025-08-30 14:13:44 -03:00
Boris Nagaev
2a599bedc0 multi: don't pass err.Error() to Fatalf
It resulted in interpreting the error message as a format string.
Use Fatal(err) instead.
2025-08-30 14:13:44 -03:00
Boris Nagaev
66c7e72c0d tor: fix go vet error in Go 1.24
non-constant format string in call to (*net/textproto.Conn).Cmd
2025-08-30 14:13:44 -03:00
Boris Nagaev
8533585d0b docs/INSTALL: remove trailing spaces 2025-08-20 16:04:30 -03:00
Boris Nagaev
ba5f3c0485 tools: fix building golangci-lint on Arm64
If CGO is enabled, Go tries to use the gold linker (-fuse-ld=gold), which is
not installed. CGO was disabled, because it is not needed for golangci-lint.
2025-08-20 16:04:30 -03:00
Yong
0c2f045f5d Merge pull request #10102 from yyforyongyu/fix-UpdatesInHorizon
Catch bad gossip peer and fix `UpdatesInHorizon`
2025-08-20 22:35:31 +08:00
Yong
8f489d0f12 Merge pull request #10153 from ziggie1984/refactor-payments-code-05
Refactor Payment PR 5
2025-08-20 21:18:04 +08:00
ziggie
bf6131ba02 routing: Add comment to DeleteFailedAttempts func call 2025-08-20 09:08:19 +02:00
ziggie
039b5994f3 routing: add more comments to the ControlTower interface 2025-08-20 09:08:19 +02:00
ziggie
b16782caeb multi: move DBMPPayment to paymentsdb package 2025-08-20 09:08:19 +02:00
ziggie
9ac93e75ac paymentsdb: fix linter 2025-08-20 09:08:18 +02:00
ziggie
f87841d638 paymentsdb: declare helper functions and add comments 2025-08-20 09:07:53 +02:00
ziggie
82242f5342 multi: rename KVPaymentDB to KVStore
This matches the same naming as used in the graph package.
2025-08-20 09:07:53 +02:00
ziggie
6abd539a2d paymentsdb: add missing function comments 2025-08-20 09:07:53 +02:00
ziggie
8245e356e5 paymentsdb: move serialization methods to kv_store file 2025-08-20 09:07:53 +02:00
ziggie
7423bfece9 paymentsdb: rename assertPaymentstatus 2025-08-20 09:07:53 +02:00
ziggie
a1fc8a3eee paymentsdb: rename db agnostic tests to highlight their behaviour 2025-08-20 09:07:52 +02:00
ziggie
68a8cf199d paymentsdb: rename assertPayments 2025-08-20 09:07:52 +02:00
ziggie
8726ba3d7c paymentsdb: move more tests
we make the index assertion db independant so it is a noop for
a future native sql backend. This allows us to reuse even more
tests for the different db architectures.
2025-08-20 09:07:52 +02:00
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
Oliver Gugger
e259456585 Merge pull request #10168 from ziggie1984/move-pgp-check-to-daily
move pgp check to daily builds
2025-08-19 05:34:43 -06:00
ziggie
1fb284fa26 github actions: move pgp key to daily builds 2025-08-19 08:35:42 +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