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

graph/db: version ChannelView and add v2 queries

Public commit record

What the developer wrote

Authored by Elle Mouton

78/100 · Adequate
graph/db: version ChannelView and add v2 queries

Add a gossip version parameter to ChannelView in the Store interface,
KV and SQL implementations, and the ChannelGraph wrapper. The KVStore
guards v2 requests with ErrVersionNotSupportedForKVDB; the SQLStore
filters by the requested version.

Add three new SQL queries to support version-scoped channel lookups:

- GetPublicV1ChannelsBySCID: public v1 channels in a SCID range,
ordered by SCID.
- GetPublicV2ChannelsBySCID: public v2 channels in a SCID range,
ordered by SCID.
- ListChannelsPaginatedV2: paginate v2 channels by internal DB ID,
used by ChanUpdateRange.

Add TestVersionedDBs/channel_view to verify that v1 and v2 channel
views each return only their respective channels.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit extends the Lightning Network graph database so it can separately handle two different channel announcement formats (v1 and v2). It adds version-aware queries and makes the channel-view lookup respect the requested gossip version. There is no obvious security bug in the patch; it appears to be a feature/refactoring change to support dual-version gossip. The most notable security-relevant detail is that the older KV database backend now refuses v2 channel-view requests, while the newer SQL backend can serve both versions.

Recommended action

Treat as a normal feature/refactoring review. Verify that KVStore's ErrVersionNotSupportedForKVDB is handled by all callers of ChannelView, and that SQL version branching does not accidentally mix v1 and v2 data. Confirm the new unit test covers both v1 and v2 paths as claimed. No immediate security patch is indicated by the diff alone.

Security signals we found

01

API versioning change that prevents KV backend from serving v2 channel views (defensive fail-closed behavior)

02

New SQL queries filter by gossip version and public-channel criteria (signature presence)

03

ChannelView now returns version-scoped results instead of an unversioned global view

04

No input validation, authorization, or cryptographic changes observed

05

No vendor disclosure or CVE references present in commit or supplied materials

Risk score

Why this scored 32/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 5/15
Confidence 8/10
Evidence quality 4/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.