Commit Graph

19302 Commits

Author SHA1 Message Date
Elle Mouton
e4137a3f14 graph/db: fix ChanUpdate message/channel flag bug
Here we start using the newly added message_flags and channel_flags
columns of the channel_policies table. The test added previoulsy to
demonstrate the bug is now updated to show that the bug has been fixed.
2025-07-01 10:12:54 +02:00
Elle Mouton
4a05e5a226 sqldb/sqlc: add message and channe flags to channel_policies table
We need to explicitly store the entire bitfield types since we may have
channel_updates with bitfields containing bits we just dont need or
understand but we still need to store the entire bitfield so that the
reconstructed announcement remains valid.

This commit only adds the new columns but does not use them yet. NOTE:
this is ok since the migration adding this schema is not available in
the production build yet.
2025-07-01 10:12:54 +02:00
Elle Mouton
90aacaae2a sqldb: add SQLInt16 helper 2025-07-01 10:12:53 +02:00
Elle Mouton
fa32f97c05 graph/db: unit test to demonstrate SQL chan policies bug
This commit adds a new graph store unit test that demonstrates that
there is currently a bug in the SQL version of the graph store where
unknown message or channel flags in a channel_update are not persisted
correctly. This will be fixed in an upcoming commit.
2025-07-01 10:12:53 +02:00
Elle Mouton
64fc92abe7 graph/db: update nextUpdateTime in tests
Let it return time.Time instead. Also, make use of the helper in a few
more places.
2025-07-01 10:04:03 +02:00
Elle
c7aa17971b Merge pull request #10006 from ellemouton/fixSQLFetchChannelEdgesByID
graph/db: let FetchChannelEdgesByID behave as promised
2025-07-01 10:01:36 +02:00
Oliver Gugger
31814a1198 Merge pull request #10014 from GustavoStingelin/issue-9583-missing-wt-cli-usage
cmd/wtclient: add usage info for session and terminate commands
2025-07-01 09:04:29 +02:00
Elle Mouton
3cb61bee95 server: make use of structured logging for peer connections 2025-07-01 08:03:19 +02:00
Elle Mouton
a1006d8372 accessman: fix structured logging formatting 2025-07-01 07:43:26 +02:00
Elle
8147bb69c0 Merge pull request #10009 from ellemouton/fixLogLinePanic
discovery: fix log line panic
2025-07-01 06:58:46 +02:00
Gustavo Stingelin Cardoso Filho
0324902ea8 cmd/wtclient: add usage info for session and terminate commands 2025-06-30 23:06:51 -03:00
Olaoluwa Osuntokun
7af4a18e3a CI: add config.yaml for gemini code review
So far, most of the AI code review tools I've seen in the wild have been
pretty lackluster. I figure we should give the new Gemini Code Assist
variant a try: https://github.com/marketplace/gemini-code-assist/.

This PR adds an initial yaml config for it.

Relevant commands (as comments on the OP PR):
  *  `/gemini review` to perform a code review
  *  `/gemini summary` provides a code summary
  * comment like normal tagging `@gemini-code-assist`
  * `/gemini help`
2025-06-30 16:08:46 -07:00
Elle Mouton
f1b7ccc6b2 sqldb+graph/db: prune graph nodes in a single query
Update the pruneGraphNodes routine to prune the graph nodes in a single
query instead of two.
2025-06-30 18:41:28 +02:00
Elle Mouton
714e528a3a graph/db: fix address fetching error 2025-06-30 18:40:25 +02:00
Elle Mouton
272a2db16c graph/db: demonstrate SQL node addresses fetch bug
This commit demonstrates that currently the Addresses field of a
LightningNode is not populated correctly if the node has no addresses if
the SQL graph store is being used. This will be fixed in an upcoming
commit.
2025-06-30 18:40:21 +02:00
Elle Mouton
73eca1bf3d graph/db: update outdated comment 2025-06-30 18:40:13 +02:00
Elle Mouton
25daf253c0 discovery: fix log line panic
If a method returns an error, we should assume all other parameters to
be nil unless the documentation explicitly says otherwise. So here, we
fix a log line where a dereference is made to an object that will be nil
due to an error being returned.
2025-06-30 18:27:56 +02:00
Oliver Gugger
e54206f8c2 Merge pull request #9990 from ziggie1984/follow-up-payment-addr-spec-update
itest coverage increase following the spec update regarding MPP payments
2025-06-30 15:45:14 +02:00
Oliver Gugger
01dfee6f8d Merge pull request #10004 from ellemouton/ensureNewNodeAnnUpdateTime
multi: use "errors" pkg everywhere and ensure newer node announcement timestamp
2025-06-30 14:40:22 +02:00
Elle
e8213dbc44 Merge pull request #9752 from erickcestari/reject-payment-without-invoice
routerrpc: reject payment to invoice that don't have payment secret or blinded paths
2025-06-30 13:11:36 +02:00
Elle Mouton
64110cf459 graph/db: let FetchChannelEdgesByID behave as promised
The comment of FetchChannelEdgesByID says that if the ErrZombieEdge
error is returned, then the ChannelEdgeInfo return parameter will also
still be populated and returned (ie, wont be nil). This commit updates
the SQLStore implementation of FetchChannelEdgesByID to do this. This is
needed to prevent nil dereference panics at any call-sites that depend
on the method working as it describes.
2025-06-30 11:04:35 +02:00
Elle Mouton
0862ba3f41 server: ensure newer node announcement timestamp
On startup, we currently blindly overwrite our node announcement info
for our source node. This includes overwriting the existing LastUpdate
timestamp. This can cause an issue with our new SQL backends in the case
that the new timestamp is not greater than the previously written
timestamp. So here, we first fetch the source node and make sure to use
a timestamp that is greater than the previosly set one.
2025-06-30 09:46:55 +02:00
Elle Mouton
8cf567b948 multi: use the "errors" package everywhere
Replace all usages of the "github.com/go-errors/errors" and
"github.com/pkg/errors" packages with the standard lib's "errors"
package. This ensures that error wrapping and `errors.Is` checks will
work as expected.
2025-06-30 09:46:55 +02:00
yyforyongyu
bef90c6a84 watchtower: fix logging and add comments 2025-06-27 19:01:33 +08:00
Oliver Gugger
6290edf146 Merge pull request #9996 from calvinrzachman/lseed
chainreg: use new lseed service
2025-06-27 12:31:28 +02:00
Oliver Gugger
e75c82e25a Merge pull request #9988 from starius/remove-used-proto-message
lnrpc: remove unused type ConfirmationUpdate
2025-06-26 17:15:18 +02:00
Oliver Gugger
5f961e4349 Merge pull request #9972 from ellemouton/graphSQL17-complete-unit-tests
[17] multi: run all graph unit tests against SQL backends & run itest suite against SQL graph backend
2025-06-26 12:40:42 +02:00
Elle Mouton
cc0be0bca2 graph/db: let IsZombieEdge return an error 2025-06-26 10:19:51 +02:00
Elle Mouton
e38aa6d1e0 multi: itest jobs with SQL graph backend
In this commit, a new `test_native_sql` build flag is defined. If this
build flag is used along with the `--use-native-sql` config option, then
the SQLStore implementation of the graphdb.V1Store will be initialised.
This is then used to run our itest suite against the new SQLStore graph
implementation.

NOTE that this only works for new nodes currently - the migration from
kv-to-sql is yet to be implemeneted.
2025-06-26 10:12:54 +02:00
Elle Mouton
b4b1c4bd8d graph/db: remove KVStore fall-back
Now that SQLStore fully implements V1Store, we no longer need the
KVStore fall-back.
2025-06-26 10:12:46 +02:00
Elle Mouton
3ccaacd16f multi: rename MakeTestGraphNew to MakeTestGraph 2025-06-26 10:12:30 +02:00
Elle Mouton
c06036d2b4 multi: use MakeTestGraphNew for all remaining unit tests
And delete the old MakeTestGraph function.

Here we need to update some of our unit tests to ensure that any updates
to existing nodes or channel policies have newer timestamps. This is so
that we don't violate our SQL DB constraints that prevent updates to a
node or channel policy record if the new update is not newer (has a
newer LastUpdate time) than the currently presisted record).
2025-06-26 10:12:27 +02:00
Elle Mouton
e0801f5a5d discovery: use errors.Is for error check
Ensure that the check works for wrapped errors. Otherwise, this breaks
for a SQLStore graph backend which wraps the error it returns.
2025-06-26 10:11:02 +02:00
Olaoluwa Osuntokun
3493b08785 Merge pull request #9978 from ziggie1984/fix-peer-connection
multi: fix deadlock in p2p race condition
2025-06-25 17:36:40 -07:00
Olaoluwa Osuntokun
5f00be2b8c Merge pull request #9148 from ProofOfKeags/lnwire-dyncomms-update
DynComms [2/n]: lnwire: add authenticated wire messages for Dyn*
2025-06-25 17:16:36 -07:00
Calvin Zachman
d9f06226fb docs: update release notes 2025-06-25 11:59:25 -04:00
Oliver Gugger
fb1fef9e6c Merge pull request #9971 from ellemouton/graphSQL16-closed-scids
[16] graph/db: SQL closed SCIDs table and last few methods
2025-06-25 17:32:49 +02:00
Calvin Zachman
7c911ec954 chainreg: use new lseed service
This points lnd at the new deployment of the lseed
service used to provide candidate peers during initial
network bootstrap.
2025-06-25 10:58:20 -04:00
Elle
1fcf112107 Merge pull request #9925 from ellemouton/rbIncomingFollowup
routing: clean-up & fix blinded path incoming chained channel logic
2025-06-25 16:30:40 +02:00
Oliver Gugger
53b249efc0 Merge pull request #9991 from ziggie1984/add-probe-logging
routerrpc: add log line for probing the invoice request
2025-06-25 14:49:51 +02:00
ziggie
d6b89b9e9e docs: add release-notes 2025-06-25 14:24:36 +02:00
ziggie
24e3958a0b lnd: improve code comment 2025-06-25 13:50:18 +02:00
ziggie
409561ac62 lnd: rename removePeer to removePeerUnsafe
rename `removePeer` to highlight that the mutex has to be acquired
before calling it.
2025-06-25 13:50:17 +02:00
ziggie
0151993b88 docs: add release-notes 2025-06-25 13:50:17 +02:00
ziggie
3329308bce multi: fix deadlock in p2p race condition
In case we cannot guarantee that the peers has started up
completely we launch the disconnect method asynchronously.
2025-06-25 13:50:17 +02:00
Elle Mouton
daf6a08747 graph/db: fix log precision 2025-06-25 13:26:53 +02:00
Elle Mouton
81ce05fced graph/db: start lastID for pagination at -1
Just to be very sure that we don't miss a valid ID.
2025-06-25 13:26:53 +02:00
Elle Mouton
23c8f7099c graph/db: impl ForEachChannelCacheable 2025-06-25 13:26:52 +02:00
Elle Mouton
34cb6a9f27 graph/db: impl GraphSession 2025-06-25 13:26:52 +02:00
Elle Mouton
933ab3c6b7 graph/db+sqldb: impl PutClosedScid and IsClosedScid 2025-06-25 13:26:52 +02:00