@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
@@ -0,0 +1,229 @@
1
+ import { userOpInfoSchema } from "../../types/index.js";
2
+ import { getNonceKeyAndSequence, isDeployment } from "../../utils/index.js";
3
+ import { Redis } from "ioredis";
4
+ import { toHex } from "viem/utils";
5
+ const serialize = (userOpInfo) => {
6
+ return JSON.stringify(userOpInfo, (_, value) => typeof value === "bigint" ? toHex(value) : value);
7
+ };
8
+ const deserialize = (data) => {
9
+ const parsed = JSON.parse(data);
10
+ return userOpInfoSchema.parse(parsed);
11
+ };
12
+ class RedisOutstandingQueue {
13
+ redis;
14
+ senderNonceKeyPrefix; // sender + nonceKey -> userOpHash
15
+ readyQueue; // Queue of userOpHashes (sorted by composite of userOp.nonceSeq + userOp.maxFeePerGas)
16
+ userOpHashMap; // userOpHash -> boolean
17
+ deploymentHashMap; // sender -> deployment userOpHash
18
+ eip7702AuthHashMap; // sender -> eip7702Auth userOpHash
19
+ senderNonceQueueTtl; // TTL for sender nonce queues in seconds
20
+ constructor({ config, entryPoint, redisEndpoint, logger }) {
21
+ this.redis = new Redis(redisEndpoint, {});
22
+ // Initialize Redis key names
23
+ const redisPrefix = `${config.redisKeyPrefix}:${config.chainId}:${entryPoint}:outstanding`;
24
+ this.readyQueue = `${redisPrefix}:ready-queue`;
25
+ this.senderNonceKeyPrefix = `${redisPrefix}:sender`;
26
+ this.userOpHashMap = `${redisPrefix}:userop-hash`;
27
+ this.deploymentHashMap = `${redisPrefix}:deployment-senders`;
28
+ this.eip7702AuthHashMap = `${redisPrefix}:eip7702-auth-senders`;
29
+ // Calculate TTL for sender nonce queues (10 blocks worth of time)
30
+ this.senderNonceQueueTtl = config.blockTime * 10;
31
+ logger.info({
32
+ readyQueueKey: this.readyQueue
33
+ }, "Using redis for outstanding mempool.");
34
+ }
35
+ // Returns queue index for this sender + nonceKey.
36
+ getSenderNonceQueue(userOp) {
37
+ const [nonceKey] = getNonceKeyAndSequence(userOp.nonce);
38
+ return `${this.senderNonceKeyPrefix}:${userOp.sender}:${nonceKey}`;
39
+ }
40
+ // OutstandingStore methods
41
+ async contains(userOpHash) {
42
+ const exists = await this.redis.hexists(this.userOpHashMap, userOpHash);
43
+ return exists === 1;
44
+ }
45
+ async popConflicting(userOp) {
46
+ const { sender, nonce } = userOp;
47
+ const [nonceSeq] = getNonceKeyAndSequence(nonce);
48
+ const senderNonceQueue = this.getSenderNonceQueue(userOp);
49
+ const isDeploymentOp = isDeployment(userOp);
50
+ const hasEip7702Auth = !!userOp.eip7702Auth;
51
+ // Check all conflicts in a single round trip
52
+ const pipeline = this.redis.pipeline();
53
+ pipeline.zrangebyscore(senderNonceQueue, Number(nonceSeq), Number(nonceSeq));
54
+ pipeline.hget(this.deploymentHashMap, sender);
55
+ pipeline.hget(this.eip7702AuthHashMap, sender);
56
+ const results = await pipeline.exec();
57
+ if (!results)
58
+ return undefined;
59
+ const [nonceResult, deploymentResult, eip7702AuthResult] = results;
60
+ const conflictingNonceHashes = nonceResult?.[1] || [];
61
+ const existingDeploymentHash = deploymentResult?.[1];
62
+ const existingEip7702AuthHash = eip7702AuthResult?.[1];
63
+ // Check for conflicting nonce
64
+ if (conflictingNonceHashes.length > 0) {
65
+ const conflictingHash = conflictingNonceHashes[0];
66
+ const removedUserOps = await this.remove([conflictingHash]);
67
+ if (removedUserOps.length > 0) {
68
+ return {
69
+ conflictReason: "conflicting_nonce",
70
+ userOpInfo: removedUserOps[0]
71
+ };
72
+ }
73
+ }
74
+ // Check for conflicting deployment
75
+ if (isDeploymentOp && existingDeploymentHash) {
76
+ const removedUserOps = await this.remove([existingDeploymentHash]);
77
+ if (removedUserOps.length > 0) {
78
+ return {
79
+ conflictReason: "conflicting_deployment",
80
+ userOpInfo: removedUserOps[0]
81
+ };
82
+ }
83
+ }
84
+ // Check for conflicting EIP-7702 auth
85
+ if (hasEip7702Auth && existingEip7702AuthHash) {
86
+ const removedUserOps = await this.remove([existingEip7702AuthHash]);
87
+ if (removedUserOps.length > 0) {
88
+ return {
89
+ conflictReason: "conflicting_7702_auth",
90
+ userOpInfo: removedUserOps[0]
91
+ };
92
+ }
93
+ }
94
+ return undefined;
95
+ }
96
+ async add(userOpInfos) {
97
+ if (userOpInfos.length === 0)
98
+ return;
99
+ // Use pipeline for atomic operations
100
+ const pipeline = this.redis.pipeline();
101
+ for (const userOpInfo of userOpInfos) {
102
+ const { userOp } = userOpInfo;
103
+ const [, nonceSequence] = getNonceKeyAndSequence(userOp.nonce);
104
+ const userOpHash = userOpInfo.userOpHash;
105
+ // Create composite score: nonceSequence in upper 32 bits, maxFeePerGas in lower 32 bits.
106
+ const score = (nonceSequence << 32n) | (userOp.maxFeePerGas & 0xffffffffn);
107
+ // Serialize userOpInfo for storage.
108
+ const serializedUserOp = serialize(userOpInfo);
109
+ // Add to main ready queue.
110
+ pipeline.zadd(this.readyQueue, Number(score), userOpHash);
111
+ // Add to sender+nonceKey index for fast lookup.
112
+ const senderNonceQueue = this.getSenderNonceQueue(userOp);
113
+ pipeline.zadd(senderNonceQueue, Number(nonceSequence), userOpHash);
114
+ pipeline.expire(senderNonceQueue, this.senderNonceQueueTtl);
115
+ // Add to userOpHash map.
116
+ pipeline.hset(this.userOpHashMap, userOpHash, serializedUserOp);
117
+ // Add sender to deployment hash if this is a deployment.
118
+ if (isDeployment(userOp)) {
119
+ pipeline.hset(this.deploymentHashMap, userOp.sender, userOpHash);
120
+ }
121
+ // Add sender to eip7702Auth hash if this has eip7702Auth.
122
+ if (userOp.eip7702Auth) {
123
+ pipeline.hset(this.eip7702AuthHashMap, userOp.sender, userOpHash);
124
+ }
125
+ }
126
+ await pipeline.exec();
127
+ }
128
+ // Removes userOps given their hashes and returns the userOpInfo objects.
129
+ async remove(userOpHashes) {
130
+ if (userOpHashes.length === 0)
131
+ return [];
132
+ // Get all serialized data in parallel.
133
+ const pipeline = this.redis.pipeline();
134
+ for (const hash of userOpHashes) {
135
+ pipeline.hget(this.userOpHashMap, hash);
136
+ }
137
+ const serializedResults = await pipeline.exec();
138
+ const removedUserOps = [];
139
+ const removalPipeline = this.redis.pipeline();
140
+ // Process each userOp that exists.
141
+ for (let i = 0; i < userOpHashes.length; i++) {
142
+ const serialized = serializedResults?.[i]?.[1];
143
+ if (!serialized)
144
+ continue;
145
+ const userOpHash = userOpHashes[i];
146
+ const userOpInfo = deserialize(serialized);
147
+ const { userOp } = userOpInfo;
148
+ const [, nonceSequence] = getNonceKeyAndSequence(userOp.nonce);
149
+ const senderNonceQueue = this.getSenderNonceQueue(userOp);
150
+ const isDeploymentOp = isDeployment(userOp);
151
+ // Remove from ready queue.
152
+ removalPipeline.zrem(this.readyQueue, userOpHash);
153
+ // Remove from sender nonceKey queue.
154
+ removalPipeline.zremrangebyscore(senderNonceQueue, Number(nonceSequence), Number(nonceSequence));
155
+ // Remove from hash lookup.
156
+ removalPipeline.hdel(this.userOpHashMap, userOpHash);
157
+ // Remove sender from deployment hash if this was a deployment.
158
+ if (isDeploymentOp) {
159
+ removalPipeline.hdel(this.deploymentHashMap, userOp.sender);
160
+ }
161
+ // Remove sender from eip7702Auth hash if this had eip7702Auth.
162
+ if (userOp.eip7702Auth) {
163
+ removalPipeline.hdel(this.eip7702AuthHashMap, userOp.sender);
164
+ }
165
+ removedUserOps.push(userOpInfo);
166
+ }
167
+ // Execute all removals.
168
+ await removalPipeline.exec();
169
+ return removedUserOps;
170
+ }
171
+ async pop(count) {
172
+ // Pop from ready queue
173
+ const results = await this.redis.zpopmax(this.readyQueue, count);
174
+ if (!results || results.length === 0) {
175
+ return [];
176
+ }
177
+ // Extract hashes from results (zpopmax returns [member, score, member, score, ...])
178
+ const userOpHashes = [];
179
+ for (let i = 0; i < results.length; i += 2) {
180
+ userOpHashes.push(results[i]);
181
+ }
182
+ // Remove all userOps in batch
183
+ return await this.remove(userOpHashes);
184
+ }
185
+ async getQueuedUserOps(userOp) {
186
+ const [, nonceSequence] = getNonceKeyAndSequence(userOp.nonce);
187
+ const senderNonceQueue = this.getSenderNonceQueue(userOp);
188
+ // Get all userOpHashes with nonce sequence lower than the input
189
+ // ZRANGEBYSCORE returns elements with scores between min and max
190
+ // We want scores from 0 to (nonceSequence - 1)
191
+ const userOpHashes = await this.redis.zrangebyscore(senderNonceQueue, 0, Number(nonceSequence) - 1);
192
+ if (userOpHashes.length === 0)
193
+ return [];
194
+ // Fetch serialized data for each hash
195
+ const pipeline = this.redis.pipeline();
196
+ for (const hash of userOpHashes) {
197
+ pipeline.hget(this.userOpHashMap, hash);
198
+ }
199
+ const results = await pipeline.exec();
200
+ // Deserialize and extract userOps
201
+ return (results || [])
202
+ .map((result) => result?.[1])
203
+ .filter((serialized) => serialized !== null)
204
+ .map((serialized) => deserialize(serialized).userOp);
205
+ }
206
+ // These methods aren't implemented
207
+ async dumpLocal() {
208
+ return []; // We can't dump from redis as the latency is too high
209
+ }
210
+ clear() {
211
+ throw new Error("Not implemented: clear");
212
+ }
213
+ // Skip limit checks when using Redis
214
+ validateQueuedLimit() {
215
+ return true;
216
+ }
217
+ validateParallelLimit() {
218
+ return true;
219
+ }
220
+ }
221
+ export const createRedisOutstandingQueue = ({ config, entryPoint, redisEndpoint, logger }) => {
222
+ return new RedisOutstandingQueue({
223
+ config,
224
+ entryPoint,
225
+ redisEndpoint,
226
+ logger
227
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;KACT,CAAC,CAAA;AACN,CAAC,CAAA"}
@@ -0,0 +1,19 @@
1
+ import type { HexData32, UserOpInfo, UserOperation } from "../../types/index.js";
2
+ import type { ConflictType } from "../types.js";
3
+ export type ConflictingOutstandingType = {
4
+ conflictReason: ConflictType;
5
+ userOpInfo: UserOpInfo;
6
+ } | undefined;
7
+ export interface OutstandingStore {
8
+ contains(userOpHash: HexData32): Promise<boolean>;
9
+ pop(count: number): Promise<UserOpInfo[]>;
10
+ popConflicting(userOp: UserOperation): Promise<ConflictingOutstandingType>;
11
+ add(userOpInfos: UserOpInfo[]): Promise<void>;
12
+ remove(userOpHash: HexData32[]): Promise<UserOpInfo[]>;
13
+ getQueuedUserOps(userOp: UserOperation): Promise<UserOperation[]>;
14
+ dumpLocal(): Promise<UserOpInfo[]>;
15
+ clear(): Promise<void>;
16
+ validateQueuedLimit(userOp: UserOperation): boolean;
17
+ validateParallelLimit(userOp: UserOperation): boolean;
18
+ }
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../store/outstanding/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { Address } from "viem";
2
+ import type { AltoConfig } from "../../createConfig.js";
3
+ import { type ProcessingStore } from "../index.js";
4
+ export declare function createProcessingStore({ config, entryPoint }: {
5
+ config: AltoConfig;
6
+ entryPoint: Address;
7
+ }): ProcessingStore;
8
+ export * from "./types.js";
9
+ export * from "./memory.js";
10
+ export * from "./redis.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { InMemoryProcessingStore, RedisProcessingStore } from "../index.js";
2
+ // Holds all userOps that have been removed from outstanding pool and are being processed.
3
+ // UserOps are are removed from this store when they have successfully landed onchain or when they are cancelled.
4
+ export function createProcessingStore({ config, entryPoint }) {
5
+ if (config.enableHorizontalScaling && config.redisEndpoint) {
6
+ return new RedisProcessingStore({
7
+ config,
8
+ entryPoint,
9
+ redisEndpoint: config.redisEndpoint
10
+ });
11
+ }
12
+ return new InMemoryProcessingStore();
13
+ }
14
+ export * from "./types.js";
15
+ export * from "./memory.js";
16
+ export * from "./redis.js";
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../store/processing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,uBAAuB,EAEvB,oBAAoB,EACvB,MAAM,aAAa,CAAA;AAEpB,0FAA0F;AAC1F,iHAAiH;AACjH,MAAM,UAAU,qBAAqB,CAAC,EAClC,MAAM,EACN,UAAU,EAIb;IACG,IAAI,MAAM,CAAC,uBAAuB,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;QACzD,OAAO,IAAI,oBAAoB,CAAC;YAC5B,MAAM;YACN,UAAU;YACV,aAAa,EAAE,MAAM,CAAC,aAAa;SACtC,CAAC,CAAA;IACN,CAAC;IACD,OAAO,IAAI,uBAAuB,EAAE,CAAA;AACxC,CAAC;AAED,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { UserOpInfo, UserOperation } from "../../types/index.js";
2
+ import type { Hex } from "viem";
3
+ import type { ConflictType } from "../types.js";
4
+ import type { ProcessingStore } from "./types.js";
5
+ export declare class InMemoryProcessingStore implements ProcessingStore {
6
+ private readonly processingUserOpsSet;
7
+ private readonly processingSenderNonceSet;
8
+ private readonly processingDeploymentSet;
9
+ private readonly processingEip7702AuthSet;
10
+ private encodeSenderNonceId;
11
+ addProcessing(userOpInfo: UserOpInfo): Promise<void>;
12
+ removeProcessing(userOpInfo: UserOpInfo): Promise<void>;
13
+ isProcessing(userOpHash: Hex): Promise<boolean>;
14
+ wouldConflict(userOp: UserOperation): Promise<ConflictType | undefined>;
15
+ }
16
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1,58 @@
1
+ import { isDeployment } from "../../utils/index.js";
2
+ export class InMemoryProcessingStore {
3
+ // Use Sets for boolean membership tracking (matching Redis store)
4
+ processingUserOpsSet = new Set();
5
+ processingSenderNonceSet = new Set();
6
+ processingDeploymentSet = new Set();
7
+ processingEip7702AuthSet = new Set();
8
+ encodeSenderNonceId(sender, nonce) {
9
+ return `${sender}:${nonce}`;
10
+ }
11
+ async addProcessing(userOpInfo) {
12
+ const { userOpHash, userOp } = userOpInfo;
13
+ const isDeploymentOp = isDeployment(userOp);
14
+ const senderNonceId = this.encodeSenderNonceId(userOp.sender, userOp.nonce);
15
+ // Add to processing sets
16
+ this.processingUserOpsSet.add(userOpHash);
17
+ this.processingSenderNonceSet.add(senderNonceId);
18
+ if (isDeploymentOp) {
19
+ this.processingDeploymentSet.add(userOp.sender);
20
+ }
21
+ if (userOp.eip7702Auth) {
22
+ this.processingEip7702AuthSet.add(userOp.sender);
23
+ }
24
+ }
25
+ async removeProcessing(userOpInfo) {
26
+ const { userOpHash, userOp } = userOpInfo;
27
+ const senderNonceId = this.encodeSenderNonceId(userOp.sender, userOp.nonce);
28
+ // Remove from all sets
29
+ this.processingUserOpsSet.delete(userOpHash);
30
+ this.processingSenderNonceSet.delete(senderNonceId);
31
+ this.processingDeploymentSet.delete(userOp.sender);
32
+ if (userOp.eip7702Auth) {
33
+ this.processingEip7702AuthSet.delete(userOp.sender);
34
+ }
35
+ }
36
+ async isProcessing(userOpHash) {
37
+ return this.processingUserOpsSet.has(userOpHash);
38
+ }
39
+ async wouldConflict(userOp) {
40
+ const isDeploymentOp = isDeployment(userOp);
41
+ const senderNonceId = this.encodeSenderNonceId(userOp.sender, userOp.nonce);
42
+ // Check deployment conflict first
43
+ if (isDeploymentOp && this.processingDeploymentSet.has(userOp.sender)) {
44
+ return "conflicting_deployment";
45
+ }
46
+ // Check EIP-7702 auth conflict
47
+ if (userOp.eip7702Auth &&
48
+ this.processingEip7702AuthSet.has(userOp.sender)) {
49
+ return "conflicting_7702_auth";
50
+ }
51
+ // Check nonce conflict
52
+ if (this.processingSenderNonceSet.has(senderNonceId)) {
53
+ return "conflicting_nonce";
54
+ }
55
+ return undefined;
56
+ }
57
+ }
58
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../store/processing/memory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAK1C,MAAM,OAAO,uBAAuB;IAChC,kEAAkE;IACjD,oBAAoB,GAAG,IAAI,GAAG,EAAO,CAAA;IACrC,wBAAwB,GAAG,IAAI,GAAG,EAAU,CAAA;IAC5C,uBAAuB,GAAG,IAAI,GAAG,EAAW,CAAA;IAC5C,wBAAwB,GAAG,IAAI,GAAG,EAAW,CAAA;IAEtD,mBAAmB,CAAC,MAAe,EAAE,KAAa;QACtD,OAAO,GAAG,MAAM,IAAI,KAAK,EAAE,CAAA;IAC/B,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,UAAsB;QACtC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;QACzC,MAAM,cAAc,GAAG,YAAY,CAAC,MAAM,CAAC,CAAA;QAC3C,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAC1C,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,KAAK,CACf,CAAA;QAED,yBAAyB;QACzB,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;QACzC,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;QAEhD,IAAI,cAAc,EAAE,CAAC;YACjB,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACnD,CAAC;QAED,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,MAAM,CAAC,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QACvB,IAAI,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;YACnD,OAAO,mBAAmB,CAAA;QAC9B,CAAC;QAED,OAAO,SAAS,CAAA;IACpB,CAAC;CACJ"}
@@ -0,0 +1,23 @@
1
+ import type { UserOpInfo, UserOperation } from "../../types/index.js";
2
+ import type { Address, Hex } from "viem";
3
+ import type { AltoConfig } from "../../createConfig.js";
4
+ import type { ConflictType } from "../types.js";
5
+ import type { ProcessingStore } from "./types.js";
6
+ export declare class RedisProcessingStore implements ProcessingStore {
7
+ private readonly redis;
8
+ private readonly processingUserOpsSet;
9
+ private readonly processingSenderNonceSet;
10
+ private readonly processingDeploymentSet;
11
+ private readonly processingEip7702AuthSet;
12
+ private encodeSenderNonceId;
13
+ constructor({ config, entryPoint, redisEndpoint }: {
14
+ config: AltoConfig;
15
+ entryPoint: Address;
16
+ redisEndpoint: string;
17
+ });
18
+ addProcessing(userOpInfo: UserOpInfo): Promise<void>;
19
+ removeProcessing(userOpInfo: UserOpInfo): Promise<void>;
20
+ isProcessing(userOpHash: Hex): Promise<boolean>;
21
+ wouldConflict(userOp: UserOperation): Promise<ConflictType | undefined>;
22
+ }
23
+ //# sourceMappingURL=redis.d.ts.map
@@ -0,0 +1,85 @@
1
+ import { isDeployment } from "../../utils/index.js";
2
+ import { Redis } from "ioredis";
3
+ export class RedisProcessingStore {
4
+ redis;
5
+ processingUserOpsSet; // set of userOpHashes being processed
6
+ processingSenderNonceSet; // set of "sender:nonce" being processed
7
+ processingDeploymentSet; // set of senders with deployments being processed
8
+ processingEip7702AuthSet; // set of senders with eip7702Auth being processed
9
+ encodeSenderNonceId(sender, nonce) {
10
+ return `${sender}:${nonce}`;
11
+ }
12
+ constructor({ config, entryPoint, redisEndpoint }) {
13
+ this.redis = new Redis(redisEndpoint);
14
+ const redisPrefix = `${config.redisKeyPrefix}:${config.chainId}:${entryPoint}:processing`;
15
+ this.processingUserOpsSet = `${redisPrefix}:userOps`;
16
+ this.processingSenderNonceSet = `${redisPrefix}:senderNonce`;
17
+ this.processingDeploymentSet = `${redisPrefix}:deployment`;
18
+ this.processingEip7702AuthSet = `${redisPrefix}:eip7702Auth`;
19
+ }
20
+ async addProcessing(userOpInfo) {
21
+ const { userOpHash, userOp } = userOpInfo;
22
+ const isDeploymentOp = isDeployment(userOp);
23
+ const senderNonceId = this.encodeSenderNonceId(userOp.sender, userOp.nonce);
24
+ // Use MULTI for atomic operation in single round trip
25
+ const multi = this.redis.multi();
26
+ multi.sadd(this.processingUserOpsSet, userOpHash);
27
+ multi.sadd(this.processingSenderNonceSet, senderNonceId);
28
+ if (isDeploymentOp) {
29
+ multi.sadd(this.processingDeploymentSet, userOp.sender);
30
+ }
31
+ if (userOp.eip7702Auth) {
32
+ multi.sadd(this.processingEip7702AuthSet, userOp.sender);
33
+ }
34
+ await multi.exec();
35
+ }
36
+ async removeProcessing(userOpInfo) {
37
+ const { userOpHash, userOp } = userOpInfo;
38
+ const isDeploymentOp = isDeployment(userOp);
39
+ const senderNonceId = this.encodeSenderNonceId(userOp.sender, userOp.nonce);
40
+ // Use MULTI for atomic removal in single round trip
41
+ const multi = this.redis.multi();
42
+ multi.srem(this.processingUserOpsSet, userOpHash);
43
+ multi.srem(this.processingSenderNonceSet, senderNonceId);
44
+ if (isDeploymentOp) {
45
+ multi.srem(this.processingDeploymentSet, userOp.sender);
46
+ }
47
+ if (userOp.eip7702Auth) {
48
+ multi.srem(this.processingEip7702AuthSet, userOp.sender);
49
+ }
50
+ await multi.exec();
51
+ }
52
+ async isProcessing(userOpHash) {
53
+ const isMember = await this.redis.sismember(this.processingUserOpsSet, userOpHash);
54
+ return isMember === 1;
55
+ }
56
+ async wouldConflict(userOp) {
57
+ const senderNonceId = this.encodeSenderNonceId(userOp.sender, userOp.nonce);
58
+ // Use MULTI for atomic read in single round trip
59
+ const multi = this.redis.multi();
60
+ multi.sismember(this.processingDeploymentSet, userOp.sender);
61
+ multi.sismember(this.processingEip7702AuthSet, userOp.sender);
62
+ multi.sismember(this.processingSenderNonceSet, senderNonceId);
63
+ const results = await multi.exec();
64
+ if (!results)
65
+ return undefined;
66
+ const [deploymentResult, eip7702AuthResult, nonceResult] = results;
67
+ const hasDeployment = deploymentResult?.[1] === 1;
68
+ const hasEip7702Auth = eip7702AuthResult?.[1] === 1;
69
+ const hasNonce = nonceResult?.[1] === 1;
70
+ // Check deployment conflict
71
+ if (isDeployment(userOp) && hasDeployment) {
72
+ return "conflicting_deployment";
73
+ }
74
+ // Check EIP-7702 auth conflict
75
+ if (userOp.eip7702Auth && hasEip7702Auth) {
76
+ return "conflicting_7702_auth";
77
+ }
78
+ // Check nonce conflict
79
+ if (hasNonce) {
80
+ return "conflicting_nonce";
81
+ }
82
+ return undefined;
83
+ }
84
+ }
85
+ //# sourceMappingURL=redis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.js","sourceRoot":"","sources":["../../../store/processing/redis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAM/B,MAAM,OAAO,oBAAoB;IACZ,KAAK,CAAO;IAEZ,oBAAoB,CAAQ,CAAC,sCAAsC;IACnE,wBAAwB,CAAQ,CAAC,wCAAwC;IACzE,uBAAuB,CAAQ,CAAC,kDAAkD;IAClF,wBAAwB,CAAQ,CAAC,kDAAkD;IAE5F,mBAAmB,CAAC,MAAe,EAAE,KAAa;QACtD,OAAO,GAAG,MAAM,IAAI,KAAK,EAAE,CAAA;IAC/B,CAAC;IAED,YAAY,EACR,MAAM,EACN,UAAU,EACV,aAAa,EAKhB;QACG,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;QAErC,MAAM,WAAW,GAAG,GAAG,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,OAAO,IAAI,UAAU,aAAa,CAAA;QACzF,IAAI,CAAC,oBAAoB,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AAwB,EAAE,aAAa,CAAC,CAAA;QAE7D,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;QAClC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAA;QAE9B,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAA;QAClE,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACjD,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACnD,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QAEvC,4BAA4B;QAC5B,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;YACxC,OAAO,wBAAwB,CAAA;QACnC,CAAC;QAED,+BAA+B;QAC/B,IAAI,MAAM,CAAC,WAAW,IAAI,cAAc,EAAE,CAAC;YACvC,OAAO,uBAAuB,CAAA;QAClC,CAAC;QAED,uBAAuB;QACvB,IAAI,QAAQ,EAAE,CAAC;YACX,OAAO,mBAAmB,CAAA;QAC9B,CAAC;QAED,OAAO,SAAS,CAAA;IACpB,CAAC;CACJ"}
@@ -0,0 +1,10 @@
1
+ import type { UserOpInfo, UserOperation } from "../../types/index.js";
2
+ import type { Hex } from "viem";
3
+ import type { ConflictType } from "../types.js";
4
+ export interface ProcessingStore {
5
+ addProcessing(userOp: UserOpInfo): Promise<void>;
6
+ removeProcessing(userOp: UserOpInfo): Promise<void>;
7
+ isProcessing(userOpHash: Hex): Promise<boolean>;
8
+ wouldConflict(userOp: UserOperation): Promise<ConflictType | undefined>;
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../store/processing/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ import type { Address } from "abitype";
2
+ import type { HexData32, UserOpInfo, UserOperation } from "../types/schemas.js";
3
+ import type { ConflictingOutstandingType } from "./outstanding/index.js";
4
+ export type ConflictType = "conflicting_nonce" | "conflicting_deployment" | "conflicting_7702_auth";
5
+ export type StoreType = "outstanding" | "processing";
6
+ export type ValidationResult = {
7
+ valid: true;
8
+ } | {
9
+ valid: false;
10
+ reason: string;
11
+ };
12
+ export type EntryPointUserOpInfoParam = {
13
+ entryPoint: Address;
14
+ userOpInfo: UserOpInfo;
15
+ };
16
+ export type EntryPointUserOpInfosParam = {
17
+ entryPoint: Address;
18
+ userOpInfos: UserOpInfo[];
19
+ };
20
+ export type EntryPointUserOpHashParam = {
21
+ entryPoint: Address;
22
+ userOpHash: HexData32;
23
+ };
24
+ export type MempoolStore = {
25
+ popOutstanding: (entryPoint: Address, count: number) => Promise<UserOpInfo[]>;
26
+ addOutstanding: (args: EntryPointUserOpInfosParam) => Promise<void>;
27
+ removeOutstanding: (args: EntryPointUserOpHashParam) => Promise<void>;
28
+ dumpOutstanding: (entryPoint: Address) => Promise<UserOpInfo[]>;
29
+ addProcessing: (args: EntryPointUserOpInfoParam) => Promise<void>;
30
+ removeProcessing: (args: EntryPointUserOpInfoParam) => Promise<void>;
31
+ checkDuplicatesAndConflicts: (args: {
32
+ entryPoint: Address;
33
+ userOp: UserOperation;
34
+ userOpHash: HexData32;
35
+ }) => Promise<ValidationResult>;
36
+ popConflictingOustanding: (args: {
37
+ entryPoint: Address;
38
+ userOp: UserOperation;
39
+ }) => Promise<ConflictingOutstandingType>;
40
+ validateSenderLimits: (args: {
41
+ entryPoint: Address;
42
+ userOp: UserOperation;
43
+ }) => Promise<ValidationResult>;
44
+ getQueuedOutstandingUserOps: (args: {
45
+ userOp: UserOperation;
46
+ entryPoint: Address;
47
+ }) => Promise<UserOperation[]>;
48
+ clearOutstanding: (entryPoint: Address) => Promise<void>;
49
+ };
50
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../store/types.ts"],"names":[],"mappings":""}