252 Commits
Author SHA1 Message Date
ziggie 325f83c179 sqldb+lncfg: consolidate SQLite default constants
Move the SQLite default constants (max connections, busy timeout) to
sqldb/config.go as the single source of truth and export them. Remove
the duplicate definitions from lncfg/db.go and reference the sqldb
constants instead.
2026-02-11 13:15:56 +01:00
ziggie d87d93b114 sqldb+lncfg: use SQLite-appropriate default for max connections
Both the sqldb and kvdb SQLite layers were not using a sensible default
for MaxConnections. The sqldb store used defaultMaxConns (25) which is
meant for Postgres, and the kvdb path passed 0 (unlimited) to
sqlbase.Init when unconfigured.

Add a MaxConns() method on SqliteConfig that returns the configured
value or defaults to 2, appropriate for SQLite's single-writer model.
Use it in both sqldb/sqlite.go and lncfg/db.go so both layers share
the same default.
2026-02-11 13:15:56 +01:00
Olaoluwa Osuntokun fa8ba6f81c lncfg: increase DefaultIncomingBroadcastDelta to 16
With this change, we'll go to chain even earlier to ensure that we have
enough time to sweep a potentially contested HTLC, now that we're
waiting longer before sweeps to ensure that the commitment transaction
is sufficeitnyl burried before we sweep.
2026-01-15 16:22:26 -08:00
Olaoluwa Osuntokun 622fa4476f lncfg: add new dev config option for scaling channel close confs
This'll be useful for the set up upcoming itests.
2026-01-15 16:22:26 -08:00
ziggie 04dab619cb lncfg: add deprecated no-experimental-endorsement config option
Re-adds the old no-experimental-endorsement config option as a hidden,
deprecated alias for no-experimental-accountability. This ensures
backward compatibility for users who have the old option in their
config files after the rename it.
2026-01-14 09:26:36 +01:00
elnosh 34329c684e multi: rename experimental endorsement signal to accountable
Renames the endorsement signal to accountable to
match the latest proposal https://github.com/lightning/blips/pull/67
2026-01-06 09:12:31 -05:00
ziggie 4f051d97ea lncfg+scripts: use configurable global lock for postgres backends
Replace hardcoded WithGlobalLock assignment with configurable
options wallet postgres backends. Also add the WithGlobalLock
option to the channeldb table for postgres backends.

Defaults:
- channeldb: false (allow concurrent access)
- wallet: true (maintain safe single-writer behavior)

Users can now override these defaults via:
- db.postgres.channeldb-with-global-lock
- db.postgres.walletdb-with-global-lock

This gives operators flexibility while maintaining safe defaults
until full native SQL migration is complete.

Moreover exclude db.postgres.walletdb-with-global-lock check
in the sample config file script. We cannot easily check the
correct default because we set it later in the LND startup
sequence so we exclude it.
2025-11-28 09:22:19 +01:00
Elle Mouton 88050da220 lndcfg: add Graph to UseNativeSQL description 2025-10-06 11:00:48 +02:00
yyforyongyu 4aff00260d lncfg: makr tor.v2 as deprecated 2025-09-29 13:01:31 +08:00
yyforyongyu 6d14370e8e lncfg: validate msg-burst-bytes 2025-09-02 21:23:08 +08:00
yyforyongyu 5bc4666efc multi: add new config peer-msg-rate-bytes 2025-09-02 21:23:07 +08: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
Elle Mouton 6a31e06817 graph/db+sqldb: find best default query cfg values for sqlite & postgres
This commit adds a BenchmarkFindOptimalSQLQueryConfig test in the
graph/db package which runs ForEachNode and ForEachChannel queries
against a local backend using various different values for the sql
QueryConfig struct. This is done to determine good default values to
use for the config options for sqlite vs postgres.
2025-08-13 14:43:31 +02:00
Elle Mouton 185166b8d3 sqldb+config: validate maximum batch size config value
Now that the SQL query config values are configurable, we add some
validation to make sure that the user doesnt set a max batch size that
is larger than the limits for sqlite/postgres that have been determined
by the TestSQLSliceQueries test.
2025-08-13 14:43:31 +02:00
Elle Mouton ee292786b1 config+sqldb: make native SQL query config options configurable
Here, we make the sql query option params (batch size and pagination
size) configurable. The defaults for SQLite vs Postgres are still the
same but will be changed in an upcoming commit.
2025-08-13 14:43:31 +02:00
yyforyongyu fc11e48585 discovery: fix make lint 2025-08-04 15:47:12 +08:00
yyforyongyu 60603f0854 multi: allow disable banning peers
When users set `gossip.ban-threshold` to 0, it's now treated as setting
the ban score to max uint64, which effectively disables the banning. We
still want to record the peer's ban score in case we need it for future
debugging.
2025-08-04 15:46:16 +08:00
yyforyongyu a6f8617e7c multi: add new config ban-threshold 2025-08-04 15:45:47 +08:00
Olaoluwa Osuntokun 694cc15a73 discovery: make gossip filter semaphore capacity configurable
In this commit, we make the gossip filter semaphore capacity configurable
through a new FilterConcurrency field. This change allows node operators
to tune the number of concurrent gossip filter applications based on
their node's resources and network position.

The previous hard-coded limit of 5 concurrent filter applications could
become a bottleneck when multiple peers attempt to synchronize
simultaneously. By making this value configurable via the new
gossip.filter-concurrency option, operators can increase this limit
for better performance on well-resourced nodes or maintain conservative
values on resource-constrained systems.

We keep the default value at 5 to maintain backward compatibility and
avoid unexpected resource usage increases for existing deployments. The
sample configuration file is updated to document this new option.
2025-08-01 11:20:19 -05:00
yyforyongyu 03bf1974a3 lncfg: update docs about msg-rate-bytes and msg-burst-bytes 2025-07-25 17:41:00 +08:00
yyforyongyu c4c519a3ae itest+lncfg: test the quiescence timeout behaivor 2025-07-04 04:20:00 +08:00
yyforyongyu 463f51d371 lncfg: enable quiescence in non-dev environment 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
Elle Mouton 04564977d8 lncfg: add IsLocalNetwork helper
It returns true for Signet and Regtest networks.
2025-07-01 11:23:29 +02:00
Oliver Gugger 29ff13d83f Merge pull request #9973 from ZZiigguurraatt/skip-native-sql-migration-doc-update
sqldb: clarify native sql options in `lnd.conf`
2025-06-24 18:18:13 +02:00
ZZiigguurraatt 4a4d19600f sqldb: clarify native sql options 2025-06-24 11:35:53 -04: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
yyforyongyu 599650fa2d lncfg+lnd: add new dev config unsafeconnect
This flag is added so we can use it in the itest to mimic racing inbound
and outbound connections.
2025-06-18 17:19:09 +08:00
yyforyongyu cc7ed5a9d2 lncfg: fix typo 2025-06-18 17:19:09 +08:00
MPins 770d1d93be lncfg: validate BlindedPaths.MaxNumPaths
Assert that the BlindedPaths.MaxNumPaths value is non-zero.
2025-05-13 19:42:53 -03:00
ziggie 947702f6de multi: add global log for wallet db postgres back 2025-04-16 16:31:24 +02:00
ziggie 5c402472a4 mulit: move neutrino.db also to postgres 2025-04-14 16:28:54 +02:00
Olaoluwa Osuntokun 96662ad43a lncfg: mention that taproot chans aren't supported for rbf close 2025-04-04 14:38:12 -07:00
Olaoluwa Osuntokun c7ed5d65c6 multi: add new config options to tune gossip msg allocated bandwidth
We go with the defaults of if no values are set.
2025-03-24 19:21:45 -07:00
Oliver Gugger 0aea482b51 multi: add testnet4 support 2025-03-24 11:53:23 -05:00
Olaoluwa Osuntokun 47af913b45 lncfg: add new protocol option - RbfCoopClose 2025-03-18 11:44:20 -05: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
Nishant Bansal 4569c07e08 multi: Add itest for funding timeout
This commit adds an integration test that
verifies the funding timeout behavior in the
funding manager, in dev/integration test.
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2025-03-07 21:32:38 +05:30
Oliver Gugger 6cabc74c20 Merge pull request #8831 from bhandras/sql-invoice-migration
invoices: migrate KV invoices to native SQL for users of KV SQL backends
2025-01-23 05:48:25 -06: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
Andras Banki-Horvath b789fb2db3 sqldb: add support for custom in-code migrations
This commit introduces support for custom, in-code migrations, allowing
a specific Go function to be executed at a designated database version
during sqlc migrations. If the current database version surpasses the
specified version, the migration will be skipped.
2025-01-23 09:10:59 +01:00
yyforyongyu 27a05694cb multi: make ProofMatureDelta configurable
We add a new config option to set the `ProofMatureDelta` so the users
can tune their graphs based on their own preference over the num of
confs found in the announcement signatures.
2025-01-17 21:44:23 +08:00
Elle Mouton ab7aae0708 multi: rename nolint:lll to nolint:ll
Find and replace all nolint instances refering to the `lll` linter and
replace with `ll` which is the name of our custom version of the `lll`
linter which can be used to ignore log lines during linting.

The next commit will do the configuration of the custom linter and
disable the default one.
2024-12-02 09:14:21 +02:00
Keagan McClelland 111c9b05f3 htlcswitch+peer: allow the disabling of quiescence
Here we add a flag where we can disable quiescence. This will be used
in the case where the feature is not negotiated with our peer.
2024-11-26 14:13:39 -07:00
Carla Kirk-Cohen f02bb58486 multi: add experimental endorsement feature bit and disable option 2024-11-22 09:16:58 -05:00
Elle Mouton 9d0cd3ff4f multi: update more loggers to the v2 type 2024-10-22 17:03:56 +02:00
Elle Mouton 23602e017e multi: start updating various loggers to use the new v2 type 2024-10-22 17:03:55 +02:00
ziggie 448193b0fd multi: separate profiler config 2024-10-18 13:03:30 +02:00
Olaoluwa Osuntokun c6ba5d11f1 lncfg: add new config option for taproot overlay chans 2024-10-02 18:10:10 -07:00