AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 32 Bitcoin

graph/db: version ForEachNodeDirectedChannel and cacheable traversal

Public commit record

What the developer wrote

Authored by Elle Mouton

85/100 · Strong
graph/db: version ForEachNodeDirectedChannel and cacheable traversal

Add a gossip version parameter to ForEachNodeDirectedChannel on the
Store interface and both DB implementations (KVStore, SQLStore). The
NodeTraverser and routing.Graph interfaces remain unversioned since
pathfinding operates on the merged cross-version cache view.

The cache population in populateCache is updated in the same commit
because it is logically atomic with the versioning changes: the graph
cache is the unversioned, merged view used by pathfinding, so it must
be populated with data from all gossip versions. Without this change,
only v1 data would be loaded into the cache, making v2 nodes and
channels invisible to pathfinding.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a multi-version gossip data handling bug in LND's channel graph. Previously, the in-memory graph cache only loaded v1 gossip data, so newer v2 nodes and channels could become invisible to pathfinding. The change populates the cache from both v1 and v2, and adds version parameters to the underlying database traversal methods. It is a correctness/availability fix for Lightning routing rather than a direct exploit.

Recommended action

Treat as a functional/availability fix. Review whether the no-cache v1 fallback in ChannelGraph.ForEachNodeDirectedChannel needs to be completed before v2-only deployments rely on it. Monitor for any follow-up commits addressing the TODOs.

Security signals we found

01

Multi-version data merge bug could cause routing to ignore v2 channels/nodes

02

Graph cache inconsistency between v1 and v2 data

03

No-cache fallback still hardcoded to v1, leaving partial coverage

04

ErrVersionNotSupportedForKVDB handling added for non-v1 KVStore traversal

Risk score

Why this scored 32/100

Our methodology →
Potential impact 8/30
Exploitability 3/25
Stealth signal 5/15
Affected reach 6/15
Confidence 7/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.