Commit Graph

19587 Commits

Author SHA1 Message Date
Elle Mouton
03ede9ccef graph/db: migrate prune log
This commit expands the `MigrateGraphToSQL` to include migration of the
prune log.
2025-07-11 09:15:47 +02:00
Oliver Gugger
63609b0801 Merge pull request #10061 from yyforyongyu/fix-listsweep-itest
itest+lntest: fix flake in `testListSweeps`
2025-07-11 00:25:48 -06:00
yyforyongyu
18916daa0c docs: update release notes 2025-07-11 04:11:31 +03:00
yyforyongyu
7a9f197de8 lnwire: simplify dyn decode methods
Remove the unnecessary convertions as suggested by Gemini.
2025-07-11 04:11:31 +03:00
yyforyongyu
91797ad1d2 lnwire: patch test and fix extra data in DynCommit 2025-07-11 04:11:31 +03:00
yyforyongyu
e6ab37305c lnwire: add missing record LocalNonce
This record was never added to the `DynCommit`, but it's inherited from
the embedding msg `DynAck`.
2025-07-11 04:11:30 +03:00
yyforyongyu
f39c3679f2 lnwire: make LocalNonce an optional tlv record and fix extra data
It should be an optional record instead of an fn option. In addition,
its tlv type is bumped to be 14 as this record is also included in the
`DynCommit`. If we use tlv type 0, it will create a conflict in the msg
`DynCommit`, which is fixed in the following commit.
2025-07-11 04:11:30 +03:00
yyforyongyu
b7d2f68ed0 lnwire: patch uint test for DynAck 2025-07-11 04:11:30 +03:00
yyforyongyu
5961f7a1bd lnwire: add method ParseAndExtractExtraData
Similar to `ParseAndExtractCustomRecords`, we now add this helper method
to make sure the extra data is parsed correctly.
2025-07-11 04:11:30 +03:00
yyforyongyu
e94ca84449 lnwire: fix encoding of MilliSatoshi
`MilliSatoshi` itself is already a `BigSize`, we just need to change the
decoding and encoding types to use that.
2025-07-11 04:11:29 +03:00
yyforyongyu
5e9365552c lnwire: fix encoding ExtraData in DynPropose
Previously we encode all the fields plus extra data to the field
`ExtraData`, this is now fixed by encoding only unknown data to extra
data. For known records, they are already encoded into the message
fields.
2025-07-11 04:11:29 +03:00
yyforyongyu
61ef83e9c2 lnwire: patch unit test for DynPropose 2025-07-11 04:09:11 +03:00
yyforyongyu
0f1cb54eb2 lnwire: use BigSize for encoding btc amount 2025-07-11 04:09:11 +03:00
Oliver Gugger
04a2be29d2 Merge pull request #10066 from ellemouton/graphFixMergeIssue
graph/db: fix sql test compilation
2025-07-10 08:08:42 -06:00
Elle Mouton
36f8a66b5a graph/db: remove temporary test skip
The skip is no longer needed.
2025-07-10 14:54:04 +02:00
Elle Mouton
b7d4f80e3e graph/db: pass in ctx to test method
Fix compilation error.
2025-07-10 14:53:10 +02:00
Oliver Gugger
8ee661f18f Merge pull request #10043 from ellemouton/ctx3
multi: add context.Context param to more graphdb.V1Store methods
2025-07-10 13:40:51 +02:00
Torkel Rogstad
ed7b056ced docs: update release notes 2025-07-10 11:36:20 +02:00
Torkel Rogstad
c8b04d03f5 itest+lntest: add grpc NotFound error code test 2025-07-10 11:36:20 +02:00
Elle Mouton
23c3aaac6a rpcserver: catch extra err case in LookupInvoice
For a kvdb backed invoices DB, we sometimes will return the
ErrNoInviocesCreated error if no invoices have ever been created on the
node. In these cases we should still wrap the returned error in the grpc
NotFound code.
2025-07-10 11:21:37 +02:00
Torkel Rogstad
7a52b6ca5e rpcserver: return consistent grpc NotFound error for GetChaninfo
So that we can properly convert this NotFound error back to our
`graphdb.ErrEdgeNotFound` error if we are making this call to another
node via RPC.
2025-07-10 11:21:31 +02:00
Olaoluwa Osuntokun
4fef0f4d7a Merge pull request #10001 from yyforyongyu/finalize-stfu
Enable quiescence in production and add timeout config
2025-07-09 19:01:48 -07:00
Abdullahi Yunus
3c759ef081 fn: remove flaky test
In this commit, we remove TestPropForEachConcOutperformsMapWhenExpensive
as it's flaky and causes the CI to fail. The previous commit intro-
duced a replacement, which benchmarked the functions.
2025-07-09 21:21:45 +01:00
Abdullahi Yunus
36dfed1cba fn: add benchmark for Map and ForEachConc fns 2025-07-09 21:21:45 +01:00
yyforyongyu
52d963bae0 itest+lntest: fix flake in testListSweeps
We now make sure we assert the `ListSweeps` results in a wait closure.
2025-07-09 20:52:02 +03:00
Oliver Gugger
0e830da9d9 Merge pull request #10058 from ellemouton/fix/rpc-graph-cache-race
rpcserver: fix race condition in graph cache eviction
2025-07-09 17:09:38 +02:00
Oliver Gugger
10209b9301 Merge pull request #10059 from ellemouton/geminiStyle
.gemini: add styleguide.md
2025-07-09 17:08:46 +02:00
Elle Mouton
b62793ada8 .gemini: add styleguide.md
Add a styleguide for gemini derived from docs/development_guidelines.md.
2025-07-09 16:22:32 +02:00
Oliver Gugger
ea32aac770 Merge pull request #10050 from ellemouton/graphMig2-channels
[graph mig 2]: graph/db: migrate graph channels and policies from kvdb to SQL
2025-07-09 13:09:27 +02:00
Elle Mouton
ef181adbc8 rpcserver: fix race condition in graph cache eviction
The previous implementation of the graph cache evictor used
time.AfterFunc, which introduced a race condition. The closure
passed to AfterFunc could execute before the call returned and
assigned the timer to the r.graphCacheEvictor field.

This created a scenario where the closure would attempt to call
Reset() on a nil r.graphCacheEvictor, causing a panic.

This commit fixes the race by replacing time.AfterFunc with a
more robust pattern using time.NewTimer and a dedicated goroutine.
The new timer is created and assigned immediately, ensuring that
r.graphCacheEvictor is never nil when accessed.

The dedicated goroutine now safely manages the timer's lifecycle,
resetting it upon firing and stopping it gracefully upon server
shutdown, which also prevents goroutine leaks.
2025-07-09 11:56:09 +02:00
Elle Mouton
640caeff39 docs: add release notes entry 2025-07-09 10:18:57 +02:00
Elle Mouton
b58089049a graph/db: migrate channels and polices to SQL
In this commit, the `MigrateGraphToSQL` function is expanded to migrate
the channel and channe policy data. Both of these have the special case
where the kvdb store records may contain invalid TLV. If we encounter a
channel with invalid TLV, we skip it and its policies. If we encounter a
policy with invalid TLV, we skip it.

The `TestMigrateGraphToSQL` and `TestMigrationWithChannelDB` tests are
updated accordingly.
2025-07-09 10:18:57 +02:00
Olaoluwa Osuntokun
fb68f36acb Merge pull request #10048 from ziggie1984/fix-utxonursery-encoding
contractcourt: fix encoding
2025-07-08 16:55:40 -07:00
Olaoluwa Osuntokun
d40ac4564b Merge pull request #10044 from ziggie1984/fix-shutdown-issue
Fix Shutdown deadlock in some scenarios
2025-07-08 16:53:30 -07:00
ziggie
354585e9dc docs: add release-notes 2025-07-08 20:10:31 +02:00
ziggie
7a363ee17f chanbackup: fix shutdown issue when backuper has not started yet 2025-07-08 20:10:31 +02:00
Oliver Gugger
47dce08948 Merge pull request #10018 from yyforyongyu/minor-refactor-link
Refactor link's long methods
2025-07-08 19:51:04 +02:00
ziggie
9bff22864e docs: add release notes 2025-07-08 19:16:28 +02:00
ziggie
1b675273fe contractcourt: fix encoding 2025-07-08 19:16:28 +02:00
Oliver Gugger
df1a15f0f1 Merge pull request #10041 from ziggie1984/fix-fwd-pkg-garbage-collection
channeldb: gc fwd packgages which have zero ADDs
2025-07-08 18:30:47 +02:00
Elle Mouton
793c1057bb graph: remove one context.TODO
By threading a context through to the Builder's ForAllOutgoingChannels
method.
2025-07-08 15:11:02 +02:00
Elle Mouton
3d5e852c8c graph/db: let ForEachNodeCached take a context 2025-07-08 15:11:02 +02:00
Elle Mouton
1e804a3d5f graph/db: let ForEachNode take a context 2025-07-08 15:11:02 +02:00
Elle Mouton
f05ef2db97 graph/db: let ForEachNodeCacheable take a context 2025-07-08 15:10:30 +02:00
Elle Mouton
85fda8b926 routing+server: let ForAllOutgoingChannels take a context
And so, remove a previously added context.TODO
2025-07-08 15:10:30 +02:00
Elle Mouton
046e106a17 graph/db: let ForEachChannel take a context 2025-07-08 15:10:30 +02:00
Elle Mouton
f8d3a3f3ba graph/db: let ForEachNodeChannel take a context 2025-07-08 15:10:30 +02:00
Elle Mouton
67c0f54e13 graph/db+server: let ForEachSourceNodeChannel take a context 2025-07-08 15:10:30 +02:00
Elle Mouton
792970e50c server: create call-back helper forEachSrcNodeChan
We do this so that in an upcoming commit, we can expand the param list
of the call-back without adding another indent to the call-back code.
2025-07-08 15:10:30 +02:00
Elle Mouton
6295211d1a server: use errors.Is for error comparison 2025-07-08 15:10:29 +02:00