#36129 fuzz: reset chainman after external block imports

ReviewabilityReviewsAgreementSize
#36129 HowHsu fuzz: reset chainman after external block importsReady0Crickets0 + 23 tests
  • Prevent fuzz iteration state contamination in external block file fuzzing
  • Fixes non-reproducible fuzz crashes and order-dependent test coverage
  • Ready to review
  • No review verdicts recorded
  • No substantive reviews or comments yet
  • Question asked about using a dirty-guard for performance (maflcko)
  • 0 lines added or modified outside tests
  • 23 lines added or modified in tests
  • 2 lines removed in total
  • 1 files, 1 commits
Test infrastructure#10 of 54
P3 · bug fix
  • P3 because it fixes state contamination causing non-reproducible fuzz crashes
  • Benefit is isolated to a single fuzz target
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

This pull request resets and re-initializes the chainstate manager after each iteration of the `load_external_block_file` fuzz target. It also disables unused networking setup to prevent `PeerManager` dangling references and resets the deterministic random number generator seed.

Problem: `LoadExternalBlockFile()` adds headers to the block index even when validation fails, contaminating static global state across fuzz iterations and causing order-dependent corpus coverage and non-reproducible fuzz crashes.

Reviewability

Ready

Nothing known that would invalidate a review now.

Agreement

Crickets

no substantive comment either way

Thread notes: maflcko asked an inline question about using a dirty-guard for performance, which HowHsu answered by noting the difficulty of tracking all order-dependent mutated state.

Objections, suggestions, and questions: none recorded.

Participants:

  • maflcko (member, question, 1 statements 2026-09-01 to 2026-09-01): asked whether a dirty-guard would make execution faster

Files

25 lines under test/bench/ci.

  • src/test/fuzz/load_external_block_file.cpp +23/-2

Card

The short text the ranking pass compares across PRs.

This PR resets the chainstate manager after each input in the `load_external_block_file` fuzz target. It solves an issue where partial imports pollute global chainstate, causing fuzzer corpus execution to be order-dependent. Deterministic test runs verify that all 930 existing corpus inputs now execute consistently in randomized order. Review is active and ready, with only a minor performance discussion on dirty checking raised so far.

Data

dossier JSON · extract JSON · model ledger, generated 2026-09-18T03:45, confidence high, input hash 4ba52ae697f721c8
thread read through 2026-09-03 (2 statements), head eb3c6f296d
Discussion read under schema 1 rules: suggestions and questions may be missing, and an objection may combine several harms (schema history).
labels: Fuzzing · draft

Categories

Test infrastructure

P3 · bug fix

Fixes state contamination across fuzz iterations that causes non-reproducible fuzz crashes and order-dependent coverage in the `load_external_block_file` target. While fixing flaky harness behavior is a key priority for test infrastructure, the impact is isolated to a single fuzz target.

Membership: Touches src/test/fuzz/load_external_block_file.cpp and carries the Fuzzing label.

Factors: security/stability 1, bug 1, performance 0, user value 0, leverage 0