Commit Graph

18843 Commits

Author SHA1 Message Date
ziggie
b837c889dc itest: add disconnect test
Add a connect/disconnect test when the peers both started up
with the rbf coop close feature.
2025-05-29 10:19:21 +02:00
Oliver Gugger
8e96bd0308 Merge pull request #9866 from ellemouton/graphSQL7-nodes-tables
sqldb+graph/db: add node related tables and implement some node CRUD
2025-05-28 08:45:33 +02:00
Oliver Gugger
3b2af90f5a Merge pull request #9854 from yyforyongyu/fix-fetchinput
gomod: update `btcwallet` to fix `FetchOutpointInfo`
2025-05-27 21:07:36 +02:00
Elle Mouton
efc04b9918 docs: update release notes 2025-05-27 18:37:00 +02:00
Elle Mouton
0064d33cda sqldb+graph/db: source nodes table, queries and CRUD
In this commit, we add the `source_nodes` table. It points to entries in
the `nodes` table. This table will store one entry per protocol version
that we are announcing a node_announcement on.

With this commit, we can run the TestSourceNode unit test against our
SQL backends.
2025-05-27 18:36:59 +02:00
Elle Mouton
86d48390ca sqldb+graph/db: implement SQLStore.NodeUpdatesInHorizon
In this commit we add the necessary SQL queries and then implement the
SQLStore's NodeUpdatesInHorizon method. This lets us run the
TestNodeUpdatesInHorizon unit tests against SQL backends.
2025-05-27 18:36:59 +02:00
Elle Mouton
7a120cb584 graph/db: implement SQLStore.LookupAlias
In this commit, we let the SQLStore implement LookupAlias. This then
lets us run the TestAliasLookup unit test against the SQL backends.
2025-05-27 18:36:59 +02:00
Elle Mouton
d1f7cce68b sqldb+graphdb: SQL methods for Node CRUD
In this commit, we add the various sqlc queries that we need in order
to implement the following V1Store methods:

- AddLightningNode
- FetchLightningNode
- HasLightningNode
- AddrsForNode
- DeleteLightningNode
- FetchNodeFeatures

These are implemented by SQLStore which then lets us use the SQLStore
backend for the following unit tests:

- TestNodeInsertionAndDeletion
- TestLightningNodePersistence
2025-05-27 18:36:59 +02:00
Elle Mouton
ffbe4f6ffc sqldb: define schemas for all graph node tables
In this commit, the various SQL schemas required to store graph node
related data is defined. Specifically, the following tables are defined:

- nodes
- node_extra_types
- node_features
- node_addresses
2025-05-27 16:28:37 +02:00
yyforyongyu
142e8dfe26 docs: add release notes 19.1 2025-05-26 21:02:05 +08:00
yyforyongyu
1a877463c7 docs: add release notes template 2025-05-26 19:41:25 +08:00
yyforyongyu
7f375ccd2e gomod: update btcwallet 2025-05-26 19:41:24 +08:00
yyforyongyu
f97f60d3d4 lntest+itest: add testBumpFeeExternalInput 2025-05-26 19:41:24 +08:00
yyforyongyu
4cef7b30fe 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-05-26 19:41:24 +08:00
Oliver Gugger
93a6ab8759 Merge pull request #9853 from lightningnetwork/elle-graphSQL8-prep
graph/db: init SQLStore caches and batch schedulers
2025-05-26 10:11:45 +02:00
Oliver Gugger
ab717c301b Merge pull request #9864 from ziggie1984/update-sqlc
sqlc: update sqlc compiler to 1.29.0
2025-05-26 09:27:01 +02:00
Oliver Gugger
1aaa76078b Merge pull request #9807 from ziggie1984/skip-vendor-and-source-packaging-cross-builds
make: allow skipping the vendor and source packaging
2025-05-26 09:14:14 +02:00
Oliver Gugger
b1b3c64410 Merge pull request #9721 from appilon/appilon/6601
feat(lncli): Add --route_hints flag to sendpayment and queryroutes
2025-05-26 09:13:01 +02:00
Oliver Gugger
5c324c732e Merge pull request #9856 from ellemouton/writeOpaqueAddr
lnwire: add lnwire.OpaqueAddr case in WriteElement for channel back-ups
2025-05-26 08:48:03 +02:00
ziggie
c65cf7ffd1 makefile: fix linewrap for make help cmd 2025-05-26 08:45:21 +02:00
ziggie
c624e4348d makefile: add lean cross-compile build
Different platforms can now be cross-compiled wihtout packing
all the source and vendor packages.
2025-05-26 08:37:10 +02:00
ziggie
5baaa3e7c5 sqlc: update sqlc compiler to 1.29.0 2025-05-25 18:23:35 +02:00
Alex Pilon
0437850089 docs: Update release notes for --route_hints flag 2025-05-24 20:01:48 -04:00
Alex Pilon
baf2e445f4 lncli: Add --route_hints flag support
Adds --route_hints flag to sendpayment.
Hints should be JSON encoded (see usage for example).

Adds --route_hints flag to queryroutes.
Errors if blinded paths are set.
2025-05-24 20:01:45 -04:00
Elle Mouton
9d54dbcd64 docs: add release notes for 0.19.1 2025-05-24 14:10:35 +02:00
Oliver Gugger
dc946ae7e8 Merge pull request #9857 from twofaktor/patch-1
docs: fix description of protocol.rbf-coop-close default state in sample-lnd.conf
2025-05-24 07:53:28 +02:00
⚡️2FakTor⚡️
6d6b975213 Fix reference to default protocol.rbf-coop-close configuration in sample-lnd.conf
Modified description regarding the default value for the parameter protocol.rbf-coop-close:

Replaced: "disable" with "enable"
2025-05-23 18:03:39 +02:00
Elle Mouton
412e05f85f lnwire: add *OpaqueAddrs case in WriteElements
And then expand the chanbackup unit tests to cover such a case.
2025-05-23 16:14:47 +02:00
Elle Mouton
a15489159a lnwire: remove duplicated logic
Use existing serialisation helpers for serialising TC Pand Onion
addresses in WriteElement.
2025-05-23 16:12:28 +02:00
Elle Mouton
6e9372a3e8 chanbackup: make sure onion addresses are covered in tests 2025-05-23 16:11:27 +02:00
Elle Mouton
3b449820d2 graph/db: init SQLStore caches and batch schedulers
Here, we use the new options to initialise the reject and channel caches
for the SQLStore (as is done for the KVStore) and also the channel and
node batch schedulers.
2025-05-23 11:05:39 +02:00
Elle Mouton
149e1c7d35 graph/db: add StoreOptions to NewSQLStore 2025-05-23 11:05:36 +02:00
Elle Mouton
a0a20bd0d0 graph/db: rename KVStoreOptions to StoreOptions
We'll re-use this options struct for our SQLStore too. So here we rename
it to be more generic.
2025-05-23 11:01:17 +02:00
Elle Mouton
14ca086c72 graph/db: skip TestGraphLoading for non-bbolt store
Let all the NewTestDB functions return the V1Store interface type
instead of pointers. Then add a manual skip in the TestGraphLoading test
for any non-bbolt backend. We can remove this once all the methods used
by the test have been implemented by the SQLStore. We only need the
manual skip for this one test since it is the only one that doesnt use
MakeGraphTest to init the graph db.
2025-05-23 10:53:27 +02:00
Oliver Gugger
cbdd1c22b7 Merge pull request #9692 from lightningnetwork/elle-graph
[graph-work-side-branch]: side branch for graph work
2025-05-23 10:29:09 +02:00
Elle Mouton
7cef62f999 docs: update release notes 2025-05-22 14:17:43 +02:00
Elle Mouton
df1e6da94e batch: update to allow for read-only calls
In this commit, we update the batch schedular so that it has the ability
to do read-only calls. It will do a best effort attempt at keeping a
transaction in read-only mode and then if any requests get added to a
batch that require a read-write tx, then the entire batch's tx will be
upgraded to use a read-write tx.
2025-05-22 14:14:43 +02:00
Elle Mouton
e743878bd5 batch: add a benchmark for SQLite and Postgres 2025-05-22 14:14:43 +02:00
Elle Mouton
bb95b0d9b6 batch: add benchmark tests for KVDB batch writes
Here we add a new BenchmarkBoltBatching test that helps us benchmark the
performance when writing to a bbolt backend using various different
configurations. We test using N txs for N writes, 1 tx for N writes and
then various configurations when using the TimeScheduler.
2025-05-22 14:14:43 +02:00
Elle Mouton
f5a466b051 batch+graph: update batch.Schedular to be generic
In preparation for using the same logic for non-bbolt backends, we adapt
the batch.Schedular to be more generic.

The only user of the scheduler at the moment is the KVStore in the
`graph.db` package. This store instantiates the bbolt implementation of
the scheduler.
2025-05-22 14:14:42 +02:00
Elle Mouton
9b9a964975 graph/db: more test coverage for node addresses
In this commit we add more test coverage for the persistence of the
addresses of a LightningNode. This is so that we have unit test coverage
that ensures that all the various address types can be persisted and
that the order of the addresses (within a type) are preserved.
2025-05-22 14:14:42 +02:00
Elle Mouton
629e74a53c graph/db: add various error assertions
Here we expand TestEdgeInsertionDeletion to assert that the expected
error is returned when AddChannelEdge is called for a channel that has
already been persisted. We also take the opportunity to convert some of
the error checks in the test to use strict error type matching.

Finally, we test that the expected error is returned if
DeleteLightningNode is called for a node that is no longer in the DB.
2025-05-22 14:14:42 +02:00
Elle Mouton
3bc58a0d2f graph/db: test the non-cached version of ForEachNodeDirectedChannel
Expand an existing test for ForEachNodeDirectedChannel so that it also
tests the DB method and not just the ChannelGraph method which will use
the in-memory graph cache for the query.
2025-05-22 14:14:42 +02:00
Elle Mouton
be915f2be7 sqldb: add support for test migrations
Add `migrations_dev.go` and `migrations_prod.go` files which each define
a `migrationAdditions` slice to be appended to the `migrationConfig`
slice. The `migrations_dev.go` file is only built if either the
`test_db_postgres` or `test_db_sqlite` build flags are used.

This slice will be used to add any migrations that are still under
development that we want access to via unit tests and itests but do not
want to expose to our release build.
2025-05-22 14:14:42 +02:00
Elle Mouton
b4121acb1f graph/db: add a framework for testing against SQL backends incrementally
In this commit, we implement the postgres and sqlite versions of the
NewTestDB function. We add the various build flags so that only one of
the three versions of this function can be active at a time.

We also introduce the SQLStore struct which is the SQL implementation of
the V1Store interface.

NOTE: it currently temporarily embeds the KVStore struct so that we can
implement the V1Store interface incrementally. For any method not
implemented, things will fall back to the KVStore. This is ONLY the
case for the time being while this struct is purely used in unit tests
only. Once all the methods have been implemented, the KVStore field will
be removed from the SQLStore struct.
2025-05-22 14:14:42 +02:00
Elle Mouton
383453635b sqldb+go.mod: update sqldb test methods
Update the test methods to take a `testing.TB` param instead of a
`*testing.T` so that the test functions can be used for all the graph's
tests including benchmark tests.

We also add a temporary replace so that we can make use of these changes
and also since we will soon be adding graph related schemas and queries
in this submodule that we'll want to have access to.
2025-05-22 14:14:42 +02:00
Elle Mouton
b285546ce1 graph/db: add NewTestDB method
In this commit, we add a `test_kvdb.go` file with a single definition of
the `NewTestDB` function. A new version of `MakeTestGraph` (called
`MakeTestGraphNew` is added which makes use of this `NewTestDB` function
to create the backing `V1Store` passed to the `ChannelGraph` for tests.

Later on, we will add new implementations of this method backed by
sqlite and postgres.  When those are added, then build flags will
control which version of `NewTestDB` is called.

With this change, the only test call-site of `NewKVStore` is the new
`test_kvdb.go` file.
2025-05-22 14:14:42 +02:00
Elle Mouton
dc353dc50e multi: use MakeTestGraph everywhere for test graph creation
In this commit, we unify how all unit tests that make use of the graph
create their test ChannelGraph instance. This will make it easier to
ensure that once we plug in different graph DB implementations, that all
unit tests are run against all variants of the graph DB.

With this commit, `NewChannelGraph` is mainly only called via
`MakeTestGraph` for all tests _except_ for `TestGraphLoading` which
needs to be able to reload a ChannelGraph with the same backend. This
will be addressed in a follow-up commit once more helpers are defined.

Note that in all previous packages where we created a test graph using
`kvdb.GetBoltBackend`, we now need to add a `TestMain` function with a
call to `kvdb.RunTest` since the `MakeTestGraph` helper uses
`GetTestBackend` instead of `kvdb.GetBoltBackend` which requires an
embedded postgres instance to be running.
2025-05-22 14:14:42 +02:00
Elle Mouton
7a348e324d graph/db: let MakeTestGraph take ChanGraphOptions
Currently none of the calls to MakeTestGraph make use of the
KVStoreOptionModifier options but later on we will want to make use of
the `WithUseGraphCache` ChannelGraphOption and so we take this
opportunity to switch out the functional parameters that the helper
function takes.
2025-05-22 14:14:42 +02:00
Elle Mouton
7288f280f6 routing+autopilot: rename mission control store var
To clearly separate the mission control DB store (which for now will
remain kvdb only) from the graph store, we rename the `graphBackend`
variable to `mcBackend` in the `testGraphInstance` struct.
2025-05-22 14:14:41 +02:00