From d4f9c604e89f73956cd3509ad5d9d2c174d0d3c1 Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Tue, 20 Aug 2024 16:45:11 +0200 Subject: [PATCH] vm: 7702 ensure delegated accounts are not deleted [no ci] --- packages/vm/src/runTx.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/vm/src/runTx.ts b/packages/vm/src/runTx.ts index 8748748b38..05c0c2f5e1 100644 --- a/packages/vm/src/runTx.ts +++ b/packages/vm/src/runTx.ts @@ -12,7 +12,6 @@ import { bytesToHex, bytesToUnprefixedHex, concatBytes, - createAddressFromString, ecrecover, equalsBytes, hexToBytes, @@ -426,7 +425,6 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise { let gasRefund = BIGINT_0 - const writtenAddresses = new Set() if (tx.supports(Capability.EIP7702EOACode)) { // Add contract code for authority tuples provided by EIP 7702 tx const authorizationList = (tx).authorizationList @@ -489,8 +487,6 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise { const addressCode = concatBytes(new Uint8Array([0xef, 0x01, 0x00]), address) await vm.stateManager.putCode(authority, addressCode) - - writtenAddresses.add(authority.toString()) } } @@ -673,15 +669,6 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise { } } - /** - * Cleanup code of accounts written to in a 7702 transaction - */ - - for (const str of writtenAddresses) { - const address = createAddressFromString(str) - await vm.stateManager.putCode(address, new Uint8Array()) - } - if (enableProfiler) { // eslint-disable-next-line no-console console.timeEnd(accountsCleanUpLabel)