LL
← All projectsLightning Labs

LND

Go implementation of a complete Lightning Network node.

BitcoinLightning NetworkNormal
Repository coverage

1239 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

116security candidates168second-pass queue948AI analyses
55commits · 30 days
169commits · 60 days
828commits · 180 days
1227commits · 365 days
Backfill bands
Aug 5 → Feb 6405 seen5 candidatesComplete
Feb 6 → Jun 6665 seen28 candidatesComplete
Jun 6 → Jul 689 seen4 candidatesComplete
Jul 6 → Aug 569 seen0 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

67/100 average clarity
279Strong · 80–100
562Adequate · 60–79
367Thin · 40–59
31Opaque · 0–39
1security candidate with opaque commit messaging
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
Olaoluwa Osuntokun19940143374
ziggie41015321164
Jared Tobin908171
Elle Mouton26731207067
Erick Cestari26724070
bitromortac46543067
yyforyongyu55345065
saubyk15213070
Oli727057
Suheb323075
elnosh323071
George Tsagkarelis32120066
Analysis record

Published AI watches

Last scanned 16 minutes ago

Moderate 63 AI analysisMessage 58 · Thin
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11024 from ziggie1984/invoices-update-validation

This commit tightens how LND processes invoice payments, especially for newer multi-path (MPP) and AMP invoices, keysend payments, and replayed payments. It adds checks that ensure the right payment preimage is used for each invoice type a…

Preimage validation added for AMP and regular invoice replaysAMP invoices forced into MPP update path, preventing legacy-path processingLegacy settlement now fails when invoice-level preimage is missing
61f3b5a7by ziggieXXX+482−114 files
No security note in commit
Moderate 59 AI analysisMessage 35 · Opaque
LL Lightning LabsLND BitcoinLightning Network

invoices: refine update handling

This commit tightens how LND handles invoice payment updates, especially for newer 'AMP' invoices and old-style 'keysend' payments. It adds checks so that the wrong kind of payment cannot be processed against the wrong kind of invoice, and…

Added preimage/hash mismatch checks for both regular and AMP invoice replaysAMP records now require an MPP payload, preventing AMP processing on the legacy pathLegacy path now rejects AMP invoices and invoices missing invoice-level preimages
6be6350eby ziggie+476−113 files
No security note in commit
Informational 15 AI analysisMessage 57 · Thin
LL Lightning LabsLND BitcoinLightning Network

docs: update 0.21.2 release notes

This commit only updates the release notes document for version 0.21.2. It adds a bullet point describing a previously merged code change about invoice handling and adds a contributor name to the credits list. No actual code was changed, s…

758bbb8eby ziggie+6−01 file
No security note in commit
Informational 15 AI analysisMessage 57 · Thin
LL Lightning LabsLND BitcoinLightning Network

docs: move gossip bounds note to v0.21.2

This commit only moves an existing release-note entry from one version's notes (v0.22.0) to another (v0.21.2). It does not change any code, build files, configuration, or tests. The change is purely editorial documentation bookkeeping.

83e7eb8cby ziggie+11−112 files
No security note in commit
High 72 AI analysisMessage 68 · Adequate
LL Lightning LabsLND BitcoinLightning Network

discovery: bound channel range reply buffering

This change fixes a way a malicious or buggy peer could make an LND node use an unpredictable amount of memory while syncing the Lightning channel graph. Before the fix, the node only limited the size of one compressed reply message, but a…

Resource exhaustion / unbounded memory growth in gossip syncRemote peer can influence memory allocation via ReplyChannelRange streamMissing aggregate limit on decoded working set
ceff94faby Olaoluwa Osuntokun+335−153 files
Vendor flagged security relevance
Low 33 AI analysisMessage 47 · Thin
LL Lightning LabsLND BitcoinLightning Network

docs: update release notes

This commit updates the release notes for LND 0.21.2 to describe a fix for a bug in the HTLC interceptor RPC. The bug caused LND to fail to forward payments in blinded routes when the next hop was identified by node ID instead of channel I…

Blinded route forwarding failure could disrupt payment routing or be used to probe path structure.Sentinel value change in RPC API could cause client misclassification of forwards if not handled.Release notes describe the change as a fix for a forwarding issue, not as a security vulnerability.
f42b4298by bitromortac+20−01 file
No security note in commit
Informational 14 AI analysisMessage 83 · Strong
LL Lightning LabsLND BitcoinLightning Network

itest: cover blinded route next_node_id forwarding

This commit only adds new integration tests for an existing feature in LND: forwarding blinded payments where the next hop is identified by node ID rather than channel ID. It does not change production code, fix a bug, or introduce any new…

da6a40c0by bitromortac+432−02 files
No security note in commit
Low 25 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

witness beacon: report node-ID next hop to the on-chain HTLC interceptor

This change fixes a reporting gap in LND's 'witness beacon,' a component that watches on-chain transactions and tells the HTLC interceptor where a payment should go next. Previously, when the next hop was identified by a node ID rather tha…

Missing security-critical metadata in on-chain interception pathBehavioral parity between on-chain and off-chain HTLC interceptionPotential misclassification of node-ID forwards as final receives
9c4b8bfeby bitromortac+59−52 files
No security note in commit
Moderate 59 AI analysisMessage 81 · Strong
LL Lightning LabsLND BitcoinLightning Network

htlcswitch: forward node-ID blinded hops via non-strict forwarding

This commit fixes a bug in LND's payment forwarding for 'blinded routes'—a privacy feature in the Lightning Network. Previously, if the next hop was identified by node ID rather than a specific channel ID, the payment could not be forwarde…

Fixes a functional forwarding failure for blinded-route payments using node-ID next hops (issue #10937).Prevents private channel SCID leakage in failure messages for node-ID blinded hops by returning FailUnknownNextPeer instead of a channel_update.Adds circular-route filtering for node-ID next hops before non-strict forwarding selection.
dbc57040by bitromortac+334−416 files
No security note in commit
Informational 19 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

htlcswitch+lnrpc: report node-ID next hop to the off-chain HTLC interceptor

This change improves how the Lightning Network Daemon (LND) reports forwarding details to external plugins that inspect HTLCs (payment packets). For a new type of blinded route where the next hop is identified by node ID rather than a spec…

Information-correctness fix for HTLC interceptor APIPrevents misclassification of node-ID forwards as exit hopsAdds explicit sentinel to disambiguate zero SCID semantics
32373b76by bitromortac+29−13 files
No security note in commit
Low 25 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

htlcswitch: classify a node-ID forward as a forward event

This commit fixes a bookkeeping bug in LND's HTLC event stream. When a payment is forwarded to a 'blinded' next hop identified only by a node public key (not a channel ID), and it fails before the switch picks an outgoing channel, the even…

Event misclassification in HTLC event stream (forward reported as receive)Blinded/node-ID forwarding path introduced prior to this fixFailure and resolution packets dropped next-hop metadata before fix
a4844ef5by bitromortac+149−04 files
No security note in commit
Low 29 AI analysisMessage 68 · Adequate
LL Lightning LabsLND BitcoinLightning Network

htlcswitch/hop: decode next_node_id blinded hops

This commit adds support in LND for a different way of identifying the next hop in a private ('blinded') Lightning payment route. Previously LND expected the next hop to be identified by a channel ID; now it also accepts the next node's pu…

New validation enforces BOLT 4 mutual exclusivity of short_channel_id and next_node_id in blinded route dataPreviously ambiguous or unhandled next_node_id forwarding case now explicitly decodedNo memory-safety, cryptographic, or authorization changes observed
4fd4289aby bitromortac+471−86 files
No security note in commit
Moderate 60 AI analysisMessage 78 · Adequate
LL Lightning LabsLND BitcoinLightning Network

lnwire: cap decoded short channel IDs

This commit tightens a safety limit in LND's Lightning wire protocol parser. Previously, a compressed network message could decompress into an unbounded number of short channel IDs, potentially consuming far more memory than the wire messa…

Resource-limit bypass: compressed-input bound did not bound decoded outputMemory-exhaustion risk from zlib decompression of peer-supplied dataTruncated/corrupt zlib streams previously accepted as valid partial results
d1622919by Olaoluwa Osuntokun+271−502 files
No security note in commit
Informational 18 AI analysisMessage 85 · Strong
LL Lightning LabsLND BitcoinLightning Network

lnrpc/routerrpc: add outgoing_node_id to HTLC intercept request

This commit only updates the API definition and auto-generated code for LND's HTLC interceptor. It adds a new optional field, outgoing_requested_node_id, and documents that when a blinded route uses a node ID instead of a channel ID, the e…

No runtime logic changed; only protobuf schema and generated stubsNew field is explicitly documented as unpopulated until later commitsSentinel value (MaxUint64) introduced to prevent misclassification of final receive vs node-addressed forward
14640a50by bitromortac+48−73 files
No security note in commit
Informational 18 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

multi: represent the blinded forwarding next hop as an fn.Either

This commit is a behind-the-scenes code cleanup in the LND Lightning node. It changes how the 'next hop' for forwarding payments is stored internally so that, in the future, blinded routes can identify the next hop by a node's public key i…

Refactor of core HTLC forwarding data structure (ForwardingInfo.NextHop)Preparation for blinded route next-hop identification by node public keyEncapsulation of Either type behind IsExit() and NextHopChannel() to centralize exit-hop detection
d28a7176by bitromortac+83−2612 files
No security note in commit
Low 44 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

htlcswitch: key the aux traffic shaper on the evaluated channel

This commit fixes a routing bug in LND's Lightning payment forwarding. When a payment could take any of several parallel channels to the same next peer, the node was accidentally asking an optional 'auxiliary traffic shaper' about the chan…

Logic error: wrong channel identifier used for auxiliary policy/bandwidth checkPotential information disclosure: real SCID could leak if passed to shaper-driven wire messages; commit explicitly prevents thisParallel-channel forwarding correctness issue
b1667800by bitromortac+133−12 files
No security note in commit
Informational 15 AI analysisMessage 68 · Adequate
LL Lightning LabsLND BitcoinLightning Network

github: bump gateway code-review to v0.6.0

This commit updates a GitHub Actions workflow that runs an optional code-review bot called 'gateway'. It only changes two pinned version numbers (SHA hashes) for the bot's action and its runtime, moving from v0.5.0 to v0.6.0. There is no c…

17a4d42fby Suheb+4−41 file
No security note in commit
Moderate 58 AI analysisMessage 68 · Adequate
LL Lightning LabsLND BitcoinLightning Network

channeldb: recover missing db version

This patch fixes a database migration bug in LND's channel database. Some databases were created without recording their schema version number, which could cause future mandatory upgrades to be skipped. The fix detects that missing version…

Database schema version key can be absent due to an init-ordering regressionMissing version key previously caused migration selection to treat DB as latest, potentially skipping mandatory migrationsFix recovers baseline from last mandatory version before the regression (33)
68264c70by Elle Mouton+176−33 files
Vendor flagged security relevance
Informational 22 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

channeldb: make waiting proof migration repeatable

This commit fixes a database migration in LND so it can safely run twice. Previously, if a certain recovery process re-ran migration 35 on a database that already had newer-format 'waiting proof' records, the migration would likely fail or…

Database migration idempotency/robustness fixPotential data corruption or node startup failure if migration re-run against mixed-format bucketNo input validation of attacker-controlled data; issue is local/state-recovery only
3aff61aeby Elle Mouton+93−02 files
No security note in commit
Moderate 54 AI analysisMessage 76 · Adequate
LL Lightning LabsLND BitcoinLightning Network

channeldb: preserve db version during init

This commit fixes a database initialization bug in LND's channel database. Previously, creating an empty metadata bucket during setup could trick the code into thinking an old or partially-created database was already fully up-to-date, pot…

Database version detection logic flawPotential migration skip due to incorrect initialized-state detectionNew explicit error for missing DB version key
619913bfby Elle Mouton+111−104 files
No security note in commit
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Lower-prioritygraph/db: version ForEachNodeDirectedChannel and cacheable traversalby Elle Mouton · 0b1a1e3d · Feb 20, 2026 · 6 filesMessage 85 · StrongLow 32Details
Commit message · Elle Mouton

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.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 32/100

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.

Lower-prioritygraph/db: version cacheable iteration methodsby Elle Mouton · f5c91691 · Feb 20, 2026 · 7 filesMessage 78 · AdequateInformational 15Details
Commit message · Elle Mouton

graph/db: version cacheable iteration methods

Add gossip version parameters to ForEachNodeCacheable and
ForEachChannelCacheable in the Store interface and both implementations.

Thread the version through SQL helpers and update call sites/tests
accordingly.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit is a routine internal refactor: it adds a 'gossip version' parameter to two existing database iteration methods so callers can choose which protocol version to read. There is no security fix or vulnerability here. The change simply threads a version number through the code and rejects unknown/unsupported versions with an error.

Lower-prioritygraph/db: version fillTestGraph test helperby Elle Mouton · d48a1603 · Feb 20, 2026 · 1 fileMessage 78 · AdequateInformational 15Details
Commit message · Elle Mouton

graph/db: version fillTestGraph test helper

Make fillTestGraph version-aware and update its call sites to pass an
explicit gossip version (currently v1 at these call sites).

This is a test-helper refactor only; cacheable-iteration API versioning
is handled in the next commit.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only changes test code. It updates an internal test helper called fillTestGraph so it can build graph data for either version 1 or version 2 of Lightning's channel-announcement format. All real call sites still pass version 1, so production behavior is unchanged. There is no security issue here.

Lower-prioritygraph/db: add gossip version aliasesby Elle Mouton · 898e4ef8 · Feb 20, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Elle Mouton

graph/db: add gossip version aliases

Introduce gossipV1 and gossipV2 package-level aliases in sql_store.go
to reduce verbosity in version switch statements. Leave hard-coded
v1/v2 call sites untouched so remaining upgrades are obvious.

In other words, it is now easy to see where our remaining work in the
sql_store.go file is by just searching for instances of
`lnwire.GossipVersion1`.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit is a simple code cleanup in LND's graph database code. It creates two short aliases, gossipV1 and gossipV2, for the existing lnwire.GossipVersion1 and lnwire.GossipVersion2 constants, and replaces many long constant names with the shorter aliases. No behavior changes, no security fixes, and no new features are introduced.

Lower-prioritygraph/db: version ForEachSourceNodeChannelby Elle Mouton · 3ea2423f · Feb 20, 2026 · 6 filesMessage 68 · AdequateInformational 15Details
Commit message · Elle Mouton

graph/db: version ForEachSourceNodeChannel

Add a gossip version parameter to ForEachSourceNodeChannel in the Store
interface and both KV/SQL implementations. The VersionedGraph wrapper
delegates with its baked-in version. Convert the
testAddChannelEdgeShellNodes and testForEachSourceNodeChannel tests to
run against both v1 and v2 gossip versions.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit is a routine internal refactoring of how LND's channel graph database API passes around gossip protocol versions. It adds a version parameter to one function (ForEachSourceNodeChannel) and moves it from a non-versioned wrapper to a versioned wrapper. There is no security fix or vulnerability here; it is purely code maintenance and test expansion.

Lower-prioritygraph/db: version channelCache by gossip versionby Elle Mouton · 2aaa52ad · Feb 20, 2026 · 4 filesMessage 68 · AdequateLow 34Details
Commit message · Elle Mouton

graph/db: version channelCache by gossip version

Add a channelCacheKey struct keyed by {GossipVersion, chanID}, matching
the pattern already used by rejectCache. This prevents v1 and v2
channel data from colliding in the shared cache.

All callers in KVStore (always GossipVersion1) and SQLStore (version
from context) are updated to pass the version parameter.

This will be needed for later on when we update methods that use this
cache to be versioned (like ChannelUpdatesInHorizon).

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 34/100

This commit changes how LND caches Lightning channel information in memory so that entries are separated by gossip protocol version (v1 vs v2). Previously, the cache used only the channel ID, which could let data for the same channel under different protocol versions overwrite or collide with each other. The fix is preventive: it makes the cache key include the version, matching a similar fix already done for another cache. There is no direct evidence in the commit of an exploitable bug or security incident, but cache collisions between protocol versions could theoretically lead to stale or mixed routing data being served to peers.

Security candidatescripts: switch verify-install.sh from curl to wgetby ziggie · 99eceba7 · Feb 13, 2026 · 2 filesMessage 88 · StrongLow 29Details
Commit message · ziggie

scripts: switch verify-install.sh from curl to wget

Replace curl with wget for downloading release manifests and
signatures in verify-install.sh. wget handles redirects, retries, and
error reporting more robustly by default, which avoids silent download
failures that caused misleading "Invalid signature!" errors.

Also add error checking to all download calls so failures are reported
immediately with the URL that failed, and log which signature file and
user failed gpg verification.

88/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundarydefensive validation
AI analysis · Low 29/100

This commit changes the LND release verification helper script from using curl to using wget, and adds clearer error messages when downloads fail. The practical security issue being fixed is that curl could silently fail to download release signatures, which then made the script wrongly report 'Invalid signature!' instead of admitting the file simply didn't download. That misleading error could confuse users or hide network/download problems during install verification. It is a hardening/usability fix in a verification helper, not a fix for a vulnerability in the Lightning node itself.

Security candidateci: add verify-release workflowby ziggie · 5e3d6087 · Feb 13, 2026 · 1 fileMessage 90 · StrongInformational 12Details
Commit message · ziggie

ci: add verify-release workflow

Add a workflow that triggers when a release is published. It runs
verify-install.sh inside the official Docker image to validate
signatures and binary hashes. If verification fails, the release
is automatically set back to draft.

90/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
signing boundarydefensive validationdocumentation-only discount
AI analysis · Informational 12/100

This commit adds a new GitHub Actions workflow that automatically checks a newly published LND software release for valid digital signatures and matching binary hashes. If the check fails, the release is reverted to draft status so users are not exposed to a potentially bad release. It is a defensive hardening change, not a vulnerability fix or malicious change.

Security candidatescripts: log failing signature details in verify-installby ziggie · b7c47559 · Feb 13, 2026 · 1 fileMessage 88 · StrongInformational 19Details
Commit message · ziggie

scripts: log failing signature details in verify-install

When gpg --verify fails, include the signature filename, username,
and full GPG output in the error message. Previously only a generic
"Invalid signature!" was printed, making it hard to identify which
signer's signature was invalid.

88/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundary
AI analysis · Informational 19/100

This commit improves an error message in a release-verification script. When a GPG signature check fails, it now prints the signature filename, the username, and the full GPG output instead of just a generic 'Invalid signature!' message. This is a usability/debugging improvement, not a security fix.

Lower-priorityci: use haiku model for issue dedupe workflowby Elle Mouton · 5f429f0a · Feb 13, 2026 · 1 fileMessage 80 · StrongInformational 15Details
Commit message · Elle Mouton

ci: use haiku model for issue dedupe workflow

Switch the claude-dedupe-issues workflow from the default (most
expensive) model to claude-haiku-4-5, which is significantly cheaper
and sufficient for issue duplicate detection.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit changes a GitHub automation workflow to use a cheaper AI model for detecting duplicate bug reports. It is a cost-saving configuration change with no security relevance.

Lower-priorityscripts: use ephemeral gocache in check-each-commitby Andras Banki-Horvath · 75de3e3b · Feb 13, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Andras Banki-Horvath

scripts: use ephemeral gocache in check-each-commit

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This change modifies a developer script so that each time it runs, it uses a temporary, throwaway Go build cache instead of the user's normal cache. It then deletes that temporary cache when the script finishes. This is a housekeeping fix to prevent the build cache from growing too large on disk over time. It does not change any code that handles money, network messages, cryptography, or user data, and it does not fix a security vulnerability.

Lower-prioritydocs: add release notes for gossip v2 policy supportby Elle Mouton · 4d4b42d0 · Feb 13, 2026 · 2 filesMessage 62 · AdequateInformational 15Details
Commit message · Elle Mouton

docs: add release notes for gossip v2 policy support

62/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only updates release notes and reformats a single line in a test file. There is no functional code change and no security relevance.

Lower-prioritygraph/db: add gossip version parameter to ForEachChannelby Elle Mouton · 0cfb9c9d · Feb 13, 2026 · 7 filesMessage 73 · AdequateInformational 15Details
Commit message · Elle Mouton

graph/db: add gossip version parameter to ForEachChannel

Update ForEachChannel to accept a gossip version parameter, allowing
callers to specify which gossip version's channels should be iterated.
This change prepares the graph database for supporting multiple gossip
versions while maintaining backward compatibility.

The KVStore implementation validates that only GossipVersion1 is
requested, returning ErrVersionNotSupportedForKVDB for other versions.
The SQLStore implementation validates known versions and passes the
version through to the underlying paginated query.

Update VersionedGraph to include a ForEachChannel method that
automatically uses its configured gossip version, and update the
DescribeGraph RPC handler to use the v1Graph instead of the global
graphDB.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
defensive validation
AI analysis · Informational 15/100

This commit is a routine internal refactoring of how the Lightning Network graph database iterates over channels. It adds a 'gossip version' parameter to the ForEachChannel function so the code can later support multiple gossip versions, but currently only version 1 is supported. There is no security fix or vulnerability present in the change itself.

Lower-prioritygraph/db: add gossip version parameter to ForEachNodeChannelby Elle Mouton · 1e35f258 · Feb 13, 2026 · 7 filesMessage 73 · AdequateInformational 14Details
Commit message · Elle Mouton

graph/db: add gossip version parameter to ForEachNodeChannel

Update ForEachNodeChannel to accept a gossip version parameter,
allowing callers to specify which gossip version's channels should be
iterated. This change mirrors the approach taken in ForEachChannel and
prepares the graph database for supporting multiple gossip versions
while maintaining backward compatibility.

The Store interface is updated to include the version parameter, and
both KVStore and SQLStore implementations are updated accordingly:

- KVStore validates that only GossipVersion1 is requested, returning
ErrVersionNotSupportedForKVDB for other versions.
- SQLStore passes the version through to the underlying node query,
enabling version-specific channel iteration.

The ChannelGraph wrapper is updated to accept and pass through the
version parameter. VersionedGraph gains a ForEachNodeChannel method
that automatically uses its configured gossip version, providing a
clean interface for version-specific operations.

Update all call sites to explicitly pass lnwire.GossipVersion1, except
for the local channel manager in server.go which now uses the v1Graph
directly (matching the pattern used in other parts of the codebase).

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
defensive validation
AI analysis · Informational 14/100

This commit is a routine internal refactoring of how LND's network graph database iterates over a node's channels. It adds a 'gossip version' parameter to one function so the code can eventually support multiple versions of Lightning channel gossip, but currently only version 1 is used. There is no security fix or vulnerability here.

AI review queuedgraph/db: update policy builders to support v2 fieldsby Elle Mouton · 40e3ac96 · Feb 13, 2026 · 3 filesMessage 73 · AdequateLow 34Details
Commit message · Elle Mouton

graph/db: update policy builders to support v2 fields

Update buildChanPolicy and related functions in both KV and SQL stores
to properly construct ChannelEdgePolicy with version-specific fields:

KVStore changes:
- Reject non-v1 policies in updateEdgePolicy and serializeChanEdgePolicy
since KV store only supports v1 gossip protocol.
- Set Version to GossipVersion1 when deserializing policies from KV.

SQLStore changes:
- Add isNode1 parameter to buildChanPolicy functions to properly set
SecondPeer field (v2 uses SecondPeer instead of ChannelFlags direction).
- Extract Version from database and populate version-specific fields:
- For v1: MessageFlags, ChannelFlags, LastUpdate, ExtraOpaqueData
- For v2: DisableFlags, LastBlockHeight, ExtraSignedFields
- Thread isNode1 through buildChanPolicyWithBatchData and
buildCachedChanPolicies call sites.

This enables the SQL store to read and reconstruct both v1 and v2
channel policies from the database with proper field mapping.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · Low 34/100

This commit updates how the Lightning Network Daemon (LND) stores and rebuilds channel routing policies in its graph database. It adds support for a newer gossip protocol version (v2) in the SQL backend, while the older KV backend is now explicitly restricted to version 1. The changes are primarily about correct data mapping and preventing unsupported versions from being written to the wrong database backend. There is no direct evidence in the commit of an exploitable security vulnerability, but the change touches consensus-relevant routing data and fixes version-handling gaps that could theoretically cause nodes to propagate or accept malformed policy information.

Lower-prioritygraph/db: convert testEdgePolicyCRUD to versioned testby Elle Mouton · d948c5bf · Feb 13, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Elle Mouton

graph/db: convert testEdgePolicyCRUD to versioned test

Convert testEdgePolicyCRUD to a versioned test that runs against both
v1 and v2 gossip versions. Update the test to use version-specific
edge creation helpers and to test version-specific fields and flag
behavior (ChannelFlags/MessageFlags for v1, DisableFlags/
ExtraSignedFields for v2).

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only changes a test file. It converts an existing test so it runs against two versions of the network gossip protocol, using version-specific helpers and fields. There is no change to production code, no bug fix, and no security-relevant behavior change.

Security candidategraph/db: add v2 fields to ChannelEdgePolicy modelby Elle Mouton · 3fe40c65 · Feb 13, 2026 · 15 filesMessage 73 · AdequateInformational 19Details
Commit message · Elle Mouton

graph/db: add v2 fields to ChannelEdgePolicy model

Extend ChannelEdgePolicy to support v2 channel updates by adding:

- Version field to track gossip protocol version (v1 or v2).
- LastBlockHeight for v2's block-height-based timestamps.
- SecondPeer flag to indicate which peer announced the policy in v2.
- DisableFlags for v2-specific channel disable signaling.
- ExtraSignedFields map for v2 extra signed TLV data.

Add version-aware methods:
- IsNode1() determines if the policy was announced by node_1, handling
both v1 (via ChannelFlags direction bit) and v2 (via SecondPeer).
- IsDisabled() checks disable status using ChannelFlags for v1 and
DisableFlags for v2.
- String() provides version-appropriate string representations.

The new fields use zero values for v1 compatibility (Version defaults
to GossipVersion1, LastBlockHeight to 0, SecondPeer to false). This
lays the groundwork for v2 policy support; a subsequent commit will
handle reading and writing these fields from/to the database.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
boot or update path
AI analysis · Informational 19/100

This commit is a preparatory code change for the Lightning Network gossip protocol. It extends an internal data structure (ChannelEdgePolicy) to store new fields needed for a future 'v2' channel-update format, while keeping existing 'v1' behavior unchanged. It does not, by itself, fix or introduce a security vulnerability; it is groundwork for a later feature.

Lower-prioritymulti: add ChanEdgePolicyFromWire constructor for ChannelEdgePolicyby Elle Mouton · a73c4594 · Feb 13, 2026 · 4 filesMessage 83 · StrongInformational 15Details
Commit message · Elle Mouton

multi: add ChanEdgePolicyFromWire constructor for ChannelEdgePolicy

Add ChanEdgePolicyFromWire to construct ChannelEdgePolicy from channel
update messages, centralizing v1/v2 field mapping.
Update call sites to use the helper:

- discovery/gossiper: handleChanUpdate
- graph/builder: ApplyChannelUpdate
- routing/router_test: ApplyChannelUpdate test helper

This consolidates update-to-policy conversion logic across versions.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit is a straightforward code cleanup: it creates a single helper function that builds an internal data structure from two different kinds of channel update messages, and updates three places to use that helper. There is no change to security behavior, no bug fix, and no disclosed vulnerability.

Lower-prioritysqldb: use version-specific staleness checks in UpsertChannelPolicyby Elle Mouton · 677e6ea8 · Feb 13, 2026 · 2 filesMessage 73 · AdequateLow 46Details
Commit message · Elle Mouton

sqldb: use version-specific staleness checks in UpsertChannelPolicy

Update the UpsertChannelPolicy query to apply different staleness
checks based on gossip version. For v1 policies, continue checking
last_update timestamps. For v2 policies, check block_height instead,
using >= comparison to handle policies from the same block.

The version-specific WHERE clause ensures that policy updates are only
applied when they contain newer information according to the versioning
scheme appropriate for that gossip version.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 46/100

This change fixes how LND stores routing policy updates received over the Lightning network gossip protocol. Different gossip versions use different freshness indicators: v1 uses a timestamp, while v2 uses a block height. Previously the code always compared timestamps, which could cause newer v2 policies to be ignored if their timestamp was older, or stale v2 policies to overwrite newer ones. The patch makes the database update conditional on the correct freshness field for each gossip version.

Lower-prioritygraph/db: add versioned HasChannelEdge methodby Elle Mouton · 506ec037 · Feb 13, 2026 · 8 filesMessage 68 · AdequateLow 34Details
Commit message · Elle Mouton

graph/db: add versioned HasChannelEdge method

Add a new HasChannelEdge method that takes a gossip version parameter
and returns only existence and zombie status, without timestamp data.
This supports both v1 and v2 gossip protocols.

The original HasChannelEdge method is renamed to HasV1ChannelEdge to
preserve v1-specific functionality for callers that need timestamp
information. All call sites are updated accordingly.

The SQL store implementation now handles both gossip versions, using
timestamps for v1 and block heights for v2 policies, with proper
reject cache support for both versions.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 34/100

This commit refactors how LND checks whether a Lightning channel edge exists in its graph database, adding support for both v1 and v2 gossip protocols. It is a code-maintenance and feature-extension change, not a direct security fix. There is no vendor statement or external report linking it to a known vulnerability, and the diff does not show a patch for an exploitable bug. However, because it touches core graph/caching logic, any mistake could affect routing or spam handling, so it warrants normal review rather than urgent response.

Lower-prioritygraph/db: refactor CachedEdgePolicy to use explicit boolean fieldsby Elle Mouton · 9c7a12c0 · Feb 13, 2026 · 5 filesMessage 83 · StrongInformational 14Details
Commit message · Elle Mouton

graph/db: refactor CachedEdgePolicy to use explicit boolean fields

Replace MessageFlags and ChannelFlags bitfields in CachedEdgePolicy
with explicit boolean fields to improve clarity and support both v1
and v2 channel updates:

- Replace MessageFlags with HasMaxHTLC boolean.
- Replace ChannelFlags with IsNode1 and IsDisabled booleans.
- Update NewCachedPolicy to extract these fields version-appropriately:
- For v1: derive from MessageFlags and ChannelFlags bits.
- For v2: derive from policy.SecondPeer and policy.DisableFlags.

Update all call sites that used method calls IsNode1() and IsDisabled()
to instead access the fields directly. This includes:
- graph_cache.go: policy direction and disable checks
- unified_edges.go: HasMaxHTLC and IsDisabled checks
- Tests: policy construction and assertions

This refactoring improves readability by making the cached policy's
state explicit rather than encoded in bitfields, and enables seamless
support for both gossip protocol versions.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 14/100

This commit is a straightforward internal code cleanup in LND's routing graph cache. It replaces compact bit-field flags with clearly named true/false fields (e.g., 'IsDisabled', 'IsNode1', 'HasMaxHTLC') and updates the code that reads them. There is no security fix or externally reported vulnerability here; it is a readability and maintainability refactor that also prepares the code for a newer gossip protocol version.

Lower-prioritygraph/db: set policy version for cache loadby Elle Mouton · bd215b1a · Feb 13, 2026 · 1 fileMessage 60 · AdequateLow 46Details
Commit message · Elle Mouton

graph/db: set policy version for cache load

Ensure policies loaded for graph cache reconstruction are tagged as v1.

60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Low 46/100

This small code change fixes a bug where Lightning Network routing policies loaded from the database into an in-memory cache were missing a version tag. The fix explicitly marks them as version 1 policies. Without the version set, other parts of the node that rely on the version field could misinterpret the policy, potentially causing incorrect fee or time-lock calculations when routing payments through the network.

Lower-prioritygraph/db: version reject cache for policiesby Elle Mouton · 4a6213c3 · Feb 13, 2026 · 4 filesMessage 68 · AdequateLow 26Details
Commit message · Elle Mouton

graph/db: version reject cache for policies

Make the reject cache version-aware so v1 and v2 policy state can be
cached independently per channel ID. Add helpers to store v1 timestamps
or v2 block heights and thread the versioned cache key through KV/SQL
store cache accesses.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 26/100

This commit reworks an in-memory cache in LND's channel graph database so that it can separately store metadata for two different gossip protocol versions (v1 and v2). The change is mostly a correctness/performance improvement to avoid cache collisions between versions, but it also fixes places where the SQL backend was not invalidating or updating the cache with the correct version key. There is no direct evidence in the commit message or diff that this is a security fix, and no CVE or advisory is referenced.

Lower-prioritygraph/db: add version parameter to FetchChannelEdgesByID/Outpointby Elle Mouton · d88fa011 · Feb 13, 2026 · 4 filesMessage 73 · AdequateInformational 15Details
Commit message · Elle Mouton

graph/db: add version parameter to FetchChannelEdgesByID/Outpoint

Make channel edge fetching version-aware by adding gossip version
parameter to FetchChannelEdgesByID and FetchChannelEdgesByOutpoint.
Add corresponding methods to VersionedGraph. V2 policy building is
marked as TODO.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit is a routine internal refactoring to prepare the LND channel graph database for future support of multiple gossip protocol versions. It adds a version parameter to two edge-lookup functions and makes the SQL store use that parameter instead of a hardcoded version. There is no security bug being fixed here and no behavior that would let an attacker do anything harmful.

Security candidategraph/db: support v2 channel proofs in AddEdgeProofby Elle Mouton · 99d622ca · Feb 13, 2026 · 2 filesMessage 78 · AdequateLow 32Details
Commit message · Elle Mouton

graph/db: support v2 channel proofs in AddEdgeProof

Update AddEdgeProof to handle both v1 (four separate signatures) and
v2 (single aggregated signature) channel authentication proofs using
the appropriate SQL queries.

78/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
signing boundaryaccess control
AI analysis · Low 32/100

This commit extends a database function in the LND Lightning node so it can store both old-style (v1) and new-style (v2) channel authentication proofs. Previously, the code only accepted v1 proofs and would reject v2 proofs with an error. The change is a feature completion / bug fix for the new gossip protocol support, not a fix for an active security vulnerability. It adds the matching SQL query and tests for both versions.