`NetworkGraph`: Update node and channel count estimates for Jan 2026
What changed, and why it matters
This commit simply updates two internal capacity estimates in the Lightning network routing code to reflect the current size of the public Lightning network. It changes how much memory is initially reserved for channel and node data structures. There is no security issue.
No security action needed. Treat as routine maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates CHAN_COUNT_ESTIMATE from 60,000 to 63,000 and NODE_COUNT_ESTIMATE from 15,000 to 20,000 in lightning/src/routing/gossip.rs. These constants are used to pre-allocate HashMap/HashSet capacity in NetworkGraph deserialization and construction, reducing reallocation as the graph grows. The values are based on observed mainnet network size in January 2026. This is a routine tuning change with no functional, cryptographic, or protocol impact.
Changed components
lightning/src/routing/gossip.rsNetworkGraph capacity estimation constantsInspect captured patch +9 / −7
diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs
index 040a28c..ea72d97 100644
--- a/lightning/src/routing/gossip.rs
+++ b/lightning/src/routing/gossip.rs
@@ -1772,13 +1772,15 @@ where
}
}
-// In Jan, 2025 there were about 49K channels.
-// We over-allocate by a bit because 20% more is better than the double we get if we're slightly
-// too low
-const CHAN_COUNT_ESTIMATE: usize = 60_000;
-// In Jan, 2025 there were about 15K nodes
-// We over-allocate by a bit because 33% more is better than the double we get if we're slightly
-// too low
+/// In Jan, 2026 there were about 54K channels.
+///
+/// We over-allocate by a bit because ~15% more is better than the double we get if we're slightly
+/// too low.
+const CHAN_COUNT_ESTIMATE: usize = 63_000;
+/// In Jan, 2026 there were about 17K nodes
+///
+/// We over-allocate by a bit because 15% more is better than the double we get if we're slightly
+/// too low.
const NODE_COUNT_ESTIMATE: usize = 20_000;
impl<L: Deref> NetworkGraph<L>
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.