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

StoredDict: use pointers instead of path

Public commit record

What the developer wrote

Authored by ThomasV

86/100 · Strong
StoredDict: use pointers instead of path

Instead of storing its own path, each StoredDict element stores
its own key and a pointer to its parent. If a dict is removed
from the db, its parent pointer is set to None. This makes
self.path return None for all branches that have been pruned.

This passes tests/tests_json_db.py and fixes issue #10000
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit rewrites how Electrum's JSON database tracks nested data. Instead of each object remembering its full 'address' (path) inside the database, it now remembers only its own key and a pointer to its parent. When a branch of data is removed, the parent pointer is cleared so the object knows it is no longer part of the database. The change is described as fixing issue #10000 and passing the json_db tests. It is a defensive refactor that reduces the risk of stale objects writing updates for paths that no longer exist.

Recommended action

Treat as a maintenance/refactor commit with possible bug-fix/security-hardening side effects. Review issue #10000 and the json_db tests to confirm the specific failure mode being fixed. If deploying, verify that Lightning channel state changes are still persisted correctly and that no orphaned StoredDict objects silently drop updates that should be written.

Security signals we found

01

Refactor of database persistence layer to prevent pruned/removed subtrees from generating JSON patches

02

Change in constructor signature across Lightning channel code and tests

03

Fixes referenced issue #10000 (details not supplied)

04

Guards added so that db_add/db_replace/db_remove only emit patches when path is non-None

05

Parent pointer nulled on pop() to mark subtree as detached

Risk score

Why this scored 42/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 6/15
Affected reach 7/15
Confidence 6/10
Evidence quality 3/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.