From b386e649bac1858cd33067f3ccf52ca1ec7a933f Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Thu, 22 Aug 2024 13:19:01 +0500 Subject: [PATCH] put storageMap back --- .../BundlingService/relayers/fastlane.ts | 35 ++++++++++--------- .../src/services/BundlingService/service.ts | 2 -- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/packages/executor/src/services/BundlingService/relayers/fastlane.ts b/packages/executor/src/services/BundlingService/relayers/fastlane.ts index 695cea9e..40dc859b 100644 --- a/packages/executor/src/services/BundlingService/relayers/fastlane.ts +++ b/packages/executor/src/services/BundlingService/relayers/fastlane.ts @@ -83,23 +83,23 @@ export class FastlaneRelayer extends BaseRelayer { maxFeePerGas: bundle.maxFeePerGas, }; - // if (this.networkConfig.eip2930) { - // const { storageMap } = bundle; - // const addresses = Object.keys(storageMap); - // if (addresses.length) { - // const accessList: AccessList = []; - // for (const address of addresses) { - // const storageKeys = storageMap[address]; - // if (typeof storageKeys == "object") { - // accessList.push({ - // address, - // storageKeys: Object.keys(storageKeys), - // }); - // } - // } - // transactionRequest.accessList = accessList; - // } - // } + if (this.networkConfig.eip2930) { + const { storageMap } = bundle; + const addresses = Object.keys(storageMap); + if (addresses.length) { + const accessList: AccessList = []; + for (const address of addresses) { + const storageKeys = storageMap[address]; + if (typeof storageKeys == "object") { + accessList.push({ + address, + storageKeys: Object.keys(storageKeys), + }); + } + } + transactionRequest.accessList = accessList; + } + } if ( chainsWithoutEIP1559.some((chainId: number) => chainId === this.chainId) @@ -206,6 +206,7 @@ export class FastlaneRelayer extends BaseRelayer { const params = [ signedRawTx, { + knownAccounts: storageMap, blockNumberMin: block.number, blockNumberMax: block.number + 180, // ~10 minutes timestampMin: block.timestamp, diff --git a/packages/executor/src/services/BundlingService/service.ts b/packages/executor/src/services/BundlingService/service.ts index 1b0d773e..b10b32d3 100644 --- a/packages/executor/src/services/BundlingService/service.ts +++ b/packages/executor/src/services/BundlingService/service.ts @@ -439,9 +439,7 @@ export class BundlingService { ); await this.mempoolService.attemptToBundle(bundle.entries); - this.logger.debug(bundle.storageMap, "before"); bundle.storageMap = getNonceStorageMapForBundle(bundle); - this.logger.debug(bundle.storageMap, "after"); if (this.config.testingMode) { // need to wait for the tx hash during testing await this.relayer.sendBundle(bundle).catch((err) => {