Commit Graph

18988 Commits

Author SHA1 Message Date
Elle Mouton
95d34be0d3 autopilot: revert passing ctx to Start methods 2025-05-22 14:14:40 +02:00
Elle Mouton
c68a19c0ba discovery: revert passing ctx through to Start methods 2025-05-22 14:14:39 +02:00
Elle Mouton
da3deeee7c multi: remove kvdb.RTx from ForEachNodeChannel
Since we have not removed all call-sites that make use of this
parameter, we can remove it. This helps hide DB-specific details from
the interface we will introduce for the graph store.
2025-05-22 14:14:39 +02:00
Elle Mouton
3ec4798311 graph/db: use only exported KVStore methods in tests
Replace all calls to bbolt specific methods on the KVStore to instead
use exported methods on the KVStore that are more db-agnostic.
2025-05-22 14:14:39 +02:00
Elle Mouton
ea4b8c30a4 graph/db: unexport various methods that expose kvdb.RTx
Unexport the KVStore `FetchOtherNode` and `ForEachNodeChannelTx` methods
so that fewer exposed methods are leaking implementation details.
2025-05-22 14:14:39 +02:00
Elle Mouton
42e87396ec graph/db: introduce ForEachSourceNodeChannel
In preparation for creating a clean interface for the graph store, we
want to hide anything that is DB specific from the exposed methods on
the interface. Currently the `ForEachNodeChannel` and the
`FetchOtherNode` methods of the `KVStore` expose a `kvdb.RTx` parameter
which is bbolt specific. There is only one call-site of
`ForEachNodeChannel` actually makes use of the passed `kvdb.RTx`
parameter, and that is in the `establishPersistentConnections` method of
the `server` which then passes the tx parameter to `FetchOtherNode`.

So to clean-up the interface such that the `kvdb.RTx` is no longer
exposed: we instead create one new method called
`ForEachSourceNodeChannel` which can be used to replace the above
mentioned call-site. So as of this commit, all the remaining call-site
of `ForEachNodeChannel` pass in a nil param for `kvdb.RTx` - meaning we
can remove the parameter in a future commit.
2025-05-22 14:14:39 +02:00
Elle Mouton
cf1ec68c0c graph/db: remove unused Wipe method
Later on we will create an interface for the persisted graph data. We
want this interface to be as small and as neat as possible. In
preparation for this, we remove this unused `Wipe` method.
2025-05-22 14:14:38 +02:00
Elle Mouton
3f218dfbbe autopilot: update AttachmentHeuristics with context
Continue threading context through the autopilot system and remove the
remaining context.TODOs.
2025-05-22 14:14:38 +02:00
Elle Mouton
1c6c6436af autopilot: continue threading context
Remove one context.TODO and add one more.
2025-05-22 14:14:38 +02:00
Elle Mouton
13fcb08794 autopilot: start threading contexts through
The `GraphSource` interface in the `autopilot` package is directly
implemented by the `graphdb.KVStore` and so we will eventually thread
contexts through to this interface. So in this commit, we start updating
the autopilot system to thread contexts through in preparation for
passing the context through to any calls made to the GraphSource.

Two context.TODOs are added here which will be addressed in follow up
commits.
2025-05-22 14:14:38 +02:00
Elle Mouton
2f54a0a26a graph/db: use only exported KVStore ForEachNode method in tests
Replace all tests calls to the private `forEachNode` method on the
`KVStore` with the exported ForEachNode method. This is in preparation
for having the tests run against an abstract DB backend.
2025-05-22 14:14:38 +02:00
Elle Mouton
b83b4015d9 graph/db: remove kvdb.Backend from test helpers
Remove unused kvdb.Backend param from `randEdgePolicy` and
`newEdgePolicy` test helpers.
2025-05-22 14:14:38 +02:00
Elle Mouton
5e3d66a97b graph/db: remove kvdb param from test helper
Remove the kvdb.Backend parameter from the `createChannelEdge` helper.
This is all in preparation for having the unit tests run against any DB
backend.
2025-05-22 14:14:37 +02:00
Elle Mouton
e2b592827e graph/db: test clean-up
This commit cleans up the graph test code by removing unused kvdb type
parameters from the `createTextVertex` and `createLightningNode` helper
methods. We also pass in the testing parameter now so that we dont need
to check the error each time we call `createTestVertex`.
2025-05-22 14:14:37 +02:00
Elle Mouton
3162837c32 discovery: listen on ctx in any select
For any method that takes a context that has a select that listens on
the systems quit channel, we should also listen on the ctx since we
should not need to worry about if this context is derived internally or
externally.
2025-05-22 14:14:37 +02:00
Elle Mouton
6d03df7b26 discovery: remove unnecessary context.Background() calls 2025-05-22 14:14:37 +02:00
Elle Mouton
291381ef86 discovery: pass context through to bootstrapper SampleNodeAddrs
Since the ChannelGraphBootstrapper implementation makes a call to the
graph DB.
2025-05-22 14:14:37 +02:00
Elle Mouton
f4b7cc4f4b discovery: pass context to ProcessRemoteAnnouncement
With this, we move a context.TODO() out of the gossiper and into the
brontide package - this will be removed in a future PR which focuses on
threading contexts through that code.
2025-05-22 14:14:37 +02:00
Elle Mouton
69e9ce9b24 discovery: thread contexts through sync manager
Here, we remove one context.TODO() by threading a context through to the
SyncManager.
2025-05-22 14:14:36 +02:00
Elle Mouton
2a5235a79f discovery: thread contexts to syncer
The `GossiperSyncer` makes various calls to the `ChannelGraphTimeSeries`
interface which threads through to the graph DB. So in preparation for
threading context through to all the methods on that interface, we
update the GossipSyncer accordingly by passing contexts through.

Two `context.TODO()`s are added in this commit. They will be removed in
the upcoming commits.
2025-05-22 14:14:36 +02:00
Elle Mouton
4a30d6243d discovery: pass context through to reliable sender
And remove a context.TODO() that was added in the previous commit.
2025-05-22 14:14:36 +02:00
Elle Mouton
7fd453f319 discovery: thread context through to gossiper
Pass the parent LND context to the gossiper, let it derive a child
context that gets cancelled on Stop. Pass the context through to any
methods that will eventually thread it through to any graph DB calls.

One `context.TODO()` is added here - this will be removed in the next
commit.

NOTE: for any internal methods that the context gets passed to, if those
methods already listen on the gossiper's `quit` channel, then then don't
need to also listen on the passed context's Done() channel because the
quit channel is closed at the same time that the context is cancelled.
2025-05-22 14:14:36 +02:00
Elle Mouton
53ba229436 lnd: pass context to newServer and server.Start
In preparation for starting to thread a single parent context through
LND, we update the main `server.Start` method to take a context so that
it can later pass it to any subsytem's Start method it calls. We also
pass the context to `newServer` since it makes some calls that will
eventually reach the DB (for example the graph db).
2025-05-22 14:14:36 +02:00
Elle Mouton
6ff0c85d76 kvdb/etcd: remove context.TODO() from test helpers
We want `context.TODO()` to be high signal in the code-base. It should
signal clearly that work is required to thread parent context through to
the call-site. So to keep the signal-to-noise ratio high, we remove any
context.TODO() calls from tests since these will never need to be
replace by a parent context.

After this commit, there is only a single context.TODO() left in the
code-base.
2025-05-22 14:14:36 +02:00
Elle Mouton
dd5c6d16e3 macaroons: remove context.TODO() in tests
We want `context.TODO()` to be high signal in the code-base. It should
signal clearly that work is required to thread parent context through to
the call-site. So to keep the signal-to-noise ratio high, we remove any
context.TODO() calls from tests since these will never need to be
replace by a parent context.
2025-05-22 14:14:35 +02:00
Oliver Gugger
c52a6ddeb8 Merge pull request #9840 from Roasbeef/0-19-final
build: bump version to 0.19
v0.19.0-beta
2025-05-20 18:11:13 +02:00
Oliver Gugger
182aab7ca4 Merge pull request #9841 from twofaktor/patch-1
docs: minor format & grammatical fixes on release notes 0.19.0
2025-05-20 17:19:49 +02:00
⚡️2FakTor⚡️
2680715832 Update release-notes-0.19.0.md 2025-05-20 16:59:59 +02:00
Olaoluwa Osuntokun
2b76e2fbd5 build: bump version to 0.19.0 2025-05-19 17:46:29 -07:00
Olaoluwa Osuntokun
30f3d7ce89 discovery: lower bandwidth rate limiting log to Debugf 2025-05-19 17:46:08 -07:00
Oliver Gugger
3707b1fb70 Merge pull request #9814 from ziggie1984/add-info-release-notes
Update release notes for LND 19 - lncli breaking change
2025-05-16 10:14:08 +02:00
ziggie
468c527556 docs: update release notes for 19.
The `lncli listchannels` command was changed and might cause breaking
changes for people relying on the `chan_id` return value in their
automation scripts.
2025-05-16 09:41:36 +02:00
Olaoluwa Osuntokun
5ea7232c31 Merge pull request #9811 from lightningnetwork/0-19-rc-5
build: bump version to v0.19.0-beta.rc5
v0.19.0-beta.rc5
2025-05-15 14:48:45 -07:00
Olaoluwa Osuntokun
71dbc189d4 Merge pull request #9801 from Roasbeef/pong-relax
peer+lnd: add new CLI option to control if we D/C on slow pongs
2025-05-15 10:25:29 -07:00
Oliver Gugger
1e8fcc5ea9 build: bump version to v0.19.0-beta.rc5 2025-05-15 16:38:26 +02:00
Olaoluwa Osuntokun
e2c56af519 docs/release-notes: add release notes entry for pong default change 2025-05-15 16:36:38 +02:00
Olaoluwa Osuntokun
c493f0c0a9 peer+lnd: add new CLI option to control if we D/C on slow pongs
In this commit, we add a new CLI option to control if we D/C on slow
pongs or not. Due to the existence of head-of-the-line blocking at
various levels of abstraction (app buffer, slow processing, TCP kernel
buffers, etc), if there's a flurry of gossip messages (eg: 1K channel
updates), then even with a reasonable processing latency, a peer may
still not read our ping in time.

To give users another option, we add a flag that allows users to disable
this behavior. The default remains.
2025-05-15 16:36:38 +02:00
MPins
6fb2d47e84 doc: release-notes-0.20.0 2025-05-13 19:42:54 -03:00
MPins
7a604c8d00 rpcserver: validate blindCfg.MaxNumPaths
Assert that the blindCfg.MaxNumPaths value is non-zero.
2025-05-13 19:42:53 -03:00
MPins
770d1d93be lncfg: validate BlindedPaths.MaxNumPaths
Assert that the BlindedPaths.MaxNumPaths value is non-zero.
2025-05-13 19:42:53 -03:00
MPins
ec42b9acd0 routing: add logging for routes discarded due to low success probability
Create the ChanIDString function to return a string representation
of the route's channel IDs, formatting them in the order they appear
in the route (e.g., "chanID1 -> chanID2").

Discarded routes with a success probability lower than the minimum
threshold are now logged accordingly when finding a blinded path.
2025-05-13 19:42:36 -03:00
MPins
c84804f81f itest: add the test for incoming channel list on blinded invoice 2025-05-13 17:02:44 -03:00
MPins
b95d48971d lntest: add the function RPC call to asserts errors on AddInvoice 2025-05-13 17:02:44 -03:00
MPins
a7da230ffa commands: add option to set the incoming channel on blinded path
Including the blinded path incoming channel list argument to the
addinvoice command, parsing and verifying that it has one or a
comma separeted list of channels id.
2025-05-13 17:02:44 -03:00
MPins
85c92805e9 rpcserver: start reading incoming blinded chan chain
Adds support for specifying a blinded path in addinvoice using
a list of chained incoming channels.
2025-05-13 17:02:43 -03:00
MPins
795b46a6fd lnrpc: add incoming chan list to BlindedPathConfig
Add an option to the addinvoice rpc which allows to specify
the blinded path via a list of chained channels.
2025-05-13 17:02:43 -03:00
MPins
f541c442cf routing: add incoming channel chain to blinded paths
In this commit, the blindedPathRestrictions are expanded to include a
list of incoming channels that must be included in any blinded path. The
unit tests are expanded to test this new logic.
2025-05-13 17:02:43 -03:00
Oliver Gugger
b0cba7dd08 Merge pull request #9804 from ellemouton/removeChanGraphCacheMu
graph/db: remove ChannelGraph cacheMu
2025-05-13 16:10:17 +02:00
Oliver Gugger
1db6c31e20 Merge pull request #9798 from ellemouton/graphFixNotificationSubs
graph/db: synchronous topology client subscriptions/cancellations
2025-05-12 17:10:44 +02:00
Elle Mouton
0155d5d7b0 graph/db: handle topology updates in a single location
In this commit, we ensure that any topology update is forced to go via
the `handleTopologySubscriptions` handler so that client subscriptions
and updates are handled correctly and in the correct order.

This removes a bug that could result from a client missing a
notification about a channel being closed if the client is subscribed
and shortly after, `PruneGraph` is called which would notify all
subscribed clients and possibly do so before the client subscription has
actually been persisted.
2025-05-12 14:42:22 +02:00