AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 28 Bitcoin

bookkeeper: test (failing!) for rebalances on restart.

Public commit record

What the developer wrote

Authored by Rusty Russell

83/100 · Strong
bookkeeper: test (failing!) for rebalances on restart.

```
lightningd-1 2025-09-22T02:10:10.978Z **BROKEN** plugin-bookkeeper: Unparsable datastore ["bookkeeper","rebalances","1-2"]
```

And, indeed, rebalance is missing:

```
> outbound_ev = only_one([ev for ev in inc_evs if ev['tag'] == 'rebalance_fee'])

tests/test_bookkeeper.py:825:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

arr = []

def only_one(arr):
"""Many JSON RPC calls return an array; often we only expect a single entry
"""
> assert len(arr) == 1
E AssertionError

```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit adds a new test that demonstrates a bug in Core Lightning's bookkeeping plugin: after a node restart, 'rebalance' fee records are lost and the plugin logs a 'BROKEN' warning about an unparsable datastore entry. The test is marked as expected-to-fail (xfail) so it documents the bug without breaking CI. It is a test-only change, not a fix, and there is no security exploit here.

Recommended action

Treat this as a known functional bug, not a security vulnerability. The next step is to fix the bookkeeper plugin so it correctly persists and reloads rebalance records across restarts, then remove the xfail marker. Users relying on bookkeeper accounting should be aware that rebalance fees may be missing after restart until the bug is fixed.

Security signals we found

01

Data persistence/serialization bug in plugin datastore

02

Loss of accounting records after node restart

03

Plugin logs BROKEN-level message for unparsable stored data

Risk score

Why this scored 28/100

Our methodology →
Potential impact 8/30
Exploitability 0/25
Stealth signal 3/15
Affected reach 5/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.