EIP-3554: Difficulty Bomb Delay to December 2021

This commit is contained in:
jangko 2021-06-28 14:11:06 +07:00
parent b51fad5fa7
commit b4221381d6
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 8 additions and 1 deletions

View File

@ -140,11 +140,18 @@ template calcDifficultyConstantinople*(timeStamp: EthTime, parent: BlockHeader):
makeDifficultyCalculator(5_000_000, timeStamp, parent) makeDifficultyCalculator(5_000_000, timeStamp, parent)
template calcDifficultyMuirGlacier*(timeStamp: EthTime, parent: BlockHeader): DifficultyInt = template calcDifficultyMuirGlacier*(timeStamp: EthTime, parent: BlockHeader): DifficultyInt =
# EIP-2384
makeDifficultyCalculator(9_000_000, timeStamp, parent) makeDifficultyCalculator(9_000_000, timeStamp, parent)
template calcDifficultyLondon*(timeStamp: EthTime, parent: BlockHeader): DifficultyInt =
# EIP-3554
makeDifficultyCalculator(9_700_000, timeStamp, parent)
func calcDifficulty*(c: ChainConfig, timeStamp: EthTime, parent: BlockHeader): DifficultyInt = func calcDifficulty*(c: ChainConfig, timeStamp: EthTime, parent: BlockHeader): DifficultyInt =
let next = parent.blockNumber + bigOne let next = parent.blockNumber + bigOne
if next >= c.muirGlacierBlock: if next >= c.londonBlock:
result = calcDifficultyLondon(timeStamp, parent)
elif next >= c.muirGlacierBlock:
result = calcDifficultyMuirGlacier(timeStamp, parent) result = calcDifficultyMuirGlacier(timeStamp, parent)
elif next >= c.constantinopleBlock: elif next >= c.constantinopleBlock:
result = calcDifficultyConstantinople(timeStamp, parent) result = calcDifficultyConstantinople(timeStamp, parent)