Commit Graph

18798 Commits

Author SHA1 Message Date
ziggie
49d40c8ea1 brontide: fix peer disconnection issue
In case when the rbf coop close feature was active we would not
properly disconnect the peer.
2025-06-04 12:19:41 +02:00
ziggie
275ab7da1d itest: add disconnect test
Add a connect/disconnect test when the peers both started up
with the rbf coop close feature.
2025-06-04 12:19:41 +02:00
Oliver Gugger
fdd2717c37 Merge branch '0-19-1-rc1-branch-9885' into 0-19-1-rc1-branch 2025-06-04 12:19:20 +02:00
ffranr
00f9589929 protofsm: exercise StateMachine.IsRunning() in unit test
Update unit test to call `StateMachine.IsRunning()` to ensure the
method has test coverage.
2025-06-04 12:19:20 +02:00
Oliver Gugger
6c3545ad53 Merge branch '0-19-1-rc1-branch-9883' into 0-19-1-rc1-branch 2025-06-04 12:19:03 +02:00
ffranr
6f4811fc14 protofsm: add thread-safe IsRunning method to StateMachine
This commit introduces a new `IsRunning()` method to the `StateMachine`.
This method allows callers to safely query whether the state machine
is currently active after it has been started and before it has been
stopped.

To ensure thread-safety, the internal `running` status flag is
implemented using `atomic.Bool` (from `sync/atomic`). Without atomic
operations, concurrent accesses to a simple boolean flag from different
goroutines (e.g., one goroutine calling `IsRunning()` while another
executes `Start()` or `Stop()`) could lead to stale reads or data races.
2025-06-04 12:19:03 +02:00
Oliver Gugger
19b2e42e18 Merge branch '0-19-1-rc1-branch-9854' into 0-19-1-rc1-branch 2025-06-04 12:18:38 +02:00
yyforyongyu
b703cf2042 docs: add release notes 19.1 2025-06-04 12:18:21 +02:00
yyforyongyu
9d5b103d09 docs: add release notes template 2025-06-04 12:17:55 +02:00
yyforyongyu
15d14ee1c4 gomod: update btcwallet 2025-06-04 12:17:54 +02:00
yyforyongyu
92279e87ae lntest+itest: add testBumpFeeExternalInput 2025-06-04 12:17:54 +02:00
yyforyongyu
6afdda837c itest: add new file lnd_bump_fee.go
Move bumpfee RPC related tests into one file - these tests focus on
testing the behaivor of the RPC only without any force close context.
2025-06-04 12:17:54 +02:00
Oliver Gugger
5f37da3f21 Merge branch '0-19-1-rc1-branch-9856' into 0-19-1-rc1-branch 2025-06-04 12:17:22 +02:00
Elle Mouton
2512677b08 docs: add release notes for 0.19.1 2025-06-04 12:17:00 +02:00
Elle Mouton
c79daf68fa lnwire: add *OpaqueAddrs case in WriteElements
And then expand the chanbackup unit tests to cover such a case.
2025-06-04 12:16:09 +02:00
Elle Mouton
2530ab13c7 lnwire: remove duplicated logic
Use existing serialisation helpers for serialising TC Pand Onion
addresses in WriteElement.
2025-06-04 12:16:09 +02:00
Elle Mouton
659549a5fc chanbackup: make sure onion addresses are covered in tests 2025-06-04 12:16:08 +02:00
Oliver Gugger
4b3fb1150b Merge pull request #9893 from ziggie1984/fix-memory-leak-cherry-pick
fix memory leak cherry pick
2025-06-04 12:07:42 +02:00
ziggie
7477a91472 docs: add release-notes 19.1 2025-06-04 10:58:48 +02:00
ziggie
45ebb9b900 discovery: add comments to the ctx creation
We highlight why we do not use the returned cancel method of the
context guard.
2025-06-04 10:55:22 +02:00
ziggie
af47604cc3 fn: add comment to context create fn 2025-06-04 10:55:22 +02:00
Elle Mouton
fe3a862ec3 autopilot: revert passing ctx to Start methods 2025-06-04 10:54:36 +02:00
Elle Mouton
6202597eec discovery: revert passing ctx through to Start methods 2025-06-04 10:54:35 +02:00
Elle Mouton
2f99706fa1 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-06-04 10:54:35 +02:00
Elle Mouton
de11997fad 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-06-04 10:54:35 +02:00
Elle Mouton
9aab68a6f5 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-06-04 10:54:35 +02:00
Elle Mouton
c15740ba09 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-06-04 10:54:35 +02:00
Elle Mouton
9c3c2b970c 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-06-04 10:54:34 +02:00
Elle Mouton
1507a7fcc7 autopilot: update AttachmentHeuristics with context
Continue threading context through the autopilot system and remove the
remaining context.TODOs.
2025-06-04 10:54:34 +02:00
Elle Mouton
46f09ba1ff autopilot: continue threading context
Remove one context.TODO and add one more.
2025-06-04 10:54:34 +02:00
Elle Mouton
cd4a59071d 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-06-04 10:54:34 +02:00
Elle Mouton
ca52834795 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-06-04 10:54:34 +02:00
Elle Mouton
861606d28b graph/db: remove kvdb.Backend from test helpers
Remove unused kvdb.Backend param from `randEdgePolicy` and
`newEdgePolicy` test helpers.
2025-06-04 10:54:34 +02:00
Elle Mouton
29ce7627fd 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-06-04 10:54:33 +02:00
Elle Mouton
1b26b590b4 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-06-04 10:54:33 +02:00
Elle Mouton
0ab61e08fa 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-06-04 10:54:33 +02:00
Elle Mouton
f2fb4827c7 discovery: remove unnecessary context.Background() calls 2025-06-04 10:54:33 +02:00
Elle Mouton
6b95b7933c discovery: pass context through to bootstrapper SampleNodeAddrs
Since the ChannelGraphBootstrapper implementation makes a call to the
graph DB.
2025-06-04 10:54:33 +02:00
Elle Mouton
1a8e7587f9 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-06-04 10:54:33 +02:00
Elle Mouton
1a5821a873 discovery: thread contexts through sync manager
Here, we remove one context.TODO() by threading a context through to the
SyncManager.
2025-06-04 10:54:32 +02:00
Elle Mouton
a1a7d771da 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-06-04 10:54:32 +02:00
Elle Mouton
5430157d0c discovery: pass context through to reliable sender
And remove a context.TODO() that was added in the previous commit.
2025-06-04 10:54:32 +02:00
Elle Mouton
e2c184f235 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-06-04 10:54:32 +02:00
Elle Mouton
4fca1f35ae 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-06-04 10:54:32 +02:00
Elle Mouton
76d2bec58f 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-06-04 10:54:32 +02:00
Elle Mouton
54f6b16f01 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-06-04 10:54:31 +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