Hello mailing list.
I have introduced int nMinDifficultyBlocksForkHeight which is 0 by
default in consensus/params.h, only ever used by the CTestNet4Params
class. GetNextWorkRequired and PermittedDifficultyTransition are also
modified to check whether min difficulty blocks are enabled, and if yes,
whether nMinDifficultyBlocksForkHeight is 0 (which would indicate it is
not testnet4).
With no other changes to the code, during the epoch that includes block 150,000 (which already began at block 149,184), we should expect the block interval to increase by roughly sixfold (to about one hour per block). This is because the effective hashrate would correspond to approximately one-sixth of the difficulty. The difficulty increases by about 6x since there are roughly six times more difficulty-1 blocks than blocks at the normal difficulty.
We could modify the code to not suffer from the temporary 1-hour block interval if needed. I'm just interested to see what you think of those changes, so that we can move forward.