Commit Graph

977 Commits

Author SHA1 Message Date
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
Elle Mouton
b8abe130a5 multi: rename lnwire.NodeAnnouncement
In preparation for adding a NodeAnnouncement2 struct along with a
NodeAnnouncement interface, this commit renames the existing
NodeAnnouncment struct to NodeAnnouncement1.
2025-10-01 13:13:32 +02:00
Yong
f293566849 Merge pull request #10235 from Abdulkbk/fix-externalip-retention-issue
lnd: fix externalip retention issue
2025-09-25 14:23:51 +08:00
Abdullahi Yunus
cf287e9693 lnd: use persisted addrs if not set in config 2025-09-24 10:51:19 +01:00
Abdullahi Yunus
783c887824 lnd: stop using prev persisted addresses
In this commit we stop using persisted address in LND's prev run.
This means addresses set using `externalip` will be used without
merging them with the ones from prev run. We will introduce the
condition to use persisted addresses in the next commit.
2025-09-24 10:51:19 +01:00
George Tsagkarelis
a58a52ee35 funding: notify aux negotiator on ChannelReady
We notify the aux channel negotiator that an established channel is now
ready to use.
2025-09-23 19:05:47 +02:00
George Tsagkarelis
6dff1bd5de htlcswitch+peer: set and read aux custom records
This is the final step, we actually call the interface and either
provide or retrieve the custom features over the message. We also notify
the aux components when channel reestablish is received.
2025-09-23 19:05:46 +02:00
Elle
055fb436e1 Merge pull request #9175 from ellemouton/g175UpdateMessageStructure
lnwire+netann: update structure of g175 messages to be pure TLV
2025-09-22 10:04:44 +02:00
Elle Mouton
cd3bd05810 multi: rename FetchLightningNode
to FetchNode
2025-09-03 10:14:35 +02:00
Elle Mouton
c663a557c4 multi: rename models.LightningNode to models.Node 2025-09-03 10:14:35 +02:00
yyforyongyu
5bc4666efc multi: add new config peer-msg-rate-bytes 2025-09-02 21:23:07 +08:00
Elle Mouton
d68d1fb355 netann: update ChanAnn2 validation to work for P2WSH channels
This commit expands the ChannelAnnouncement2 validation for the case
where it is announcing a P2WSH channel.
2025-09-01 12:10:31 +02: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
ziggie
9f824fe1ee multi: introduce interface for payment database 2025-08-20 09:07:48 +02: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
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
Jared Tobin
5688935354 server: don't mention aux stuff in error [skip ci]
This error is returned when one attempts to use taproot overlay channels
without the necessary auxiliary funding controller being supplied. In
practice, when running lnd via litd, the latter will always supply
'tapd' as the aux funding controller, but a standalone lnd has no
knowledge of that.

The previous message sort of reads like the lnd user has forgotten to
set some available option or flag, but nothing or the sort actually
exists. The update makes it clearer that the feature isn't available in
the standalone build.
2025-08-08 16:10:53 -02:30
Yong
21726f0179 Merge pull request #9826 from ziggie1984/refactor-payments-code-02
Refactor Payment PR 2
2025-08-04 17:01:30 +08:00
yyforyongyu
a6f8617e7c multi: add new config ban-threshold 2025-08-04 15:45:47 +08:00
ziggie
e120110470 lnd: introduce separate key-value payment db
We also addd this new db on the server level to use it in the
following commit to do all the payment related queries of the
rpcserver.
We add a new payment db instance on the server level. Which we
will you for the payment related queries in a following commit.
2025-08-02 13:21:48 +02:00
ziggie
2d07d44d1a channeldb: rename PaymentControl struct
In the following commits we will gradually unify the current
payment db operations into an interface to later down the road
support both backends (sql+kv).
2025-08-02 11:24:59 +02:00
Olaoluwa Osuntokun
7f16b24192 multi: wire up gossip filter concurrency config
In this commit, we complete the integration of the configurable gossip
filter concurrency by wiring the new FilterConcurrency configuration
through all layers of the application.

The changes connect the gossip.filter-concurrency configuration option
from the command-line interface through the server initialization code
to the gossiper and sync manager. This ensures that operators can
actually use the new configuration option to tune their node's
concurrent gossip filter processing capacity based on their specific
requirements and available resources.
2025-08-01 11:20:21 -05:00
Elle Mouton
c32bf642d2 multi: pass reset to ForEachNodeCached 2025-07-15 11:23:27 +02:00
Elle Mouton
e5fbca8299 multi: let ForEachNodeChannel take a reset param 2025-07-15 11:23:27 +02:00
Elle Mouton
16126d7703 graph/db: expose reset in ForEachSourceNodeChannel 2025-07-15 11:23:27 +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
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
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
yyforyongyu
d44b480977 lnd: fix notifying peer online event too early
We need to notify the peer is online only when it has been started
successfully.
2025-07-04 04:19:59 +08:00
yyforyongyu
127b0e9f41 multi: add new config QuiescenceTimeout
This commit makes removes the `defaultQuiescenceTimeout` and makes it
configurable as different nodes have different network environment. In
addition the default timeout has been increased from 30s to 60s.
2025-07-04 04:19:59 +08:00
Oliver Gugger
538723e33b Merge pull request #10016 from ellemouton/fixAccessManLogging
accessman: Fix pub key formatting in logs
2025-07-01 19:49:26 +02:00
Elle Mouton
37d6390642 discovery: use a no-op hash accumluator for local networks
If LND is running on a local network, then use deterministic sampling so
that we can have deterministic peer bootstrapping.
2025-07-01 11:27:18 +02:00
Elle Mouton
bca6c0d115 server: use IsLocalNetwork check for DNS bootstrapper decision
It should be ok to use IsLocalNetwork here since the
chainreg.ChainDNSSeeds map does not have an entry for either simnet or
regtest.
2025-07-01 11:24:39 +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 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
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
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
38862d3b91 server: remove shouldPeerBootstrap
We already set `nobootstrap` in the default node flags for itest nodes,
so we can remove this check now. This will allow us to later test
bootstrapping in an itest. NOTE that with this change, any
signet/simnet/regtest network users will now need to explicitly add the
`--nobootstrap` flag if they want to prevent automatic bootstrapping.
This warning is added to the release notes later on.
2025-06-24 12:48:00 +02:00
Olaoluwa Osuntokun
faa68a220e Merge pull request #9880 from yyforyongyu/accessman
Improve access control in peer connections
2025-06-20 15:26:24 -07:00
Elle Mouton
91513623b5 routing: remove a context.TODO() 2025-06-19 14:49:32 +02:00
Elle Mouton
3fdb9b84f4 graph/db: thread context to AddChannelEdge 2025-06-19 14:47:41 +02:00
Elle Mouton
7ba4051cfd graph/db: thread context through to SourceNode 2025-06-19 14:47:41 +02:00
Elle Mouton
65049ddd02 graph/db: thread context through to SetSourceNode 2025-06-19 14:47:40 +02:00
yyforyongyu
250a61af6d lnd: remove peer from peerChanInfo when necessary
We now remove the peer from `peerChanInfo` if this peer doesn't have
channels with us. Also patched a unit test for `removePeerAccess`.
2025-06-19 20:23:46 +08:00
yyforyongyu
03de0f9e4b funding+lnd: make sure accessman won't interrupt funding flow
If there's an error occured when updating the peer's status after the
channel status is changed, we now make sure we log the error instead of
letting it interrupt the channel open/close flow.
2025-06-19 16:05:59 +08:00