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 44 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-priorityrust: Bump cln-plugin==0.5by Christian Decker · 516861c5 · Aug 19, 2025 · 7 filesMessage 72 · AdequateInformational 15Details
Commit message · Christian Decker

rust: Bump cln-plugin==0.5

Due to the breaking change in 9dcc264d4c8e244f0cb827c8a81e61f977011486.

72/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Explains rationale or failure mode
AI analysis · Informational 15/100

This commit is a routine version bump for an internal Rust library (cln-plugin) from version 0.4 to 0.5. It only changes version numbers in package files to match a prior breaking API change. There is no code change, no bug fix, and no security patch visible in this commit.

Lower-prioritynix: Upgrade channel and flake checker actionsby Christian Decker · 8f67da33 · Aug 19, 2025 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · Christian Decker

nix: Upgrade channel and flake checker actions

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit updates two third-party GitHub Actions used in the project's automated CI pipeline to newer versions and bumps the NixOS channel reference from 24.05 to 25.05. It does not change Core Lightning's runtime code, cryptographic logic, or network behavior. There is no indication in the commit or supplied references that this fixes or introduces a security vulnerability.

Lower-priorityci: Remove nix checkby Christian Decker · 40ded45a · Aug 19, 2025 · 1 fileMessage 75 · AdequateInformational 15Details
Commit message · Christian Decker

ci: Remove nix check

It was breaking a lot, due to Cargo dependencies not being published,
no surprise there, we are just publishing them with the changes it is
complaining about.

75/100 · AdequateMessage clarity
✓ Subject identifies a change✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit removes a Nix flake validation job from the project's continuous integration (CI) workflow. The change only affects GitHub Actions configuration and does not modify any application code, cryptographic logic, network handling, or user-facing behavior. It is a build/maintenance change, not a security fix or vulnerability.

Lower-prioritybkpr: remove redundant account_onchain_feesby Rusty Russell · 568f12ea · Aug 19, 2025 · 3 filesMessage 68 · AdequateInformational 15Details
Commit message · Rusty Russell

bkpr: remove redundant account_onchain_fees

It's account_get_chain_fees() without the ORDER BY clause, *and* it's
only used on the run-recorder.c test.

I also got ChatGPT to compare them, in case I missed something subtle.

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

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit removes an unused duplicate function from the bookkeeping plugin and switches the only test that used it to an equivalent existing function. There is no security-relevant change: the removed code and its replacement read the same database table with the same columns; the only difference was the sort order of results, which does not affect correctness here.

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.

Lower-prioritylightningd: add listchainmoves and listchannelmoves commands.by Rusty Russell · 7c2a7468 · Aug 19, 2025 · 8 filesMessage 73 · AdequateInformational 18Details
Commit message · Rusty Russell

lightningd: add listchainmoves and listchannelmoves commands.

This is where all the previous work pays off: we can access the coinmoves
in the db.

Changelog-Added: JSON-RPC: `listchainmoves` and `listchannelmoves` commands to access the audit log of coin movements.
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 adds two new read-only JSON-RPC commands, listchainmoves and listchannelmoves, that let users query an audit log of on-chain and channel coin movements stored in the node's database. It is a feature addition, not a security fix, and does not change how funds are handled or how the node protects itself.

Lower-prioritylightningd: reorder JSON fields into more coherent order.by Rusty Russell · 0c77cdd2 · Aug 19, 2025 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Rusty Russell

lightningd: reorder JSON fields into more coherent order.

This is mainly for the coming list commands, but it's just more
logical to have the common fields at the top.

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 simply rearranges the order in which information appears in JSON output for two internal accounting functions. No values are added, removed, or changed in meaning. It is a cosmetic/code-organization change with no security relevance.

Lower-prioritydb: helper for binding/reading bitcoin_outpoint.by Rusty Russell · b2baef16 · Aug 19, 2025 · 2 filesMessage 60 · AdequateInformational 15Details
Commit message · Rusty Russell

db: helper for binding/reading bitcoin_outpoint.

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 adds two small helper functions for storing and retrieving Bitcoin transaction outpoints (a transaction ID plus an output number) in the database. It is purely a code-cleanup/refactoring change: it introduces no new behavior, no bug fixes, and no security-sensitive logic. The helpers simply serialize/deserialize a standard data structure in the same way other nearby helpers already do for txids and channel IDs.

Lower-prioritybkpr: use list commands instead of subscribing to notifications.by Rusty Russell · 70d19e85 · Aug 19, 2025 · 4 filesMessage 83 · StrongLow 27Details
Commit message · Rusty Russell

bkpr: use list commands instead of subscribing to notifications.

This is reliable, meaning we should never get replayed events.

We have to reference count to make sure all commands are complete,
before we return. In particular, annotating with descriptions can
involve several calls to list commands. We need to give them the
results *after* this is all complete.

test_bookkeeping_descriptions() relied on log messages from
notifications, which now only happen when a command is called. This
changes the test a bit.

Since we no longer subscribe to the balance_snapshot event, we
need to create the wallet account at initialization, as callers
expect it to exist.

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 · Low 27/100

This commit rewrites the Core Lightning bookkeeper plugin so it fetches accounting events by calling 'list' RPC commands on demand instead of listening to live event notifications. The main goal is reliability: notifications can be replayed or missed, while list commands give a consistent, ordered view. The change also adds reference counting so the plugin waits for all helper RPC calls to finish before returning results, stores the last-processed index in the datastore, and creates the wallet account at startup because it can no longer rely on a startup balance-snapshot notification.

Lower-prioritybkpr: take, don't steal in new_channel_event.by Rusty Russell · 2a191479 · Aug 19, 2025 · 3 filesMessage 60 · AdequateInformational 18Details
Commit message · Rusty Russell

bkpr: take, don't steal in new_channel_event.

Cleaner (I'm about to hand it a sha256 on the stack).

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

This is a small cleanup change in the bookkeeping (bkpr) plugin. It changes how a payment identifier (a 32-byte hash value) is passed into a function: instead of 'stealing' ownership of the caller's copy, it now 'takes' a read-only pointer and makes its own duplicate if needed. The commit message says this is to make it easier to pass a temporary value created on the stack. This is defensive coding and reduces the risk of memory-management mistakes, but it does not by itself fix a known exploitable bug.

Lower-prioritybkpr: convert all the local db sql queries into calls to sql plugin.by Rusty Russell · b70f4f61 · Aug 19, 2025 · 8 filesMessage 85 · StrongInformational 14Details
Commit message · Rusty Russell

bkpr: convert all the local db sql queries into calls to sql plugin.

With some help (and hinderance!) from ChatGPT: the field names
differ slightly from our internal db.

The particilar wrinkle is that we have to restrict all queries to
limit them to entries we've seen already. Our code expects this (we
used to only enter it into the db when we processed it), and it would
otherwise be confusing if a sql query returned inconsistent results
because an event occurred while bookkeeper was processing.

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

This commit rewrites the bookkeeper (bkpr) plugin so that most of its internal SQLite queries are sent through a new SQL plugin instead of being executed directly. The change is described as a refactoring to use a shared SQL backend. There is no claim in the commit that this fixes a security bug, and the diff does not show an obvious vulnerability. However, because the new queries are built by concatenating strings with user-influenced values (account names, transaction IDs, payment hashes) there is a small risk of SQL injection if the helper functions do not escape those values correctly. The commit also removes a duplicate-check when logging chain events, which could in principle allow duplicate records, but that is a data-integrity issue rather than a direct security flaw.

Lower-prioritybookkeeper: don't set origin account to "null" if that's specified as transfer_from.by Rusty Russell · 980241fc · Aug 19, 2025 · 2 filesMessage 73 · AdequateInformational 21Details
Commit message · Rusty Russell

bookkeeper: don't set origin account to "null" if that's specified as transfer_from.

Before bkpr_listaccountevents() gave entries with origin like:

{'account': "nifty's secret stash",
'blockheight': 111,
'credit_msat': 180000000,
'currency': 'bcrt',
'debit_msat': 0,
'origin': 'null',
'outpoint': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:0',
'tag': 'deposit',
'timestamp': 1679955976,
'type': 'chain'},

Changelog-Changed: Plugins: "utxo_deposit" is allows to have missing `transfer_from`, and null is not considered an account name.
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 21/100

This is a small bug-fix in Core Lightning's bookkeeping plugin. Previously, if a user sent a deposit notification without specifying where the funds came from, the plugin would incorrectly record the origin account as the literal string "null". The fix makes the transfer_from field optional and treats a JSON null value as 'no origin account' rather than an account named "null". This is a data-correctness issue, not a direct way for an attacker to steal funds or take over a node.

Lower-prioritypytest: wait to make sure moves are registered in coinmoves tests.by Rusty Russell · 94c1cf58 · Aug 19, 2025 · 1 fileMessage 75 · AdequateInformational 15Details
Commit message · Rusty Russell

pytest: wait to make sure moves are registered in coinmoves tests.

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 changes a test file to add short waits before checking coin-move records. It is a test reliability fix, not a security patch, and does not change any production code that handles funds, networking, or cryptography.

Lower-prioritylibplugin: allow sync interface to be used at all times.by Rusty Russell · bb6787df · Aug 19, 2025 · 4 filesMessage 73 · AdequateLow 26Details
Commit message · Rusty Russell

libplugin: allow sync interface to be used at all times.

After much thought and mis-steps, I chose a simple solution: open another fd
for sync comms. It's almost impossible to know what state the async one is in.

jsonrpc_request_sync() is enhanced to return a valid tal object, as the current
behaviour of returning a pointer to inside an array was surprising.

Changelog-Changed: libplugin: you can now call the synchronous API functions at any time (not just in the init callback).
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 26/100

This change lets Core Lightning plugins make synchronous (blocking) JSON-RPC calls at any time, not just during startup. To do that safely, it opens a second Unix socket connection to the lightningd RPC so the sync call does not collide with ongoing async traffic. The patch also fixes a memory-handling quirk so the returned response is a proper allocated object. There is no direct evidence this fixes an active security bug, but it removes a risky restriction and improves robustness.