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

multi: add and use V1 constructor for models.ChannelEdgeInfo

Public commit record

What the developer wrote

Authored by Elle Mouton

83/100 · Strong
multi: add and use V1 constructor for models.ChannelEdgeInfo

This makes it clear what fields must/can be set for a V1 channel.

Introduce NewV1Channel constructor to create v1 channel edges with
proper initialization and validation. The constructor:

- Takes required fields (chanID, chainHash, node keys) as parameters
- Takes v1-specific fields (bitcoin keys, extra opaque data) via
ChannelV1Fields struct
- Accepts optional fields (capacity, channel point, features, proof)
via functional options (WithCapacity, WithChannelPoint, etc.)
- Validates that if an AuthProof is provided, its version matches the
channel version

This makes it clear which fields are required vs optional for v1
channels and prevents incorrectly initialized channel edges. All
tests and production code updated to use the constructor.
✓ Specific, 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 is a code-quality and safety refactor for LND's Lightning channel graph data structures. It introduces a single, controlled constructor for creating V1 channel records, replacing many places where fields were set by hand. The change makes it harder to accidentally create an invalid or inconsistent channel record, and adds a check that any attached proof matches the channel version. It is not an obvious security fix for an active vulnerability, but it reduces the risk of future bugs in how the network graph is built and validated.

Recommended action

Treat as a hardening/refactor commit. Review the new constructor's validation logic for completeness, ensure the AuthProof version check is exercised by tests, and verify that no production path can bypass the constructor to create an inconsistent ChannelEdgeInfo. No urgent patch or incident response is indicated by the supplied materials.

Security signals we found

01

New constructor centralizes validation of ChannelEdgeInfo creation

02

Added version-consistency check between AuthProof.Version and ChannelEdgeInfo.Version

03

Replaces scattered manual struct initialization, reducing risk of partially-initialized channel edges

04

No direct bug or CVE described in commit message or diff

05

Large refactor (+853/-575) across 18 files, mostly test updates

Risk score

Why this scored 27/100

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