Skip to content

Commit a795aa6

Browse files
Merge pull request #976 from lightninglabs/docs-lnd
Update lnd documentation
2 parents 3f63b1d + 1becac0 commit a795aa6

File tree

2 files changed

+49
-35
lines changed

2 files changed

+49
-35
lines changed

docs/lnd/estimate_route_fee.md

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -150,52 +150,58 @@ probing.
150150

151151
The heuristic examines the structure of route hints provided in the invoice to
152152
identify characteristic LSP patterns. The detection operates on the principle
153-
that LSPs typically maintain private channels to their users and appear as the
154-
penultimate hop in payment routing.
153+
that LSPs typically maintain private channels to their users and appear as
154+
public nodes in the network, while the final destination is private.
155155

156156
```mermaid
157157
flowchart TD
158158
Start([Route Hints Received]) --> Empty{Empty Hints?}
159159
Empty -->|Yes| NotLSP([Not LSP])
160-
Empty -->|No| GetFirst[Get First Hint's Last Hop]
161-
162-
GetFirst --> CheckPub1{Is Channel<br/>Public?}
163-
CheckPub1 -->|Yes| NotLSP
164-
CheckPub1 -->|No| SaveNode[Save Node ID]
165-
166-
SaveNode --> MoreHints{More Hints?}
167-
MoreHints -->|No| IsLSP([Detected as LSP])
160+
Empty -->|No| CheckTarget{Invoice Target<br/>in Graph?}
161+
162+
CheckTarget -->|Yes| NotLSP
163+
CheckTarget -->|No| GetFirstDest[Get First Hint's<br/>Destination Hop]
164+
165+
GetFirstDest --> CheckPub1{Destination Node<br/>in Graph?}
166+
CheckPub1 -->|Yes| IsLSP([Detected as LSP])
167+
CheckPub1 -->|No| MoreHints{More Hints?}
168+
169+
MoreHints -->|No| NotLSP
168170
MoreHints -->|Yes| NextHint[Check Next Hint]
169-
170-
NextHint --> GetLast[Get Last Hop]
171-
GetLast --> CheckPub2{Is Channel<br/>Public?}
172-
CheckPub2 -->|Yes| NotLSP
173-
CheckPub2 -->|No| SameNode{Same Node ID<br/>as First?}
174-
175-
SameNode -->|No| NotLSP
176-
SameNode -->|Yes| MoreHints
177-
```
178171
179-
The detection criteria are:
172+
NextHint --> GetNextDest[Get Destination Hop]
173+
GetNextDest --> CheckPub2{Destination Node<br/>in Graph?}
174+
CheckPub2 -->|Yes| IsLSP
175+
CheckPub2 -->|No| MoreHints
176+
```
180177

181-
- **All route hints must terminate at the same node ID** - This indicates a
182-
single destination behind potentially multiple LSP entry points
178+
The detection follows three simple rules applied sequentially:
183179

184-
- **Final hop channels must be private** - The channels in the last hop of
185-
each route hint must not exist in the public channel graph
180+
**Rule 1: Public Invoice Target → NOT an LSP**
181+
- If the invoice target (destination) is a public node that exists in the
182+
channel graph, the payment can be routed directly to it
183+
- This means it's not an LSP setup, regardless of what route hints are provided
184+
- Example: A well-connected merchant node with route hints for liquidity
185+
signaling
186186

187-
- **No public channels in final hops** - If any route hint contains a public
188-
channel in its final hop, LSP detection is disabled entirely
187+
**Rule 2: Public Destination Hop → IS an LSP**
188+
- If at least one route hint has a destination hop (last hop in the route hint)
189+
that is a public node in the graph, LSP detection is triggered
190+
- This indicates the destination hop is an LSP serving a private client
191+
- The private client is reached through the LSP's private channel
189192

190-
- **Multiple route hints strengthen detection** - While not required,
191-
multiple hints converging on the same destination strongly suggest an LSP
192-
configuration
193+
**Rule 3: All Private Destination Hops → NOT an LSP**
194+
- If all destination hops in all route hints are private nodes (not in the
195+
public graph), this is not treated as an LSP setup
196+
- The payment will be routed directly to the invoice destination using the
197+
route hints as additional path information
198+
- This is the standard case for private channel payments
193199

194200
This pattern effectively distinguishes LSP configurations from other routing
195201
scenarios. For instance, some Lightning implementations like CLN include route
196202
hints even for public nodes to signal liquidity availability or preferred
197-
routing paths. The heuristic correctly identifies these as non-LSP scenarios by
198-
detecting the presence of public channels.
203+
routing paths. The heuristic correctly identifies these as non-LSP scenarios
204+
by Rule 1 (detecting that the invoice target itself is public).
199205

200206
### How Probing Differs When an LSP is Detected
201207

@@ -432,10 +438,6 @@ appropriately.
432438
The `EstimateRouteFee` implementation continues to evolve based on real-world
433439
usage patterns. Ongoing discussions in the LND community focus on:
434440

435-
**Improved LSP Detection**: Developing more sophisticated heuristics that
436-
accurately identify LSP configurations while avoiding false positives for
437-
regular private channels.
438-
439441
**Multi-Path Payment Support**: Extending fee estimation to support MPP
440442
scenarios where payments split across multiple routes.
441443

docs/lnd/release-notes/release-notes-0.20.1.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
in the mission control store. Now we skip over potential errors and also
4343
delete them from the store.
4444

45+
* [Fix potential sql tx exhaustion
46+
issue](https://github.com/lightningnetwork/lnd/pull/10428) in LND which might
47+
happen when running postgres with a limited number of connections configured.
48+
4549
# New Features
4650

4751
## Functional Enhancements
@@ -55,6 +59,14 @@
5559

5660
## RPC Updates
5761

62+
* The `EstimateRouteFee` RPC now implements an [LSP detection
63+
heuristic](https://github.com/lightningnetwork/lnd/pull/10396) that probes up
64+
to 3 unique Lightning Service Providers when route hints indicate an LSP
65+
setup. The implementation returns worst-case (most expensive) fee estimates
66+
for conservative budgeting and includes griefing protection by limiting the
67+
number of probed LSPs. It enhances the previous LSP design by being more
68+
generic and more flexible.
69+
5870
## lncli Updates
5971

6072
## Breaking Changes

0 commit comments

Comments
 (0)