From bd398e7b138df3ac601e5ecf6654092f7a16f7c7 Mon Sep 17 00:00:00 2001 From: shahafn Date: Sun, 22 Dec 2024 15:06:47 +0200 Subject: [PATCH] Running 7702 bundler with preState tracer --- .../localconfig/bundler.eip7702.config.json | 20 +++++++++++++++++++ packages/bundler/package.json | 1 + packages/validation-manager/src/GethTracer.ts | 4 ++-- packages/validation-manager/src/index.ts | 4 ++-- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 packages/bundler/localconfig/bundler.eip7702.config.json diff --git a/packages/bundler/localconfig/bundler.eip7702.config.json b/packages/bundler/localconfig/bundler.eip7702.config.json new file mode 100644 index 00000000..d2519d16 --- /dev/null +++ b/packages/bundler/localconfig/bundler.eip7702.config.json @@ -0,0 +1,20 @@ +{ + "chainId": 1337, + "gasFactor": "1", + "port": "3000", + "privateApiPort": "3001", + "network": "http://127.0.0.1:8545", + "tracerRpcUrl": "http://127.0.0.1:8545", + "entryPoint": "0x0000000071727De22E5E9d8BAf0edAc6f37da032", + "beneficiary": "0xd21934eD8eAf27a67f0A70042Af50A1D6d195E81", + "minBalance": "1", + "mnemonic": "./localconfig/mnemonic.txt", + "maxBundleGas": 30e6, + "minStake": "1", + "minUnstakeDelay": 0, + "autoBundleInterval": 3, + "autoBundleMempoolSize": 10, + "rip7560": false, + "rip7560Mode": "PULL", + "gethDevMode": true +} diff --git a/packages/bundler/package.json b/packages/bundler/package.json index 9668244e..59b1b409 100644 --- a/packages/bundler/package.json +++ b/packages/bundler/package.json @@ -12,6 +12,7 @@ "runop": "ts-node ./src/runner/runop.ts", "bundler": "TS_NODE_TRANSPILE_ONLY=1 ts-node ./src/exec.ts --config ./localconfig/bundler.config.json", "bundler-rip7560": "ts-node ./src/exec.ts --config ./localconfig/bundler.rip7560.config.json", + "bundler-eip7702": "ts-node ./src/exec.ts --config ./localconfig/bundler.eip7702.config.json", "clear": "rm -rf dist artifacts cache src/types", "hardhat-compile": "hardhat compile", "hardhat-node": "npx hardhat node --no-deploy", diff --git a/packages/validation-manager/src/GethTracer.ts b/packages/validation-manager/src/GethTracer.ts index 9f6b5775..0c992231 100644 --- a/packages/validation-manager/src/GethTracer.ts +++ b/packages/validation-manager/src/GethTracer.ts @@ -10,7 +10,7 @@ const debug = Debug('aa.tracer') // the name of the native tracer. // equivalent to the javascript "bundlerCollectorTracer". -export const bundlerNativeTracerName = 'bundlerCollectorTracer' +export const bundlerJSTracerName = 'bundlerCollectorTracer' export const GethNativeTracerName = 'erc7562Tracer' /** @@ -55,7 +55,7 @@ export async function debug_traceCall (provider: JsonRpcProvider, tx: Deferrable } const ret = await prestateTracerProvider.send('debug_traceCall', [tx1, 'latest', { - tracer: bundlerNativeTracerName, + tracer: bundlerJSTracerName, stateOverrides: preState }]) diff --git a/packages/validation-manager/src/index.ts b/packages/validation-manager/src/index.ts index 791d53ac..ac9c2955 100644 --- a/packages/validation-manager/src/index.ts +++ b/packages/validation-manager/src/index.ts @@ -3,7 +3,7 @@ import { JsonRpcProvider } from '@ethersproject/providers' import { AddressZero, IEntryPoint__factory, OperationRIP7560, UserOperation } from '@account-abstraction/utils' import { PreVerificationGasCalculator } from '@account-abstraction/sdk' -import { bundlerNativeTracerName, debug_traceCall, eth_traceRip7560Validation } from './GethTracer' +import { bundlerJSTracerName, debug_traceCall, eth_traceRip7560Validation } from './GethTracer' import { bundlerCollectorTracer } from './BundlerCollectorTracer' import { ValidateUserOpResult } from './IValidationManager' import { ValidationManager } from './ValidationManager' @@ -12,7 +12,7 @@ export * from './ValidationManager' export * from './ValidationManagerRIP7560' export * from './IValidationManager' -export async function supportsNativeTracer (provider: JsonRpcProvider, nativeTracer = bundlerNativeTracerName): Promise { +export async function supportsNativeTracer (provider: JsonRpcProvider, nativeTracer = bundlerJSTracerName): Promise { try { await provider.send('debug_traceCall', [{}, 'latest', { tracer: nativeTracer }]) return true