Merge pull request #10102 from yyforyongyu/fix-UpdatesInHorizon

Catch bad gossip peer and fix `UpdatesInHorizon`
This commit is contained in:
Yong authored and GitHub committed 2025-08-20 22:35:31 +08:00
commit 0c2f045f5d
12 files changed
+189 -75

No files matched your search

+19
View File
@@ -62,6 +62,25 @@ Large routing nodes handling many simultaneous peer connections might benefit
from increasing this value to 10 or 15, while resource-constrained nodes should
keep it at the default or even reduce it slightly.
### Preventing Spam: gossip.ban-threshold
To protect your node from spam and misbehaving peers, LND uses a ban score
system controlled by `gossip.ban-threshold`. Each time a peer sends a gossip
message that is considered invalid, its ban score is incremented. Once the score
reaches this threshold, the peer is banned for a default of 48 hours, and your
node will no longer process gossip messages from them.
A gossip message can be considered invalid for several reasons, including:
- Invalid signature on the announcement.
- Stale timestamp, older than what we already have.
- Too many channel updates for the same channel in a short period.
- Announcing a channel that is not found on-chain.
- Announcing a channel that has already been closed.
- Announcing a channel with an invalid proof.
The default value is 100. Setting this value to 0 disables banning completely,
which is not recommended for most operators.
### Understanding Connection Limits: num-restricted-slots
The `num-restricted-slots` configuration deserves special attention because it
@@ -38,6 +38,10 @@
messages in the dynamic commitment set.
- [Fixed](https://github.com/lightningnetwork/lnd/pull/10102) a case that we may
send unnecessary `channel_announcement` and `node_announcement` messages when
replying to a `gossip_timestamp_filter` query.
# New Features
* Use persisted [nodeannouncement](https://github.com/lightningnetwork/lnd/pull/8825)
@@ -95,6 +99,12 @@ circuit. The indices are only available for forwarding events saved after v0.20.
a canceled invoice. Supports deleting a canceled invoice by providing its
payment hash.
* A [new config](https://github.com/lightningnetwork/lnd/pull/10102)
`gossip.ban-threshold` is added to allow users to configure the ban score
threshold for peers. When a peer's ban score exceeds this value, they will be
disconnected and banned. Setting the value to 0 effectively disables banning
by setting the threshold to the maximum possible value.
## lncli Additions
* [`lncli sendpayment` and `lncli queryroutes` now support the