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 fixes a bug in the Lightning Dev Kit's handling of channel monitor updates that are refused because the channel's funding transaction was already spent on-chain. Previously, such refused updates were persisted as a full monitor…
Durability ordering bug: later MonitorEvent::Completed could imply earlier refused update was persistedRefused monitor update may carry forwarded HTLC preimage, creating risk of inconsistent state across restartAsynchronous persistence tracking gap for refused updates
This commit only adds and modifies test code in rust-lightning. It expands test coverage for a specific edge case in Lightning channel splicing: when a splice transaction gets confirmed before both peers have finished exchanging signatures…
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…
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
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
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.
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 …
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…
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
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
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
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
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`
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
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
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
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
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…
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
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 …
Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.
Lower-prioritySend splice_locked for promoted splice on reconnectby Wilmer Paulino · 294fbbae · Jun 9, 2026 · 2 filesMessage 73 · AdequateModerate 53Details
Commit message · Wilmer Paulino
Send splice_locked for promoted splice on reconnect
When a splice confirms after our `channel_reestablish` was generated and sent, but prior to processing the counterparty's, we may promote the splice and clear `pending_splice`. In such cases, we're still required to send an explicit `splice_locked` as the `channel_reestablish` we sent did not consider the splice confirmation.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Moderate 53/100
This commit fixes a protocol edge case in Lightning splicing. If a splice transaction confirmed at just the wrong moment—after one peer sent a channel-reestablish message but before it received the other peer's—the node could promote the new splice funding state internally but forget to send the required follow-up 'splice_locked' message. Without that message, the counterparty would not know the splice was active on this side, potentially leaving the channel in an inconsistent or stuck state. The fix adds a fallback that sends splice_locked in that reconnect scenario, plus a regression test.
Lower-priorityReject quantity of 0 for offers with bounded quantityby Jeffrey Czyz · 76201243 · Jun 9, 2026 · 2 filesMessage 85 · StrongLow 41Details
Commit message · Jeffrey Czyz
Reject quantity of 0 for offers with bounded quantity
An offer advertising Quantity::Bounded expects at least one item, but is_valid_quantity accepted a quantity of 0 since it only checked the upper bound. Require the quantity to be greater than 0 so that an invoice request for 0 items is rejected as an InvalidQuantity.
Co-Authored-By: Claude <noreply@anthropic.com>
85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 41/100
This commit fixes a validation bug in rust-lightning's BOLT12 offer handling. An offer that says 'buy up to N items' was accidentally accepting requests to buy 0 items, which is meaningless and could let someone request an invoice for nothing. The fix now rejects zero-quantity requests for bounded-quantity offers, matching the intended behavior.
Lower-priorityPrefer outbound_scid_alias over short_channel_id in get_outbound_payment_scidby Alkamal01 · 59fd10ce · Jun 9, 2026 · 7 filesMessage 73 · AdequateLow 46Details
Commit message · Alkamal01
Prefer outbound_scid_alias over short_channel_id in get_outbound_payment_scid
With splicing, the real SCID changes when a splice confirms while the outbound_scid_alias remains stable. Prefer alias-first in get_outbound_payment_scid so routes built before a splice confirmation stay valid after.
Also fix route direction in fail_splice_on_tx_complete_error and update onion_route_tests comment to state intent rather than describe change.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 46/100
This commit changes how Lightning payment routes pick the identifier used for the first hop of an outbound payment. Previously the real channel ID was preferred; now a stable alias is preferred. The goal is to keep routes valid when a channel is 'spliced' (its on-chain funding transaction changes), because the real ID changes after a splice while the alias stays the same. The change is framed as a robustness improvement, not a security fix, though it can prevent payment failures and related error-handling edge cases.
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 34/100
This commit fixes a copy/paste typo in a deserialization routine. The code was preallocating a HashMap using the wrong length variable, which could cause either excessive memory allocation or insufficient preallocation when loading on-chain transaction data. The actual loop that reads entries still uses the correct length, so the functional behavior is mostly unchanged, but the preallocation amount could be manipulated by an attacker crafting input data.
Lower-priorityStop using an introduction node in blinded message pathsby Matt Corallo · 8c08a306 · Jun 8, 2026 · 2 filesMessage 73 · AdequateLow 40Details
Commit message · Matt Corallo
Stop using an introduction node in blinded message paths
lnd is preparing to ship a release with opt-in onion messages without support for forwarding onion messages from non-channel peers. This breaks the common BOLT 12 OM flow today where we direct-connect to the blinded path introduction point and send the `invoice_request` without a channel. For CLN it turns out this is fine as they never select a peer for their introduction point at all. However, for LDK this would break existing nodes as nodes might now pick an lnd peer as an introduction node but it won't forward the onion message.
For now, we just drop the separate introduction point selection and just always use ourselves as an introduction point (assuming we're an announced node).
This should also have the side-effect of making offers marginally more robust, which may be worth it, even if it sucks to drop any pretense of privacy.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 40/100
This commit changes how LDK creates hidden ("blinded") messaging paths for BOLT 12 offers. Previously, LDK tried to pick a well-connected peer as an "introduction node" to receive messages on your behalf, which improved privacy. Because lnd nodes will soon refuse to forward such messages from peers without a channel, LDK now always uses the offer creator itself as the introduction node (if publicly announced). This avoids broken offers but reduces privacy. It is a compatibility/reliability fix, not a patch for an active exploit.
Lower-prioritySet PaymentSent::fee_paid_msat in abandoned caseby Valentine Wallace · 3e9e6e93 · Jun 8, 2026 · 4 filesMessage 68 · AdequateInformational 23Details
Commit message · Valentine Wallace
Set PaymentSent::fee_paid_msat in abandoned case
If an outbound payment was abandoned with htlcs in-flight and later claimed, we would previously have the PaymentSent::fee_paid_msat be set to None. This contradicted some docs on the event that stated the field would always be Some after 0.0.103.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 23/100
This commit fixes a small bookkeeping bug in the Lightning Dev Kit. When a user abandoned an in-flight payment but the payment still succeeded later, the reported fee field was incorrectly left blank (None), even though the documentation promised it would always be filled in for newer versions. The patch preserves the fee amount when a payment is abandoned so it can still be reported correctly if an HTLC later succeeds. There is no direct security vulnerability here—no funds are stolen, lost, or incorrectly routed—but it removes a contradiction between documented behavior and actual behavior that downstream software might rely on.
Prior to supporting RBF, we would avoid persisting `FundedChannel::pending_splice` when there was a pending funding negotiation that could not be resumed on channel reestablishment. With the addition of RBF support, this would cause our previously negotiated splices (but still pending) to be dropped unintentionally.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Moderate 55/100
This commit fixes a bug in the Lightning Dev Kit where restarting a node during a certain type of funding negotiation (RBF splice) could accidentally throw away already-agreed splice candidates. Previously, the code avoided saving incomplete negotiations on reload, but with RBF support that also dropped earlier negotiated splice states that the channel monitor was still tracking. The fix separates the live negotiation state from the negotiated candidates during serialization, so reload cancels only the in-flight negotiation while preserving the prior candidate. The bug is a state-consistency/data-loss issue rather than a direct theft vector, but it could disrupt channel operation or funds availability after a restart.
Lower-priorityAdd async migratable filesystem storesby Elias Rohrer · 94cff3be · Jun 3, 2026 · 4 filesMessage 78 · AdequateInformational 17Details
Commit message · Elias Rohrer
Add async migratable filesystem stores
Allow the filesystem stores to use the async migration helper and cover both store versions with async migration tests.
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 17/100
This commit adds new async (non-blocking) versions of existing filesystem data migration helpers for two versions of the Lightning Dev Kit persistence store. It mostly moves existing synchronous key-listing code into a shared helper and wraps it in an async task when the tokio feature is enabled. There is no obvious security bug introduced; it is a feature/refactoring change with added test coverage.
Lower-priorityAdd async migratable KV store migration APIby Elias Rohrer · 9b11fdad · Jun 3, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Elias Rohrer
Add async migratable KV store migration API
Expose an async migratable KV store trait and async migration helper so async stores can migrate data without using the synchronous API.
Co-Authored-By: HAL 9000
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100
This commit adds a new async-capable API for migrating key-value store data in the Lightning Dev Kit Rust library. It is a feature addition that lets asynchronous storage backends copy their data without falling back to synchronous calls. There is no indication in the commit that this fixes a security bug or introduces a vulnerability.
Lower-priorityRename migratable KV store trait for sync APIby Elias Rohrer · 4060b623 · Jun 3, 2026 · 4 filesMessage 68 · AdequateInformational 15Details
Commit message · Elias Rohrer
Rename migratable KV store trait for sync API
Prepare the migration API naming for an async variant by giving the existing synchronous trait an explicit Sync suffix.
Co-Authored-By: HAL 9000
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100
This commit is a simple rename of a Rust programming interface (trait) from MigratableKVStore to MigratableKVStoreSync. It only changes names to make room for a future asynchronous version. No behavior, logic, or security properties of the code are changed.
Add AGENTS.md as a symlink to CLAUDE.md so Codex can load the same repository guidance.
43/100 · ThinMessage clarity
✓ Subject identifies a change✓ Provides an explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100
This commit adds a symbolic link named AGENTS.md that points to an existing file called CLAUDE.md. It is purely a repository documentation/AI-agent guidance change and does not modify any code, configuration, or security-sensitive files.
Add a writeable TLV helper macro that emits both write and serialized_length from the same field list. Reuse the shared TLV length helper from impl_ser_tlv_based so the generated read/write path and the new custom-read path stay aligned.
Use the new helper for the hot channel funding and commitment transaction TLV writers while leaving their custom read implementations unchanged.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 13/100
This commit is a code cleanup and performance improvement. It introduces a new Rust macro that automatically generates both the 'write' and 'serialized_length' functions for certain data structures from a single field list. Previously, these two functions were written separately, which made it easier for them to become inconsistent. The change applies this new macro to hot-path channel funding and commitment transaction serialization, but leaves the corresponding read/deserialization code untouched. There is no indication of a security bug being fixed.
Add direct serialized length implementations for common serialization wrappers. This avoids routing field payload length calculations through in-memory writers for common nested serialization paths used by the existing TLV length helpers.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100
This commit adds faster, direct ways to calculate how many bytes certain data wrappers will take up when serialized. Previously, these lengths were sometimes computed by actually writing the data to a temporary in-memory buffer and measuring the result. The change avoids that extra work for common wrapper types like references, boxed values, optional values, and length-prefixed collections. It is a performance and code-quality improvement, not a fix for a known security vulnerability.
Rename TLV macros that generate both Readable and Writeable impls to use the impl_ser_tlv_based prefix. Keep the MaybeReadable upgradable enum helpers and shared write-only enum helper under writeable naming so macro names match the traits they generate.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
cryptography-sensitive pathsigning or wallet path
AI analysis · Informational 15/100
This commit is a pure code cleanup: it renames internal Rust macros from impl_writeable_tlv_based* to impl_ser_tlv_based* across many files. The generated serialization and deserialization code is unchanged, so there is no functional or security impact.
FilesystemStoreV2 already rejected v1 data when a key file was found at the store root, but it did not inspect namespace directories. This missed v1 layouts such as primary/key, where v2 expects primary to contain secondary namespace directories.
For example, an ldk-node store can contain a BDK descriptor below a namespace directory. The previous check would accept that directory as v2 data because the root contained only directories, leaving the incompatible descriptor file undetected.
80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 26/100
This commit tightens a safety check in a new version of Lightning Dev Kit's file-based storage. The new store (v2) organizes data into folders-within-folders. Previously, it only rejected old v1 data if a stray file sat directly in the root folder, but it missed cases where an old-style file sat one folder deeper. That could let an incompatible v1 data file hide inside what looked like a valid v2 namespace folder, potentially causing confusion or data corruption when the v2 store later tries to use that folder as a namespace. The fix now scans one level deeper and refuses to open the store if it finds such files.
Lower-priorityDon't validate a splice if updates are pendingby Leo Nash · bda8e69e · May 29, 2026 · 2 filesMessage 68 · AdequateLow 43Details
Commit message · Leo Nash
Don't validate a splice if updates are pending
`FundedChannel::get_next_splice_out_maximum` is called in `FundedChannel::splice_channel`, which can be called when updates are pending in the channel.
If this is the case, `FundedChannel::get_next_splice_out_maximum` may report a value that is not yet valid on both commitments, and thus fails `FundedChannel::validate_splice_contributions`. That value will nonetheless be valid on both commitments once the updates are cleared from the channel, and splice negotiation actually begins.
So, we now validate `FundedChannel::get_next_splice_out_maximum` with `FundedChannel::validate_splice_contributions` only if there are no pending updates in the channel.
Joost and Wilmer's fuzzing runs caught this discrepancy.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
defensive validationfuzzing or regression evidence
AI analysis · Low 43/100
This commit fixes a bug in the Lightning Dev Kit where a proposed channel splice could be incorrectly rejected when there were still unconfirmed updates (like HTLC fulfillments) pending in the channel. The fix skips an internal consistency check in that specific situation, because the check would compare numbers that are temporarily out of sync but will match once the pending updates clear. The bug was found by the developers' own fuzzing, not by an external security researcher.
Add an environment-variable switch that lets stdin fuzz targets use the dev-null test logger. This keeps direct invocations verbose by default, while external runners can opt into quieter passing-case replays.
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 evidencesigning or wallet pathboot or update pathauthentication pathparser or protocol path
AI analysis · Informational 15/100
This change is a developer convenience tweak for the project's internal fuzz-testing programs. It adds an environment variable switch (LDK_FUZZ_SUPPRESS_LOGS) that lets automated fuzzing runs stay quiet, while keeping normal manual runs verbose. It does not touch any production Lightning node code, wallet logic, or network handling, and it does not fix or introduce any security vulnerability.
✓ Subject identifies a change✓ Mentions testing or verification! No meaningful explanatory body! Opaque security-relevant change
Why it was queued
fuzzing or regression evidencecryptography-sensitive path
AI analysis · Informational 15/100
This commit only fixes compiler warnings that appear when building the project's fuzzing test harness. It removes one unused import, narrows three conditional compilation flags so they don't conflict during fuzz builds, and reduces the visibility of one internal encryption helper from public to crate-internal. None of these changes affect runtime behavior or fix any security vulnerability.
This removes the temporary cfg flag that was added while the splice fuzzer was broken. We also include coverage for the newly supported async signing of a splice's shared input.
78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
signing boundaryfuzzing or regression evidence
AI analysis · Informational 15/100
This commit re-enables an existing fuzz test for a feature called 'splicing' and adds test coverage for one more signer operation. It only changes test/fuzzing code, not the production Lightning protocol code that real users run. There is no indication it fixes a security bug or changes runtime behavior.
Lower-priorityManually exit quiescence in fuzzing upon disconnectby Wilmer Paulino · 90621cfc · May 22, 2026 · 1 fileMessage 83 · StrongInformational 16Details
Commit message · Wilmer Paulino
Manually exit quiescence in fuzzing upon disconnect
In certain cases, we may need to terminate quiescence as a result of some error via a `ChannelError::WarnAndDisconnect`. We don't need to necessarily reconnect the peers, so we choose to manually terminate quiescence via the existing `ChannelManager::exit_quiescence` test helper.
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 16/100
This commit changes only a fuzzing test harness (chanmon_consistency.rs). It updates how the test handles peer-disconnect errors so that, when a disconnect happens during a quiescent (splice-related) state, the test manually clears that quiescent state on both sides. This is a test-only fix to prevent fuzzing false-positives; it does not change production code or fix a real-world security vulnerability.
Security candidateUnify and simplify the application of simple chacha20 passesby Matt Corallo · 4fac0fe1 · May 22, 2026 · 3 filesMessage 73 · AdequateInformational 17Details
Commit message · Matt Corallo
Unify and simplify the application of simple chacha20 passes
Most of our `chacha20` calls don't actually care about the concept of ChaCha20's "seek" vs "nonce" - we just want to use the full 128 bits of nonce space as nonce. Here we unify those calls to keep a consistent API and consolidate the `unwrap`s to one place.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
cryptography-sensitive pathsigning or wallet path
AI analysis · Informational 17/100
This commit is a code cleanup: it moves repeated ChaCha20 encryption calls into a single helper function without changing the underlying math or behavior. There is no indication it fixes a security bug or introduces a new vulnerability.
Security candidateEncrypt `payment_metadata` when we build the payment secretby Matt Corallo · 38552522 · May 22, 2026 · 11 filesMessage 85 · StrongLow 34Details
Commit message · Matt Corallo
Encrypt `payment_metadata` when we build the payment secret
In 657ac8f58e51af74c610375cb65cdad6f7a18c6b we started committing to the `payment_metadata` in the `payment_secret`. We'd largely assumed that downstream code could simply encrypt the `payment_metadata` itself before passing it to `lightning` and decrypt before reading it from `lightning`. However, this presents a challenge - we'd very much love for that downstream code to avoid adding any extra bytes to its `payment_metadata` if at all possible, but it doesn't have a great way to get a decent IV without simply shoving it in the encrypted `payment_metadata`.
Instead, here, we encrypt and decrypt the `payment_metadata` internally in `lightning`. This allows us to reuse the IV that is used for `lightning`-generated `payment_hash`es as the IV for the encrypted `payment_metadata` as well. Sadly, we don't have any similar IV for user-provided `payment_hash`es. In that case, we simply accept the limitations and document that users must avoid encrypting multiple `payment_metadata`s for payments with the same `payment_hash`. This avoids padding the size of the `payment_metadata` and should generally not be a material concern - `payment_hash` reuse should generally not exist anyway, and if it does it should only be in cases where its "the same payment" being retried after failure, at which point `payment_metadata` should hopefully be the same.
85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
cryptography-sensitive path
AI analysis · Low 34/100
This commit changes how Lightning Dev Kit handles optional extra data attached to incoming payments (called payment_metadata). Previously, LDK expected downstream applications to encrypt that data themselves before handing it to LDK. Now LDK encrypts and decrypts it internally, reusing random values already generated for payment secrets. The goal is to avoid making invoices larger by adding separate encryption overhead. For payments where the user supplies their own payment hash, a fresh random value is appended to the encrypted metadata, with a documented warning that reusing the same payment hash with different metadata is unsafe. The change is a privacy/usability improvement, not a fix for an active vulnerability, and it includes new tests covering the three ways metadata can be created.
Stamp pending payments with the first manager generation.
On deferred reload, drop payments born after the loaded snapshot.
This keeps tracker state aligned with explicit persistence.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 17/100
This commit changes an internal fuzz-testing harness (a tool used to automatically find bugs during development), not the production Lightning node code that users run. It adds bookkeeping so the test harness can track which simulated payments were created before or after a saved snapshot of node state. When the harness reloads an older snapshot, it now discards payments that were born after that snapshot, keeping the test's internal tracking consistent. There is no direct security fix to real user funds here.
Pending and resolved payment state are updated the same way.
The owner of that state now owns the helper methods.
68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100
This is a code cleanup change inside a fuzz-testing file. It moves some bookkeeping helper methods from one struct to another without changing what the code actually does. There is no user-facing or security-relevant change.
Skip ChannelManager persistence for message-only monitor completions
When process_pending_monitor_events processes only Completed events and the resulting work is limited to message-only monitor completion handling, ChannelManager persistence can be skipped.
Completion handling now reports whether it actually mutated ChannelManager state, and process_pending_monitor_events uses that to decide between SkipPersistHandleEvents and DoPersist.
73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 22/100
This change is an internal performance optimization for the Lightning Dev Kit (LDK). It reduces unnecessary disk writes by skipping ChannelManager persistence when a monitor completion event only produces messages and does not change any important channel state. The commit does not fix a vulnerability and does not change protocol behavior; it only changes when the software decides to save data to disk.