Mutant created against commit dc3cd19.
+1 -1 · cpp
This description is AI generated, mistakes can be made.
Intent: Moves the testnet min-difficulty boundary by one second, so a block timestamped exactly 1200s after its parent must be min-difficulty instead of the real difficulty. The node then disagrees with the network about nBits for such blocks. That is a consensus split, but only on testnet3/testnet4, which is why it is not rated critical.
Behaviour change: Original: a block with nTime == prev.nTime + 1200 must carry the real difficulty. Mutant: it must carry powLimit (0x1d00ffff). A correctly mined block at real difficulty is rejected with bad-diffbits, and a min-difficulty block the network rejects is accepted.
Trigger: On testnet4, at a non-retarget height, a block whose nTime is exactly prev.nTime + 1200 and whose nBits is the real difficulty (or 0x1d00ffff, for the opposite divergence).
Spec violation: BIP94: 'If the block's timestamp is >20 minutes past the timestamp of the previous block ... Then the block MUST use the minimum difficulty value'. The code comment also says 'more than 2* 10 minutes'.
Severity if undetected: medium
Why tests miss it: src/test/pow_tests.cpp (only CalculateNextWorkRequired, mainnet), src/test/fuzz/pow.cpp (mainnet, no min-diff), grep -rn 'fPowAllowMinDifficultyBlocks|TESTNET|bad-diffbits' src/test test/functional; functional tests are regtest where all nBits == powLimit
Plausibility: 'At least 20 minutes' vs 'more than 20 minutes' is a classic off-by-one, and >= reads naturally for a time threshold.
Equivalence risk: Only blocks with a timestamp exactly 1200s after the parent diverge, and only on chains with fPowAllowMinDifficultyBlocks and non-powLimit difficulty (testnet3/4). On regtest both branches return powLimit.
Commands and environment reported by the submitter
cmake -B build -DBUILD_GUI=OFF -DWITH_ZMQ=OFF -DENABLE_IPC=OFF && cmake --build build -j$(nproc)ctest --test-dir build -j$(nproc) && build/test/functional/test_runner.py -j$(nproc)mutant-harness operator: boundary; location: GetNextWorkRequired lines 27
Imported from mutant-harness 480d7e3.
Commands are shown as text and never executed by MutantHub.
0 comments
No comments yet
Discuss equivalence, reproduction difficulties, or a test that kills this mutant.