EP
← All projectsElements Project

Core Lightning

Modular C implementation of the Lightning Network protocol and node stack.

BitcoinLightning NetworkNormal
Repository coverage

1856 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.

158security candidates263second-pass queue1853AI analyses
140commits · 30 days
227commits · 60 days
803commits · 180 days
1839commits · 365 days
Backfill bands
Aug 5 → Feb 61049 seen37 candidatesComplete
Feb 6 → Jun 6579 seen10 candidatesComplete
Jun 6 → Jul 678 seen1 candidatesComplete
Jul 6 → Aug 5147 seen16 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.

70/100 average clarity
432Strong · 80–100
1164Adequate · 60–79
231Thin · 40–59
29Opaque · 0–39
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
dovgopoly15015164
Rusty Russell95873958072
Sangbida Chaudhuri14731146066
Dusty Daemon771377066
ShahanaFarooqui931093063
daywalker9090589062
Níckolas Goline40540076
Lagrang376476069
Christian Decker36436072
Vincenzo Palazzo838080
Chandra Pratap56256082
ekzyis222063
Analysis record

Published AI watches

Last scanned 55 minutes ago

Informational 15 AI analysisMessage 65 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

Revert "doc: require Homebrew GNU make and gpatch on macOS"

This commit is a simple documentation revert. It undoes a previous change that told macOS users to install GNU make and GNU patch from Homebrew and to put those tools first in their command path. The reverted instructions now omit gpatch a…

0cfa949fby Sangbida Chaudhuri+4−81 file
No security note in commit
Informational 15 AI analysisMessage 75 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

Revert "tests: drop obsolete x-prefix in compacter-slow.sh"

This commit re-adds an old-style 'x' prefix to a string comparison in a test helper script. It is a test-only change with no effect on the actual Core Lightning node software, user funds, network behavior, or security. The change simply re…

116fd7cdby Sangbida Chaudhuri+1−11 file
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

doc: require Homebrew GNU make and gpatch on macOS

This commit only updates macOS installation instructions in the documentation. It tells macOS users to install newer GNU versions of 'make' and 'patch' from Homebrew because Apple's built-in tools are too old for building and running sourc…

d3ff1474by Sangbida Chaudhuri+8−41 file
No security note in commit
Informational 15 AI analysisMessage 83 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

tests: drop obsolete x-prefix in compacter-slow.sh

This commit is a trivial shell script cleanup. It removes an old-fashioned 'x' prefix from a string comparison in a test helper script so that a newer version of the Shellcheck linter stops warning about it. The change does not alter progr…

474c272aby Sangbida Chaudhuri+1−11 file
No security note in commit
Informational 18 AI analysisMessage 65 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

common: hoist amount+currency parsing into common code.

This commit moves existing code that parses payment amounts (Bitcoin millisatoshis, 'any' amount, or fiat currency amounts) from one plugin file into a shared library so it can be reused by a future feature. It is a code refactoring with n…

Refactoring of amount-parsing code into a shared helperAddition of explicit u64 overflow guards (mul_overflows_u64, add_overflows_u64) in the new common codeNo change to wire protocol or RPC interface semantics
e0f86c17by Rusty Russell+112−723 files
No security note in commit
Informational 17 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

lightningd: internal cleanups since all non-command JSON IDs are strings.

This is a routine internal cleanup commit in Core Lightning. It removes an unused helper function and simplifies how JSON-RPC request IDs are stored and formatted, since the project now always uses string IDs for non-command JSON traffic. …

No security-relevant keywords in commit title or messageNo CVE, advisory, or bug reference presentChanges are refactor/cleanup in nature
a70ae963by Rusty Russell+25−378 files
No security note in commit
Informational 15 AI analysisMessage 65 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

common: hoist hash_str helper into its own header.

This commit is a routine code cleanup: it moves a small string-hashing helper function into a shared header file so it can be reused without being copied and pasted. There is no change to behavior, no bug fix, and no security relevance.

581bbb1fby Rusty Russell+16−176 files
No security note in commit
Informational 23 AI analysisMessage 65 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

downgrade: we need to remove "impressions" from askrene datastore when downgrading to v26.06.

This is a database downgrade helper fix, not a live network vulnerability. Core Lightning's downgrade tool previously failed to strip out new 'channel impression' records when rolling a database back to version v26.06. The patch teaches th…

Database downgrade path could leave incompatible records in older schemaOffline tool only; no remote or on-chain triggerFix prevents potential node startup failure after version rollback
4d926285by Rusty Russell+43−111 file
No security note in commit
Low 31 AI analysisMessage 68 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

downgrade tool: fix invalid memory bug

This commit fixes a typo in a database downgrade helper tool. The bug caused the tool to pass a negative number (turned into a huge positive size) when copying data, which led to an out-of-memory (OOM) error. The fix swaps two variable nam…

Integer underflow / negative-to-size_t wrap leading to excessive allocationOut-of-memory crash in maintenance toolMemory corruption potential if allocation somehow succeeded
42995326by Lagrang3+8−81 file
No security note in commit
Informational 24 AI analysisMessage 65 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

xpay: actually tell askrene when a payment succeeded.

This commit fixes a bookkeeping bug in Core Lightning's xpay plugin. Previously, when a payment succeeded, xpay did not tell the askrene routing-helper that the route worked. As a result, askrene kept stale or overly pessimistic ideas abou…

Missing success feedback to routing layer can degrade payment reliabilityStale negative impressions may bias future path selection toward worse or failing routesNo direct funds-loss primitive is introduced or fixed
a66fabd4by Rusty Russell+40−02 files
No security note in commit
Low 49 AI analysisMessage 58 · Thin
EP Elements ProjectCore Lightning BitcoinLightning Network

askrene: correctly order constraints.

This commit fixes a bug in Core Lightning's routing helper (askrene) where two kinds of channel information—hard limits called 'constraints' and usage estimates called 'impressions'—were being applied in the wrong order. Because impression…

Routing decision bug caused by incorrect ordering of time-relative channel statePotential payment failure or acceptance of an over-capacity routeRegression test added demonstrating incorrect route acceptance before fix
4b6fe4a1by Rusty Russell+211−1182 files
No security note in commit
Low 35 AI analysisMessage 68 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

askrene: don't leak channel intel entries

This commit fixes a memory leak in the askrene plugin of Core Lightning. When individual channel intelligence entries were deleted, the code removed the entry from its array but forgot to free two internal pointers (impression and constrai…

Memory leak in plugin data structure cleanupMissing deallocation of nested pointers before array removalFix located in routing/intelligence plugin (askrene)
8891f414by Lagrang3+5−01 file
No security note in commit
Informational 15 AI analysisMessage 70 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

xpay: tests should expect the new error messages

This commit only updates test files so that automated checks expect slightly different error wording from the xpay payment command. It does not change any production code, so it cannot introduce a security vulnerability or fix one on its o…

0b67601fby Lagrang3+24−32 files
No security note in commit
Low 43 AI analysisMessage 65 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

offers: limit invoices to 10 minutes for recurring offers in other currencies.

This change tightens the lifetime of recurring invoices priced in foreign currencies (like USD) to 10 minutes by default, and refreshes them with current exchange rates when they expire. Previously, such invoices could remain valid for the…

Fixes stale exchange-rate exposure for currency-denominated recurring invoicesAdds configurable expiry cap for recurring currency invoicesDistinguishes user-cancellation (0s expiry) from natural expiry to avoid misleading errors
446312cfby Rusty Russell+134−148 files
No security note in commit
Low 45 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

offers: limit expiry to offer limit, or 10 minutes with currency conversion.

This commit tightens the expiration time on invoices created from BOLT12 offers. Previously, all such invoices defaulted to a 2-hour payment window. Now, if the offer has an absolute expiry, the invoice expires when the offer expires; and …

BOLT12 invoice expiry now bounded by offer absolute expiryCurrency-converted invoices use short expiry to limit exchange-rate exposureNew regression test added for expiry behavior
a6cf4915by Rusty Russell+55−22 files
No security note in commit
Low 29 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

fetchinvoice: don't bother with checking recurrence timing.

This commit removes local timing checks in Core Lightning's fetchinvoice plugin for recurring payments. Instead of the plugin refusing too-early or too-late invoice requests, it now lets the remote node decide and report back. The change i…

Removal of local input-validation checks for recurring invoice requestsReliance on remote-party enforcement for recurrence period limits and pay windowsTest expectations changed from local rejection to remote failure messages
3e49d908by Rusty Russell+2−682 files
No security note in commit
Low 32 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

lightningd: don't do previous invoice checking in createinvoicerequest.

This commit removes a local sanity check in Core Lightning's experimental 'createinvoicerequest' command. Previously, when creating a recurring invoice request, the code looked up past payments by label to verify the previous recurrence wa…

Removal of local payment-state validation for recurring invoice requestsParameter rename from recurrence_label to label in internal RPC callsTest expectations changed from local 'previous invoice has not been paid' errors to remote failure messages
4348d8acby Rusty Russell+5−1224 files
No security note in commit
Low 35 AI analysisMessage 65 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

fetchinvoice: handle weird labels in recurrence_label parameter.

This commit fixes how the fetchinvoice plugin handles user-supplied labels that contain special characters such as backslashes, quotes, tabs, and newlines. Previously these labels were passed as raw strings, which could cause JSON encoding…

JSON injection / improper escaping of user-controlled input passed between RPC componentsPotential mismatch between label parsing and label serialization leading to functional failures or unexpected behaviorFix is narrowly scoped to a single plugin and parameter
d7f87f2dby Rusty Russell+37−102 files
No security note in commit
Informational 15 AI analysisMessage 70 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

Add unit tests for str_to_u64

This commit only adds a new automated test file that checks how a helper function (str_to_u64) converts text strings to unsigned 64-bit integers. It does not change any production code, so it cannot by itself introduce a security vulnerabi…

dddb455dby Lagrang3+203−01 file
No security note in commit
Informational 15 AI analysisMessage 78 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

pytest: add tests for what we want askrene to do.

This commit only adds a new pytest test file. It does not change any production code. The test describes desired future behavior for the askrene routing module's error messages when a payment source or destination lacks enough channel capa…

518620aeby Rusty Russell+67−01 file
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.

Lower-prioritylightningd: allow another gossip state transition.by Rusty Russell · c43206e4 · Nov 18, 2025 · 1 fileMessage 81 · StrongInformational 23Details
Commit message · Rusty Russell

lightningd: allow another gossip state transition.

This can definitely happen with zeroconf and the about-to-be-implemented withheld=True:

```
lightningd-1 2025-09-12T13:17:50.848Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: Illegal gossip state transition: CGOSSIP_WAITING_FOR_SCID->CGOSSIP_CHANNEL_UNANNOUNCED_DYING
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
AI analysis · Informational 23/100

This is a small bug-fix patch for Core Lightning's internal channel gossip state machine. It adds one previously missing allowed transition between two internal states, preventing the daemon from logging a 'BROKEN' error and potentially misbehaving when a special type of channel (zeroconf, or soon a 'withheld' funding flow) is closed before the funding transaction is mined. There is no indication this allows an attacker to steal funds or take control; it is a robustness fix for an edge case in protocol handling.

Lower-priorityoffers: make find_best_peer take a feature bitmap.by Rusty Russell · a3441ff2 · Nov 18, 2025 · 4 filesMessage 73 · AdequateInformational 15Details
Commit message · Rusty Russell

offers: make find_best_peer take a feature bitmap.

This means we can ask for more than one required feature at a time.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This is a small internal refactoring change in the Core Lightning 'offers' plugin. It changes one helper function so it can check for multiple peer features at once (using a bitmap) instead of only one feature at a time. The callers are updated to pass their single feature as a bitmap bit. There is no security fix or behavior change visible to users.

Lower-priorityoffers: require opt_onion_message for incoming invoices too. Changelog-Fixed: offers: require peers for blinded paths to have `option_onion_messages`, due to reports of LND not forwarding our blinded payments correctly.by 21M4TW · 29e4c3fe · Nov 18, 2025 · 1 fileMessage 85 · StrongLow 35Details
Commit message · 21M4TW

offers: require opt_onion_message for incoming invoices too.
Changelog-Fixed: offers: require peers for blinded paths to have `option_onion_messages`, due to reports of LND not forwarding our blinded payments correctly.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 35/100

This change tightens which network peers Core Lightning will choose when creating hidden (blinded) payment paths for incoming invoices. Previously it only required support for route blinding; now it also requires support for onion messages. The reason given is that LND nodes were reportedly not forwarding these hidden payments correctly, which could cause payment failures or routing problems. It is a robustness fix rather than a clear-cut security patch, and there is no evidence in the commit of funds being stolen.

Lower-priorityschemas: allow *CLOSED* state in channel_state_changed notification.by Rusty Russell · 64563c51 · Nov 18, 2025 · 2 filesMessage 65 · AdequateInformational 18Details
Commit message · Rusty Russell

schemas: allow *CLOSED* state in channel_state_changed notification.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 18/100

This commit updates two JSON schema files used by Core Lightning to document and validate a notification message. It adds 'CLOSED' as a permitted value for the channel state field in the 'channel_state_changed' notification, along with a note that this value was introduced in version 25.12. There is no code behavior change, no runtime logic change, and no security fix or vulnerability present in the diff.

Lower-prioritypytest: add tests for channel_state_changed into the CLOSED state.by Rusty Russell · 13852b7f · Nov 18, 2025 · 1 fileMessage 75 · AdequateInformational 15Details
Commit message · Rusty Russell

pytest: add tests for channel_state_changed into the CLOSED state.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

75/100 · AdequateMessage clarity
✓ Specific, 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 and adjusts Python test code for the Core Lightning project. It extends existing tests to verify that a 'channel_state_changed' notification is correctly emitted when a payment channel transitions into the CLOSED state. There are no changes to production code, no bug fixes, and no security-sensitive behavior being altered.

Lower-prioritylightningd: deprecate "message": null in channel_state_changed notifications.by Rusty Russell · 7c7f1e42 · Nov 18, 2025 · 6 filesMessage 73 · AdequateInformational 20Details
Commit message · Rusty Russell

lightningd: deprecate "message": null in channel_state_changed notifications.

Somehow I missed this when deprecating `short_channel_id` being null.

Changelog-Deprecated: Plugins: `channel_state_changed` notification `message` field being `null`: it will be omitted instead.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 20/100

This is a routine API cleanup, not a security fix. The commit changes how Core Lightning tells plugins about channel state changes: instead of sending `"message": null` when there is no message, it will eventually stop including the `message` field at all. For now it still sends `null` unless the user has opted into strict 'no deprecated features' mode. The code also removes a general helper for adding `null` values to JSON and adds private copies in two places that still need it temporarily.

AI review queuedlightningd: notify plugins when finalizing channelby Matt Whitlock · cbfe1a99 · Nov 18, 2025 · 8 filesMessage 65 · AdequateInformational 18Details
Commit message · Matt Whitlock

lightningd: notify plugins when finalizing channel

Changelog-Added: Plugins now receive `channel_state_changed` notification upon final change to `CLOSED` state.

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 18/100

This commit adds a new plugin notification so that plugins are told when a Lightning channel finishes closing and reaches the CLOSED state. It also makes the optional human-readable 'message' field in that notification truly optional in the generated API bindings. This is a routine feature addition, not a security fix or vulnerability.

Lower-prioritypytest: Test that we don't try to pay too many htlcs at once through an unknown channel.by Rusty Russell · 145af08f · Nov 17, 2025 · 1 fileMessage 75 · AdequateInformational 12Details
Commit message · Rusty Russell

pytest: Test that we don't try to pay too many htlcs at once through an unknown channel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

75/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Informational 12/100

This commit only adds a new test case to the project's test suite. It does not change any production code. The test checks that the xpay payment feature limits how many simultaneous payment paths it tries to use when one of the channels is unannounced and has a low limit. Because no actual software behavior is changed, this commit by itself does not create or fix a security vulnerability.

Lower-priorityxpay: restrict maxparts to 6 for non-public nodes, but remove it if we can't route.by Rusty Russell · 73147daf · Nov 17, 2025 · 2 filesMessage 81 · StrongLow 34Details
Commit message · Rusty Russell

xpay: restrict maxparts to 6 for non-public nodes, but remove it if we can't route.

This attempts to solve a problem we have with Phoenix clients:

This payment has been split in two many parts by the sender: 31 parts vs max 6 parts allowed for on-the-fly funding.

The problem is that we don't have any way in bolt11 or bolt12 to
specify the maximum number of HTLCs.

As a workaround, we start by restricting askrene to 6 parts if the
node is not openly reachable, and if it struggles, we remove the
restriction. This would work much better if askrene handled maxparts
more completely!

See-Also: https://github.com/ElementsProject/lightning/issues/8331
Changelog-Fixed: `xpay` will not try to send too many HTLCs through unknown channels (6, as that is Phoenix's limit) unless it has no choice
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
AI analysis · Low 34/100

This change adjusts how Core Lightning's xpay plugin splits payments. It limits multi-part payments to 6 pieces when the destination is not publicly known, matching a known limit used by Phoenix wallets. If routing fails with that limit, xpay removes it and retries. Previously, xpay could send too many payment pieces through private channels, causing payments to fail at the recipient. This is a compatibility and reliability fix, not a security vulnerability in the traditional sense, but it prevents a real-world payment failure scenario.

Lower-prioritypytest: test to demonstrate that reservations of "private" channels overlap.by Rusty Russell · da4edd28 · Nov 17, 2025 · 1 fileMessage 75 · AdequateLow 35Details
Commit message · Rusty Russell

pytest: test to demonstrate that reservations of "private" channels overlap.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

75/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Low 35/100

This commit adds a test showing a bug in Core Lightning's routing-reservation system. When two separate routing layers use the same fake channel ID, a reservation made through one layer is incorrectly counted against the other layer too. The test is marked as expected to fail, meaning it documents the bug rather than fixing it. This could cause valid payment routes to be rejected because the system thinks capacity is already reserved when it should not be.

Lower-priorityaskrene: add optional layers to reservations.by Rusty Russell · 1102d806 · Nov 17, 2025 · 15 filesMessage 68 · AdequateLow 28Details
Commit message · Rusty Russell

askrene: add optional layers to reservations.

We have the issue of aliases: xpay uses scids like 0x0x0 for
routehints and blinded paths, and then can apply reservations to them. But
generally, reservations are *global*, so we need to differentiate.

Changelog-Added: Plugins: `askrene-reserve` and `askrene-unreserve` can take an optional `layer` inside `path` elements.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 28/100

This commit adds an optional 'layer' field to the askrene-reserve and askrene-unreserve commands in Core Lightning. The purpose is to let different plugins (like xpay) reserve capacity on fake or aliased channels without their reservations colliding with each other. It is a feature addition that improves correctness of route planning, not a fix for an active security bug.

Lower-priorityxpay: don't place global reservations on generated channels.by Rusty Russell · e5b68cad · Nov 17, 2025 · 1 fileMessage 73 · AdequateLow 49Details
Commit message · Rusty Russell

xpay: don't place global reservations on generated channels.

We generate fake scids for routehints and blinded paths. But then we were
placing reservations on them as if they were global. If there are two xpays
going at once these reservations will clash, even though the same scid refers
to different channels.

Reported-by: @Lagrang3
Changelog-Fixed: xpay: fixed theoretical clash with simultanous payments via routehints and blinded paths.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 49/100

This fix corrects a bug in Core Lightning's 'xpay' plugin where temporary, made-up channel identifiers used for private payment routes (routehints and blinded paths) were being treated as real, globally-known channels. When two payments ran at the same time, they could reserve the same fake identifier and interfere with each other, potentially causing one payment to fail or be delayed. The fix marks these channels as fake and keeps their reservations private to each payment.

Lower-priorityaskrene: implement reduce_num_flows in refine, using increase_flows().by Rusty Russell · 8c7ac33f · Nov 17, 2025 · 4 filesMessage 85 · StrongLow 33Details
Commit message · Rusty Russell

askrene: implement reduce_num_flows in refine, using increase_flows().

Now we simply call it at the end. We need to check it hasn't violated fee maxima, but
otherwise it's simple.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Plugins: `askrene` now handles limits on number of htlcs much more gracefully.

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 33/100

This commit fixes the `askrene` routing plugin in Core Lightning so it respects user limits on how many payment paths (HTLCs) can be used. Previously, when a user set `maxparts` lower than the number of routes the algorithm found, the plugin could fail to find a route or behave poorly. The new code merges excess routes into the largest remaining ones and checks that fees stay within budget. It is a correctness/reliability improvement, not a remote exploit.

Lower-priorityaskrene: clean up renamed functions.by Rusty Russell · a8a6a446 · Nov 17, 2025 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Rusty Russell

askrene: clean up renamed functions.

We added _noidx versions of the sort functions, but now they're the only ones, we can
rename them to the old names.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This is a simple code cleanup: a developer renamed a few internal helper functions by removing the '_noidx' suffix because the older versions no longer exist. The actual behavior of the code is unchanged. There is no security issue here.

Lower-priorityaskrene: remove indexes from refine_flows except for increase_flows()by Rusty Russell · e3dfc020 · Nov 17, 2025 · 1 fileMessage 73 · AdequateInformational 11Details
Commit message · Rusty Russell

askrene: remove indexes from refine_flows except for increase_flows()

This removes the index array from code after increase_flows()m, so we use the flows
array directly.

The next step will be to make increase_flows() use the flows array, and remove the
index array indirection entirely.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 11/100

This is a small internal code cleanup in the askrene routing plugin. It removes an unnecessary intermediate index array in the flow-refinement logic, making the code operate directly on the flows array. There is no indication this fixes a security bug or changes externally observable behavior.

Lower-priorityaskrene: neated flow array handling, by freeing flows we discard.by Rusty Russell · 6e4bc1dd · Nov 17, 2025 · 1 fileMessage 73 · AdequateLow 25Details
Commit message · Rusty Russell

askrene: neated flow array handling, by freeing flows we discard.

Pointed out by @Lagrang3; he's right, while it's a temporary leak the
way we use flows, it's still a trap.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 25/100

This commit fixes a temporary memory leak in the askrene routing plugin of Core Lightning. When the code discarded unused payment routes (called 'flows'), it removed them from a list but forgot to free the memory they occupied. The commit adds a helper function that both removes and frees these discarded flows. The author notes it is a 'temporary leak' and a 'trap' for future developers, not an active security vulnerability.

Lower-priorityaskrene: make increase_flows function more generic.by Rusty Russell · 330f51aa · Nov 17, 2025 · 1 fileMessage 73 · AdequateInformational 23Details
Commit message · Rusty Russell

askrene: make increase_flows function more generic.

Rewrite it, so it properly takes into account interactions between flows
by using reservations.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 23/100

This commit rewrites a routing helper inside Core Lightning's experimental 'askrene' plugin so it correctly accounts for overlapping payment routes when increasing payment amounts. The old code sorted routes and increased each independently, which could ignore shared channel capacity limits. The new code reserves capacity across all routes, picks the route with the most spare capacity, and stops if it cannot meet the target. There is no direct evidence this is a security fix, but incorrect capacity accounting in payment routing can lead to failed routes, stuck payments, or unintended fee/HTLC behavior.

Lower-priorityaskrene: handle maxparts parameter values 1 and 0.by Rusty Russell · 050b149e · Nov 17, 2025 · 1 fileMessage 65 · AdequateLow 28Details
Commit message · Rusty Russell

askrene: handle maxparts parameter values 1 and 0.

For 1, we use single-path. For 0, reject.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Low 28/100

This commit fixes how the askrene routing plugin handles the maxparts parameter. Previously, setting maxparts to 1 did not force single-path routing, and setting it to 0 was accepted even though it makes no sense. Now, maxparts=1 forces single-path routing, and maxparts=0 is rejected with an error. This is a minor correctness and input-validation improvement, not a critical security fix.

Lower-priorityaskrene: remove max_deliverable cache from increase_flows.by Rusty Russell · 31d28bad · Nov 17, 2025 · 1 fileMessage 73 · AdequateInformational 11Details
Commit message · Rusty Russell

askrene: remove max_deliverable cache from increase_flows.

Make it calculate on demand. This will be useful when we call it from elsewhere.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 11/100

This is a small internal code cleanup in Core Lightning's payment routing plugin (askrene). It removes a precomputed cache of maximum deliverable amounts and instead calculates those values on demand. There is no indication this fixes a security bug or changes externally observable behavior.

Lower-priorityaskrene: remove overzealous cache of channel_data.by Rusty Russell · b6c22045 · Nov 17, 2025 · 1 fileMessage 83 · StrongInformational 12Details
Commit message · Rusty Russell

askrene: remove overzealous cache of channel_data.

This is not worth optimizing that I can see. Using a non-debug build I get
the following times for tests/test_askrene.py::test_real_data

Before:
143 seconds

After:
141 seconds.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 12/100

This commit removes a small performance cache from the askrene routing plugin. The author found the cache barely sped up tests, so they simplified the code by recalculating channel values on demand instead of storing them. There is no indication this fixes a security bug; it is a routine code cleanup.

Lower-priorityaskrene: make increase_flows() use the raw flows array.by Rusty Russell · 2735673f · Nov 17, 2025 · 1 fileMessage 65 · AdequateInformational 11Details
Commit message · Rusty Russell

askrene: make increase_flows() use the raw flows array.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 11/100

This is a small internal code cleanup in Core Lightning's payment routing plugin (askrene). It removes an unnecessary index array and makes a function work directly on the list of payment flows. There is no indication this fixes a security bug or changes externally observable behavior.

Lower-priorityaskrene: fix error path if we fail sanity checks.by Rusty Russell · b5b4dbf2 · Nov 17, 2025 · 1 fileMessage 68 · AdequateLow 31Details
Commit message · Rusty Russell

askrene: fix error path if we fail sanity checks.

We've already freed the working_ctx, and the fail path does that again.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 31/100

This commit fixes a programming mistake in Core Lightning's 'askrene' plugin where an error-handling path tried to free memory that had already been freed. Re-freeing the same memory can crash the process or corrupt memory. The fix replaces the shared 'goto fail' path with direct returns so the double-free cannot happen.

Lower-priorityaskrene: Remove index indirection from squash_flows, simplify sorting.by Rusty Russell · 7c7a4f87 · Nov 17, 2025 · 2 filesMessage 73 · AdequateInformational 13Details
Commit message · Rusty Russell

askrene: Remove index indirection from squash_flows, simplify sorting.

We don't need to convert to strings, we can compare directly. This removes the final
use of the index arrays.

This of course changes the order of returned routes, which alters test_real_biases, since
that biases against the final channel in the *first* route.

Took me far too long to diagnose that!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 13/100

This is an internal code cleanup in the askrene routing plugin. It replaces a string-based sorting trick with a direct pointer comparison when merging duplicate payment routes. The only observable effect is that routes come out in a slightly different order, so one test's expected numbers were updated. There is no indication this fixes or introduces a security vulnerability.

Lower-priorityaskrene: use flows array directly in remove_excess.by Rusty Russell · 565a92e8 · Nov 17, 2025 · 1 fileMessage 73 · AdequateInformational 12Details
Commit message · Rusty Russell

askrene: use flows array directly in remove_excess.

We don't need the indexes array, we can use this directly.

We still set up the indexes array (for now) after we call this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 12/100

This is a small internal code cleanup in the askrene routing plugin. It changes one function to sort and modify a list of payment flows directly instead of going through a separate index array. The old index array is still created afterward for other code that still needs it. There is no indication this fixes a security bug or changes user-visible behavior.

Lower-priorityaskrene: remove now-unused bottleneck_idx from flow_max_deliverable.by Rusty Russell · 69adf387 · Nov 17, 2025 · 3 filesMessage 65 · AdequateInformational 15Details
Commit message · Rusty Russell

askrene: remove now-unused bottleneck_idx from flow_max_deliverable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 15/100

This is a routine code cleanup in Core Lightning's payment routing plugin (askrene). It removes an unused output parameter called bottleneck_idx from an internal helper function and its callers. There is no change to behavior, no bug fix, and no security relevance visible in the commit.