@@ -254,6 +254,36 @@ class EthashBlockHeaderValidatorSpec
254254 difficulty shouldBe afterRewardReductionBlockHeader.difficulty
255255 }
256256
257+ it should " properly calculate the difficulty after muir glacier delay" in new EphemBlockchainTestSetup {
258+ val blockchainConfigWithoutDifficultyBombRemoval : BlockchainConfig =
259+ blockchainConfig.withUpdatedForkBlocks(
260+ _.copy(
261+ difficultyBombRemovalBlockNumber = BigInt (" 1000000000000" ),
262+ difficultyBombPauseBlockNumber = 0 ,
263+ difficultyBombContinueBlockNumber = 0 ,
264+ muirGlacierBlockNumber = 9200000
265+ )
266+ )
267+
268+ val parentHeader : BlockHeader =
269+ validParentBlockHeader.copy(
270+ number = 9200000 - 1 ,
271+ unixTimestamp = 1525176000 ,
272+ difficulty = BigInt (" 22627021745803" )
273+ )
274+ val parent = Block (parentHeader, parentBody)
275+
276+ val blockNumber : BigInt = parentHeader.number + 1
277+ val blockTimestamp : Long = parentHeader.unixTimestamp + 6
278+
279+ val difficulty : BigInt = EthashDifficultyCalculator .calculateDifficulty(blockNumber, blockTimestamp, parent.header)(
280+ blockchainConfigWithoutDifficultyBombRemoval
281+ )
282+ val blockDifficultyWihtoutBomb = BigInt (" 22638070096265" )
283+
284+ difficulty shouldBe blockDifficultyWihtoutBomb
285+ }
286+
257287 // FIXME: Replace with mocked miner validators once we have them
258288 object BlockValidatorWithPowMocked extends BlockHeaderValidatorSkeleton () {
259289
@@ -388,6 +418,7 @@ class EthashBlockHeaderValidatorSpec
388418 byzantiumBlockNumber = 4370000 ,
389419 constantinopleBlockNumber = 7280000 ,
390420 istanbulBlockNumber = 9069000 ,
421+ muirGlacierBlockNumber = 9200000 ,
391422 eip106BlockNumber = 0
392423 ),
393424 daoForkConfig = Some (new DaoForkConfig {
0 commit comments