20399 Commits
Author SHA1 Message Date
Elle Mouton ae13158b68 graph/db: update ForEachChannel to use new sqldb helper
Refactor to let ForEachChannel make use of the new
sqldb.ExecuteCollectAndBatchWithSharedDataQuery helper.
2025-08-05 06:36:36 +02:00
Elle Mouton 1219cdb7f1 graph/db: use sqldb helper for ForEachNode
A pure refactor commit which updates the ForEachNode method to make use
of the new sqldb.ExecuteCollectAndBatchWithSharedDataQuery helper.
2025-08-05 06:36:34 +02:00
Elle Mouton 905941067e sqldb: add ExecuteCollectAndBatchWithSharedDataQuery helper
In this commit we add a new helper method in the sqldb package:
ExecuteCollectAndBatchWithSharedDataQuery. This can be used to paginate
through items in the database while at the same time performing batch
data collection for those items.
2025-08-05 06:34:38 +02:00
Elle Mouton 1a60edbd33 make+graph/db: add -short helper and skip tests in short mode
In this commit, we add a makefile helper that can be used to add the
"-short" flag to the "go test" command when running unit tests via "make
unit ...".

Tests can then be expanded with a `testing.Short()` check to potentially
skip the test in short mode. This is useful for if a dev wants to
quickly run most of the tests in a package but would like to opt out of
running the longer form tests such as stress tests or rapid generation
tests.

This commit adds this check to two graph/db tests.
2025-08-05 06:34:38 +02:00
Oliver Gugger e10cb0174e docs: explain what "visual symmetry" means 2025-08-04 16:34:18 +02:00
Oliver Gugger 46b1897d03 docs: document formatting for slice definitions
Adds more clarity around when to use what style for using inline
slice definitions.
2025-08-04 16:26:41 +02:00
Oliver Gugger 7152224b22 Merge pull request #10118 from ellemouton/graphPerf5
[4] sqldb+graph/db: add and use new pagination helper
2025-08-04 05:04:50 -06:00
Yong 21726f0179 Merge pull request #9826 from ziggie1984/refactor-payments-code-02
Refactor Payment PR 2
2025-08-04 17:01:30 +08:00
yyforyongyu 4d7622ab05 docs: add and update release notes for 0.19.3 2025-08-04 16:50:34 +08:00
yyforyongyu ab8e0354ab sweep: fix typos 2025-08-04 16:50:34 +08:00
yyforyongyu 3da4093012 itest: fix tests re the new anchor behavior 2025-08-04 16:50:31 +08:00
Elle 8f94929a27 Merge pull request #9993 from MPins/issue-9904-9915
Validate UTF-8 description and empty route hints when parsing BOLT-11 invoices
2025-08-04 10:32:07 +02:00
yyforyongyu 5ee54b34ce sweep: only remove the other input from the exclusive group
We now make sure when removing inputs identified by the exclusive group
ID, we only remove the other one, not the one that invoked the removal.
2025-08-04 16:20:25 +08:00
yyforyongyu ae08a75410 contractcourt+sweep: make anchor inputs exclusive
We now make sure to sweep each anchor input in its own sweeping tx, if
economically feasible.
2025-08-04 16:07:33 +08:00
yyforyongyu 7c46ba19ca docs: update gossip rate limiting doc 2025-08-04 15:55:11 +08:00
yyforyongyu fc11e48585 discovery: fix make lint 2025-08-04 15:47:12 +08:00
yyforyongyu 84532e27f9 docs: add release notes for ban-threshold 2025-08-04 15:46:17 +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
yyforyongyu 3109a8f3fe discovery: pass banThreshold to banman
So we can configure it via gossip's config in a following commit.
2025-08-04 15:44:35 +08:00
yyforyongyu 343418cfdf docs: update release notes 2025-08-04 15:44:34 +08:00
yyforyongyu 11c53b7212 discovery: increase peer's ban score when received skewed channel_update 2025-08-04 15:44:34 +08:00
yyforyongyu c3780a230c discovery: use handleBadPeer to increase peer's ban score 2025-08-04 15:44:34 +08:00
yyforyongyu f1b2a47717 discovery: add new method handleBadPeer
So we can use the same piece of code elsewhere.
2025-08-04 15:44:34 +08:00
yyforyongyu 9cae62dcd7 discovery: only send node_announcement associated with channels
If a node doesn't have any channels, there's little point to send its
node_announcement as it cannot be used for routing.
2025-08-04 15:44:34 +08:00
yyforyongyu f00073e62c discovery: skip sending channel_announcement with no channel_updates
Base on BOLT07:
> If a channel_announcement has no corresponding channel_updates:
>   - MUST NOT send the channel_announcement.
2025-08-04 15:44:33 +08:00
Yong 6c39b9a3d4 Merge pull request #10097 from Roasbeef/gossip-block-fix
multi: make gossip filter sends non-blocking, only allow a single backlog catch up goroutine per peer
2025-08-04 15:43:33 +08:00
Yong 149a81911a Merge pull request #10087 from starius/estimate-feerate-allow-1
walletrpc: allow conf_target=1 in EstimateFee and FundPsbt
2025-08-04 14:08:42 +08:00
ziggie 2b3b27f5a9 multi: fix linter issues 2025-08-02 13:24:27 +02:00
ziggie 0aef5fa44c multi: unify all payment related kv data
All interactions related to the payment db are now part of the
kvPaymentDB struct.
2025-08-02 13:24:27 +02:00
ziggie aaa1ee0b74 channeldb: move kv related code
We move all kv particular code which was in the payments.go file
to the kv related file. Code which will be backend independant
will remain in the payments.go file although only the kv backend
is currently supported.
2025-08-02 13:24:25 +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
ziggie 84b2a94da2 multi: fix linter issues 2025-08-02 13:21:45 +02:00
ziggie 8bd4744ee8 channeldb: rename pControl to paymentDB in tests 2025-08-02 11:48:01 +02:00
ziggie 2d07d44d1a channeldb: rename PaymentControl struct
In the following commits we will gradually unify the current
payment db operations into an interface to later down the road
support both backends (sql+kv).
2025-08-02 11:24:59 +02:00
Boris Nagaev aacb94c6d3 doc: add release note (EstimateFee conf_target 1) 2025-08-01 17:16:02 -03:00
Boris Nagaev c22768283c walletrpc: allow conf_target=1 in FundPsbt
Modified 'fund_psbt' itest to test this scenario.
2025-08-01 17:16:02 -03:00
Boris Nagaev cd6e648a7f itest: add test for walletrpc.EstimateFee
Make sure conf_target=1 is accepted, but conf_target=0 is not.
2025-08-01 17:16:00 -03:00
Boris Nagaev b0e9a4b79f walletrpc: allow conf_target=1 in EstimateFee
See https://github.com/lightningnetwork/lnd/pull/9611#issuecomment-3082770038
2025-08-01 17:15:09 -03:00
MPins 2815d4922c doc: release-notes-0.20.0 2025-08-01 13:09:33 -07:00
MPins e61d971ce4 zpay32: test case for empty routing hints on r fields 2025-08-01 13:09:25 -07:00
MPins 16187f047a zpay32: validate empty routing hints when parsing r fields 2025-08-01 13:09:17 -07:00
MPins b8acca2c89 zpay32: test case for parsing non UTF-8 description 2025-08-01 13:09:04 -07:00
MPins 2b1a89fbaf zpay32: validate UTF-8 parsing field description 2025-08-01 13:08:31 -07:00
Olaoluwa Osuntokun 8dcb7a8f8b docs/release-notes: add release notes entry 2025-08-01 11:20:22 -05:00
Olaoluwa Osuntokun 7e767eac82 discovery: only permit a single gossip backlog goroutine per peer
In this commit, we add a new atomic bool to only permit a single gossip
backlog goroutine per peer. If we get a new reuqest that needs a backlog
while we're still processing the other, then we'll drop that request.
2025-08-01 11:20:22 -05:00
Olaoluwa Osuntokun 5fcd33c50c discovery: add tests for for async timestamp range queue 2025-08-01 11:20:22 -05:00
Olaoluwa Osuntokun ed717a120a docs: add comprehensive gossip rate limiting guide
In this commit, we add detailed documentation to help node operators
understand and configure the gossip rate limiting system effectively.
The new guide addresses a critical knowledge gap that has led to
misconfigured nodes experiencing synchronization failures.

The documentation covers the token bucket algorithm used for rate
limiting, providing clear formulas and examples for calculating
appropriate values based on node size and network position. We include
specific recommendations ranging from 50 KB/s for small nodes to
1 MB/s for large routing nodes, with detailed calculations showing
how these values are derived.

The guide explains the relationship between rate limiting and other
configuration options like num-restricted-slots and the new
filter-concurrency setting. We provide troubleshooting steps for
common issues like slow initial sync and peer disconnections, along
with debug commands and log patterns to identify problems.

Configuration examples are provided for conservative, balanced, and
performance-oriented setups, giving operators concrete starting points
they can adapt to their specific needs. The documentation emphasizes
the importance of not setting rate limits too low, warning that values
below 50 KB/s can cause synchronization to fail entirely.
2025-08-01 11:20:21 -05:00
Olaoluwa Osuntokun 7f16b24192 multi: wire up gossip filter concurrency config
In this commit, we complete the integration of the configurable gossip
filter concurrency by wiring the new FilterConcurrency configuration
through all layers of the application.

The changes connect the gossip.filter-concurrency configuration option
from the command-line interface through the server initialization code
to the gossiper and sync manager. This ensures that operators can
actually use the new configuration option to tune their node's
concurrent gossip filter processing capacity based on their specific
requirements and available resources.
2025-08-01 11:20:21 -05:00
Olaoluwa Osuntokun f3ba372441 discovery: integrate async queue in ProcessRemoteAnnouncement
In this commit, we complete the integration of the asynchronous
timestamp range queue by modifying ProcessRemoteAnnouncement to use
the new queuing mechanism instead of calling ApplyGossipFilter
synchronously.

This change ensures that when a peer sends a GossipTimestampRange
message, it is queued for asynchronous processing rather than
blocking the gossiper's main message processing loop. The modification
prevents the peer's readHandler from blocking on potentially slow
gossip filter operations, maintaining connection stability during
periods of high synchronization activity.

If the queue is full when attempting to enqueue a message, we log
a warning but return success to prevent peer disconnection. This
design choice prioritizes connection stability over guaranteed
delivery of every gossip filter request, which is acceptable since
peers can always resend timestamp range messages if needed.
2025-08-01 11:20:21 -05:00