Skip to content

Commit

Permalink
alternate fix of skipping only pos validation on genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Nov 19, 2022
1 parent a671e21 commit 3aa4ad6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block/src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export class BlockHeader {
* @throws if any check fails
*/
_consensusFormatValidation() {
const { nonce, uncleHash, difficulty, extraData } = this
const { nonce, uncleHash, difficulty, extraData, number } = this
const hardfork = this._common.hardfork()

// Consensus type dependent checks
Expand Down Expand Up @@ -394,7 +394,7 @@ export class BlockHeader {
}
}
// Validation for PoS blocks (EIP-3675)
if (this._common.consensusType() === ConsensusType.ProofOfStake) {
if (this._common.consensusType() === ConsensusType.ProofOfStake && number > BigInt(0)) {
let error = false
let errorMsg = ''

Expand Down
1 change: 1 addition & 0 deletions packages/evm/src/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export class EVM implements EVMInterface {
Hardfork.GrayGlacier,
Hardfork.MergeForkIdTransition,
Hardfork.Merge,
Hardfork.Shanghai,
]
if (!supportedHardforks.includes(this._common.hardfork() as Hardfork)) {
throw new Error(
Expand Down

0 comments on commit 3aa4ad6

Please sign in to comment.