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

txgraph: use fallback order to sort chunks (feature)

Public commit record

What the developer wrote

Authored by Pieter Wuille

73/100 · Adequate
txgraph: use fallback order to sort chunks (feature)

This makes TxGraph also use the fallback order to decide the order of
chunks from distinct clusters.

The order of chunks across clusters becomes:
1. Feerate (high to low)
2. Equal-feerate-chunk-prefix (small to large)
3. Max-txid (chunk with lowest maximum-txid first)

This makes the full TxGraph ordering fully deterministic as long as all
clusters in it are optimally linearized.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit changes how Bitcoin Core orders groups of related transactions (called 'chunks') in its internal transaction graph. It replaces a non-deterministic tie-breaker based on internal cluster sequence numbers with a deterministic one based on transaction IDs. The goal is to make the mempool ordering fully predictable, which helps with testing and may reduce subtle consensus or network behavior differences between nodes. There is no indication this fixes an active security vulnerability.

Recommended action

No immediate security action required. Treat as a robustness/feature improvement. Reviewers may want to confirm the fallback comparator provides a strong ordering for all chunk pairs and that the new fuzz test invariant holds under extended fuzzing.

Security signals we found

01

Replaces non-deterministic cluster-sequence tie-breaker with deterministic fallback-order tie-breaker

02

Adds defensive Assume(entry.m_ref != nullptr) before invoking fallback comparator on chunk data creation

03

Moves ApplyRemovals before staging-to-main commit to avoid using unlinked entries with no Ref

04

Functional test changed from set comparison to exact list comparison, asserting deterministic mempool order after reorg

Risk score

Why this scored 19/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 0/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.