From 16941c9390f7f9a89a9571b5c93010a46684df23 Mon Sep 17 00:00:00 2001 From: acolytec3 <17355484+acolytec3@users.noreply.github.com> Date: Fri, 3 May 2024 14:23:42 -0400 Subject: [PATCH] Add 2935 back --- packages/common/src/hardforks.ts | 2 +- packages/vm/src/runBlock.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/common/src/hardforks.ts b/packages/common/src/hardforks.ts index d7b77d579b..814a55a113 100644 --- a/packages/common/src/hardforks.ts +++ b/packages/common/src/hardforks.ts @@ -841,7 +841,7 @@ export const hardforks: HardforksDict = { 'Next feature hardfork after cancun, internally used for pectra testing/implementation (incomplete/experimental)', url: 'https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/prague.md', status: Status.Draft, - eips: [2537, 3074, 6110, 7002, 7685], + eips: [2537, 2935, 3074, 6110, 7002, 7685], }, osaka: { name: 'osaka', diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 443bf5ded1..afb47d0b9c 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -478,11 +478,7 @@ export async function accumulateParentBlockHash( ) const historyServeWindow = this.common.param('vm', 'historyServeWindow') - // Is this the fork block? const forkTime = this.common.eipTimestamp(2935) - if (forkTime === null) { - throw new Error('EIP 2935 should be activated by timestamp') - } // getAccount with historyAddress will throw error as witnesses are not bundeled // but we need to put account so as to query later for slot @@ -520,7 +516,8 @@ export async function accumulateParentBlockHash( const parentBlock = await this.blockchain.getBlock(parentHash) // If on the fork block, store the old block hashes as well - if (parentBlock.header.timestamp < forkTime) { + if (forkTime !== null && parentBlock.header.timestamp < forkTime) { + // forkTime could be null in test fixtures let ancestor = parentBlock for (let i = 0; i < Number(historyServeWindow) - 1; i++) { if (ancestor.header.number === BIGINT_0) {