Skip to content

Conversation

@yuvicc
Copy link
Contributor

@yuvicc yuvicc commented Nov 27, 2025

Deduplicate reorg test code by introducing ForkGenerator utility class in blocktools.py.

Changes

  • Add ForkGenerator class with prepare_fork() / trigger_reorg() / reset() methods
  • Removes duplicated trigger_reorg() methods across tests
  • Update mempool tests to use the new utility

For now I am keeping it as draft as we need to address other tests to eliminate use of invalidate_block for reorg scenario. Also, optional args for non-empty forks to test mix-and-match cases of transactions re-entering mempool as suggested by instagibbs in #32587 (comment).

Replace duplicated trigger_reorg() methods in mempool tests with ForkGenerator utility class in blocktools.py.
@DrahtBot DrahtBot added the Tests label Nov 27, 2025
@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 27, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33959.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #33616 (policy: don't CheckEphemeralSpends on reorg by instagibbs)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

LLM Linter (✨ experimental)

Possible typos and grammar issues:

  • triggered.. -> triggered. [Double period at end of sentence in the ForkGenerator class docstring makes the sentence look like a typo and may distract; replace with a single period.]

2025-12-13

@fanquake fanquake requested a review from instagibbs November 27, 2025 15:17
@fanquake fanquake changed the title test: use ForkGenerator to deduplicate reorg test code (#32587 follow-up) test: use ForkGenerator to deduplicate reorg test code Nov 27, 2025
@yuvicc yuvicc force-pushed the 2025-11-followup_fix_reorgs_tests branch from 4ee9b46 to b6150c2 Compare December 13, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants