From 3aa4ad61e909c17f36fe0cc8b76e6c4a76fd0da4 Mon Sep 17 00:00:00 2001 From: harkamal Date: Sat, 19 Nov 2022 12:48:52 +0530 Subject: [PATCH] alternate fix of skipping only pos validation on genesis --- packages/block/src/header.ts | 4 ++-- packages/evm/src/evm.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 839c6a2f064..fc2c7392e5f 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -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 @@ -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 = '' diff --git a/packages/evm/src/evm.ts b/packages/evm/src/evm.ts index 8b6b50b01bc..45f9507c614 100644 --- a/packages/evm/src/evm.ts +++ b/packages/evm/src/evm.ts @@ -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(