LL
← All projectsLightning Labs

LND

Go implementation of a complete Lightning Network node.

BitcoinLightning NetworkNormal
Repository coverage

1238 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 queue337AI analyses
55commits · 30 days
168commits · 60 days
827commits · 180 days
1226commits · 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
561Adequate · 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 Osuntokun1994084374
Elle Mouton2673170067
ziggie4101584064
Erick Cestari26715070
bitromortac46519067
yyforyongyu55313065
saubyk1523070
Oli724057
Suheb323075
elnosh322071
George Tsagkarelis32114066
Gijs van Dam2614071
Analysis record

Published AI watches

Last scanned 52 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-prioritysqldb/v2: add base for sqldb/v2 moduleby Viktor Torstensson · aa1725a8 · Mar 31, 2026 · 3 filesMessage 80 · StrongTriage 0Details
Commit message · Viktor Torstensson

sqldb/v2: add base for sqldb/v2 module

In the upcoming commits, we will introduce a new sqldb module, sqldb
version 2.

The intention of the new sqldb module, is to make it generalizable so
that it contains no `lnd` specific code, to ensure that it can be reused
in other projects.

This commit adds the base of the new module, but does not include any
implementation yet, as that will be done in the upcoming commits.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Security candidatelnwire: validate MuSig2 nonces in LocalNoncesData decodeby Erick Cestari · 05f04f74 · Mar 31, 2026 · 2 filesMessage 65 · AdequateModerate 59Details
Commit message · Erick Cestari

lnwire: validate MuSig2 nonces in LocalNoncesData decode

Validate each nonce in decodeLocalNoncesData with
ValidateMusig2Nonce to reject malformed entries.

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
Why it was queued
defensive validationnonce handling
AI analysis · Moderate 59/100

This change adds a safety check when LND reads stored MuSig2 cryptographic nonces from disk or network data. Previously, a malformed or all-zero nonce could be loaded silently; now the decoder rejects it. MuSig2 nonces are used in multi-signature Bitcoin transactions for the Lightning Network, so bad nonces could in theory lead to failed channel operations or, in worst-case cryptographic scenarios, weaken security guarantees.

AI review queuedlnwallet/chancloser: remove racy "no more states" checkby Elle Mouton · 1f8b558c · Mar 31, 2026 · 1 fileMessage 95 · StrongInformational 15Details
Commit message · Elle Mouton

lnwallet/chancloser: remove racy "no more states" check

The assertStateTransitions helper contained a non-blocking select
after consuming expected states to verify no additional transitions
occurred. This check is inherently racy: the state machine goroutine
can emit the next transition before the non-blocking select runs,
causing spurious "unexpected state transition" failures.

This was the primary cause of TestRbfCloseErr flakes (~29% failure
rate under coverage instrumentation).

To preserve strictness, add a post-Stop() quiet-period check in
stopAndAssert(). After the state machine is stopped, no further
transitions should be produced, so draining the subscriber channel
there is deterministic and catches any unexpected stragglers.

Also fix the CloseErr restart test paths (send_offer_restart,
recv_offer_restart) which were under-consuming transitions. Both
ClosePending and CloseErr produce an extra ClosingNegotiation
emission on restart via internal requeue, so the helpers now take
an explicit expectExtraTransition flag rather than the ambiguous
iteration bool.

Finally, register the state subscriber before Start() to avoid
racing with the initial state notification emitted by driveMachine.
The old ordering (Start then RegisterStateEvents) could miss the
first transition entirely on slow CI runners, causing a permanent
timeout in assertStartupAssertions.

95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 15/100

This commit fixes flaky automated tests for a Lightning Network channel-closing feature. It removes a timing-sensitive check that sometimes falsely reported extra state changes, and adjusts the tests to expect the correct number of state transitions after restarts. There is no change to production code or user-facing behavior.

AI review queuedlnwallet/chancloser: use wait.DefaultTimeout for state transitionsby Elle Mouton · 7e549631 · Mar 31, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Elle Mouton

lnwallet/chancloser: use wait.DefaultTimeout for state transitions

The hardcoded defaultTimeout (previously 500ms, then 5s) used in
assertStateTransitions was too tight for CI runners, especially
under coverage instrumentation or remote DB backends (postgres).

Use wait.DefaultTimeout which automatically adapts to the build
environment: 30s on standard platforms, 60s+ for remote DB builds,
and 60s on Windows.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 15/100

This commit changes a single test file to use a more flexible timeout value instead of a hardcoded 500 milliseconds. It only affects automated tests, not the actual production code that runs on users' Lightning nodes. There is no security issue here.

Lower-prioritydocs: add release note for v1 node horizon query optimizationby Elle Mouton · f3d9b1f2 · Mar 31, 2026 · 1 fileMessage 62 · AdequateTriage 0Details
Commit message · Elle Mouton

docs: add release note for v1 node horizon query optimization

62/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
documentation-only discount
Lower-prioritygraph/db: add node horizon index benchmarkby Elle Mouton · 2fda82b6 · Mar 31, 2026 · 1 fileMessage 78 · AdequateTriage 0Details
Commit message · Elle Mouton

graph/db: add node horizon index benchmark

Add BenchmarkNodeHorizonIndex to compare query performance under old
vs new index configurations for NodeUpdatesInHorizon. Tests both
all-nodes and public-only variants against native SQLite and
optionally Postgres backends, swapping indexes via DDL between runs.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritysqldb/sqlc: split public-only node horizon query and upgrade channel indexesby Elle Mouton · 561edf8c · Mar 31, 2026 · 7 filesMessage 73 · AdequateTriage 0Details
Commit message · Elle Mouton

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.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritysqldb/sqlc: add version filter and composite index for v1 node horizon queryby Elle Mouton · 2cf8b7bd · Mar 31, 2026 · 4 filesMessage 73 · AdequateTriage 0Details
Commit message · Elle Mouton

sqldb/sqlc: add version filter and composite index for v1 node horizon query

The v1 GetNodesByLastUpdateRange query was missing an explicit
`WHERE version = 1` filter and used a single-column index on
`graph_nodes(last_update)` which didn't match the full query ordering
shape `ORDER BY last_update, pub_key`, requiring an extra sort step.

Add `WHERE version = 1` to the query for correctness and replace the
index with a composite `(version, last_update, pub_key)` index that
covers the filter, range scan, and pagination ordering together.

Note: the migration 000009_graph_v2 file is edited directly (dropping
the old index and creating the new one) rather than adding a new
migration, since this migration has not been included in a release yet.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritydocs: add release note for versioned graph horizon queriesby Elle Mouton · f38daf81 · Mar 31, 2026 · 1 fileMessage 62 · AdequateTriage 0Details
Commit message · Elle Mouton

docs: add release note for versioned graph horizon queries

62/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
documentation-only discount
Security candidategraph/db: add v2 block-height path for NodeUpdatesInHorizonby Elle Mouton · c14a79c0 · Mar 31, 2026 · 5 filesMessage 78 · AdequateInformational 15Details
Commit message · Elle Mouton

graph/db: add v2 block-height path for NodeUpdatesInHorizon

Add GetNodesByBlockHeightRange SQL query and wire it into
SQLStore.nodeUpdatesInHorizonV2. This mirrors the existing v1
time-based query but filters on (version, block_height) instead of
last_update, using the same [start, end) exclusive-end semantics
and (block_height, pub_key) compound cursor pagination.

The public-node filter for v2 checks for channels with a non-empty
channel announcement signature (c.signature), matching the v2
protocol's public channel indicator.

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 boundary
AI analysis · Informational 15/100

This commit adds a new database query path for a planned v2 gossip protocol feature in LND. It is purely functional code that lets the node list other nodes by block-height range, similar to an existing time-based query. There is no indication this fixes a security bug or introduces a vulnerability; it appears to be a normal feature implementation.

Lower-prioritygraph/db: version NodeUpdatesInHorizon and ChanUpdatesInHorizonby Elle Mouton · 497d4794 · Mar 31, 2026 · 9 filesMessage 73 · AdequateTriage 0Details
Commit message · Elle Mouton

graph/db: version NodeUpdatesInHorizon and ChanUpdatesInHorizon

Replace the (startTime, endTime time.Time) parameters on
NodeUpdatesInHorizon and ChanUpdatesInHorizon with
(v GossipVersion, r NodeUpdateRange/ChanUpdateRange). The range
types enforce version-correct bounds at the type level: v1 uses unix
timestamps, v2 will use block heights.

The KV store rejects non-v1 versions since it only stores v1 data.
The SQL store dispatches to version-specific helpers
(nodeUpdatesInHorizonV1, chanUpdatesInHorizonV1); the v2
block-height paths return an error for now and will be wired up in
follow-up commits.

VersionedGraph wrappers supply the version from the embedded field,
so callers only pass the range.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritysqldb: add composite indexes for v2 block-height horizon queriesby Elle Mouton · ccbe7d69 · Mar 31, 2026 · 2 filesMessage 73 · AdequateTriage 0Details
Commit message · Elle Mouton

sqldb: add composite indexes for v2 block-height horizon queries

Add composite indexes on graph_nodes and graph_channel_policies for
the upcoming v2 block-height-based horizon queries.

The v2 gossip protocol uses block heights instead of unix timestamps
for ordering node announcements and channel updates. The v2
NodeUpdatesInHorizon and ChanUpdatesInHorizon query paths will
filter on WHERE version = @v AND block_height >= start AND
block_height < end. Without these indexes, those queries would
require full table scans.

For nodes, the index is (version, block_height, pub_key). Including
pub_key covers the ORDER BY (block_height, pub_key) clause and
allows direct cursor seeks for pagination, avoiding an extra sort.

For channel policies, the index is (version, block_height). The
pagination cursor uses a CASE expression across two joined policy
rows so the index cannot cover the ORDER BY — the two leading
columns are sufficient for the range scan.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritygraph/db: add v2 block-height path for ChanUpdatesInHorizonby Elle Mouton · 7f5be5a4 · Mar 31, 2026 · 5 filesMessage 73 · AdequateTriage 0Details
Commit message · Elle Mouton

graph/db: add v2 block-height path for ChanUpdatesInHorizon

Add GetChannelsByPolicyBlockRange SQL query and wire it into
SQLStore.chanUpdatesInHorizonV2. This mirrors the existing v1
time-based query but filters on policy block_height instead of
last_update, using the same [start, end) exclusive-end semantics
and (max_block_height, channel_id) compound cursor pagination.

Also adds extractMaxBlockHeight helper (returns the max of both
policies' block heights for cursor tracking) and
buildChannelFromBlockRangeRow (structurally identical to the v1
variant but accepts the distinct sqlc-generated row type). The
extractChannelPolicies type-switch is extended with a case for the
new GetChannelsByPolicyBlockRangeRow type.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritydiscovery: replace chain param with ctx in UpdatesInHorizonby Elle Mouton · cdd19792 · Mar 31, 2026 · 3 filesMessage 73 · AdequateTriage 0Details
Commit message · Elle Mouton

discovery: replace chain param with ctx in UpdatesInHorizon

Replace the unused chainhash.Hash parameter in
ChannelGraphTimeSeries.UpdatesInHorizon with context.Context. The
chain parameter was never consulted by the implementation since the
graph is not chain-scoped. The context is threaded through to the
underlying graph DB queries that need it.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritygraph/db: add ChanUpdateRange and NodeUpdateRange typesby Elle Mouton · 8b5d21a8 · Mar 31, 2026 · 2 filesMessage 73 · AdequateInformational 15Details
Commit message · Elle Mouton

graph/db: add ChanUpdateRange and NodeUpdateRange types

Add version-aware range types for channel and node update horizon
queries. V1 gossip uses unix timestamps for ordering while v2 uses
block heights, so each range type validates that the correct bound
type is provided for the requested gossip version.

These types will be used in follow-up commits to version the
NodeUpdatesInHorizon and ChanUpdatesInHorizon Store methods.

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 adds new internal data types (ChanUpdateRange and NodeUpdateRange) and validation logic for upcoming gossip protocol features. It does not change any existing behavior or fix a security issue; it is purely preparatory code with tests.

Lower-prioritygraph/db: remove ChannelGraph horizon wrappers, use VersionedGraphby Elle Mouton · fc7204ca · Mar 31, 2026 · 2 filesMessage 83 · StrongTriage 0Details
Commit message · Elle Mouton

graph/db: remove ChannelGraph horizon wrappers, use VersionedGraph

The ChannelGraph.NodeUpdatesInHorizon and
ChannelGraph.ChanUpdatesInHorizon methods were only used in tests.
All production callers already use VersionedGraph (which supplies
the gossip version from its embedded field).

Remove the ChannelGraph wrappers and update tests to instantiate a
VersionedGraph via NewVersionedGraph(MakeTestGraph(t), v1) instead,
dropping the explicit version parameter from horizon calls.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritygraph/db: use exclusive end time for horizon queries per BOLT 07by Elle Mouton · 57a32b92 · Mar 31, 2026 · 7 filesMessage 83 · StrongTriage 0Details
Commit message · Elle Mouton

graph/db: use exclusive end time for horizon queries per BOLT 07

BOLT 07 specifies that gossip_timestamp_filter range semantics are
"greater or equal to first_timestamp, and less than first_timestamp
plus timestamp_range", i.e. [start, end). Three of the four
implementations (KV ChanUpdatesInHorizon, KV NodeUpdatesInHorizon,
SQL NodeUpdatesInHorizon) were incorrectly using an inclusive end
time (<= instead of <). Only SQL ChanUpdatesInHorizon was correct.

This commit fixes the KV store's fetchNextChanUpdateBatch and
fetchNextNodeBatch to use >= (instead of >) for the end time break
condition, and < (instead of <=) for the hasMore check. It also
fixes the SQL GetNodesByLastUpdateRange query to use < instead of <=
on the end_time bound.

All godocs are updated to reference the BOLT 07 spec language and
explicitly document the [start, end) range semantics. New dedicated
tests (TestNodeUpdatesInHorizonExclusiveEnd and
TestChanUpdatesInHorizonExclusiveEnd) verify that items at exactly
the end time are excluded while items at the start time are included.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritylntest: add DeleteForwardingHistory to RPC harnessby ziggie · 6dd3e486 · Mar 30, 2026 · 1 fileMessage 83 · StrongTriage 0Details
Commit message · ziggie

lntest: add DeleteForwardingHistory to RPC harness

In this commit, we extend the test harness RPC wrapper to expose the
new DeleteForwardingHistory method, following the established pattern
for router RPC calls with automatic error handling and logging.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI review queuedrpcserver: wire ForwardingLog into router backendby ziggie · b3b05dda · Mar 30, 2026 · 5 filesMessage 68 · AdequateInformational 20Details
Commit message · ziggie

rpcserver: wire ForwardingLog into router backend

In this commit, we pass the node's ForwardingLog into the RouterBackend
alongside the MinFwdHistoryAge configuration value, completing the
dependency injection chain from the RPC handler down to the database
layer.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · Informational 20/100

This commit is a routine plumbing change: it wires a new configuration option (fwd-history-delete-batch-size) through LND's RPC server so operators can tune how many forwarding history records are deleted in each database batch. It does not fix a vulnerability or change any security boundary; it simply exposes an existing internal batch size as a user-configurable setting and adds a startup warning if the value is set too high.

Lower-prioritydocs: add forwarding history privacy guideby ziggie · c14dcf0e · Mar 30, 2026 · 1 fileMessage 80 · StrongTriage 0Details
Commit message · ziggie

docs: add forwarding history privacy guide

In this commit, we add a guide explaining the privacy implications of
retaining forwarding history and how to use DeleteForwardingHistory to
implement a data retention policy. The guide covers the CLI interface,
batch size tuning, cron-based automation, database compaction, fee
accounting considerations, and privacy best practices.

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
Lower-prioritydocs: add release-notes for LND 21by ziggie · a5fcc819 · Mar 30, 2026 · 1 fileMessage 57 · ThinTriage 0Details
Commit message · ziggie

docs: add release-notes for LND 21

57/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
documentation-only discount
Lower-prioritycmd: add deletefwdhistory CLI commandby ziggie · 7d90b8e7 · Mar 30, 2026 · 2 filesMessage 68 · AdequateTriage 0Details
Commit message · ziggie

cmd: add deletefwdhistory CLI command

In this commit, we add the lncli deletefwdhistory command that wraps
the DeleteForwardingHistory RPC. The command accepts a time
specification in one of two forms:

--age=<duration> relative duration, e.g. "-90d", "-1M", "-720h"
--before=<unix> absolute Unix timestamp in seconds

An interactive confirmation prompt is shown before deletion proceeds,
which can be suppressed with --force/-f for unattended automation.
The --batch_size flag controls events deleted per database transaction
(default 10000, max 50000).

The response is printed as JSON, consistent with other lncli commands.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-priorityitest: add integration tests for DeleteForwardingHistoryby ziggie · 45fe63ca · Mar 30, 2026 · 2 filesMessage 83 · StrongInformational 15Details
Commit message · ziggie

itest: add integration tests for DeleteForwardingHistory

In this commit, we add integration tests for the DeleteForwardingHistory
RPC covering four scenarios: basic deletion of all events, partial
deletion by time range, empty database handling, and idempotency.
A time format test validates both the relative duration and absolute
timestamp code paths end-to-end.

Bob's node is started with --routerrpc.min-fwd-history-age=2s so the
tests can exercise the minimum age guard without waiting an hour.

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

This commit only adds new integration tests for an existing RPC called DeleteForwardingHistory. It does not change any production code, so it cannot introduce a security vulnerability on its own. The tests exercise normal deletion behavior, partial deletion, empty database handling, idempotency, and time format parsing.

Lower-priorityactor: add BackpressureMailbox and custom mailbox supportby Gijs van Dam · dd917dc9 · Mar 28, 2026 · 9 filesMessage 73 · AdequateTriage 0Details
Commit message · Gijs van Dam

actor: add BackpressureMailbox and custom mailbox support

Add BackpressureMailbox, a Mailbox implementation backed by
queue.BackpressureQueue that consults a queue.DropCheckFunc on every
Send/TrySend to enable RED-style load shedding before the mailbox is
full.

Add MailboxFactory type and ActorOption functional options
(WithMailboxFactory, WithMailboxSize) so callers can inject custom
mailbox implementations when spawning actors via RegisterWithSystem
or ServiceKey.Spawn.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-priorityqueue: add BackpressureQueue[T] with Random Early Dropby Gijs van Dam · ea8a6657 · Mar 28, 2026 · 4 filesMessage 88 · StrongTriage 0Details
Commit message · Gijs van Dam

queue: add BackpressureQueue[T] with Random Early Drop

Add a generic BackpressureQueue that uses a DropPredicate to proactively
shed load before the queue is completely full.

Two predicate types are provided:
- DropCheckFunc: length-only drop decision (func(queueLen int) bool)
- DropPredicate[T]: item-aware drop decision

RandomEarlyDrop returns a DropCheckFunc since RED only considers queue
depth. The AsDropPredicate helper adapts it to DropPredicate[T] for use
with BackpressureQueue.

In addition to the blocking Enqueue/Dequeue methods, the queue exposes
TryEnqueue (non-blocking send with drop check), Len, ReceiveChan, and
Close. These are needed by the actor package's BackpressureMailbox which
uses BackpressureQueue as its core buffer while implementing the Mailbox
interface's select-based iteration and lifecycle methods.

Property-based tests using pgregory.net/rapid verify queue invariants
(capacity bounds, FIFO ordering, model consistency) across randomized
enqueue/dequeue sequences with RED enabled.

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