Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

HF Muir Glacier Difficulty bomb delay #87

Merged
merged 3 commits into from
Dec 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"homepage": "https://github.com/ethereumjs/ethereumjs-block#readme",
"dependencies": {
"@types/bn.js": "^4.11.5",
"ethereumjs-common": "^1.3.0",
"ethereumjs-common": "^1.5.0",
Copy link
Contributor Author

@evertonfraga evertonfraga Dec 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.5.0 has the definitions for HF Muir Glacier

"ethereumjs-tx": "^2.1.1",
"ethereumjs-util": "^6.1.0",
"merkle-patricia-tree": "^2.1.2"
Expand Down
8 changes: 7 additions & 1 deletion src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ export class BlockHeader {
dif = parentDif.add(offset.mul(a))
}

if (this._common.hardforkGteHardfork(hardfork, 'constantinople')) {
if (this._common.hardforkGteHardfork(hardfork, 'muirGlacier')) {
// Istanbul/Berlin difficulty bomb delay (EIP2384)
num.isubn(9000000)
if (num.ltn(0)) {
num = new BN(0)
}
} else if (this._common.hardforkGteHardfork(hardfork, 'constantinople')) {
// Constantinople difficulty bomb delay (EIP1234)
num.isubn(5000000)
if (num.ltn(0)) {
Expand Down