@pimlico/alto 0.0.0-staging.20240606T110517 → 0.0.2

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.
Files changed (230) hide show
  1. package/LICENSE +674 -0
  2. package/lib/executor/executor.js +6 -0
  3. package/lib/executor/executor.js.map +1 -1
  4. package/lib/executor/executorManager.js +1 -0
  5. package/lib/executor/executorManager.js.map +1 -1
  6. package/lib/executor/utils.js +3 -1
  7. package/lib/executor/utils.js.map +1 -1
  8. package/lib/rpc/server.js +2 -1
  9. package/lib/rpc/server.js.map +1 -1
  10. package/lib/types/mempool.d.ts +2 -1
  11. package/package.json +11 -12
  12. package/esm/cli/alto.d.ts +0 -6
  13. package/esm/cli/alto.js +0 -92
  14. package/esm/cli/alto.js.map +0 -1
  15. package/esm/cli/config/bundler.d.ts +0 -391
  16. package/esm/cli/config/bundler.js +0 -132
  17. package/esm/cli/config/bundler.js.map +0 -1
  18. package/esm/cli/config/index.d.ts +0 -3
  19. package/esm/cli/config/index.js +0 -3
  20. package/esm/cli/config/index.js.map +0 -1
  21. package/esm/cli/config/options.d.ts +0 -11
  22. package/esm/cli/config/options.js +0 -336
  23. package/esm/cli/config/options.js.map +0 -1
  24. package/esm/cli/customTransport.d.ts +0 -14
  25. package/esm/cli/customTransport.js +0 -53
  26. package/esm/cli/customTransport.js.map +0 -1
  27. package/esm/cli/handler.d.ts +0 -3
  28. package/esm/cli/handler.js +0 -116
  29. package/esm/cli/handler.js.map +0 -1
  30. package/esm/cli/index.d.ts +0 -4
  31. package/esm/cli/index.js +0 -4
  32. package/esm/cli/index.js.map +0 -1
  33. package/esm/cli/instrumentation.d.ts +0 -2
  34. package/esm/cli/instrumentation.js +0 -39
  35. package/esm/cli/instrumentation.js.map +0 -1
  36. package/esm/cli/setupServer.d.ts +0 -17
  37. package/esm/cli/setupServer.js +0 -155
  38. package/esm/cli/setupServer.js.map +0 -1
  39. package/esm/cli/util.d.ts +0 -22
  40. package/esm/cli/util.js +0 -30
  41. package/esm/cli/util.js.map +0 -1
  42. package/esm/executor/executor.d.ts +0 -54
  43. package/esm/executor/executor.js +0 -637
  44. package/esm/executor/executor.js.map +0 -1
  45. package/esm/executor/executorManager.d.ts +0 -34
  46. package/esm/executor/executorManager.js +0 -401
  47. package/esm/executor/executorManager.js.map +0 -1
  48. package/esm/executor/index.d.ts +0 -5
  49. package/esm/executor/index.js +0 -5
  50. package/esm/executor/index.js.map +0 -1
  51. package/esm/executor/senderManager.d.ts +0 -17
  52. package/esm/executor/senderManager.js +0 -160
  53. package/esm/executor/senderManager.js.map +0 -1
  54. package/esm/executor/test/utils.d.ts +0 -13
  55. package/esm/executor/test/utils.js +0 -75
  56. package/esm/executor/test/utils.js.map +0 -1
  57. package/esm/executor/utils.d.ts +0 -32
  58. package/esm/executor/utils.js +0 -239
  59. package/esm/executor/utils.js.map +0 -1
  60. package/esm/index.d.ts +0 -2
  61. package/esm/index.js +0 -2
  62. package/esm/index.js.map +0 -1
  63. package/esm/mempool/index.d.ts +0 -5
  64. package/esm/mempool/index.js +0 -5
  65. package/esm/mempool/index.js.map +0 -1
  66. package/esm/mempool/mempool.d.ts +0 -64
  67. package/esm/mempool/mempool.js +0 -489
  68. package/esm/mempool/mempool.js.map +0 -1
  69. package/esm/mempool/monitoring.d.ts +0 -10
  70. package/esm/mempool/monitoring.js +0 -34
  71. package/esm/mempool/monitoring.js.map +0 -1
  72. package/esm/mempool/nullMempool.d.ts +0 -15
  73. package/esm/mempool/nullMempool.js +0 -36
  74. package/esm/mempool/nullMempool.js.map +0 -1
  75. package/esm/mempool/reputationManager.d.ts +0 -115
  76. package/esm/mempool/reputationManager.js +0 -397
  77. package/esm/mempool/reputationManager.js.map +0 -1
  78. package/esm/mempool/store.d.ts +0 -22
  79. package/esm/mempool/store.js +0 -123
  80. package/esm/mempool/store.js.map +0 -1
  81. package/esm/rpc/EntryPointSimulationsV07.d.ts +0 -58
  82. package/esm/rpc/EntryPointSimulationsV07.js +0 -407
  83. package/esm/rpc/EntryPointSimulationsV07.js.map +0 -1
  84. package/esm/rpc/ExecuteSimulator.d.ts +0 -37
  85. package/esm/rpc/ExecuteSimulator.js +0 -48
  86. package/esm/rpc/ExecuteSimulator.js.map +0 -1
  87. package/esm/rpc/gasEstimation.d.ts +0 -17
  88. package/esm/rpc/gasEstimation.js +0 -410
  89. package/esm/rpc/gasEstimation.js.map +0 -1
  90. package/esm/rpc/index.d.ts +0 -5
  91. package/esm/rpc/index.js +0 -5
  92. package/esm/rpc/index.js.map +0 -1
  93. package/esm/rpc/nonceQueuer.d.ts +0 -25
  94. package/esm/rpc/nonceQueuer.js +0 -135
  95. package/esm/rpc/nonceQueuer.js.map +0 -1
  96. package/esm/rpc/rpcHandler.d.ts +0 -64
  97. package/esm/rpc/rpcHandler.js +0 -727
  98. package/esm/rpc/rpcHandler.js.map +0 -1
  99. package/esm/rpc/server.d.ts +0 -31
  100. package/esm/rpc/server.js +0 -238
  101. package/esm/rpc/server.js.map +0 -1
  102. package/esm/rpc/validation/BundlerCollectorTracerV06.d.ts +0 -102
  103. package/esm/rpc/validation/BundlerCollectorTracerV06.js +0 -255
  104. package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +0 -1
  105. package/esm/rpc/validation/BundlerCollectorTracerV07.d.ts +0 -102
  106. package/esm/rpc/validation/BundlerCollectorTracerV07.js +0 -254
  107. package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +0 -1
  108. package/esm/rpc/validation/SafeValidator.d.ts +0 -35
  109. package/esm/rpc/validation/SafeValidator.js +0 -487
  110. package/esm/rpc/validation/SafeValidator.js.map +0 -1
  111. package/esm/rpc/validation/TracerResultParserV06.d.ts +0 -13
  112. package/esm/rpc/validation/TracerResultParserV06.js +0 -578
  113. package/esm/rpc/validation/TracerResultParserV06.js.map +0 -1
  114. package/esm/rpc/validation/TracerResultParserV07.d.ts +0 -33
  115. package/esm/rpc/validation/TracerResultParserV07.js +0 -557
  116. package/esm/rpc/validation/TracerResultParserV07.js.map +0 -1
  117. package/esm/rpc/validation/UnsafeValidator.d.ts +0 -63
  118. package/esm/rpc/validation/UnsafeValidator.js +0 -257
  119. package/esm/rpc/validation/UnsafeValidator.js.map +0 -1
  120. package/esm/rpc/validation/index.d.ts +0 -3
  121. package/esm/rpc/validation/index.js +0 -3
  122. package/esm/rpc/validation/index.js.map +0 -1
  123. package/esm/rpc/validation/tracer.d.ts +0 -122
  124. package/esm/rpc/validation/tracer.js +0 -82
  125. package/esm/rpc/validation/tracer.js.map +0 -1
  126. package/esm/types/contracts/BundleBulker.d.ts +0 -120
  127. package/esm/types/contracts/BundleBulker.js +0 -157
  128. package/esm/types/contracts/BundleBulker.js.map +0 -1
  129. package/esm/types/contracts/CallEngine.d.ts +0 -28
  130. package/esm/types/contracts/CallEngine.js +0 -37
  131. package/esm/types/contracts/CallEngine.js.map +0 -1
  132. package/esm/types/contracts/CodeHashGetter.d.ts +0 -37
  133. package/esm/types/contracts/CodeHashGetter.js +0 -45
  134. package/esm/types/contracts/CodeHashGetter.js.map +0 -1
  135. package/esm/types/contracts/EntryPoint.d.ts +0 -1789
  136. package/esm/types/contracts/EntryPoint.js +0 -2304
  137. package/esm/types/contracts/EntryPoint.js.map +0 -1
  138. package/esm/types/contracts/EntryPointSimulations.d.ts +0 -153
  139. package/esm/types/contracts/EntryPointSimulations.js +0 -15
  140. package/esm/types/contracts/EntryPointSimulations.js.map +0 -1
  141. package/esm/types/contracts/IOpInflator.d.ts +0 -61
  142. package/esm/types/contracts/IOpInflator.js +0 -80
  143. package/esm/types/contracts/IOpInflator.js.map +0 -1
  144. package/esm/types/contracts/IPaymaster.d.ts +0 -3
  145. package/esm/types/contracts/IPaymaster.js +0 -117
  146. package/esm/types/contracts/IPaymaster.js.map +0 -1
  147. package/esm/types/contracts/Inflator.d.ts +0 -65
  148. package/esm/types/contracts/Inflator.js +0 -84
  149. package/esm/types/contracts/Inflator.js.map +0 -1
  150. package/esm/types/contracts/PerOpInflator.d.ts +0 -176
  151. package/esm/types/contracts/PerOpInflator.js +0 -229
  152. package/esm/types/contracts/PerOpInflator.js.map +0 -1
  153. package/esm/types/contracts/PimlicoEntryPointSimulations.d.ts +0 -23
  154. package/esm/types/contracts/PimlicoEntryPointSimulations.js +0 -33
  155. package/esm/types/contracts/PimlicoEntryPointSimulations.js.map +0 -1
  156. package/esm/types/contracts/SenderCreator.d.ts +0 -4
  157. package/esm/types/contracts/SenderCreator.js +0 -23
  158. package/esm/types/contracts/SenderCreator.js.map +0 -1
  159. package/esm/types/contracts/SimpleAccountFactory.d.ts +0 -57
  160. package/esm/types/contracts/SimpleAccountFactory.js +0 -76
  161. package/esm/types/contracts/SimpleAccountFactory.js.map +0 -1
  162. package/esm/types/contracts/TestOpcodesAccount.d.ts +0 -4
  163. package/esm/types/contracts/TestOpcodesAccount.js +0 -281
  164. package/esm/types/contracts/TestOpcodesAccount.js.map +0 -1
  165. package/esm/types/contracts/TestOpcodesAccountFactory.d.ts +0 -4
  166. package/esm/types/contracts/TestOpcodesAccountFactory.js +0 -23
  167. package/esm/types/contracts/TestOpcodesAccountFactory.js.map +0 -1
  168. package/esm/types/contracts/TestStorageAccount.d.ts +0 -4
  169. package/esm/types/contracts/TestStorageAccount.js +0 -313
  170. package/esm/types/contracts/TestStorageAccount.js.map +0 -1
  171. package/esm/types/contracts/index.d.ts +0 -17
  172. package/esm/types/contracts/index.js +0 -17
  173. package/esm/types/contracts/index.js.map +0 -1
  174. package/esm/types/gasPrice.d.ts +0 -110
  175. package/esm/types/gasPrice.js +0 -52
  176. package/esm/types/gasPrice.js.map +0 -1
  177. package/esm/types/index.d.ts +0 -11
  178. package/esm/types/index.js +0 -11
  179. package/esm/types/index.js.map +0 -1
  180. package/esm/types/interfaces.d.ts +0 -26
  181. package/esm/types/interfaces.js +0 -2
  182. package/esm/types/interfaces.js.map +0 -1
  183. package/esm/types/mempool.d.ts +0 -78
  184. package/esm/types/mempool.js +0 -16
  185. package/esm/types/mempool.js.map +0 -1
  186. package/esm/types/schemas.d.ts +0 -4791
  187. package/esm/types/schemas.js +0 -497
  188. package/esm/types/schemas.js.map +0 -1
  189. package/esm/types/test/validationTestErrors.d.ts +0 -3
  190. package/esm/types/test/validationTestErrors.js +0 -229
  191. package/esm/types/test/validationTestErrors.js.map +0 -1
  192. package/esm/types/utils.d.ts +0 -24
  193. package/esm/types/utils.js +0 -30
  194. package/esm/types/utils.js.map +0 -1
  195. package/esm/types/validation.d.ts +0 -14327
  196. package/esm/types/validation.js +0 -304
  197. package/esm/types/validation.js.map +0 -1
  198. package/esm/utils/bigInt.d.ts +0 -3
  199. package/esm/utils/bigInt.js +0 -9
  200. package/esm/utils/bigInt.js.map +0 -1
  201. package/esm/utils/compressionHandler.d.ts +0 -11
  202. package/esm/utils/compressionHandler.js +0 -39
  203. package/esm/utils/compressionHandler.js.map +0 -1
  204. package/esm/utils/gasPriceManager.d.ts +0 -34
  205. package/esm/utils/gasPriceManager.js +0 -338
  206. package/esm/utils/gasPriceManager.js.map +0 -1
  207. package/esm/utils/helpers.d.ts +0 -4
  208. package/esm/utils/helpers.js +0 -13
  209. package/esm/utils/helpers.js.map +0 -1
  210. package/esm/utils/index.d.ts +0 -11
  211. package/esm/utils/index.js +0 -10
  212. package/esm/utils/index.js.map +0 -1
  213. package/esm/utils/logger.d.ts +0 -6
  214. package/esm/utils/logger.js +0 -76
  215. package/esm/utils/logger.js.map +0 -1
  216. package/esm/utils/metrics.d.ts +0 -22
  217. package/esm/utils/metrics.js +0 -150
  218. package/esm/utils/metrics.js.map +0 -1
  219. package/esm/utils/rpc-reply.d.ts +0 -17
  220. package/esm/utils/rpc-reply.js +0 -41
  221. package/esm/utils/rpc-reply.js.map +0 -1
  222. package/esm/utils/test.d.ts +0 -17
  223. package/esm/utils/test.js +0 -130
  224. package/esm/utils/test.js.map +0 -1
  225. package/esm/utils/userop.d.ts +0 -49
  226. package/esm/utils/userop.js +0 -408
  227. package/esm/utils/userop.js.map +0 -1
  228. package/esm/utils/validation.d.ts +0 -65
  229. package/esm/utils/validation.js +0 -461
  230. package/esm/utils/validation.js.map +0 -1
@@ -1,637 +0,0 @@
1
- import { EntryPointV06Abi, EntryPointV07Abi, deriveUserOperation } from "../types/index.js";
2
- import { getUserOperationHash, isVersion06, maxBigInt, parseViemError, toPackedUserOperation } from "../utils/index.js";
3
- import * as sentry from "@sentry/node";
4
- import { Mutex } from "async-mutex";
5
- import { FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooLowError, NonceTooLowError, encodeFunctionData, getContract } from "viem";
6
- 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
- export class Executor {
31
- // private unWatch: WatchBlocksReturnType | undefined
32
- publicClient;
33
- walletClient;
34
- entryPoints;
35
- senderManager;
36
- logger;
37
- metrics;
38
- simulateTransaction;
39
- legacyTransactions;
40
- fixedGasLimitForEstimation;
41
- localGasLimitCalculation;
42
- reputationManager;
43
- compressionHandler;
44
- gasPriceManager;
45
- mutex;
46
- constructor(publicClient, walletClient, senderManager, reputationManager, entryPoints, logger, metrics, compressionHandler, gasPriceManager, simulateTransaction = false, legacyTransactions = false, fixedGasLimitForEstimation, localGasLimitCalculation = false) {
47
- this.publicClient = publicClient;
48
- this.walletClient = walletClient;
49
- this.senderManager = senderManager;
50
- this.reputationManager = reputationManager;
51
- this.logger = logger;
52
- this.metrics = metrics;
53
- this.simulateTransaction = simulateTransaction;
54
- this.legacyTransactions = legacyTransactions;
55
- this.fixedGasLimitForEstimation = fixedGasLimitForEstimation;
56
- this.localGasLimitCalculation = localGasLimitCalculation;
57
- this.compressionHandler = compressionHandler;
58
- this.gasPriceManager = gasPriceManager;
59
- this.entryPoints = entryPoints;
60
- this.mutex = new Mutex();
61
- }
62
- getCompressionHandler() {
63
- if (!this.compressionHandler) {
64
- throw new Error("Support for compressed bundles has not initialized");
65
- }
66
- return this.compressionHandler;
67
- }
68
- cancelOps(_entryPoint, _ops) {
69
- throw new Error("Method not implemented.");
70
- }
71
- markWalletProcessed(executor) {
72
- if (!this.senderManager.availableWallets.includes(executor)) {
73
- this.senderManager.pushWallet(executor);
74
- }
75
- return Promise.resolve();
76
- }
77
- async replaceTransaction(transactionInfo) {
78
- const newRequest = { ...transactionInfo.transactionRequest };
79
- const gasPriceParameters = await this.gasPriceManager.getGasPrice();
80
- newRequest.maxFeePerGas = maxBigInt(gasPriceParameters.maxFeePerGas, (newRequest.maxFeePerGas * 11n + 9n) / 10n);
81
- newRequest.maxPriorityFeePerGas = maxBigInt(gasPriceParameters.maxPriorityFeePerGas, (newRequest.maxPriorityFeePerGas * 11n + 9n) / 10n);
82
- newRequest.account = transactionInfo.executor;
83
- const opsWithHashes = transactionInfo.userOperationInfos.map((opInfo) => {
84
- const op = deriveUserOperation(opInfo.mempoolUserOperation);
85
- return {
86
- mempoolUserOperation: opInfo.mempoolUserOperation,
87
- userOperationHash: getUserOperationHash(op, transactionInfo.entryPoint, this.walletClient.chain.id),
88
- entryPoint: opInfo.entryPoint
89
- };
90
- });
91
- let callContext;
92
- if (transactionInfo.transactionType === "default") {
93
- const [isUserOpVersion06, entryPoint] = opsWithHashes.reduce((acc, op) => {
94
- if (acc[0] !==
95
- isVersion06(op.mempoolUserOperation) ||
96
- acc[1] !== op.entryPoint) {
97
- throw new Error("All user operations must be of the same version");
98
- }
99
- return acc;
100
- }, [
101
- isVersion06(opsWithHashes[0].mempoolUserOperation),
102
- opsWithHashes[0].entryPoint
103
- ]);
104
- const ep = getContract({
105
- abi: isUserOpVersion06 ? EntryPointV06Abi : EntryPointV07Abi,
106
- address: entryPoint,
107
- client: {
108
- public: this.publicClient,
109
- wallet: this.walletClient
110
- }
111
- });
112
- callContext = {
113
- ep,
114
- type: "default"
115
- };
116
- }
117
- else {
118
- const compressionHandler = this.getCompressionHandler();
119
- callContext = {
120
- publicClient: this.publicClient,
121
- bundleBulker: compressionHandler.bundleBulkerAddress,
122
- perOpInflatorId: compressionHandler.perOpInflatorId,
123
- type: "compressed"
124
- };
125
- }
126
- const result = await filterOpsAndEstimateGas(transactionInfo.entryPoint, callContext, transactionInfo.executor, opsWithHashes, newRequest.nonce, newRequest.maxFeePerGas, newRequest.maxPriorityFeePerGas, "latest", this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, this.logger);
127
- const childLogger = this.logger.child({
128
- transactionHash: transactionInfo.transactionHash,
129
- executor: transactionInfo.executor.address
130
- });
131
- if (result.simulatedOps.length === 0) {
132
- childLogger.warn("no ops to bundle");
133
- this.markWalletProcessed(transactionInfo.executor);
134
- return { status: "failed" };
135
- }
136
- if (result.simulatedOps.every((op) => op.reason === "AA25 invalid account nonce" ||
137
- op.reason === "AA10 sender already constructed")) {
138
- childLogger.trace({ reasons: result.simulatedOps.map((sop) => sop.reason) }, "all ops failed simulation with nonce error");
139
- return { status: "potentially_already_included" };
140
- }
141
- if (result.simulatedOps.every((op) => op.reason !== undefined)) {
142
- childLogger.warn("all ops failed simulation");
143
- this.markWalletProcessed(transactionInfo.executor);
144
- return { status: "failed" };
145
- }
146
- const opsToBundle = result.simulatedOps
147
- .filter((op) => op.reason === undefined)
148
- .map((op) => {
149
- const opInfo = transactionInfo.userOperationInfos.find((info) => info.userOperationHash === op.owh.userOperationHash);
150
- if (!opInfo) {
151
- throw new Error("opInfo not found");
152
- }
153
- return opInfo;
154
- });
155
- newRequest.gas = this.localGasLimitCalculation
156
- ? opsToBundle.reduce((acc, opInfo) => {
157
- const userOperation = deriveUserOperation(opInfo.mempoolUserOperation);
158
- return (acc +
159
- userOperation.preVerificationGas +
160
- 3n * userOperation.verificationGasLimit +
161
- userOperation.callGasLimit);
162
- }, 0n)
163
- : result.gasLimit;
164
- // update calldata to include only ops that pass simulation
165
- if (transactionInfo.transactionType === "default") {
166
- const isUserOpVersion06 = opsWithHashes.reduce((acc, op) => {
167
- if (acc !==
168
- isVersion06(op.mempoolUserOperation)) {
169
- throw new Error("All user operations must be of the same version");
170
- }
171
- return acc;
172
- }, isVersion06(opsWithHashes[0].mempoolUserOperation));
173
- newRequest.data = isUserOpVersion06
174
- ? encodeFunctionData({
175
- abi: EntryPointV06Abi,
176
- functionName: "handleOps",
177
- args: [
178
- opsToBundle.map((opInfo) => opInfo.mempoolUserOperation),
179
- transactionInfo.executor.address
180
- ]
181
- })
182
- : encodeFunctionData({
183
- abi: EntryPointV07Abi,
184
- functionName: "handleOps",
185
- args: [
186
- opsToBundle.map((opInfo) => toPackedUserOperation(opInfo.mempoolUserOperation)),
187
- transactionInfo.executor.address
188
- ]
189
- });
190
- }
191
- else if (transactionInfo.transactionType === "compressed") {
192
- const compressedOps = opsToBundle.map((opInfo) => opInfo.mempoolUserOperation);
193
- newRequest.data = createCompressedCalldata(compressedOps, this.getCompressionHandler().perOpInflatorId);
194
- }
195
- try {
196
- childLogger.info({
197
- newRequest: {
198
- ...newRequest,
199
- abi: undefined,
200
- chain: undefined
201
- },
202
- executor: newRequest.account.address,
203
- opsToBundle: opsToBundle.map((opInfo) => opInfo.userOperationHash)
204
- }, "replacing transaction");
205
- const txHash = await this.walletClient.sendTransaction(this.legacyTransactions
206
- ? {
207
- ...newRequest,
208
- gasPrice: newRequest.maxFeePerGas,
209
- maxFeePerGas: undefined,
210
- maxPriorityFeePerGas: undefined,
211
- type: "legacy",
212
- accessList: undefined
213
- }
214
- : newRequest);
215
- const newTxInfo = {
216
- ...transactionInfo,
217
- transactionRequest: newRequest,
218
- transactionHash: txHash,
219
- previousTransactionHashes: [
220
- transactionInfo.transactionHash,
221
- ...transactionInfo.previousTransactionHashes
222
- ],
223
- lastReplaced: Date.now(),
224
- userOperationInfos: opsToBundle.map((opInfo) => {
225
- return {
226
- entryPoint: opInfo.entryPoint,
227
- mempoolUserOperation: opInfo.mempoolUserOperation,
228
- userOperationHash: opInfo.userOperationHash,
229
- lastReplaced: Date.now(),
230
- firstSubmitted: opInfo.firstSubmitted
231
- };
232
- })
233
- };
234
- return {
235
- status: "replaced",
236
- transactionInfo: newTxInfo
237
- };
238
- }
239
- catch (err) {
240
- const e = parseViemError(err);
241
- if (!e) {
242
- sentry.captureException(err);
243
- childLogger.error({ error: err }, "unknown error replacing transaction");
244
- }
245
- if (e instanceof NonceTooLowError) {
246
- childLogger.trace({ error: e }, "nonce too low, potentially already included");
247
- return { status: "potentially_already_included" };
248
- }
249
- if (e instanceof FeeCapTooLowError) {
250
- childLogger.warn({ error: e }, "fee cap too low, not replacing");
251
- }
252
- if (e instanceof InsufficientFundsError) {
253
- childLogger.warn({ error: e }, "insufficient funds, not replacing");
254
- }
255
- if (e instanceof IntrinsicGasTooLowError) {
256
- childLogger.warn({ error: e }, "intrinsic gas too low, not replacing");
257
- }
258
- childLogger.warn({ error: e }, "error replacing transaction");
259
- this.markWalletProcessed(transactionInfo.executor);
260
- return { status: "failed" };
261
- }
262
- }
263
- async flushStuckTransactions() {
264
- const gasPrice = await this.gasPriceManager.getGasPrice();
265
- const wallets = this.senderManager.utilityAccount
266
- ? Array.from(new Set([
267
- ...this.senderManager.wallets,
268
- this.senderManager.utilityAccount
269
- ]))
270
- : Array.from(new Set(this.senderManager.wallets));
271
- const promises = wallets.map(async (wallet) => {
272
- for (const entryPoint of this.entryPoints) {
273
- await flushStuckTransaction(this.publicClient, this.walletClient, wallet, gasPrice.maxFeePerGas * 5n, this.logger, entryPoint);
274
- }
275
- });
276
- await Promise.all(promises);
277
- }
278
- async bundle(entryPoint, ops) {
279
- const wallet = await this.senderManager.getWallet();
280
- const opsWithHashes = ops.map((op) => {
281
- return {
282
- mempoolUserOperation: op,
283
- userOperationHash: getUserOperationHash(op, entryPoint, this.walletClient.chain.id)
284
- };
285
- });
286
- const isUserOpVersion06 = opsWithHashes.reduce((acc, op) => {
287
- if (acc !==
288
- isVersion06(op.mempoolUserOperation)) {
289
- throw new Error("All user operations must be of the same version");
290
- }
291
- return acc;
292
- }, isVersion06(opsWithHashes[0].mempoolUserOperation));
293
- const ep = getContract({
294
- abi: isUserOpVersion06 ? EntryPointV06Abi : EntryPointV07Abi,
295
- address: entryPoint,
296
- client: {
297
- public: this.publicClient,
298
- wallet: this.walletClient
299
- }
300
- });
301
- let childLogger = this.logger.child({
302
- userOperations: opsWithHashes.map((oh) => oh.userOperationHash),
303
- entryPoint
304
- });
305
- childLogger.debug("bundling user operation");
306
- const gasPriceParameters = await this.gasPriceManager.getGasPrice();
307
- childLogger.debug({ gasPriceParameters }, "got gas price");
308
- const nonce = await this.publicClient.getTransactionCount({
309
- address: wallet.address,
310
- blockTag: "pending"
311
- });
312
- childLogger.trace({ nonce }, "got nonce");
313
- const callContext = {
314
- ep,
315
- type: "default"
316
- };
317
- let { gasLimit, simulatedOps, resubmitAllOps } = await filterOpsAndEstimateGas(entryPoint, callContext, wallet, opsWithHashes, nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, "pending", this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, childLogger);
318
- gasLimit += 10000n;
319
- if (resubmitAllOps) {
320
- this.markWalletProcessed(wallet);
321
- return opsWithHashes.map((owh) => {
322
- const bundleResult = {
323
- status: "resubmit",
324
- info: {
325
- entryPoint,
326
- userOpHash: owh.userOperationHash,
327
- userOperation: owh.mempoolUserOperation,
328
- reason: FeeCapTooLowError.name
329
- }
330
- };
331
- return bundleResult;
332
- });
333
- }
334
- if (simulatedOps.length === 0) {
335
- childLogger.error("gas limit simulation encountered unexpected failure");
336
- this.markWalletProcessed(wallet);
337
- return opsWithHashes.map((owh) => {
338
- return {
339
- status: "failure",
340
- error: {
341
- entryPoint,
342
- userOpHash: owh.userOperationHash,
343
- reason: "INTERNAL FAILURE"
344
- }
345
- };
346
- });
347
- }
348
- if (simulatedOps.every((op) => op.reason !== undefined)) {
349
- childLogger.warn("all ops failed simulation");
350
- this.markWalletProcessed(wallet);
351
- return simulatedOps.map((op) => {
352
- return {
353
- status: "failure",
354
- error: {
355
- entryPoint,
356
- userOpHash: op.owh.userOperationHash,
357
- reason: op.reason
358
- }
359
- };
360
- });
361
- }
362
- const opsWithHashToBundle = simulatedOps
363
- .filter((op) => op.reason === undefined)
364
- .map((op) => op.owh);
365
- childLogger = this.logger.child({
366
- userOperations: opsWithHashToBundle.map((owh) => owh.userOperationHash),
367
- entryPoint
368
- });
369
- childLogger.trace({ gasLimit }, "got gas limit");
370
- let txHash;
371
- try {
372
- const gasOptions = this.legacyTransactions
373
- ? {
374
- gasPrice: gasPriceParameters.maxFeePerGas
375
- }
376
- : {
377
- maxFeePerGas: gasPriceParameters.maxFeePerGas,
378
- maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas
379
- };
380
- txHash = isUserOpVersion06
381
- ? await ep.write.handleOps([
382
- opsWithHashToBundle.map((owh) => owh.mempoolUserOperation),
383
- wallet.address
384
- ], {
385
- account: wallet,
386
- gas: gasLimit,
387
- nonce: nonce,
388
- ...gasOptions
389
- })
390
- : await ep.write.handleOps([
391
- opsWithHashToBundle.map((owh) => toPackedUserOperation(owh.mempoolUserOperation)),
392
- wallet.address
393
- ], {
394
- account: wallet,
395
- gas: gasLimit,
396
- nonce: nonce,
397
- ...gasOptions
398
- });
399
- }
400
- catch (err) {
401
- const e = parseViemError(err);
402
- if (e instanceof InsufficientFundsError) {
403
- childLogger.error({ error: e }, "insufficient funds, not submitting transaction");
404
- this.markWalletProcessed(wallet);
405
- return opsWithHashToBundle.map((owh) => {
406
- return {
407
- status: "resubmit",
408
- info: {
409
- entryPoint,
410
- userOpHash: owh.userOperationHash,
411
- userOperation: owh.mempoolUserOperation,
412
- reason: InsufficientFundsError.name
413
- }
414
- };
415
- });
416
- }
417
- sentry.captureException(err);
418
- childLogger.error({ error: JSON.stringify(err) }, "error submitting bundle transaction");
419
- this.markWalletProcessed(wallet);
420
- return opsWithHashes.map((owh) => {
421
- return {
422
- status: "failure",
423
- error: {
424
- entryPoint,
425
- userOpHash: owh.userOperationHash,
426
- reason: "INTERNAL FAILURE"
427
- }
428
- };
429
- });
430
- }
431
- const userOperationInfos = opsWithHashToBundle.map((op) => {
432
- return {
433
- entryPoint,
434
- mempoolUserOperation: op.mempoolUserOperation,
435
- userOperationHash: op.userOperationHash,
436
- lastReplaced: Date.now(),
437
- firstSubmitted: Date.now()
438
- };
439
- });
440
- const transactionInfo = {
441
- entryPoint,
442
- isVersion06: isUserOpVersion06,
443
- transactionType: "default",
444
- transactionHash: txHash,
445
- previousTransactionHashes: [],
446
- transactionRequest: {
447
- account: wallet,
448
- to: ep.address,
449
- data: isUserOpVersion06
450
- ? encodeFunctionData({
451
- abi: ep.abi,
452
- functionName: "handleOps",
453
- args: [
454
- opsWithHashToBundle.map((owh) => owh.mempoolUserOperation),
455
- wallet.address
456
- ]
457
- })
458
- : encodeFunctionData({
459
- abi: ep.abi,
460
- functionName: "handleOps",
461
- args: [
462
- opsWithHashToBundle.map((owh) => toPackedUserOperation(owh.mempoolUserOperation)),
463
- wallet.address
464
- ]
465
- }),
466
- gas: gasLimit,
467
- chain: this.walletClient.chain,
468
- maxFeePerGas: gasPriceParameters.maxFeePerGas,
469
- maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas,
470
- nonce: nonce
471
- },
472
- executor: wallet,
473
- userOperationInfos,
474
- lastReplaced: Date.now(),
475
- firstSubmitted: Date.now(),
476
- timesPotentiallyIncluded: 0
477
- };
478
- const userOperationResults = simulatedOpsToResults(simulatedOps, transactionInfo);
479
- childLogger.info({
480
- transactionRequest: {
481
- ...transactionInfo.transactionRequest,
482
- abi: undefined
483
- },
484
- txHash,
485
- opHashes: opsWithHashToBundle.map((owh) => owh.userOperationHash)
486
- }, "submitted bundle transaction");
487
- return userOperationResults;
488
- }
489
- async bundleCompressed(entryPoint, compressedOps) {
490
- const compressionHandler = this.getCompressionHandler();
491
- const wallet = await this.senderManager.getWallet();
492
- const childLogger = this.logger.child({
493
- compressedUserOperations: compressedOps,
494
- entryPoint: entryPoint
495
- });
496
- childLogger.debug("bundling compressed user operation");
497
- const gasPriceParameters = await this.gasPriceManager.getGasPrice();
498
- childLogger.debug({ gasPriceParameters }, "got gas price");
499
- const nonce = await this.publicClient.getTransactionCount({
500
- address: wallet.address,
501
- blockTag: "pending"
502
- });
503
- childLogger.trace({ nonce }, "got nonce");
504
- const callContext = {
505
- publicClient: this.publicClient,
506
- bundleBulker: compressionHandler.bundleBulkerAddress,
507
- perOpInflatorId: compressionHandler.perOpInflatorId,
508
- type: "compressed"
509
- };
510
- let { gasLimit, simulatedOps, resubmitAllOps } = await filterOpsAndEstimateGas(entryPoint, callContext, wallet, compressedOps.map((compressedOp) => {
511
- return {
512
- mempoolUserOperation: compressedOp,
513
- userOperationHash: getUserOperationHash(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id)
514
- };
515
- }), nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, "pending", this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, childLogger);
516
- gasLimit += 10000n;
517
- if (resubmitAllOps) {
518
- this.markWalletProcessed(wallet);
519
- return compressedOps.map((compressedOp) => {
520
- return {
521
- status: "resubmit",
522
- info: {
523
- entryPoint,
524
- userOpHash: getUserOperationHash(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id),
525
- userOperation: compressedOp,
526
- reason: FeeCapTooLowError.name
527
- }
528
- };
529
- });
530
- }
531
- if (simulatedOps.length === 0) {
532
- childLogger.warn("no ops to bundle");
533
- this.markWalletProcessed(wallet);
534
- return compressedOps.map((compressedOp) => {
535
- return {
536
- status: "failure",
537
- error: {
538
- entryPoint,
539
- userOpHash: getUserOperationHash(compressedOp.inflatedOp, entryPoint, this.walletClient.chain.id),
540
- reason: "INTERNAL FAILURE"
541
- }
542
- };
543
- });
544
- }
545
- // if not all succeeded, return error
546
- if (simulatedOps.some((simulatedOp) => simulatedOp.reason !== undefined)) {
547
- childLogger.warn("some ops failed simulation");
548
- this.markWalletProcessed(wallet);
549
- return simulatedOps.map((simulatedOp) => {
550
- return {
551
- status: "failure",
552
- error: {
553
- entryPoint,
554
- userOpHash: simulatedOp.owh.userOperationHash,
555
- reason: simulatedOp.reason
556
- }
557
- };
558
- });
559
- }
560
- const opsToBundle = simulatedOps
561
- .filter((simulatedOp) => simulatedOp.reason === undefined)
562
- .map((simulatedOp) => simulatedOp.owh);
563
- let txHash;
564
- try {
565
- const gasOptions = this.legacyTransactions
566
- ? {
567
- gasPrice: gasPriceParameters.maxFeePerGas
568
- }
569
- : {
570
- maxFeePerGas: gasPriceParameters.maxFeePerGas,
571
- maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas
572
- };
573
- // need to use sendTransaction to target BundleBulker's fallback
574
- txHash = await this.walletClient.sendTransaction({
575
- account: wallet,
576
- to: compressionHandler.bundleBulkerAddress,
577
- data: createCompressedCalldata(compressedOps, compressionHandler.perOpInflatorId),
578
- gas: gasLimit,
579
- nonce: nonce,
580
- ...gasOptions
581
- });
582
- }
583
- catch (err) {
584
- sentry.captureException(err);
585
- childLogger.error({ error: JSON.stringify(err) }, "error submitting bundle transaction");
586
- this.markWalletProcessed(wallet);
587
- return opsToBundle.map((op) => {
588
- return {
589
- status: "failure",
590
- error: {
591
- entryPoint,
592
- userOpHash: op.userOperationHash,
593
- reason: "INTERNAL FAILURE"
594
- }
595
- };
596
- });
597
- }
598
- const userOperationInfos = opsToBundle.map((owh) => {
599
- return {
600
- entryPoint,
601
- mempoolUserOperation: owh.mempoolUserOperation,
602
- userOperationHash: owh.userOperationHash,
603
- lastReplaced: Date.now(),
604
- firstSubmitted: Date.now()
605
- };
606
- });
607
- const transactionInfo = {
608
- entryPoint,
609
- isVersion06: true, //TODO: compressed bundles are always v06
610
- transactionType: "compressed",
611
- transactionHash: txHash,
612
- previousTransactionHashes: [],
613
- transactionRequest: {
614
- to: compressionHandler.bundleBulkerAddress,
615
- data: createCompressedCalldata(compressedOps, compressionHandler.perOpInflatorId),
616
- gas: gasLimit,
617
- account: wallet,
618
- chain: this.walletClient.chain,
619
- maxFeePerGas: gasPriceParameters.maxFeePerGas,
620
- maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas,
621
- nonce: nonce
622
- },
623
- executor: wallet,
624
- userOperationInfos,
625
- lastReplaced: Date.now(),
626
- firstSubmitted: Date.now(),
627
- timesPotentiallyIncluded: 0
628
- };
629
- const userOperationResults = simulatedOpsToResults(simulatedOps, transactionInfo);
630
- childLogger.info({
631
- txHash,
632
- opHashes: opsToBundle.map((owh) => owh.userOperationHash)
633
- }, "submitted bundle transaction");
634
- return userOperationResults;
635
- }
636
- }
637
- //# sourceMappingURL=executor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../executor/executor.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EAUtB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACH,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,cAAc,EACd,qBAAqB,EAExB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EACH,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EAMd,MAAM,MAAM,CAAA;AACb,OAAO,EACH,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EAExB,MAAM,SAAS,CAAA;AAoBhB,MAAM,OAAO,Y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