@pimlico/alto 0.0.19 → 0.0.20

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 (337) 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/338795fc743ca612.json +1 -0
  52. package/contracts/build-info/44a9648cfe32a468.json +1 -0
  53. package/contracts/build-info/{880955d5786bfdae.json → 8dbf8a4ad39019b5.json} +1 -1
  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 +13 -6
  80. package/esm/cli/alto.js.map +1 -1
  81. package/esm/cli/config/bundler.d.ts +190 -148
  82. package/esm/cli/config/bundler.js +72 -83
  83. package/esm/cli/config/bundler.js.map +1 -1
  84. package/esm/cli/config/options.d.ts +2 -1
  85. package/esm/cli/config/options.js +105 -68
  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 +48 -52
  92. package/esm/cli/handler.js.map +1 -1
  93. package/esm/cli/setupServer.js +46 -47
  94. package/esm/cli/setupServer.js.map +1 -1
  95. package/esm/cli/shutDown.d.ts +20 -0
  96. package/esm/cli/shutDown.js +260 -0
  97. package/esm/cli/shutDown.js.map +1 -0
  98. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -1
  99. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -1
  100. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -1
  101. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
  102. package/esm/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -1
  103. package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
  104. package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
  105. package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
  106. package/esm/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
  107. package/esm/createConfig.d.ts +9 -2
  108. package/esm/createConfig.js.map +1 -1
  109. package/esm/executor/{userOpMonitor.d.ts → bundleManager.d.ts} +38 -32
  110. package/esm/executor/{userOpMonitor.js → bundleManager.js} +127 -99
  111. package/esm/executor/bundleManager.js.map +1 -0
  112. package/esm/executor/executor.d.ts +4 -3
  113. package/esm/executor/executor.js +33 -20
  114. package/esm/executor/executor.js.map +1 -1
  115. package/esm/executor/executorManager.d.ts +17 -15
  116. package/esm/executor/executorManager.js +130 -55
  117. package/esm/executor/executorManager.js.map +1 -1
  118. package/esm/executor/filterOpsAndEstimateGas.d.ts +17 -2
  119. package/esm/executor/filterOpsAndEstimateGas.js +100 -77
  120. package/esm/executor/filterOpsAndEstimateGas.js.map +1 -1
  121. package/esm/executor/index.d.ts +1 -0
  122. package/esm/executor/index.js +1 -0
  123. package/esm/executor/index.js.map +1 -1
  124. package/esm/executor/senderManager/createMemorySenderManager.js +13 -0
  125. package/esm/executor/senderManager/createMemorySenderManager.js.map +1 -1
  126. package/esm/executor/senderManager/createRedisSenderManager.d.ts +2 -1
  127. package/esm/executor/senderManager/createRedisSenderManager.js +3 -6
  128. package/esm/executor/senderManager/createRedisSenderManager.js.map +1 -1
  129. package/esm/executor/senderManager/flushOnStartUp.js +4 -4
  130. package/esm/executor/senderManager/flushOnStartUp.js.map +1 -1
  131. package/esm/executor/senderManager/index.d.ts +1 -0
  132. package/esm/executor/senderManager/index.js +6 -2
  133. package/esm/executor/senderManager/index.js.map +1 -1
  134. package/esm/executor/senderManager/validateAndRefill.js +2 -2
  135. package/esm/executor/senderManager/validateAndRefill.js.map +1 -1
  136. package/esm/executor/utilityWalletMonitor.d.ts +4 -4
  137. package/esm/executor/utilityWalletMonitor.js +1 -1
  138. package/esm/executor/utilityWalletMonitor.js.map +1 -1
  139. package/esm/executor/utils.d.ts +7 -2
  140. package/esm/executor/utils.js +57 -26
  141. package/esm/executor/utils.js.map +1 -1
  142. package/esm/handlers/arbitrumGasPriceManager.d.ts +3 -2
  143. package/esm/handlers/arbitrumGasPriceManager.js +6 -2
  144. package/esm/handlers/arbitrumGasPriceManager.js.map +1 -1
  145. package/esm/handlers/eventManager.d.ts +9 -9
  146. package/esm/handlers/eventManager.js +59 -60
  147. package/esm/handlers/eventManager.js.map +1 -1
  148. package/esm/handlers/gasPriceManager.d.ts +8 -9
  149. package/esm/handlers/gasPriceManager.js +68 -80
  150. package/esm/handlers/gasPriceManager.js.map +1 -1
  151. package/esm/handlers/mantleGasPriceManager.d.ts +4 -4
  152. package/esm/handlers/mantleGasPriceManager.js +4 -4
  153. package/esm/handlers/mantleGasPriceManager.js.map +1 -1
  154. package/esm/handlers/optimismManager.d.ts +1 -1
  155. package/esm/handlers/optimismManager.js +1 -1
  156. package/esm/handlers/optimismManager.js.map +1 -1
  157. package/esm/mempool/index.d.ts +1 -1
  158. package/esm/mempool/index.js +1 -1
  159. package/esm/mempool/index.js.map +1 -1
  160. package/esm/mempool/mempool.d.ts +57 -22
  161. package/esm/mempool/mempool.js +180 -134
  162. package/esm/mempool/mempool.js.map +1 -1
  163. package/esm/mempool/reputationManager.d.ts +14 -14
  164. package/esm/mempool/reputationManager.js +36 -39
  165. package/esm/mempool/reputationManager.js.map +1 -1
  166. package/esm/mempool/statusManager.d.ts +20 -0
  167. package/esm/mempool/statusManager.js +143 -0
  168. package/esm/mempool/statusManager.js.map +1 -0
  169. package/esm/receiptCache/createMemoryReceiptCache.d.ts +3 -0
  170. package/esm/receiptCache/createMemoryReceiptCache.js +30 -0
  171. package/esm/receiptCache/createMemoryReceiptCache.js.map +1 -0
  172. package/esm/receiptCache/createRedisReceiptCache.d.ts +10 -0
  173. package/esm/receiptCache/createRedisReceiptCache.js +56 -0
  174. package/esm/receiptCache/createRedisReceiptCache.js.map +1 -0
  175. package/esm/receiptCache/index.d.ts +11 -0
  176. package/esm/receiptCache/index.js +21 -0
  177. package/esm/receiptCache/index.js.map +1 -0
  178. package/esm/rpc/createMethodHandler.js.map +1 -1
  179. package/esm/rpc/estimation/gasEstimationHandler.d.ts +2 -4
  180. package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
  181. package/esm/rpc/estimation/gasEstimations06.d.ts +6 -7
  182. package/esm/rpc/estimation/gasEstimations06.js +1 -5
  183. package/esm/rpc/estimation/gasEstimations06.js.map +1 -1
  184. package/esm/rpc/estimation/gasEstimations07.d.ts +13 -41
  185. package/esm/rpc/estimation/gasEstimations07.js +27 -34
  186. package/esm/rpc/estimation/gasEstimations07.js.map +1 -1
  187. package/esm/{utils/preVerificationGasCalulator.d.ts → rpc/estimation/preVerificationGasCalculator.d.ts} +20 -6
  188. package/esm/{utils/preVerificationGasCalulator.js → rpc/estimation/preVerificationGasCalculator.js} +95 -47
  189. package/esm/rpc/estimation/preVerificationGasCalculator.js.map +1 -0
  190. package/esm/rpc/estimation/types.d.ts +4 -2
  191. package/esm/rpc/estimation/utils.d.ts +10 -8
  192. package/esm/rpc/estimation/utils.js +54 -48
  193. package/esm/rpc/estimation/utils.js.map +1 -1
  194. package/esm/rpc/methods/boost_sendUserOperation.d.ts +304 -0
  195. package/esm/rpc/methods/debug_bundler_clearReputation.js +1 -1
  196. package/esm/rpc/methods/debug_bundler_clearReputation.js.map +1 -1
  197. package/esm/rpc/methods/debug_bundler_clearState.js +1 -1
  198. package/esm/rpc/methods/debug_bundler_clearState.js.map +1 -1
  199. package/esm/rpc/methods/debug_bundler_dumpMempool.d.ts +338 -0
  200. package/esm/rpc/methods/debug_bundler_dumpReputation.js +1 -1
  201. package/esm/rpc/methods/debug_bundler_dumpReputation.js.map +1 -1
  202. package/esm/rpc/methods/eth_estimateUserOperationGas.d.ts +622 -14
  203. package/esm/rpc/methods/eth_estimateUserOperationGas.js +50 -29
  204. package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
  205. package/esm/rpc/methods/eth_getUserOperationByHash.d.ts +621 -11
  206. package/esm/rpc/methods/eth_getUserOperationByHash.js.map +1 -1
  207. package/esm/rpc/methods/eth_getUserOperationReceipt.d.ts +26 -26
  208. package/esm/rpc/methods/eth_getUserOperationReceipt.js +1 -1
  209. package/esm/rpc/methods/eth_sendUserOperation.d.ts +305 -1
  210. package/esm/rpc/methods/eth_sendUserOperation.js +132 -36
  211. package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
  212. package/esm/rpc/methods/pimlico_getUserOperationStatus.js +1 -1
  213. package/esm/rpc/methods/pimlico_getUserOperationStatus.js.map +1 -1
  214. package/esm/rpc/methods/pimlico_sendUserOperationNow.d.ts +330 -26
  215. package/esm/rpc/methods/pimlico_sendUserOperationNow.js +15 -27
  216. package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -1
  217. package/esm/rpc/methods/pimlico_simulateAssetChange.d.ts +620 -12
  218. package/esm/rpc/methods/pimlico_simulateAssetChange.js +14 -19
  219. package/esm/rpc/methods/pimlico_simulateAssetChange.js.map +1 -1
  220. package/esm/rpc/rpcHandler.d.ts +21 -22
  221. package/esm/rpc/rpcHandler.js +15 -17
  222. package/esm/rpc/rpcHandler.js.map +1 -1
  223. package/esm/rpc/server.d.ts +5 -5
  224. package/esm/rpc/server.js +15 -11
  225. package/esm/rpc/server.js.map +1 -1
  226. package/esm/rpc/validation/BundlerCollectorTracerV06.js +1 -1
  227. package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +1 -1
  228. package/esm/rpc/validation/BundlerCollectorTracerV07.js +1 -1
  229. package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +1 -1
  230. package/esm/rpc/validation/SafeValidator.d.ts +13 -14
  231. package/esm/rpc/validation/SafeValidator.js +24 -24
  232. package/esm/rpc/validation/SafeValidator.js.map +1 -1
  233. package/esm/rpc/validation/TracerResultParserV06.d.ts +2 -2
  234. package/esm/rpc/validation/TracerResultParserV06.js +11 -11
  235. package/esm/rpc/validation/TracerResultParserV06.js.map +1 -1
  236. package/esm/rpc/validation/TracerResultParserV07.d.ts +2 -2
  237. package/esm/rpc/validation/TracerResultParserV07.js +13 -13
  238. package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
  239. package/esm/rpc/validation/UnsafeValidator.d.ts +18 -14
  240. package/esm/rpc/validation/UnsafeValidator.js +71 -40
  241. package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
  242. package/esm/store/createMempoolStore.d.ts +1 -1
  243. package/esm/store/createMempoolStore.js +63 -139
  244. package/esm/store/createMempoolStore.js.map +1 -1
  245. package/esm/store/index.d.ts +4 -75
  246. package/esm/store/index.js +4 -1
  247. package/esm/store/index.js.map +1 -1
  248. package/esm/store/outstanding/index.d.ts +13 -0
  249. package/esm/store/outstanding/index.js +16 -0
  250. package/esm/store/outstanding/index.js.map +1 -0
  251. package/esm/store/{createMemoryOutstandingStore.d.ts → outstanding/memory.d.ts} +14 -13
  252. package/esm/store/outstanding/memory.js +263 -0
  253. package/esm/store/outstanding/memory.js.map +1 -0
  254. package/esm/store/outstanding/redis.d.ts +11 -0
  255. package/esm/store/outstanding/redis.js +229 -0
  256. package/esm/store/outstanding/redis.js.map +1 -0
  257. package/esm/store/outstanding/types.d.ts +19 -0
  258. package/esm/store/outstanding/types.js +2 -0
  259. package/esm/store/outstanding/types.js.map +1 -0
  260. package/esm/store/processing/index.d.ts +11 -0
  261. package/esm/store/processing/index.js +17 -0
  262. package/esm/store/processing/index.js.map +1 -0
  263. package/esm/store/processing/memory.d.ts +16 -0
  264. package/esm/store/processing/memory.js +58 -0
  265. package/esm/store/processing/memory.js.map +1 -0
  266. package/esm/store/processing/redis.d.ts +23 -0
  267. package/esm/store/processing/redis.js +85 -0
  268. package/esm/store/processing/redis.js.map +1 -0
  269. package/esm/store/processing/types.d.ts +10 -0
  270. package/esm/store/processing/types.js +2 -0
  271. package/esm/store/processing/types.js.map +1 -0
  272. package/esm/store/types.d.ts +50 -0
  273. package/esm/store/types.js +2 -0
  274. package/esm/store/types.js.map +1 -0
  275. package/esm/types/contracts/PimlicoSimulations.d.ts +81 -0
  276. package/esm/types/contracts/PimlicoSimulations.js +105 -0
  277. package/esm/types/contracts/PimlicoSimulations.js.map +1 -1
  278. package/esm/types/gasPrice.js +0 -18
  279. package/esm/types/gasPrice.js.map +1 -1
  280. package/esm/types/interfaces.d.ts +15 -10
  281. package/esm/types/mempool.d.ts +3 -0
  282. package/esm/types/schemas.d.ts +13174 -4732
  283. package/esm/types/schemas.js +113 -25
  284. package/esm/types/schemas.js.map +1 -1
  285. package/esm/types/utils.d.ts +2 -5
  286. package/esm/types/utils.js +16 -18
  287. package/esm/types/utils.js.map +1 -1
  288. package/esm/types/validation.d.ts +7646 -6912
  289. package/esm/types/validation.js +122 -152
  290. package/esm/types/validation.js.map +1 -1
  291. package/esm/utils/eip7702.d.ts +2 -1
  292. package/esm/utils/eip7702.js +14 -8
  293. package/esm/utils/eip7702.js.map +1 -1
  294. package/esm/utils/entryPointOverrides.js +18 -4
  295. package/esm/utils/entryPointOverrides.js.map +1 -1
  296. package/esm/utils/helpers.d.ts +2 -1
  297. package/esm/utils/helpers.js +30 -11
  298. package/esm/utils/helpers.js.map +1 -1
  299. package/esm/utils/index.d.ts +0 -1
  300. package/esm/utils/index.js +0 -1
  301. package/esm/utils/index.js.map +1 -1
  302. package/esm/utils/metrics.d.ts +2 -1
  303. package/esm/utils/metrics.js +15 -8
  304. package/esm/utils/metrics.js.map +1 -1
  305. package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js +8 -9
  306. package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js.map +1 -1
  307. package/esm/utils/minMaxQueue/createRedisMinMaxQueue.d.ts +24 -2
  308. package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js +85 -64
  309. package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js.map +1 -1
  310. package/esm/utils/minMaxQueue/index.d.ts +2 -2
  311. package/esm/utils/minMaxQueue/index.js +4 -3
  312. package/esm/utils/minMaxQueue/index.js.map +1 -1
  313. package/esm/utils/rpc-reply.d.ts +3 -3
  314. package/esm/utils/rpc-reply.js.map +1 -1
  315. package/esm/utils/toViemStateOverrides.js +7 -7
  316. package/esm/utils/toViemStateOverrides.js.map +1 -1
  317. package/esm/utils/userop.d.ts +87 -55
  318. package/esm/utils/userop.js +138 -248
  319. package/esm/utils/userop.js.map +1 -1
  320. package/package.json +4 -2
  321. package/contracts/build-info/7710b5a048396e70.json +0 -1
  322. package/esm/executor/userOpMonitor.js.map +0 -1
  323. package/esm/mempool/monitoring.d.ts +0 -15
  324. package/esm/mempool/monitoring.js +0 -118
  325. package/esm/mempool/monitoring.js.map +0 -1
  326. package/esm/store/createMemoryOutstandingStore.js +0 -240
  327. package/esm/store/createMemoryOutstandingStore.js.map +0 -1
  328. package/esm/store/createRedisOutstandingStore.d.ts +0 -27
  329. package/esm/store/createRedisOutstandingStore.js +0 -344
  330. package/esm/store/createRedisOutstandingStore.js.map +0 -1
  331. package/esm/store/createRedisStore.d.ts +0 -9
  332. package/esm/store/createRedisStore.js +0 -131
  333. package/esm/store/createRedisStore.js.map +0 -1
  334. package/esm/store/createStore.d.ts +0 -6
  335. package/esm/store/createStore.js +0 -66
  336. package/esm/store/createStore.js.map +0 -1
  337. package/esm/utils/preVerificationGasCalulator.js.map +0 -1
@@ -1,7 +1,6 @@
1
1
  import type { GasPriceManager } from "../../handlers/index.js";
2
- import type { InterfaceValidator, StateOverrides, UserOperationV06, UserOperationV07, ValidationResult, ValidationResultV06, ValidationResultV07, ValidationResultWithAggregationV06, ValidationResultWithAggregationV07 } from "../../types/index.js";
3
- import { type Address, type ExecutionResult, type ReferencedCodeHashes, type StorageMap, type UserOperation, type ValidationResultWithAggregation } from "../../types/index.js";
4
- import type { Logger, Metrics } from "../../utils/index.js";
2
+ import { type Address, type ExecutionResult, type InterfaceValidator, type ReferencedCodeHashes, type StateOverrides, type StorageMap, type UserOperation, type UserOperation06, type UserOperation07, type ValidationResult, type ValidationResult06, type ValidationResult07 } from "../../types/index.js";
3
+ import { type Logger, type Metrics } from "../../utils/index.js";
5
4
  import type { AltoConfig } from "../../createConfig.js";
6
5
  import { GasEstimationHandler } from "../estimation/gasEstimationHandler.js";
7
6
  import type { SimulateHandleOpResult } from "../estimation/types.js";
@@ -16,24 +15,29 @@ export declare class UnsafeValidator implements InterfaceValidator {
16
15
  metrics: Metrics;
17
16
  gasPriceManager: GasPriceManager;
18
17
  });
19
- getSimulationResult(isVersion06: boolean, errorResult: unknown, logger: Logger, simulationType: "validation" | "execution"): Promise<ValidationResult | ValidationResultWithAggregation | ExecutionResult>;
18
+ getSimulationResult06(errorResult: unknown, logger: Logger, simulationType: "validation" | "execution"): Promise<ValidationResult | ExecutionResult>;
20
19
  validateHandleOp(args: {
21
20
  userOp: UserOperation;
22
21
  entryPoint: Address;
23
22
  queuedUserOps: UserOperation[];
24
23
  stateOverrides?: StateOverrides;
25
- }): Promise<SimulateHandleOpResult>;
24
+ }): Promise<{
25
+ callGasLimit: bigint;
26
+ verificationGasLimit: bigint;
27
+ paymasterVerificationGasLimit: bigint | null;
28
+ paymasterPostOpGasLimit: bigint | null;
29
+ }>;
26
30
  getExecutionResult(args: {
27
31
  userOp: UserOperation;
28
32
  entryPoint: Address;
29
33
  queuedUserOps: UserOperation[];
30
34
  stateOverrides?: StateOverrides;
31
35
  }): Promise<SimulateHandleOpResult>;
32
- getValidationResultV06(args: {
33
- userOp: UserOperationV06;
36
+ getValidationResult06(args: {
37
+ userOp: UserOperation06;
34
38
  entryPoint: Address;
35
39
  codeHashes?: ReferencedCodeHashes;
36
- }): Promise<(ValidationResultV06 | ValidationResultWithAggregationV06) & {
40
+ }): Promise<ValidationResult06 & {
37
41
  storageMap: StorageMap;
38
42
  referencedContracts?: ReferencedCodeHashes;
39
43
  }>;
@@ -62,12 +66,12 @@ export declare class UnsafeValidator implements InterfaceValidator {
62
66
  validAfter: number;
63
67
  validUntil: number;
64
68
  };
65
- getValidationResultV07(args: {
66
- userOp: UserOperationV07;
67
- queuedUserOps: UserOperationV07[];
69
+ getValidationResult07(args: {
70
+ userOp: UserOperation07;
71
+ queuedUserOps: UserOperation07[];
68
72
  entryPoint: Address;
69
73
  codeHashes?: ReferencedCodeHashes;
70
- }): Promise<(ValidationResultV07 | ValidationResultWithAggregationV07) & {
74
+ }): Promise<ValidationResult07 & {
71
75
  storageMap: StorageMap;
72
76
  referencedContracts?: ReferencedCodeHashes;
73
77
  }>;
@@ -76,7 +80,7 @@ export declare class UnsafeValidator implements InterfaceValidator {
76
80
  queuedUserOps: UserOperation[];
77
81
  entryPoint: Address;
78
82
  codeHashes?: ReferencedCodeHashes;
79
- }): Promise<(ValidationResult | ValidationResultWithAggregation) & {
83
+ }): Promise<ValidationResult & {
80
84
  storageMap: StorageMap;
81
85
  referencedContracts?: ReferencedCodeHashes;
82
86
  }>;
@@ -85,7 +89,7 @@ export declare class UnsafeValidator implements InterfaceValidator {
85
89
  queuedUserOps: UserOperation[];
86
90
  entryPoint: Address;
87
91
  _referencedContracts?: ReferencedCodeHashes;
88
- }): Promise<(ValidationResult | ValidationResultWithAggregation) & {
92
+ }): Promise<ValidationResult & {
89
93
  storageMap: StorageMap;
90
94
  referencedContracts?: ReferencedCodeHashes;
91
95
  }>;
@@ -1,10 +1,11 @@
1
- import { EntryPointV06Abi, ExecutionErrors, RpcError, ValidationErrors, entryPointExecutionErrorSchemaV06, entryPointExecutionErrorSchemaV07 } from "../../types/index.js";
1
+ import { ERC7769Errors, EntryPointV06Abi, RpcError, entryPointExecutionErrorSchema06 } from "../../types/index.js";
2
2
  import { isVersion06 } from "../../utils/index.js";
3
3
  import * as sentry from "@sentry/node";
4
4
  import { BaseError, ContractFunctionExecutionError, getContract, pad, slice, toHex, zeroAddress } from "viem";
5
5
  import { fromZodError } from "zod-validation-error";
6
6
  import { getEip7702DelegationOverrides } from "../../utils/eip7702.js";
7
7
  import { GasEstimationHandler } from "../estimation/gasEstimationHandler.js";
8
+ import { toErc7769Code } from "../estimation/utils.js";
8
9
  export class UnsafeValidator {
9
10
  config;
10
11
  metrics;
@@ -20,14 +21,11 @@ export class UnsafeValidator {
20
21
  });
21
22
  this.gasEstimationHandler = new GasEstimationHandler(config, gasPriceManager);
22
23
  }
23
- async getSimulationResult(isVersion06, errorResult, logger, simulationType) {
24
- const entryPointExecutionErrorSchema = isVersion06
25
- ? entryPointExecutionErrorSchemaV06
26
- : entryPointExecutionErrorSchemaV07;
27
- const entryPointErrorSchemaParsing = entryPointExecutionErrorSchema.safeParse(errorResult);
28
- if (!entryPointErrorSchemaParsing.success) {
24
+ async getSimulationResult06(errorResult, logger, simulationType) {
25
+ const parsingResult = entryPointExecutionErrorSchema06.safeParse(errorResult);
26
+ if (!parsingResult.success) {
29
27
  try {
30
- const err = fromZodError(entryPointErrorSchemaParsing.error);
28
+ const err = fromZodError(parsingResult.error);
31
29
  logger.error({ error: err.message }, "unexpected error during valiation");
32
30
  logger.error(JSON.stringify(errorResult));
33
31
  err.message = `User Operation simulation returned unexpected invalid response: ${err.message}`;
@@ -38,16 +36,16 @@ export class UnsafeValidator {
38
36
  const revertError = errorResult.walk((err) => err instanceof ContractFunctionExecutionError);
39
37
  throw new RpcError(`UserOperation reverted during simulation with reason: ${
40
38
  // biome-ignore lint/suspicious/noExplicitAny: it's a generic type
41
- revertError?.cause?.reason}`, ValidationErrors.SimulateValidation);
39
+ revertError?.cause?.reason}`, ERC7769Errors.SimulateValidation);
42
40
  }
43
41
  sentry.captureException(errorResult);
44
42
  throw new Error(`User Operation simulation returned unexpected invalid response: ${JSON.stringify(errorResult)}`);
45
43
  }
46
44
  }
47
- const errorData = entryPointErrorSchemaParsing.data;
45
+ const errorData = parsingResult.data;
48
46
  if (errorData.errorName === "FailedOp") {
49
47
  const reason = errorData.args.reason;
50
- throw new RpcError(`UserOperation reverted during simulation with reason: ${reason}`, ValidationErrors.SimulateValidation);
48
+ throw new RpcError(`UserOperation reverted during simulation with reason: ${reason}`, toErc7769Code(reason));
51
49
  }
52
50
  if (simulationType === "validation") {
53
51
  if (errorData.errorName !== "ValidationResult" &&
@@ -71,14 +69,55 @@ export class UnsafeValidator {
71
69
  targetCallData: "0x",
72
70
  stateOverrides
73
71
  });
72
+ let { callGasLimit, verificationGasLimit } = userOp;
73
+ let paymasterVerificationGasLimit = "paymasterVerificationGasLimit" in userOp
74
+ ? userOp.paymasterVerificationGasLimit
75
+ : null;
76
+ // Check if userOperation passes without estimation balance overrides (will throw error if it fails validation)
77
+ // the errors we are looking for are:
78
+ // 1. AA31 paymaster deposit too low
79
+ // 2. AA21 didn't pay prefund
74
80
  if (error.result === "failed") {
75
- let errorCode = ExecutionErrors.UserOperationReverted;
76
- if (error.data.toString().includes("AA23")) {
77
- errorCode = ValidationErrors.SimulateValidation;
81
+ const data = error.data.toString();
82
+ if (data.includes("AA31") ||
83
+ data.includes("AA21") ||
84
+ data.includes("AA50")) {
85
+ const errorMessage = data;
86
+ throw new RpcError(`UserOperation reverted during simulation with reason: ${errorMessage}`, toErc7769Code(errorMessage));
87
+ }
88
+ this.metrics.altoSecondValidationFailed.inc();
89
+ this.logger.warn({ data }, "Second validation during eth_estimateUserOperationGas led to a failure");
90
+ // we always have to double the call gas limits as other gas limits happen
91
+ // before we even get to callGasLimit
92
+ callGasLimit *= 2n;
93
+ const isPaymasterError = data.includes("AA33") || data.includes("AA36");
94
+ const isVerificationError = data.includes("AA23") ||
95
+ data.includes("AA13") ||
96
+ data.includes("AA26") ||
97
+ data.includes("AA40") ||
98
+ data.includes("AA41");
99
+ if (isPaymasterError && paymasterVerificationGasLimit) {
100
+ // paymasterVerificationGasLimit out of gas errors
101
+ paymasterVerificationGasLimit *= 2n;
102
+ }
103
+ else if (isVerificationError) {
104
+ // verificationGasLimit out of gas errors
105
+ verificationGasLimit *= 2n;
106
+ // we need to increase paymaster fields because they will be
107
+ // caught after verification gas limit errors
108
+ if (paymasterVerificationGasLimit) {
109
+ paymasterVerificationGasLimit *= 2n;
110
+ }
78
111
  }
79
- throw new RpcError(`UserOperation reverted during simulation with reason: ${error.data}`, errorCode);
80
112
  }
81
- return error;
113
+ return {
114
+ callGasLimit: callGasLimit,
115
+ verificationGasLimit: verificationGasLimit,
116
+ paymasterVerificationGasLimit: paymasterVerificationGasLimit,
117
+ paymasterPostOpGasLimit: "paymasterPostOpGasLimit" in userOp
118
+ ? userOp.paymasterPostOpGasLimit
119
+ : null
120
+ };
82
121
  }
83
122
  async getExecutionResult(args) {
84
123
  const { userOp, entryPoint, queuedUserOps, stateOverrides } = args;
@@ -91,24 +130,15 @@ export class UnsafeValidator {
91
130
  stateOverrides
92
131
  });
93
132
  if (error.result === "failed") {
94
- let errorCode = ExecutionErrors.UserOperationReverted;
95
- if (error.data.toString().includes("AA23")) {
96
- errorCode = ValidationErrors.SimulateValidation;
97
- return {
98
- result: "failed",
99
- data: error.data,
100
- code: errorCode
101
- };
102
- }
103
133
  return {
104
134
  result: "failed",
105
135
  data: `UserOperation reverted during simulation with reason: ${error.data}`,
106
- code: errorCode
136
+ code: error.code
107
137
  };
108
138
  }
109
139
  return error;
110
140
  }
111
- async getValidationResultV06(args) {
141
+ async getValidationResult06(args) {
112
142
  const { userOp, entryPoint } = args;
113
143
  const entryPointContract = getContract({
114
144
  address: entryPoint,
@@ -138,11 +168,11 @@ export class UnsafeValidator {
138
168
  });
139
169
  const [simulateValidationResult, runtimeValidation] = await Promise.all([simulateValidationPromise, runtimeValidationPromise]);
140
170
  const validationResult = {
141
- ...(await this.getSimulationResult(isVersion06(userOp), simulateValidationResult, this.logger, "validation")),
171
+ ...(await this.getSimulationResult06(simulateValidationResult, this.logger, "validation")),
142
172
  storageMap: {}
143
173
  };
144
174
  if (validationResult.returnInfo.sigFailed) {
145
- throw new RpcError("Invalid UserOperation signature or paymaster signature", ValidationErrors.InvalidSignature);
175
+ throw new RpcError("Invalid UserOperation signature or paymaster signature", ERC7769Errors.InvalidSignature);
146
176
  }
147
177
  const now = Date.now() / 1000;
148
178
  this.logger.debug({
@@ -152,15 +182,15 @@ export class UnsafeValidator {
152
182
  });
153
183
  if (validationResult.returnInfo.validAfter > now &&
154
184
  this.config.expirationCheck) {
155
- throw new RpcError("User operation is not valid yet", ValidationErrors.ExpiresShortly);
185
+ throw new RpcError("User operation is not valid yet", ERC7769Errors.ExpiresShortly);
156
186
  }
157
187
  if (this.config.expirationCheck &&
158
188
  validationResult.returnInfo.validUntil < now + 5) {
159
- throw new RpcError("expires too soon", ValidationErrors.ExpiresShortly);
189
+ throw new RpcError("expires too soon", ERC7769Errors.ExpiresShortly);
160
190
  }
161
191
  // validate runtime
162
192
  if (runtimeValidation.result === "failed") {
163
- throw new RpcError(`UserOperation reverted during simulation with reason: ${runtimeValidation.data}`, ValidationErrors.SimulateValidation);
193
+ throw new RpcError(`UserOperation reverted during simulation with reason: ${runtimeValidation.data}`, ERC7769Errors.SimulateValidation);
164
194
  }
165
195
  return validationResult;
166
196
  }
@@ -191,7 +221,7 @@ export class UnsafeValidator {
191
221
  mergeValidationDataValues(accountValidationData, paymasterValidationData) {
192
222
  return this.mergeValidationData(this.parseValidationData(accountValidationData), this.parseValidationData(paymasterValidationData));
193
223
  }
194
- async getValidationResultV07(args) {
224
+ async getValidationResult07(args) {
195
225
  const { userOp, queuedUserOps, entryPoint } = args;
196
226
  const simulateValidationResult = await this.gasEstimationHandler.gasEstimator07.simulateValidation({
197
227
  entryPoint,
@@ -199,7 +229,8 @@ export class UnsafeValidator {
199
229
  queuedUserOps
200
230
  });
201
231
  if (simulateValidationResult.result === "failed") {
202
- throw new RpcError(`UserOperation reverted with reason: ${simulateValidationResult.data}`, ValidationErrors.SimulateValidation);
232
+ const failedResult = simulateValidationResult;
233
+ throw new RpcError(`UserOperation reverted with reason: ${failedResult.data}`, failedResult.code);
203
234
  }
204
235
  const validationResult = simulateValidationResult.data;
205
236
  const mergedValidation = this.mergeValidationDataValues(validationResult.returnInfo.accountValidationData, validationResult.returnInfo.paymasterValidationData);
@@ -232,32 +263,32 @@ export class UnsafeValidator {
232
263
  };
233
264
  // this.validateStorageAccessList(userOp, res, accessList)
234
265
  if (res.returnInfo.accountSigFailed) {
235
- throw new RpcError("Invalid UserOp signature", ValidationErrors.InvalidSignature);
266
+ throw new RpcError("Invalid UserOp signature", ERC7769Errors.InvalidSignature);
236
267
  }
237
268
  if (res.returnInfo.paymasterSigFailed) {
238
- throw new RpcError("Invalid UserOp paymasterData", ValidationErrors.InvalidSignature);
269
+ throw new RpcError("Invalid UserOp paymasterData", ERC7769Errors.InvalidSignature);
239
270
  }
240
271
  const now = Math.floor(Date.now() / 1000);
241
272
  if (res.returnInfo.validAfter > now) {
242
- throw new RpcError(`User operation is not valid yet, validAfter=${res.returnInfo.validAfter}, now=${now}`, ValidationErrors.ExpiresShortly);
273
+ throw new RpcError(`User operation is not valid yet, validAfter=${res.returnInfo.validAfter}, now=${now}`, ERC7769Errors.ExpiresShortly);
243
274
  }
244
275
  if (this.config.expirationCheck &&
245
276
  (res.returnInfo.validUntil == null ||
246
277
  res.returnInfo.validUntil < now + 5)) {
247
- throw new RpcError(`UserOperation expires too soon, validUntil=${res.returnInfo.validUntil}, now=${now}`, ValidationErrors.ExpiresShortly);
278
+ throw new RpcError(`UserOperation expires too soon, validUntil=${res.returnInfo.validUntil}, now=${now}`, ERC7769Errors.ExpiresShortly);
248
279
  }
249
280
  return res;
250
281
  }
251
282
  getValidationResult(args) {
252
283
  const { userOp, queuedUserOps, entryPoint, codeHashes } = args;
253
284
  if (isVersion06(userOp)) {
254
- return this.getValidationResultV06({
285
+ return this.getValidationResult06({
255
286
  userOp,
256
287
  entryPoint,
257
288
  codeHashes
258
289
  });
259
290
  }
260
- return this.getValidationResultV07({
291
+ return this.getValidationResult07({
261
292
  userOp,
262
293
  queuedUserOps: queuedUserOps,
263
294
  entryPoint
@@ -1 +1 @@
1
- {"version":3,"file":"UnsafeValidator.js","sourceRoot":"","sources":["../../../rpc/validation/UnsafeValidator.ts"],"names":[],"mappings":"AAYA,OAAO,EAEH,gBAAgB,EAChB,eAAe,EAGf,QAAQ,EAGR,gBAAgB,EAEhB,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,EACH,SAAS,EACT,8BAA8B,EAE9B,WAAW,EACX,GAAG,EACH,KAAK,EACL,KAAK,EACL,WAAW,EACd,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,YAAY,EAAE,MAAM,s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C,cAAc,CAC/B,CAAA;QACL,CAAC;QAED,OAAO,GAAG,CAAA;IACd,CAAC;IAED,mBAAmB,CAAC,IAKnB;QAMG,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;QAC9D,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,qBAAqB,CAAC;gBAC9B,MAAM;gBACN,UAAU;gBACV,UAAU;aACb,CAAC,CAAA;QACN,CAAC;QACD,OAAO,IAAI,CAAC,qBAAqB,CAAC;YAC9B,MAAM;YACN,aAAa,EAAE,aAAkC;YACjD,UAAU;SACb,CAAC,CAAA;IACN,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,IAKpB;QAMG,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;QAClD,IAAI,CAAC;YACD,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC;gBACpD,MAAM;gBACN,aAAa;gBACb,UAAU;aACb,CAAC,CAAA;YAEF,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,GAAG,EAAE,CAAA;YAE3C,OAAO,gBAAgB,CAAA;QAC3B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,iBAAiB;YACjB,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,GAAG,EAAE,CAAA;YAC3C,MAAM,CAAC,CAAA;QACX,CAAC;IACL,CAAC;CACJ"}
@@ -1,5 +1,5 @@
1
+ import { type MempoolStore } from "./index.js";
1
2
  import type { Metrics } from "../utils/index.js";
2
- import type { MempoolStore } from "./index.js";
3
3
  import type { AltoConfig } from "../createConfig.js";
4
4
  export declare const createMempoolStore: ({ config, metrics }: {
5
5
  config: AltoConfig;
@@ -1,8 +1,5 @@
1
+ import { createOutstandingQueue, createProcessingStore } from "./index.js";
1
2
  import * as sentry from "@sentry/node";
2
- import { createMemoryOutstandingQueue } from "./createMemoryOutstandingStore.js";
3
- import { createRedisOutstandingQueue } from "./createRedisOutstandingStore.js";
4
- import { createRedisStore } from "./createRedisStore.js";
5
- import { createMemoryStore } from "./createStore.js";
6
3
  export const createMempoolStore = ({ config, metrics }) => {
7
4
  const logger = config.getLogger({ module: "mempool-store" }, {
8
5
  level: config.logLevel
@@ -17,48 +14,20 @@ export const createMempoolStore = ({ config, metrics }) => {
17
14
  return handlers;
18
15
  };
19
16
  for (const entryPoint of config.entrypoints) {
20
- let outstanding;
21
- let processing;
22
- let submitted;
23
- if (config.redisMempoolUrl) {
24
- outstanding = createRedisOutstandingQueue({
25
- config,
26
- entryPoint
27
- });
28
- processing = createRedisStore({
29
- config,
30
- entryPoint,
31
- storeType: "processing"
32
- });
33
- submitted = createRedisStore({
34
- config,
35
- entryPoint,
36
- storeType: "submitted"
37
- });
38
- logger.info("Using redis for outstanding, processing, submitted mempools");
39
- }
40
- else {
41
- outstanding = createMemoryOutstandingQueue({
42
- config
43
- });
44
- processing = createMemoryStore({
45
- config
46
- });
47
- submitted = createMemoryStore({
48
- config
49
- });
50
- logger.info("Using memory for outstanding, processing, submitted mempools");
51
- }
17
+ const outstanding = createOutstandingQueue({
18
+ config,
19
+ entryPoint,
20
+ logger
21
+ });
22
+ const processing = createProcessingStore({
23
+ config,
24
+ entryPoint
25
+ });
52
26
  storeHandlers.set(entryPoint, {
53
- processing,
54
- submitted,
55
- outstanding
27
+ outstanding,
28
+ processing
56
29
  });
57
30
  }
58
- const logAddOperation = (userOpHash, storeType) => {
59
- logger.debug({ userOpHash, store: storeType }, `added user op to ${storeType} mempool`);
60
- metrics.userOpsInMempool.labels({ status: storeType }).inc();
61
- };
62
31
  const logRemoveOperation = (userOpHash, storeType, removed) => {
63
32
  if (!removed) {
64
33
  logger.warn({ userOpHash, store: storeType }, "tried to remove non-existent user op from mempool");
@@ -74,146 +43,101 @@ export const createMempoolStore = ({ config, metrics }) => {
74
43
  };
75
44
  return {
76
45
  // Methods used for bundling
77
- popOutstanding: async (entryPoint) => {
78
- try {
79
- const { outstanding } = getStoreHandlers(entryPoint);
80
- return await outstanding.pop();
81
- }
82
- catch (err) {
83
- logger.error({ err }, "Failed to pop from outstanding mempool, defaulting to undefined");
84
- sentry.captureException(err);
85
- return undefined;
86
- }
87
- },
88
- peekOutstanding: async (entryPoint) => {
46
+ popOutstanding: async (entryPoint, count) => {
89
47
  try {
90
48
  const { outstanding } = getStoreHandlers(entryPoint);
91
- return await outstanding.peek();
49
+ return await outstanding.pop(count);
92
50
  }
93
51
  catch (err) {
94
- logger.error({ err }, "Failed to peek from outstanding mempool, defaulting to undefined");
52
+ logger.error({ err }, "Failed to pop from outstanding mempool, defaulting to empty array");
95
53
  sentry.captureException(err);
96
- return undefined;
54
+ return [];
97
55
  }
98
56
  },
99
57
  // State handling
100
- addOutstanding: async ({ entryPoint, userOpInfo }) => {
58
+ addOutstanding: async ({ entryPoint, userOpInfos }) => {
101
59
  const { outstanding } = getStoreHandlers(entryPoint);
102
- logAddOperation(userOpInfo.userOpHash, "outstanding");
60
+ metrics.userOpsInMempool
61
+ .labels({ status: "outstanding" })
62
+ .inc(userOpInfos.length);
103
63
  try {
104
- await outstanding.add(userOpInfo);
64
+ await outstanding.add(userOpInfos);
105
65
  }
106
66
  catch (err) {
107
67
  logger.error({ err }, "Failed to add to outstanding mempool");
108
68
  sentry.captureException(err);
109
69
  }
110
70
  },
111
- addProcessing: ({ entryPoint, userOpInfo }) => {
112
- try {
113
- const { processing } = getStoreHandlers(entryPoint);
114
- logAddOperation(userOpInfo.userOpHash, "processing");
115
- processing.add(userOpInfo);
116
- return Promise.resolve();
117
- }
118
- catch (err) {
119
- logger.error({ err }, "Failed to add to processing mempool");
120
- sentry.captureException(err);
121
- return Promise.resolve();
122
- }
123
- },
124
- addSubmitted: ({ entryPoint, userOpInfo }) => {
125
- try {
126
- const { submitted } = getStoreHandlers(entryPoint);
127
- logAddOperation(userOpInfo.userOpHash, "submitted");
128
- submitted.add(userOpInfo);
129
- return Promise.resolve();
130
- }
131
- catch (err) {
132
- logger.error({ err }, "Failed to add to submitted mempool");
133
- sentry.captureException(err);
134
- return Promise.resolve();
135
- }
136
- },
137
71
  removeOutstanding: async ({ entryPoint, userOpHash }) => {
138
72
  try {
139
73
  const { outstanding } = getStoreHandlers(entryPoint);
140
- const removed = await outstanding.remove(userOpHash);
141
- logRemoveOperation(userOpHash, "outstanding", removed);
74
+ const removed = await outstanding.remove([userOpHash]);
75
+ logRemoveOperation(userOpHash, "outstanding", removed.length > 0);
142
76
  }
143
77
  catch (err) {
144
78
  logger.error({ err }, "Failed to remove from outstanding mempool");
145
79
  sentry.captureException(err);
146
- return Promise.resolve();
147
80
  }
148
81
  },
149
- removeProcessing: async ({ entryPoint, userOpHash }) => {
82
+ dumpOutstanding: async (entryPoint) => {
83
+ const { outstanding } = getStoreHandlers(entryPoint);
84
+ logDumpOperation("outstanding");
85
+ return await outstanding.dumpLocal();
86
+ },
87
+ // Methods to mark/unmark userOps that are being processed.
88
+ addProcessing: async ({ entryPoint, userOpInfo }) => {
150
89
  try {
151
90
  const { processing } = getStoreHandlers(entryPoint);
152
- const removed = await processing.remove(userOpHash);
153
- logRemoveOperation(userOpHash, "processing", removed);
91
+ await processing.addProcessing(userOpInfo);
154
92
  }
155
93
  catch (err) {
156
- logger.error({ err }, "Failed to remove from processing mempool");
94
+ logger.error({ err }, "Failed to track active userOp");
157
95
  sentry.captureException(err);
158
- return Promise.resolve();
159
96
  }
160
97
  },
161
- removeSubmitted: async ({ entryPoint, userOpHash }) => {
98
+ removeProcessing: async ({ entryPoint, userOpInfo }) => {
162
99
  try {
163
- const { submitted } = getStoreHandlers(entryPoint);
164
- const removed = await submitted.remove(userOpHash);
165
- logRemoveOperation(userOpHash, "submitted", removed);
100
+ const { processing } = getStoreHandlers(entryPoint);
101
+ await processing.removeProcessing(userOpInfo);
166
102
  }
167
103
  catch (err) {
168
- logger.error({ err }, "Failed to remove from submitted mempool");
104
+ logger.error({ err }, "Failed to untrack active userOp");
169
105
  sentry.captureException(err);
170
- return Promise.resolve();
171
106
  }
172
107
  },
173
- dumpOutstanding: async (entryPoint) => {
174
- const { outstanding } = getStoreHandlers(entryPoint);
175
- logDumpOperation("outstanding");
176
- return await outstanding.dumpLocal();
177
- },
178
- dumpProcessing: async (entryPoint) => {
179
- const { processing } = getStoreHandlers(entryPoint);
180
- logDumpOperation("processing");
181
- return await processing.dumpLocal();
182
- },
183
- dumpSubmitted: async (entryPoint) => {
184
- const { submitted } = getStoreHandlers(entryPoint);
185
- logDumpOperation("submitted");
186
- return await submitted.dumpLocal();
187
- },
188
- // Check if the userOp is already in the mempool
189
- isInMempool: async ({ userOpHash, entryPoint }) => {
190
- const { outstanding, processing, submitted } = getStoreHandlers(entryPoint);
191
- const [inOutstanding, inProcessing, inSubmitted] = await Promise.all([
108
+ // Check if the userOp is already in the mempool or conflicts with existing userOps.
109
+ checkDuplicatesAndConflicts: async ({ entryPoint, userOp, userOpHash }) => {
110
+ const { outstanding, processing } = getStoreHandlers(entryPoint);
111
+ const [isInOutstanding, isInProcessing, wouldConflict] = await Promise.all([
192
112
  outstanding.contains(userOpHash),
193
- processing.contains(userOpHash),
194
- submitted.contains(userOpHash)
195
- ]);
196
- return inOutstanding || inProcessing || inSubmitted;
197
- },
198
- validateSubmittedOrProcessing: async ({ entryPoint, userOp }) => {
199
- const { submitted, processing } = getStoreHandlers(entryPoint);
200
- const [submittedConflict, processingConflict] = await Promise.all([
201
- submitted.findConflicting(userOp),
202
- processing.findConflicting(userOp)
113
+ processing.isProcessing(userOpHash),
114
+ processing.wouldConflict(userOp)
203
115
  ]);
204
- const conflicting = submittedConflict || processingConflict;
205
- if (conflicting?.reason === "conflicting_nonce") {
116
+ // Check if already known (in outstanding or processing).
117
+ if (isInOutstanding || isInProcessing) {
118
+ return {
119
+ valid: false,
120
+ reason: "Already known"
121
+ };
122
+ }
123
+ if (wouldConflict === "conflicting_nonce") {
206
124
  return {
207
125
  valid: false,
208
126
  reason: "AA25 invalid account nonce: Another UserOperation with same sender and nonce is already being processed"
209
127
  };
210
128
  }
211
- if (conflicting?.reason === "conflicting_deployment") {
129
+ if (wouldConflict === "conflicting_deployment") {
212
130
  return {
213
131
  valid: false,
214
132
  reason: "AA25 invalid account deployment: Another deployment operation for this sender is already being processed"
215
133
  };
216
134
  }
135
+ if (wouldConflict === "conflicting_7702_auth") {
136
+ return {
137
+ valid: false,
138
+ reason: "AA10 sender already constructed: Sender already has an inflight EIP-7702 authorization"
139
+ };
140
+ }
217
141
  return { valid: true };
218
142
  },
219
143
  popConflictingOustanding: async ({ entryPoint, userOp }) => {
@@ -227,21 +151,21 @@ export const createMempoolStore = ({ config, metrics }) => {
227
151
  return undefined;
228
152
  }
229
153
  },
230
- validateSenderLimits: ({ entryPoint, userOp }) => {
154
+ validateSenderLimits: async ({ entryPoint, userOp }) => {
231
155
  const { outstanding } = getStoreHandlers(entryPoint);
232
156
  if (!outstanding.validateParallelLimit(userOp)) {
233
- return Promise.resolve({
157
+ return {
234
158
  valid: false,
235
159
  reason: "AA25 invalid account nonce: Maximum number of parallel user operations for that is allowed for this sender reached"
236
- });
160
+ };
237
161
  }
238
162
  if (!outstanding.validateQueuedLimit(userOp)) {
239
- return Promise.resolve({
163
+ return {
240
164
  valid: false,
241
165
  reason: "AA25 invalid account nonce: Maximum number of queued user operations reached for this sender and nonce key"
242
- });
166
+ };
243
167
  }
244
- return Promise.resolve({ valid: true });
168
+ return { valid: true };
245
169
  },
246
170
  // misc
247
171
  getQueuedOutstandingUserOps: async ({ userOp, entryPoint }) => {