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.
Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.
Security candidateAdd test for monitor update after funding spendby Joost Jager · 1d3704d5 · Mar 19, 2026 · 1 fileMessage 78 · AdequateModerate 56Details
Commit message · Joost Jager
Add test for monitor update after funding spend
Add a regression test that reproduces the panic when a commitment_signed is processed after the counterparty commitment transaction has confirmed. The ChannelMonitor's no_further_updates_allowed() returns true, causing update_monitor to fail, which ChainMonitor overrides to InProgress. A subsequent preimage claim returning Completed then triggers the per-channel assertion that Completed must not follow InProgress.
AI tools were used in preparing this commit.
78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidenceboot or update path
AI analysis · Moderate 56/100
This commit adds a regression test that reproduces a crash (panic) in the Lightning Dev Kit's channel monitoring logic. The crash happens when a blockchain event and a peer message arrive in an unlucky order: after the counterparty's commitment transaction confirms on-chain, the local node still processes a new commitment_signed message from that peer. The code marks the channel monitor as frozen, but a later legitimate payment preimage claim returns a success status, conflicting with the earlier frozen status and triggering an internal assertion that crashes the node.
Replace dual-sync-async persistence panic with Watch contract
Commit 0760f99 ("Disallow dual-sync-async persistence without restarting") added a panic in non-test builds when a Persist implementation returns both Completed and InProgress from the same ChannelManager instance. However, this check runs against the status that ChainMonitor returns to ChannelManager, not the raw Persist result. When ChannelMonitor::update_monitor fails (e.g. a counterparty commitment_signed arrives after a funding spend confirms), ChainMonitor persists the full monitor successfully but overrides the return value to InProgress. If the user's Persist impl only ever returns Completed, this override triggers a false mode-mismatch panic.
This replaces the panic with a per-channel contract at the Watch trait level: a Watch implementation must not return Completed for a channel update while prior InProgress updates are still pending. Switching from Completed to InProgress is always allowed, but switching back is impractical because the Watch implementation cannot observe when ChannelManager has finished processing a MonitorEvent::Completed. The documentation on ChannelMonitorUpdateStatus is updated to describe these rules.
The mode tracking and panic checks from 0760f99 are removed and replaced with a panic that validates the new contract directly on the in-flight update state. Legacy tests that switch the persister between modes mid-flight can opt out via Node::disable_monitor_completeness_assertion().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
defensive validationboot or update path
AI analysis · Low 44/100
This commit fixes a bug where the Lightning Dev Kit (LDK) node software could crash with a false alarm panic. The panic was meant to catch incorrect use of two persistence modes, but it could also fire in legitimate situations because it checked an overridden status value rather than the raw result from the user's persistence code. The fix replaces the broad panic with a more precise rule at the Watch trait level and adds a test-only opt-out for legacy tests that intentionally switch modes mid-flight.
Lower-priorityci: fix OOM in artifact upload and update actions to v4by Atishyy27 · 43066b78 · Mar 19, 2026 · 4 filesMessage 62 · AdequateInformational 15Details
Commit message · Atishyy27
ci: fix OOM in artifact upload and update actions to v4
62/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100
This commit only updates GitHub Actions configuration files. It upgrades checkout actions from v3 to v4, disables compression on a fuzzing corpus artifact upload to avoid running out of memory, and ensures one workflow fetches the full git history. There are no code changes affecting the rust-lightning software itself or its security.
fuzz: handle missing SendTx* message events in chanmon_consistency
Add handlers for SendTxInitRbf, SendTxAckRbf, SendTxRemoveInput, and SendTxRemoveOutput in the chanmon_consistency fuzz target. These variants were reachable but not matched, causing panics on the wildcard arm ("Unhandled message event").
SendTxInitRbf became reachable after commit 5873660a0 added splicing support without updating the fuzz target's message delivery logic.
AI tools were used in preparing this commit.
83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
AI analysis · Informational 17/100
This commit fixes a fuzz testing harness so it can handle four new types of message events related to the experimental splicing feature. Previously, the harness would panic with 'Unhandled message event' when these messages appeared during automated fuzzing. This is a test-only fix and does not change the production Lightning protocol code that real nodes run.
Security candidateAssign random ids to monitor eventsby Valentine Wallace · 4f385aee · Mar 18, 2026 · 6 filesMessage 73 · AdequateInformational 24Details
Commit message · Valentine Wallace
Assign random ids to monitor events
Currently, the resolution of HTLCs (and decisions on when HTLCs can be forwarded) is the responsibility of Channel objects (a part of ChannelManager) until the channel is closed, and then the ChannelMonitor thereafter. This leads to some complexity around race conditions for HTLCs right around channel closure. Additionally, there is lots of complexity reconstructing the state of all HTLCs in the ChannelManager deserialization/loading logic.
Instead, we want to do all resolution in ChannelMonitors (in response to ChannelMonitorUpdates) and pass them back to ChannelManager in the form of MonitorEvents (similar to how HTLCs are resolved after channels are closed). In order to have reliable resolution, we'll need to keep MonitorEvents around in the ChannelMonitor until the ChannelManager has finished processing them. This simplifies things - on restart instead of examining the set of HTLCs in monitors we can simply replay all the pending MonitorEvents.
To allow the ChannelManager to ack specific monitor events once they are resolved, here we give each MonitorEvent a corresponding unique id. It's implemented in such a way that we can delete legacy monitor event serialization in future LDK versions when persistent monitor events are enabled by default.
73/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
boot or update path
AI analysis · Informational 24/100
This commit is a code-quality and architecture refactor in a Lightning Network library. It assigns random unique IDs to internal 'monitor events' so the system can reliably track which events have been processed after a restart. The change itself does not fix an active security bug; it lays groundwork for a future simplification of how payment resolution is handled. There is no evidence in the commit or supplied references that this is a disclosed security fix or that it addresses a known exploit.
Security candidateFail HTLCs from late counterparty commitment updates after funding spendby Joost Jager · 3e1a18c8 · Mar 18, 2026 · 4 filesMessage 73 · AdequateModerate 68Details
Commit message · Joost Jager
Fail HTLCs from late counterparty commitment updates after funding spend
When a ChannelMonitorUpdate containing a new counterparty commitment is dispatched (e.g. via deferred writes) before a channel force-closes but only applied to the in-memory monitor after the commitment transaction has already confirmed on-chain, the outbound HTLCs in that update must be failed back.
Add fail_htlcs_from_update_after_funding_spend to ChannelMonitorImpl which detects this race condition during update_monitor. When a LatestCounterpartyCommitmentTXInfo or LatestCounterpartyCommitment update is applied and the funding output has already been spent, the function iterates all outbound HTLCs from the update and creates OnchainEvent::HTLCUpdate entries for those that need to be failed back. These entries mature after ANTI_REORG_DELAY blocks, giving time for the peer to potentially broadcast the newer commitment.
HTLCs that appear as non-dust outputs in the confirmed commitment (whether counterparty or holder) are skipped, as they will be resolved on-chain via the normal HTLC timeout/success path. HTLCs already fulfilled by the counterparty (tracked in counterparty_fulfilled_htlcs) are also skipped. Duplicate failures from previously-known counterparty commitments are handled gracefully by the ChannelManager.
AI tools were used in preparing this commit.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
boot or update path
AI analysis · Moderate 68/100
This commit fixes a race condition in the Lightning Dev Kit's channel monitoring code. In simple terms, when a Lightning channel is force-closed, the software must correctly fail back any outstanding payments that are stuck. Previously, if a monitor update containing new payment information was queued but only applied after the channel's funding transaction was already spent on-chain, those payments might not be properly failed back. The patch adds logic to detect this situation and create the necessary failure events, while skipping payments that already have on-chain outputs or were already fulfilled. It also ensures the event processor is notified after flushing monitor updates.
Implement deferred monitor write queueing and flushing
Replace the unimplemented!() stubs with a full deferred write implementation. When ChainMonitor has deferred=true, Watch trait operations queue PendingMonitorOp entries instead of executing immediately. A new flush() method drains the queue and forwards operations to the internal watch/update methods, calling channel_monitor_updated on Completed status.
The BackgroundProcessor is updated to capture pending_operation_count before persisting the ChannelManager, then flush that many writes afterward - ensuring monitor writes happen in the correct order relative to manager persistence.
Key changes: - Add PendingMonitorOp enum and pending_ops queue to ChainMonitor - Implement flush() and pending_operation_count() public methods - Integrate flush calls in BackgroundProcessor (both sync and async) - Add TestChainMonitor::new_deferred, flush helpers, and auto-flush in release_pending_monitor_events for test compatibility - Add create_node_cfgs_deferred for deferred-mode test networks - Add unit tests for queue/flush mechanics and full payment flow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Low 42/100
This commit finishes a previously stubbed-out feature in a Bitcoin Lightning node library. It lets the node delay saving certain channel safety records (called 'monitor writes') until after the main channel state file is saved. The goal is to prevent a crash from leaving the node in a state where the safety record is newer than the main state, which could force-close channels and cost on-chain fees. The change itself is a defensive correctness improvement, not an obvious new vulnerability, but it touches sensitive persistence ordering and replaces unimplemented!() panic stubs with real logic.
Lower-priorityClarify that each pending monitor update ID must be marked completeby Joost Jager · da7c3da2 · Mar 18, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Joost Jager
Clarify that each pending monitor update ID must be marked complete
The previous wording implied that persisting a full ChannelMonitor would automatically resolve all pending updates. Reword to make clear that each update ID still needs to be individually marked complete via channel_monitor_updated, even after a full monitor persistence.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 rewords a documentation comment in the source code. It does not change any code logic, fix a bug, or alter behavior. The change clarifies that each pending monitor update ID must still be individually marked complete even after a full ChannelMonitor has been persisted. There is no security vulnerability being patched here.
Extract shared dummy_monitor helper in channelmonitor.rs
Extract the ChannelMonitor construction boilerplate that was duplicated across channelmonitor test functions into a reusable #[cfg(test)] pub(super) dummy_monitor helper, generic over the signer type.
AI tools were used in preparing this commit.
83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100
This commit is a straightforward code cleanup inside the project's test suite. It pulls repeated setup code for creating a fake ChannelMonitor into a single shared helper function called dummy_monitor. There is no change to production behavior, no bug fix, and no security-sensitive logic added or altered.
Lower-priorityExtract watch_channel_internal/update_channel_internal from Watch implby Joost Jager · dbc1365f · Mar 18, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Joost Jager
Extract watch_channel_internal/update_channel_internal from Watch impl
Pure refactor: move the bodies of Watch::watch_channel and Watch::update_channel into methods on ChainMonitor, and have the Watch trait methods delegate to them. This prepares for adding deferred mode where the Watch methods will conditionally queue operations instead of executing them immediately.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 pure code reorganization (refactor) in the Lightning Dev Kit's chain monitoring code. It moves the existing logic for watching and updating a channel into new internal helper methods, while the public trait methods now simply call those helpers. No behavior changes, security fixes, or new features are introduced.
Add a `deferred` parameter to `ChainMonitor::new` and `ChainMonitor::new_async_beta`. When set to true, the Watch trait methods (watch_channel and update_channel) will unimplemented!() for now. All existing callers pass false to preserve current behavior.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
boot or update path
AI analysis · Informational 19/100
This commit adds a new 'deferred' mode to ChainMonitor, a component that watches blockchain events for Lightning payment channels. When deferred=true, the watch methods currently panic with unimplemented!(). All existing callers pass false, so normal behavior is unchanged. This appears to be a partial feature implementation, not a security fix or vulnerability.
Security candidateValidate all common fields in LSPS1 `is_valid` order checkby Elias Rohrer · 4bec6db5 · Mar 18, 2026 · 1 fileMessage 78 · AdequateLow 47Details
Commit message · Elias Rohrer
Validate all common fields in LSPS1 `is_valid` order check
Add missing cross-validation of `LSPS1OrderParams` against `LSPS1Options` as required by bLIP-51:
- Check `required_channel_confirmations` >= `min_required_channel_confirmations` - Check `funding_confirms_within_blocks` >= `min_funding_confirms_within_blocks` - Check total channel balance (`lsp_balance_sat` + `client_balance_sat`) is within [`min_channel_balance_sat`, `max_channel_balance_sat`], using `checked_add` to guard against overflow
Co-Authored-By: HAL 9000
78/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
memory safetydefensive validation
AI analysis · Low 47/100
This commit fixes validation checks in a Lightning service feature (LSPS1) that lets users place orders for liquidity. Previously, the code did not verify that an order's requested channel size and confirmation settings stayed within the service's advertised limits. The patch adds those missing checks and also protects against a rare integer overflow when adding two balance amounts together. A malicious or malformed order could have slipped through and caused the service to accept terms it never intended to offer.
Lower-priorityReject clients if request registration failed (e.g., duplicative Id)by Elias Rohrer · 15dbb217 · Mar 18, 2026 · 1 fileMessage 65 · AdequateLow 37Details
Commit message · Elias Rohrer
Reject clients if request registration failed (e.g., duplicative Id)
Signed-off-by: Elias Rohrer <dev@tnull.de>
65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Low 37/100
This small patch fixes a messaging bug in a Lightning liquidity service. Previously, if a client sent a duplicate request ID, the server would log an error but would not tell the client that the request was rejected, leaving the client waiting for a response. Now the server sends an explicit rejection message back to the client. The main risk is a mild denial-of-service or confusion from duplicate/lingering request IDs, not theft of funds or remote code execution.
Lower-priorityLimit pending requests and peers in LSPS1 serviceby Elias Rohrer · b2722357 · Mar 18, 2026 · 3 filesMessage 68 · AdequateModerate 55Details
Commit message · Elias Rohrer
Limit pending requests and peers in LSPS1 service
Add per-peer and global rate limiting to `LSPS1ServiceHandler` to prevent resource exhaustion, mirroring the existing LSPS2 pattern.
Introduce `MAX_PENDING_REQUESTS_PER_PEER` (10), `MAX_TOTAL_PENDING_REQUESTS` (1000), and `MAX_TOTAL_PEERS` (100000) constants and enforce them in `handle_create_order_request`. Rejected requests receive a `CreateOrderError` with `LSPS0_CLIENT_REJECTED_ERROR_CODE`. A `total_pending_requests` atomic counter tracks the global count, and a `verify_pending_request_counter` debug assertion ensures it stays in sync.
Co-Authored-By: HAL 9000
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Moderate 55/100
This commit adds rate limits to the LSPS1 (a Lightning liquidity service protocol) server code. It caps how many unfinished order requests a single peer can have open, how many total unfinished requests can exist across all peers, and how many distinct peers can be tracked. Requests that exceed these limits are rejected with a standard error. This is a defensive hardening change to prevent a malicious or buggy peer from consuming excessive server memory or processing time.
Lower-priorityReset `persistence_in_flight` counter on error in LSPS1/LSPS2by Elias Rohrer · 47e5c04f · Mar 18, 2026 · 2 filesMessage 73 · AdequateModerate 60Details
Commit message · Elias Rohrer
Reset `persistence_in_flight` counter on error in LSPS1/LSPS2
Previously, if any `.await?` in the persist loop returned an error, the `?` would propagate out of `persist()` before reaching the `fetch_sub` at the end of the loop. This left the counter permanently > 0, causing all subsequent `persist()` calls to early-return and effectively disabling persistence for the lifetime of the handler.
Fix this by extracting the loop into `do_persist()` and unconditionally resetting the counter via `store(0, Release)` in the outer `persist()` after `do_persist()` returns, regardless of success or failure.
Co-Authored-By: HAL 9000
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Moderate 60/100
This commit fixes a bug in two Lightning liquidity service modules (LSPS1 and LSPS2). Previously, if saving data to disk failed partway through, an internal 'persistence in flight' counter would stay stuck above zero. Once stuck, the code would skip all future disk-saving attempts for the lifetime of the running service. This could silently stop important state from being saved, potentially leading to data loss or inconsistent service state after a restart. The fix wraps the save loop in a helper function and always resets the counter to zero afterward, whether the save succeeded or failed.
Lower-priorityAdd `onchain_payment_required` methodby Elias Rohrer · 98f71f5d · Mar 18, 2026 · 3 filesMessage 58 · ThinLow 32Details
Commit message · Elias Rohrer
Add `onchain_payment_required` method
We previously had no way to reject requests in case the LSP requires onchain payment while the client not providing `refund_onchain_address`. Here we add a method allowing to do so.
This commit adds a new method so a Lightning Service Provider (LSP) can cleanly reject a customer's order when the LSP only accepts on-chain Bitcoin payments but the customer did not supply a refund address. Before this change, the code had no explicit way to reject such orders, which could have led to confused or stuck orders. The change is a defensive API improvement, not a fix for an active exploit.
Lower-priorityDrop unused `LSPS1ServiceEvent::Refund` eventby Elias Rohrer · c0cef54b · Mar 18, 2026 · 1 fileMessage 60 · AdequateInformational 15Details
Commit message · Elias Rohrer
Drop unused `LSPS1ServiceEvent::Refund` event
Turns out this was another variant we didn't actually use anywhere. So we're dropping it.
60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 15/100
This commit simply removes an unused event variant called Refund from a Lightning Service Provider Specification (LSPS1) event enum. It is a cleanup change with no security relevance: the variant was never used in the code, so removing it cannot introduce or fix a vulnerability.
AI review queuedDrop unused `LSPS1OnchainPayment` typeby Elias Rohrer · 029ad804 · Mar 18, 2026 · 1 fileMessage 35 · OpaqueInformational 15Details
Commit message · Elias Rohrer
Drop unused `LSPS1OnchainPayment` type
35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100
This commit simply removes an unused data structure called LSPS1OnchainPayment from the rust-lightning codebase. There is no functional code change, no bug fix, and no security impact. It is a routine cleanup that deletes 12 lines of dead code.
Lower-priorityAdd integration tests for LSPS1 order state transition APIby Elias Rohrer · c5139d0f · Mar 18, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Elias Rohrer
Add integration tests for LSPS1 order state transition API
Add two new integration tests to cover the new public API methods:
- `lsps1_order_state_transitions`: Tests the full flow of `order_payment_received` followed by `order_channel_opened`, verifying that payment states are updated correctly and channel info is returned after the channel is opened.
- `lsps1_order_failed_and_refunded`: Tests the `order_failed_and_refunded` method, verifying that payment states are set to Refunded.
Co-Authored-By: HAL 9000
83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100
This commit only adds new automated integration tests for an existing Lightning Service Provider Specification 1 (LSPS1) order state API. It does not change production code, fix bugs, or introduce new functionality. There is no security-relevant change.
Lower-priorityAdd integration test for expired order pruningby Elias Rohrer · 24848738 · Mar 18, 2026 · 1 fileMessage 78 · AdequateInformational 15Details
Commit message · Elias Rohrer
Add integration test for expired order pruning
Add `lsps1_expired_orders_are_pruned_and_not_persisted` test that verifies:
- Orders with expired payment details (expires_at in the past) are accessible before persist() is called - After persist() is called, expired orders in ExpectingPayment state are pruned and no longer accessible - Pruned orders are not recovered after restart, confirming that the pruning also removes the persisted state
Co-Authored-By: HAL 9000
78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100
This commit only adds a new automated integration test. It does not change any production code. The test verifies that expired LSPS1 orders are removed from memory during persistence and are not restored after a restart. There is no security fix or vulnerability patch here.
Lower-priorityAdd `Hold` payment state per bLIP-51 specby Elias Rohrer · 36e11982 · Mar 18, 2026 · 3 filesMessage 78 · AdequateInformational 19Details
Commit message · Elias Rohrer
Add `Hold` payment state per bLIP-51 spec
The bLIP-51 specification defines a `HOLD` intermediate payment state: - `EXPECT_PAYMENT` -> `HOLD` -> `PAID` (success path) - `EXPECT_PAYMENT` -> `REFUNDED` (failure before payment) - `HOLD` -> `REFUNDED` (failure after payment received)
This commit adds the `Hold` variant to `LSPS1PaymentState` and updates the state machine transitions:
- `payment_received()` now sets payment state to `Hold` (not `Paid`) - `channel_opened()` transitions payment state from `Hold` to `Paid` - Tests updated to verify the correct state at each transition
This allows LSPs to properly communicate when a payment has been received but the channel has not yet been opened (e.g., Lightning HTLC held, or on-chain tx detected but channel funding not published).
Co-Authored-By: HAL 9000
78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 19/100
This commit adds a new 'Hold' payment state to the LSPS1 (Lightning Service Provider Specification 1) implementation in rust-lightning. Previously, when a customer paid for a channel, the system immediately marked it as 'Paid' even though the channel had not been opened yet. The new 'Hold' state correctly reflects that the payment has been received but the channel opening is still pending. This is a protocol/specification compliance change that improves state accuracy and reduces the chance of misleading status reporting, but it does not fix a memory-safety bug or an active exploit.
Lower-priorityRefactor `ChannelOrder` to use `ChannelOrderState` state machineby Elias Rohrer · c7db17de · Mar 18, 2026 · 2 filesMessage 73 · AdequateLow 26Details
Commit message · Elias Rohrer
Refactor `ChannelOrder` to use `ChannelOrderState` state machine
This refactors `ChannelOrder` to use an internal state machine enum `ChannelOrderState` that: - Encapsulates state-specific data in variants (e.g., `channel_info` only available in `CompletedAndChannelOpened`) - Provides type-safe state transitions - Replaces the generic `update_order_status` API with specific transition methods: `order_payment_received`, `order_channel_opened`, and `order_failed_and_refunded`
The state machine has four states: - `ExpectingPayment`: Initial state, awaiting payment - `OrderPaid`: Payment received, awaiting channel open - `CompletedAndChannelOpened`: Terminal state with channel info - `FailedAndRefunded`: Terminal state for failed/refunded orders
Co-Authored-By: HAL 9000 Signed-off-by: Elias Rohrer <dev@tnull.de>
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 26/100
This commit is a code-quality refactor, not a security patch. It replaces a loose 'update_order_status' call with a stricter state machine for tracking LSPS1 channel orders. The change makes invalid transitions explicit errors and keeps payment/channel data tied to the correct states, which reduces the chance of accidental misuse but does not by itself fix a known exploitable vulnerability.
Lower-priorityAdd some checks on provided payment detailsby Elias Rohrer · 8304ebef · Mar 18, 2026 · 4 filesMessage 68 · AdequateLow 36Details
Commit message · Elias Rohrer
Add some checks on provided payment details
As per spec, we check that the user provides at least one payment detail *and* that they don't provide onchain payment details if `refund_onchain_address` is unset.
Signed-off-by: Elias Rohrer <dev@tnull.de>
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 36/100
This commit adds validation checks in the LSPS1 (liquidity service) code to make sure a service provider cannot accidentally offer on-chain Bitcoin refunds when the customer never gave a refund address. It also requires at least one payment method and ensures each payment method starts in the correct initial state. The change is defensive: it prevents protocol non-compliance and reduces the risk of funds being sent to an unknown address if a channel opening fails.
Lower-priorityAdd test case asserting `LSPS1ServiceState` is persisted across restartsby Elias Rohrer · b7b2f7ef · Mar 18, 2026 · 1 fileMessage 60 · AdequateInformational 12Details
Commit message · Elias Rohrer
Add test case asserting `LSPS1ServiceState` is persisted across restarts
Co-authored by Claude AI
60/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
AI analysis · Informational 12/100
This commit adds a new automated test to verify that an LSPS1 service's order state survives a node restart. It does not change production code; it only adds a test case. There is no indication of a security bug being fixed or introduced.
Lower-priorityAdd test case for `invalid_token_provided` flowby Elias Rohrer · be5c2c1a · Mar 18, 2026 · 1 fileMessage 70 · AdequateInformational 15Details
Commit message · Elias Rohrer
Add test case for `invalid_token_provided` flow
We test the just-added API.
Co-authored by Claude AI
70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Informational 15/100
This commit only adds a new automated test for an existing feature. It does not change any production code, fix a bug, or introduce new behavior. There is no security issue here.