@pimlico/alto 0.0.19 → 0.0.21

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 (357) hide show
  1. package/contracts/EIP712.sol/EIP712.json +1 -1
  2. package/contracts/ERC165.sol/ERC165.json +1 -1
  3. package/contracts/ERC20.sol/ERC20.json +1 -1
  4. package/contracts/Eip7702Support.sol/Eip7702Support.json +1 -1
  5. package/contracts/EntryPoint.sol/EntryPoint.json +1 -1
  6. package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -1
  7. package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -1
  8. package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -1
  9. package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
  10. package/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -1
  11. package/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
  12. package/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
  13. package/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
  14. package/contracts/Exec.sol/Exec.json +1 -1
  15. package/contracts/IAccount.sol/IAccount.json +1 -1
  16. package/contracts/IAccountExecute.sol/IAccountExecute.json +1 -1
  17. package/contracts/IAggregator.sol/IAggregator.json +1 -1
  18. package/contracts/IERC165.sol/IERC165.json +1 -1
  19. package/contracts/IERC5267.sol/IERC5267.json +1 -1
  20. package/contracts/IEntryPoint.sol/IEntryPoint.json +1 -1
  21. package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride08.json +1 -0
  22. package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride09.json +1 -0
  23. package/contracts/IEntryPointSimulations.sol/IEntryPointSimulations.json +1 -1
  24. package/contracts/INonceManager.sol/INonceManager.json +1 -1
  25. package/contracts/IPaymaster.sol/IPaymaster.json +1 -1
  26. package/contracts/ISenderCreator.sol/ISenderCreator.json +1 -1
  27. package/contracts/IStakeManager.sol/IStakeManager.json +1 -1
  28. package/contracts/LibBytes.sol/LibBytes.json +1 -1
  29. package/contracts/Math.sol/Math.json +1 -1
  30. package/contracts/MessageHashUtils.sol/MessageHashUtils.json +1 -1
  31. package/contracts/NonceManager.sol/NonceManager.json +1 -1
  32. package/contracts/Panic.sol/Panic.json +1 -1
  33. package/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
  34. package/contracts/ReentrancyGuard.sol/ReentrancyGuard.json +1 -1
  35. package/contracts/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.json +1 -1
  36. package/contracts/SafeCast.sol/SafeCast.json +1 -1
  37. package/contracts/SenderCreator.sol/SenderCreator.json +1 -1
  38. package/contracts/ShortStrings.sol/ShortStrings.json +1 -1
  39. package/contracts/SignedMath.sol/SignedMath.json +1 -1
  40. package/contracts/SimulationOverrideHelper.sol/SimulationOverrideHelper.json +1 -0
  41. package/contracts/StakeManager.sol/StakeManager.json +1 -1
  42. package/contracts/StorageSlot.sol/StorageSlot.json +1 -1
  43. package/contracts/Strings.sol/Strings.json +1 -1
  44. package/contracts/TransientSlot.sol/TransientSlot.json +1 -1
  45. package/contracts/UserOperation.sol/UserOperationLib.json +1 -1
  46. package/contracts/UserOperationLib.sol/UserOperationLib.json +1 -1
  47. package/contracts/account-abstraction-v9/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -0
  48. package/contracts/account-abstraction-v9/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -0
  49. package/contracts/account-abstraction-v9/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -0
  50. package/contracts/account-abstraction-v9/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -0
  51. package/contracts/build-info/{880955d5786bfdae.json → 031b289b93191224.json} +1 -1
  52. package/contracts/build-info/181f3522c3744403.json +1 -0
  53. package/contracts/build-info/a2db592afab5c9de.json +1 -0
  54. package/contracts/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -1
  55. package/contracts/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -1
  56. package/contracts/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -1
  57. package/contracts/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -1
  58. package/contracts/core/Eip7702Support.sol/Eip7702Support.json +1 -0
  59. package/contracts/core/NonceManager.sol/NonceManager.json +1 -0
  60. package/contracts/core/SenderCreator.sol/SenderCreator.json +1 -0
  61. package/contracts/core/StakeManager.sol/StakeManager.json +1 -0
  62. package/contracts/core/UserOperationLib.sol/UserOperationLib.json +1 -0
  63. package/contracts/interfaces/IAccount.sol/IAccount.json +1 -0
  64. package/contracts/interfaces/IAccountExecute.sol/IAccountExecute.json +1 -0
  65. package/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -1
  66. package/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -1
  67. package/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -1
  68. package/contracts/interfaces/IPaymaster.sol/IPaymaster.json +1 -0
  69. package/contracts/interfaces/ISenderCreator.sol/ISenderCreator.json +1 -0
  70. package/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -1
  71. package/contracts/overrides/Eip7702Support.sol/Eip7702Support.json +1 -0
  72. package/contracts/overrides/NonceManager.sol/NonceManager.json +1 -0
  73. package/contracts/overrides/SenderCreator.sol/SenderCreator.json +1 -0
  74. package/contracts/overrides/StakeManager.sol/StakeManager.json +1 -0
  75. package/contracts/overrides/UserOperationLib.sol/UserOperationLib.json +1 -0
  76. package/contracts/utils/Exec.sol/Exec.json +1 -1
  77. package/contracts/utils/StorageSlot.sol/StorageSlot.json +1 -0
  78. package/contracts/v09/EntryPoint.sol/EntryPoint.json +1 -0
  79. package/esm/cli/alto.js +17 -6
  80. package/esm/cli/alto.js.map +1 -1
  81. package/esm/cli/config/bundler.d.ts +459 -321
  82. package/esm/cli/config/bundler.js +125 -91
  83. package/esm/cli/config/bundler.js.map +1 -1
  84. package/esm/cli/config/options.d.ts +4 -1
  85. package/esm/cli/config/options.js +233 -106
  86. package/esm/cli/config/options.js.map +1 -1
  87. package/esm/cli/customTransport.d.ts +3 -3
  88. package/esm/cli/deploySimulationsContract.d.ts +1 -0
  89. package/esm/cli/deploySimulationsContract.js +41 -5
  90. package/esm/cli/deploySimulationsContract.js.map +1 -1
  91. package/esm/cli/handler.js +76 -80
  92. package/esm/cli/handler.js.map +1 -1
  93. package/esm/cli/multiRpcTransport.d.ts +7 -0
  94. package/esm/cli/multiRpcTransport.js +52 -0
  95. package/esm/cli/multiRpcTransport.js.map +1 -0
  96. package/esm/cli/setupServer.js +92 -70
  97. package/esm/cli/setupServer.js.map +1 -1
  98. package/esm/cli/shutDown.d.ts +20 -0
  99. package/esm/cli/shutDown.js +285 -0
  100. package/esm/cli/shutDown.js.map +1 -0
  101. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -1
  102. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -1
  103. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -1
  104. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
  105. package/esm/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -1
  106. package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
  107. package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
  108. package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
  109. package/esm/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
  110. package/esm/createConfig.d.ts +9 -2
  111. package/esm/createConfig.js.map +1 -1
  112. package/esm/executor/{userOpMonitor.d.ts → bundleManager.d.ts} +56 -37
  113. package/esm/executor/bundleManager.js +393 -0
  114. package/esm/executor/bundleManager.js.map +1 -0
  115. package/esm/executor/executor.d.ts +4 -3
  116. package/esm/executor/executor.js +47 -23
  117. package/esm/executor/executor.js.map +1 -1
  118. package/esm/executor/executorManager.d.ts +20 -15
  119. package/esm/executor/executorManager.js +248 -67
  120. package/esm/executor/executorManager.js.map +1 -1
  121. package/esm/executor/filterOpsAndEstimateGas.d.ts +17 -2
  122. package/esm/executor/filterOpsAndEstimateGas.js +100 -77
  123. package/esm/executor/filterOpsAndEstimateGas.js.map +1 -1
  124. package/esm/executor/getBundleStatus.d.ts +5 -1
  125. package/esm/executor/getBundleStatus.js.map +1 -1
  126. package/esm/executor/index.d.ts +1 -0
  127. package/esm/executor/index.js +1 -0
  128. package/esm/executor/index.js.map +1 -1
  129. package/esm/executor/senderManager/createMemorySenderManager.js +13 -0
  130. package/esm/executor/senderManager/createMemorySenderManager.js.map +1 -1
  131. package/esm/executor/senderManager/createRedisSenderManager.d.ts +2 -1
  132. package/esm/executor/senderManager/createRedisSenderManager.js +45 -26
  133. package/esm/executor/senderManager/createRedisSenderManager.js.map +1 -1
  134. package/esm/executor/senderManager/flushOnStartUp.js +7 -5
  135. package/esm/executor/senderManager/flushOnStartUp.js.map +1 -1
  136. package/esm/executor/senderManager/index.d.ts +1 -0
  137. package/esm/executor/senderManager/index.js +6 -2
  138. package/esm/executor/senderManager/index.js.map +1 -1
  139. package/esm/executor/senderManager/validateAndRefill.js +268 -85
  140. package/esm/executor/senderManager/validateAndRefill.js.map +1 -1
  141. package/esm/executor/utils.d.ts +8 -3
  142. package/esm/executor/utils.js +59 -27
  143. package/esm/executor/utils.js.map +1 -1
  144. package/esm/handlers/arbitrumGasPriceManager.d.ts +3 -2
  145. package/esm/handlers/arbitrumGasPriceManager.js +6 -2
  146. package/esm/handlers/arbitrumGasPriceManager.js.map +1 -1
  147. package/esm/handlers/citreaManager.d.ts +10 -0
  148. package/esm/handlers/citreaManager.js +17 -0
  149. package/esm/handlers/citreaManager.js.map +1 -0
  150. package/esm/handlers/eventManager.d.ts +9 -9
  151. package/esm/handlers/eventManager.js +59 -60
  152. package/esm/handlers/eventManager.js.map +1 -1
  153. package/esm/handlers/gasPriceManager.d.ts +17 -10
  154. package/esm/handlers/gasPriceManager.js +245 -99
  155. package/esm/handlers/gasPriceManager.js.map +1 -1
  156. package/esm/handlers/mantleGasPriceManager.d.ts +4 -4
  157. package/esm/handlers/mantleGasPriceManager.js +4 -4
  158. package/esm/handlers/mantleGasPriceManager.js.map +1 -1
  159. package/esm/handlers/optimismManager.d.ts +1 -1
  160. package/esm/handlers/optimismManager.js +1 -1
  161. package/esm/handlers/optimismManager.js.map +1 -1
  162. package/esm/mempool/index.d.ts +1 -1
  163. package/esm/mempool/index.js +1 -1
  164. package/esm/mempool/index.js.map +1 -1
  165. package/esm/mempool/mempool.d.ts +61 -22
  166. package/esm/mempool/mempool.js +223 -133
  167. package/esm/mempool/mempool.js.map +1 -1
  168. package/esm/mempool/reputationManager.d.ts +14 -14
  169. package/esm/mempool/reputationManager.js +36 -39
  170. package/esm/mempool/reputationManager.js.map +1 -1
  171. package/esm/mempool/statusManager.d.ts +20 -0
  172. package/esm/mempool/statusManager.js +143 -0
  173. package/esm/mempool/statusManager.js.map +1 -0
  174. package/esm/receiptCache/createMemoryReceiptCache.d.ts +3 -0
  175. package/esm/receiptCache/createMemoryReceiptCache.js +30 -0
  176. package/esm/receiptCache/createMemoryReceiptCache.js.map +1 -0
  177. package/esm/receiptCache/createRedisReceiptCache.d.ts +10 -0
  178. package/esm/receiptCache/createRedisReceiptCache.js +56 -0
  179. package/esm/receiptCache/createRedisReceiptCache.js.map +1 -0
  180. package/esm/receiptCache/index.d.ts +11 -0
  181. package/esm/receiptCache/index.js +21 -0
  182. package/esm/receiptCache/index.js.map +1 -0
  183. package/esm/rpc/createMethodHandler.js.map +1 -1
  184. package/esm/rpc/estimation/gasEstimationHandler.d.ts +2 -4
  185. package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
  186. package/esm/rpc/estimation/gasEstimations06.d.ts +6 -7
  187. package/esm/rpc/estimation/gasEstimations06.js +1 -5
  188. package/esm/rpc/estimation/gasEstimations06.js.map +1 -1
  189. package/esm/rpc/estimation/gasEstimations07.d.ts +13 -41
  190. package/esm/rpc/estimation/gasEstimations07.js +27 -34
  191. package/esm/rpc/estimation/gasEstimations07.js.map +1 -1
  192. package/esm/{utils/preVerificationGasCalulator.d.ts → rpc/estimation/preVerificationGasCalculator.d.ts} +20 -6
  193. package/esm/{utils/preVerificationGasCalulator.js → rpc/estimation/preVerificationGasCalculator.js} +134 -48
  194. package/esm/rpc/estimation/preVerificationGasCalculator.js.map +1 -0
  195. package/esm/rpc/estimation/types.d.ts +4 -2
  196. package/esm/rpc/estimation/utils.d.ts +10 -8
  197. package/esm/rpc/estimation/utils.js +56 -53
  198. package/esm/rpc/estimation/utils.js.map +1 -1
  199. package/esm/rpc/methods/boost_sendUserOperation.d.ts +304 -0
  200. package/esm/rpc/methods/boost_sendUserOperation.js +1 -1
  201. package/esm/rpc/methods/boost_sendUserOperation.js.map +1 -1
  202. package/esm/rpc/methods/debug_bundler_clearReputation.js +1 -1
  203. package/esm/rpc/methods/debug_bundler_clearReputation.js.map +1 -1
  204. package/esm/rpc/methods/debug_bundler_clearState.js +1 -1
  205. package/esm/rpc/methods/debug_bundler_clearState.js.map +1 -1
  206. package/esm/rpc/methods/debug_bundler_dumpMempool.d.ts +338 -0
  207. package/esm/rpc/methods/debug_bundler_dumpReputation.js +1 -1
  208. package/esm/rpc/methods/debug_bundler_dumpReputation.js.map +1 -1
  209. package/esm/rpc/methods/eth_estimateUserOperationGas.d.ts +622 -14
  210. package/esm/rpc/methods/eth_estimateUserOperationGas.js +61 -30
  211. package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
  212. package/esm/rpc/methods/eth_getUserOperationByHash.d.ts +621 -11
  213. package/esm/rpc/methods/eth_getUserOperationByHash.js.map +1 -1
  214. package/esm/rpc/methods/eth_getUserOperationReceipt.d.ts +34 -34
  215. package/esm/rpc/methods/eth_getUserOperationReceipt.js +1 -1
  216. package/esm/rpc/methods/eth_sendUserOperation.d.ts +307 -3
  217. package/esm/rpc/methods/eth_sendUserOperation.js +153 -48
  218. package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
  219. package/esm/rpc/methods/pimlico_getUserOperationStatus.js +1 -1
  220. package/esm/rpc/methods/pimlico_getUserOperationStatus.js.map +1 -1
  221. package/esm/rpc/methods/pimlico_sendUserOperationNow.d.ts +338 -34
  222. package/esm/rpc/methods/pimlico_sendUserOperationNow.js +26 -29
  223. package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -1
  224. package/esm/rpc/methods/pimlico_simulateAssetChange.d.ts +620 -12
  225. package/esm/rpc/methods/pimlico_simulateAssetChange.js +14 -19
  226. package/esm/rpc/methods/pimlico_simulateAssetChange.js.map +1 -1
  227. package/esm/rpc/rpcHandler.d.ts +38 -26
  228. package/esm/rpc/rpcHandler.js +97 -44
  229. package/esm/rpc/rpcHandler.js.map +1 -1
  230. package/esm/rpc/server.d.ts +5 -5
  231. package/esm/rpc/server.js +15 -11
  232. package/esm/rpc/server.js.map +1 -1
  233. package/esm/rpc/validation/BundlerCollectorTracerV06.js +1 -1
  234. package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +1 -1
  235. package/esm/rpc/validation/BundlerCollectorTracerV07.js +1 -1
  236. package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +1 -1
  237. package/esm/rpc/validation/SafeValidator.d.ts +13 -14
  238. package/esm/rpc/validation/SafeValidator.js +24 -24
  239. package/esm/rpc/validation/SafeValidator.js.map +1 -1
  240. package/esm/rpc/validation/TracerResultParserV06.d.ts +2 -2
  241. package/esm/rpc/validation/TracerResultParserV06.js +11 -11
  242. package/esm/rpc/validation/TracerResultParserV06.js.map +1 -1
  243. package/esm/rpc/validation/TracerResultParserV07.d.ts +2 -2
  244. package/esm/rpc/validation/TracerResultParserV07.js +13 -13
  245. package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
  246. package/esm/rpc/validation/UnsafeValidator.d.ts +18 -14
  247. package/esm/rpc/validation/UnsafeValidator.js +76 -41
  248. package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
  249. package/esm/store/createMempoolStore.d.ts +1 -1
  250. package/esm/store/createMempoolStore.js +79 -140
  251. package/esm/store/createMempoolStore.js.map +1 -1
  252. package/esm/store/index.d.ts +4 -75
  253. package/esm/store/index.js +4 -1
  254. package/esm/store/index.js.map +1 -1
  255. package/esm/store/outstanding/index.d.ts +13 -0
  256. package/esm/store/outstanding/index.js +16 -0
  257. package/esm/store/outstanding/index.js.map +1 -0
  258. package/esm/store/{createMemoryOutstandingStore.d.ts → outstanding/memory.d.ts} +14 -13
  259. package/esm/store/outstanding/memory.js +263 -0
  260. package/esm/store/outstanding/memory.js.map +1 -0
  261. package/esm/store/outstanding/redis.d.ts +11 -0
  262. package/esm/store/outstanding/redis.js +229 -0
  263. package/esm/store/outstanding/redis.js.map +1 -0
  264. package/esm/store/outstanding/types.d.ts +19 -0
  265. package/esm/store/outstanding/types.js +2 -0
  266. package/esm/store/outstanding/types.js.map +1 -0
  267. package/esm/store/processing/index.d.ts +11 -0
  268. package/esm/store/processing/index.js +17 -0
  269. package/esm/store/processing/index.js.map +1 -0
  270. package/esm/store/processing/memory.d.ts +19 -0
  271. package/esm/store/processing/memory.js +83 -0
  272. package/esm/store/processing/memory.js.map +1 -0
  273. package/esm/store/processing/redis.d.ts +26 -0
  274. package/esm/store/processing/redis.js +123 -0
  275. package/esm/store/processing/redis.js.map +1 -0
  276. package/esm/store/processing/types.d.ts +12 -0
  277. package/esm/store/processing/types.js +2 -0
  278. package/esm/store/processing/types.js.map +1 -0
  279. package/esm/store/types.d.ts +52 -0
  280. package/esm/store/types.js +2 -0
  281. package/esm/store/types.js.map +1 -0
  282. package/esm/types/contracts/Multicall3.d.ts +34 -0
  283. package/esm/types/contracts/Multicall3.js +31 -0
  284. package/esm/types/contracts/Multicall3.js.map +1 -0
  285. package/esm/types/contracts/PimlicoSimulations.d.ts +81 -0
  286. package/esm/types/contracts/PimlicoSimulations.js +105 -0
  287. package/esm/types/contracts/PimlicoSimulations.js.map +1 -1
  288. package/esm/types/contracts/index.d.ts +1 -1
  289. package/esm/types/contracts/index.js +1 -1
  290. package/esm/types/contracts/index.js.map +1 -1
  291. package/esm/types/gasPrice.js +0 -18
  292. package/esm/types/gasPrice.js.map +1 -1
  293. package/esm/types/interfaces.d.ts +15 -10
  294. package/esm/types/mempool.d.ts +3 -0
  295. package/esm/types/schemas.d.ts +13184 -4741
  296. package/esm/types/schemas.js +116 -27
  297. package/esm/types/schemas.js.map +1 -1
  298. package/esm/types/utils.d.ts +2 -5
  299. package/esm/types/utils.js +16 -18
  300. package/esm/types/utils.js.map +1 -1
  301. package/esm/types/validation.d.ts +7646 -6912
  302. package/esm/types/validation.js +122 -152
  303. package/esm/types/validation.js.map +1 -1
  304. package/esm/utils/eip7702.d.ts +2 -1
  305. package/esm/utils/eip7702.js +14 -8
  306. package/esm/utils/eip7702.js.map +1 -1
  307. package/esm/utils/entryPointOverrides.js +18 -4
  308. package/esm/utils/entryPointOverrides.js.map +1 -1
  309. package/esm/utils/helpers.d.ts +7 -1
  310. package/esm/utils/helpers.js +36 -11
  311. package/esm/utils/helpers.js.map +1 -1
  312. package/esm/utils/index.d.ts +0 -1
  313. package/esm/utils/index.js +0 -1
  314. package/esm/utils/index.js.map +1 -1
  315. package/esm/utils/metrics.d.ts +4 -1
  316. package/esm/utils/metrics.js +34 -7
  317. package/esm/utils/metrics.js.map +1 -1
  318. package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js +8 -9
  319. package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js.map +1 -1
  320. package/esm/utils/minMaxQueue/createRedisMinMaxQueue.d.ts +24 -2
  321. package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js +85 -64
  322. package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js.map +1 -1
  323. package/esm/utils/minMaxQueue/index.d.ts +2 -2
  324. package/esm/utils/minMaxQueue/index.js +4 -3
  325. package/esm/utils/minMaxQueue/index.js.map +1 -1
  326. package/esm/utils/rpc-reply.d.ts +3 -3
  327. package/esm/utils/rpc-reply.js.map +1 -1
  328. package/esm/utils/toViemStateOverrides.js +7 -7
  329. package/esm/utils/toViemStateOverrides.js.map +1 -1
  330. package/esm/utils/userop.d.ts +110 -56
  331. package/esm/utils/userop.js +161 -249
  332. package/esm/utils/userop.js.map +1 -1
  333. package/package.json +4 -2
  334. package/contracts/build-info/7710b5a048396e70.json +0 -1
  335. package/esm/executor/userOpMonitor.js +0 -326
  336. package/esm/executor/userOpMonitor.js.map +0 -1
  337. package/esm/executor/utilityWalletMonitor.d.ts +0 -19
  338. package/esm/executor/utilityWalletMonitor.js +0 -38
  339. package/esm/executor/utilityWalletMonitor.js.map +0 -1
  340. package/esm/mempool/monitoring.d.ts +0 -15
  341. package/esm/mempool/monitoring.js +0 -118
  342. package/esm/mempool/monitoring.js.map +0 -1
  343. package/esm/store/createMemoryOutstandingStore.js +0 -240
  344. package/esm/store/createMemoryOutstandingStore.js.map +0 -1
  345. package/esm/store/createRedisOutstandingStore.d.ts +0 -27
  346. package/esm/store/createRedisOutstandingStore.js +0 -344
  347. package/esm/store/createRedisOutstandingStore.js.map +0 -1
  348. package/esm/store/createRedisStore.d.ts +0 -9
  349. package/esm/store/createRedisStore.js +0 -131
  350. package/esm/store/createRedisStore.js.map +0 -1
  351. package/esm/store/createStore.d.ts +0 -6
  352. package/esm/store/createStore.js +0 -66
  353. package/esm/store/createStore.js.map +0 -1
  354. package/esm/types/contracts/CallEngine.d.ts +0 -28
  355. package/esm/types/contracts/CallEngine.js +0 -37
  356. package/esm/types/contracts/CallEngine.js.map +0 -1
  357. package/esm/utils/preVerificationGasCalulator.js.map +0 -1
@@ -5,13 +5,20 @@ import type { CamelCasedProperties } from "./cli/parseArgs.js";
5
5
  export type AltoConfig = Readonly<CamelCasedProperties<IOptions>> & {
6
6
  getLogger: <ChildCustomLevels extends string = never>(bindings: Bindings, options?: ChildLoggerOptions<ChildCustomLevels>) => Logger<ChildCustomLevels>;
7
7
  readonly publicClient: PublicClient<Transport, Chain>;
8
- readonly walletClient: WalletClient<Transport, Chain>;
8
+ readonly walletClients: {
9
+ readonly private?: WalletClient<Transport, Chain>;
10
+ readonly public: WalletClient<Transport, Chain>;
11
+ };
9
12
  readonly chainId: number;
10
13
  readonly utilityWalletAddress: Address;
11
14
  };
12
15
  export declare function createConfig(config: CamelCasedProperties<IOptions> & {
13
16
  logger: Logger;
14
17
  publicClient: PublicClient<Transport, Chain>;
15
- walletClient: WalletClient<Transport, Chain>;
18
+ walletClients: {
19
+ private?: WalletClient<Transport, Chain>;
20
+ public: WalletClient<Transport, Chain>;
21
+ };
22
+ enableCors: boolean;
16
23
  }): AltoConfig;
17
24
  //# sourceMappingURL=createConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createConfig.js","sourceRoot":"","sources":["../createConfig.ts"],"names":[],"mappings":"AAsBA,MAAM,UAAU,YAAY,CACxB,MAIC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;IAElC,OAAO;QACH,GAAG,IAAI;QACP,OAAO,EAAE,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;QACrC,oBAAoB,EAChB,MAAM,CAAC,iBAAiB,EAAE,OAAO;YACjC,4CAA4C;QAChD,SAAS,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC;KACpE,CAAA;AACL,CAAC"}
1
+ {"version":3,"file":"createConfig.js","sourceRoot":"","sources":["../createConfig.ts"],"names":[],"mappings":"AAyBA,MAAM,UAAU,YAAY,CACxB,MAQC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;IAElC,OAAO;QACH,GAAG,IAAI;QACP,OAAO,EAAE,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;QACrC,oBAAoB,EAChB,MAAM,CAAC,iBAAiB,EAAE,OAAO;YACjC,4CAA4C;QAChD,SAAS,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC;KACpE,CAAA;AACL,CAAC"}
@@ -1,60 +1,79 @@
1
- import type { SenderManager } from "./index.js";
2
- import type { EventManager } from "../handlers/index.js";
3
- import type { InterfaceReputationManager, Mempool, Monitor } from "../mempool/index.js";
1
+ import { type SenderManager } from "./index.js";
2
+ import type { EventManager, GasPriceManager } from "../handlers/index.js";
3
+ import type { InterfaceReputationManager, Mempool, StatusManager } from "../mempool/index.js";
4
4
  import type { HexData32, SubmittedBundleInfo, UserOpInfo } from "../types/index.js";
5
- import type { Metrics } from "../utils/index.js";
6
- import { type Block } from "viem";
5
+ import { type Metrics } from "../utils/index.js";
6
+ import { type Address, type Hex } from "viem";
7
7
  import type { AltoConfig } from "../createConfig.js";
8
8
  import { type BundleStatus } from "./getBundleStatus.js";
9
- export declare class UserOpMonitor {
10
- private reputationManager;
11
- private config;
12
- private mempool;
13
- private monitor;
14
- private logger;
15
- private metrics;
16
- private eventManager;
17
- private senderManager;
9
+ export declare class BundleManager {
10
+ private readonly reputationManager;
11
+ private readonly config;
12
+ private readonly mempool;
13
+ private readonly statusManager;
14
+ private readonly logger;
15
+ private readonly metrics;
16
+ private readonly eventManager;
17
+ private readonly senderManager;
18
18
  private cachedLatestBlock;
19
- private pendingBundles;
20
- private receiptCache;
21
- private readonly receiptTtl;
22
- constructor({ config, mempool, monitor, metrics, reputationManager, eventManager, senderManager }: {
19
+ private readonly receiptCache;
20
+ private readonly gasPriceManager;
21
+ private readonly pendingBundles;
22
+ constructor({ config, mempool, statusManager, metrics, reputationManager, eventManager, senderManager, gasPriceManager }: {
23
23
  config: AltoConfig;
24
24
  mempool: Mempool;
25
- monitor: Monitor;
25
+ statusManager: StatusManager;
26
26
  metrics: Metrics;
27
27
  reputationManager: InterfaceReputationManager;
28
28
  eventManager: EventManager;
29
29
  senderManager: SenderManager;
30
+ gasPriceManager: GasPriceManager;
30
31
  });
31
32
  getPendingBundles(): SubmittedBundleInfo[];
32
- getReceipts(pendingBundles: SubmittedBundleInfo[]): Promise<BundleStatus[]>;
33
- processIncludedBundle({ submittedBundle, bundleReceipt }: {
33
+ getBundleStatuses(pendingBundles: SubmittedBundleInfo[]): Promise<BundleStatus[]>;
34
+ processIncludedBundle({ submittedBundle, bundleReceipt, blockReceivedTimestamp }: {
34
35
  submittedBundle: SubmittedBundleInfo;
35
36
  bundleReceipt: BundleStatus<"included">;
37
+ blockReceivedTimestamp: number;
36
38
  }): Promise<void>;
37
39
  /**
38
40
  * The reasons for reverted bundles are:
39
- * 1. complete bundle was frontrun -> cancel bundle -> need to wait for one more block to see if the userOp was frontrun
40
- * 2. partial bundle was frontrun -> filter out non-frontrun userOps and resubmit -> need to wait for one more block to see if the userOp was frontrun
41
- * 3. partial bundle was reverted -> filter out reverted userOps and resubmit
42
- * 4. full bundle was reverted -> cancel bundle -> need to wait for one more block to see if the userOp was frontrun
41
+ * 1. complete bundle was frontrun
42
+ * - cancel bundle
43
+ * - need to wait for one more block to see if the userOp was frontrun
44
+ *
45
+ * 2. partial bundle was frontrun
46
+ * - filter out non-frontrun userOps and resubmit
47
+ * - need to wait for one more block to see if the userOp was frontrun
48
+ *
49
+ * 3. partial bundle was reverted
50
+ * - filter out reverted userOps and resubmit
51
+ *
52
+ * 4. full bundle was reverted
53
+ * - cancel bundle
54
+ * - need to wait for one more block to see if the userOp was frontrun
43
55
  */
44
- processRevertedBundle({ submittedBundle, bundleReceipt, block }: {
56
+ processRevertedBundle({ submittedBundle, blockReceivedTimestamp, bundleReceipt }: {
45
57
  submittedBundle: SubmittedBundleInfo;
58
+ blockReceivedTimestamp: number;
46
59
  bundleReceipt: BundleStatus<"reverted">;
47
- block: Block;
60
+ }): Promise<void>;
61
+ processInternalErrorBundle({ submittedBundle, error }: {
62
+ submittedBundle: SubmittedBundleInfo;
63
+ error: string;
48
64
  }): Promise<void>;
49
65
  trackBundle(submittedBundle: SubmittedBundleInfo): void;
50
66
  getLatestBlockWithCache(): Promise<bigint>;
51
- private cacheReceipt;
52
- private getCachedReceipt;
53
- private pruneReceiptCache;
54
67
  private freeSubmittedBundle;
55
68
  stopTrackingBundle(submittedBundle: SubmittedBundleInfo): void;
56
- private processIncludedUserOp;
57
- checkFrontrun(userOpInfo: UserOpInfo, blockWaitCount?: number): Promise<boolean>;
69
+ private processIncludedUserOps;
70
+ getUserOpStatus({ userOpInfo, entryPoint, bundlerTxs, blockReceivedTimestamp, blockWaitCount }: {
71
+ userOpInfo: UserOpInfo;
72
+ entryPoint: Address;
73
+ bundlerTxs: Hex[];
74
+ blockReceivedTimestamp: number;
75
+ blockWaitCount?: number;
76
+ }): Promise<"not_found" | "included" | "frontran">;
58
77
  getUserOpReceipt(userOpHash: HexData32): Promise<{
59
78
  sender: `0x${string}`;
60
79
  userOpHash: `0x${string}`;
@@ -66,20 +85,20 @@ export declare class UserOpMonitor {
66
85
  logs: {
67
86
  address: `0x${string}`;
68
87
  data: `0x${string}`;
88
+ transactionHash: `0x${string}`;
69
89
  logIndex: bigint;
70
90
  transactionIndex: bigint;
71
- transactionHash: `0x${string}`;
72
91
  blockHash: `0x${string}`;
73
92
  blockNumber: bigint;
74
93
  topics: `0x${string}`[];
75
94
  }[];
76
95
  receipt: {
77
- to: `0x${string}` | null;
78
96
  gasUsed: bigint;
97
+ to: `0x${string}` | null;
79
98
  status: bigint | null;
99
+ transactionHash: `0x${string}`;
80
100
  contractAddress: `0x${string}` | null;
81
101
  transactionIndex: bigint;
82
- transactionHash: `0x${string}`;
83
102
  blockHash: `0x${string}`;
84
103
  blockNumber: bigint;
85
104
  from: `0x${string}`;
@@ -87,9 +106,9 @@ export declare class UserOpMonitor {
87
106
  logs: {
88
107
  address: `0x${string}`;
89
108
  data: `0x${string}`;
109
+ transactionHash: `0x${string}`;
90
110
  logIndex: bigint;
91
111
  transactionIndex: bigint;
92
- transactionHash: `0x${string}`;
93
112
  blockHash: `0x${string}`;
94
113
  blockNumber: bigint;
95
114
  topics: `0x${string}`[];
@@ -102,4 +121,4 @@ export declare class UserOpMonitor {
102
121
  } | null>;
103
122
  private checkAccountDeployment;
104
123
  }
105
- //# sourceMappingURL=userOpMonitor.d.ts.map
124
+ //# sourceMappingURL=bundleManager.d.ts.map
@@ -0,0 +1,393 @@
1
+ import { getUserOpHashes } from "./index.js";
2
+ import { createReceiptCache } from "../receiptCache/index.js";
3
+ import { parseUserOpReceipt } from "../utils/index.js";
4
+ import * as sentry from "@sentry/node";
5
+ import { TransactionReceiptNotFoundError, decodeEventLog, getAbiItem, getAddress } from "viem";
6
+ import { entryPoint07Abi } from "viem/account-abstraction";
7
+ import { filterOpsAndEstimateGas } from "./filterOpsAndEstimateGas.js";
8
+ import { getBundleStatus } from "./getBundleStatus.js";
9
+ export class BundleManager {
10
+ reputationManager;
11
+ config;
12
+ mempool;
13
+ statusManager;
14
+ logger;
15
+ metrics;
16
+ eventManager;
17
+ senderManager;
18
+ cachedLatestBlock;
19
+ receiptCache;
20
+ gasPriceManager;
21
+ pendingBundles = new Map();
22
+ constructor({ config, mempool, statusManager, metrics, reputationManager, eventManager, senderManager, gasPriceManager }) {
23
+ this.reputationManager = reputationManager;
24
+ this.config = config;
25
+ this.mempool = mempool;
26
+ this.statusManager = statusManager;
27
+ this.metrics = metrics;
28
+ this.eventManager = eventManager;
29
+ this.senderManager = senderManager;
30
+ this.cachedLatestBlock = null;
31
+ this.gasPriceManager = gasPriceManager;
32
+ this.logger = config.getLogger({ module: "userop_status_manager" }, {
33
+ level: config.executorLogLevel || config.logLevel
34
+ });
35
+ // Initialize receipt cache
36
+ this.receiptCache = createReceiptCache(config, config.receiptCacheTtl);
37
+ }
38
+ getPendingBundles() {
39
+ return Array.from(this.pendingBundles.values());
40
+ }
41
+ getBundleStatuses(pendingBundles) {
42
+ return Promise.all(pendingBundles.map(async (bundle) => {
43
+ try {
44
+ return await getBundleStatus({
45
+ submittedBundle: bundle,
46
+ publicClient: this.config.publicClient,
47
+ logger: this.logger
48
+ });
49
+ }
50
+ catch (err) {
51
+ sentry.captureException(err);
52
+ return {
53
+ status: "internal_error",
54
+ error: err instanceof Error ? err.message : String(err)
55
+ };
56
+ }
57
+ }));
58
+ }
59
+ async processIncludedBundle({ submittedBundle, bundleReceipt, blockReceivedTimestamp }) {
60
+ const { bundle } = submittedBundle;
61
+ const { userOps, entryPoint } = bundle;
62
+ const { transactionHash, blockNumber, userOpReceipts } = bundleReceipt;
63
+ // Cleanup bundle
64
+ await this.freeSubmittedBundle(submittedBundle);
65
+ // Process all userOps in parallel (non-blocking)
66
+ // The IIFE returns immediately, allowing the caller to continue
67
+ return (async () => {
68
+ const userOpsBatch = userOps.map((userOpInfo) => ({
69
+ userOpInfo,
70
+ userOpReceipt: userOpReceipts[userOpInfo.userOpHash]
71
+ }));
72
+ // Batch cache receipts
73
+ const receipts = Object.values(userOpReceipts);
74
+ await this.receiptCache.cache(receipts);
75
+ // Batch process userOps
76
+ await this.processIncludedUserOps(userOpsBatch, transactionHash, blockNumber, entryPoint, blockReceivedTimestamp);
77
+ })();
78
+ }
79
+ /**
80
+ * The reasons for reverted bundles are:
81
+ * 1. complete bundle was frontrun
82
+ * - cancel bundle
83
+ * - need to wait for one more block to see if the userOp was frontrun
84
+ *
85
+ * 2. partial bundle was frontrun
86
+ * - filter out non-frontrun userOps and resubmit
87
+ * - need to wait for one more block to see if the userOp was frontrun
88
+ *
89
+ * 3. partial bundle was reverted
90
+ * - filter out reverted userOps and resubmit
91
+ *
92
+ * 4. full bundle was reverted
93
+ * - cancel bundle
94
+ * - need to wait for one more block to see if the userOp was frontrun
95
+ */
96
+ async processRevertedBundle({ submittedBundle, blockReceivedTimestamp, bundleReceipt }) {
97
+ const { bundle } = submittedBundle;
98
+ const { blockNumber, transactionHash } = bundleReceipt;
99
+ this.logger.info({ transactionHash, userOpHashes: getUserOpHashes(bundle.userOps) }, "Processing reverted bundle");
100
+ await this.freeSubmittedBundle(submittedBundle);
101
+ const networkBaseFee = this.config.legacyTransactions
102
+ ? 0n
103
+ : await this.gasPriceManager.getBaseFee();
104
+ // make rest of the code non-blocking
105
+ return (async () => {
106
+ // Find userOps that can be resubmitted
107
+ const filterOpsResult = await filterOpsAndEstimateGas({
108
+ checkEip7702AuthNonces: true, // Check if any userOps reverted onchain due to invalid EIP-7702 auth nonce.
109
+ userOpBundle: bundle,
110
+ config: this.config,
111
+ logger: this.logger,
112
+ networkBaseFee
113
+ });
114
+ // Resubmit any userOps that we can recover
115
+ if (filterOpsResult.status === "success") {
116
+ const { userOpsToBundle } = filterOpsResult;
117
+ await this.mempool.resubmitUserOps({
118
+ userOps: userOpsToBundle,
119
+ entryPoint: bundle.entryPoint,
120
+ reason: "sibling_op_reverted"
121
+ });
122
+ }
123
+ const { rejectedUserOps } = filterOpsResult;
124
+ // Fire and forget
125
+ // Check if any rejected userOps were frontruns, if not mark as reverted onchain.
126
+ for (const userOpInfo of rejectedUserOps) {
127
+ ;
128
+ (async () => {
129
+ const status = await this.getUserOpStatus({
130
+ userOpInfo,
131
+ entryPoint: submittedBundle.bundle.entryPoint,
132
+ bundlerTxs: [
133
+ submittedBundle.transactionHash,
134
+ ...submittedBundle.previousTransactionHashes
135
+ ],
136
+ blockReceivedTimestamp
137
+ });
138
+ if (status === "not_found") {
139
+ const { userOpHash } = userOpInfo;
140
+ await this.statusManager.set([userOpHash], {
141
+ status: "failed",
142
+ transactionHash
143
+ });
144
+ this.eventManager.emitFailedOnChain(userOpHash, transactionHash, blockNumber);
145
+ this.logger.info({
146
+ userOpHash,
147
+ transactionHash
148
+ }, "user op failed onchain");
149
+ this.metrics.userOpsOnChain
150
+ .labels({ status: "reverted" })
151
+ .inc(1);
152
+ }
153
+ })();
154
+ }
155
+ })();
156
+ }
157
+ async processInternalErrorBundle({ submittedBundle, error }) {
158
+ const { bundle, transactionHash } = submittedBundle;
159
+ const { userOps } = bundle;
160
+ this.logger.error({
161
+ transactionHash,
162
+ userOpHashes: getUserOpHashes(userOps),
163
+ error
164
+ }, "Internal error processing bundle - cleaning up and dropping");
165
+ // Clean up the bundle so it doesn't get stuck
166
+ await this.freeSubmittedBundle(submittedBundle);
167
+ // Mark all userOps as failed
168
+ await this.statusManager.set(userOps.map((op) => op.userOpHash), {
169
+ status: "failed",
170
+ transactionHash
171
+ });
172
+ // Increment metrics for failed userOps
173
+ this.metrics.userOpsOnChain
174
+ .labels({ status: "internal_error" })
175
+ .inc(userOps.length);
176
+ }
177
+ trackBundle(submittedBundle) {
178
+ this.pendingBundles.set(submittedBundle.uid, submittedBundle);
179
+ }
180
+ // Helpers //
181
+ async getLatestBlockWithCache() {
182
+ const now = Date.now();
183
+ const cache = this.cachedLatestBlock;
184
+ if (cache && now - cache.timestamp < this.config.blockNumberCacheTtl) {
185
+ return cache.value;
186
+ }
187
+ const latestBlock = await this.config.publicClient.getBlockNumber();
188
+ this.cachedLatestBlock = { value: latestBlock, timestamp: now };
189
+ return latestBlock;
190
+ }
191
+ // Free executors and remove userOps from mempool.
192
+ async freeSubmittedBundle(submittedBundle) {
193
+ const { executor, bundle } = submittedBundle;
194
+ const { userOps, entryPoint } = bundle;
195
+ this.stopTrackingBundle(submittedBundle);
196
+ await this.senderManager.markWalletProcessed(executor);
197
+ await this.mempool.removeProcessing({ entryPoint, userOps });
198
+ }
199
+ // Stop tracking bundle in event resubmit fails
200
+ stopTrackingBundle(submittedBundle) {
201
+ this.pendingBundles.delete(submittedBundle.uid);
202
+ }
203
+ async processIncludedUserOps(userOpsBatch, transactionHash, blockNumber, entryPoint, blockReceivedTimestamp) {
204
+ // Update all statuses in one batch
205
+ await this.statusManager.set(userOpsBatch.map(({ userOpInfo }) => userOpInfo.userOpHash), {
206
+ status: "included",
207
+ transactionHash
208
+ });
209
+ // Process each userOp
210
+ for (const { userOpInfo, userOpReceipt } of userOpsBatch) {
211
+ const { userOpHash, userOp, submissionAttempts, addedToMempool } = userOpInfo;
212
+ const inclusionTimeMs = blockReceivedTimestamp - addedToMempool;
213
+ this.logger.info({ userOpHash, transactionHash, inclusionTimeMs }, "user op included");
214
+ // Log metric
215
+ this.metrics.userOpsOnChain.labels({ status: "included" }).inc();
216
+ // Emit appropriate event
217
+ if (userOpReceipt.success) {
218
+ this.eventManager.emitIncludedOnChain(userOpHash, transactionHash, blockNumber);
219
+ }
220
+ else {
221
+ this.eventManager.emitExecutionRevertedOnChain(userOpHash, transactionHash, userOpReceipt.reason || "0x", blockNumber);
222
+ }
223
+ // Track metrics
224
+ this.metrics.userOpInclusionDuration.observe(inclusionTimeMs / 1000);
225
+ this.metrics.userOpsSubmissionAttempts.observe(submissionAttempts);
226
+ // Update reputation
227
+ const accountDeployed = this.checkAccountDeployment(userOpReceipt, userOp.sender);
228
+ this.reputationManager.updateUserOpIncludedStatus(userOp, entryPoint, accountDeployed);
229
+ }
230
+ }
231
+ async getUserOpStatus({ userOpInfo, entryPoint, bundlerTxs, blockReceivedTimestamp, blockWaitCount = 0 }) {
232
+ const { userOpHash } = userOpInfo;
233
+ // Try to find userOp onchain
234
+ try {
235
+ const userOpReceipt = await this.getUserOpReceipt(userOpHash);
236
+ if (userOpReceipt &&
237
+ bundlerTxs.includes(userOpReceipt.receipt.transactionHash)) {
238
+ const { receipt } = userOpReceipt;
239
+ const { blockNumber, transactionHash } = receipt;
240
+ // Cache the receipt
241
+ await this.receiptCache.cache([userOpReceipt]);
242
+ await this.processIncludedUserOps([{ userOpInfo, userOpReceipt }], transactionHash, blockNumber, entryPoint, blockReceivedTimestamp);
243
+ // userOp was bundled by this bundler
244
+ return "included";
245
+ }
246
+ if (userOpReceipt) {
247
+ const transactionHash = userOpReceipt.receipt.transactionHash;
248
+ const blockNumber = userOpReceipt.receipt.blockNumber;
249
+ await this.statusManager.set([userOpHash], {
250
+ status: "included",
251
+ transactionHash
252
+ });
253
+ this.eventManager.emitFrontranOnChain(userOpHash, transactionHash, blockNumber);
254
+ this.logger.info({
255
+ userOpHash
256
+ }, "user op frontrun onchain");
257
+ // Update metrics
258
+ this.metrics.userOpsOnChain.labels({ status: "frontran" }).inc();
259
+ // userOp was bundled by another bundler
260
+ return "frontran";
261
+ }
262
+ if (blockWaitCount >= this.config.maxBlockWaitCount) {
263
+ return "not_found";
264
+ }
265
+ return new Promise((resolve) => {
266
+ setTimeout(() => {
267
+ resolve(this.getUserOpStatus({
268
+ userOpInfo,
269
+ entryPoint,
270
+ bundlerTxs,
271
+ blockReceivedTimestamp,
272
+ blockWaitCount: blockWaitCount + 1
273
+ }));
274
+ }, this.config.blockTime);
275
+ });
276
+ }
277
+ catch (err) {
278
+ this.logger.error({
279
+ err,
280
+ userOpHash
281
+ }, "Error checking frontrun status");
282
+ return "not_found";
283
+ }
284
+ }
285
+ async getUserOpReceipt(userOpHash) {
286
+ // Check cache first
287
+ const cached = await this.receiptCache.get(userOpHash);
288
+ if (cached) {
289
+ return cached;
290
+ }
291
+ let fromBlock;
292
+ let toBlock;
293
+ if (this.config.maxBlockRange !== undefined) {
294
+ const latestBlock = await this.getLatestBlockWithCache();
295
+ fromBlock = latestBlock - BigInt(this.config.maxBlockRange);
296
+ if (fromBlock < 0n) {
297
+ fromBlock = 0n;
298
+ }
299
+ toBlock = "latest";
300
+ }
301
+ const filterResult = await this.config.publicClient.getLogs({
302
+ address: this.config.entrypoints,
303
+ event: getAbiItem({
304
+ abi: entryPoint07Abi,
305
+ name: "UserOperationEvent"
306
+ }),
307
+ fromBlock,
308
+ toBlock,
309
+ args: {
310
+ userOpHash
311
+ }
312
+ });
313
+ if (filterResult.length === 0) {
314
+ return null;
315
+ }
316
+ const userOperationEvent = filterResult[0];
317
+ // throw if any of the members of userOperationEvent are undefined
318
+ if (userOperationEvent.args.actualGasCost === undefined ||
319
+ userOperationEvent.args.sender === undefined ||
320
+ userOperationEvent.args.nonce === undefined ||
321
+ userOperationEvent.args.userOpHash === undefined ||
322
+ userOperationEvent.args.success === undefined ||
323
+ userOperationEvent.args.paymaster === undefined ||
324
+ userOperationEvent.args.actualGasUsed === undefined) {
325
+ throw new Error("userOperationEvent has undefined members");
326
+ }
327
+ const txHash = userOperationEvent.transactionHash;
328
+ if (txHash === null) {
329
+ // transaction pending
330
+ return null;
331
+ }
332
+ const getTransactionReceipt = async (txHash) => {
333
+ const maxRetries = 16;
334
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
335
+ try {
336
+ const publicClient = this.config.publicClient;
337
+ const transactionReceipt = await publicClient.getTransactionReceipt({
338
+ hash: txHash
339
+ });
340
+ let effectiveGasPrice = transactionReceipt.effectiveGasPrice ??
341
+ transactionReceipt.gasPrice ??
342
+ undefined;
343
+ if (effectiveGasPrice === undefined) {
344
+ const tx = await publicClient.getTransaction({
345
+ hash: txHash
346
+ });
347
+ effectiveGasPrice = tx.gasPrice ?? undefined;
348
+ }
349
+ if (effectiveGasPrice) {
350
+ transactionReceipt.effectiveGasPrice = effectiveGasPrice;
351
+ }
352
+ return transactionReceipt;
353
+ }
354
+ catch (e) {
355
+ if (e instanceof TransactionReceiptNotFoundError) {
356
+ if (attempt < maxRetries - 1) {
357
+ // Wait a bit before trying again
358
+ await new Promise((resolve) => setTimeout(resolve, this.config.blockTime / 4));
359
+ continue;
360
+ }
361
+ // Max retries reached, likely a reorg
362
+ throw new Error(`Transaction receipt not found after ${maxRetries} attempts for tx ${txHash}`);
363
+ }
364
+ throw e;
365
+ }
366
+ }
367
+ // Should never reach here due to the throw in the catch block
368
+ throw new Error(`Failed to get transaction receipt for ${txHash}`);
369
+ };
370
+ const receipt = await getTransactionReceipt(txHash);
371
+ const userOpReceipt = parseUserOpReceipt(userOpHash, receipt);
372
+ // Cache the receipt before returning
373
+ await this.receiptCache.cache([userOpReceipt]);
374
+ return userOpReceipt;
375
+ }
376
+ checkAccountDeployment(userOpReceipt, sender) {
377
+ return userOpReceipt.receipt.logs.some((log) => {
378
+ try {
379
+ const { args } = decodeEventLog({
380
+ abi: entryPoint07Abi,
381
+ data: log.data,
382
+ eventName: "AccountDeployed",
383
+ topics: log.topics
384
+ });
385
+ return getAddress(args.sender) === sender;
386
+ }
387
+ catch {
388
+ return false;
389
+ }
390
+ });
391
+ }
392
+ }
393
+ //# sourceMappingURL=bundleManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundleManager.js","sourceRoot":"","sources":["../../executor/bundleManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAOpE,OAAO,EAAqB,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAO1E,OAAO,EAA6B,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,EAKH,+BAA+B,EAC/B,cAAc,EACd,UAAU,EACV,UAAU,EACb,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAqB,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEtE,MAAM,OAAO,aAAa;IACL,iBAAiB,CAA4B;IAC7C,MAAM,CAAY;IAClB,OAAO,CAAS;IAChB,aAAa,CAAe;IAC5B,MAAM,CAAQ;IACd,OAAO,CAAS;IAChB,YAAY,CAAc;IAC1B,aAAa,CAAe;IACrC,iBAAiB,CAA6C;IACrD,YAAY,CAAc;IAC1B,eAAe,CAAiB;IAChC,cAAc,GAC3B,IAAI,GAAG,EAAE,CAAA;IAEb,YAAY,EACR,MAAM,EACN,OAAO,EACP,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,eAAe,EAUlB;QACG,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAA;QAC1C,IAAI,CAAC,MA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,8 +1,7 @@
1
1
  import type { EventManager } from "../handlers/index.js";
2
2
  import type { Address, BundleResult, GasPriceParameters, UserOpInfo, UserOperationBundle } from "../types/index.js";
3
3
  import type { Logger } from "../utils/index.js";
4
- import { type Account } from "viem";
5
- import type { SignedAuthorizationList } from "viem";
4
+ import { type Account, type SignedAuthorizationList } from "viem";
6
5
  import type { AltoConfig } from "../createConfig.js";
7
6
  type HandleOpsTxParams = {
8
7
  gas: bigint;
@@ -43,9 +42,11 @@ export declare class Executor {
43
42
  totalBeneficiaryFees: bigint;
44
43
  bundleGasUsed: bigint;
45
44
  }): GasPriceParameters;
46
- sendHandleOpsTransaction({ txParam, gasOpts }: {
45
+ sendHandleOpsTransaction({ txParam, gasOpts, childLogger, submissionAttempts }: {
47
46
  txParam: HandleOpsTxParams;
48
47
  gasOpts: HandleOpsGasParams;
48
+ childLogger: Logger;
49
+ submissionAttempts: number;
49
50
  }): Promise<`0x${string}`>;
50
51
  bundle({ executor, userOpBundle, networkGasPrice, networkBaseFee, nonce }: {
51
52
  executor: Account;