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.
Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.
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
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
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
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…
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
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
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.
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
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
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
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
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
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
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
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.
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
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…
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
This commit fixes the GitHub Actions CI setup for running a custom code linter. It makes sure Docker can read and write build caches correctly and that the built linter image is available for later steps. There is no user-facing security f…
This patch fixes a database bug in the Lightning Network Daemon (LND) where very long lists of unsigned, acknowledged channel updates could be silently truncated when saved to disk. Because the storage format used a 16-bit counter, lists l…
Integer truncation / wrap-around in serialization format (uint16 count)Silent data loss on restart due to undersized length fieldDefensive deserialization with count-modulo validation
Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.
AI review queuedmulti: make RemoteNextRevocation an fn.Optionby Olaoluwa Osuntokun · 4bdb3320 · Sep 23, 2026 · 18 filesMessage 78 · AdequateLow 32Details
Commit message · Olaoluwa Osuntokun
multi: make RemoteNextRevocation an fn.Option
In this commit, we change OpenChannel.RemoteNextRevocation and ChannelCloseSummary.RemoteNextRevocation from a bare *btcec.PublicKey to an fn.Option[btcec.PublicKey], and have LightningChannel.RemoteNextRevocation return one as well. The remote party's next revocation point is legitimately absent until they send channel_ready (and, for taproot channels, until we have their nonces), so the type should say so rather than leaving it to convention.
With an Option, code can no longer move the point into a field that assumes it's always set without first deciding what to do when it's absent. Every place that needs the point now has to unwrap it: the revocation rotation, restoring a pending remote commitment, the anchor resolution and chain watcher paths for a pending remote commitment, and a retransmitted channel_ready in the peer. Each returns the new ErrNoNextRevocation if it's missing. The presence checks in the funding manager, link and peer become IsSome/IsNone.
We hold the key by value rather than by pointer, so a present point is always a real key: there's no Some(nil) to fall into. In the same spirit, InsertNextRevocation and InitNextRevocation now take the key by value, which moves the only pointer dereference to the funding manager, where the point comes straight off a decoded channel_ready message.
The on-disk format is unchanged. The revocation state still omits the point when it's absent, and the close summary still writes a presence flag ahead of it. The frozen migration packages keep their own copies of these types, so they're untouched.
We add a round trip test for a channel with no next point, and for close summaries with and without one. The peer test for a retransmitted channel_ready previously passed a channel with no next point and inserted an empty value. It now asserts that case is rejected, and that a real point makes it into the peer's copy of the channel.
78/100 · AdequateMessage clarity
✓ 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 · Low 32/100
This commit is a defensive code-quality change in LND that makes the 'remote next revocation point' an explicit optional value instead of a bare pointer that could be nil. It forces every piece of code that needs the point to check whether it is actually present before using it, and returns a clear error (ErrNoNextRevocation) when it is missing. The on-disk database format is unchanged, and new tests are added for channels and close summaries that lack the point. The change reduces the risk of accidental nil-pointer use or logic bugs around channels that have not yet received channel_ready, but it is not a fix for a known active exploit.
In this commit, we refine revocation processing and extend its transition coverage. The state-transition and key checks now run before their corresponding revocation bookkeeping updates.
The tests cover the rejected cases for tweakless and taproot channels, verify that their revocation bookkeeping stays unchanged, and confirm that the next valid transition succeeds.
78/100 · AdequateMessage clarity
✓ 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 · Moderate 59/100
This change tightens the order of checks when LND processes a revocation message from the other party in a Lightning channel. Previously, the code could add a secret to its revocation store before confirming the revocation was actually expected and matched the right commitment point. Now it checks those conditions first, so a malformed or unexpected revocation cannot partially update local state. The patch is defensive hardening rather than a clear fix for an active exploit.
Merge pull request #11223 from gijswijs/legacy-dust-retribution-fix
lnwallet+contractcourt: skip trimmed HTLCs in legacy breach retribution
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Moderate 56/100
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 crash or behave incorrectly when trying to claim funds back. The fix removes those blank entries and adds safety checks further down the line.
Extend commitment-difference classification to distinguish outgoing HTLCs whose preimages are available. A forwarded HTLC learns its preimage from the downstream peer, which the link records in the witness beacon before accepting the commitment that removes the HTLC, so classification and settlement consult that source alone. This matches the source the incoming contest resolver uses for forwarded HTLCs on chain.
Publish their terminal result through the existing resolution-message path, keeping commitment-difference handling consistent with other resolved HTLC states.
The sites that classify incoming HTLCs keep the registry fallback, so an incoming HTLC paying one of our invoices still takes us to chain and sets the sweep deadline.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Merge pull request #11190 from Roasbeef/zpay32-reject-duplicate-payment-hashes
zpay32: reject duplicate payment hash fields
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
Why it was queued
parser or protocol pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Moderate 62/100
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 release notes frame this as an interoperability improvement rather than a security fix, but the behavior removes a potential source of confusion or invoice manipulation where a second, different payment hash could be present but ignored.
In this commit, we reject BOLT 11 invoices that contain more than one payment hash (`p`) field. `zpay32.Decode` previously kept the first supported payment hash and ignored later fields, so the interpreted payment hash depended on field order.
The decoder now tracks whether a `p` field has appeared separately from whether its contents parsed successfully, and any later `p` field returns `ErrDuplicatePaymentHash`. This covers identical hashes, distinct hashes, and a malformed first field followed by a valid one. The change is deliberately stricter than the current BOLT 11 text, which tells a reader to use the first `p` field; it is motivated by lightning/bolts#1357, and will be backported to the v0.20.5 and v0.21.4 releases.
We also replace the stale comment above parse32Bytes, which quoted the old BOLT 11 rule that a reader must skip over 32-byte fields with an unsupported length. The current reader requirements say the opposite: a reader must fail the payment if a fixed-length field (p, h, s, n) does not have the correct length. The new comment states that reporting the field as absent is a known divergence, and explains why the end result for the payment hash is the same either way.
In the tests, we cover identical and distinct duplicate hashes, a malformed first field followed by a valid one, and the signed vectors. A valid variant of the flipped vector keeps the wrong-length h and n fields, so the coverage that such fields are skipped survives. The duplicate vector in the decode table pins ErrDuplicatePaymentHash through a new wantErr field rather than asserting any decode error.
98/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
parser or protocol pathsecond-pass: security-sensitive path
AI analysis · Moderate 62/100
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 prevents an attacker from potentially tricking a wallet into interpreting a different payment hash than intended, which could lead to payments being sent to the wrong destination or failing in unexpected ways. The fix is being backported to two release branches.
Merge pull request #11161 from ziggie1984/invoice-lookup-cleanup
invoices: contain modifier errors and bypass interception for replays
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-prioritylnrpc: document that the legacy commitment type is rejected on inputby ziggie · 9b634bfd · Sep 22, 2026 · 3 filesMessage 73 · AdequateTriage 0Details
Commit message · ziggie
lnrpc: document that the legacy commitment type is rejected on input
In this commit, we document the restriction on the API itself, so callers can discover it without reading the release notes. The LEGACY enum value notes that it is only ever reported for channels that already exist, and the commitment_type fields of OpenChannelRequest and BatchOpenChannel note that it is turned down as an input.
Worth spelling out on those fields that an empty channel type on the wire asks for the legacy type as well, so there is no way to request it at all.
The generated code carries no change beyond the comments.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
channeldb: preserve responses during channel cleanup
Integrate the circuit-keyed forwarding response store with both channel cleanup strategies.
Select eligible settle and fail messages before applying the forwarding package lifecycle transition. The synchronous path updates both stores in one transaction, while the tombstone path applies the same response persistence rule with its existing package behavior.
This makes response state consistent across the supported database cleanup strategies.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Load persisted forwarding responses during switch startup and send them through the existing packet path.
Process these records before contract-court resolutions so the original wire message takes precedence when both sources refer to one circuit. The replayed packet has no destination reference because package acknowledgement is handled by the persistence transition.
Prune records without an open circuit and propagate storage or decoding errors. The store is not populated until the channel cleanup integration lands in a later commit.
85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Add a top-level store for forwarding settle and fail messages indexed by outgoing circuit key. This aligns response lookup with the circuit-oriented model already used for contract-court resolution messages.
Keep each response in its original wire encoding so replay preserves failure reasons, custom records and other message details.
This commit establishes the storage schema and access methods. Later commits connect the store to switch startup and channel cleanup.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Merge pull request #11132 from yyforyongyu/task-11129-pong
peer: answer every valid ping
58/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
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 think the connection is dead. Now LND replies to every valid ping, while still disconnecting peers that flood too many pings. The cost of a reply is counted against a single flood budget based on how large the reply would be.
docs: add 0.20.5 release notes for the legacy commitment type
In this commit, we spell out that existing legacy channels are not affected and can still be operated and closed, since that is the question an operator reading these notes will have. Only opening new ones is refused.
85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
docs: add 0.21.4 release notes for the legacy commitment type
In this commit, we add the same entries as the 0.20.5 notes, kept in a commit of their own so that each backport carries only the release notes of the branch it lands on.
97/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
documentation-only discount
Lower-priorityfunding: never open a legacy channelby ziggie · 6ea22314 · Sep 21, 2026 · 3 filesMessage 90 · StrongTriage 0Details
Commit message · ziggie
funding: never open a legacy channel
In this commit, we stop opening and accepting new channels using the legacy commitment type, which was removed from the spec in 2024. Its tweaked to_remote output is why funds in such a channel cannot be recovered unilaterally after data loss. Channels that already use it are untouched: they keep working and can be operated, force closed and cooperatively closed exactly as before.
An empty channel_type asks for precisely this type, and that branch performed no feature check whatsoever, since the type predates feature bits entirely. Any peer could obtain a legacy channel from us no matter what either side signalled, which is what TestFundingManagerRejectLegacyChanType now covers.
Implicit negotiation keeps falling back to the static remote key type, and only fails once there is nothing left below it.
The funding manager's own test nodes signalled no features at all, which means they were negotiating legacy channels among themselves. They now default to static remote key.
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
Lower-priorityrpcserver: reject the legacy commitment type in OpenChannelby ziggie · a0374796 · Sep 21, 2026 · 1 fileMessage 73 · AdequateTriage 0Details
Commit message · ziggie
rpcserver: reject the legacy commitment type in OpenChannel
In this commit, we turn down a request for the legacy commitment type before we touch the wallet or the peer, so the caller gets a clear error instead of one from deep inside the funding flow.
The LEGACY enum value itself has to stay: CommitmentType is also the reporting type for ListChannels, ClosedChannels, PendingChannels and the channel acceptor, and channels we already have still report it.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
In this commit, we move the two tests that still opened legacy channels over to static remote key. Both produce the same commitment shape and the same fees, so no assertion moves.
The watchtower case opted into legacy deliberately. The remote signer one did not: neither of its nodes runs with committweak, so both support static remote key, and the channel only came out legacy because an empty channel_type was accepted without any check. That is the bug this PR fixes, sitting in our own suite.
The legacy node arguments and the unreferenced CfgLegacy go away with them, since committweak no longer does anything.
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
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Low 33/100
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: previously, an empty channel_type was accepted without checking whether the nodes actually supported the legacy format, which could cause a channel to open in an unintended, deprecated commitment shape. The diff itself only changes tests and removes unused legacy-node configuration flags; it does not contain the actual production-code fix.