File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,9 @@ console.log(common.consensusAlgorithm()) // 'ethash'
74
74
const block = Block .fromBlockData ({}, { common })
75
75
```
76
76
77
- TODO
77
+ To validate that the difficulty of the block matches the canonical difficulty use ` block.validate(blockchain) ` .
78
+
79
+ To calculate the difficulty when creating the block pass in the block option ` calcDifficultyFromHeader ` with the preceding (parent) ` BlockHeader ` .
78
80
79
81
## Clique/PoA (since v3.1.0)
80
82
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ Starting with `v5.1.0` the VM supports running both `Ethash/PoW` and `Clique/PoA
81
81
82
82
### Ethash/PoW Chains
83
83
84
- TODO
84
+ ` @ethereumjs/blockchain ` validates the PoW algorithm with ` @ethereumjs/ethash ` and validates blocks' difficulty to match their canonical difficulty.
85
85
86
86
### Clique/PoA Chains
87
87
You can’t perform that action at this time.
0 commit comments