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

test: add coverage for UB caused by FindMostWorkChain

Public commit record

What the developer wrote

Authored by stratospher

95/100 · Strong
test: add coverage for UB caused by FindMostWorkChain

when pruned node2 finally receives the blocks from
node0, node2 will process duplicate entires in
ReceivedBlockTransactions twice but it will only
insert into setBlockIndexCandidates if the block has
more work that the current chain tip.

the duplicate entries in m_blocks_unlinked in this
test are from height 1171 to 1294.

before this commit
- we invalidated height 1320 and chain tip became
1319. so we won't add duplicate entries (all have
<1319) into setBlockIndexCandidates and won't
have coverage for this UB scenario.

with this commit
- we invalidate height 1295 and chain tip became
1294. so we will process the duplicate entry
1294 in m_blocks_unlinked and have coverage
for this UB.

Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit only changes a test file. It adjusts which block height is invalidated in an existing functional test so that the test exercises a specific edge case involving duplicate block processing in pruned nodes. There is no change to production code, so it does not introduce or fix a live vulnerability by itself. It is a test-coverage improvement.

Recommended action

No immediate action is required for production systems. Developers should ensure the underlying undefined-behavior issue in FindMostWorkChain is tracked and fixed separately if it has not already been addressed. Reviewers may run the updated functional test to confirm it reproduces the intended UB coverage.

Security signals we found

01

test-only change

02

coverage for undefined behavior in FindMostWorkChain

03

duplicate entries in m_blocks_unlinked / setBlockIndexCandidates

04

pruned node block re-download / reorg scenario

Risk score

Why this scored 12/100

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