LL
← All projectsLightning Labs

LND

Go implementation of a complete Lightning Network node.

BitcoinLightning NetworkNormal
Repository coverage

1689 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.

187security candidates237second-pass queue1374AI analyses
164commits · 30 days
270commits · 60 days
640commits · 180 days
1424commits · 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.

68/100 average clarity
388Strong · 80–100
838Adequate · 60–79
432Thin · 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 Osuntokun29860237474
ziggie49922422265
Elle Mouton26832268167
Yong60926172
ziggieXXX50617170
George Tsagkarelis37335167
LNBiG111173
Jared Tobin909171
yyforyongyu1211574070
bitromortac731154071
Erick Cestari26726070
Suheb746074
Analysis record

Published AI watches

Last scanned 41 minutes ago

Moderate 66 AI analysisMessage 96 · Strong
LL Lightning LabsLND BitcoinLightning Network

channeldb: persist local updates the peer acked before our first revoke (#11268)

This commit fixes a bug in LND's channel database where a specific type of fee update could be lost if a node restarted at a very precise moment during a Lightning channel's setup. If triggered, the node would reject a valid signature from…

Force-closure of a Lightning channel due to state desynchronization after restartLoss of locally initiated fee updates before first local revocationRegression test reproduces restart scenario leading to signature rejection
9f5e2c7bby Olaoluwa Osuntokun+78−133 files
Vendor flagged security relevance
Low 45 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11575 from Roasbeef/rbf-coop-close-lifecycle

This commit fixes bugs in LND's new RBF-style cooperative channel close feature. Previously, fee-bump requests could be dropped or block the peer's main goroutine while waiting for an in-progress offer. The patch buffers those requests ins…

Denial-of-service / liveness fix: fee-bump requests no longer block the peer's `channelManager` goroutine while waiting for an in-flight offer.State consistency fix: buffered fee-bump requests are now part of the FSM state instead of being dropped during shutdown or flush.Resource-leak fix: confirmed RBF closes now tear down the active channel state and switch link for both local and remote-initiated closes.
5597f6f7by Olaoluwa Osuntokun+1538−4248 files
Vendor flagged security relevance
Low 43 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11588 from ziggie1984/lnwallet/fix-reorg-wallet-sync-flake

This change fixes a wallet synchronization check in LND. Previously, the wallet only compared block heights to decide if it was fully caught up with the Bitcoin chain. During a chain reorganization (a temporary fork where one block is repl…

State synchronization check previously used height only, which is insufficient across reorgsFix adds block hash comparison to prevent false-positive sync statusCould cause LND to proceed while wallet state reflects an invalidated or not-yet-updated chain tip
8cdbf85cby Yong+224−1354 files
Vendor flagged security relevance
Moderate 51 AI analysisMessage 68 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #10708 from jtobin/alias-perms

This commit fixes a missing permission check on a new Lightning routing RPC called XFindBaseLocalChanAlias. Without the entry, any valid macaroon could call that RPC, bypassing the normal access-control list. The patch adds the required pe…

Missing macaroon authorization entry for an RPC endpointPotential privilege escalation: any valid macaroon could invoke an unprotected RPCRegression test added to enforce macPermissions coverage
98dc2b44by Olaoluwa Osuntokun+35−02 files
No security note in commit
Moderate 68 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11555 from yyforyongyu/invoice-settlement-public

This large LND patch changes when an ordinary invoice is considered 'paid'. Previously, releasing the preimage (the secret that lets the payer claim the funds) immediately marked the invoice as settled. Now the invoice enters a new interme…

New intermediate invoice/HTLC state prevents premature settlement reportingOn-chain HTLC outcomes persisted without opt-in to support restart recoveryForwarding package marker persisted before preimage release to avoid replay rejection on restart
895118acby Olaoluwa Osuntokun+4536−32048 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 80 · Strong
LL Lightning LabsLND BitcoinLightning Network

docs: describe invoice collection finality

This commit only adds documentation to the release notes. It describes a previously merged code change (PR 11555) about how LND handles invoice finality, but the commit itself contains no code, bug fixes, or behavior changes. There is noth…

9649d9f6by yyforyongyu+87−01 file
No security note in commit
Moderate 64 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11551 from ziggie1984/public-pr149-sanitized

This change fixes a bug in LND's invoice handling for multi-part payments (MPP and AMP). When a payment is split into several pieces (HTLCs), each piece is accepted individually. Previously, an old accepted piece could become too close to …

Fixes missing revalidation of accepted HTLC CLTV expiries at MPP/AMP set completionPrevents settlement of shards whose on-chain claim window has become unsafe while heldAdds new fail resolution ResultHtlcSetExpiryTooSoon and cancels the entire affected set
4b7447bcby Yong+281−347 files
Vendor flagged security relevance
Low 35 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11396 from yyforyongyu/task-lease-policy

This commit changes how LND's wallet locks (leases) unspent coins through its RPC interface. It removes a recently added 'release after N confirmations' option and replaces it with an explicit 'no expiry' flag. Old clients that still send …

Breaking API change that reserves removed protobuf fields to prevent accidental reintroductionExplicit rejection of legacy `release_after_spend_confs` parameters from old clients instead of silent fallbackValidation prevents conflicting no-expiry + duration lease settings before wallet state is touched
03e28a96by Yong+663−4029 files
Vendor flagged security relevance
Low 40 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11175 from ViktorT-11/2026-08-gossip-version-agnostic-store

This commit refactors how the Lightning Network Daemon (LND) stores and queries channel graph data so that the same channel or node can exist under both old (v1) and new (v2) gossip protocols without the database returning stale, missing, …

Cross-version data consistency: prevents a v2 channel shell from shadowing a usable v1 channel, which could affect routing decisions and RPC output.Cache consistency: ensures the in-memory pathfinding cache and the SQL-backed RPC reads agree on which channel version and policies are active.Bug fix: zombie edge info now carries the correct channel ID instead of 0, which could have caused incorrect channel identification during resurrection.
8c251687by Yong+3752−28726 files
No security note in commit
Moderate 61 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11440 from Roasbeef/fix-longstanding-correctness-bugs

This is a large bug-fix patch for LND (a Bitcoin Lightning Network node) that tightens correctness rules across many subsystems. It prevents several ways a node could mis-handle channel data, accept bad network gossip, commit corrupted dat…

Database transaction commit now aborts on read errors (etcd) - prevents silent data corruption / inconsistent stateGossip zombie marking removed for invalid funding script - prevents denial-of-service / channel graph poisoningWire message length bounding added to watchtower protocol - prevents memory exhaustion / malformed message parsing
0123a548by Olaoluwa Osuntokun+1424−11938 files
Vendor flagged security relevance
Moderate 59 AI analysisMessage 80 · Strong
LL Lightning LabsLND BitcoinLightning Network

invoices: require complete payment collection

This commit changes how LND handles multi-part Lightning payments when one part fails after the preimage was already released. Previously, the invoice could be marked as fully paid even if one shard was later reclaimed by the payer on-chai…

Changes invoice settlement semantics for released-but-failed HTLCsAdds new persisted HTLC state `HtlcStateFailed`Prevents invoice from reaching `ContractSettled` when any released shard fails
699ea930by Olaoluwa Osuntokun+492−4910 files
No security note in commit
Moderate 60 AI analysisMessage 78 · Adequate
LL Lightning LabsLND BitcoinLightning Network

lnwallet: reject a zero CSV delay

This change tightens the rules for opening Lightning payment channels by refusing a setting called the CSV delay when it is set to zero. The CSV delay is the waiting period a user must endure before reclaiming their own funds from a channe…

Rejects a zero CSV delay that would eliminate the breach-remedy windowCentralizes the check in VerifyConstraints so all channel types and directions are coveredAdds explicit error type and unit test for the new constraint
266eba7bby Olaoluwa Osuntokun+81−03 files
Vendor flagged security relevance
Moderate 58 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

lnwallet+chanstate: keep persisted HTLC data readable

This commit fixes two bugs in how Lightning Network channel data is saved to disk. First, it stops extra 'aux' signatures meant only for advanced taproot channels from being saved on ordinary channels, where they don't belong. Second, it p…

Persisted state could become unreadable due to writer/reader size mismatchAuxiliary signatures for taproot overlay channels were persisted on plain channel HTLCsFix adds explicit serialization bound to prevent unreadable channel records
43c74723by Olaoluwa Osuntokun+101−25 files
No security note in commit
Low 39 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11374 from bitromortac/20261016-c7e5-dispatch

This commit adds the first end-to-end BOLT 12 'Offers' flow to LND: a new dev-only RPC and CLI command to create offers, plus a dispatcher that listens for incoming onion-message invoice requests and replies with signed BOLT 12 invoices. I…

New network-facing dispatcher answers invoice requests from any peer; rate and concurrency limits are appliedBlinded-path PathID check prevents reply linking to self-created paths, but TODO notes the check should move once offers can have offer_pathsCreateOffer RPC is restricted to dev builds and requires offchain:write macaroon permission
a9d4ca3bby bitromortac+3113−7838 files
No security note in commit
Moderate 60 AI analysisMessage 78 · Adequate
LL Lightning LabsLND BitcoinLightning Network

invoices: reject settled AMP set shards

This change fixes a bug in LND's invoice handling for AMP (Atomic Multi-Path) payments. Previously, if someone tried to pay a fresh shard for an AMP set that was already fully paid, the invoice updater could return an internal error that w…

Denial-of-service vector: an internal updater error could force-fail a shared channel link, disrupting unrelated sibling HTLCsAMP invoice state machine edge case: reusable invoice stays open for other sets but must reject new shards for already-settled setsClean failure path introduced: ResultInvoiceNotOpen instead of error-driven link failure
99e3da37by yyforyongyu+49−02 files
No security note in commit
Moderate 59 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11282 from lightningnetwork/elle-base-branch-payment-service

This is a large feature merge for LND that adds a new optional RPC subsystem called switchrpc. It lets an external program hand a pre-built onion packet to LND for direct dispatch over a Lightning channel, instead of LND doing its own path…

New optional RPC surface (switchrpc) that accepts externally crafted onion packets and directly dispatches HTLCsIdempotency/deduplication added via InitAttempt durable write-ahead log and ErrPaymentIDAlreadyExistsStartup orphan cleanup fails half-open or pre-commit attempts to avoid hangs
11f79be0by Olaoluwa Osuntokun+11385−22458 files
Vendor flagged security relevance
Low 44 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11472 from yyforyongyu/task-sweep-rejections

This commit fixes a bug in LND's transaction sweeping logic. Previously, if the Bitcoin backend rejected a sweep transaction for a temporary or unknown reason (for example, the mempool was full, a network error occurred, or the rejection r…

Funds-availability / liveness fix: temporary or unknown mempool rejections could leave sweep inputs unspent.Error-handling reclassification: previously fatal errors now retryable.Retry metadata preservation: next fee rate and fee cap kept across attempts.
c5863e55by Yong+290−9720 files
No security note in commit
Low 32 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11292 from ViktorT-11/2026-10-harden-remote-signing-no-op

This change is a hardening fix for LND's remote-signing feature. Previously, if a node was configured to act as an outbound remote signer but was compiled without the required 'signrpc' and 'walletrpc' sub-servers, it would silently fall b…

silent-degradation-to-no-op preventedconfiguration-misconfiguration now surfaces as fatal errorbuild-tag-dependency explicitly validated at runtime
0c538e1fby Suheb+241−125 files
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

invoices: fix test whitespace

This commit only fixes blank-line spacing in a single test file to satisfy lint checks. It adds one blank line after a function signature and removes one trailing blank line. There are no code behavior changes, no bug fixes, and no securit…

a67d07f4by yyforyongyu+1−11 file
No security note in commit
Low 31 AI analysisMessage 92 · Strong
LL Lightning LabsLND BitcoinLightning Network

build: pin the new lint job actions by commit

This change updates two GitHub Actions used in the project's automated lint workflow so they are locked to specific commit hashes instead of floating version tags. A floating tag could be silently repointed to a different, possibly malicio…

CI/CD supply-chain hardeningthird-party action pinning by commit hashprevention of tag-movement attacks
2a9f137dby Olaoluwa Osuntokun+4−21 file
Vendor flagged security relevance
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: register migration 14 in migration configby ziggie · 8a9f774f · Apr 9, 2026 · 1 fileMessage 68 · AdequateInformational 22Details
Commit message · ziggie

sqldb: register migration 14 in migration config

Add the 000014_payments_no_fail_reason_index migration to the
main migration configuration so the global migration list stays in
sync with the embedded SQL schema files.

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

This commit is a small bookkeeping fix: it adds a previously-created database migration to the master list so that LND's database upgrade tracker knows about it. On its own, the change does not introduce a security vulnerability or fix an exploitable bug. However, if the migration had been left unregistered, future upgrades could potentially get out of sync, which in database systems can sometimes lead to inconsistent state or upgrade failures.

Lower-prioritydocs: add release notes for Android 16KB page sizeby ajaysehwal · bb1b56f3 · Apr 9, 2026 · 1 fileMessage 62 · AdequateInformational 19Details
Commit message · ajaysehwal

docs: add release notes for Android 16KB page size

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

This commit only adds a line to the release notes describing a previous build-system change for Android. It does not change any code, configuration, or behavior, and it does not fix or introduce any security issue.

Lower-prioritydocs: add release-notes for 21by ziggie · 15135222 · Apr 9, 2026 · 1 fileMessage 57 · ThinInformational 15Details
Commit message · ziggie

docs: add release-notes for 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
AI analysis · Informational 15/100

This commit only adds a line to the release notes document describing a bug fix that was already merged in a previous pull request. It does not change any program code, so it cannot by itself introduce or fix a security issue. The underlying bug it describes was a deadlock during shutdown that could freeze invoice processing, but this commit is purely documentation.

Lower-priorityhtlcswitch: fix hodlQueue deadlock by stopping htlcManager firstby ziggie · f550ac1f · Apr 9, 2026 · 1 fileMessage 73 · AdequateHigh 70Details
Commit message · ziggie

htlcswitch: fix hodlQueue deadlock by stopping htlcManager first

The channelLink.Stop() teardown had an inverted ordering that could
cause a permanent deadlock of the invoice registry under concurrent
peer disconnect.

The previous order was:
1. HodlUnsubscribeAll -- removes subscriptions
2. hodlQueue.Stop() -- kills the queue's internal goroutine
3. cg.Quit() -- signals htlcManager to stop
4. cg.WgWait() -- waits for htlcManager to exit

The race window between steps 2 and 4 left htlcManager alive. A
RevokeAndAck arriving during that window could drive processRemoteAdds
→ processExitHop → NotifyExitHopHtlc, registering a new hodl
subscription backed by a dead hodlQueue (ChanIn() has no reader).

Any subsequent call to notifyHodlSubscribers (e.g. MPP auto-release
timer, expiry watcher, or explicit settle/cancel) would then block
indefinitely on the unbuffered ChanIn(), holding hodlSubscriptionsMux.
Concurrent NotifyExitHopHtlc calls waiting for that lock, plus callers
holding the invoice-level lock waiting for those, produce a full
deadlock of the invoice registry with no recovery path short of a
daemon restart.

The fix is to stop htlcManager before touching the hodl subscription
state. htlcManager is the sole caller of NotifyExitHopHtlc, so once
cg.WgWait() returns no new subscriptions can be registered, making
HodlUnsubscribeAll and hodlQueue.Stop() race-free.

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

This commit fixes a bug in LND's payment channel shutdown code that could freeze the entire invoice handling system. The old shutdown order stopped a message queue before stopping the goroutine that uses it, creating a brief window where a new subscription could be attached to a dead queue. Once that happened, later invoice operations would block forever waiting for a queue that would never respond, deadlocking the invoice registry and requiring a full node restart to recover. The fix simply reverses the shutdown order so the worker goroutine exits before the queue is torn down.

Lower-prioritybuild: add Android 16KB page size flags to Makefileby ajaysehwal · 38575679 · Apr 9, 2026 · 1 fileMessage 62 · AdequateInformational 19Details
Commit message · ajaysehwal

build: add Android 16KB page size flags to Makefile

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 19/100

This commit changes the Android build settings for LND's mobile library so it works on newer Android devices that use 16KB memory pages. It is a compatibility/build fix, not a security patch. There is no indication it fixes a vulnerability.

Lower-prioritygraph/db: fix FetchChannelEdgesByID zombie fallback versioningby Elle Mouton · ebb199d2 · Apr 9, 2026 · 2 filesMessage 83 · StrongLow 35Details
Commit message · Elle Mouton

graph/db: fix FetchChannelEdgesByID zombie fallback versioning

The zombie fallback in SQLStore.FetchChannelEdgesByID unconditionally
constructed a models.NewV1Channel regardless of the requested gossip
version. Use the passed version to select the correct constructor so
that v2 zombie edges carry the right version.

A new testFetchZombieEdgeVersioning versioned test verifies that
zombie edges returned by FetchChannelEdgesByID have the correct
gossip version for both v1 and v2.

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

This commit fixes a bug in LND's Lightning graph database where a fallback path for deleted ('zombie') channels always created a version-1 channel object, even when the caller asked for version 2. The fix makes the fallback use the requested gossip version. The bug could cause version mismatches when reading zombie channel data, but it does not appear to be directly exploitable for theft or denial of service.

Lower-prioritydocs: add release note for FilterKnownChanIDs versioningby Elle Mouton · 4d85877a · Apr 9, 2026 · 1 fileMessage 62 · AdequateInformational 15Details
Commit message · Elle Mouton

docs: add release note for FilterKnownChanIDs versioning

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

This commit only adds a release note describing a previously merged code change. It does not modify any program code, network behavior, or configuration. There is no security issue in the commit itself.

Security candidategraph/db: add gossip version parameter to FilterKnownChanIDsby Elle Mouton · 12f8e509 · Apr 9, 2026 · 5 filesMessage 78 · AdequateLow 27Details
Commit message · Elle Mouton

graph/db: add gossip version parameter to FilterKnownChanIDs

Add an explicit lnwire.GossipVersion parameter to FilterKnownChanIDs
on the Store interface, SQLStore, KVStore, and ChannelGraph. Since
FilterKnownChanIDs is always called from a version-scoped ChanSeries
context, a single version parameter is cleaner than per-item version
reads. A convenience wrapper on VersionedGraph preserves the existing
ChanSeries call-site signature by threading c.v automatically.

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 · Low 27/100

This commit refactors how a Lightning Network routing database method, FilterKnownChanIDs, receives the gossip protocol version. Previously the version was read from each individual channel record; now it is passed explicitly from the version-scoped wrapper. The change also adds a sanity check that zombie channels returned by the database match the expected gossip version, and updates tests to cover both v1 and v2 gossip. It is a defensive correctness improvement rather than a clear-cut fix for an active vulnerability.

Lower-prioritygraph/db: parameterize forEachChanInSCIDList with gossip versionby Elle Mouton · bcadafa1 · Apr 9, 2026 · 1 fileMessage 73 · AdequateInformational 19Details
Commit message · Elle Mouton

graph/db: parameterize forEachChanInSCIDList with gossip version

Replace the hardcoded GossipVersion1 in forEachChanInSCIDList with an
explicit version parameter so the helper can be used for v2 channel
lookups. The caller in FilterKnownChanIDs now passes the version
through.

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

This is a small internal code cleanup in LND's channel graph database code. It replaces a hardcoded gossip version number with a parameter so the same helper function can be reused for both old and new channel gossip formats. The only visible behavior change is that zombie-channel checks now use the version carried in each channel's own metadata rather than always assuming the old version. There is no obvious security vulnerability here; it looks like a correctness/refactoring change.

Lower-prioritysqldb/v2: align sqlite idle defaultsby yyforyongyu · 7074419b · Apr 9, 2026 · 3 filesMessage 90 · StrongInformational 18Details
Commit message · yyforyongyu

sqldb/v2: align sqlite idle defaults

Keep SQLite's default idle connection limit aligned with the
open connection limit so the default pool matches v1 behavior.

This is a follow-up regression fix to the restored open-connection
default in e263ea145. After that change, SQLite again defaulted to
SetMaxOpenConns(2), but SetMaxIdleConns still fell back to 6. Go
silently caps idle connections at the open limit, so nothing
crashed, but the configured idle default became misleading and no
longer matched v1.

Use cfg.MaxConns() as the inherited idle default, keep the
explicit MaxIdleConnections override, and add unit coverage for
the default and override cases. The mismatch was easy to miss
because the code still compiled and basic tests did not assert the
effective idle pool sizing.

90/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
AI analysis · Informational 18/100

This commit fixes a minor configuration mismatch in how LND's new SQLite database layer (v2) manages its connection pool. Previously, the default number of idle connections was set to 6, while the default number of open connections was only 2. Go's database library silently limits idle connections to the open-connection cap, so the effective idle pool was already 2, but the configured default was misleading and differed from the older v1 behavior. The change makes the idle default inherit the open-connection default unless the user explicitly overrides it, and adds tests. It is not a security vulnerability.

Lower-prioritysqldb/v2: scope retry rollbacksby yyforyongyu · 115daef4 · Apr 9, 2026 · 1 fileMessage 68 · AdequateLow 33Details
Commit message · yyforyongyu

sqldb/v2: scope retry rollbacks

Scope the safety-net rollback to each retry attempt instead of
storing one deferred rollback per loop iteration.

This keeps cleanup local to the active attempt while
preserving the existing commit and rollback behavior.

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

This change refactors how database transaction retries are cleaned up in LND's SQL layer. Previously, a rollback was scheduled once per loop and could pile up across retries; now each retry attempt gets its own scoped rollback. The commit message frames this as a safety/cleanup improvement, not a reported vulnerability, and the diff shows only a structural refactor with no change to commit or rollback behavior.

Lower-prioritysqldb/v2: validate migration setsby yyforyongyu · 70ab2fc5 · Apr 9, 2026 · 5 filesMessage 78 · AdequateLow 26Details
Commit message · yyforyongyu

sqldb/v2: validate migration sets

Validate migration descriptor ordering before executing a
migration stream so inconsistent metadata fails fast.

In addition to checking contiguous descriptor versions and keeping
LatestMigrationVersion aligned with the last descriptor, reject a
non-zero LatestMigrationVersion when the descriptor list is empty.
Without that guard, a set such as {LatestMigrationVersion: 5}
passed validation silently.

The validation intentionally focuses on version consistency.
Descriptor names remain optional metadata for debugging, and the
checks still run only when migrations execute, which means
SkipMigrations continues to bypass validation by design. Add unit
coverage for the new empty-descriptor case.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
defensive validation
AI analysis · Low 26/100

This commit adds a safety check to LND's database migration system. Before running any migration, it now verifies that the list of migration steps matches the declared 'latest version' number. The change prevents a specific misconfiguration where a migration set claims to be at version 5 but contains no actual migration steps, which previously would have passed validation silently. It is a defensive hardening fix rather than a response to an active attack.

Lower-prioritysqldb/v2: harden fixture namesby yyforyongyu · 275fe497 · Apr 9, 2026 · 2 filesMessage 83 · StrongInformational 18Details
Commit message · yyforyongyu

sqldb/v2: harden fixture names

Sanitize Docker container names more aggressively and add a
random suffix so concurrent test runs do not collide on the
same fixture name.

Normalize unsupported characters, trim leading and trailing
punctuation, and keep the fallback name for cases that sanitize
down to nothing. Add unit coverage for the sanitizer so the
allowed name surface stays explicit.

83/100 · StrongMessage clarity
✓ 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
defensive validation
AI analysis · Informational 18/100

This change tightens how test-only Docker container names are built for Postgres test fixtures. It replaces a simple slash-to-underscore replacement with a stricter sanitizer that allows only letters, digits, underscores, and hyphens, trims leading/trailing punctuation, adds a random suffix, and falls back to a default name if the input sanitizes to nothing. The goal is to stop concurrent test runs from creating containers with the same name and to avoid invalid Docker names. It is test infrastructure hardening, not a fix for a user-facing vulnerability.

Lower-prioritysqldb/v2: use BaseDB skip flagby yyforyongyu · 76fc6863 · Apr 9, 2026 · 2 filesMessage 68 · AdequateLow 27Details
Commit message · yyforyongyu

sqldb/v2: use BaseDB skip flag

Route migration skipping through the BaseDB field that each
store already initializes.

This makes the embedded state meaningful and keeps the runtime
migration behavior consistent across both backends.

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

This is a small code cleanup in LND's database layer. It changes how two database types (Postgres and SQLite) check whether to skip running schema migrations. Previously they looked at a setting inside their configuration object; now they look at a flag on a shared base database object. The commit message says this makes behavior consistent across both database backends. There is no direct evidence in the commit that this fixes a security vulnerability, but inconsistent migration handling can in principle lead to operational or state-integrity problems.

Lower-prioritysqldb/v2: add executor backendby yyforyongyu · 8be89646 · Apr 9, 2026 · 2 filesMessage 78 · AdequateInformational 17Details
Commit message · yyforyongyu

sqldb/v2: add executor backend

Make TransactionExecutor satisfy the BatchedTx contract by
providing Backend() and asserting the interface conformance at
compile time.

This was a latent interface mismatch rather than an immediately
triggered package-wide compile failure. The executor was
instantiated directly, but sqldb/v2 did not yet assert or use it
as a BatchedTx, so the missing method stayed hidden until a caller
tried to rely on the advertised interface.

At the same time, move Backend() onto BatchedQuerier so the lower-
level contract explicitly requires backend identity. That lets the
executor delegate directly instead of probing an anonymous
interface at runtime, which would have weakened the contract and
fell back to BackendTypeUnknown instead of failing at compile
time.

Keep the focused runtime test and the compile-time assertion so
future interface drift is caught immediately.

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

This commit fixes a design-level mismatch in a new database helper package (sqldb/v2). The TransactionExecutor type was advertised as satisfying the BatchedTx interface, but it was missing a Backend() method, so any code that actually tried to use it through that interface would fail to compile. The patch adds the missing method, moves the Backend() requirement onto a lower-level interface, and adds a compile-time check plus a small test so the problem cannot silently recur. There is no runtime security vulnerability here; it is a compile-time contract repair in unreleased/internal code.

Lower-prioritysqldb/v2: drop dead retry helperby yyforyongyu · 5c067e76 · Apr 9, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · yyforyongyu

sqldb/v2: drop dead retry helper

Remove the unused txExecutorOptions retry helper so the package
only keeps the backoff logic that is actually used.

This avoids carrying a second retry API with different
semantics from the live exponential backoff path.

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

This commit removes an unused helper function that generated random retry delays. It is a code cleanup change with no security relevance: the deleted code was not being called anywhere and did not affect program behavior.

Lower-prioritysqldb/v2: align test helper argsby yyforyongyu · a0a52734 · Apr 9, 2026 · 1 fileMessage 90 · StrongInformational 15Details
Commit message · yyforyongyu

sqldb/v2: align test helper args

Use the same NewTestDBWithVersion argument order across the
SQLite and Postgres test helpers.

This was a latent build-tag API mismatch rather than a current
package-wide compile failure. Any shared helper that called
NewTestDBWithVersion(t, set, version) would compile under one
backend tag and fail under the other, but the mismatch stayed
hidden because nothing in sqldb/v2 called the helper yet.

90/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
AI analysis · Informational 15/100

This is a tiny code cleanup in a test-only helper. It swaps the order of two function arguments in the Postgres test helper so it matches the SQLite test helper. It does not change any production code, user-facing behavior, or runtime security. The commit itself notes it was a hidden build-tag mismatch that had not caused any actual compile failure yet.

Lower-prioritysqldb/v2: fix sqlite migration errorsby yyforyongyu · d8734aaa · Apr 9, 2026 · 2 filesMessage 90 · StrongInformational 15Details
Commit message · yyforyongyu

sqldb/v2: fix sqlite migration errors

Wrap SQLite programmatic migration setup failures with the
SQLite error helper instead of the Postgres helper.

Before this change, a MakeProgrammaticMigrations failure on the
SQLite path returned an error that mentioned Postgres, which made
backend-specific setup failures needlessly confusing to debug.
The package still compiled and behaved normally unless that narrow
error path was exercised, which is why it slipped through.

Add a targeted unit test that forces the failing constructor path
and asserts the returned error is attributed to SQLite rather
than Postgres.

90/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit fixes a mistake in an error message: when a SQLite database migration setup failed, the error incorrectly blamed Postgres. The actual database behavior was unaffected; only the wording of a rare error path changed. A new test was added to confirm the error now correctly says 'sqlite'.

Lower-prioritysqldb/v2: restore sqlite conn limitby yyforyongyu · 82e3ce29 · Apr 9, 2026 · 4 filesMessage 90 · StrongLow 25Details
Commit message · yyforyongyu

sqldb/v2: restore sqlite conn limit

Restore the low default SQLite connection limit used in v1 so
the v2 store does not default to a Postgres-sized pool.

This is a real v2 regression from v1. The v1 store defines
DefaultSqliteMaxConns = 2 and routes SetMaxOpenConns through
cfg.MaxConns(), while v2 had fallen back to the generic
defaultMaxConns = 25. That change did not break compilation, but
it quietly changed runtime pool sizing in a way that is hostile
to SQLite's single-writer concurrency model and can increase lock
contention.

Add a small config helper and unit test so callers can still
override the limit explicitly while the default remains safe for
SQLite. The regression was easy to miss because existing tests
did not assert the effective default pool sizing.

90/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
AI analysis · Low 25/100

This commit fixes a regression in LND's new v2 SQL database layer. The v2 code accidentally used a 25-connection pool for SQLite, matching PostgreSQL defaults, instead of the v1 value of 2. SQLite handles writes poorly with many concurrent connections, so this change restores the low default to reduce lock contention and resource use. It is a reliability/performance fix, not a security vulnerability that can be directly exploited by an attacker.

AI review queuedsqldb/v2: enforce require ssl modeby yyforyongyu · 2be43f41 · Apr 9, 2026 · 2 filesMessage 90 · StrongModerate 60Details
Commit message · yyforyongyu

sqldb/v2: enforce require ssl mode

Apply the RequireSSL config knob when opening Postgres stores
so it cannot be silently ignored.

Before this change, sqldb/v2 exposed PostgresConfig.RequireSSL
but still opened cfg.Dsn verbatim, which meant RequireSSL=true
was a no-op. A caller could set RequireSSL=true together with a
DSN such as sslmode=disable and still establish a non-TLS
connection.

This is a v2-only API contract bug, not a v1 regression in DSN
handling: v1 never offered a separate RequireSSL flag and always
left TLS policy entirely up to the DSN. The fix rewrites the DSN
to use sslmode=require when needed, while preserving stricter
modes such as verify-ca and verify-full.

The bug was easy to miss because no test asserted that the boolean
flag changed the effective DSN or overrode an insecure sslmode.
Keep the focused DSN rewrite test because it proves the contract
without needing a live Postgres instance.

90/100 · StrongMessage clarity
✓ 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
second-pass: broader security terminology
AI analysis · Moderate 60/100

This commit fixes a bug in LND's new database library (sqldb/v2) where a 'require SSL' setting was silently ignored. A user could turn on RequireSSL=true, but if their database connection string also said sslmode=disable, the connection would still be made without encryption. The fix now rewrites the connection string to enforce TLS when RequireSSL is true, unless an even stricter TLS mode is already set. It also adds tests to prove the behavior.

Lower-prioritysqldb/v2: fix no_sqlite target buildsby yyforyongyu · ab7f36f2 · Apr 9, 2026 · 2 filesMessage 80 · StrongInformational 19Details
Commit message · yyforyongyu

sqldb/v2: fix no_sqlite target builds

Restore the no_sqlite shim so unsupported SQLite targets still
build the module.

Update the stub to satisfy the current migration interface and
restore the missing Postgres-only SQL error helpers. These
failures were easy to miss because the default developer and CI
paths build native SQLite targets, while the broken code only
showed up on no-SQLite architectures and build tags.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Informational 19/100

This commit fixes build errors that occurred when compiling LND's new SQL database module (v2) for platforms or build tags that exclude SQLite (for example, WebAssembly or some embedded architectures). It restores a 'stub' implementation so the code still compiles, updates the stub to match the current migration interface, and adds missing helper functions for interpreting Postgres database errors. There is no direct security vulnerability being patched; it is a build-compatibility and error-handling completeness fix.

Lower-prioritysqldb/v2: fix postgres time rewriteby yyforyongyu · 093c1c79 · Apr 9, 2026 · 2 filesMessage 78 · AdequateLow 36Details
Commit message · yyforyongyu

sqldb/v2: fix postgres time rewrite

Keep the Postgres schema rewrite keyed on " TIMESTAMP" so
CURRENT_TIMESTAMP is not rewritten while schema files are
adapted.

Add a focused unit test to keep the replacement aligned with the
existing v1 behavior.

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

This commit fixes a bug in how LND adapts its SQLite-style database schema for PostgreSQL. Previously, the word 'TIMESTAMP' was being replaced anywhere it appeared, which meant 'CURRENT_TIMESTAMP' could be mangled into 'CURRENT_TIMESTAMP WITHOUT TIME ZONE' and break database migrations. The fix makes the replacement only trigger when 'TIMESTAMP' appears as a standalone column type (with a leading space). A unit test was added to prevent regression.

Lower-prioritysqldb/v2: align test helper build tagsby yyforyongyu · cfb7ae35 · Apr 9, 2026 · 2 filesMessage 78 · AdequateInformational 15Details
Commit message · yyforyongyu

sqldb/v2: align test helper build tags

Align the backend-swapped test helper files with the platforms
where their backing SQLite and Postgres helper implementations
actually exist.

This keeps the exported helper surface internally consistent even
on targets that current CI likely does not exercise. Before this
change, the SQLite helper file was still selected on no-SQLite
targets, and the Postgres helper file was still selected on
openbsd and netbsd under test_db_postgres even though the Docker
fixture was compiled out there.

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 adjusts which test helper files are compiled on which operating systems and CPU types. It does not change any production code, user-facing behavior, or security-sensitive logic. It is a build-tag cleanup for internal test helpers.

Lower-prioritysqldb/sqlc: simplify non-terminal payment queryby yyforyongyu · 414fcc62 · Apr 8, 2026 · 4 filesMessage 68 · AdequateInformational 12Details
Commit message · yyforyongyu

sqldb/sqlc: simplify non-terminal payment query

Simplify FetchNonTerminalPayments by collapsing the selector down to
two branches: payments that are not failed and have no settled attempt,
and payments that still have unresolved attempts. This keeps the same
non-terminal semantics while making the query easier to reason about.

Also add a partial index on payments(id) where fail_reason IS NULL to
speed up the startup selector branch that scans payments without a
recorded failure reason.

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

This commit refactors a database query used at startup to find payments that still need attention, and adds a database index to make that query faster. There is no indication of a security vulnerability being fixed; it reads as a performance and code-clarity improvement.

Lower-prioritydocs: update release notesby Matthew Zipkin · 39639056 · Apr 8, 2026 · 1 fileMessage 47 · ThinInformational 15Details
Commit message · Matthew Zipkin

docs: update release notes

47/100 · ThinMessage clarity
✓ Descriptive subject✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit only updates the release notes document. It adds a one-line description of an earlier code change about detecting Taproot activation, and adds a contributor's name to the credits list. There are no code changes and no security fix or vulnerability described.