@pimlico/alto 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/cli/alto.js +0 -4
- package/esm/cli/alto.js.map +1 -1
- package/esm/cli/config/bundler.d.ts +2302 -22
- package/esm/cli/config/bundler.js +32 -4
- package/esm/cli/config/bundler.js.map +1 -1
- package/esm/cli/config/options.js +59 -4
- package/esm/cli/config/options.js.map +1 -1
- package/esm/cli/customTransport.js +5 -1
- package/esm/cli/customTransport.js.map +1 -1
- package/esm/cli/handler.js +39 -4
- package/esm/cli/handler.js.map +1 -1
- package/esm/cli/instrumentation.js +2 -2
- package/esm/cli/instrumentation.js.map +1 -1
- package/esm/cli/setupServer.d.ts +2 -1
- package/esm/cli/setupServer.js +51 -27
- package/esm/cli/setupServer.js.map +1 -1
- package/esm/executor/executor.d.ts +7 -14
- package/esm/executor/executor.js +139 -128
- package/esm/executor/executor.js.map +1 -1
- package/esm/executor/executorManager.d.ts +58 -4
- package/esm/executor/executorManager.js +206 -52
- package/esm/executor/executorManager.js.map +1 -1
- package/esm/executor/senderManager.d.ts +2 -1
- package/esm/executor/senderManager.js +3 -0
- package/esm/executor/senderManager.js.map +1 -1
- package/esm/executor/utilityWalletMonitor.d.ts +15 -0
- package/esm/executor/utilityWalletMonitor.js +38 -0
- package/esm/executor/utilityWalletMonitor.js.map +1 -0
- package/esm/executor/utils.d.ts +1 -2
- package/esm/executor/utils.js +49 -38
- package/esm/executor/utils.js.map +1 -1
- package/esm/handlers/compressionHandler.js.map +1 -0
- package/esm/handlers/eventManager.d.ts +21 -0
- package/esm/handlers/eventManager.js +166 -0
- package/esm/handlers/eventManager.js.map +1 -0
- package/{lib/utils → esm/handlers}/gasPriceManager.d.ts +19 -5
- package/esm/{utils → handlers}/gasPriceManager.js +58 -13
- package/esm/handlers/gasPriceManager.js.map +1 -0
- package/esm/handlers/index.d.ts +4 -0
- package/esm/handlers/index.js +4 -0
- package/esm/handlers/index.js.map +1 -0
- package/esm/mempool/index.d.ts +0 -1
- package/esm/mempool/index.js +0 -1
- package/esm/mempool/index.js.map +1 -1
- package/esm/mempool/mempool.d.ts +4 -2
- package/esm/mempool/mempool.js +70 -26
- package/esm/mempool/mempool.js.map +1 -1
- package/esm/mempool/reputationManager.js +7 -3
- package/esm/mempool/reputationManager.js.map +1 -1
- package/esm/rpc/EntryPointSimulationsV07.d.ts +7 -3
- package/esm/rpc/EntryPointSimulationsV07.js +12 -9
- package/esm/rpc/EntryPointSimulationsV07.js.map +1 -1
- package/esm/rpc/gasEstimation.d.ts +3 -3
- package/esm/rpc/gasEstimation.js +23 -14
- package/esm/rpc/gasEstimation.js.map +1 -1
- package/esm/rpc/nonceQueuer.d.ts +4 -1
- package/esm/rpc/nonceQueuer.js +9 -3
- package/esm/rpc/nonceQueuer.js.map +1 -1
- package/esm/rpc/rpcHandler.d.ts +53 -3
- package/esm/rpc/rpcHandler.js +150 -238
- package/esm/rpc/rpcHandler.js.map +1 -1
- package/esm/rpc/server.d.ts +2 -1
- package/esm/rpc/server.js +10 -1
- package/esm/rpc/server.js.map +1 -1
- package/esm/rpc/validation/SafeValidator.d.ts +5 -8
- package/esm/rpc/validation/SafeValidator.js +51 -208
- package/esm/rpc/validation/SafeValidator.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV07.js +6 -2
- package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +7 -3
- package/esm/rpc/validation/UnsafeValidator.js +52 -48
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/rpc/validation/tracer.js +1 -0
- package/esm/rpc/validation/tracer.js.map +1 -1
- package/esm/types/contracts/EntryPointSimulations.d.ts +0 -1
- package/esm/types/contracts/EntryPointSimulations.js +1941 -2
- package/esm/types/contracts/EntryPointSimulations.js.map +1 -1
- package/esm/types/contracts/PimlicoEntryPointSimulations.d.ts +1 -1
- package/esm/types/contracts/PimlicoEntryPointSimulations.js +1 -1
- package/esm/types/contracts/PimlicoEntryPointSimulations.js.map +1 -1
- package/esm/types/schemas.d.ts +1029 -333
- package/esm/types/schemas.js +94 -20
- package/esm/types/schemas.js.map +1 -1
- package/esm/types/utils.d.ts +1 -1
- package/esm/types/validation.js +7 -2
- package/esm/types/validation.js.map +1 -1
- package/esm/utils/bigInt.d.ts +1 -0
- package/esm/utils/bigInt.js +4 -0
- package/esm/utils/bigInt.js.map +1 -1
- package/esm/utils/helpers.d.ts +1 -0
- package/esm/utils/helpers.js +6 -0
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/index.d.ts +0 -3
- package/esm/utils/index.js +0 -3
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/metrics.d.ts +4 -0
- package/esm/utils/metrics.js +29 -1
- package/esm/utils/metrics.js.map +1 -1
- package/esm/utils/rpc-reply.d.ts +1 -1
- package/esm/utils/rpc-reply.js +2 -1
- package/esm/utils/rpc-reply.js.map +1 -1
- package/esm/utils/userop.d.ts +66 -6
- package/esm/utils/userop.js +182 -95
- package/esm/utils/userop.js.map +1 -1
- package/esm/utils/validation.d.ts +1 -1
- package/esm/utils/validation.js +9 -13
- package/esm/utils/validation.js.map +1 -1
- package/lib/cli/alto.js +0 -4
- package/lib/cli/alto.js.map +1 -1
- package/lib/cli/config/bundler.d.ts +2302 -22
- package/lib/cli/config/bundler.js +31 -3
- package/lib/cli/config/bundler.js.map +1 -1
- package/lib/cli/config/options.js +59 -4
- package/lib/cli/config/options.js.map +1 -1
- package/lib/cli/customTransport.js +5 -1
- package/lib/cli/customTransport.js.map +1 -1
- package/lib/cli/handler.js +38 -3
- package/lib/cli/handler.js.map +1 -1
- package/lib/cli/instrumentation.js +2 -2
- package/lib/cli/instrumentation.js.map +1 -1
- package/lib/cli/setupServer.d.ts +2 -1
- package/lib/cli/setupServer.js +52 -28
- package/lib/cli/setupServer.js.map +1 -1
- package/lib/executor/executor.d.ts +7 -14
- package/lib/executor/executor.js +138 -128
- package/lib/executor/executor.js.map +1 -1
- package/lib/executor/executorManager.d.ts +58 -4
- package/lib/executor/executorManager.js +204 -50
- package/lib/executor/executorManager.js.map +1 -1
- package/lib/executor/senderManager.d.ts +2 -1
- package/lib/executor/senderManager.js +3 -0
- package/lib/executor/senderManager.js.map +1 -1
- package/lib/executor/utilityWalletMonitor.d.ts +15 -0
- package/lib/executor/utilityWalletMonitor.js +42 -0
- package/lib/executor/utilityWalletMonitor.js.map +1 -0
- package/lib/executor/utils.d.ts +1 -2
- package/lib/executor/utils.js +48 -37
- package/lib/executor/utils.js.map +1 -1
- package/lib/handlers/compressionHandler.js.map +1 -0
- package/lib/handlers/eventManager.d.ts +21 -0
- package/lib/handlers/eventManager.js +196 -0
- package/lib/handlers/eventManager.js.map +1 -0
- package/{esm/utils → lib/handlers}/gasPriceManager.d.ts +19 -5
- package/lib/{utils → handlers}/gasPriceManager.js +58 -13
- package/lib/handlers/gasPriceManager.js.map +1 -0
- package/lib/handlers/index.d.ts +4 -0
- package/lib/handlers/index.js +20 -0
- package/lib/handlers/index.js.map +1 -0
- package/lib/mempool/index.d.ts +0 -1
- package/lib/mempool/index.js +0 -1
- package/lib/mempool/index.js.map +1 -1
- package/lib/mempool/mempool.d.ts +4 -2
- package/lib/mempool/mempool.js +70 -26
- package/lib/mempool/mempool.js.map +1 -1
- package/lib/mempool/reputationManager.js +7 -3
- package/lib/mempool/reputationManager.js.map +1 -1
- package/lib/rpc/EntryPointSimulationsV07.d.ts +7 -3
- package/lib/rpc/EntryPointSimulationsV07.js +13 -9
- package/lib/rpc/EntryPointSimulationsV07.js.map +1 -1
- package/lib/rpc/gasEstimation.d.ts +3 -3
- package/lib/rpc/gasEstimation.js +23 -14
- package/lib/rpc/gasEstimation.js.map +1 -1
- package/lib/rpc/nonceQueuer.d.ts +4 -1
- package/lib/rpc/nonceQueuer.js +9 -3
- package/lib/rpc/nonceQueuer.js.map +1 -1
- package/lib/rpc/rpcHandler.d.ts +53 -3
- package/lib/rpc/rpcHandler.js +147 -258
- package/lib/rpc/rpcHandler.js.map +1 -1
- package/lib/rpc/server.d.ts +2 -1
- package/lib/rpc/server.js +10 -1
- package/lib/rpc/server.js.map +1 -1
- package/lib/rpc/validation/SafeValidator.d.ts +5 -8
- package/lib/rpc/validation/SafeValidator.js +50 -207
- package/lib/rpc/validation/SafeValidator.js.map +1 -1
- package/lib/rpc/validation/TracerResultParserV07.js +6 -2
- package/lib/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/lib/rpc/validation/UnsafeValidator.d.ts +7 -3
- package/lib/rpc/validation/UnsafeValidator.js +52 -48
- package/lib/rpc/validation/UnsafeValidator.js.map +1 -1
- package/lib/rpc/validation/tracer.js +1 -0
- package/lib/rpc/validation/tracer.js.map +1 -1
- package/lib/types/contracts/EntryPointSimulations.d.ts +0 -1
- package/lib/types/contracts/EntryPointSimulations.js +1942 -3
- package/lib/types/contracts/EntryPointSimulations.js.map +1 -1
- package/lib/types/contracts/PimlicoEntryPointSimulations.d.ts +1 -1
- package/lib/types/contracts/PimlicoEntryPointSimulations.js +2 -2
- package/lib/types/contracts/PimlicoEntryPointSimulations.js.map +1 -1
- package/lib/types/schemas.d.ts +1029 -333
- package/lib/types/schemas.js +93 -19
- package/lib/types/schemas.js.map +1 -1
- package/lib/types/utils.d.ts +1 -1
- package/lib/types/validation.js +7 -2
- package/lib/types/validation.js.map +1 -1
- package/lib/utils/bigInt.d.ts +1 -0
- package/lib/utils/bigInt.js +6 -1
- package/lib/utils/bigInt.js.map +1 -1
- package/lib/utils/helpers.d.ts +1 -0
- package/lib/utils/helpers.js +8 -1
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/index.d.ts +0 -3
- package/lib/utils/index.js +0 -3
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/metrics.d.ts +4 -0
- package/lib/utils/metrics.js +29 -1
- package/lib/utils/metrics.js.map +1 -1
- package/lib/utils/rpc-reply.d.ts +1 -1
- package/lib/utils/rpc-reply.js +2 -1
- package/lib/utils/rpc-reply.js.map +1 -1
- package/lib/utils/userop.d.ts +66 -6
- package/lib/utils/userop.js +184 -95
- package/lib/utils/userop.js.map +1 -1
- package/lib/utils/validation.d.ts +1 -1
- package/lib/utils/validation.js +9 -36
- package/lib/utils/validation.js.map +1 -1
- package/package.json +16 -14
- package/esm/executor/test/utils.d.ts +0 -13
- package/esm/executor/test/utils.js +0 -75
- package/esm/executor/test/utils.js.map +0 -1
- package/esm/mempool/nullMempool.d.ts +0 -15
- package/esm/mempool/nullMempool.js +0 -36
- package/esm/mempool/nullMempool.js.map +0 -1
- package/esm/types/test/validationTestErrors.d.ts +0 -3
- package/esm/types/test/validationTestErrors.js +0 -229
- package/esm/types/test/validationTestErrors.js.map +0 -1
- package/esm/utils/compressionHandler.js.map +0 -1
- package/esm/utils/gasPriceManager.js.map +0 -1
- package/esm/utils/test.d.ts +0 -17
- package/esm/utils/test.js +0 -130
- package/esm/utils/test.js.map +0 -1
- package/lib/executor/test/utils.d.ts +0 -13
- package/lib/executor/test/utils.js +0 -81
- package/lib/executor/test/utils.js.map +0 -1
- package/lib/mempool/nullMempool.d.ts +0 -15
- package/lib/mempool/nullMempool.js +0 -40
- package/lib/mempool/nullMempool.js.map +0 -1
- package/lib/types/test/validationTestErrors.d.ts +0 -3
- package/lib/types/test/validationTestErrors.js +0 -232
- package/lib/types/test/validationTestErrors.js.map +0 -1
- package/lib/utils/compressionHandler.js.map +0 -1
- package/lib/utils/gasPriceManager.js.map +0 -1
- package/lib/utils/test.d.ts +0 -17
- package/lib/utils/test.js +0 -161
- package/lib/utils/test.js.map +0 -1
- /package/esm/{utils → handlers}/compressionHandler.d.ts +0 -0
- /package/esm/{utils → handlers}/compressionHandler.js +0 -0
- /package/lib/{utils → handlers}/compressionHandler.d.ts +0 -0
- /package/lib/{utils → handlers}/compressionHandler.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupServer.js","sourceRoot":"","sources":["../../cli/setupServer.ts"],"names":[],"mappings":";;;AACA,6CAA0D;AAC1D,2CAMsB;AACtB,mCAMkB;
|
|
1
|
+
{"version":3,"file":"setupServer.js","sourceRoot":"","sources":["../../cli/setupServer.ts"],"names":[],"mappings":";;;AACA,6CAA0D;AAC1D,6CAIuB;AACvB,2CAMsB;AACtB,mCAMkB;AAOlB,MAAM,oBAAoB,GAAG,CAAC,EAC1B,MAAM,EACN,UAAU,EACV,MAAM,EAKT,EAA8B,EAAE;IAC7B,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,2BAAiB,CACxB,MAAM,EACN,UAAU,CAAC,WAAW,EACtB,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,EACtC,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC,EAC9C,MAAM,CAAC,KAAK,CACR,EAAE,MAAM,EAAE,oBAAoB,EAAE,EAChC;YACI,KAAK,EACD,UAAU,CAAC,8BAA8B,CAAC;gBAC1C,UAAU,CAAC,WAAW,CAAC;SAC9B,CACJ,CACJ,CAAA;IACL,CAAC;IACD,OAAO,IAAI,+BAAqB,EAAE,CAAA;AACtC,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,EAClB,MAAM,EACN,UAAU,EACV,MAAM,EACN,aAAa,EACb,OAAO,EACP,eAAe,EASlB,EAAsB,EAAE;IACrB,MAAM,oBAAoB,GACtB,UAAU,CAAC,qBAAqB,CAAC,EAAE,OAAO;QAC1C,4CAA4C,CAAA;IAEhD,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,mBAAa,CACpB,MAAM,EACN,aAAa,EACb,MAAM,CAAC,KAAK,CACR,EAAE,MAAM,EAAE,KAAK,EAAE,EACjB;YACI,KAAK,EACD,UAAU,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC;SAC7D,CACJ,EACD,OAAO,EACP,eAAe,EACf,UAAU,CAAC,YAAY,CAAC,EACxB,UAAU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CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAEjC,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,MAAM,CAAA;QACpD,MAAM,SAAS,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,MAAM,CAAA;QACnD,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,MAAM,CAAA;QAClD,UAAU,CAAC,IAAI,CACX,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,EACtC,iCAAiC,CACpC,CAAA;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC,CAAA;IAED,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAA;IACtC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAA;AAC3C,CAAC,CAAA;AAnKY,QAAA,WAAW,eAmKvB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SenderManager } from "./index.js";
|
|
2
2
|
import type { InterfaceReputationManager } from "../mempool/index.js";
|
|
3
|
-
import { type
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
3
|
+
import { type TransactionInfo, type Address, type UserOperation, type BundleResult, type CompressedUserOperation } from "../types/index.js";
|
|
4
|
+
import type { Logger, Metrics } from "../utils/index.js";
|
|
5
|
+
import type { GasPriceManager, CompressionHandler, EventManager } from "../handlers/index.js";
|
|
6
6
|
import { Mutex } from "async-mutex";
|
|
7
7
|
import { type Account, type Chain, type PublicClient, type Transport, type WalletClient } from "viem";
|
|
8
8
|
export interface GasEstimateResult {
|
|
@@ -18,15 +18,6 @@ export type ReplaceTransactionResult = {
|
|
|
18
18
|
} | {
|
|
19
19
|
status: "failed";
|
|
20
20
|
};
|
|
21
|
-
export declare class NullExecutor {
|
|
22
|
-
bundle(_entryPoint: Address, _ops: UserOperation[]): Promise<BundleResult[]>;
|
|
23
|
-
bundleCompressed(_entryPoint: Address, _compressedOps: CompressedUserOperation[]): Promise<BundleResult[]>;
|
|
24
|
-
replaceTransaction(_entryPoint: Address, _transactionInfo: TransactionInfo): Promise<ReplaceTransactionResult>;
|
|
25
|
-
replaceOps(_opHashes: HexData32[]): Promise<void>;
|
|
26
|
-
cancelOps(_entryPoint: Address, _ops: UserOperation[]): Promise<void>;
|
|
27
|
-
markWalletProcessed(_executor: Account): Promise<void>;
|
|
28
|
-
flushStuckTransactions(): Promise<void>;
|
|
29
|
-
}
|
|
30
21
|
export declare class Executor {
|
|
31
22
|
publicClient: PublicClient;
|
|
32
23
|
walletClient: WalletClient<Transport, Chain, Account | undefined>;
|
|
@@ -41,9 +32,11 @@ export declare class Executor {
|
|
|
41
32
|
reputationManager: InterfaceReputationManager;
|
|
42
33
|
compressionHandler: CompressionHandler | null;
|
|
43
34
|
gasPriceManager: GasPriceManager;
|
|
44
|
-
|
|
35
|
+
blockTagSupport: boolean;
|
|
45
36
|
mutex: Mutex;
|
|
46
|
-
|
|
37
|
+
eventManager: EventManager;
|
|
38
|
+
noProfitBundling: boolean;
|
|
39
|
+
constructor(publicClient: PublicClient, walletClient: WalletClient<Transport, Chain, Account | undefined>, senderManager: SenderManager, reputationManager: InterfaceReputationManager, entryPoints: Address[], logger: Logger, metrics: Metrics, compressionHandler: CompressionHandler | null, gasPriceManager: GasPriceManager, eventManager: EventManager, simulateTransaction?: boolean, legacyTransactions?: boolean, fixedGasLimitForEstimation?: bigint, blockTagSupport?: boolean, localGasLimitCalculation?: boolean, noProfitBundling?: boolean);
|
|
47
40
|
getCompressionHandler(): CompressionHandler;
|
|
48
41
|
cancelOps(_entryPoint: Address, _ops: UserOperation[]): Promise<void>;
|
|
49
42
|
markWalletProcessed(executor: Account): Promise<void>;
|
package/lib/executor/executor.js
CHANGED
|
@@ -23,37 +23,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Executor =
|
|
26
|
+
exports.Executor = void 0;
|
|
27
27
|
const types_1 = require("../types/index.js");
|
|
28
28
|
const utils_1 = require("../utils/index.js");
|
|
29
|
+
// biome-ignore lint/style/noNamespaceImport: explicitly make it clear when sentry is used
|
|
29
30
|
const sentry = __importStar(require("@sentry/node"));
|
|
30
31
|
const async_mutex_1 = require("async-mutex");
|
|
31
32
|
const viem_1 = require("viem");
|
|
32
33
|
const utils_2 = require("./utils.js");
|
|
33
|
-
class NullExecutor {
|
|
34
|
-
bundle(_entryPoint, _ops) {
|
|
35
|
-
return Promise.resolve([]);
|
|
36
|
-
}
|
|
37
|
-
bundleCompressed(_entryPoint, _compressedOps) {
|
|
38
|
-
return Promise.resolve([]);
|
|
39
|
-
}
|
|
40
|
-
replaceTransaction(_entryPoint, _transactionInfo) {
|
|
41
|
-
return Promise.resolve({ status: "failed" });
|
|
42
|
-
}
|
|
43
|
-
replaceOps(_opHashes) {
|
|
44
|
-
return Promise.resolve();
|
|
45
|
-
}
|
|
46
|
-
cancelOps(_entryPoint, _ops) {
|
|
47
|
-
return Promise.resolve();
|
|
48
|
-
}
|
|
49
|
-
markWalletProcessed(_executor) {
|
|
50
|
-
return Promise.resolve();
|
|
51
|
-
}
|
|
52
|
-
flushStuckTransactions() {
|
|
53
|
-
return Promise.resolve();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.NullExecutor = NullExecutor;
|
|
57
34
|
class Executor {
|
|
58
35
|
// private unWatch: WatchBlocksReturnType | undefined
|
|
59
36
|
publicClient;
|
|
@@ -69,9 +46,11 @@ class Executor {
|
|
|
69
46
|
reputationManager;
|
|
70
47
|
compressionHandler;
|
|
71
48
|
gasPriceManager;
|
|
72
|
-
|
|
49
|
+
blockTagSupport;
|
|
73
50
|
mutex;
|
|
74
|
-
|
|
51
|
+
eventManager;
|
|
52
|
+
noProfitBundling; // if true, bundle such that all beneficiary fees go towards tx gasFees
|
|
53
|
+
constructor(publicClient, walletClient, senderManager, reputationManager, entryPoints, logger, metrics, compressionHandler, gasPriceManager, eventManager, simulateTransaction = false, legacyTransactions = false, fixedGasLimitForEstimation, blockTagSupport = true, localGasLimitCalculation = false, noProfitBundling = false) {
|
|
75
54
|
this.publicClient = publicClient;
|
|
76
55
|
this.walletClient = walletClient;
|
|
77
56
|
this.senderManager = senderManager;
|
|
@@ -84,8 +63,10 @@ class Executor {
|
|
|
84
63
|
this.localGasLimitCalculation = localGasLimitCalculation;
|
|
85
64
|
this.compressionHandler = compressionHandler;
|
|
86
65
|
this.gasPriceManager = gasPriceManager;
|
|
87
|
-
this.
|
|
66
|
+
this.eventManager = eventManager;
|
|
67
|
+
this.blockTagSupport = blockTagSupport;
|
|
88
68
|
this.entryPoints = entryPoints;
|
|
69
|
+
this.noProfitBundling = noProfitBundling;
|
|
89
70
|
this.mutex = new async_mutex_1.Mutex();
|
|
90
71
|
}
|
|
91
72
|
getCompressionHandler() {
|
|
@@ -152,27 +133,27 @@ class Executor {
|
|
|
152
133
|
type: "compressed"
|
|
153
134
|
};
|
|
154
135
|
}
|
|
155
|
-
|
|
136
|
+
let { simulatedOps, gasLimit } = await (0, utils_2.filterOpsAndEstimateGas)(transactionInfo.entryPoint, callContext, transactionInfo.executor, opsWithHashes, newRequest.nonce, newRequest.maxFeePerGas, newRequest.maxPriorityFeePerGas, this.blockTagSupport ? "latest" : undefined, this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, this.logger);
|
|
156
137
|
const childLogger = this.logger.child({
|
|
157
138
|
transactionHash: transactionInfo.transactionHash,
|
|
158
139
|
executor: transactionInfo.executor.address
|
|
159
140
|
});
|
|
160
|
-
if (
|
|
141
|
+
if (simulatedOps.length === 0) {
|
|
161
142
|
childLogger.warn("no ops to bundle");
|
|
162
143
|
this.markWalletProcessed(transactionInfo.executor);
|
|
163
144
|
return { status: "failed" };
|
|
164
145
|
}
|
|
165
|
-
if (
|
|
146
|
+
if (simulatedOps.every((op) => op.reason === "AA25 invalid account nonce" ||
|
|
166
147
|
op.reason === "AA10 sender already constructed")) {
|
|
167
|
-
childLogger.trace({ reasons:
|
|
148
|
+
childLogger.trace({ reasons: simulatedOps.map((sop) => sop.reason) }, "all ops failed simulation with nonce error");
|
|
168
149
|
return { status: "potentially_already_included" };
|
|
169
150
|
}
|
|
170
|
-
if (
|
|
151
|
+
if (simulatedOps.every((op) => op.reason !== undefined)) {
|
|
171
152
|
childLogger.warn("all ops failed simulation");
|
|
172
153
|
this.markWalletProcessed(transactionInfo.executor);
|
|
173
154
|
return { status: "failed" };
|
|
174
155
|
}
|
|
175
|
-
const opsToBundle =
|
|
156
|
+
const opsToBundle = simulatedOps
|
|
176
157
|
.filter((op) => op.reason === undefined)
|
|
177
158
|
.map((op) => {
|
|
178
159
|
const opInfo = transactionInfo.userOperationInfos.find((info) => info.userOperationHash === op.owh.userOperationHash);
|
|
@@ -181,15 +162,29 @@ class Executor {
|
|
|
181
162
|
}
|
|
182
163
|
return opInfo;
|
|
183
164
|
});
|
|
184
|
-
|
|
185
|
-
|
|
165
|
+
if (this.localGasLimitCalculation) {
|
|
166
|
+
gasLimit = opsToBundle.reduce((acc, opInfo) => {
|
|
186
167
|
const userOperation = (0, types_1.deriveUserOperation)(opInfo.mempoolUserOperation);
|
|
187
168
|
return (acc +
|
|
188
169
|
userOperation.preVerificationGas +
|
|
189
170
|
3n * userOperation.verificationGasLimit +
|
|
190
171
|
userOperation.callGasLimit);
|
|
191
|
-
}, 0n)
|
|
192
|
-
|
|
172
|
+
}, 0n);
|
|
173
|
+
}
|
|
174
|
+
// https://github.com/eth-infinitism/account-abstraction/blob/fa61290d37d079e928d92d53a122efcc63822214/contracts/core/EntryPoint.sol#L236
|
|
175
|
+
let innerHandleOpFloor = 0n;
|
|
176
|
+
for (const owh of opsToBundle) {
|
|
177
|
+
const op = (0, types_1.deriveUserOperation)(owh.mempoolUserOperation);
|
|
178
|
+
innerHandleOpFloor +=
|
|
179
|
+
op.callGasLimit + op.verificationGasLimit + 5000n;
|
|
180
|
+
}
|
|
181
|
+
if (gasLimit < innerHandleOpFloor) {
|
|
182
|
+
gasLimit += innerHandleOpFloor;
|
|
183
|
+
}
|
|
184
|
+
// sometimes the estimation rounds down, adding a fixed constant accounts for this
|
|
185
|
+
gasLimit += 10000n;
|
|
186
|
+
// ensures that we don't submit again with too low of a gas value
|
|
187
|
+
newRequest.gas = (0, utils_1.maxBigInt)(newRequest.gas, gasLimit);
|
|
193
188
|
// update calldata to include only ops that pass simulation
|
|
194
189
|
if (transactionInfo.transactionType === "default") {
|
|
195
190
|
const isUserOpVersion06 = opsWithHashes.reduce((acc, op) => {
|
|
@@ -241,6 +236,12 @@ class Executor {
|
|
|
241
236
|
accessList: undefined
|
|
242
237
|
}
|
|
243
238
|
: newRequest);
|
|
239
|
+
opsToBundle.map((opToBundle) => {
|
|
240
|
+
const op = (0, types_1.deriveUserOperation)(opToBundle.mempoolUserOperation);
|
|
241
|
+
const chainId = this.publicClient.chain?.id;
|
|
242
|
+
const opHash = (0, utils_1.getUserOperationHash)(op, opToBundle.entryPoint, chainId);
|
|
243
|
+
this.eventManager.emitSubmitted(opHash, txHash);
|
|
244
|
+
});
|
|
244
245
|
const newTxInfo = {
|
|
245
246
|
...transactionInfo,
|
|
246
247
|
transactionRequest: newRequest,
|
|
@@ -290,17 +291,15 @@ class Executor {
|
|
|
290
291
|
}
|
|
291
292
|
}
|
|
292
293
|
async flushStuckTransactions() {
|
|
294
|
+
const allWallets = new Set(this.senderManager.wallets);
|
|
295
|
+
const utilityWallet = this.senderManager.utilityAccount;
|
|
296
|
+
if (utilityWallet) {
|
|
297
|
+
allWallets.add(utilityWallet);
|
|
298
|
+
}
|
|
299
|
+
const wallets = Array.from(allWallets);
|
|
293
300
|
const gasPrice = await this.gasPriceManager.getGasPrice();
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
...this.senderManager.wallets,
|
|
297
|
-
this.senderManager.utilityAccount
|
|
298
|
-
]))
|
|
299
|
-
: Array.from(new Set(this.senderManager.wallets));
|
|
300
|
-
const promises = wallets.map(async (wallet) => {
|
|
301
|
-
for (const entryPoint of this.entryPoints) {
|
|
302
|
-
await (0, utils_2.flushStuckTransaction)(this.publicClient, this.walletClient, wallet, gasPrice.maxFeePerGas * 5n, this.logger, entryPoint);
|
|
303
|
-
}
|
|
301
|
+
const promises = wallets.map((wallet) => {
|
|
302
|
+
(0, utils_2.flushStuckTransaction)(this.publicClient, this.walletClient, wallet, gasPrice.maxFeePerGas * 5n, this.logger);
|
|
304
303
|
});
|
|
305
304
|
await Promise.all(promises);
|
|
306
305
|
}
|
|
@@ -343,33 +342,17 @@ class Executor {
|
|
|
343
342
|
ep,
|
|
344
343
|
type: "default"
|
|
345
344
|
};
|
|
346
|
-
let { gasLimit, simulatedOps
|
|
347
|
-
gasLimit += 10000n;
|
|
348
|
-
if (resubmitAllOps) {
|
|
349
|
-
this.markWalletProcessed(wallet);
|
|
350
|
-
return opsWithHashes.map((owh) => {
|
|
351
|
-
const bundleResult = {
|
|
352
|
-
status: "resubmit",
|
|
353
|
-
info: {
|
|
354
|
-
entryPoint,
|
|
355
|
-
userOpHash: owh.userOperationHash,
|
|
356
|
-
userOperation: owh.mempoolUserOperation,
|
|
357
|
-
reason: viem_1.FeeCapTooLowError.name
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
return bundleResult;
|
|
361
|
-
});
|
|
362
|
-
}
|
|
345
|
+
let { gasLimit, simulatedOps } = await (0, utils_2.filterOpsAndEstimateGas)(entryPoint, callContext, wallet, opsWithHashes, nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, this.blockTagSupport ? "pending" : undefined, this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, childLogger);
|
|
363
346
|
if (simulatedOps.length === 0) {
|
|
364
347
|
childLogger.error("gas limit simulation encountered unexpected failure");
|
|
365
348
|
this.markWalletProcessed(wallet);
|
|
366
|
-
return opsWithHashes.map((
|
|
349
|
+
return opsWithHashes.map(({ userOperationHash, mempoolUserOperation }) => {
|
|
367
350
|
return {
|
|
368
351
|
status: "failure",
|
|
369
352
|
error: {
|
|
370
353
|
entryPoint,
|
|
371
|
-
userOpHash:
|
|
372
|
-
userOperation:
|
|
354
|
+
userOpHash: userOperationHash,
|
|
355
|
+
userOperation: mempoolUserOperation,
|
|
373
356
|
reason: "INTERNAL FAILURE"
|
|
374
357
|
}
|
|
375
358
|
};
|
|
@@ -378,14 +361,14 @@ class Executor {
|
|
|
378
361
|
if (simulatedOps.every((op) => op.reason !== undefined)) {
|
|
379
362
|
childLogger.warn("all ops failed simulation");
|
|
380
363
|
this.markWalletProcessed(wallet);
|
|
381
|
-
return simulatedOps.map((
|
|
364
|
+
return simulatedOps.map(({ reason, owh }) => {
|
|
382
365
|
return {
|
|
383
366
|
status: "failure",
|
|
384
367
|
error: {
|
|
385
368
|
entryPoint,
|
|
386
|
-
userOpHash:
|
|
387
|
-
userOperation:
|
|
388
|
-
reason:
|
|
369
|
+
userOpHash: owh.userOperationHash,
|
|
370
|
+
userOperation: owh.mempoolUserOperation,
|
|
371
|
+
reason: reason
|
|
389
372
|
}
|
|
390
373
|
};
|
|
391
374
|
});
|
|
@@ -397,36 +380,52 @@ class Executor {
|
|
|
397
380
|
userOperations: opsWithHashToBundle.map((owh) => owh.userOperationHash),
|
|
398
381
|
entryPoint
|
|
399
382
|
});
|
|
400
|
-
|
|
401
|
-
let
|
|
383
|
+
// https://github.com/eth-infinitism/account-abstraction/blob/fa61290d37d079e928d92d53a122efcc63822214/contracts/core/EntryPoint.sol#L236
|
|
384
|
+
let innerHandleOpFloor = 0n;
|
|
385
|
+
let totalBeneficiaryFees = 0n;
|
|
386
|
+
for (const owh of opsWithHashToBundle) {
|
|
387
|
+
const op = (0, types_1.deriveUserOperation)(owh.mempoolUserOperation);
|
|
388
|
+
innerHandleOpFloor +=
|
|
389
|
+
op.callGasLimit + op.verificationGasLimit + 5000n;
|
|
390
|
+
totalBeneficiaryFees += (0, utils_1.getRequiredPrefund)(op);
|
|
391
|
+
}
|
|
392
|
+
if (gasLimit < innerHandleOpFloor) {
|
|
393
|
+
gasLimit += innerHandleOpFloor;
|
|
394
|
+
}
|
|
395
|
+
// sometimes the estimation rounds down, adding a fixed constant accounts for this
|
|
396
|
+
gasLimit += 10000n;
|
|
397
|
+
childLogger.debug({ gasLimit }, "got gas limit");
|
|
398
|
+
let transactionHash;
|
|
402
399
|
try {
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
}
|
|
400
|
+
const isLegacyTransaction = this.legacyTransactions;
|
|
401
|
+
const gasOptions = isLegacyTransaction
|
|
402
|
+
? { gasPrice: gasPriceParameters.maxFeePerGas }
|
|
407
403
|
: {
|
|
408
404
|
maxFeePerGas: gasPriceParameters.maxFeePerGas,
|
|
409
405
|
maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas
|
|
410
406
|
};
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
:
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
407
|
+
if (this.noProfitBundling) {
|
|
408
|
+
const gasPrice = totalBeneficiaryFees / gasLimit;
|
|
409
|
+
if (isLegacyTransaction) {
|
|
410
|
+
gasOptions.gasPrice = gasPrice;
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
gasOptions.maxFeePerGas = (0, utils_1.maxBigInt)(gasPrice, gasOptions.maxFeePerGas || 0n);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
const opts = {
|
|
417
|
+
account: wallet,
|
|
418
|
+
gas: gasLimit,
|
|
419
|
+
nonce: nonce,
|
|
420
|
+
...gasOptions
|
|
421
|
+
};
|
|
422
|
+
const userOps = opsWithHashToBundle.map((owh) => isUserOpVersion06
|
|
423
|
+
? owh.mempoolUserOperation
|
|
424
|
+
: (0, utils_1.toPackedUserOperation)(owh.mempoolUserOperation));
|
|
425
|
+
transactionHash = await ep.write.handleOps([userOps, wallet.address], opts);
|
|
426
|
+
opsWithHashToBundle.map(({ userOperationHash }) => {
|
|
427
|
+
this.eventManager.emitSubmitted(userOperationHash, transactionHash);
|
|
428
|
+
});
|
|
430
429
|
}
|
|
431
430
|
catch (err) {
|
|
432
431
|
const e = (0, utils_1.parseViemError)(err);
|
|
@@ -445,6 +444,23 @@ class Executor {
|
|
|
445
444
|
};
|
|
446
445
|
});
|
|
447
446
|
}
|
|
447
|
+
if (e?.details
|
|
448
|
+
.toLowerCase()
|
|
449
|
+
.includes("replacement transaction underpriced")) {
|
|
450
|
+
childLogger.error({ error: e }, "replacement transaction underpriced");
|
|
451
|
+
this.markWalletProcessed(wallet);
|
|
452
|
+
return opsWithHashToBundle.map((owh) => {
|
|
453
|
+
return {
|
|
454
|
+
status: "resubmit",
|
|
455
|
+
info: {
|
|
456
|
+
entryPoint,
|
|
457
|
+
userOpHash: owh.userOperationHash,
|
|
458
|
+
userOperation: owh.mempoolUserOperation,
|
|
459
|
+
reason: "replacement transaction underpriced"
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
});
|
|
463
|
+
}
|
|
448
464
|
sentry.captureException(err);
|
|
449
465
|
childLogger.error({ error: JSON.stringify(err) }, "error submitting bundle transaction");
|
|
450
466
|
this.markWalletProcessed(wallet);
|
|
@@ -473,7 +489,7 @@ class Executor {
|
|
|
473
489
|
entryPoint,
|
|
474
490
|
isVersion06: isUserOpVersion06,
|
|
475
491
|
transactionType: "default",
|
|
476
|
-
transactionHash:
|
|
492
|
+
transactionHash: transactionHash,
|
|
477
493
|
previousTransactionHashes: [],
|
|
478
494
|
transactionRequest: {
|
|
479
495
|
account: wallet,
|
|
@@ -513,7 +529,7 @@ class Executor {
|
|
|
513
529
|
...transactionInfo.transactionRequest,
|
|
514
530
|
abi: undefined
|
|
515
531
|
},
|
|
516
|
-
txHash,
|
|
532
|
+
txHash: transactionHash,
|
|
517
533
|
opHashes: opsWithHashToBundle.map((owh) => owh.userOperationHash)
|
|
518
534
|
}, "submitted bundle transaction");
|
|
519
535
|
return userOperationResults;
|
|
@@ -539,36 +555,23 @@ class Executor {
|
|
|
539
555
|
perOpInflatorId: compressionHandler.perOpInflatorId,
|
|
540
556
|
type: "compressed"
|
|
541
557
|
};
|
|
542
|
-
let { gasLimit, simulatedOps
|
|
558
|
+
let { gasLimit, simulatedOps } = await (0, utils_2.filterOpsAndEstimateGas)(entryPoint, callContext, wallet, compressedOps.map((compressedOp) => {
|
|
543
559
|
return {
|
|
544
560
|
mempoolUserOperation: compressedOp,
|
|
545
561
|
userOperationHash: (0, utils_1.getUserOperationHash)(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id)
|
|
546
562
|
};
|
|
547
|
-
}), nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, this.
|
|
563
|
+
}), nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, this.blockTagSupport ? "pending" : undefined, this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, childLogger);
|
|
548
564
|
gasLimit += 10000n;
|
|
549
|
-
if (resubmitAllOps) {
|
|
550
|
-
this.markWalletProcessed(wallet);
|
|
551
|
-
return compressedOps.map((compressedOp) => {
|
|
552
|
-
return {
|
|
553
|
-
status: "resubmit",
|
|
554
|
-
info: {
|
|
555
|
-
entryPoint,
|
|
556
|
-
userOpHash: (0, utils_1.getUserOperationHash)(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id),
|
|
557
|
-
userOperation: compressedOp,
|
|
558
|
-
reason: viem_1.FeeCapTooLowError.name
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
});
|
|
562
|
-
}
|
|
563
565
|
if (simulatedOps.length === 0) {
|
|
564
566
|
childLogger.warn("no ops to bundle");
|
|
565
567
|
this.markWalletProcessed(wallet);
|
|
566
568
|
return compressedOps.map((compressedOp) => {
|
|
569
|
+
const userOpHash = (0, utils_1.getUserOperationHash)(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id);
|
|
567
570
|
return {
|
|
568
571
|
status: "failure",
|
|
569
572
|
error: {
|
|
570
573
|
entryPoint,
|
|
571
|
-
userOpHash
|
|
574
|
+
userOpHash,
|
|
572
575
|
userOperation: compressedOp,
|
|
573
576
|
reason: "INTERNAL FAILURE"
|
|
574
577
|
}
|
|
@@ -579,14 +582,14 @@ class Executor {
|
|
|
579
582
|
if (simulatedOps.some((simulatedOp) => simulatedOp.reason !== undefined)) {
|
|
580
583
|
childLogger.warn("some ops failed simulation");
|
|
581
584
|
this.markWalletProcessed(wallet);
|
|
582
|
-
return simulatedOps.map((
|
|
585
|
+
return simulatedOps.map(({ reason, owh }) => {
|
|
583
586
|
return {
|
|
584
587
|
status: "failure",
|
|
585
588
|
error: {
|
|
586
589
|
entryPoint,
|
|
587
|
-
userOpHash:
|
|
588
|
-
userOperation:
|
|
589
|
-
reason:
|
|
590
|
+
userOpHash: owh.userOperationHash,
|
|
591
|
+
userOperation: owh.mempoolUserOperation,
|
|
592
|
+
reason: reason
|
|
590
593
|
}
|
|
591
594
|
};
|
|
592
595
|
});
|
|
@@ -594,7 +597,7 @@ class Executor {
|
|
|
594
597
|
const opsToBundle = simulatedOps
|
|
595
598
|
.filter((simulatedOp) => simulatedOp.reason === undefined)
|
|
596
599
|
.map((simulatedOp) => simulatedOp.owh);
|
|
597
|
-
let
|
|
600
|
+
let transactionHash;
|
|
598
601
|
try {
|
|
599
602
|
const gasOptions = this.legacyTransactions
|
|
600
603
|
? {
|
|
@@ -604,27 +607,34 @@ class Executor {
|
|
|
604
607
|
maxFeePerGas: gasPriceParameters.maxFeePerGas,
|
|
605
608
|
maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas
|
|
606
609
|
};
|
|
610
|
+
const compressedOpsToBundle = opsToBundle.map(({ mempoolUserOperation }) => {
|
|
611
|
+
const compressedOp = mempoolUserOperation;
|
|
612
|
+
return compressedOp;
|
|
613
|
+
});
|
|
607
614
|
// need to use sendTransaction to target BundleBulker's fallback
|
|
608
|
-
|
|
615
|
+
transactionHash = await this.walletClient.sendTransaction({
|
|
609
616
|
account: wallet,
|
|
610
617
|
to: compressionHandler.bundleBulkerAddress,
|
|
611
|
-
data: (0, utils_2.createCompressedCalldata)(
|
|
618
|
+
data: (0, utils_2.createCompressedCalldata)(compressedOpsToBundle, compressionHandler.perOpInflatorId),
|
|
612
619
|
gas: gasLimit,
|
|
613
620
|
nonce: nonce,
|
|
614
621
|
...gasOptions
|
|
615
622
|
});
|
|
623
|
+
opsToBundle.map(({ userOperationHash }) => {
|
|
624
|
+
this.eventManager.emitSubmitted(userOperationHash, transactionHash);
|
|
625
|
+
});
|
|
616
626
|
}
|
|
617
627
|
catch (err) {
|
|
618
628
|
sentry.captureException(err);
|
|
619
629
|
childLogger.error({ error: JSON.stringify(err) }, "error submitting bundle transaction");
|
|
620
630
|
this.markWalletProcessed(wallet);
|
|
621
|
-
return opsToBundle.map((
|
|
631
|
+
return opsToBundle.map(({ userOperationHash, mempoolUserOperation }) => {
|
|
622
632
|
return {
|
|
623
633
|
status: "failure",
|
|
624
634
|
error: {
|
|
625
635
|
entryPoint,
|
|
626
|
-
userOpHash:
|
|
627
|
-
userOperation:
|
|
636
|
+
userOpHash: userOperationHash,
|
|
637
|
+
userOperation: mempoolUserOperation,
|
|
628
638
|
reason: "INTERNAL FAILURE"
|
|
629
639
|
}
|
|
630
640
|
};
|
|
@@ -643,7 +653,7 @@ class Executor {
|
|
|
643
653
|
entryPoint,
|
|
644
654
|
isVersion06: true, //TODO: compressed bundles are always v06
|
|
645
655
|
transactionType: "compressed",
|
|
646
|
-
transactionHash
|
|
656
|
+
transactionHash,
|
|
647
657
|
previousTransactionHashes: [],
|
|
648
658
|
transactionRequest: {
|
|
649
659
|
to: compressionHandler.bundleBulkerAddress,
|
|
@@ -663,7 +673,7 @@ class Executor {
|
|
|
663
673
|
};
|
|
664
674
|
const userOperationResults = (0, utils_2.simulatedOpsToResults)(simulatedOps, transactionInfo);
|
|
665
675
|
childLogger.info({
|
|
666
|
-
txHash,
|
|
676
|
+
txHash: transactionHash,
|
|
667
677
|
opHashes: opsToBundle.map((owh) => owh.userOperationHash)
|
|
668
678
|
}, "submitted bundle transaction");
|
|
669
679
|
return userOperationResults;
|