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 makes on-chain 'MonitorEvent' notifications durable and replay-safe. Previously, if a node crashed after a ChannelMonitor persisted a block update but before the ChannelManager processed the resulting event, the event could be …
Durability/atomicity fix for async persistence: prevents lost MonitorEvents across crashesNew ack-based event lifecycle with random event IDsArchival gating on unacknowledged events to avoid losing preimage/timeout information
This commit refactors how LDK nodes claim incoming Lightning payments. It replaces a separate 'claim with known custom TLVs' method with an options struct passed to the normal claim call, and fixes two edge cases in payment attribution dat…
API change: claim_funds now takes ClaimFundsOptions, consolidating TLV-known behavior into one pathFailure-packet length bound added to prevent oversized onion error messagesIncoming failure packet truncated at 32 KiB before processing
This change fixes a wallet bookkeeping problem in rust-lightning's built-in coin-selection wrappers. Previously, when a splice attempt failed or coin selection errored after picking UTXOs, those UTXOs stayed marked as 'reserved' in memory …
Resource exhaustion / denial-of-service via permanent in-memory UTXO reservationIncorrect state tracking in coin-selection wrapperNew API method required for correct lifecycle management (release_utxos)
This commit fixes a bug in the wallet's coin-selection code. When the wallet picked UTXOs to spend, it locked them immediately so they couldn't be reused. But if a later step—fetching the change address or the previous transaction—failed, …
Resource lock leak on error pathUTXO lock state inconsistency between selection and confirmationDenial-of-service/funds-unavailability risk from persistent UTXO locks
This commit rewrites how a Lightning wallet talks to Esplora block-explorer servers so that many status checks happen in parallel instead of one at a time. It is a performance/refactoring change. There is no direct evidence in the commit t…
Concurrency/timing change in transaction confirmation logicNew inconsistency check preserved when a previously-confirmed tx is reported unconfirmedAdded defensive error path for missing pre-fetched block status
This change stops the Electrum-based transaction sync client from downloading the very transaction that created an output it is watching. Previously, the client could request that transaction from Electrum, even though a transaction can ne…
Avoids unnecessary Electrum transaction.get requests for watched outputsReduces information disclosure to Electrum server about watched outpointsAdds regression test verifying request suppression
This change improves how the Lightning Dev Kit's Electrum and Esplora transaction-sync clients track watched Bitcoin transactions. Previously, the code ignored the script pubkey (the 'address' associated with a transaction) supplied when r…
Previously ignored `script_pubkey` argument in `register_tx` for transaction watchersElectrum script-history queries previously used an arbitrary transaction output, which could be OP_RETURN and therefore unindexed by some Electrum serversNew logic prefers caller-supplied script pubkey and falls back to non-OP_RETURN outputs
This commit changes how LDK stores pending event notifications. It adds serialization support for several event types that previously were not fully saved to disk, and introduces a helper method so the code can decide which events are wort…
Data-loss prevention: previously non-round-trippable event variants are now fully serialized, avoiding accidental event loss when users serialize Event queues themselvesState-consistency hardening: ChannelManager now explicitly skips events that describe non-surviving restart state, preventing replay of stale eventsDefensive assertion: debug builds assert that every persisted event round-trips to Some(event), catching serialization mismatches
This commit only adds documentation comments to two source files. It explains that certain funding-signing events can become stale if the underlying negotiation fails, and that callers may see specific harmless errors as a result. No code …
This commit fixes a design flaw in LDK's built-in wallet helper where coins selected for a splice-in (or other unclaimed funding) were permanently reserved in memory if the transaction was abandoned. Over repeated failed splices, all spend…
Denial-of-service via UTXO exhaustion from repeated failed splice negotiationsRisk of inability to broadcast fee-bumping/claim transactions due to lack of available UTXOsNew API surface (release_utxos) introduced to mitigate resource leak
This commit removes a fixed-version pin for the honggfuzz fuzzing tool in a continuous-integration script. The project now uses the current release of honggfuzz instead of an older pinned version. There is no change to the actual Lightning…
This commit changes the Rust toolchain used in the continuous integration (CI) fuzzing job from a fixed older version (1.75) to the latest stable release. It is purely a build/test infrastructure change to fix a dependency compatibility is…
This commit makes a previously internal helper function public so that outside developers can build dummy-hop tails for blinded payment paths without recreating the logic themselves. It is an API usability change, not a fix for a known sec…
No security-relevant behavior change in the diffAPI visibility broadened from crate-public to publicCLTV expiry overflow check already present and unchanged
This change adds a safety check in a Bitcoin Lightning Network library (LDK). Previously, if the software tried to verify a peer's commitment signature before it had learned the peer's channel parameters, it could crash with a panic. Now i…
Defensive check added on peer-driven code path to prevent panicMissing counterparty_parameters could previously cause panic during commitment transaction constructionChannel closure returned instead of panic
This commit only changes the wording of an error message sent to peers when a commitment transaction fails validation. It replaces the vague phrase 'Failed to validate our commitment' with the clearer 'Received commitment failed validation…
This commit moves the checks that validate a counterparty's signatures on the holder's commitment and HTLC transactions out of the general channel code and into the signer module (InMemorySigner). Previously, these signature checks were do…
Moved signature validation from channel state machine into signer moduleAdded new tests that corrupt signatures and verify rejectionChanged error message from 'Invalid commitment tx signature from peer' / 'Invalid funding_created signature from peer' to 'Failed to validate our commitment'
This change fixes a Lightning channel splicing bug: when two peers temporarily disconnect during a splice, any half-finished signature the other side already sent is now discarded. Before the fix, that stale signature could be reused after…
State-invalidation bug in multi-step protocol (splice negotiation)Stale cryptographic signature not cleared on disconnectPotential reuse of old commitment state after reconnect
This fix prevents a Lightning channel from being accidentally force-closed. During a splice (a way to resize a payment channel), one side's initial signature could be kept in memory after the peers disconnected. If the peers later reconnec…
State inconsistency: in-memory buffered message not cleared on disconnectDuplicate message processing after reconnectionForce-close consequence for active Lightning channel
This commit is a simple rename of a public function from `matches_invoice_signing_pubkey` to `key_can_sign_invoice`, plus matching updates to its documentation, callers, tests, and changelog. No behavior changed. It is not a security fix.
This commit is a simple rename of a function and its documentation from matches_invoice_signing_pubkey to key_can_sign_invoice. No logic, behavior, or security properties changed. It is a follow-up code-review naming cleanup.
Correct `msgs_sent_since_pong` tracking for gossip forwards
When we forward gossip messages, we use the already-encoded copy we have, pushing it onto the `gossip_broadcast_buffer`. When we have free socket buffer space, and there are no non-gossip messages pending, we'll remove it from the `gossip_broadcast_buffer` and push it onto the normal `pending_outbound_buffer` socket queue.
Separately, we use `msgs_sent_since_pong` to ensure that our peer is being responsive and our messages are getting through with minimal latency. After we send 32 messages (if we've already received the `pong` for the last `ping` wensent), we send an extra `ping` and will only queue up an additional 32 forwarded gossip messages before we start dropping forwarded gossip on the floor.
Previously, we (arguably) incorrectly incremented `msgs_sent_since_pong` when we pushed a message onto the `gossip_broadcast_buffer`, not when it was actually queued up in our `pending_outbound_buffer` immediate socket queue. This is fairly strange - the point of `msgs_sent_since_pong` is to keep peer latency low, we already independently enforce memory limits to ensure we drop forwarded gossip messages if a peer's message queues have grown too large. This means we potentially disconnect a peer for not draining the backlog forwarded-gossip socket queue fast enough, rather than simply dropping gossip.
While this shouldn't be a big deal in practice, I do see (mostly Tor) peers disconnect on my node occasionally, and while its likely due to Tor circuits hanging and a disconnect is needed, the incorrect tracking here makes state analysis difficult as there are nearly always a flow of enough gossip messages to "send to the peer". Its also possible that this allows incredibly low bandwidth connections to stay afloat more durably.
85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 35/100
This change fixes how a Lightning node counts messages it has sent to a peer. Previously, the node counted forwarded gossip messages as 'sent' when they were merely placed in a broadcast buffer, even though they had not yet been written to the actual network socket. This could cause the node to think the peer was slow or unresponsive and disconnect it prematurely, especially for peers on slow networks like Tor. The fix moves the count to the point where the message is actually queued for sending on the socket, so the node only disconnects peers for genuine backpressure, not for buffered gossip waiting to be sent.
* Parsing now slices 0..32 = pubkey, 32..34 = checksum (BE), 34 = version. * Display now appends pubkey + checksum + version and lowercases base32. * Adds/updates test vector accordingly.
100/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
fuzzing or regression evidence
AI analysis · Low 44/100
This commit fixes how rust-lightning reads and writes Tor onion v3 network addresses. Previously the code treated the 56-character onion address as if its bytes were arranged in the wrong order: it put the version and checksum at the front and the public key at the back, which is the opposite of the real Tor specification. It also printed onion addresses in uppercase base32 instead of lowercase. The fix reorders parsing and formatting to match the official Tor layout (pubkey first, then checksum, then version) and forces lowercase output. Because of the old bug, a valid real-world onion address would have been parsed into the wrong internal fields, and addresses produced by the library would not have been valid Tor addresses.
AI review queuedFix lint CI jobby Matt Corallo · f013d957 · Sep 18, 2025 · 1 fileMessage 28 · OpaqueInformational 15Details
Commit message · Matt Corallo
Fix lint CI job
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 adds one line to a CI lint script, telling the Clippy linter to ignore a newly introduced style warning (manual_is_multiple_of) until the project can require a newer Rust compiler version. It does not change any application code, runtime behavior, or security-sensitive logic.
Add testing for sending payments from an often-offline sender to an often-offline recipient.
53/100 · ThinMessage clarity
✓ Subject identifies a change✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Informational 15/100
This commit adds new automated tests for a feature that lets Lightning payments complete even when the sender and recipient are often offline. It does not change production code behavior; it only adds test code and small test helper improvements. There is no indication of a security vulnerability being fixed or introduced.
Support held_htlc_available counterparty reply path
As part of supporting sending payments as an often-offline sender, the sender needs to send held_htlc_available onion messages such that the reply path to the message terminates at their always-online channel counterparty that is holding the HTLC. That way when the recipient responds with release_held_htlc, the sender's counterparty will receive that message.
Here we lay some groundwork for using a counterparty-created reply path when sending held_htlc_available as an async sender in the next commit.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100
This commit is a routine code refactor in the Lightning Dev Kit library. It restructures how reply paths are specified for a new type of onion message (held_htlc_available) used in an experimental async-payments feature. The change adds a new enum so that future code can choose whether the reply path should end at the sender's own node or at an always-online channel counterparty. There is no security fix, vulnerability, or exploit here.
Previously we were taking the NetworkGraph::{channels,nodes} locks before ChannelManager::per_peer_state's peer_state locks in some tests, which violated a lock order requirement we have in ChannelManager to take netgraph locks *after* peer_state locks. See OffersMessageFlow::path_for_release_htlc which is called while a peer_state lock is held and takes netgraph locks while creating blinded paths.
78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 17/100
This commit fixes the order in which internal locks are acquired inside test code only. It prevents a potential deadlock during tests, but does not change any production code that an attacker could exploit. The change makes tests follow the same lock-ordering rule already required by the main ChannelManager code.
Now that we support the feature of sending payments as an often-offline sender to an often-offline recipient, including the sender's LSP-side, we can start conditionally advertising the feature bit to other nodes on the network.
Also remove an outdated comment, in a previous version of the code we had more logic to check if we're an always-online node before advertising the feature bit but it's since been removed.
This commit removes test-only restrictions on a feature called htlc_hold, allowing regular users to enable it. The feature lets an often-offline payer hold outbound payments temporarily at the next hop. It is a normal feature rollout, not a fix for an active attack or bug. There is no direct evidence in the commit that this change addresses a security vulnerability.
Send held_htlc_available with counterparty reply path
As part of supporting sending payments as an often-offline sender, the sender needs to send held_htlc_available onion messages such that the reply path to the message terminates at their always-online channel counterparty that is holding the HTLC. That way when the recipient responds with release_held_htlc, the sender's counterparty will receive that message.
After laying groundwork over some past commits, here we as an async sender send held_htlc_available messages using reply paths created by our always-online channel counterparty.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 26/100
This commit adds a feature for asynchronous Lightning payments where an often-offline sender can ask their always-online channel counterparty to hold a payment. The change ensures that when the counterparty confirms a channel state update (via revoke_and_ack), the sender extracts reply paths provided by the counterparty and uses them to send 'held_htlc_available' onion messages. The reply paths ensure the recipient's release response returns to the sender's online counterparty. The commit also includes a defensive check to ignore reply paths for HTLCs that were not actually configured as async payments, which limits a potential privacy leak where a counterparty could otherwise learn which payments are async.
As part of supporting sending payments as an often-offline sender, the sender needs to be able to set a flag in their update_add_htlc message indicating that the HTLC should be held until receipt of a release_held_htlc onion message from the often-offline payment recipient.
The prior commits laid groundwork to finally set the flag here in this commit.
See-also BOLTs PR 989
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 27/100
This commit finishes a feature that lets an often-offline Lightning payer ask the next node in the payment path to hold the payment (HTLC) until the offline recipient comes online and releases it. The change wires a previously unused flag through the payment-sending code so the 'hold_htlc' bit is actually set on outgoing HTLCs. It is a protocol feature implementation, not a fix for an active bug or exploit, but it touches payment logic and changes retry behavior for held HTLCs.
Lower-priorityAdd util to gather channels that support htlc_holdby Valentine Wallace · feeab19f · Sep 18, 2025 · 1 fileMessage 73 · AdequateInformational 18Details
Commit message · Valentine Wallace
Add util to gather channels that support htlc_hold
Returns a list of channels where our counterparty supports InitFeatures::supports_htlc_hold, or an error if there are none. Useful for sending async payments to StaticInvoices.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 18/100
This commit adds a small internal helper in a Lightning payment library. It collects payment channels whose peer supports a new 'hold HTLC' feature, used for a specific type of invoice (StaticInvoice/async payments). The change also tweaks an existing internal filter helper to accept mutable closures. There is no obvious security bug in the diff itself; it is a feature addition.
Lower-priorityAdd config flag for held outbound HTLCsby Valentine Wallace · 38685db0 · Sep 18, 2025 · 2 filesMessage 68 · AdequateInformational 18Details
Commit message · Valentine Wallace
Add config flag for held outbound HTLCs
If the flag is set to true, then if we as an often-offline payer receive a static invoice to pay, we will attempt to hold the corresponding outbound HTLCs with our next-hop channel counterparty(s) that support the feature. This allows our node to go offline once the HTLCs are locked in even though the recipient may not yet be online to receive them.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 18/100
This commit adds a new optional configuration flag to the Lightning Dev Kit (LDK) library. When enabled, a paying node can ask its next-hop peers to hold outgoing payment contracts (HTLCs) for a while, which is useful for nodes that are often offline. The feature is off by default and is described by the project as intended only for private, often-offline nodes. There is no direct evidence in the commit that this fixes a security vulnerability; it appears to be a new feature.
Immediately archive `ChannelMonitor`s for inbound unfuned channels
If a peer opens a channel to us, but never actually broadcasts the funding transaction, we'll still keep a `ChannelMonitor` around for the channel. While we maybe shouldn't do this either, when the channel ultimately times out 2016 blocks later, we should at least immediately archive the `ChannelMonitor`, which we do here.
Fixes #3384
81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
AI analysis · Low 35/100
This change fixes a cleanup issue in the Lightning Dev Kit: when someone tries to open a channel with you but never actually puts the funding transaction on the blockchain, the software used to keep an unnecessary 'ChannelMonitor' record around for up to about two weeks. After this patch, that leftover record is archived immediately once the channel times out, reducing clutter and avoiding misleading 'claimable balance' reports. It is a reliability/resource issue rather than a direct theft-of-funds bug.
As part of supporting sending payments as an often-offline sender, the sender needs to be able to set a flag in their update_add_htlc message indicating that the HTLC should be held until receipt of a release_held_htlc onion message from the often-offline payment recipient.
We don't yet ever set this flag, but lay the groundwork by including the parameter in the pay_route method.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
AI analysis · Informational 13/100
This commit is a small internal code cleanup that adds a new parameter called hold_htlcs to a private payment-sending helper function. The parameter is always set to false everywhere it is used, so it does not change any actual behavior. It simply prepares the code for a future Lightning protocol feature that lets senders ask intermediate nodes to hold payments until the recipient comes back online. There is no security issue in this change itself.
In the util we allow manually passing in the first_hops that should be used when paying a static invoice, which is useful for only passing in next-hop channels that support the hold_htlcs feature.
This commit simply moves existing payment-sending code into a new helper function without changing behavior. It is a code cleanup to make a future change easier. There is no security issue visible in this patch.
As part of supporting sending payments as an often-offline sender, the sender needs to be able to set a flag in their update_add_htlc message indicating that the HTLC should be held until receipt of a release_held_htlc onion message from the often-offline payment recipient.
We don't yet ever set this flag, but lay the groundwork by including a parameter for it in internal channel send_htlc APIs, including serializing the field when the parameter is set.
See-also BOLTs PR 989
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 18/100
This commit is a small, preparatory code change inside the Lightning Dev Kit's internal channel machinery. It adds a new 'hold_htlc' parameter to internal functions that send HTLCs (payment forwarding instructions), but the commit explicitly states that no code actually sets this flag to true yet. It is groundwork for a future feature described in BOLTs PR 989, which lets an often-offline sender ask a hop to hold an HTLC until a release message arrives. There is no immediate security issue visible in the diff itself.
As part of supporting sending payments as an often-offline sender, the sender needs to be able to set a flag in their update_add_htlc message indicating that the HTLC should be held until receipt of a release_held_htlc onion message from the often-offline payment recipient.
We don't yet ever set this flag, but lay the groundwork by including the field in Channel serialization.
See-also BOLTs PR 989
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 19/100
This commit adds a new 'hold_htlc' flag to Lightning channel data structures and makes sure it gets saved to and loaded from disk. The flag is not yet used to actually change any network behavior; it is only groundwork for a future feature that lets an often-offline sender ask the next node to hold an HTLC until a release message arrives. Because the flag is always set to None and never read for protocol decisions, it does not introduce a currently exploitable vulnerability.
Add init_features to list_channels filter callback
Useful to filter for channel peers that support a specific feature, in this case the hold_htlc feature, in upcoming commits.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100
This is a small, internal code change that adds extra information (a peer's feature flags) to a channel-listing filter callback. It does not fix a bug or change any security behavior on its own; it simply prepares the code for future filtering capabilities.
Actually remove forward<>intercepted htlcs lock dep
8513341b1f7c39da3e6ad4521d4161362b0f4562 purported to remove a lock dependency between ChannelManager::pending_intercepted_htlcs and ::forward_htlcs. However, in practice the dependency remained because the locks of the two maps were still held at the same time in some cases. Here we fix this.
85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
second-pass: broader security terminology
AI analysis · Low 40/100
This commit fixes an incomplete earlier change that was meant to prevent two internal data structures in LDK's channel manager from being locked at the same time. Holding both locks together can create a lock-order dependency, which in the worst case can lead to deadlock (the program freezing up). The fix narrows the use of one lock so the two locks are no longer held together in the affected code path. There is no direct evidence in the commit of an exploitable security vulnerability such as theft of funds.
Send `update_add_htlc` messages after HTLC removal messages
While nodes are generally supposed to validate commitment transactions after the `commitent_signed` and not while HTLCs are being added/removed, we don't. This can make a commitment update where we use HTLC balance claimed with a fulfill to send new HTLCs, which is perfectly valid, being rejected. While we shouldn't currently generate any such commitments, we might want to in the future, and on the off-chance that we do, or where such a commitment would result in a dust threshold overrun, its always safter to add new HTLCs to a commitment only after we've removed any HTLCs we're going to remove, which we do here.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
defensive validation
AI analysis · Low 35/100
This commit changes the order in which Lightning network messages are sent to peers. Previously, new HTLCs (payment forwards) were announced before old HTLCs were removed with fulfill/fail messages. Now, removal messages are sent first. The commit message explains that this prevents a peer from rejecting a commitment update in cases where a newly claimed balance is used to fund a new HTLC in the same update. The change is defensive and does not fix an active exploit, but closes a protocol-handling edge case that could cause channel updates to be rejected.
While its cool to have a super trivial API to initiate payment to a `HumanReadableName`, most wallets ultimately support multiple payment instruction formats (eg on-chain) or multiple HRN resolution schemes (eg LN-Address). Thus, we generally don't expect this API to get a lot of use.
Meanwhile, we've now ended up with both a `ChannelManager::pay_for_offer_from_hrn` and `ChannelManager::pay_for_ofer_from_human_readable_name`, which is incredibly confusing.
Here, we deprecate `pay_for_offer_from_human_readable_name`, pushing folks to the `bitcoin-payment-instructions` crate instead. Because it has outbound payment states associated with it it may be some time before we can fully remove all the pieces of it, sadly.
65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Provides detailed explanatory context✓ Explains rationale or failure mode! Too few words to establish purpose
AI analysis · Informational 15/100
This commit simply marks a convenience payment method as deprecated. It does not fix a bug, change behavior, or address any security issue. The function still works; developers are just being steered toward a different, more flexible crate for handling human-readable payment names.
Previously, OutboundPayments methods required borrowed logger arguments since Logger lacked a Clone bound. This prevented logging in all desired places, limiting trace statements for debugging. This change initializes OutboundPayments with a cloned Logger, simplifying method signatures and improving logging flexibility.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundary
AI analysis · Informational 15/100
This commit is a straightforward internal refactoring: it stores a copy of the logging object inside the OutboundPayments helper so individual methods no longer need to be passed a logger every time they are called. There is no change to payment logic, cryptographic handling, network behavior, or user-facing APIs. It only affects how diagnostic messages are produced.
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.