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
225commits · 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 36 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-priorityplugins/bkpr/test/run-recorder: don't hand NULL cmd.by Rusty Russell · 66741dda · Aug 19, 2025 · 1 fileMessage 75 · AdequateInformational 15Details
Commit message · Rusty Russell

plugins/bkpr/test/run-recorder: don't hand NULL cmd.

ubsan complains that we declared a function not to take NULL.

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 is a fix inside a test program for the bookkeeping plugin. The test was passing NULL (an empty pointer) to functions that are declared to never accept NULL, which caused the Undefined Behavior Sanitizer (UBSan) to complain during testing. The change creates a dummy command object and passes it instead. It does not affect the actual Core Lightning node software that users run.

Lower-prioritybkpr: restore run-recorder.by Rusty Russell · f8a44d91 · Aug 19, 2025 · 4 filesMessage 58 · ThinInformational 13Details
Commit message · Rusty Russell

bkpr: restore run-recorder.

This requires us to turn "sql" calls into calls to a local db, which
means pulling in a lot of infrastructure. But it's possible.

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

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
AI analysis · Informational 13/100

This commit restores a bookkeeping plugin test that had been disabled. It adds a new test file that exercises account, chain-event, channel-event, and on-chain-fee recording logic against a temporary local SQLite database. The changes are confined to test code and build files; no production plugin or node logic is modified.

Lower-prioritypytest: restore bookkeeper to recover tests.by Rusty Russell · 12e2f58e · Aug 19, 2025 · 1 fileMessage 70 · AdequateInformational 15Details
Commit message · Rusty Russell

pytest: restore bookkeeper to recover tests.

Now handles when we remove the db.

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

70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only changes test code. It removes temporary workarounds that disabled the 'bookkeeper' plugin during three recovery-related tests, because the underlying code now handles database removal correctly. There is no change to production code and no security issue is introduced or fixed here.

Lower-prioritybookkeeper: remove database.by Rusty Russell · 41ac9db7 · Aug 19, 2025 · 9 filesMessage 58 · ThinInformational 15Details
Commit message · Rusty Russell

bookkeeper: remove database.

Changelog-Changed: Plugins: `bookkeeper` now uses the lightningd database, not "accounts.db".
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit removes the bookkeeper plugin's private SQLite database (accounts.db) and switches it to use the main lightningd database instead. It is a code cleanup/refactoring change, not a security fix. There is no evidence in the commit of a vulnerability being patched.

Lower-prioritybkpr: remove missing event handling.by Rusty Russell · 87487558 · Aug 19, 2025 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Rusty Russell

bkpr: remove missing event handling.

There will be no more missing events (and at initialization time, we will do
that as a migration).

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 commit removes a large chunk of fallback code in the bookkeeper plugin that tried to reconstruct missing channel-opening events by calling `listpeerchannels`. The author says missing events will no longer happen because they will be handled as a database migration at initialization. It is a cleanup/refactoring change, not a fix for an exploitable vulnerability.

Lower-prioritybkpr: helpers to query sql plugin for chainmoves and channelmoves.by Rusty Russell · 45e860ad · Aug 19, 2025 · 6 filesMessage 73 · AdequateInformational 15Details
Commit message · Rusty Russell

bkpr: helpers to query sql plugin for chainmoves and channelmoves.

We're going to be using this instead of our internal db.

I also made json_out_obj() take the str arg, as it didn't and I
expected it to.

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 commit adds bookkeeping helpers that let the bkpr plugin ask the separate sql plugin for transaction data instead of using its own internal database. It also fixes a memory-handling quirk in a shared JSON helper so it can accept strings that are marked as 'take ownership' (TAKES). The commit itself is a feature/refactoring change; it does not fix a known vulnerability and does not claim to be security-relevant.

Lower-prioritybookkeeper: call refresh before processing any commands.by Rusty Russell · f50ceb4c · Aug 19, 2025 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Rusty Russell

bookkeeper: call refresh before processing any commands.

Rearrange all the JSON interfaces to call refresh_moves() (async)
before doing anything.

This does nothing for now, but it will be useful once we transition
from notifications to using the list commands.

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 routine internal refactoring of the Core Lightning bookkeeper plugin. It changes when the plugin refreshes its internal records so that refresh happens before handling user commands, rather than relying on notifications. The commit message explicitly says this currently does nothing functional and is preparation for a future change. There is no security issue visible in the code.

Lower-priorityplugins/bkpr/test/run-recorder: remove.by Rusty Russell · 9cc08bf0 · Aug 19, 2025 · 1 fileMessage 78 · AdequateInformational 15Details
Commit message · Rusty Russell

plugins/bkpr/test/run-recorder: remove.

It's a great test, but it's very hard to simulate now we are going to be
going from the internal db.

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

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

This commit simply deletes a single test file for the bookkeeper plugin. It removes a unit test that was difficult to maintain after an internal database change. There is no change to production code, no bug fix, and no security-related content.

Lower-prioritybkpr: send a backtrace if we get a fatal db event.by Rusty Russell · b7e95e49 · Aug 19, 2025 · 3 filesMessage 73 · AdequateInformational 18Details
Commit message · Rusty Russell

bkpr: send a backtrace if we get a fatal db event.

Particularly useful if we do something outside a transaction if I mess
up the code, e.g:

```
bookkeeper: Attempting to prepare a db_stmt outside of a transaction: plugins/bkpr/recorder.c:591 (version v25.05-112-g4daf355-modded)
0x5caefda2414b send_backtrace
common/daemon.c:33
0x5caefda08a30 db_error
plugins/bkpr/db.c:133
0x5caefda4cb32 db_fatal
db/utils.c:322
0x5caefda4cc9e db_prepare_v2_
db/utils.c:103
0x5caefda0dcbe get_chain_events_by_id
plugins/bkpr/recorder.c:591
0x5caefda063ce json_edit_desc_payment_id
plugins/bkpr/bookkeeper.c:550
0x5caefda13ad3 ld_command_handle
plugins/libplugin.c:2185
0x5caefda13d27 ld_read_json_one
plugins/libplugin.c:2274
0x5caefda13dba ld_read_json
plugins/libplugin.c:2294
0x5caefdab5478 next_plan
ccan/ccan/io/io.c:60
0x5caefdab5949 do_plan
ccan/ccan/io/io.c:422
0x5caefdab5a06 io_ready
ccan/ccan/io/io.c:439
0x5caefdab7375 io_loop
ccan/ccan/io/poll.c:455
0x5caefda1420c plugin_main
plugins/libplugin.c:2507
0x5caefda07762 main
plugins/bkpr/bookkeeper.c:2048
0x79a7c522a1c9 __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x79a7c522a28a __libc_start_main_impl
../csu/libc-start.c:360
0x5caefda00374 ???
???:0
0xffffffffffffffff ???
???:0
Attempting to prepare a db_stmt outside of a transaction: plugins/bkpr/recorder.c:591
```

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

This change only adds a diagnostic backtrace printout when the bookkeeper plugin hits a fatal database error. It does not fix a vulnerability or change any security boundary; it is a debugging aid for developers.

Lower-prioritybkpr: forward utxo_deposit / utxo_spend notifications to new injectutxodeposit / injectutxospend calls.by Rusty Russell · 1f790525 · Aug 19, 2025 · 3 filesMessage 73 · AdequateInformational 20Details
Commit message · Rusty Russell

bkpr: forward utxo_deposit / utxo_spend notifications to new injectutxodeposit / injectutxospend calls.

And thus we absorb them as normal when they come back as "foreign" entries.

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 commit refactors the Core Lightning bookkeeper plugin so that incoming 'utxo_deposit' and 'utxo_spend' notifications are forwarded to new internal 'injectutxodeposit' / 'injectutxospend' RPC calls, then reprocessed as ordinary 'foreign' chain events. It is a code-cleanup and consistency change; it does not by itself introduce or fix a clear security vulnerability, though it changes how injected transactions are recorded and tagged.

Lower-prioritycommon: use "foreign" in extra_tags to indicate a chain movement is injected.by Rusty Russell · 78f88c1c · Aug 19, 2025 · 6 filesMessage 73 · AdequateInformational 17Details
Commit message · Rusty Russell

common: use "foreign" in extra_tags to indicate a chain movement is injected.

This allows the bookkeeper plugin to know it's not actually a channel account.

Remove the "ignored" tag from the schema too: we removed it previously.

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

This change is a bookkeeping cleanup, not a security fix. It adds a new 'foreign' label to internal records that track on-chain money movements that don't belong to a Lightning channel account. It also removes an obsolete 'ignored' label from documentation and schemas. There is no indication this patch fixes an exploitable vulnerability.

Lower-prioritybkpr: add in-mem & datastore storage for external blockheights.by Rusty Russell · c5e359c7 · Aug 19, 2025 · 8 filesMessage 73 · AdequateInformational 17Details
Commit message · Rusty Russell

bkpr: add in-mem & datastore storage for external blockheights.

We won't be able to "UPDATE chain_events", so keep a separate record
of these blockheights, and lookup that when the blockheight is 0.

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

This commit changes the bookkeeper plugin so it no longer updates existing on-chain event records when it learns a transaction's real block height. Instead, it stores those heights in a separate in-memory hash table and the node's datastore. This is a bookkeeping refactor, not a security fix. There is no direct evidence in the commit that it addresses an exploitable vulnerability.

Lower-prioritybkpr: use the in-memory event descriptions, not the database ones.by Rusty Russell · af2e4034 · Aug 19, 2025 · 9 filesMessage 73 · AdequateInformational 18Details
Commit message · Rusty Russell

bkpr: use the in-memory event descriptions, not the database ones.

The new access APIs are more symmetrical:

1. edit_utxo_description -> add_utxo_description
2. add_payment_hash_desc -> add_payment_hash_description

And to read it, instead of accessing ->ev_desc (now removed) we use
chain_event_description() & channel_event_description(), threading bkpr though
as needed.

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

This commit refactors the bookkeeper plugin so that event descriptions (like invoice memos or user-edited notes) are kept in memory and looked up on demand, instead of being copied into and out of the database on every chain/channel event. It removes the old `ev_desc` database column usage, renames a couple of internal functions for consistency, and adds helper functions to fetch descriptions when needed. There is no obvious security vulnerability here; it is a code-quality and data-model cleanup.

Lower-prioritybookkeeper: use modern plugin_get_data() instead of globals.by Rusty Russell · c00d12fa · Aug 19, 2025 · 1 fileMessage 73 · AdequateInformational 13Details
Commit message · Rusty Russell

bookkeeper: use modern plugin_get_data() instead of globals.

Slightly neater as we expand this, but also handles memleak natively!

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 a routine internal cleanup in the bookkeeper plugin. It replaces old global variables with a modern plugin data structure and removes a manual memory-leak workaround. There is no visible security bug being fixed and no change to user-facing behavior.

Lower-prioritybkpr: pass bkpr struct into all functions in recorder.c.by Rusty Russell · e28443ed · Aug 19, 2025 · 7 filesMessage 65 · AdequateInformational 15Details
Commit message · Rusty Russell

bkpr: pass bkpr struct into all functions in recorder.c.

We want to access it in stmt2chain_event, so plumb it through.

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 straightforward internal code cleanup in the bookkeeper plugin. It changes many functions so they receive a single 'bkpr' bookkeeping structure instead of just the database handle. The goal stated in the commit message is to make the 'bkpr' structure available inside one helper function (stmt2chain_event) for future use. No security bug is fixed here and no externally visible behavior changes.

Lower-prioritybkpr: expose `struct bkpr` to outside bookkeeper.c.by Rusty Russell · 41856dc6 · Aug 19, 2025 · 3 filesMessage 73 · AdequateInformational 15Details
Commit message · Rusty Russell

bkpr: expose `struct bkpr` to outside bookkeeper.c.

We're going to add more members here, so we will start handing around
the whole thing.

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 commit is a routine code cleanup in the bookkeeper plugin of Core Lightning. It moves an internal data structure definition from a source file into a new header file so other parts of the code can use it later. There is no functional change, no bug fix, and no security relevance visible in the diff.

Lower-prioritybkpr: strings in structures should be const.by Rusty Russell · 030863d1 · Aug 19, 2025 · 9 filesMessage 60 · AdequateInformational 15Details
Commit message · Rusty Russell

bkpr: strings in structures should be const.

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

60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 15/100

This commit only adds the 'const' keyword to string pointers in the bookkeeping plugin's data structures and function signatures. It does not change program logic, fix a crash, or address any security vulnerability. It is a code-quality/correctness change that tells the compiler these strings should not be modified.

Lower-prioritysql: avoid trying to do parallel refreshes.by Rusty Russell · 19dab62d · Aug 19, 2025 · 2 filesMessage 68 · AdequateLow 43Details
Commit message · Rusty Russell

sql: avoid trying to do parallel refreshes.

Simply wait if there's one going already. This is a minor
optimization, but critical for the case where we do partial refreshes
asynchonously (rather than deleting everything and reloading). This
is currently only coinmoves and chainmoves, but the duplicated effort
is a waste everywhere.

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

This change fixes a bug in Core Lightning's SQL plugin where running the same table refresh twice at the same time could cause database errors (duplicate rows) or wasted work. The fix makes later refresh requests wait until the current one finishes, then continue. The commit message calls it a 'minor optimization' but the test shows it previously caused real SQL errors. It is not obviously exploitable by an external attacker, but it could affect reliability or data consistency under concurrent use.

Lower-prioritypytest: test for parallel refresh.by Rusty Russell · 0ff1c7ab · Aug 19, 2025 · 1 fileMessage 78 · AdequateLow 33Details
Commit message · Rusty Russell

pytest: test for parallel refresh.

If we do this, we get a database error (now we try to refresh
intelligently, is this is currently only chainmoves / channelmoves).

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

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Low 33/100

This commit adds a test that demonstrates a bug: when the Core Lightning node's SQL interface is asked to refresh the same internal table from multiple requests at the same time, it can hit a database uniqueness error. The test is marked as expected to fail for now, so it documents the problem rather than fixing it. It appears to be a reliability issue in the SQL plugin's refresh logic rather than a security vulnerability that can be exploited by an attacker.

Lower-prioritybkpr: infrastructure to keep rebalance pairs in mem & datastore.by Rusty Russell · 6dcc5806 · Aug 19, 2025 · 4 filesMessage 65 · AdequateInformational 15Details
Commit message · Rusty Russell

bkpr: infrastructure to keep rebalance pairs in mem & datastore.

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 commit adds bookkeeping infrastructure inside the Core Lightning bookkeeper plugin to remember pairs of related on-chain movements called 'rebalances.' It stores each pair both in memory (a hash table) and persistently in the node's datastore. There is no user-facing behavior change or security fix visible in this patch; it is purely foundational code for a future feature.

Lower-priorityplugins/sql: use `created_index` as primary key, where available.by Rusty Russell · 3ae22254 · Aug 19, 2025 · 4 filesMessage 85 · StrongInformational 18Details
Commit message · Rusty Russell

plugins/sql: use `created_index` as primary key, where available.

It's a unique integer, and very useful for querying changes. Unlike
our generated rowid, it's *stable* across queries.

We still need an explicit rowid column for list commands which don't
(currently) have this.

Here's the documentation diff:

@@ -85,69 +85,69 @@
TABLES
------

-Note that the first column of every table is a unique integer called `rowid`: this is used for related tables to refer to specific rows in their parent. sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key.
+Note that tables which have a `created_index` field use that as the primary key (and `rowid` is an alias to this), otherwise an explicit `rowid` integer primary key is generated, whose value changes on each refresh. This field is used for related tables to refer to specific rows in their parent. (sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key).

The following tables are currently supported:
- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))
@@ -119,14 +119,14 @@
- `payment_id` (type `hex`, sqltype `BLOB`)

- `chainmoves` indexed by `account_id` (see lightning-listchainmoves(7))
- - `created_index` (type `u64`, sqltype `INTEGER`)
+ - `created_index` (type `u64`, sqltype `INTEGER PRIMARY KEY`)
- `account_id` (type `string`, sqltype `TEXT`)
- `credit_msat` (type `msat`, sqltype `INTEGER`)
- `debit_msat` (type `msat`, sqltype `INTEGER`)
- `timestamp` (type `u64`, sqltype `INTEGER`)
- `primary_tag` (type `string`, sqltype `TEXT`)
- related table `chainmoves_extra_tags`
- - `row` (reference to `chainmoves.rowid`, sqltype `INTEGER`)
+ - `row` (reference to `chainmoves.created_index`, sqltype `INTEGER`)
- `arrindex` (index within array, sqltype `INTEGER`)
- `extra_tags` (type `string`, sqltype `TEXT`)
- `peer_id` (type `pubkey`, sqltype `BLOB`)
@@ -139,7 +139,7 @@
- `blockheight` (type `u32`, sqltype `INTEGER`)

- `channelmoves` indexed by `account_id` (see lightning-listchannelmoves(7))
- - `created_index` (type `u64`, sqltype `INTEGER`)
+ - `created_index` (type `u64`, sqltype `INTEGER PRIMARY KEY`)
- `account_id` (type `string`, sqltype `TEXT`)
- `credit_msat` (type `msat`, sqltype `INTEGER`)
- `debit_msat` (type `msat`, sqltype `INTEGER`)
@@ -204,7 +204,7 @@
- `last_stable_connection` (type `u64`, sqltype `INTEGER`)

- `forwards` indexed by `in_channel` and `in_htlc_id` (see lightning-listforwards(7))
- - `created_index` (type `u64`, sqltype `INTEGER`)
+ - `created_index` (type `u64`, sqltype `INTEGER PRIMARY KEY`)
- `in_channel` (type `short_channel_id`, sqltype `TEXT`)
- `in_htlc_id` (type `u64`, sqltype `INTEGER`)
- `in_msat` (type `msat`, sqltype `INTEGER`)
@@ -222,7 +222,7 @@

- `htlcs` indexed by `short_channel_id` and `id` (see lightning-listhtlcs(7))
- `short_channel_id` (type `short_channel_id`, sqltype `TEXT`)
- - `created_index` (type `u64`, sqltype `INTEGER`)
+ - `created_index` (type `u64`, sqltype `INTEGER PRIMARY KEY`)
- `updated_index` (type `u64`, sqltype `INTEGER`)
- `id` (type `u64`, sqltype `INTEGER`)
- `expiry` (type `u32`, sqltype `INTEGER`)
@@ -242,7 +242,7 @@
- `bolt12` (type `string`, sqltype `TEXT`)
- `local_offer_id` (type `hash`, sqltype `BLOB`)
- `invreq_payer_note` (type `string`, sqltype `TEXT`)
- - `created_index` (type `u64`, sqltype `INTEGER`)
+ - `created_index` (type `u64`, sqltype `INTEGER PRIMARY KEY`)
- `updated_index` (type `u64`, sqltype `INTEGER`)
- `pay_index` (type `u64`, sqltype `INTEGER`)
- `amount_received_msat` (type `msat`, sqltype `INTEGER`)
@@ -408,7 +408,7 @@
- `features` (type `hex`, sqltype `BLOB`)

- `sendpays` indexed by `payment_hash` (see lightning-listsendpays(7))
- - `created_index` (type `u64`, sqltype `INTEGER`)
+ - `created_index` (type `u64`, sqltype `INTEGER PRIMARY KEY`)
- `id` (type `u64`, sqltype `INTEGER`)
- `groupid` (type `u64`, sqltype `INTEGER`)
- `partid` (type `u64`, sqltype `INTEGER`)

Changelog-Changed: Plugins: `sql` tables `forwards`, `htlcs`, `invoices`, `sendpays` all use `created_index` as their primary key (and `rowid` is now an alias to this).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

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

This change updates the Core Lightning SQL plugin so that several database tables use a stable, existing identifier (`created_index`) as their primary key instead of a generated `rowid` that changes every time the data is refreshed. This is a data-model improvement, not a security fix, and the commit message and diff do not describe any security issue.

Lower-prioritysql: optimize listchainmoves and listchannelmoves accesses.by Rusty Russell · a36e7794 · Aug 19, 2025 · 2 filesMessage 73 · AdequateInformational 17Details
Commit message · Rusty Russell

sql: optimize listchainmoves and listchannelmoves accesses.

We don't yet do the other list commands, as they are not append-only:
we would need to check deletes and updates.

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

This commit is a performance optimization for the SQL plugin in Core Lightning. It changes how two append-only data lists (chain moves and channel moves) are refreshed, so the plugin only fetches newly created entries instead of re-downloading the entire list every time. The commit message and diff show no security intent, and the change does not appear to introduce a vulnerability. It is a normal feature/optimization patch.

Lower-priorityplugins/sql: add listchainmoves and listchannelmoves.by Rusty Russell · cfbca30b · Aug 19, 2025 · 6 filesMessage 73 · AdequateInformational 15Details
Commit message · Rusty Russell

plugins/sql: add listchainmoves and listchannelmoves.

And note the other commands in See Also section.

Note that this means handling the "outpoint" type.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `sql` plugin now supports `chainmoves` and `channelmoves` tables.

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

This commit adds two new read-only SQL views, chainmoves and channelmoves, to the existing sql plugin. It also adds support for a new 'outpoint' data type (a transaction ID plus output number) and updates documentation and tests. There is no security-relevant change: no new permissions, no parsing of untrusted input beyond what the plugin already handles, and no changes to cryptographic or network code.

Lower-prioritypytest: test listcoinmoves / listchannelmoves during penalties.by Rusty Russell · c0368555 · Aug 19, 2025 · 1 fileMessage 75 · AdequateInformational 15Details
Commit message · Rusty Russell

pytest: test listcoinmoves / listchannelmoves during penalties.

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 a new automated test to the Core Lightning project. It exercises the existing 'listcoinmoves' and 'listchannelmoves' accounting commands during a simulated channel penalty scenario. There is no change to production code, no bug fix, and no security patch.

Lower-prioritypytest: test listcoinmoves / listchannelmoves for unilateral closes.by Rusty Russell · 33ed1eb7 · Aug 19, 2025 · 1 fileMessage 75 · AdequateInformational 14Details
Commit message · Rusty Russell

pytest: test listcoinmoves / listchannelmoves for unilateral closes.

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

This commit only adds new automated tests for existing accounting features. It does not change any production code, so it cannot introduce a security vulnerability or fix one directly. The tests verify that the wallet correctly records coin movements during unilateral channel closes and HTLC timeouts.