LL
← All projectsLightning Labs

LND

Go implementation of a complete Lightning Network node.

BitcoinLightning NetworkNormal
Repository coverage

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

141security candidates194second-pass queue1285AI analyses
77commits · 30 days
173commits · 60 days
599commits · 180 days
1237commits · 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
318Strong · 80–100
646Adequate · 60–79
391Thin · 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 Osuntokun20942204474
Elle Mouton26832268167
ziggie44416413165
Yong28513171
LNBiG111173
Jared Tobin909171
bitromortac531051069
yyforyongyu83861068
Erick Cestari26726070
Andras Banki-Horvath11311072
Gijs van Dam33230073
ziggieXXX2026070
Analysis record

Published AI watches

Last scanned 41 minutes ago

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

Merge pull request #11212 from ziggie1984/disable-legacy-channels

This change stops LND from opening new Lightning channels using the old 'legacy' commitment format. The legacy format makes it harder to recover funds if something goes wrong, because the money owed to you is tied to a secret key that chan…

Prevents opening new channels with the legacy commitment type, whose tweaked to_remote output complicates data-loss recoveryCloses a negotiation path where an empty channel_type TLV bypassed feature checks and forced a legacy channelAdds explicit RPC and wire rejection with a dedicated error code
112cb5f3by ziggieXXX+265−4716 files
Vendor flagged security relevance
Moderate 56 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11223 from gijswijs/legacy-dust-retribution-fix

This update fixes a bug in how LND handles old-style punishment transactions when a channel partner tries to cheat. Previously, tiny (dust) HTLCs were left as blank placeholder entries in the punishment data, which could cause the node to …

nil-pointer dereference risk in breach retribution pathlegacy revocation log handling inconsistency with modern formatdefensive hardening added for trimmed/dust HTLCs
500ca51fby ziggieXXX+168−146 files
No security note in commit
Moderate 62 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11190 from Roasbeef/zpay32-reject-duplicate-payment-hashes

This change tightens how LND reads Lightning invoices (BOLT 11). Previously, if an invoice contained more than one payment hash field, LND would silently keep the first one and ignore the rest. Now it rejects the invoice entirely. The rele…

Behavior change from 'use first duplicate field' to 'reject duplicate fields'New error type ErrDuplicatePaymentHash returned on duplicate payment hash fieldsMalformed/unsupported-length duplicate payment hash now treated as duplicate and rejected
86306f89by Yong+147−106 files
No security note in commit
Moderate 62 AI analysisMessage 98 · Strong
LL Lightning LabsLND BitcoinLightning Network

zpay32: reject duplicate payment hash fields

This change tightens how LND reads Lightning invoices. Previously, if an invoice contained more than one payment hash field, LND would silently keep the first valid one and ignore the rest. Now it rejects such invoices outright. This preve…

Behavioral change from silent first-field acceptance to explicit rejection of duplicate payment hash fieldsPrevents invoice parsing from depending on field ordering when multiple payment hashes are presentCovers malformed first field + valid second field, closing a potential bypass
e2f27063by Olaoluwa Osuntokun+147−106 files
Vendor flagged security relevance
Moderate 53 AI analysisMessage 58 · Thin
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11132 from yyforyongyu/task-11129-pong

This change fixes how LND answers network 'ping' messages from other Lightning nodes. Previously, LND would sometimes silently ignore valid pings to limit reply traffic, which violates the Lightning protocol (BOLT 1) and could make a peer …

Protocol compliance fix: BOLT 1 requires a Pong for every valid PingRemoved silent suppression of Pong replies that could cause peer timeout/misbehaviorUnified rate limiting now accounts for amplification bandwidth, not just ping count
d3d1f1d0by Olaoluwa Osuntokun+274−1715 files
Vendor flagged security relevance
Low 33 AI analysisMessage 90 · Strong
LL Lightning LabsLND BitcoinLightning Network

itest: stop creating legacy channels

This commit updates LND's integration tests to stop using an obsolete 'legacy' channel type and adds a test confirming that LND now rejects that legacy type. The commit message says the real fix is elsewhere in the same pull request: previ…

Deprecated commitment format (legacy) is now rejected by RPCTest added to verify legacy channel type is refusedUnused legacy node configuration flag removed
03d8b09dby ziggie+24−85 files
No security note in commit
Moderate 60 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11198 from gijswijs/amp-setlocal-reconstruction-fix

This change fixes a bug in LND's handling of AMP (Atomic Multi-Path) payments. Previously, if one partial payment set failed to reconstruct its secret preimage, the entire invoice was canceled, including unrelated partial payment sets from…

Denial-of-service against reusable static AMP invoices by causing unrelated accepted HTLC sets to be canceledIncorrect invoice state transition from set-local failure to global invoice cancellationAvailability impact on multi-payer AMP invoice scenarios
88959aecby Olaoluwa Osuntokun+155−44 files
Vendor flagged security relevance
Low 29 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11200 from ziggie1984/build-go-1.27.1

This commit updates the Go programming language version used to build LND from 1.25.13/1.26.6 to 1.26.8 (language version) and 1.27.1 (toolchain). It also regenerates many automatically generated RPC files and adjusts linter settings. The …

Go version bump may indirectly address unlisted runtime/standard-library security fixesLarge regenerated protobuf files suggest dependency/toolchain refresh rather than logic changeLinter configuration expanded to suppress new checks, consistent with a toolchain upgrade
ef4820e5by Olaoluwa Osuntokun+4932−412670 files
No security note in commit
Informational 15 AI analysisMessage 92 · Strong
LL Lightning LabsLND BitcoinLightning Network

build: adopt focused golangci-lint v2.13 checks

This commit is a routine build-maintenance change. It updates the project's Go linter configuration to a newer version and fixes the resulting style warnings: a WebSocket header spelling and several documentation comments that didn't start…

bada7ea3by ziggie+27−1911 files
No security note in commit
Informational 15 AI analysisMessage 68 · Adequate
LL Lightning LabsLND BitcoinLightning Network

lnrpc: regenerate protos with Go 1.27

This commit is a housekeeping change that regenerates automatically generated RPC binding files using a newer Go compiler version. The only differences are in code comments (doc-comment formatting), not in actual program logic or API behav…

dd523108by ziggie+4501−369826 files
No security note in commit
Informational 20 AI analysisMessage 100 · Strong
LL Lightning LabsLND BitcoinLightning Network

build: fix Go 1.27 compatibility

This commit is a routine build-and-test maintenance patch to make the LND codebase compile and pass tests with the upcoming Go 1.27 release. It upgrades the project's custom linter tool, refreshes many indirect tool dependencies, adjusts o…

No production code changesNo vulnerability fix or CVE reference presentDependency-only refresh in tools module (development tooling)
6b54a387by ziggie+365−3706 files
No security note in commit
Informational 15 AI analysisMessage 80 · Strong
LL Lightning LabsLND BitcoinLightning Network

build: bump Go language and toolchain versions

This commit is a routine maintenance update that changes which version of the Go programming language is used to build the lnd project. It does not change any application logic, fix a bug, or address a security vulnerability. The project i…

b1f9ca66by ziggie+39−3930 files
No security note in commit
Moderate 60 AI analysisMessage 83 · Strong
LL Lightning LabsLND BitcoinLightning Network

invoices: cancel only the failing AMP set on reconstruction failure

This commit fixes a bug in LND's invoice handling for reusable AMP (Atomic Multi-Path) invoices. Previously, if one payment set failed to reconstruct its preimage, the entire invoice was canceled, even though other valid payment sets on th…

Denial-of-service-like availability impact: a malicious or buggy payer could cause a whole reusable AMP invoice to be canceled, blocking legitimate concurrent payersSet-local failure incorrectly escalated to invoice-global cancellationRegression test added for concurrent-set survival after reconstruction failure
d74ab6faby Gijs van Dam+141−42 files
No security note in commit
Low 34 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11061 from bitromortac/2604-bolt12-1f

This commit adds the missing cryptographic signature layer for BOLT 12 offers in LND. It builds a Merkle tree from the message fields, signs that tree with a BIP-340 Schnorr signature, and now rejects invoice requests and invoices whose si…

Adds BIP-340 Schnorr signature verification for BOLT 12 invoice_request and invoice messagesMerkle tree commits to canonical re-encoded TLV records; non-minimal feature/amount encodings now rejected to preserve byte-exactnessSignature TLV type 240 and reserved range 240-1000 excluded from the signed Merkle root
1049d301by Yong+2076−7815 files
Vendor flagged security relevance
Low 35 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11125 from bhandras/codex/reorg-aware-output-lock-20260825

This commit adds a new optional wallet feature to LND that lets users lock UTXOs until the transaction spending them reaches a chosen confirmation depth, instead of relying on a wall-clock timeout. It is a feature addition with safety chec…

New RPC fields release_after_spend_confs and confirmed_spend_height added to LeaseOutput and FundPsbtCustom lock ID enforced as required for confirmation-controlled FundPsbt leases; all-zero and reserved internal IDs rejectedCapability check (ResolveOutputLeaser) prevents silent downgrade to time-only lease when confirmation control is requested
80dde144by Yong+1293−10021 files
No security note in commit
Informational 19 AI analysisMessage 58 · Thin
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #10812 from ziggie1984/chanstate-kv-store-move

This commit is a large internal code reorganization for the LND Lightning node. It moves channel state storage logic from the `channeldb` package into a new `chanstate` package, while keeping the same database keys, serialization formats, …

Large refactoring with no change to cryptographic or consensus-critical logicCodec serialization moved verbatim to new package; wire format unchangedDatabase bucket keys and TLV record types preserved
62b0a073by Olaoluwa Osuntokun+3923−310924 files
No security note in commit
Low 25 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #10804 from GeorgeTsagk/close-immediately-itest-lnd-7c38

This change fixes a data-handling bug in LND's channel-opening code. When opening a Lightning channel using an optional 'auxiliary funding controller' (used for custom channel types such as Taproot Assets), the funding manager was previous…

Data-correctness fix in funding handshake: negotiated channel configs now exposed to auxiliary funding controllerAuxiliary funding controller receives incomplete channel state before patch, complete state after patchNo explicit security claim, CVE, or advisory referenced in commit or supplied materials
1e127653by Olaoluwa Osuntokun+291−254 files
No security note in commit
Moderate 60 AI analysisMessage 88 · Strong
LL Lightning LabsLND BitcoinLightning Network

bolt12: verify invoice_request and invoice signatures on read

This change makes LND's BOLT 12 invoice and invoice-request reader actually check that the digital signature is valid, instead of only checking that a signature field exists. Before, an attacker could craft or modify a BOLT 12 message and …

Missing cryptographic verification on parsed BOLT 12 messages replaced with BIP-340 Schnorr signature verificationReader accepted any 64-byte placeholder signature before the patchNew negative tests verify rejection of wrong-signer and tampered Merkle-root fields
aa8bd19fby bitromortac+272−723 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 78 · Adequate
LL Lightning LabsLND BitcoinLightning Network

itest: cover confirmation-controlled leases

This commit only adds a new integration test for an existing feature called confirmation-controlled leases. It does not change production code, so it cannot introduce a security vulnerability or fix one directly. The test exercises how lon…

a1ab4e92by Andras Banki-Horvath+152−02 files
No security note in commit
Moderate 68 AI analysisMessage 73 · Adequate
LL Lightning LabsLND BitcoinLightning Network

Merge pull request #11122 from gijswijs/websocket-proxy-hardening

This update fixes two security-related bugs in LND's REST WebSocket proxy. First, a specially crafted WebSocket protocol header could crash the proxy (a panic). Second, the proxy previously had no limit on how large an incoming WebSocket m…

panic fix in request header parsingunbounded incoming WebSocket message read now cappedincorrect header value assignment possible before fix
c662f853by Yong+227−104 files
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-prioritychanstate: use channel types in fitnessby ziggie · 19e656b2 · Jul 7, 2026 · 3 filesMessage 68 · AdequateInformational 15Details
Commit message · ziggie

chanstate: use channel types in fitness

Move channel event payloads in chanfitness to chanstate types.

The event store still uses channeldb for flap-count persistence and
related errors, but open-channel and close-summary values now come from
the channel-state package.

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 small internal code cleanup in LND's channel-fitness subsystem. It swaps one internal Go data type for another equivalent one (moving from channeldb to a newer chanstate package) in test and production code. There is no user-facing behavior change, no bug fix, and no security-relevant change visible in the diff.

Security candidatechanstate: fix htlc copyby ziggie · b720fd5c · Jul 6, 2026 · 2 filesMessage 56 · ThinLow 46Details
Commit message · ziggie

chanstate: fix htlc copy

Copy all HTLC fields when cloning channel commitment state.

The old copy method only copied a subset of scalar fields and copied
into nil slices for Signature and ExtraData. Allocate those slices and
deep-copy custom record values so snapshots and channel copies retain
complete HTLC metadata.

56/100 · ThinMessage clarity
✓ Subject identifies a change✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
signing boundary
AI analysis · Low 46/100

This commit fixes a bug in how the Lightning Network Daemon (LND) copies payment channel data. When the program made a copy of an HTLC (a pending payment in a Lightning channel), it failed to copy several important fields and did not properly duplicate variable-length data like signatures, extra data, and custom records. This could cause copies or snapshots of channel state to be incomplete or accidentally share mutable data. The fix deep-copies all relevant fields and adds a test to verify the copy is fully independent.

AI review queuedchanstate: remove store genericsby ziggie · 68ad283d · Jul 6, 2026 · 15 filesMessage 58 · ThinInformational 15Details
Commit message · ziggie

chanstate: remove store generics

Drop the temporary channel type parameter from the channel-state store
interfaces now that OpenChannel lives in chanstate.

The domain store subinterfaces now refer to *OpenChannel directly while
retaining the same backend-independent shape. Update callers and
compatibility aliases to use the concrete Store and ChannelShell types.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 15/100

This commit is a routine internal code cleanup in the LND Lightning node software. It removes temporary generic type parameters from channel-state database interfaces and replaces them with direct references to the concrete OpenChannel type. There are no user-facing behavior changes, no bug fixes, and no security-related modifications.

Lower-prioritychanneldb: document legacy fwd packager interfaceby ziggie · c5aabdf8 · Jul 6, 2026 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · ziggie

channeldb: document legacy fwd packager interface

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only adds a documentation comment (a TODO note) to an existing interface in the channel database code. No code behavior was changed, no bug was fixed, and no security issue is present in the diff.

Lower-prioritychanstate: split commitment store interfaceby ziggie · 07ede43a · Jul 6, 2026 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · ziggie

chanstate: split commitment store interface

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit is a pure code refactoring change. It takes one existing Go interface called OpenChannelCommitmentStore and splits it into two smaller interfaces: one for write/mutation operations and one for read/query operations. The original interface is preserved by embedding the two new ones. No behavior, logic, or security properties of the software change.

Lower-prioritychanneldb: add store status checkby ziggie · 6eef3ad6 · Jul 6, 2026 · 1 fileMessage 68 · AdequateInformational 11Details
Commit message · ziggie

channeldb: add store status check

Add a transitional non-locking status predicate for channeldb store
code and use it from KV serialization helpers.

This avoids calling an unexported OpenChannel helper from channeldb
after the type moves into chanstate.

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

This commit is a small internal code cleanup in LND's channel database code. It adds a new public helper method that lets store/serialization code check a channel's status without grabbing a lock, and switches a few internal serialization functions to use it. There is no direct security fix or vulnerability being patched here; it appears to be preparation for a larger code reorganization.

Lower-prioritychanstate: move channel snapshot typeby ziggie · aeab363a · Jul 6, 2026 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · ziggie

chanstate: move channel snapshot type

Move the backend-neutral ChannelSnapshot value type into chanstate and
leave channeldb with a compatibility alias.

This keeps the future OpenChannel Snapshot receiver close to its return
type without changing existing channeldb callers.

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 reorganization: it moves a data structure called ChannelSnapshot from one package (channeldb) to another (chanstate), and leaves a compatibility alias so existing code keeps working. There are no functional changes, no bug fixes, and no security implications.

Lower-prioritychanstate: move open channel typeby ziggie · 3adc0133 · Jul 6, 2026 · 7 filesMessage 78 · AdequateInformational 15Details
Commit message · ziggie

chanstate: move open channel type

Move OpenChannel and its backend-neutral receiver methods into the
chanstate package.

channeldb now keeps a compatibility alias while retaining the KV store
implementation and serialization helpers. Tests that used private
channel status fields now use store-facing accessors.

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 pure internal code reorganization (refactor). It moves the OpenChannel data type and its methods from the channeldb package into a new chanstate package, while leaving a compatibility alias in channeldb so existing code keeps working. There are no user-facing behavior changes, no protocol changes, and no security fixes or vulnerabilities introduced in the visible diff.

AI review queuedchanstate: move taproot channel helpersby ziggie · c065aa91 · Jul 6, 2026 · 2 filesMessage 78 · AdequateInformational 15Details
Commit message · ziggie

chanstate: move taproot channel helpers

Move the backend-neutral taproot shachain and verification nonce
helpers into chanstate with the thaw-height threshold they support.

Leave channeldb aliases for existing callers while OpenChannel and its
receiver methods are moved across the package boundary.

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 validationsecond-pass: broader security terminology
AI analysis · Informational 15/100

This commit is a routine code reorganization: it moves two helper functions and a constant related to Taproot channels from one internal package (channeldb) to another (chanstate), and leaves aliases in the old location so existing callers keep working. There is no change to behavior, no bug fix, and no security patch.

AI review queuedchanneldb: derive channel packagersby ziggie · 0229e0ad · Jul 6, 2026 · 9 filesMessage 58 · ThinInformational 18Details
Commit message · ziggie

channeldb: derive channel packagers

Remove the KV forwarding packager from OpenChannel and derive a
ChannelPackager inside the channeldb store methods that need one.

This keeps the backend-specific kvdb transaction helper in channeldb,
so the OpenChannel type no longer carries that dependency toward
chanstate.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: broader security terminologysecond-pass: security-sensitive path
AI analysis · Informational 18/100

This commit is a code cleanup: it removes a forwarding-package helper object from the in-memory channel state and instead creates it on demand inside database methods. There is no direct security fix or vulnerability being patched. It mainly reduces coupling between components and updates tests to match the new structure.

Lower-prioritychanstate: move revocation log typesby ziggie · dbc9a701 · Jul 6, 2026 · 3 filesMessage 78 · AdequateInformational 15Details
Commit message · ziggie

chanstate: move revocation log types

Move the revocation-log value types and TLV serialization helpers into
chanstate.

Leave channeldb aliases and wrapper functions for the existing KV
persistence code and tests. Bucket keys, errors, and transaction
helpers stay in channeldb, so this commit only moves backend-neutral
state data.

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 straightforward code reorganization: it moves data type definitions and serialization helpers for revocation logs from the channeldb package into a new chanstate package, while keeping the actual database storage code in channeldb. There is no change to how data is stored, parsed, or validated, and no security-relevant behavior is altered.

Lower-prioritychanstate: add previous state lookupby ziggie · 1bcd4d65 · Jul 6, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · ziggie

chanstate: add previous state lookup

Add FindPreviousState to the chanstate commitment store subinterface now that
RevocationLog is a chanstate value type.

This extends the store contract without changing runtime behavior. The
existing ChannelStateDB method already satisfies the new method.

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

This commit only adds a new method declaration to an internal Go interface in LND's channel state package. It does not change any running code, data handling, or security behavior. The commit message explicitly says it extends the store contract without changing runtime behavior. There is no security issue visible in this change.

Lower-prioritychanneldb: store channel state by interfaceby ziggie · 40234f3c · Jul 6, 2026 · 6 filesMessage 78 · AdequateInformational 15Details
Commit message · ziggie

channeldb: store channel state by interface

Change OpenChannel.Db to the composed chanstate Store interface while
keeping the existing field name.

Tests that need raw channeldb access now assert the concrete test
backend explicitly instead of reaching through OpenChannel.Db. This
keeps backend setup out of the store contract.

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 straightforward internal code cleanup: it changes the type of one field in LND's channel database from a concrete database pointer to a more generic 'Store' interface. The goal is to make future refactoring easier, not to fix a bug or close a security hole. No security relevance is visible in the change itself or in the commit message.

Lower-prioritychanneldb: split out channel kv helpersby ziggie · a82ea84a · Jul 6, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · ziggie

channeldb: split out channel kv helpers

Convert the KV-only OpenChannel helpers for TLV aux data and
borked-state lookup into package-level channeldb helpers.

This keeps serialization and bucket inspection code tied to the KV
backend while leaving the OpenChannel receiver set closer to the future
chanstate type.

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 straightforward internal code cleanup in LND's channel database code. It converts a few helper methods that were attached to the OpenChannel type into plain package-level functions. There are no user-facing changes, no bug fixes, and no security-sensitive behavior changes.

Lower-prioritychanneldb: move revocation tail helperby ziggie · e2812246 · Jul 6, 2026 · 2 filesMessage 78 · AdequateInformational 15Details
Commit message · ziggie

channeldb: move revocation tail helper

Keep the revocation-log tail-height helper on ChannelStateDB instead of
the OpenChannel receiver.

The helper is only used by channeldb tests, so it should not become
part of the backend-independent chanstate store contract. The tests now
call the concrete helper directly.

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 is a small internal code cleanup. A helper function used only in tests is moved from one object to another so it does not become part of a new storage interface. There is no user-facing change and no security fix.

Lower-prioritychanneldb: add channel store accessorsby ziggie · 4fbb51b5 · Jul 6, 2026 · 1 fileMessage 68 · AdequateInformational 18Details
Commit message · ziggie

channeldb: add channel store accessors

Add transitional OpenChannel accessors for the channel status and
confirmed SCID fields used by KV store code.

These helpers keep the fields private while allowing channeldb backend
code to continue hydrating and serializing channel state after
OpenChannel moves to chanstate.

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

This commit adds temporary getter and setter helper methods to access two internal fields of an open Lightning channel (channel status and confirmed short channel ID). The helpers intentionally skip the normal mutex lock because they are meant for internal database serialization code during a larger code reorganization. The commit does not fix a vulnerability; it is a structural refactor to keep private fields accessible while the data model is moved to a new package.

Lower-prioritychanstate: add commit tail storeby ziggie · 7029960d · Jul 6, 2026 · 2 filesMessage 68 · AdequateInformational 11Details
Commit message · ziggie

chanstate: add commit tail store

Add the commitment-tail advancement method to the chanstate commitment
store subinterface.

Move the existing AdvanceCommitChainTail KV transaction body onto
ChannelStateDB. The OpenChannel receiver now keeps locking and restored
channel checks before delegating persistence through the store.

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

This commit is a straightforward internal code reorganization. It moves the database logic for advancing a Lightning channel's commitment chain from one object (OpenChannel) to another (ChannelStateDB) and adds the corresponding method to an interface. There is no visible change in behavior, no bug fix, and no security-related content in the commit message or diff.

Lower-prioritychanstate: add forwarding package storeby ziggie · 61f26df2 · Jul 6, 2026 · 2 filesMessage 68 · AdequateInformational 13Details
Commit message · ziggie

chanstate: add forwarding package store

Add a forwarding-package store subinterface to chanstate.Store.

Move the existing OpenChannel forwarding-package KV transaction bodies
onto ChannelStateDB. The OpenChannel receivers keep their locking
behavior and delegate package loading, acking, filtering, and removal
through the store.

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

This commit is a straightforward internal code reorganization. It moves the logic for loading, acknowledging, and removing HTLC forwarding packages from the OpenChannel type to a new ChannelStateDB store interface. The actual database operations and locking behavior remain unchanged. There is no indication this fixes or introduces a security vulnerability.

Lower-prioritychanstate: move forwarding package typesby ziggie · 71864a32 · Jul 6, 2026 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · ziggie

chanstate: move forwarding package types

Move FwdState, PkgFilter, and FwdPkg into chanstate with their existing
comments and helper methods.

Leave channeldb aliases for the moved value types and constructors so
current callers keep compiling. The KV forwarding package persistence
code stays in channeldb.

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 straightforward internal code reorganization: it moves some data types and helper functions related to forwarding packages from one package (channeldb) to another (chanstate), while keeping aliases in the original package so existing code continues to compile. There is no functional change, no bug fix, and no security-relevant behavior change visible in the diff.

Lower-prioritychanstate: add commitment read storesby ziggie · 4a9ae1c5 · Jul 6, 2026 · 2 filesMessage 68 · AdequateInformational 12Details
Commit message · ziggie

chanstate: add commitment read stores

Add commitment-height, latest-commitment, and remote revocation store
lookups to the chanstate commitment store subinterface.

Move the existing OpenChannel KV view transaction bodies onto
ChannelStateDB. This leaves the receivers as store-call wrappers while
keeping the persisted format and read behavior unchanged.

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

This commit is a straightforward internal code reorganization. It moves the database-reading logic for three channel-state queries from the OpenChannel object to a new ChannelStateDB helper, and adds matching method declarations to an interface. The actual data format, read behavior, and locking are unchanged. There is no visible security fix or vulnerability being introduced.

Lower-prioritychanneldb: move revocation log readsby ziggie · 3e1aab02 · Jul 6, 2026 · 1 fileMessage 78 · AdequateInformational 12Details
Commit message · ziggie

channeldb: move revocation log reads

Move the remaining OpenChannel revocation-log KV reads onto
ChannelStateDB.

This keeps FindPreviousState and the unit-test tail-height helper as
OpenChannel wrappers. It removes direct backend access from the
receiver methods while leaving RevocationLog in channeldb for now.

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

This commit is a straightforward internal code reorganization in LND's channel database. It moves two existing database-read helpers from the OpenChannel type to the ChannelStateDB type, leaving thin wrapper methods behind. There is no change to what data is read, how it is validated, or how it is exposed to users or the network. It is best described as a refactoring/cleanup change.

Lower-prioritychanstate: add commitment store subinterfaceby ziggie · 68ada20b · Jul 6, 2026 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · ziggie

chanstate: add commitment store subinterface

Add a commitment-focused store subinterface for updating local channel
commitment state. This lets OpenChannel call through the chanstate
store contract instead of reaching directly into the KV backend.

Keep the existing KV transaction body on ChannelStateDB for now. The
receiver still owns locking and in-memory state updates while the store
method owns persistence.

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 straightforward internal code reorganization. It moves the existing logic for saving channel commitment updates from one place in the code to another, without changing what the logic actually does. There is no user-facing change and no indication of a security fix.

Lower-prioritychanstate: move commitment diff typesby ziggie · 9dfb8c1e · Jul 6, 2026 · 4 filesMessage 68 · AdequateInformational 15Details
Commit message · ziggie

chanstate: move commitment diff types

Move CommitDiff and its forwarding reference types into chanstate. This
lets the next commitment store subinterface name pending remote commitment
state without importing channeldb.

Keep forwarding package persistence and commit-diff serialization in
channeldb for now. The aliases preserve existing call sites while the
KV backend code remains in place.

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 straightforward internal code reorganization. It moves the definitions of CommitDiff, AddRef, and SettleFailRef from the channeldb package to a new chanstate package, and creates type aliases in channeldb so existing code keeps working. There is no change to how data is stored, parsed, or validated, and no security fix or vulnerability is introduced.

AI review queuedchanstate: add remote commit chain storeby ziggie · 06308e1d · Jul 6, 2026 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · ziggie

chanstate: add remote commit chain store

Add the remote commitment-chain append method to the chanstate
commitment store subinterface.

Move the existing KV transaction body onto ChannelStateDB and have the
OpenChannel receiver call through the store. This removes another
direct backend dependency from OpenChannel while keeping KV persistence
code in channeldb.

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

This commit is a straightforward internal code reorganization. It moves the existing logic for saving a new remote commitment-chain update from one place in the code to another, without changing what the logic actually does. There is no user-facing behavior change and no security fix or vulnerability introduced.

Lower-prioritychanstate: add commit lookup storeby ziggie · 349567c7 · Jul 6, 2026 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · ziggie

chanstate: add commit lookup store

Add read-side commitment lookup methods to the chanstate commitment
store subinterface.

Move the existing OpenChannel KV view transaction bodies onto
ChannelStateDB. Leave the OpenChannel receivers as store-call wrappers.
This removes three more direct backend references from the receiver
code without changing the persisted data format.

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 straightforward internal code reorganization. It moves three read-only database lookup methods from the OpenChannel type to the ChannelStateDB type, and adds matching method declarations to an interface. The actual database queries, data read, and data format are unchanged. There is no user-facing behavior change and no security fix or vulnerability introduced.