@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,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EACH,aAAa,EACb,OAAO,EACP,qBAAqB,EACrB,iBAAiB,EAEpB,MAAM,eAAe,CAAA;AACtB,OAAO,EACH,WAAW,EACX,UAAU,EACV,aAAa,EACb,MAAM,EACN,eAAe,EAClB,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"setupServer.js","sourceRoot":"","sources":["../../cli/setupServer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAEH,kBAAkB,EAClB,YAAY,EACf,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACH,aAAa,EACb,OAAO,EACP,qBAAqB,EACrB,iBAAiB,EAEpB,MAAM,eAAe,CAAA;AACtB,OAAO,EACH,WAAW,EACX,UAAU,EACV,aAAa,EACb,MAAM,EACN,eAAe,EAClB,MAAM,WAAW,CAAA;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,iBAAiB,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,qBAAqB,EAAE,CAAA;AACtC,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,EAClB,MAAM,EACN,UAAU,EACV,MAAM,EACN,a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C,sBAAsB,EAAE,CAAA;IACrC,CAAC;IAED,UAAU,CAAC,IAAI,CACX,eAAe,aAAa,CAAC,OAAO,CAAC,MAAM,mBAAmB,CACjE,CAAA;IAED,MAAM,MAAM,GAAG,SAAS,CAAC;QACrB,WAAW;QACX,UAAU;QACV,MAAM;QACN,QAAQ;QACR,OAAO;KACV,CAAC,CAAA;IAEF,MAAM,CAAC,KAAK,EAAE,CAAA;IAEd,MAAM,gBAAgB,GAAG,KAAK,EAAE,MAAc,EAAE,EAAE;QAC9C,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,0BAA0B,CAAC,CAAA;QAEpD,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;QACnB,UAAU,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"}
|
|
@@ -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/esm/executor/executor.js
CHANGED
|
@@ -1,32 +1,10 @@
|
|
|
1
|
-
import { EntryPointV06Abi, EntryPointV07Abi
|
|
2
|
-
import { getUserOperationHash, isVersion06, maxBigInt, parseViemError, toPackedUserOperation } from "../utils/index.js";
|
|
1
|
+
import { deriveUserOperation, EntryPointV06Abi, EntryPointV07Abi } from "../types/index.js";
|
|
2
|
+
import { getRequiredPrefund, getUserOperationHash, isVersion06, maxBigInt, parseViemError, toPackedUserOperation } from "../utils/index.js";
|
|
3
|
+
// biome-ignore lint/style/noNamespaceImport: explicitly make it clear when sentry is used
|
|
3
4
|
import * as sentry from "@sentry/node";
|
|
4
5
|
import { Mutex } from "async-mutex";
|
|
5
6
|
import { FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooLowError, NonceTooLowError, encodeFunctionData, getContract } from "viem";
|
|
6
7
|
import { createCompressedCalldata, filterOpsAndEstimateGas, flushStuckTransaction, simulatedOpsToResults } from "./utils.js";
|
|
7
|
-
export class NullExecutor {
|
|
8
|
-
bundle(_entryPoint, _ops) {
|
|
9
|
-
return Promise.resolve([]);
|
|
10
|
-
}
|
|
11
|
-
bundleCompressed(_entryPoint, _compressedOps) {
|
|
12
|
-
return Promise.resolve([]);
|
|
13
|
-
}
|
|
14
|
-
replaceTransaction(_entryPoint, _transactionInfo) {
|
|
15
|
-
return Promise.resolve({ status: "failed" });
|
|
16
|
-
}
|
|
17
|
-
replaceOps(_opHashes) {
|
|
18
|
-
return Promise.resolve();
|
|
19
|
-
}
|
|
20
|
-
cancelOps(_entryPoint, _ops) {
|
|
21
|
-
return Promise.resolve();
|
|
22
|
-
}
|
|
23
|
-
markWalletProcessed(_executor) {
|
|
24
|
-
return Promise.resolve();
|
|
25
|
-
}
|
|
26
|
-
flushStuckTransactions() {
|
|
27
|
-
return Promise.resolve();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
8
|
export class Executor {
|
|
31
9
|
// private unWatch: WatchBlocksReturnType | undefined
|
|
32
10
|
publicClient;
|
|
@@ -42,9 +20,11 @@ export class Executor {
|
|
|
42
20
|
reputationManager;
|
|
43
21
|
compressionHandler;
|
|
44
22
|
gasPriceManager;
|
|
45
|
-
|
|
23
|
+
blockTagSupport;
|
|
46
24
|
mutex;
|
|
47
|
-
|
|
25
|
+
eventManager;
|
|
26
|
+
noProfitBundling; // if true, bundle such that all beneficiary fees go towards tx gasFees
|
|
27
|
+
constructor(publicClient, walletClient, senderManager, reputationManager, entryPoints, logger, metrics, compressionHandler, gasPriceManager, eventManager, simulateTransaction = false, legacyTransactions = false, fixedGasLimitForEstimation, blockTagSupport = true, localGasLimitCalculation = false, noProfitBundling = false) {
|
|
48
28
|
this.publicClient = publicClient;
|
|
49
29
|
this.walletClient = walletClient;
|
|
50
30
|
this.senderManager = senderManager;
|
|
@@ -57,8 +37,10 @@ export class Executor {
|
|
|
57
37
|
this.localGasLimitCalculation = localGasLimitCalculation;
|
|
58
38
|
this.compressionHandler = compressionHandler;
|
|
59
39
|
this.gasPriceManager = gasPriceManager;
|
|
60
|
-
this.
|
|
40
|
+
this.eventManager = eventManager;
|
|
41
|
+
this.blockTagSupport = blockTagSupport;
|
|
61
42
|
this.entryPoints = entryPoints;
|
|
43
|
+
this.noProfitBundling = noProfitBundling;
|
|
62
44
|
this.mutex = new Mutex();
|
|
63
45
|
}
|
|
64
46
|
getCompressionHandler() {
|
|
@@ -125,27 +107,27 @@ export class Executor {
|
|
|
125
107
|
type: "compressed"
|
|
126
108
|
};
|
|
127
109
|
}
|
|
128
|
-
|
|
110
|
+
let { simulatedOps, gasLimit } = await 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);
|
|
129
111
|
const childLogger = this.logger.child({
|
|
130
112
|
transactionHash: transactionInfo.transactionHash,
|
|
131
113
|
executor: transactionInfo.executor.address
|
|
132
114
|
});
|
|
133
|
-
if (
|
|
115
|
+
if (simulatedOps.length === 0) {
|
|
134
116
|
childLogger.warn("no ops to bundle");
|
|
135
117
|
this.markWalletProcessed(transactionInfo.executor);
|
|
136
118
|
return { status: "failed" };
|
|
137
119
|
}
|
|
138
|
-
if (
|
|
120
|
+
if (simulatedOps.every((op) => op.reason === "AA25 invalid account nonce" ||
|
|
139
121
|
op.reason === "AA10 sender already constructed")) {
|
|
140
|
-
childLogger.trace({ reasons:
|
|
122
|
+
childLogger.trace({ reasons: simulatedOps.map((sop) => sop.reason) }, "all ops failed simulation with nonce error");
|
|
141
123
|
return { status: "potentially_already_included" };
|
|
142
124
|
}
|
|
143
|
-
if (
|
|
125
|
+
if (simulatedOps.every((op) => op.reason !== undefined)) {
|
|
144
126
|
childLogger.warn("all ops failed simulation");
|
|
145
127
|
this.markWalletProcessed(transactionInfo.executor);
|
|
146
128
|
return { status: "failed" };
|
|
147
129
|
}
|
|
148
|
-
const opsToBundle =
|
|
130
|
+
const opsToBundle = simulatedOps
|
|
149
131
|
.filter((op) => op.reason === undefined)
|
|
150
132
|
.map((op) => {
|
|
151
133
|
const opInfo = transactionInfo.userOperationInfos.find((info) => info.userOperationHash === op.owh.userOperationHash);
|
|
@@ -154,15 +136,29 @@ export class Executor {
|
|
|
154
136
|
}
|
|
155
137
|
return opInfo;
|
|
156
138
|
});
|
|
157
|
-
|
|
158
|
-
|
|
139
|
+
if (this.localGasLimitCalculation) {
|
|
140
|
+
gasLimit = opsToBundle.reduce((acc, opInfo) => {
|
|
159
141
|
const userOperation = deriveUserOperation(opInfo.mempoolUserOperation);
|
|
160
142
|
return (acc +
|
|
161
143
|
userOperation.preVerificationGas +
|
|
162
144
|
3n * userOperation.verificationGasLimit +
|
|
163
145
|
userOperation.callGasLimit);
|
|
164
|
-
}, 0n)
|
|
165
|
-
|
|
146
|
+
}, 0n);
|
|
147
|
+
}
|
|
148
|
+
// https://github.com/eth-infinitism/account-abstraction/blob/fa61290d37d079e928d92d53a122efcc63822214/contracts/core/EntryPoint.sol#L236
|
|
149
|
+
let innerHandleOpFloor = 0n;
|
|
150
|
+
for (const owh of opsToBundle) {
|
|
151
|
+
const op = deriveUserOperation(owh.mempoolUserOperation);
|
|
152
|
+
innerHandleOpFloor +=
|
|
153
|
+
op.callGasLimit + op.verificationGasLimit + 5000n;
|
|
154
|
+
}
|
|
155
|
+
if (gasLimit < innerHandleOpFloor) {
|
|
156
|
+
gasLimit += innerHandleOpFloor;
|
|
157
|
+
}
|
|
158
|
+
// sometimes the estimation rounds down, adding a fixed constant accounts for this
|
|
159
|
+
gasLimit += 10000n;
|
|
160
|
+
// ensures that we don't submit again with too low of a gas value
|
|
161
|
+
newRequest.gas = maxBigInt(newRequest.gas, gasLimit);
|
|
166
162
|
// update calldata to include only ops that pass simulation
|
|
167
163
|
if (transactionInfo.transactionType === "default") {
|
|
168
164
|
const isUserOpVersion06 = opsWithHashes.reduce((acc, op) => {
|
|
@@ -214,6 +210,12 @@ export class Executor {
|
|
|
214
210
|
accessList: undefined
|
|
215
211
|
}
|
|
216
212
|
: newRequest);
|
|
213
|
+
opsToBundle.map((opToBundle) => {
|
|
214
|
+
const op = deriveUserOperation(opToBundle.mempoolUserOperation);
|
|
215
|
+
const chainId = this.publicClient.chain?.id;
|
|
216
|
+
const opHash = getUserOperationHash(op, opToBundle.entryPoint, chainId);
|
|
217
|
+
this.eventManager.emitSubmitted(opHash, txHash);
|
|
218
|
+
});
|
|
217
219
|
const newTxInfo = {
|
|
218
220
|
...transactionInfo,
|
|
219
221
|
transactionRequest: newRequest,
|
|
@@ -263,17 +265,15 @@ export class Executor {
|
|
|
263
265
|
}
|
|
264
266
|
}
|
|
265
267
|
async flushStuckTransactions() {
|
|
268
|
+
const allWallets = new Set(this.senderManager.wallets);
|
|
269
|
+
const utilityWallet = this.senderManager.utilityAccount;
|
|
270
|
+
if (utilityWallet) {
|
|
271
|
+
allWallets.add(utilityWallet);
|
|
272
|
+
}
|
|
273
|
+
const wallets = Array.from(allWallets);
|
|
266
274
|
const gasPrice = await this.gasPriceManager.getGasPrice();
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
...this.senderManager.wallets,
|
|
270
|
-
this.senderManager.utilityAccount
|
|
271
|
-
]))
|
|
272
|
-
: Array.from(new Set(this.senderManager.wallets));
|
|
273
|
-
const promises = wallets.map(async (wallet) => {
|
|
274
|
-
for (const entryPoint of this.entryPoints) {
|
|
275
|
-
await flushStuckTransaction(this.publicClient, this.walletClient, wallet, gasPrice.maxFeePerGas * 5n, this.logger, entryPoint);
|
|
276
|
-
}
|
|
275
|
+
const promises = wallets.map((wallet) => {
|
|
276
|
+
flushStuckTransaction(this.publicClient, this.walletClient, wallet, gasPrice.maxFeePerGas * 5n, this.logger);
|
|
277
277
|
});
|
|
278
278
|
await Promise.all(promises);
|
|
279
279
|
}
|
|
@@ -316,33 +316,17 @@ export class Executor {
|
|
|
316
316
|
ep,
|
|
317
317
|
type: "default"
|
|
318
318
|
};
|
|
319
|
-
let { gasLimit, simulatedOps
|
|
320
|
-
gasLimit += 10000n;
|
|
321
|
-
if (resubmitAllOps) {
|
|
322
|
-
this.markWalletProcessed(wallet);
|
|
323
|
-
return opsWithHashes.map((owh) => {
|
|
324
|
-
const bundleResult = {
|
|
325
|
-
status: "resubmit",
|
|
326
|
-
info: {
|
|
327
|
-
entryPoint,
|
|
328
|
-
userOpHash: owh.userOperationHash,
|
|
329
|
-
userOperation: owh.mempoolUserOperation,
|
|
330
|
-
reason: FeeCapTooLowError.name
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
return bundleResult;
|
|
334
|
-
});
|
|
335
|
-
}
|
|
319
|
+
let { gasLimit, simulatedOps } = await filterOpsAndEstimateGas(entryPoint, callContext, wallet, opsWithHashes, nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, this.blockTagSupport ? "pending" : undefined, this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, childLogger);
|
|
336
320
|
if (simulatedOps.length === 0) {
|
|
337
321
|
childLogger.error("gas limit simulation encountered unexpected failure");
|
|
338
322
|
this.markWalletProcessed(wallet);
|
|
339
|
-
return opsWithHashes.map((
|
|
323
|
+
return opsWithHashes.map(({ userOperationHash, mempoolUserOperation }) => {
|
|
340
324
|
return {
|
|
341
325
|
status: "failure",
|
|
342
326
|
error: {
|
|
343
327
|
entryPoint,
|
|
344
|
-
userOpHash:
|
|
345
|
-
userOperation:
|
|
328
|
+
userOpHash: userOperationHash,
|
|
329
|
+
userOperation: mempoolUserOperation,
|
|
346
330
|
reason: "INTERNAL FAILURE"
|
|
347
331
|
}
|
|
348
332
|
};
|
|
@@ -351,14 +335,14 @@ export class Executor {
|
|
|
351
335
|
if (simulatedOps.every((op) => op.reason !== undefined)) {
|
|
352
336
|
childLogger.warn("all ops failed simulation");
|
|
353
337
|
this.markWalletProcessed(wallet);
|
|
354
|
-
return simulatedOps.map((
|
|
338
|
+
return simulatedOps.map(({ reason, owh }) => {
|
|
355
339
|
return {
|
|
356
340
|
status: "failure",
|
|
357
341
|
error: {
|
|
358
342
|
entryPoint,
|
|
359
|
-
userOpHash:
|
|
360
|
-
userOperation:
|
|
361
|
-
reason:
|
|
343
|
+
userOpHash: owh.userOperationHash,
|
|
344
|
+
userOperation: owh.mempoolUserOperation,
|
|
345
|
+
reason: reason
|
|
362
346
|
}
|
|
363
347
|
};
|
|
364
348
|
});
|
|
@@ -370,36 +354,52 @@ export class Executor {
|
|
|
370
354
|
userOperations: opsWithHashToBundle.map((owh) => owh.userOperationHash),
|
|
371
355
|
entryPoint
|
|
372
356
|
});
|
|
373
|
-
|
|
374
|
-
let
|
|
357
|
+
// https://github.com/eth-infinitism/account-abstraction/blob/fa61290d37d079e928d92d53a122efcc63822214/contracts/core/EntryPoint.sol#L236
|
|
358
|
+
let innerHandleOpFloor = 0n;
|
|
359
|
+
let totalBeneficiaryFees = 0n;
|
|
360
|
+
for (const owh of opsWithHashToBundle) {
|
|
361
|
+
const op = deriveUserOperation(owh.mempoolUserOperation);
|
|
362
|
+
innerHandleOpFloor +=
|
|
363
|
+
op.callGasLimit + op.verificationGasLimit + 5000n;
|
|
364
|
+
totalBeneficiaryFees += getRequiredPrefund(op);
|
|
365
|
+
}
|
|
366
|
+
if (gasLimit < innerHandleOpFloor) {
|
|
367
|
+
gasLimit += innerHandleOpFloor;
|
|
368
|
+
}
|
|
369
|
+
// sometimes the estimation rounds down, adding a fixed constant accounts for this
|
|
370
|
+
gasLimit += 10000n;
|
|
371
|
+
childLogger.debug({ gasLimit }, "got gas limit");
|
|
372
|
+
let transactionHash;
|
|
375
373
|
try {
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}
|
|
374
|
+
const isLegacyTransaction = this.legacyTransactions;
|
|
375
|
+
const gasOptions = isLegacyTransaction
|
|
376
|
+
? { gasPrice: gasPriceParameters.maxFeePerGas }
|
|
380
377
|
: {
|
|
381
378
|
maxFeePerGas: gasPriceParameters.maxFeePerGas,
|
|
382
379
|
maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas
|
|
383
380
|
};
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
:
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
381
|
+
if (this.noProfitBundling) {
|
|
382
|
+
const gasPrice = totalBeneficiaryFees / gasLimit;
|
|
383
|
+
if (isLegacyTransaction) {
|
|
384
|
+
gasOptions.gasPrice = gasPrice;
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
gasOptions.maxFeePerGas = maxBigInt(gasPrice, gasOptions.maxFeePerGas || 0n);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
const opts = {
|
|
391
|
+
account: wallet,
|
|
392
|
+
gas: gasLimit,
|
|
393
|
+
nonce: nonce,
|
|
394
|
+
...gasOptions
|
|
395
|
+
};
|
|
396
|
+
const userOps = opsWithHashToBundle.map((owh) => isUserOpVersion06
|
|
397
|
+
? owh.mempoolUserOperation
|
|
398
|
+
: toPackedUserOperation(owh.mempoolUserOperation));
|
|
399
|
+
transactionHash = await ep.write.handleOps([userOps, wallet.address], opts);
|
|
400
|
+
opsWithHashToBundle.map(({ userOperationHash }) => {
|
|
401
|
+
this.eventManager.emitSubmitted(userOperationHash, transactionHash);
|
|
402
|
+
});
|
|
403
403
|
}
|
|
404
404
|
catch (err) {
|
|
405
405
|
const e = parseViemError(err);
|
|
@@ -418,6 +418,23 @@ export class Executor {
|
|
|
418
418
|
};
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
|
+
if (e?.details
|
|
422
|
+
.toLowerCase()
|
|
423
|
+
.includes("replacement transaction underpriced")) {
|
|
424
|
+
childLogger.error({ error: e }, "replacement transaction underpriced");
|
|
425
|
+
this.markWalletProcessed(wallet);
|
|
426
|
+
return opsWithHashToBundle.map((owh) => {
|
|
427
|
+
return {
|
|
428
|
+
status: "resubmit",
|
|
429
|
+
info: {
|
|
430
|
+
entryPoint,
|
|
431
|
+
userOpHash: owh.userOperationHash,
|
|
432
|
+
userOperation: owh.mempoolUserOperation,
|
|
433
|
+
reason: "replacement transaction underpriced"
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
});
|
|
437
|
+
}
|
|
421
438
|
sentry.captureException(err);
|
|
422
439
|
childLogger.error({ error: JSON.stringify(err) }, "error submitting bundle transaction");
|
|
423
440
|
this.markWalletProcessed(wallet);
|
|
@@ -446,7 +463,7 @@ export class Executor {
|
|
|
446
463
|
entryPoint,
|
|
447
464
|
isVersion06: isUserOpVersion06,
|
|
448
465
|
transactionType: "default",
|
|
449
|
-
transactionHash:
|
|
466
|
+
transactionHash: transactionHash,
|
|
450
467
|
previousTransactionHashes: [],
|
|
451
468
|
transactionRequest: {
|
|
452
469
|
account: wallet,
|
|
@@ -486,7 +503,7 @@ export class Executor {
|
|
|
486
503
|
...transactionInfo.transactionRequest,
|
|
487
504
|
abi: undefined
|
|
488
505
|
},
|
|
489
|
-
txHash,
|
|
506
|
+
txHash: transactionHash,
|
|
490
507
|
opHashes: opsWithHashToBundle.map((owh) => owh.userOperationHash)
|
|
491
508
|
}, "submitted bundle transaction");
|
|
492
509
|
return userOperationResults;
|
|
@@ -512,36 +529,23 @@ export class Executor {
|
|
|
512
529
|
perOpInflatorId: compressionHandler.perOpInflatorId,
|
|
513
530
|
type: "compressed"
|
|
514
531
|
};
|
|
515
|
-
let { gasLimit, simulatedOps
|
|
532
|
+
let { gasLimit, simulatedOps } = await filterOpsAndEstimateGas(entryPoint, callContext, wallet, compressedOps.map((compressedOp) => {
|
|
516
533
|
return {
|
|
517
534
|
mempoolUserOperation: compressedOp,
|
|
518
535
|
userOperationHash: getUserOperationHash(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id)
|
|
519
536
|
};
|
|
520
|
-
}), nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, this.
|
|
537
|
+
}), nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, this.blockTagSupport ? "pending" : undefined, this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, childLogger);
|
|
521
538
|
gasLimit += 10000n;
|
|
522
|
-
if (resubmitAllOps) {
|
|
523
|
-
this.markWalletProcessed(wallet);
|
|
524
|
-
return compressedOps.map((compressedOp) => {
|
|
525
|
-
return {
|
|
526
|
-
status: "resubmit",
|
|
527
|
-
info: {
|
|
528
|
-
entryPoint,
|
|
529
|
-
userOpHash: getUserOperationHash(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id),
|
|
530
|
-
userOperation: compressedOp,
|
|
531
|
-
reason: FeeCapTooLowError.name
|
|
532
|
-
}
|
|
533
|
-
};
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
539
|
if (simulatedOps.length === 0) {
|
|
537
540
|
childLogger.warn("no ops to bundle");
|
|
538
541
|
this.markWalletProcessed(wallet);
|
|
539
542
|
return compressedOps.map((compressedOp) => {
|
|
543
|
+
const userOpHash = getUserOperationHash(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id);
|
|
540
544
|
return {
|
|
541
545
|
status: "failure",
|
|
542
546
|
error: {
|
|
543
547
|
entryPoint,
|
|
544
|
-
userOpHash
|
|
548
|
+
userOpHash,
|
|
545
549
|
userOperation: compressedOp,
|
|
546
550
|
reason: "INTERNAL FAILURE"
|
|
547
551
|
}
|
|
@@ -552,14 +556,14 @@ export class Executor {
|
|
|
552
556
|
if (simulatedOps.some((simulatedOp) => simulatedOp.reason !== undefined)) {
|
|
553
557
|
childLogger.warn("some ops failed simulation");
|
|
554
558
|
this.markWalletProcessed(wallet);
|
|
555
|
-
return simulatedOps.map((
|
|
559
|
+
return simulatedOps.map(({ reason, owh }) => {
|
|
556
560
|
return {
|
|
557
561
|
status: "failure",
|
|
558
562
|
error: {
|
|
559
563
|
entryPoint,
|
|
560
|
-
userOpHash:
|
|
561
|
-
userOperation:
|
|
562
|
-
reason:
|
|
564
|
+
userOpHash: owh.userOperationHash,
|
|
565
|
+
userOperation: owh.mempoolUserOperation,
|
|
566
|
+
reason: reason
|
|
563
567
|
}
|
|
564
568
|
};
|
|
565
569
|
});
|
|
@@ -567,7 +571,7 @@ export class Executor {
|
|
|
567
571
|
const opsToBundle = simulatedOps
|
|
568
572
|
.filter((simulatedOp) => simulatedOp.reason === undefined)
|
|
569
573
|
.map((simulatedOp) => simulatedOp.owh);
|
|
570
|
-
let
|
|
574
|
+
let transactionHash;
|
|
571
575
|
try {
|
|
572
576
|
const gasOptions = this.legacyTransactions
|
|
573
577
|
? {
|
|
@@ -577,27 +581,34 @@ export class Executor {
|
|
|
577
581
|
maxFeePerGas: gasPriceParameters.maxFeePerGas,
|
|
578
582
|
maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas
|
|
579
583
|
};
|
|
584
|
+
const compressedOpsToBundle = opsToBundle.map(({ mempoolUserOperation }) => {
|
|
585
|
+
const compressedOp = mempoolUserOperation;
|
|
586
|
+
return compressedOp;
|
|
587
|
+
});
|
|
580
588
|
// need to use sendTransaction to target BundleBulker's fallback
|
|
581
|
-
|
|
589
|
+
transactionHash = await this.walletClient.sendTransaction({
|
|
582
590
|
account: wallet,
|
|
583
591
|
to: compressionHandler.bundleBulkerAddress,
|
|
584
|
-
data: createCompressedCalldata(
|
|
592
|
+
data: createCompressedCalldata(compressedOpsToBundle, compressionHandler.perOpInflatorId),
|
|
585
593
|
gas: gasLimit,
|
|
586
594
|
nonce: nonce,
|
|
587
595
|
...gasOptions
|
|
588
596
|
});
|
|
597
|
+
opsToBundle.map(({ userOperationHash }) => {
|
|
598
|
+
this.eventManager.emitSubmitted(userOperationHash, transactionHash);
|
|
599
|
+
});
|
|
589
600
|
}
|
|
590
601
|
catch (err) {
|
|
591
602
|
sentry.captureException(err);
|
|
592
603
|
childLogger.error({ error: JSON.stringify(err) }, "error submitting bundle transaction");
|
|
593
604
|
this.markWalletProcessed(wallet);
|
|
594
|
-
return opsToBundle.map((
|
|
605
|
+
return opsToBundle.map(({ userOperationHash, mempoolUserOperation }) => {
|
|
595
606
|
return {
|
|
596
607
|
status: "failure",
|
|
597
608
|
error: {
|
|
598
609
|
entryPoint,
|
|
599
|
-
userOpHash:
|
|
600
|
-
userOperation:
|
|
610
|
+
userOpHash: userOperationHash,
|
|
611
|
+
userOperation: mempoolUserOperation,
|
|
601
612
|
reason: "INTERNAL FAILURE"
|
|
602
613
|
}
|
|
603
614
|
};
|
|
@@ -616,7 +627,7 @@ export class Executor {
|
|
|
616
627
|
entryPoint,
|
|
617
628
|
isVersion06: true, //TODO: compressed bundles are always v06
|
|
618
629
|
transactionType: "compressed",
|
|
619
|
-
transactionHash
|
|
630
|
+
transactionHash,
|
|
620
631
|
previousTransactionHashes: [],
|
|
621
632
|
transactionRequest: {
|
|
622
633
|
to: compressionHandler.bundleBulkerAddress,
|
|
@@ -636,7 +647,7 @@ export class Executor {
|
|
|
636
647
|
};
|
|
637
648
|
const userOperationResults = simulatedOpsToResults(simulatedOps, transactionInfo);
|
|
638
649
|
childLogger.info({
|
|
639
|
-
txHash,
|
|
650
|
+
txHash: transactionHash,
|
|
640
651
|
opHashes: opsToBundle.map((owh) => owh.userOperationHash)
|
|
641
652
|
}, "submitted bundle transaction");
|
|
642
653
|
return userOperationResults;
|