LDK
← All projectsLightning Dev Kit

rust-lightning

Composable Rust libraries for building Lightning wallets, nodes, and services.

BitcoinCryptographic librariesLightning NetworkNormal
Repository coverage

1924 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

300security candidates261second-pass queue1606AI analyses
175commits · 30 days
261commits · 60 days
636commits · 180 days
1314commits · 365 days
Backfill bands
Aug 5 → Feb 6819 seen18 candidatesComplete
Feb 6 → Jun 6468 seen16 candidatesComplete
Jun 6 → Jul 6128 seen8 candidatesComplete
Jul 6 → Aug 561 seen3 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

71/100 average clarity
704Strong · 80–100
856Adequate · 60–79
302Thin · 40–59
62Opaque · 0–39
3security candidates with opaque commit messaging
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
Matt Corallo58679418876
Elias Rohrer15415153667
auto-pr-bot571823287
Jeffrey Czyz19645182169
Wilmer Paulino15945155169
Valentine Wallace15715145169
Leo Nash11613116162
Vincenzo Palazzo11311183
Joost Jager16324162069
elnosh401434059
shaavan22622069
wpaulino2059082
Analysis record

Published AI watches

Last scanned 43 minutes ago

Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Correct FeeEstimator docs on the 253 sat/kW lower bound

This is a documentation-only edit. It corrects a misleading comment in the code that wrongly claimed all fee estimates returned to LDK are forced to be at least 253 satoshis per 1000 weight units. The new comment clarifies that this minimu…

ea2051feby auto-pr-bot+9−31 file
No security note in commit
Moderate 54 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Track splice confirmation while awaiting tx_signatures' (#5570)

This change fixes a bug in Lightning Dev Kit's splicing logic. During a splice, one side can broadcast the new funding transaction as soon as it has the other side's signatures. Previously, if that transaction confirmed on-chain before the…

State-machine inconsistency in channel funding lifecycleMissing chain-source watch for in-flight splice funding transactionPotential failure to send splice_locked after splice confirms during signature exchange
ca778e61by Matt Corallo+245−32 files
No security note in commit
Moderate 63 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Account for current HTLC fees in dust exposure' (#5690)

This change fixes how Lightning nodes calculate the financial risk from tiny ('dust') HTLCs when the current on-chain fee rate is higher than the node's own local fee estimate. Previously, the code only considered a buffered fee rate when …

Incorrect fee exposure accounting for dust HTLCsPotential to accept HTLCs whose commitment/HTLC-success fees exceed their value under current feerateEconomic griefing / forced-channel-closure cost manipulation
cc798f60by Matt Corallo+108−382 files
No security note in commit
Informational 15 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Replace cloned array literal with slice::from_ref in reload test' (#5689)

This is a one-line code cleanup in a test file. It replaces a cloned array literal with a slice reference to silence a Rust compiler lint. There is no change to production code, no security fix, and no functional behavior change.

03ca832fby Matt Corallo+1−11 file
No security note in commit
Informational 15 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Replace cloned array literal with slice::from_ref in reload test

This is a one-line change in a test file to satisfy a Rust linter warning. It replaces a needless clone of a funding transaction with a reference-based slice construction. There is no functional change, no user-facing behavior change, and …

93e0129cby auto-pr-bot+1−11 file
No security note in commit
Informational 12 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Fix CI: rebuild test coin-selection impl and rework reused-ID balance test' (#5684)

This commit is a test-only fix for a broken continuous integration (CI) build. It updates a test mock to match a new function signature and rewrites an existing test to use three nodes instead of two so the test scenario remains valid unde…

17bac68aby Matt Corallo+26−202 files
No security note in commit
Moderate 68 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Guard pending closing signatures before channel_ready' (#5681)

This change fixes a Lightning channel bug where a malicious peer could renegotiate the closing transaction fee while the local node was still waiting for its own signer to produce the final signature. If allowed, the local node might combi…

State-machine guard expansion to prevent fee renegotiation while a closing signature is pendingRisk of combining mismatched signatures across different closing feesRegression test demonstrates malicious peer renegotiation attempt and expected warning rejection
a01273a2by Matt Corallo+169−21 file
No security note in commit
Low 48 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Release wallet UTXOs when FundingBuilder rejects a coin selection' (#5634)

This change fixes a wallet bug in rust-lightning where a UTXO could be selected for a Lightning funding transaction, then rejected because its previous transaction was too large to fit in a Lightning peer message. Previously, that rejectio…

API change to CoinSelectionSource::select_confirmed_utxos adding max_input_prevtx_serialized_lenWalletSync filters UTXOs by prevtx serialized length before selectionFundingBuilder enforces Lightning tx_add_input message-size limit at selection time
56054190by Matt Corallo+148−155 files
No security note in commit
Low 48 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Refuse to pay BOLT 12 invoices with records above experimental range

This commit hardens LDK's BOLT 12 payment logic so it refuses to pay invoices containing very large unknown record types (4 billion and up). These records are legal under the Lightning spec, but LDK doesn't understand them, so the change t…

Defensive refusal to pay invoices with unknown high-numbered TLV recordsReuses existing UnknownRequiredFeatures failure path instead of adding a new oneAdds explicit checks before payment state insertion and route construction
2970372fby auto-pr-bot+106−177 files
No security note in commit
Moderate 64 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Read invoice TLV records above the experimental range

This commit fixes a backward-compatibility bug in LDK's BOLT 12 invoice parser. A previous change had capped the range of 'experimental' TLV record types at 4 billion, but the Lightning spec imposes no upper bound. As a result, invoices cr…

Backward-compatibility regression in deserialization of persisted channel monitorsDenial-of-service via unreadable monitor blocking all channel monitoringSpec compliance fix: TLV record types have no upper bound
9e28db58by auto-pr-bot+133−84 files
No security note in commit
High 74 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse to sign messages that collide with gossip serializations' (#5677)

This change fixes a security issue where a signed text message could be crafted so that its prefixed form looks exactly like a Lightning 'node_announcement' gossip message. Because both use the same double-SHA256 hash and the same signing …

Signature replay / message confusion between signed messages and gossip announcementsForged `node_announcement` signatures via chosen-prefix message constructionNew validation rejects prefixed messages that deserialize as `UnsignedNodeAnnouncement`
ec40e097by Matt Corallo+74−148 files
Vendor flagged security relevance
Low 37 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Retry a single HTLC before abandoning an unfundable batch' (#5406)

This change fixes a corner case in how the Lightning node tries to claim multiple pending HTLCs (small Bitcoin payments locked in a channel) when the wallet cannot fund a single large batch transaction. Previously, if the multi-HTLC batch …

Funds-recovery robustness improvement: prevents premature abandonment of a single unbatched HTLCChange in error-handling arithmetic from checked_sub/saturating_sub with max(1)New unit tests covering both failed and successful singleton HTLC funding paths
643e8684by wpaulino+119−21 file
No security note in commit
Moderate 54 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse to persist fresh monitors that alias archived monitors' (#5645)

This change prevents a Lightning node from accidentally overwriting an archived copy of a channel's security monitor with a brand-new one that happens to use the same identifier. In the old code, if a new channel reused the same identifier…

Data-loss prevention: stops archived ChannelMonitor from being overwritten by a later channel with the same keySafety guard added to both sync and async persistence pathsPersistence refusal surfaces as InProgress/UnrecoverableError rather than silent overwrite
3c606c11by Matt Corallo+298−332 files
No security note in commit
Moderate 52 AI analysisMessage 86 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Handle fee multiplication overflow when merging MPP paths' (#5288)

This change fixes a place in the Lightning payment routing code where adding up fees could overflow the maximum number a computer can store in a 64-bit integer. Previously, the code assumed this could never happen and would crash (panic) i…

Integer overflow in fee computationPreviously unreachable!() panic path reachableMPP path merge could trigger overflow
25f8a740by Matt Corallo+42−171 file
No security note in commit
Low 43 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Resume channels stuck awaiting a completed monitor persistence on reload' (#5610)

This commit fixes a bug where a Lightning node could get stuck after restarting. If the node crashed or restarted while it was still saving the initial channel monitor to disk, and that save later finished in another process, the restarted…

Fixes a state-machine stall on node reload that could leave channels non-functionalRemoves an overstrict assertion that would panic on a legitimate post-reload stateAdds explicit detection of monitor persistence completed in a prior process
11815ed1by Matt Corallo+334−74 files
No security note in commit
Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Correct KeysManager docs on spliced channels' remote_key derivation' (#5609)

This change only updates documentation and code comments in the Lightning Dev Kit library. It clarifies that a particular key-derivation setting is fixed when a channel is first opened and is not changed by splicing. No code behavior was a…

83a4d243by Matt Corallo+17−91 file
No security note in commit
Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Fix DelayedPaymentKey/HtlcKey from_basepoint docs and document justice tx witness script' (#5596)

This commit only changes documentation comments in two source files. It corrects the wording of how certain public keys are derived in the Lightning protocol and adds details about which witness script a signer must use when creating justi…

Documentation-only changeClarifies key derivation semantics for Lightning commitment transactionsClarifies justice transaction witness script requirements for signers
2f832195by Matt Corallo+44−62 files
No security note in commit
Informational 19 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Document that TokioSpawner requires all of LDK in a tokio context' (#5621)

This change only adds documentation comments to a Rust struct. It does not modify any executable code, so it cannot by itself introduce or fix a security vulnerability. The new text warns developers that using TokioSpawner incorrectly can …

Documentation-only changeNo code logic modifiedNo unsafe blocks added
6e555fa2by Matt Corallo+11−01 file
No security note in commit
High 70 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Make custom signers verify holder commitment sigs synchronously' (#5616)

This commit hardens how Lightning Dev Kit handles custom signing modules. Previously, LDK relied on each custom signer to check that the other party's signatures on a holder commitment transaction were valid. The change adds a ready-made v…

New synchronous signature-verification helper for holder commitment transactionsTrait documentation now mandates verification before Ok(()) because LDK acts immediatelyInMemorySigner now validates that holder funding key belongs to signer before signature checks
0e3b6d33by Matt Corallo+324−954 files
Vendor flagged security relevance
Moderate 64 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse channel_ready while the initial funding_signed is pending' (#5612)

This update fixes a corner case in the Lightning Dev Kit where a node could get confused if it received a 'channel_ready' message while still waiting for its own signer to produce the first commitment signature. The patch makes the node re…

State-machine confusion between funding_signed and channel_ready in async signer flowPremature channel_ready could advance counterparty_next_commitment_point before initial commitment is signedPatch closes channel rather than allowing inconsistent commitment state
d68d2235by Matt Corallo+101−12 files
No security note in commit
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Security candidateMerge PR '`MonitorEvent`s resolve outbound payment claims' (#4545)by wpaulino · ff943dc8 · Nov 5, 2026 · 10 filesMessage 81 · StrongModerate 52Details
Commit message · wpaulino

Merge PR '`MonitorEvent`s resolve outbound payment claims' (#4545)

from valentinewallace/2026-04-mon-resolves-outb-claims into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/4545
Reviewed-by: wpaulino <wpaulino@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · Moderate 52/100

This commit changes how Lightning Dev Kit handles payment claims when an outbound HTLC is resolved. Previously, off-chain payment claims were tied to a specific message-handling flow (RAA release) and could get out of sync with the channel monitor's durable events. The patch makes monitor events the durable source of truth for resolving outbound payments, adds tracking so the same HTLC can have both an off-chain and an on-chain claim event, and ensures older LDK versions (0.3 and earlier) don't misinterpret off-chain events as on-chain ones. It also fixes edge cases around restarts, upgrades, downgrades, and replayed events. The primary risk is not a remote exploit but a correctness/consensus bug that could, in edge cases, lead to stuck payments, phantom balances, or premature payment completion.

Security candidateLSPS2: Release pruned pending requests from the total limitby auto-pr-bot · 0d95586c · Nov 5, 2026 · 2 filesMessage 83 · StrongHigh 76Details
Commit message · auto-pr-bot

LSPS2: Release pruned pending requests from the total limit

The LSPS2 service counts unanswered `get_info`/`buy` requests in a global
`total_pending_requests` counter and refuses new requests from any peer
once it reaches `MAX_TOTAL_PENDING_REQUESTS`. When a peer disconnected,
its pending requests were dropped from the per-peer map by
`prune_pending_requests` without lowering the counter, so every request
still unanswered at disconnect permanently consumed one of the 1,000
global slots until the process restarted. A peer with throw-away node
keys could thus pin an LSP at the limit and refuse `lsps2.get_info` and
`lsps2.buy` to all clients, and ordinary clients that lost their
connection before being answered drifted the counter upward, too.

Have `prune_pending_requests` return how many entries it removed (the
same shape LSPS1's already has) and subtract that from the counter in
`peer_disconnected`, using the same saturating `fetch_update` and
out-of-sync `debug_assert!` idiom as `remove_pending_request`.
`peer_disconnected` is the only caller of `prune_pending_requests`, and
together with `remove_pending_request` this covers every removal from
`pending_requests`, so the counter stays in sync with the per-peer maps
as `verify_pending_request_counter` asserts.

Reported by Anthropic's OSS Scanner as ANT-2026-S58419MV and
independently by Erick Cestari.

@tnull asked:

> @auto-pr-bot please fix this, including in the commit message that
> this was reported by Anthropic's OSS Scanner, as ANT-2026-S58419MV.
>
> Release requests pruned in peer_disconnected from
> total_pending_requests, keeping the counter in sync with what
> prune_pending_requests removes. Add a regression test that fails
> without the fix.

Requested-by: @tnull
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>

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
access controlfuzzing or regression evidence
AI analysis · High 76/100

This commit fixes a denial-of-service bug in the LSPS2 (Lightning Service Provider Specification 2) service code. The service tracks how many unanswered client requests it has globally and stops accepting new ones after 1,000. When a client disconnected before being answered, the per-client request list was cleaned up, but the global counter was not reduced. That meant every such request permanently consumed one of the 1,000 slots until the program restarted. An attacker could repeatedly connect, send a request, and disconnect to exhaust the slot limit, blocking legitimate clients from using the service. The fix makes the cleanup routine report how many requests it removed and subtracts that from the global counter when a peer disconnects. A regression test is included.

Security candidateMerge PR 'Report bare BOLT 11 invoice amounts that overflow pico BTC' (#5338)by Matt Corallo · 36e3da0a · Oct 29, 2026 · 3 filesMessage 86 · StrongLow 48Details
Commit message · Matt Corallo

Merge PR 'Report bare BOLT 11 invoice amounts that overflow pico BTC' (#5338)

from bot/5332-bolt11invoice-reads-an-amount-of-7cfdc8 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5338
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

86/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
memory safetymerge-commit duplicate discount
AI analysis · Low 48/100

This change fixes a bug in how BOLT 11 Lightning invoices handle very large amounts written without a unit suffix (like 'lnbc18446745...'). Previously, such invoices could bypass an overflow check and later cause arithmetic errors or unexpected behavior when the code tried to convert the amount into smaller units. The patch now rejects these oversized amounts both during parsing and when constructing a signed invoice, returning a clear error instead.

Security candidatePin backtrace to 0.3.76 for rustc 1.82 through 1.87by auto-pr-bot · 2c88e722 · Oct 27, 2026 · 1 fileMessage 91 · StrongInformational 15Details
Commit message · auto-pr-bot

Pin backtrace to 0.3.76 for rustc 1.82 through 1.87

@matt asked in issue #5413:

> @auto-pr-bot please add appropriate CI pins to fix the new CI breakage
> like this:
>
> ```
> cargo test -p lightning --quiet --color always --features backtrace
> error: rustc 1.85.1 is not supported by the following packages:
> addr2line@0.27.1 requires rustc 1.88
> backtrace@0.3.77 requires rustc 1.88.0
> gimli@0.34.0 requires rustc 1.88
> Either upgrade rustc or select compatible dependency versions with
> cargo update <name>@<current-ver> --precise <compatible-ver>
> where <compatible-ver> is the latest version supporting rustc 1.85.1
> ```

backtrace v0.3.77 raised its MSRV to 1.88, dragging addr2line 0.27 and
gimli 0.34, which also require rustc 1.88, into the resolution of our
`backtrace` feature. Pinning backtrace to 0.3.76 downgrades those
transitively to 0.25.1 and 0.32.3, which still support our 1.85 MSRV.

The new pin only applies from rustc 1.82, backtrace 0.3.76's own MSRV,
so the existing 0.3.74 pin still covers the 1.75 fuzz-sanity job, and it
stops applying once rustc reaches 1.88.

Fixes #5413

Requested-by: @matt
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5413
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>

91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
access controlupdate trustfuzzing or regression evidence
AI analysis · Informational 15/100

This is a routine build-maintenance change, not a security fix. A newer version of a Rust dependency called 'backtrace' started requiring a newer Rust compiler than the project officially supports, which broke automated tests. The commit pins that dependency to an older compatible version so the test suite can run again. It does not change any code that handles money, network messages, or cryptography.

Security candidateMerge PR 'Don't process monitor events in `get_and_clear_pending_msg_events`' (#5031)by wpaulino · 42e3eb03 · Oct 26, 2026 · 17 filesMessage 81 · StrongLow 45Details
Commit message · wpaulino

Merge PR 'Don't process monitor events in `get_and_clear_pending_msg_events`' (#5031)

from 2026-09-dont-process-mon-evs-on-msg-evs into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5031
Reviewed-by: wpaulino <wpaulino@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
signing or wallet pathboot or update pathmerge-commit duplicate discount
AI analysis · Low 45/100

This change stops one internal function from automatically processing monitor events when the caller only asked for pending message events. It is a cleanup of how background tasks are triggered, not a fix for an externally exploitable bug. Most of the patch is test updates that reorder event checks to match the new behavior.

Security candidateMerge PR 'Verify built invoice signatures and length' (#5306)by benthecarman · 349f4421 · Oct 23, 2026 · 5 filesMessage 91 · StrongModerate 62Details
Commit message · benthecarman

Merge PR 'Verify built invoice signatures and length' (#5306)

from invoice-signing-hardening into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5306
Reviewed-by: joostjager <joostjager@noreply.git.rust-bitcoin.org>

91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
signing boundarydefensive validationsigning or wallet pathmerge-commit duplicate discount
AI analysis · Moderate 62/100

This commit hardens how Lightning invoices are created and validated in rust-lightning. It now checks that the digital signature on a freshly built invoice actually matches the invoice contents, and it rejects invoices that would become too long once encoded. Previously, a buggy or malicious signer could produce an invoice with an invalid signature or one that exceeded protocol size limits, which could cause parsing failures or denial-of-service issues for other nodes.

Security candidateMerge PR 'Reject serializing blinded paths with more than 255 hops' (#5254)by Val Wallace · 2f42409d · Oct 22, 2026 · 1 fileMessage 81 · StrongLow 35Details
Commit message · Val Wallace

Merge PR 'Reject serializing blinded paths with more than 255 hops' (#5254)

from bot/5152-reject-overflowing-blinded-path-14a8f7 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5254
Reviewed-by: Val Wallace <val@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
memory safetymerge-commit duplicate discount
AI analysis · Low 35/100

This change hardens how Lightning blinded payment paths are saved or sent over the wire. Previously, if a path somehow contained more than 255 hops, the code would silently chop the count to fit in a single byte and then write out all hops, causing the receiver to read the wrong number of entries and likely crash or misparse the data. Now it still caps the count but also stops writing after 255 hops, and adds a debug-only assertion to catch the oversized path during development.

Security candidateMerge PR 'Fix CI: pin tokio; remove 0.0.125 compat tests' (#5299)by Matt Corallo · 243c2f14 · Oct 20, 2026 · 5 filesMessage 91 · StrongInformational 15Details
Commit message · Matt Corallo

Merge PR 'Fix CI: pin tokio; remove 0.0.125 compat tests' (#5299)

from 2026-10-pin-tokio into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5299
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
access controlmerge-commit duplicate discount
AI analysis · Informational 15/100

This commit is purely a maintenance patch for the project's continuous integration (CI) system. It pins the tokio dependency to an older version for older Rust compilers and removes compatibility tests for a very old LDK release (0.0.125). There is no change to production code, no security fix, and no vulnerability introduced.

Security candidatePin tokio to 1.53.3 on pre-1.85 rustcby Valentine Wallace · c8c138a9 · Oct 20, 2026 · 1 fileMessage 80 · StrongInformational 15Details
Commit message · Valentine Wallace

Pin tokio to 1.53.3 on pre-1.85 rustc

Starting with version 1.54.0, tokio has an MSRV of rustc 1.85. As
tokio is a dependency of our downstream-facing crates (e.g.
lightning-net-tokio), pin it in PIN_RELEASE_DEPS so that the
msrv-no-dev-deps-check build is covered as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
access control
AI analysis · Informational 15/100

This is a routine build-script change that pins the tokio dependency to an older version when using older Rust compilers. It is not a security patch and does not change any production code that handles user data or network traffic.

Security candidateSerialize experimental TLV records in unsigned invoicesby auto-pr-bot · 10296a82 · Oct 20, 2026 · 1 fileMessage 96 · StrongModerate 60Details
Commit message · auto-pr-bot

Serialize experimental TLV records in unsigned invoices

The `Writeable` implementation for `UnsignedBolt12Invoice` emitted only
`bytes`, omitting `experimental_bytes`, even though construction and
parsing include that buffer in `tagged_hash` and `sign` appends it to
the signed invoice. Experimental records inherited from the payer's
signed invoice request, including unknown odd TLV records, were
therefore missing from the byte representation exposed before signing.

@jkczyz asked in issue #5192:

> @auto-pr-bot please open a PR to fix this issue

> `UnsignedBolt12Invoice` deliberately separates experimental records
> into `experimental_bytes`: construction and parsing include that
> buffer in `tagged_hash`, and `sign` appends it to the final signed
> invoice. However, its public `Writeable` implementation emits only
> `self.bytes`. Experimental records inherited from the payer's signed
> invoice request (including unknown odd TLVs) are therefore omitted
> from the byte representation exposed before signing even though they
> are authenticated by the signature and present in the resulting
> `Bolt12Invoice`.
>
> This breaks the documented policy-signing boundary:
> `NodeSigner::sign_bolt12_invoice` implementations are allowed to
> inspect the `UnsignedBolt12Invoice` and reject unexpected content
> before releasing the node key signature. A remote/HSM adapter or
> policy signer that serializes the public `Writeable` value to parse
> or reject extensions sees an incomplete object.
>
> The serialization should write `self.bytes` followed by
> `self.experimental_bytes`, without adding a length prefix, matching
> the exact unsigned TLV stream later signed.

[...]

The regression test inherits the repository's test-only experimental
invoice request field through `respond_with_no_std` and checks that
serialization exposes every TLV record committed by `tagged_hash` and
round-trips to the same hash.

Fixes #5192

Requested-by: @jkczyz
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5192
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>

96/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
signing boundaryfuzzing or regression evidence
AI analysis · Moderate 60/100

This commit fixes a bug in how an unsigned BOLT 12 invoice was serialized before being signed. The public serialization accidentally dropped experimental/custom data fields that were inherited from the payer's invoice request. Because those fields are still included in the cryptographic hash that gets signed, a signer that inspected only the public serialized bytes would see an incomplete picture and could not reliably enforce policies against unknown extensions. The fix makes the public serialization include both the standard bytes and the experimental bytes, matching what is actually signed.

Security candidateSerialize experimental TLV records in unsigned invoice requestsby auto-pr-bot · cf18377f · Oct 20, 2026 · 1 fileMessage 86 · StrongHigh 72Details
Commit message · auto-pr-bot

Serialize experimental TLV records in unsigned invoice requests

The `Writeable` implementation for `UnsignedInvoiceRequest` emitted only
`bytes`, omitting `experimental_bytes`, even though construction and
parsing include that buffer in `tagged_hash` and `sign` appends it to
the signed invoice request. A signer reviewing the unsigned
serialization before releasing a signature would therefore not see
records that the signature commits to.

@jkczyz asked in issue #5193:

> @auto-pr-bot please open a PR to fix this issue

> `UnsignedInvoiceRequest` stores normal records in `bytes` and
> experimental offer/invoice-request records in `experimental_bytes`.
> Its signing hash is computed over both buffers, and `sign` inserts
> the signature before appending `experimental_bytes` to the final
> request. However, the public `Writeable` implementation emits only
> `bytes`. A custom/HSM policy signer receiving the
> `&UnsignedInvoiceRequest` through `SignInvoiceRequestFn` and
> serializing it for review therefore sees fewer fields than it is
> being asked to authenticate. A malicious offer can carry an unknown
> odd experimental extension: the policy approves the truncated
> serialization, while the returned `InvoiceRequest` includes the
> hidden extension under the payer's valid signature. [...]

Fixes #5193, superseding #5289, an earlier standalone fix for the same
issue. The analogous fix for `UnsignedBolt12Invoice` follows in the
next commit.

Requested-by: @jkczyz
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5193
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>

86/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
signing boundary
AI analysis · High 72/100

This commit fixes a bug in how unsigned invoice requests were serialized before being signed. The code previously left out experimental extra data, meaning a signer reviewing the request would not see everything their signature would later cover. A malicious offer could hide data in that experimental space, getting a valid signature on content the signer never reviewed. The fix makes the unsigned serialization include both the normal and experimental bytes.

Security candidateMerge PR 'Avoid overflow when averaging liquidity offsets in merge' (#5208)by Matt Corallo · ca77cdfa · Oct 13, 2026 · 1 fileMessage 86 · StrongLow 48Details
Commit message · Matt Corallo

Merge PR 'Avoid overflow when averaging liquidity offsets in merge' (#5208)

from bot/5121-unchecked-u64-addition-in-channe-326b73 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5208
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

86/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
memory safetymerge-commit duplicate discount
AI analysis · Low 48/100

This patch fixes an arithmetic overflow bug in rust-lightning's payment-path scoring logic. When the software merged two stored estimates of a Lightning channel's available liquidity, it added two large 64-bit numbers together and then divided by two to get an average. If both numbers were near the maximum a u64 can hold, the addition would overflow and wrap around, producing a tiny, wrong average. The fix computes the average safely by dividing each number first, then adding. The commit message and new test explicitly describe this as an overflow risk, especially when data is loaded from disk or untrusted external sources.

Security candidateMerge PR 'Fix hang in `test_single_channel_multiple_mpp` on busy machines' (#5131)by Matt Corallo · a1eaff1a · Oct 9, 2026 · 11 filesMessage 91 · StrongInformational 14Details
Commit message · Matt Corallo

Merge PR 'Fix hang in `test_single_channel_multiple_mpp` on busy machines' (#5131)

from 2026-10-racy-test into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5131
Reviewed-by: Val Wallace <val@noreply.git.rust-bitcoin.org>

91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
cryptography-sensitive pathboot or update pathmerge-commit duplicate discount
AI analysis · Informational 14/100

This commit fixes a flaky test that could hang on busy machines. It does not change production code behavior or fix any security vulnerability in the software itself. The rest of the patch is minor code cleanup, such as switching to newer Rust syntax for formatting strings and constructing vectors.

Security candidateFix new clippy lint complaining about extra `&`s in `format!()`by Matt Corallo · f1498b25 · Oct 9, 2026 · 6 filesMessage 50 · ThinInformational 15Details
Commit message · Matt Corallo

Fix new clippy lint complaining about extra `&`s in `format!()`

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
cryptography-sensitive path
AI analysis · Informational 15/100

This commit only cleans up Rust formatting strings to satisfy a new Clippy lint. It removes unnecessary ampersands (&) inside format!() and writeln!() calls. There is no change to program logic, no security fix, and no behavior change.

Security candidateFix hang in `test_single_channel_multiple_mpp` on busy machinesby Matt Corallo · e7a51475 · Oct 8, 2026 · 1 fileMessage 100 · StrongInformational 16Details
Commit message · Matt Corallo

Fix hang in `test_single_channel_multiple_mpp` on busy machines

`test_single_channel_multiple_mpp` claims an MPP payment from a
background thread while each `ChannelMonitorUpdate` persistence blocks
until the test sends into an mpsc channel. The claiming thread holds
node 8's per-peer lock while blocked, so the main thread can only take
that lock in the brief window after each update completes.

To fetch the first `commitment_signed`, the main thread called
`get_and_clear_pending_msg_events`, which takes the per-peer lock four
separate times. Only three updates were completed before it had to
return, and under CPU contention the main thread may get the lock only
once per update. It then stayed blocked on the lock while the claiming
thread waited for a write which only a thread spawned after the call
returns would send, hanging the test forever.

Instead, read the pending messages from the peer state directly,
taking the lock only once. Further, complete updates from a background
thread until each call returns, rather than a fixed number of times.
At least two are still completed while fetching the messages, so that
some claims are in the holding cell when the `revoke_and_ack` arrives.
Finally, accept any number of fulfills in each batch at the end, as
that depends on how far the claim got before the `revoke_and_ack` was
handled.

This may or may not be a complete fix, and may or may not make the
test unable to detect the original issue, but at this point it hardly
matters. We want to drop the test entirely in #4552 and its been racy
for so long that its starting to cause other issues.

Fixes #4744

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

100/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✓ Links an issue, advisory, or supporting reference
Why it was queued
boot or update path
AI analysis · Informational 16/100

This change fixes a flaky automated test that could freeze forever on heavily loaded computers. It only touches test code, not the actual Lightning node software that users run, so it has no direct security impact on real deployments.

Security candidateLog blinded route tails without payload bytesby auto-pr-bot · 2b9039e6 · Oct 8, 2026 · 1 fileMessage 76 · AdequateModerate 58Details
Commit message · auto-pr-bot

Log blinded route tails without payload bytes

`DebugRoute` formatted `Path::blinded_tail` with the derived `Debug`,
which emits every `BlindedHop::encrypted_payload` byte as a decimal
list. Routes are logged at INFO by the default router after the
recipient-provided blinded path from a BOLT 12 invoice has been cloned
into them, so a single "Got route" record scaled with—and could largely
consist of—invoice ciphertext chosen by whoever issued the invoice.

Instead, log one line for the tail's blinding point, excess CLTV expiry
delta and final value, one line per Trampoline hop, and one line per
blinded hop carrying its blinded node id and encrypted payload length.
Rendering each hop is then bounded to a fixed ~150 bytes regardless of
the payload size, while staying readable for debugging.

@val reported in #5084:

> `DebugRoute` formats `p.blinded_tail` with derived `Debug`. That
> recursively emits every `BlindedHop::encrypted_payload` byte as a
> decimal list. The default route finder logs this formatter at INFO
> (`Got route`) after cloning the selected recipient-provided blinded
> path into the route, so attempting payment of an attacker-issued BOLT
> 12 invoice can make an ordinary log record scale with—and
> substantially amplify—the invoice ciphertext. [...]

@matt asked:

> @auto-pr-bot please come up with a better way to log these, something
> that's relatively readable, the suggested fix isn't bad.

Requested-by: @matt
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5084#issuecomment-449421

Fixes #5084

Authored-By: ggml-org/GLM-5.3-Flash-GGUF:Q4_K <goose@users.noreply.local>

76/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
explicit security language
AI analysis · Moderate 58/100

This change fixes a logging issue where paying a BOLT 12 invoice could cause the software to write an unusually large log entry. The previous code printed every byte of encrypted data from the invoice's hidden payment path as a long list of numbers, which could waste disk space, slow down logging, and potentially disrupt log collection systems. The fix prints only a short summary and the length of each encrypted payload instead.

Security candidateMerge PR 'Fail held HTLC failures when force-closing' (#5050)by Matt Corallo · e8c3f656 · Oct 1, 2026 · 6 filesMessage 81 · StrongModerate 60Details
Commit message · Matt Corallo

Merge PR 'Fail held HTLC failures when force-closing' (#5050)

from fail-back-htlc-fc into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5050
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · Moderate 60/100

This commit fixes a bug in the Lightning Dev Kit where a forwarded payment could get permanently stuck if a channel was force-closed at exactly the wrong moment. Normally, when the next node in a route rejects a payment, that rejection is held back briefly until the channel state is fully updated. If the channel was force-closed while that rejection was still held back, the rejection could be lost and the payment would never be failed backwards to the sender. The fix hands those held-back failures to the channel's on-chain monitor so they are released once the monitor is updated, preventing stuck payments.

Security candidateFail held HTLC failures when force-closingby elnosh · bfc96786 · Oct 1, 2026 · 6 filesMessage 68 · AdequateModerate 68Details
Commit message · elnosh

Fail held HTLC failures when force-closing

When our counterparty fails an HTLC, the failure is held until the
ChannelMonitorUpdate for their revoke_and_ack completes. If the channel
is force-closed while that update is in-flight, the held failure was
dropped with the Channel. As the ChannelMonitor had already applied the
revocation, the HTLC was in no commitment transaction it tracks either,
so it was never failed, eventually causing a force-close.

Instead, include the held failures in the ChannelForceClosed update and
have the ChannelMonitor fail them via a MonitorEvent::HTLCEvent when
applying it. HTLC monitor events are only released once all updates
have been persisted, so the failure is only acted on once the
revocation is durable.

HTLCs which are still in a commitment transaction the ChannelMonitor
tracks are skipped. This is the case if the update for the revocation
was blocked rather than in-flight, and thus dropped on close, in which
case the counterparty can still claim the HTLC on-chain. Such HTLCs are
resolved like any other HTLC the ChannelMonitor tracks.

Co-Authored-By: Claude Opus 5.5 <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 · Moderate 68/100

This commit fixes a bug in the Lightning Dev Kit where a forwarded payment failure could get permanently lost if a channel was force-closed at exactly the wrong moment. Previously, when the other side of a channel told us an HTLC (a conditional payment) had failed, that failure was temporarily held until a channel-state update finished. If the channel was force-closed while that update was still in flight, the held failure was discarded. Because the payment was also no longer in any on-chain commitment transaction the node watches, it would never be failed backwards or forwards, eventually causing another force-close. The fix hands those held failures to the ChannelMonitor as part of the force-close update, so they are properly failed once the relevant state updates are durably persisted.

Security candidateMerge PR 'Drop since-applied blocked monitor updates before the stale-channel check' (#5046)by Matt Corallo · 49ed7c35 · Oct 1, 2026 · 2 filesMessage 81 · StrongModerate 64Details
Commit message · Matt Corallo

Merge PR 'Drop since-applied blocked monitor updates before the stale-channel check' (#5046)

from drop-applied-blocked-mon-updates into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5046
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · Moderate 64/100

This patch fixes a bug in the Lightning Dev Kit's channel startup logic. Previously, if a user's ChannelManager state was older than their ChannelMonitor, the code would force-close the channel and incorrectly fail backwards (cancel) any HTLCs that were added in a monitor update that had already been applied. The fix drops those already-applied blocked updates before doing the stale check, so HTLCs the counterparty is already committed to are not wrongly canceled. This could have caused payment failures or loss of funds in edge cases involving stale backups.

Security candidateRevert "Pass entropy source when queueing monitor event"by Valentine Wallace · 8f793eb7 · Sep 30, 2026 · 7 filesMessage 78 · AdequateInformational 19Details
Commit message · Valentine Wallace

Revert "Pass entropy source when queueing monitor event"

This reverts commit 6798ec9406e3f7dc7247e7423637c8d9ed98ace3.

We previously used the entropy source to generate random monitor event IDs, but
have since started generating the IDs deterministically.

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
entropy or randomness
AI analysis · Informational 19/100

This commit is a straightforward code cleanup: it removes an unused 'entropy source' argument that was previously passed around when creating monitor events. The project now generates those event IDs deterministically, so the randomness source is no longer needed. There is no indication this fixes a security bug; it is an API simplification and refactoring change.

Security candidateRevert "ChainMonitor::_entropy_source -> ::entropy_source"by Valentine Wallace · e0c0bcdd · Sep 30, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Valentine Wallace

Revert "ChainMonitor::_entropy_source -> ::entropy_source"

This reverts commit 721265b34802956e6c34f8b4f8c36b772a812044.

We previously used the entropy source to generate random monitor event IDs, but
have since started generating the IDs deterministically.

68/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
entropy or randomness
AI analysis · Informational 15/100

This commit simply renames a field inside the ChainMonitor struct from `entropy_source` back to `_entropy_source`. The leading underscore is a Rust convention meaning 'this field is intentionally unused.' The commit message explains the field is no longer needed for generating random monitor event IDs because those IDs are now created deterministically. The entropy source is still used in one peer-storage feature path, so it is kept in the struct but marked as mostly unused. There is no security bug being fixed here—this is a code cleanup/revert of a previous naming change.

Security candidateMerge PR 'Don't track refused monitor updates as pending' (#5030)by Matt Corallo · 47850384 · Sep 28, 2026 · 2 filesMessage 81 · StrongModerate 57Details
Commit message · Matt Corallo

Merge PR 'Don't track refused monitor updates as pending' (#5030)

from 2026-09-refused-upds-not-pending into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5030
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · Moderate 57/100

This patch fixes a bookkeeping bug in rust-lightning's ChainMonitor. When a channel monitor refuses an update (for example, because the channel is already force-closing), the code used to still record that update as 'pending completion.' Because refused updates are never later marked complete, the pending entry could sit around indefinitely and potentially block follow-up completion actions such as marking a payment as claimed. The change only adds the update to the pending list when the monitor actually accepted it.

Security candidateMerge PR 'Persistent `MonitorEvent`s' (#4491)by wpaulino · 9a324e72 · Sep 25, 2026 · 12 filesMessage 76 · AdequateModerate 55Details
Commit message · wpaulino

Merge PR 'Persistent `MonitorEvent`s' (#4491)

from valentinewallace/2026-03-persistent-mon-evs into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/4491

76/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · Moderate 55/100

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 lost. That could cause a forwarding node to miss an HTLC preimage or timeout, potentially leading to stuck payments or loss of funds. The fix assigns each event a random ID, keeps unacknowledged events in the monitor, replays them after restart, and requires the ChannelManager to acknowledge them once processed. It also prevents monitors from being archived while they still have unacknowledged events.

Security candidateMerge PR 'Fix payment attribution edge cases and simplify claiming' (#5021)by Matt Corallo · ee7c61c2 · Sep 25, 2026 · 22 filesMessage 81 · StrongLow 47Details
Commit message · Matt Corallo

Merge PR 'Fix payment attribution edge cases and simplify claiming' (#5021)

from fulfillment-prerequisites into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5021
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
signing or wallet pathboot or update pathmerge-commit duplicate discount
AI analysis · Low 47/100

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 data used for timing analysis: it caps failure-packet size to prevent oversized messages and ensures trampoline-style forwarded claims start fresh attribution rather than reusing downstream data. The changes are mostly defensive correctness fixes rather than an active vulnerability patch.

Security candidateDon't track refused monitor updates as pendingby Valentine Wallace · ada0cb7a · Sep 18, 2026 · 2 filesMessage 68 · AdequateModerate 66Details
Commit message · Valentine Wallace

Don't track refused monitor updates as pending

When a monitor update is rejected by the monitor (e.g. a stale commitment
update applied after funding spend), it's possible that that update modified
the monitor's state. Therefore, the ChainMonitor will respond by persisting the
entire monitor and not persisting the individual rejected update.

However, prior to this patch, if the above whole-monitor-persist returned
InProgress, the monitor would erroneously track the rejected monitor update as
pending-persist, even though that update was never handed to the persister in
the first place, so implementations would never know to call
channel_monitor_updated with the rejected update's ID.

This dangling pending update can then block emission of
MonitorEvent::Completed, blocking ChannelManager's completion actions (e.g.
PaymentClaimed) until restart. In the case of payment forwards, if this bug
blocked the resumption of another channel, it could lead to an HTLC timing out
and a force close.

Co-Authored-By: Claude Fable 5.1 <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 · Moderate 66/100

This patch fixes a bookkeeping bug in rust-lightning's ChainMonitor. When a monitor update is rejected (for example, because the channel funding has already been spent), the code may persist the entire monitor instead of the individual update. If that full-monitor save was still in progress, the system incorrectly recorded the rejected update as 'pending completion.' Because the rejected update was never actually handed to the persister, it would never complete, leaving a dangling pending entry. That could stall important channel events, and in payment-forwarding scenarios could contribute to an HTLC timeout and a forced channel closure.