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
  9. DrahtBot removed the label CI failed on Jan 28, 2026
  10. luke-jr commented at 6:14 am on January 29, 2026: member
    It’s a testnet. Any reason not to make it retroactive?
  11. stwenhao commented at 6:59 am on January 29, 2026: none

    Any reason not to make it retroactive?

    Well, it is possible to remove 20 minutes rule entirely from the source code. But that would mean testnet3 and testnet4 in their current form, would be entirely removed, and then supported only by the old Bitcoin Core version.

  12. batmanbytes commented at 10:11 am on January 29, 2026: none

    It’s a testnet. Any reason not to make it retroactive?

    A few reasons from the top of my head:

    • it’s disruptive for developers and services currently using testnet4
    • there are around 4 million test coins “pre-mined”, laying around at faucets.
    • resetting to a new testnet5 would require miners to point their hashrate elsewhere. With the current change, they just get more test coins, with the same hashrate.
    • a new testnet5 would not be supported by old Bitcoin Core version nodes, but a forked testnet4 would be fully supported.

    In my opinion, the simplification from going retroactive is marginal and doesn’t justify the disruption, especially with the fork height logic being only a few lines.

  13. stwenhao commented at 12:03 pm on January 29, 2026: none

    a new testnet5 would not be supported by old Bitcoin Core version nodes, but a forked testnet4 would be fully supported.

    In case of a hard-fork, old versions will not follow these changes anyway. If you want them, to end up in the same chain, then a different rule is needed, for example that blocks with more than 20 minutes delay, should be simply invalid (except difficulty adjustment, where you can use the real time). And then, if all ASIC blocks will be less than 20 minutes away, then they will be accepted by the old network, and will reorg CPU blocks, created in the meantime.

  14. DrahtBot added the label CI failed on Jan 30, 2026
  15. maflcko removed the label CI failed on Jan 31, 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-03-07 03:13 UTC

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