Commit Graph

90 Commits

Author SHA1 Message Date
Elle
5f3055944a Merge pull request #10148 from ellemouton/graphPerf10
graph/db+sqldb: different defaults for SQLite and Postgres query options
2025-08-14 07:56:28 +02:00
Elle Mouton
b1deddec44 multi: remove DefaultQueryConfig
And always make use of either the new DefaultSQLiteConfig or
DefaultPostgresConfig.
2025-08-13 14:43:31 +02:00
ziggie
88da582526 mulit: use kvdb.Backend for the kv payment db
Instead of the ChannelState struct we now use the kv backend
interface for the payment kv database.
2025-08-11 16:44:14 +02: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
Elle Mouton
902611d86a lnd: plug in graph SQL migration into dev build
This commit plugs in the graph kvdb-to-sql migration for builds
containing the `test_native_sql` tag. This will allow us to perform
local tests and write itests for the migration without exposing it to
the production release build.
2025-07-15 06:34:31 +02:00
Elle Mouton
e38aa6d1e0 multi: itest jobs with SQL graph backend
In this commit, a new `test_native_sql` build flag is defined. If this
build flag is used along with the `--use-native-sql` config option, then
the SQLStore implementation of the graphdb.V1Store will be initialised.
This is then used to run our itest suite against the new SQLStore graph
implementation.

NOTE that this only works for new nodes currently - the migration from
kv-to-sql is yet to be implemeneted.
2025-06-26 10:12:54 +02:00
ziggie
d220b87b60 multi: Add decayedlog db migration code
This commit adds the migration code for the decayedlog db which
is optional and will default to true.
2025-06-21 09:20:19 +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
526fb7f181 graph/db: init KVStore outside of ChannelGraph
So that we can pass in the abstract V1Store in preparation for adding a
SQL implementation of the KVStore.
2025-05-22 14:14:40 +02:00
ziggie
5c402472a4 mulit: move neutrino.db also to postgres 2025-04-14 16:28:54 +02:00
ziggie
490347b056 multi: update walletdb package 2025-04-09 18:47:53 +02:00
Andras Banki-Horvath
0c8b0351d6 lnd: remove unnecessary debug log to avoid misunderstanding 2025-04-01 13:03:56 +02:00
Elle Mouton
88398e3dd9 graph/db: let ChannelGraph init the graphCache
In this commit, we let the ChannelGraph be responsible for populating
the graphCache and then passing it to the KVStore. This is a first step
in moving the graphCache completely out of the KVStore layer.
2025-03-24 15:05:46 +02:00
Elle Mouton
00432e46f3 multi: add ChannelGraph Config struct
And use this struct to pass NewChannelGraph anything it needs to be able
to init the KVStore that it houses. This will allow us to add
ChannelGraph specific options.
2025-03-24 15:05:46 +02:00
Elle Mouton
81e0608c10 graph/db: rename Options to KVStoreOptions
Namespace these options so that we can introduce separate options for
the new ChannelGraph.
2025-03-24 15:05:46 +02:00
bitromortac
a93ec3b01a lnd: pass through neutrino MaxPeers config
This enables users to set the config. We check that the currently set
value of MaxPeers is non-zero.
2025-03-18 17:55:20 +01:00
Andras Banki-Horvath
55595954ad config: rename skip-sql-invoice-migration to skip-native-sql-migration
In future releases we will use this flag to make potentially failing kv
to native SQL migrations optional. For this reason it is better to
rename it to avoid confusion.
2025-03-17 16:45:18 +01:00
Slyghtning
ea9a5a2a71 macaroons: add ip range checker 2025-03-13 09:57:39 -05:00
Andras Banki-Horvath
444524a762 channeldb+lnd: set invoice bucket tombstone after migration
This commit introduces the functionality to set a tombstone key
in the invoice bucket after the migration to the native SQL
database. The tombstone prevents the user from switching back
to the KV invoice database, ensuring data consistency and
avoiding potential issues like lingering invoices or partial
state in KV tables. The tombstone is checked on startup to
block any manual overrides that attempt to revert the migration.
2025-01-23 15:06:09 +01:00
Andras Banki-Horvath
8d20e2a23b lnd: run invoice migration on startup
This commit runs the invoice migration if the user has a KV SQL backend
configured.
2025-01-23 09:11:01 +01:00
Andras Banki-Horvath
91c3e1496f sqldb: separate migration execution from construction
This commit separates the execution of SQL and in-code migrations
from their construction. This change is necessary because,
currently, the SQL schema is migrated during the construction
phase in the lncfg package. However, migrations are typically
executed when individual stores are constructed within the
configuration builder.
2025-01-23 09:10:59 +01:00
Olaoluwa Osuntokun
fb429d658b Merge pull request #9330 from ProofOfKeags/update/fn2
multi: update to fn v2
2024-12-09 12:56:23 +01:00
Oliver Gugger
117c6bc781 multi: move routing.TlvTrafficShaper => htlcswitch.AuxTrafficShaper
With this commit we move the traffic shaper definition from the routing
package to the HTLC switch package as a preparation for being able to
use it there as well.
At the same time we rename it to AuxTrafficShaper to be more in line
with the other auxiliary components.
2024-12-05 12:39:33 +01:00
Keagan McClelland
ed2989ae33 multi: update to fn v2 2024-12-04 13:19:00 -07:00
Elle Mouton
b86980ec40 channeldb: remove graph db from channeldb
Now that the channel.DB no longer uses the ChannelGraph pointer, we can
completely remove it as a member of channeldb.DB.
2024-11-28 13:36:15 +02:00
Elle Mouton
1859993734 channeldb+graphdb: init graph DB outside of channel db
We also now use the graph DB's own optional functions. An instance of
the graph is currently still passed to the channeldb's
`CreateWithBackend` function. This will be removed in a later commit
once the two have been completely disjoint.
2024-11-28 13:36:15 +02:00
Elle Mouton
9d0cd3ff4f multi: update more loggers to the v2 type 2024-10-22 17:03:56 +02:00
Olaoluwa Osuntokun
eaea11e48f sweep: update sweeper to use AuxSweeper to add extra change addr
In this commit, we start to use the AuxSweeper (if present) to obtain a
new extra change addr we should add to the sweeping transaction. With
this, we'll take the set of inputs and our change addr, and then maybe
gain a new change addr to add to the sweep transaction.

The extra change addr will be treated as an extra required tx out,
shared across all the relevant inputs. This'll also be used in
NeedWalletInput to make sure that we add an extra input if needed to be
able to pay for the change addr.
2024-10-02 18:09:58 -07:00
Olaoluwa Osuntokun
4619cefc8f lnwallet: add new aux resolver interface
This will be used by external callers to modify the way we resolve
contracts on chain. For a given contract, we'll store an extra "blob",
that will later be presented during the sweeping phase.
2024-10-02 18:09:50 -07:00
Olaoluwa Osuntokun
44ab7e6b10 server+peer: init peer struct w/ AuxChanCloser if present 2024-09-19 10:18:41 +02:00
Oliver Gugger
d49da574e3 lnd: add aux data parser
This commit adds an optional data parser that can inspect and in-place
format custom data of certain RPC messages.
We don't add an implementation of the interface itself, as that will be
provided by external components when packaging up lnd as a bundle with
other software.
2024-09-18 19:07:27 +02:00
Olaoluwa Osuntokun
83fdbda2fa multi: obtain+verify aux sigs for all second level HTLCs
In this commit, we start to use the new AuxSigner to obtain+verify aux sigs for all second level HTLCs. This is similar to the existing SigPool, but we'll only attempt to do this if the AuxSigner is present (won't be for most channels).
2024-09-18 19:04:53 +02:00
Olaoluwa Osuntokun
65f54cb075 config+serer: add AuxFundingController as top level cfg option 2024-09-18 10:25:40 +02:00
George Tsagkarelis
c39143052e lnd: use impl cfg TlvTrafficShaper 2024-09-05 18:00:52 +02:00
Oliver Gugger
b45d72fe59 multi: thread thru the AuxLeafStore everywhere 2024-08-28 13:26:14 +02:00
Olaoluwa Osuntokun
b028af1836 multi: make MsgRouter available in the ImplementationCfg
With this commit, we allow the `MsgRouter` to be available in the
`ImplementationCfg`. With this, programs outside of lnd itself are able
to now hook into the message processing flow to direct handle custom
messages, and even normal wire messages.
2024-08-14 19:23:02 -07:00
yyforyongyu
ddf46f435c multi: update RPC error import path
These errors are now defined in `btcwallet/chain` instead of
`btcd/rpcclient`.
2024-07-06 13:59:28 +08:00
yyforyongyu
e0a506ab26 multi: use chain.MapRPCErr instead of rpcclient.MapRPCErr 2024-07-06 13:59:25 +08:00
Tom Kirkpatrick
3837c3f12e lnwallet: add configurable cache for web fee estimator
Add fee.min-update-timeout and fee.max-update-timeout config options to
allow configuration of the web fee estimator cache.
2024-05-04 14:41:41 +08:00
erik
ab83343c87 multi: repleace ioutil.ReadFile 2024-04-25 11:22:43 +02:00
Oliver Gugger
648fb22f63 multi: wrap all errors 2024-04-11 15:04:03 +02:00
Andras Banki-Horvath
7f5c8219ef sqldb+invoices: move SQL invoice store impl to invoices package 2024-04-09 20:46:11 +02:00
Oliver Gugger
15c7686830 Merge pull request #8554 from yyforyongyu/use-new-errors
lnwallet: use new errors returned from `rpcclient`
2024-03-21 01:42:57 -06:00
Andras Banki-Horvath
2d3d11487c lnd: ensure that native SQL can only be used with a clean KV invoice DB
This commit adds a check to ensure that we don't start LND with native
SQL invoice DB if we already have any invoices in our KV channeldb. This
is needed as native SQL invoices is an experimental feature and we do
not yet support migration.
2024-03-20 08:46:48 +01:00
yyforyongyu
837c7f761c lnwallet+lnd: make use of the new errors from btcd/rpcclient
This commit updates `btcd` and `btcwallet` packages and make use of the
new RPC error mappings.
2024-03-20 04:40:38 +08:00
Andras Banki-Horvath
88370de1ab lnd: use native SQL invoice store if configured 2024-03-01 10:08:09 +01:00
Andras Banki-Horvath
debfaf41b9 lncfg: use the sqldb config types instead of the kvdb counterparts 2024-03-01 10:08:09 +01:00
ffranr
cd566eb097 multi: fix fmt.Errorf error wrapping
Refactor fmt.Errorf usage to correctly wrap errors instead of using
non-wrapping format verbs.
2024-02-27 11:13:40 +00:00
Oliver Gugger
cbc11dac8f multi: add coin selection strategy to channel funding
With this commit we prepare for the lnwallet channel funding logic to be
aware of the config-level coin selection strategy by adding it to the
wallet config.
2024-02-23 08:58:07 +01:00
Keagan McClelland
fb8de14798 lnwallet+funding+lnd: trim unused parameters, from lnwallet.Config
chainreg: remove unused GenDefaultBtcConstraints

lnwallet+funding+lnd: remove DefaultDustLimit from lnwallet.Config
2024-02-19 17:06:21 -08:00