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

refactor: remove dead branches in `SingletonClusterImpl`

Public commit record

What the developer wrote

Authored by Lőrinc

100/100 · Strong
refactor: remove dead branches in `SingletonClusterImpl`

`SplitAll()` always calls `ApplyRemovals()` first, for a singleton, it empties the cluster, therefore any `SingletonClusterImpl` passed to `Split()` must be empty.

`TxGraphImpl::ApplyDependencies()` first merges each dependency group and asserts the group has at least one dependency.
Since `parent` != `child`, `TxGraphImpl::Merge()` upgrades the merge target to `GenericClusterImpl`, therefore the `ApplyDependencies()` is never dispatched to `SingletonClusterImpl`.

Found during review: https://github.com/bitcoin/bitcoin/pull/33157#discussion_r2423058928
Coverage evidence:
* https://maflcko.github.io/b-c-cov/fuzz.coverage/src/txgraph.cpp.gcov.html#L1446
* https://storage.googleapis.com/oss-fuzz-coverage/bitcoin-core/reports/20251103/linux/src/bitcoin-core/src/txgraph.cpp.html#L1446
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ 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 is a code cleanup change in Bitcoin Core's internal transaction graph logic. It removes branches of code that the author proved can never actually run, replacing them with explicit 'this should never happen' assumptions. There is no security bug being fixed; it is purely a refactoring to simplify the code and document invariants.

Recommended action

No security action required. Treat as a normal refactoring review; verify the author's invariants hold and that the new Assume assertions are acceptable for the project's debug/assumption policy.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

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