diff --git a/packages/evm/src/journal.ts b/packages/evm/src/journal.ts index 3fcfc496fe..1a84e51ac5 100644 --- a/packages/evm/src/journal.ts +++ b/packages/evm/src/journal.ts @@ -2,7 +2,6 @@ import { Hardfork } from '@ethereumjs/common' import { Address, RIPEMD160_ADDRESS_STRING, - bigIntToHex, bytesToHex, bytesToUnprefixedHex, stripHexPrefix, @@ -198,13 +197,6 @@ export class Journal { const address = new Address(hexToBytes(`0x${addressHex}`)) const account = await this.stateManager.getAccount(address) if (account === undefined || account.isEmpty()) { - if (this.common.isActivatedEIP(2935)) { - // The history storage address is exempt of state clearing by EIP-158 if the EIP is activated - const addr = bigIntToHex(this.common.param('vm', 'historyStorageAddress')).slice(2) - if (addressHex === addr) { - continue - } - } await this.deleteAccount(address) if (this.DEBUG) { this._debug(`Cleanup touched account address=${address} (>= SpuriousDragon)`) diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 346a7dd61c..e38f6035f7 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -545,6 +545,9 @@ export async function accumulateParentBlockHash( } // eslint-disable-next-line no-empty } catch (_e) {} + + // do cleanup if the code was not deployed + await this.evm.journal.cleanup() } export async function accumulateParentBeaconBlockRoot( @@ -590,6 +593,9 @@ export async function accumulateParentBeaconBlockRoot( setLengthLeft(bigIntToBytes(timestampExtended), 32), root ) + + // do cleanup if the code was not deployed + await this.evm.journal.cleanup() } /**