consensus: disable min difficulty blocks on testnet4 after height 151200 #34420

pull batmanbytes wants to merge 2 commits into bitcoin:master from batmanbytes:testnet4-fix changing 5 files +202 −4
  1. batmanbytes commented at 3:08 pm on January 27, 2026: none

    Summary

    Disable the min-difficulty block rule on testnet4 after block height 151,200 (epoch 75 boundary) and reset difficulty to 1,000,000 at the fork.

    Motivation

    Testnet4’s min-difficulty rule (allowing difficulty-1 blocks after 20 minutes) is being exploited, causing ~85-90% of blocks to be CPU-mined min-difficulty blocks. This results in a race of CPU miners broadcasting blocks at exactly the second that it’s acceptable. This race is so intense that CPU miners have figured out sending empty blocks, as they propagate faster than those that contain transactions, resulting in a network where transactions are confirmed at only the remaining ASIC blocks, that have ~1 hour average block times.

    After the fork:

    • Min-difficulty blocks will no longer be allowed
    • Difficulty resets to 1,000,000 (not 1, to avoid a block storm of thousands of blocks in seconds)
    • Normal difficulty retargeting resumes

    Changes

    • Add nMinDifficultyBlocksForkHeight consensus parameter (default 0 = disabled)
    • Set fork height to 151,200 for testnet4 (epoch 75 boundary, ~31,000 blocks from current height ~120,000)
    • Modify GetNextWorkRequired() to disable min-difficulty rule and reset difficulty at fork
    • Modify PermittedDifficultyTransition() to enforce the new rules
    • Modify WaitAndCreateNewBlock() in miner to respect the fork
    • Add unit tests covering pre-fork, at-fork, and post-fork behavior

    Test Plan

    • ./build/bin/test_bitcoin --run_test=pow_tests - all 21 tests pass

    Discussion

    [bitcoin-dev mailing list thread #1](https://groups.google.com/g/bitcoindev/c/iVLHJ1HWhoU) [bitcoin-dev mailing list thread #2](https://groups.google.com/g/bitcoindev/c/Jsv1VYpewuU)
    Bitcointalk thread

  2. DrahtBot added the label Consensus on Jan 27, 2026
  3. DrahtBot commented at 3:08 pm on January 27, 2026: contributor

    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/34420.

    Reviews

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

  4. DrahtBot added the label CI failed on Jan 27, 2026
  5. batmanbytes force-pushed on Jan 27, 2026
  6. consensus: disable min difficulty blocks on testnet4 after height 151200 2aa8902ca6
  7. test: add unit tests for testnet4 min-difficulty fork 2123e4d5e6
  8. batmanbytes force-pushed on Jan 27, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-01-28 09:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me