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 commit changes how the Lightning Dev Kit's block-sync module verifies Lightning network gossip announcements. Instead of downloading entire Bitcoin blocks (which can be large), it now downloads only the list of transaction IDs for a b…
API surface change in UtxoSource traitReduced data exposure: no longer fetches full blocks for gossip verificationNew JSON parsing for txid lists and TxOut values
This commit changes how the Lightning Dev Kit (LDK) node software handles receiving the same block twice through its filtered-block interface. Previously, calling filtered_block_connected with the current tip again would trigger an asserti…
Assertion relaxation in block connection pathPotential denial-of-service vector removed: previously a malicious or buggy filter provider could crash the node by replaying the current tipNew test coverage for same-block filtered rescan
This commit only adds a new test mode to the project's internal testing framework. It lets developers simulate a specific way blocks are delivered to the Lightning node (a 'replay' through the Listen interface) so that behavior is covered …
This commit changes only internal test helper code in the Lightning Dev Kit repository. It makes the functional test framework smarter about 'block replays'—situations where the same block is fed to a test node more than once—so the fake b…
No production code modifiedNo cryptographic, consensus, or networking changesCommit message frames change as test-framework correctness, not security
This patch fixes a bug in the Lightning Dev Kit where the software could confuse HTLCs (payment contracts) on live, unrevoked counterparty commitment transactions with ones from old, revoked transactions. Previously, it relied only on whet…
Incorrect revocation state detection for counterparty commitment transactionsHTLC direction not previously checked when matching against pending HTLCsPromotion of debug assertions to full assertions for HTLC claim path consistency
This commit changes how the Lightning networking code handles oversized encrypted messages. Previously, certain conditions would cause the program to crash with a panic. Now the code returns errors instead, which is a defensive improvement…
panic-to-error conversion for oversized message encryption/decryptiondenial-of-service hardening against oversized peer messagesdebug_assert retained to preserve test coverage of invariant violations
This commit fixes a crash bug in the Lightning Dev Kit's peer message handling. Previously, if a message grew too large to be sent over the encrypted peer connection, the code would panic (abruptly terminate the whole program). The patch m…
Replaces a `.expect()` panic path with a fallible `Result` in peer message encryptionAdds graceful peer disconnection when a critical message cannot be sentIncludes a regression test for oversized-message handling
This patch fixes a crash bug in the Lightning Dev Kit's handling of HTLC failure messages. A downstream peer could send a maximally-sized failure message without attribution data. When the node added its own attribution data while relaying…
Denial-of-service via remote-triggered panic in message encryptionOversized message exceeding Noise/Lightning wire framing limitMissing length validation before adding attribution data during relay
This commit fixes a denial-of-service bug in rust-lightning where a maliciously crafted one-hop blinded reply path could cause the node to panic when it tried to respond. The fix rejects paths with too few hops before advancing them, and a…
Denial-of-service vector via malformed blinded pathPanic in onion construction due to zero-hop pathUntrusted reply path input validation gap
This commit fixes a log-forgery risk in a Rust Lightning library helper called PrintableString. That helper is meant to make untrusted text safe to print by replacing dangerous characters with a placeholder. It already caught most control …
log injection / log forgery via U+2028/U+2029 line separatorsincomplete input sanitisation in PrintableStringpeer-controlled strings (node alias, BOLT 12 description/issuer/payer_note, peer_msg) as attack surface
This commit fixes a rate-limiting bug in the Lightning Dev Kit (LDK) that let a single peer bypass the cap on how many different peers can have unfunded (not-yet-funded) channels open. Previously, if a peer sent multiple channel requests q…
Denial-of-service resource exhaustion via rapid inbound channel open requestsLogic error in rate-limiting conditionRegression test added for the bypass scenario
This commit fixes a bug where replaying the current blockchain block through a normal listener callback could crash two core Lightning components (ChannelManager and OutputSweeper) with a panic. The fix recognizes a same-block replay as a …
panic in chain listener callbacksame-block replay/rescan mishandlingassertion failure on valid chain input
This commit fixes a crash bug in the Lightning Dev Kit's on-chain transaction handler. During a deep blockchain reorganization, a previously settled HTLC claim could be 'resurrected' at a block height where it could no longer be combined w…
Assertion/panic in reorg handling pathDeep blockchain reorg as trigger conditionHTLC claim resurrection after reorg
This commit simply updates the 'repository' web links in 15 package metadata files from GitHub to a self-hosted Forgejo instance. It does not change any program code, build logic, dependencies, or security behavior. There is no security is…
This commit fixes a small but real accounting bug in how rust-lightning checks whether a previous transaction (prevtx) attached to a funding input will make the resulting Lightning wire message too large. The code previously compared the m…
Off-by-constant length check in protocol message size enforcementPotential acceptance of a prevtx that produces an oversized Lightning wire messageDenial-of-service / protocol-interop risk from peer message rejection
This commit fixes a bug in the Lightning Dev Kit where, after a disconnection, a node could fail to retransmit a 'splice_locked' message to a peer that was still waiting for transaction signatures. Without this retransmission, the two peer…
Protocol state desynchronization between channel peers after reconnectionMissing retransmission of splice_locked for 0-conf splice channelsPotential channel unusability or stuck splice negotiation
This commit adds a new API, pay_for_bolt12_invoice, that lets users pay a BOLT 12 invoice even if LDK did not originally request it. It is intended for advanced use cases like multi-sender payments and replaces an older, more restrictive A…
New API removes internal invoice-origin verification, shifting trust boundary to callerDocumentation explicitly warns caller to verify invoice via Bolt12Invoice::verify_using_metadata and to ensure unique payment_id to avoid duplicate paymentsInput validation added for zero amount, overpay, and partial-amount-without-MPP
This commit fixes a small accounting bug in how the Lightning wallet estimates the size (and therefore transaction fee) of a special Bitcoin transaction that sweeps funds back to the user after a channel closes. The old code always assumed…
debug assertion failure possible in development/testing buildstransaction weight/fee estimate overestimation up to 3 WUconstant replaced with per-descriptor length computation
This commit only updates documentation comments for a Rust function called get_per_commitment_point. It removes an outdated warning that the method was non-asynchronous and that returning an error could cause a crash, and replaces it with …
Documentation-only changeRemoves outdated panic warningAdds retry/unblock guidance for signer errors
This commit is a small internal code cleanup in the Lightning Dev Kit's Trampoline routing code. It removes a separate 'BlindedTrampolineEntrypoint' payload variant and folds an optional blinding point into the existing 'Forward' variant. …
Refactor-only change with no added bounds checks or validationNo mention of vulnerability, CVE, security fix, or bug in commit messageTLV field changed from required to optional, but only for a newly unified variant used in internal construction
Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.
Lower-prioritySpeed up `remove_stale_channels_and_tracking` nontriviallyby Matt Corallo · 28b526ac · Sep 18, 2025 · 2 filesMessage 73 · AdequateInformational 21Details
Commit message · Matt Corallo
Speed up `remove_stale_channels_and_tracking` nontrivially
During startup, the lightning protocol forces us to fetch a ton of gossip for channels where there is a `channel_update` in only one direction. We then have to wait around a while until we can prune the crap cause we don't know when the gossip sync has completed.
Sadly, doing a large prune via `remove_stale_channels_and_tracking` is somewhat slow. Removing a large portion of our graph currently takes a bit more than 7.5 seconds on an i9-14900K, which can ultimately ~hang a node with a few less GHz ~forever.
The bulk of this time is in our `IndexedMap` removals, where we walk the entire `keys` `Vec` to remove the entry, then shift it down after removing.
In the previous commit we shifted to a bulk removal model for channels, here we do the same for nodes. This reduces the same test to around 340 milliseconds on the same hardware.
This commit is a performance optimization, not a security fix. It speeds up a cleanup routine in the Lightning network graph code that removes old, stale channels and nodes during startup. The change switches from removing nodes one-by-one to removing them in bulk, cutting the time from over 7.5 seconds to about 340 milliseconds on a fast desktop. There is no indication this fixes a vulnerability or changes security behavior.
Lower-prioritySpeed up `remove_stale_channels_and_tracking` nontriviallyby Matt Corallo · cc028f4c · Sep 18, 2025 · 2 filesMessage 73 · AdequateInformational 20Details
Commit message · Matt Corallo
Speed up `remove_stale_channels_and_tracking` nontrivially
During startup, the lightning protocol forces us to fetch a ton of gossip for channels where there is a `channel_update` in only one direction. We then have to wait around a while until we can prune the crap cause we don't know when the gossip sync has completed.
Sadly, doing a large prune via `remove_stale_channels_and_tracking` is somewhat slow. Removing a large portion of our graph currently takes a bit more than 7.5 seconds on an i9-14900K, which can ultimately ~hang a node with a few less GHz ~forever.
The bulk of this time is in our `IndexedMap` removals, where we walk the entire `keys` `Vec` to remove the entry, then shift it down after removing.
Here we shift to a bulk removal model when removing channels, doing a single `Vec` iterate + shift. This reduces the same test to around 1.38 seconds on the same hardware.
This commit is a performance optimization, not a security fix. It speeds up a startup cleanup routine in the Lightning routing code by removing many stale channels in one pass instead of one at a time. The change reduces a reported 7.5-second freeze to about 1.4 seconds on a high-end CPU. There is no indication it fixes a vulnerability or changes security behavior.
Previously, we had a bug that particularly affected async payments where if an outbound payment was in the state {Static}InvoiceReceived and there was a call to process_pending_htlc_forwards, the payment would be automatically abandoned. We would behave correctly and avoid abandoning if the payment was awaiting an invoice, but not if the payment had an invoice but the HTLCs weren't yet locked in.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Moderate 57/100
This commit fixes a bug in the Lightning Dev Kit where certain asynchronous payments could be wrongly marked as failed before the actual payment HTLCs were locked in. The fix expands the definition of 'not yet ready to fail' to include payments that have received an invoice but have not yet locked in HTLCs, preventing premature abandonment.
Lower-priorityln: remove test flag from `negotiate_anchor_zero_fee_commitments`by Carla Kirk-Cohen · b0c384e2 · Sep 17, 2025 · 4 filesMessage 60 · AdequateLow 32Details
Commit message · Carla Kirk-Cohen
ln: remove test flag from `negotiate_anchor_zero_fee_commitments`
60/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
AI analysis · Low 32/100
This commit removes a test-only restriction on a Lightning channel feature called 'anchor zero-fee commitments.' Previously, the feature could only be negotiated during tests; now it can be used in production code. The change itself is a feature enablement, not a direct bug fix, but it exposes a new protocol path that could carry security risks if the feature has flaws. There is no disclosed security incident or vulnerability tied to this commit in the provided materials.
Drop `RevokedOutput::is_counterparty_balance_on_anchors`
When we added anchors support we declined to aggregate claims across different types of outputs for anchor channels, requiring that we track whether a `RevokedOutput` claim came from an anchor channel or not. This was only ever used to decide whether the claim was aggregable or not.
In 0fe90c6f7c3325935b18dbc809be14afd8fe067f we started aggregating by determining whether a claim is pinnable or not, rather than the much-too-coarse aggregable flag, leaving `is_counterparty_balance_on_anchors` unused.
Here we remove it entirely (as it would become ambiguous with zero-commitment-fee anchor channels).
We always write `Some(())`, marking the claim as an anchor claim and resulting in LDK prior to 0.1 refusing to aggregate the claim (which is the more conservative stance). This breaks downgrade to LDK 0.0.115 and earlier.
This commit removes an internal flag used when claiming funds from a revoked Lightning channel. The flag had become unused after a prior change, and removing it simplifies the code. The change intentionally breaks backward compatibility with older versions (before 0.1) to avoid ambiguous behavior with newer anchor channel types. It is a cleanup/refactoring change with a deliberate compatibility trade-off, not a fix for an active exploit.
Lower-priorityMention the `bitcoin-payment-instructions` crate in docsby Matt Corallo · 0c13a663 · Sep 16, 2025 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Matt Corallo
Mention the `bitcoin-payment-instructions` crate in docs
50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100
This commit only updates documentation comments in a single source file. It adds a reference to an external Rust crate called `bitcoin-payment-instructions` and slightly reorders existing documentation links. No code behavior changes, no security fixes, and no functional modifications are present.
Lower-priorityMove reasonable-default arguments out of `pay_for_offer`.by Matt Corallo · f65e78da · Sep 16, 2025 · 5 filesMessage 73 · AdequateInformational 18Details
Commit message · Matt Corallo
Move reasonable-default arguments out of `pay_for_offer`.
`ChannelManager::pay_for_offer` and `ChannelManager::pay_for_offer_from_human_readable_name` have accumulated a handful of arguments, most of which we expect users to never actually set.
Instead, here, we move `quantity` and `payer_note` (which we expect users to never set) as well as `route_params_config` and `retry_strategy` (which we expect users to generally stick with the defaults on) into a new struct, which implements `Default`.
This cleans up a good bit of cruft on payment calls.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 18/100
This commit is a routine API cleanup, not a security fix. It groups several rarely-used arguments of the `pay_for_offer` and `pay_for_offer_from_human_readable_name` functions into a new `OptionalOfferPaymentParams` struct with sensible defaults. Existing callers are updated to use the new, simpler call pattern. There is no change to payment logic, validation, or security behavior.
Lower-priorityAllow setting an HRN in invoice_requests built by `pay_for_offer`by Matt Corallo · 54219385 · Sep 16, 2025 · 1 fileMessage 85 · StrongInformational 15Details
Commit message · Matt Corallo
Allow setting an HRN in invoice_requests built by `pay_for_offer`
If a user did their own BIP 353 lookup to fetch an offer from a human readable name, we still want them to be able to use `ChannelManager::pay_for_offer`.
Because BIP 353 offer payments require that the `invoice_request` include the human readable name, we need to add an argument to set the `invoice_request` HRN to `pay_for_offer`, which we do here.
85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Informational 15/100
This commit adds a new public method, pay_for_offer_from_hrn, to ChannelManager so that users who looked up a Lightning offer via a human-readable name (BIP 353) can still pay it through the existing pay_for_offer machinery. The change is a feature addition: it threads the human-readable name into the invoice_request so the payment follows the BIP 353 protocol. There is no security bug being fixed here.
Drop spurious limitations section on `pay_for_offer`
For some time we've automatically opened a connection to the blinded path introduction point when we need to send a message we generated. However, the "Limitations" section in `ChannelManager::pay_for_offer` lists having a direct connection as required for the payment to succeed, which is not true.
Instead, we simply remove the section from both `pay_for_offer` and `pay_for_offer_from_human_readable_name`.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100
This commit only removes outdated documentation comments from two functions. The deleted text incorrectly stated that users needed a direct network connection to specific nodes for certain Lightning payments to work. The code already automatically opens those connections, so the documentation was wrong and misleading, but no actual behavior changed. There is no security issue in the code change itself.
Lower-priorityAdd a `OfferFromHrn` type to wrap `Offer`s which came from HRNsby Matt Corallo · 6679c4f3 · Sep 16, 2025 · 1 fileMessage 73 · AdequateInformational 11Details
Commit message · Matt Corallo
Add a `OfferFromHrn` type to wrap `Offer`s which came from HRNs
In a coming commit we'll provide users a different `ChannelManager` method for sending to `Offer`s which were fetched by resolving an HRN. Here, we first ad a wrapper type which can be used by HRN resolution methods to nudge users towards calling the correct payment method on `ChannelManager`.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 11/100
This commit is a small, preparatory refactor in the Lightning Dev Kit library. It introduces a new wrapper type called OfferFromHrn to mark payment offers that came from a human-readable name (like a BIP 353 DNS-style address). The wrapper helps ensure that future code calls the correct method when building an invoice request. There is no security fix or vulnerability patch here; it is purely a code-organization change setting up a later feature.
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 14/100
This commit is a small internal cleanup in the code that handles BOLT 12 offer payments. It removes repeated boilerplate by moving the construction of a RetryableInvoiceRequest object into one shared helper, instead of building it separately in each caller. The actual values being passed (invoice request, nonce, retry flag, and expiration timer) remain the same, so there is no functional or security change.
AI review queuedMiscellanous CI fixesby Leo Nash · 2ce8e647 · Sep 16, 2025 · 6 filesMessage 28 · OpaqueInformational 15Details
Commit message · Leo Nash
Miscellanous CI fixes
28/100 · OpaqueMessage clarity
✓ Subject identifies a change! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100
This commit is a collection of minor cleanups to fix automated documentation and code-quality checks. It removes unnecessary parentheses, fixes broken doc links, corrects a URL in a comment, and adds missing doc links. None of the changes alter program behavior or fix any security issue.
This adds a new test for both splice-in and splice-out in favor of maintaining the existing test. Helpers have been added to DRY up a lot of the logic necessary for driving the splice state machine forward.
78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100
This commit is a routine development patch that adds and improves automated tests for a new Bitcoin Lightning channel feature called 'splicing'—a way to add or remove funds from an existing channel. It removes a temporary placeholder that deliberately aborted splicing during testing, because the tests now need the feature to run further. There is no indication this fixes a security bug or introduces a vulnerability.
Lower-prioritySet current block locktime for coinbase in provide_anchor_reservesby Wilmer Paulino · 8ab08840 · Sep 16, 2025 · 1 fileMessage 73 · AdequateInformational 16Details
Commit message · Wilmer Paulino
Set current block locktime for coinbase in provide_anchor_reserves
This guarantees we get a unique txid when calling `provide_anchor_reserves` successively as we're immediately mining (and therefore advancing the chain) the transaction after creating it.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 16/100
This is a one-line change inside a test helper function. It sets the transaction locktime to the current block height instead of zero when creating a dummy coinbase transaction used only in tests. The goal is to avoid duplicate transaction IDs when the test framework rapidly mines blocks. It does not affect production Lightning node code or real funds.
We plan to reuse it for dual-funding/splicing, and those require standard SegWit inputs only.
60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 15/100
This commit changes a test-only helper in the Lightning Dev Kit codebase so that its fake wallet produces a more modern type of Bitcoin address (SegWit/P2WPKH) instead of the older P2PKH format. The change only affects internal test utilities and does not alter production code, network behavior, or cryptographic security. There is no indication this fixes or introduces a vulnerability.
Lower-priorityImplement `KVStore` for `TestStore`by Elias Rohrer · 012bb7a0 · Sep 16, 2025 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · Elias Rohrer
Implement `KVStore` for `TestStore`
We implement the async `KVStore` trait for `TestStore`. This is mostly useful in LDK Node tests, where we use `TestStore` and we now require all stores to implement both variants.
This commit adds an asynchronous version of a key-value store interface to a test-only helper called TestStore. It does not change production code, user-facing behavior, or any security-sensitive logic. It is purely a testing infrastructure change to satisfy a new trait requirement.
.. to be easier reusable by different trait implementations.
60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 15/100
This commit is a simple internal code cleanup in the project's test utilities. It takes the existing logic of a test-only key-value store and splits it into private helper methods, then has the public trait methods call those helpers. There is no change to behavior, no fix for a bug, and no security relevance.
Remove redundant `startup_replay` arg to `claim_funds_internal`
`startup_replay` should always exactly mirror `background_events_processed_since_startup`, so we should just use that rather than having a dedicated argument for it.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 12/100
This is a small internal code cleanup in the Lightning Dev Kit's channel manager. It removes a redundant function argument and replaces it with a direct read of an existing flag. The change does not alter behavior and is not a security fix.
Lower-priorityStop re-hydrating pending payments once they are fully resolvedby Matt Corallo · 226520b2 · Sep 16, 2025 · 4 filesMessage 85 · StrongModerate 57Details
Commit message · Matt Corallo
Stop re-hydrating pending payments once they are fully resolved
`MonitorEvent`s aren't delivered to the `ChannelManager` in a durable fasion - if the `ChannelManager` fetches the pending `MonitorEvent`s, then the `ChannelMonitor` gets persisted (i.e. due to a block update) then the node crashes, prior to persisting the `ChannelManager` again, the `MonitorEvent` and its effects on the `ChannelManger` will be lost. This isn't likely in a sync persist environment, but in an async one this could be an issue.
Note that this is only an issue for closed channels - `MonitorEvent`s only inform the `ChannelManager` that a channel is closed (which the `ChannelManager` will learn on startup or when it next tries to advance the channel state), that `ChannelMonitorUpdate` writes completed (which the `ChannelManager` will detect on startup), or that HTLCs resolved on-chain post closure. Of the three, only the last is problematic to lose prior to a reload.
In previous commits we ensured that HTLC resolutions which came to `ChannelManager` via a `MonitorEvent` were replayed on startup if the `MonitorEvent` was lost. However, in cases where the `ChannelManager` was so stale that it didn't have the payment state for an HTLC at all, we only re-add it in cases where `ChannelMonitor::get_pending_or_resolved_outbound_htlcs` includes it.
Because constantly re-adding a payment state and then failing it would generate lots of noise for users on startup (not to mention risk of confusing stale payment events for the latest state of a payment when the `PaymentId` has been reused to retry a payment). Thus, `get_pending_or_resolved_outbound_htlcs` does not include state for HTLCs which were resolved on chain with a preimage or HTLCs which were resolved on chain with a timeout after `ANTI_REORG_DELAY` confirmations.
This critera matches the critera for generating a `MonitorEvent`, and works great under the assumption that `MonitorEvent`s are reliably delivered. However, if they are not, and our `ChannelManager` is lost or substantially old (or, in a future where we do not persist `ChannelManager` at all), we will not end up seeing payment resolution events for an HTLC.
Instead, we really want to tell our `ChannelMonitor`s when the resolution of an HTLC is complete. Note that we don't particularly care about non-payment HTLCs, as there is no re-hydration of state to do there - `ChannelManager` load ignores forwarded HTLCs coming back from `get_pending_or_resolved_outbound_htlcs` as there's nothing to do - we always attempt to replay the success/failure and figure out if it mattered based on whether there was still an HTLC to claim/fail.
Here we, finally, begin actually using the new `ChannelMonitorUpdateStep::ReleasePaymentComplete` updates, skipping re-hydration of pending payments once they have been fully resolved through to a user `Event`.
85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Moderate 57/100
This commit fixes a reliability issue in the Lightning Dev Kit's handling of payment events after a channel closes. In rare crash scenarios, the wallet could lose track of whether an on-chain payment had already been reported to the user, causing it to either replay old payment notifications or fail to report a resolution. The fix marks HTLCs as fully resolved in the ChannelMonitor so they are not re-processed on restart, reducing duplicate or missing payment events.
Lower-priorityProperly provide `PaymentPathSuccessful` event for replay claimsby Matt Corallo · ba6528f0 · Sep 16, 2025 · 3 filesMessage 73 · AdequateInformational 21Details
Commit message · Matt Corallo
Properly provide `PaymentPathSuccessful` event for replay claims
When a payment was sent and ultimately completed through an on-chain HTLC claim which we discover during startup, we deliberately break the payment tracking logic to keep it around forever, declining to send a `PaymentPathSuccessful` event but ensuring that we don't constantly replay the claim on every startup.
However, now that we now have logic to complete a claim by marking it as completed in a `ChannelMonitor` and not replaying information about the claim on every startup. Thus, we no longer need to take the conservative stance and can correctly replay claims now, generating `PaymentPathSuccessful` events and allowing the state to be removed.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 21/100
This change fixes a bookkeeping quirk in the Lightning Dev Kit. Previously, when a payment was completed via an on-chain claim discovered during startup, the software deliberately kept the payment record around forever and skipped sending a 'this payment path succeeded' event, to avoid repeatedly replaying the claim every time the node restarted. Now that the software can mark such claims as completed inside the channel monitor, it can safely send the missing success event and clean up the old payment state. This is a correctness and cleanup improvement, not a vulnerability that an attacker can exploit.
Generate new `ReleasePaymentComplete` monitor updates
`MonitorEvent`s aren't delivered to the `ChannelManager` in a durable fasion - if the `ChannelManager` fetches the pending `MonitorEvent`s, then the `ChannelMonitor` gets persisted (i.e. due to a block update) then the node crashes, prior to persisting the `ChannelManager` again, the `MonitorEvent` and its effects on the `ChannelManger` will be lost. This isn't likely in a sync persist environment, but in an async one this could be an issue.
Note that this is only an issue for closed channels - `MonitorEvent`s only inform the `ChannelManager` that a channel is closed (which the `ChannelManager` will learn on startup or when it next tries to advance the channel state), that `ChannelMonitorUpdate` writes completed (which the `ChannelManager` will detect on startup), or that HTLCs resolved on-chain post closure. Of the three, only the last is problematic to lose prior to a reload.
In previous commits we ensured that HTLC resolutions which came to `ChannelManager` via a `MonitorEvent` were replayed on startup if the `MonitorEvent` was lost. However, in cases where the `ChannelManager` was so stale that it didn't have the payment state for an HTLC at all, we only re-add it in cases where `ChannelMonitor::get_pending_or_resolved_outbound_htlcs` includes it.
Because constantly re-adding a payment state and then failing it would generate lots of noise for users on startup (not to mention risk of confusing stale payment events for the latest state of a payment when the `PaymentId` has been reused to retry a payment). Thus, `get_pending_or_resolved_outbound_htlcs` does not include state for HTLCs which were resolved on chain with a preimage or HTLCs which were resolved on chain with a timeout after `ANTI_REORG_DELAY` confirmations.
This critera matches the critera for generating a `MonitorEvent`, and works great under the assumption that `MonitorEvent`s are reliably delivered. However, if they are not, and our `ChannelManager` is lost or substantially old (or, in a future where we do not persist `ChannelManager` at all), we will not end up seeing payment resolution events for an HTLC.
Instead, we really want to tell our `ChannelMonitor`s when the resolution of an HTLC is complete. Note that we don't particularly care about non-payment HTLCs, as there is no re-hydration of state to do there - `ChannelManager` load ignores forwarded HTLCs coming back from `get_pending_or_resolved_outbound_htlcs` as there's nothing to do - we always attempt to replay the success/failure and figure out if it mattered based on whether there was still an HTLC to claim/fail.
Here we begin generating the new `ChannelMonitorUpdateStep::ReleasePaymentComplete` updates, updating functional tests for the new `ChannelMonitorUpdate`s where required.
95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
Why it was queued
boot or update path
AI analysis · Moderate 53/100
This commit fixes a reliability bug in the Lightning Dev Kit (LDK) where payment success or failure events could be lost if the node crashes at the wrong moment. The fix adds a new 'ReleasePaymentComplete' monitor update so that once a payment is fully resolved, the ChannelMonitor records it durably. This prevents users from seeing stale or repeated payment events after a restart, especially in setups where persistence happens asynchronously. It is a defensive correctness fix, not an externally exploitable vulnerability.
Address ChannelState inconsistency throughout splicing
Once a channel open has become locked (i.e., we've entered `ChannelState::ChannelReady`), the channel is intended to remain within this state for the rest of its lifetime until shutdown. Previously, we had assumed a channel being spliced would go through the `ChannelState` lifecycle again starting from `NegotiatingFunding` but skipping `AwaitingChannelReady`. This inconsistency departs from what we strive to achieve with `ChannelState` and also makes the state of a channel harder to reason about.
This commit ensures a channel undergoing a splice remains in `ChannelReady`, clearing the quiescent flag once the negotiation is complete. Dual funding is unaffected by this change as the channel is being opened and we want to maintain the same `ChannelState` lifecycle.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 42/100
This commit fixes a state-machine inconsistency in how the Lightning node tracks the lifecycle of a channel when it is being spliced. Previously, a splice incorrectly moved the channel back through the same states used when a channel is first being opened. The change keeps the channel in its normal operating state during a splice and only clears a temporary 'quiet' flag once negotiation is done. This makes the code easier to reason about and prevents potential bugs where the channel could be treated as not-yet-open when it is actually already active.
Remove tx_signatures flags for interactive signing ChannelState
This commit addresses an overlap of state between `InteractiveTxSigningSession` and `ChannelState::FundingNegotiated`. The signing session already tracks whether both holder and counterparty `tx_signatures` have been produced, so tracking the state duplicatively at the `ChannelState` level is unnecessary.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundary
AI analysis · Low 27/100
This commit is a code cleanup in a Bitcoin Lightning network library. It removes duplicate state-tracking flags from the channel state and instead relies on an existing 'interactive signing session' object to track the same information. The change simplifies the code and reduces the chance of inconsistent state, but it does not appear to fix an active security bug on its own. Some behavior changes in error handling are visible, but they look like incidental adjustments rather than a disclosed vulnerability fix.
Move interactive signing session into ChannelContext
Since the `InteractiveTxSigningSession` already tracks everything we need, we can remove the duplicate interactive signing state tracking within `ChannelState`.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundary
AI analysis · Informational 12/100
This commit is a straightforward internal code cleanup in the Lightning Dev Kit. It moves the interactive transaction signing session from several channel-specific structs into a single shared ChannelContext struct, removing duplicate state tracking. There is no indication this fixes a security bug or changes security-relevant behavior.
The tests have become a bit painful to maintain, and they don't even fully test the production code paths, so we opt to just remove them for now. In the future, we plan to unify the dual funding code paths with splicing.
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 simply deletes a set of incomplete automated tests for an experimental dual-funded Lightning channel feature, plus one small test-only helper function that only those tests used. No production code is changed, so it cannot introduce or fix a security vulnerability in running software.