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

sqldb/sqlc: split public-only node horizon query and upgrade channel indexes

Public commit record

What the developer wrote

Authored by Elle Mouton

73/100 · Adequate
sqldb/sqlc: split public-only node horizon query and upgrade channel indexes

Split GetNodesByLastUpdateRange into two query variants: one for all
nodes and a new GetPublicNodesByLastUpdateRange for public-only nodes.
The public-only variant uses two separate EXISTS checks (one per
node_id column) instead of a single OR, allowing the planner to do
direct index probes on each channel node-id index.

Also upgrade the channel node-id indexes from single-column
(node_id_1) and (node_id_2) to composite (node_id_1, version) and
(node_id_2, version) to support version-aware public node checks
while preserving usefulness for node-centric lookups.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit is a performance and correctness improvement for LND's channel graph database queries. It splits one database query into two specialized versions—one that returns all nodes and one that returns only publicly announced nodes—and updates database indexes to make the public-node check faster. There is no direct security vulnerability being patched; it is a query optimization and schema refinement.

Recommended action

Treat as a routine performance/correctness improvement. Review the migration for large-table index rebuild impact and verify the new test passes. No urgent security action is required.

Security signals we found

01

No security-relevant behavior change: the public/private node classification logic is unchanged

02

Query optimization only: split OR predicate into two EXISTS probes to enable index usage

03

Schema migration adds composite indexes including version column

04

New regression test added for public-only node horizon filtering

Risk score

Why this scored 22/100

Our methodology →
Potential impact 5/30
Exploitability 0/25
Stealth signal 0/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.