Commit graph

19888 commits

Author SHA1 Message Date
Gijs van Dam
cb2d8abe40
lnwire: add onion message type
This message type is a message that carries an onion-encrypted payload
used for BOLT12 messages.
2025-11-12 22:54:03 +08:00
ziggie
c08f918ffc
paymentsdb: make verifyAttempt more robust
We now return an error when blinded and non blinded attempts are
combined. This was theoretically possible to register a legacy
attempt in combination with a blinded payment. This would have
been prevented by other checks in the code because legacy payments
are not split into shards.
2025-11-12 22:54:03 +08:00
ziggie
cbfc0e0dc2
mulit: don't set customData on the lnrpc route level
We now make sure we only set the custom channel data in the
lnrpc.Route only if it contains relevant data.
2025-11-12 22:54:03 +08:00
Elle Mouton
f35c295bd8
discovery: let reject cache use gossip version in key
Since the gossip protocols are completely disjoint, we need to treat
messages on the two protocols completely separately and should not let
rejections on one protocol affect how we treat messages on the other.
2025-11-12 22:54:03 +08:00
Elle Mouton
b57714b00c
graph/db: use lnwire.GossipVersion instead of ProtocolVersion 2025-11-12 22:54:03 +08:00
Elle Mouton
ef0e6b78bb
lnwire: let gossip messages implement GossipMessage 2025-11-12 22:54:03 +08:00
Elle Mouton
4d3bf6379a
lnwire: define GossipVersion and GossipMessage
Define a GossipVersion enum along with a GossipMessage interface to be
satisfied by all gossip related messages. This will be useful later on
when we want to make decisions based on the protocol version that a
message is part of.
2025-11-12 22:54:02 +08:00
Elle Mouton
70054ac402
lnwire: add NodeAnnouncement interface
And ensure that both versions 1 and 2 implement it.
2025-11-12 22:54:02 +08:00
ziggie
6cc7a88e99
makefile: add linter config check 2025-11-12 22:54:02 +08:00
ziggie
c324922a47
CI: remove unnecessary custom-gcl.yml file
The custom file is only needed in the tools directory.
2025-11-12 22:54:02 +08:00
ziggie
b6dd3a32f7
CI: also use go tool for gosimports 2025-11-12 22:54:02 +08:00
ziggie
d2d56f2968
linter: remove unsupported linters from the codebase 2025-11-12 22:54:02 +08:00
ziggie
13e7a6e782
tools: update golangci-lint to v2
The config file format changed. The tool golangci-lint migrate
was used to migrate the old config. However old comments and also
the structure of the disabled linters was preserved.

Moreover the new v2 version introduced new linters, we disable
3 of them because they are very noise and we do not really want
to check for them: funcorder, noinlineerr, embeddedstructfieldcheck.
2025-11-12 22:54:01 +08:00
ziggie
f9dccd3e20
tools: use new golang 1.24 tool directive 2025-11-12 22:54:01 +08:00
Yong
04917644ff
Merge pull request #10361 from Roasbeef/master-v-20-99
build: bump master version to v0.20.99
2025-11-12 22:52:04 +08:00
Yong
93ca7eda03
Merge pull request #10362 from Roasbeef/security-key-update-2025
security: update security@ PGP key
2025-11-12 22:37:12 +08:00
Olaoluwa Osuntokun
7e7bf59133
security: update security@ PGP key
The key was renewed, but the gist linked in the repo wasn't updated.
2025-11-11 14:44:50 -08:00
Olaoluwa Osuntokun
2cd17e3d2f
build: bump master version to v0.20.99
This reflects the fact that master is beyond the last major release and
will be a super set of anything in the v0.20.x series.
2025-11-11 14:41:48 -08:00
Olaoluwa Osuntokun
604dbdadd2
Merge pull request #10359 from Roasbeef/release-doc
docs: create new document describing proposed release/branch management
2025-11-11 14:39:58 -08:00
Olaoluwa Osuntokun
b9ea7070c2
Merge pull request #10358 from Roasbeef/v0.20.x-branch
build: bump version to v0.20.0
2025-11-11 14:36:48 -08:00
Olaoluwa Osuntokun
113aaf1607
docs: create new document describing proposed release/branch management
In this PR, we aim to create a central document that describes how we
want to drive the release process, as well as branch management going
forward.
2025-11-11 12:42:27 -08:00
Olaoluwa Osuntokun
83668fd910
build: bump version to v0.20.0 2025-11-10 15:33:25 -08:00
Yong
096ab65b1d
Merge pull request #10350 from saubyk/update-pgp-key-suheb
Updated expired PGP key for Suheb
2025-11-06 20:56:04 +08:00
Yong
b63a6a0c09
Merge pull request #10349 from ziggie1984/ci/enhance-expiration-date-key
refresh signing PGP key ziggie1984 - expiring at the end of november
2025-11-06 20:37:52 +08:00
saubyk
49e75a6e8b
keys:updated the expired key for Suheb 2025-11-05 18:35:31 -08:00
Norbert
b669494a23 keys: increase expiry of signing key
The key did not change just the meta data.
2025-11-06 01:29:34 +01:00
Olaoluwa Osuntokun
aeac3380ac
Merge pull request #10345 from Roasbeef/v7-rc4
build: bump version to v0.20.0-beta rc4
2025-11-05 12:25:53 -08:00
Olaoluwa Osuntokun
2ddb630a95
build: bump version to v0.7.0 rc4 2025-11-04 14:43:12 -08:00
Olaoluwa Osuntokun
4131a8e586
Merge pull request #10330 from Roasbeef/fix-error-handling-gossiper
discovery: fix potential infinite loop bug re context cancel error handling in gossip syncer
2025-11-03 11:57:51 -08:00
Olaoluwa Osuntokun
adaa893f22
docs: add release notes entry 2025-11-03 10:44:14 -08:00
Olaoluwa Osuntokun
b8ca876409
discovery/test: add comprehensive tests for state handler error exits
Add comprehensive test coverage to verify that state handler errors cause
the channelGraphSyncer goroutine to exit cleanly without entering endless
retry loops. These tests use mutation testing principles to ensure they
would fail if the fixes were removed.

TestGossipSyncerStateHandlerErrors is a table-driven test covering four
scenarios: context cancellation and peer disconnect during syncingChans
state, and context cancellation and network errors during queryNewChannels
state. Each test case verifies both attempt count (no endless loop) and
clean shutdown (no deadlock).

TestGossipSyncerProcessChanRangeReplyError verifies that errors from
processChanRangeReply in the waitingQueryRangeReply state cause clean
exit. This test sends multiple malformed messages and checks that only
the first is processed before the goroutine exits, using channel queue
depth to detect if the goroutine is still running.

All tests are race-detector clean and use mutation testing validation:
removing any of the error return statements causes the corresponding
tests to fail, confirming the tests properly verify the fixes.
2025-11-03 10:44:13 -08:00
Olaoluwa Osuntokun
06c7d60452
discovery: fix endless loop in gossip syncer on context cancellation
This commit fixes a critical bug where the channelGraphSyncer goroutine
would enter an endless loop when context cancellation or peer disconnect
errors occurred during the syncingChans or queryNewChannels states.

The root cause was that state handler functions (handleSyncingChans and
synchronizeChanIDs) did not return errors to the main goroutine loop.
When these functions encountered fatal errors like context cancellation,
they would log the error and return early without changing the syncer's
state. This caused the main loop to immediately re-enter the same state
handler, encounter the same error, and loop indefinitely while spamming
error logs.

The fix makes error handling explicit by having state handlers return
errors. The main channelGraphSyncer loop now checks these errors and
exits cleanly when fatal errors occur. We return any error (not just
context cancellation) because fatal errors can manifest in multiple
forms: context.Canceled, ErrGossipSyncerExiting from the rate limiter,
lnpeer.ErrPeerExiting from Brontide, or network errors like connection
closed. This approach matches the error handling pattern already used in
other goroutines like replyHandler.
2025-11-03 10:44:12 -08:00
Yong
c7c80730d2
Merge pull request #10334 from ziggie1984/fix-decoding-extra-tlv-data
Don't fail on invalid extra tlv data when decoding a payment
2025-11-03 22:15:37 +08:00
ziggie
870d603ce5
multi: allow invalid tlv data when decoding payment fail info
Older payments might have a invalid tlv stream, we now catch this
case and add a unit test.
2025-11-03 12:54:29 +01:00
Olaoluwa Osuntokun
f938e40afe
Merge pull request #10324 from Roasbeef/v-20-branch-rc3
build: bump version to v0.20 rc3
2025-10-28 16:51:30 -07:00
Yong
9f5094c98e
Merge pull request #10315 from saubyk/db-migration-guide
docs: added a user guide for db migration
2025-10-29 00:49:08 +08:00
Yong
995a1e75cd
Merge pull request #10314 from AbelLykens/patch-2
[docs] Typo recovery.md
2025-10-28 18:31:55 +08:00
Olaoluwa Osuntokun
0ff9c2e67f
build: bump version to v0.20 rc3 2025-10-27 16:35:12 -07:00
saubyk
99745f3e60
docs: added a user guide for db migration 2025-10-27 11:55:07 -07:00
Olaoluwa Osuntokun
9a7b526c0c
Merge pull request #10268 from starius/release-gnu-gzip
release.sh: make sure GNU gzip is used
2025-10-27 10:34:30 -07:00
Yong
ead95de2ce
Merge pull request #10312 from saubyk/release-signing-doc-url-fix
docs: fix build instructions doc url
2025-10-27 18:09:47 +08:00
Olaoluwa Osuntokun
6a82c61f47
Merge pull request #10280 from mohamedawnallah/optimize-neutrino-rescan
rpcserver: resolve root cause of premature wallet rescanning
2025-10-23 19:33:21 +02:00
Mohamed Awnallah
f761dc4c7a docs: update release notes v0.20.0 2025-10-22 18:01:48 +00:00
Mohamed Awnallah
c6f458e478 lnd.go: sync headers before chain notifier startup to prevent premature rescan
This commit addresses a regression where Neutrino rescanning starts
from an outdated height (~100k blocks behind) instead of using the
current synced height.

Root Cause:
In commit 16a8b623b, the initialization order was changed so that
Chain Notifier starts before wallet syncing completes. This means
the rescan begins using the stale height from BuildChainControl
rather than the fully synced height.

Old behavior (commit 1dfb5a0c2):
1. RPC server starts
2. Headers sync as part of daemon server
3. Chain Notifier starts after sync completes
4. Rescan begins from current (synced) height

Current behavior (regression):
1. Chain Notifier starts in newServer (before RPC)
2. Wallet sync happens after RPC server starts
3. Rescan uses outdated height from BuildChainControl

Solution:
- Ensure headers are fully synced before starting the chain notifier,
and after starting the RPC server.
- Move chain notifier startup to its correct location after headers are
fully synced.
- Make sure the starting beat is lazily called after chain notifier
started and before that starting beat result is used.
2025-10-22 17:59:06 +00:00
Olaoluwa Osuntokun
1a30ac29e3
Merge pull request #10309 from starius/bump-go-and-mapstructure
build: update Go 1.25.3 / 1.24.9
2025-10-22 17:52:25 +01:00
Olaoluwa Osuntokun
9f611402e2
Merge pull request #10313 from Roasbeef/roasbeef-key-expiry-update
scripts/keys: update roasbeef keys with new expiry
2025-10-22 15:21:23 +01:00
AbelLykens
529ee2eff7
[docs] Typo recovery.md
`-multi_file` should be `--multi_file`
2025-10-22 13:30:58 +02:00
Olaoluwa Osuntokun
81ff01c9cc scripts/keys: update roasbeef keys with new expiry
My key recently expired, in this commit, we update the keys to the new
refreshed version. These are the same keys, but with an expiry further
out.

Here's a clear sign of the latest Bitcoin block hash:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

000000000000000000013215ef7c32bc0427f388fc83623affe712f388
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQQpYhJoGq3wVlaize6QUl997uCthgUCaPi6xwAKCRCQUl997uCt
hpqNAQC5VnnbO6h/PjywGhU4LLRvH8SdgdDEMSc7xrtWd1vgPgD+IDrHqiAb+h38
ORBnUVJCVuZrPebtdnYXVQhII91eaw4=
=WRbl
-----END PGP SIGNATURE-----
2025-10-22 12:07:38 +01:00
saubyk
5ef97632a7
docs: fix build instructions doc url
Signed-off-by: saubyk <39208279+saubyk@users.noreply.github.com>
2025-10-21 17:32:24 -07:00
Boris Nagaev
4fc8d8dda3
build: update CI+release version to Go 1.25.3
We also update the go.mod files to pin to Go 1.24.9.
2025-10-21 14:32:44 -03:00