@pimlico/alto 0.0.19 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/contracts/EIP712.sol/EIP712.json +1 -1
  2. package/contracts/ERC165.sol/ERC165.json +1 -1
  3. package/contracts/ERC20.sol/ERC20.json +1 -1
  4. package/contracts/Eip7702Support.sol/Eip7702Support.json +1 -1
  5. package/contracts/EntryPoint.sol/EntryPoint.json +1 -1
  6. package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -1
  7. package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -1
  8. package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -1
  9. package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
  10. package/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -1
  11. package/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
  12. package/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
  13. package/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
  14. package/contracts/Exec.sol/Exec.json +1 -1
  15. package/contracts/IAccount.sol/IAccount.json +1 -1
  16. package/contracts/IAccountExecute.sol/IAccountExecute.json +1 -1
  17. package/contracts/IAggregator.sol/IAggregator.json +1 -1
  18. package/contracts/IERC165.sol/IERC165.json +1 -1
  19. package/contracts/IERC5267.sol/IERC5267.json +1 -1
  20. package/contracts/IEntryPoint.sol/IEntryPoint.json +1 -1
  21. package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride08.json +1 -0
  22. package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride09.json +1 -0
  23. package/contracts/IEntryPointSimulations.sol/IEntryPointSimulations.json +1 -1
  24. package/contracts/INonceManager.sol/INonceManager.json +1 -1
  25. package/contracts/IPaymaster.sol/IPaymaster.json +1 -1
  26. package/contracts/ISenderCreator.sol/ISenderCreator.json +1 -1
  27. package/contracts/IStakeManager.sol/IStakeManager.json +1 -1
  28. package/contracts/LibBytes.sol/LibBytes.json +1 -1
  29. package/contracts/Math.sol/Math.json +1 -1
  30. package/contracts/MessageHashUtils.sol/MessageHashUtils.json +1 -1
  31. package/contracts/NonceManager.sol/NonceManager.json +1 -1
  32. package/contracts/Panic.sol/Panic.json +1 -1
  33. package/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
  34. package/contracts/ReentrancyGuard.sol/ReentrancyGuard.json +1 -1
  35. package/contracts/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.json +1 -1
  36. package/contracts/SafeCast.sol/SafeCast.json +1 -1
  37. package/contracts/SenderCreator.sol/SenderCreator.json +1 -1
  38. package/contracts/ShortStrings.sol/ShortStrings.json +1 -1
  39. package/contracts/SignedMath.sol/SignedMath.json +1 -1
  40. package/contracts/SimulationOverrideHelper.sol/SimulationOverrideHelper.json +1 -0
  41. package/contracts/StakeManager.sol/StakeManager.json +1 -1
  42. package/contracts/StorageSlot.sol/StorageSlot.json +1 -1
  43. package/contracts/Strings.sol/Strings.json +1 -1
  44. package/contracts/TransientSlot.sol/TransientSlot.json +1 -1
  45. package/contracts/UserOperation.sol/UserOperationLib.json +1 -1
  46. package/contracts/UserOperationLib.sol/UserOperationLib.json +1 -1
  47. package/contracts/account-abstraction-v9/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -0
  48. package/contracts/account-abstraction-v9/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -0
  49. package/contracts/account-abstraction-v9/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -0
  50. package/contracts/account-abstraction-v9/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -0
  51. package/contracts/build-info/{880955d5786bfdae.json → 031b289b93191224.json} +1 -1
  52. package/contracts/build-info/181f3522c3744403.json +1 -0
  53. package/contracts/build-info/a2db592afab5c9de.json +1 -0
  54. package/contracts/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -1
  55. package/contracts/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -1
  56. package/contracts/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -1
  57. package/contracts/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -1
  58. package/contracts/core/Eip7702Support.sol/Eip7702Support.json +1 -0
  59. package/contracts/core/NonceManager.sol/NonceManager.json +1 -0
  60. package/contracts/core/SenderCreator.sol/SenderCreator.json +1 -0
  61. package/contracts/core/StakeManager.sol/StakeManager.json +1 -0
  62. package/contracts/core/UserOperationLib.sol/UserOperationLib.json +1 -0
  63. package/contracts/interfaces/IAccount.sol/IAccount.json +1 -0
  64. package/contracts/interfaces/IAccountExecute.sol/IAccountExecute.json +1 -0
  65. package/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -1
  66. package/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -1
  67. package/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -1
  68. package/contracts/interfaces/IPaymaster.sol/IPaymaster.json +1 -0
  69. package/contracts/interfaces/ISenderCreator.sol/ISenderCreator.json +1 -0
  70. package/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -1
  71. package/contracts/overrides/Eip7702Support.sol/Eip7702Support.json +1 -0
  72. package/contracts/overrides/NonceManager.sol/NonceManager.json +1 -0
  73. package/contracts/overrides/SenderCreator.sol/SenderCreator.json +1 -0
  74. package/contracts/overrides/StakeManager.sol/StakeManager.json +1 -0
  75. package/contracts/overrides/UserOperationLib.sol/UserOperationLib.json +1 -0
  76. package/contracts/utils/Exec.sol/Exec.json +1 -1
  77. package/contracts/utils/StorageSlot.sol/StorageSlot.json +1 -0
  78. package/contracts/v09/EntryPoint.sol/EntryPoint.json +1 -0
  79. package/esm/cli/alto.js +17 -6
  80. package/esm/cli/alto.js.map +1 -1
  81. package/esm/cli/config/bundler.d.ts +459 -321
  82. package/esm/cli/config/bundler.js +125 -91
  83. package/esm/cli/config/bundler.js.map +1 -1
  84. package/esm/cli/config/options.d.ts +4 -1
  85. package/esm/cli/config/options.js +233 -106
  86. package/esm/cli/config/options.js.map +1 -1
  87. package/esm/cli/customTransport.d.ts +3 -3
  88. package/esm/cli/deploySimulationsContract.d.ts +1 -0
  89. package/esm/cli/deploySimulationsContract.js +41 -5
  90. package/esm/cli/deploySimulationsContract.js.map +1 -1
  91. package/esm/cli/handler.js +76 -80
  92. package/esm/cli/handler.js.map +1 -1
  93. package/esm/cli/multiRpcTransport.d.ts +7 -0
  94. package/esm/cli/multiRpcTransport.js +52 -0
  95. package/esm/cli/multiRpcTransport.js.map +1 -0
  96. package/esm/cli/setupServer.js +92 -70
  97. package/esm/cli/setupServer.js.map +1 -1
  98. package/esm/cli/shutDown.d.ts +20 -0
  99. package/esm/cli/shutDown.js +285 -0
  100. package/esm/cli/shutDown.js.map +1 -0
  101. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -1
  102. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -1
  103. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -1
  104. package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
  105. package/esm/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -1
  106. package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
  107. package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
  108. package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
  109. package/esm/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
  110. package/esm/createConfig.d.ts +9 -2
  111. package/esm/createConfig.js.map +1 -1
  112. package/esm/executor/{userOpMonitor.d.ts → bundleManager.d.ts} +56 -37
  113. package/esm/executor/bundleManager.js +393 -0
  114. package/esm/executor/bundleManager.js.map +1 -0
  115. package/esm/executor/executor.d.ts +4 -3
  116. package/esm/executor/executor.js +47 -23
  117. package/esm/executor/executor.js.map +1 -1
  118. package/esm/executor/executorManager.d.ts +20 -15
  119. package/esm/executor/executorManager.js +248 -67
  120. package/esm/executor/executorManager.js.map +1 -1
  121. package/esm/executor/filterOpsAndEstimateGas.d.ts +17 -2
  122. package/esm/executor/filterOpsAndEstimateGas.js +100 -77
  123. package/esm/executor/filterOpsAndEstimateGas.js.map +1 -1
  124. package/esm/executor/getBundleStatus.d.ts +5 -1
  125. package/esm/executor/getBundleStatus.js.map +1 -1
  126. package/esm/executor/index.d.ts +1 -0
  127. package/esm/executor/index.js +1 -0
  128. package/esm/executor/index.js.map +1 -1
  129. package/esm/executor/senderManager/createMemorySenderManager.js +13 -0
  130. package/esm/executor/senderManager/createMemorySenderManager.js.map +1 -1
  131. package/esm/executor/senderManager/createRedisSenderManager.d.ts +2 -1
  132. package/esm/executor/senderManager/createRedisSenderManager.js +45 -26
  133. package/esm/executor/senderManager/createRedisSenderManager.js.map +1 -1
  134. package/esm/executor/senderManager/flushOnStartUp.js +7 -5
  135. package/esm/executor/senderManager/flushOnStartUp.js.map +1 -1
  136. package/esm/executor/senderManager/index.d.ts +1 -0
  137. package/esm/executor/senderManager/index.js +6 -2
  138. package/esm/executor/senderManager/index.js.map +1 -1
  139. package/esm/executor/senderManager/validateAndRefill.js +268 -85
  140. package/esm/executor/senderManager/validateAndRefill.js.map +1 -1
  141. package/esm/executor/utils.d.ts +8 -3
  142. package/esm/executor/utils.js +59 -27
  143. package/esm/executor/utils.js.map +1 -1
  144. package/esm/handlers/arbitrumGasPriceManager.d.ts +3 -2
  145. package/esm/handlers/arbitrumGasPriceManager.js +6 -2
  146. package/esm/handlers/arbitrumGasPriceManager.js.map +1 -1
  147. package/esm/handlers/citreaManager.d.ts +10 -0
  148. package/esm/handlers/citreaManager.js +17 -0
  149. package/esm/handlers/citreaManager.js.map +1 -0
  150. package/esm/handlers/eventManager.d.ts +9 -9
  151. package/esm/handlers/eventManager.js +59 -60
  152. package/esm/handlers/eventManager.js.map +1 -1
  153. package/esm/handlers/gasPriceManager.d.ts +17 -10
  154. package/esm/handlers/gasPriceManager.js +245 -99
  155. package/esm/handlers/gasPriceManager.js.map +1 -1
  156. package/esm/handlers/mantleGasPriceManager.d.ts +4 -4
  157. package/esm/handlers/mantleGasPriceManager.js +4 -4
  158. package/esm/handlers/mantleGasPriceManager.js.map +1 -1
  159. package/esm/handlers/optimismManager.d.ts +1 -1
  160. package/esm/handlers/optimismManager.js +1 -1
  161. package/esm/handlers/optimismManager.js.map +1 -1
  162. package/esm/mempool/index.d.ts +1 -1
  163. package/esm/mempool/index.js +1 -1
  164. package/esm/mempool/index.js.map +1 -1
  165. package/esm/mempool/mempool.d.ts +61 -22
  166. package/esm/mempool/mempool.js +223 -133
  167. package/esm/mempool/mempool.js.map +1 -1
  168. package/esm/mempool/reputationManager.d.ts +14 -14
  169. package/esm/mempool/reputationManager.js +36 -39
  170. package/esm/mempool/reputationManager.js.map +1 -1
  171. package/esm/mempool/statusManager.d.ts +20 -0
  172. package/esm/mempool/statusManager.js +143 -0
  173. package/esm/mempool/statusManager.js.map +1 -0
  174. package/esm/receiptCache/createMemoryReceiptCache.d.ts +3 -0
  175. package/esm/receiptCache/createMemoryReceiptCache.js +30 -0
  176. package/esm/receiptCache/createMemoryReceiptCache.js.map +1 -0
  177. package/esm/receiptCache/createRedisReceiptCache.d.ts +10 -0
  178. package/esm/receiptCache/createRedisReceiptCache.js +56 -0
  179. package/esm/receiptCache/createRedisReceiptCache.js.map +1 -0
  180. package/esm/receiptCache/index.d.ts +11 -0
  181. package/esm/receiptCache/index.js +21 -0
  182. package/esm/receiptCache/index.js.map +1 -0
  183. package/esm/rpc/createMethodHandler.js.map +1 -1
  184. package/esm/rpc/estimation/gasEstimationHandler.d.ts +2 -4
  185. package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
  186. package/esm/rpc/estimation/gasEstimations06.d.ts +6 -7
  187. package/esm/rpc/estimation/gasEstimations06.js +1 -5
  188. package/esm/rpc/estimation/gasEstimations06.js.map +1 -1
  189. package/esm/rpc/estimation/gasEstimations07.d.ts +13 -41
  190. package/esm/rpc/estimation/gasEstimations07.js +27 -34
  191. package/esm/rpc/estimation/gasEstimations07.js.map +1 -1
  192. package/esm/{utils/preVerificationGasCalulator.d.ts → rpc/estimation/preVerificationGasCalculator.d.ts} +20 -6
  193. package/esm/{utils/preVerificationGasCalulator.js → rpc/estimation/preVerificationGasCalculator.js} +134 -48
  194. package/esm/rpc/estimation/preVerificationGasCalculator.js.map +1 -0
  195. package/esm/rpc/estimation/types.d.ts +4 -2
  196. package/esm/rpc/estimation/utils.d.ts +10 -8
  197. package/esm/rpc/estimation/utils.js +56 -53
  198. package/esm/rpc/estimation/utils.js.map +1 -1
  199. package/esm/rpc/methods/boost_sendUserOperation.d.ts +304 -0
  200. package/esm/rpc/methods/boost_sendUserOperation.js +1 -1
  201. package/esm/rpc/methods/boost_sendUserOperation.js.map +1 -1
  202. package/esm/rpc/methods/debug_bundler_clearReputation.js +1 -1
  203. package/esm/rpc/methods/debug_bundler_clearReputation.js.map +1 -1
  204. package/esm/rpc/methods/debug_bundler_clearState.js +1 -1
  205. package/esm/rpc/methods/debug_bundler_clearState.js.map +1 -1
  206. package/esm/rpc/methods/debug_bundler_dumpMempool.d.ts +338 -0
  207. package/esm/rpc/methods/debug_bundler_dumpReputation.js +1 -1
  208. package/esm/rpc/methods/debug_bundler_dumpReputation.js.map +1 -1
  209. package/esm/rpc/methods/eth_estimateUserOperationGas.d.ts +622 -14
  210. package/esm/rpc/methods/eth_estimateUserOperationGas.js +61 -30
  211. package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
  212. package/esm/rpc/methods/eth_getUserOperationByHash.d.ts +621 -11
  213. package/esm/rpc/methods/eth_getUserOperationByHash.js.map +1 -1
  214. package/esm/rpc/methods/eth_getUserOperationReceipt.d.ts +34 -34
  215. package/esm/rpc/methods/eth_getUserOperationReceipt.js +1 -1
  216. package/esm/rpc/methods/eth_sendUserOperation.d.ts +307 -3
  217. package/esm/rpc/methods/eth_sendUserOperation.js +153 -48
  218. package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
  219. package/esm/rpc/methods/pimlico_getUserOperationStatus.js +1 -1
  220. package/esm/rpc/methods/pimlico_getUserOperationStatus.js.map +1 -1
  221. package/esm/rpc/methods/pimlico_sendUserOperationNow.d.ts +338 -34
  222. package/esm/rpc/methods/pimlico_sendUserOperationNow.js +26 -29
  223. package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -1
  224. package/esm/rpc/methods/pimlico_simulateAssetChange.d.ts +620 -12
  225. package/esm/rpc/methods/pimlico_simulateAssetChange.js +14 -19
  226. package/esm/rpc/methods/pimlico_simulateAssetChange.js.map +1 -1
  227. package/esm/rpc/rpcHandler.d.ts +38 -26
  228. package/esm/rpc/rpcHandler.js +97 -44
  229. package/esm/rpc/rpcHandler.js.map +1 -1
  230. package/esm/rpc/server.d.ts +5 -5
  231. package/esm/rpc/server.js +15 -11
  232. package/esm/rpc/server.js.map +1 -1
  233. package/esm/rpc/validation/BundlerCollectorTracerV06.js +1 -1
  234. package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +1 -1
  235. package/esm/rpc/validation/BundlerCollectorTracerV07.js +1 -1
  236. package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +1 -1
  237. package/esm/rpc/validation/SafeValidator.d.ts +13 -14
  238. package/esm/rpc/validation/SafeValidator.js +24 -24
  239. package/esm/rpc/validation/SafeValidator.js.map +1 -1
  240. package/esm/rpc/validation/TracerResultParserV06.d.ts +2 -2
  241. package/esm/rpc/validation/TracerResultParserV06.js +11 -11
  242. package/esm/rpc/validation/TracerResultParserV06.js.map +1 -1
  243. package/esm/rpc/validation/TracerResultParserV07.d.ts +2 -2
  244. package/esm/rpc/validation/TracerResultParserV07.js +13 -13
  245. package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
  246. package/esm/rpc/validation/UnsafeValidator.d.ts +18 -14
  247. package/esm/rpc/validation/UnsafeValidator.js +76 -41
  248. package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
  249. package/esm/store/createMempoolStore.d.ts +1 -1
  250. package/esm/store/createMempoolStore.js +79 -140
  251. package/esm/store/createMempoolStore.js.map +1 -1
  252. package/esm/store/index.d.ts +4 -75
  253. package/esm/store/index.js +4 -1
  254. package/esm/store/index.js.map +1 -1
  255. package/esm/store/outstanding/index.d.ts +13 -0
  256. package/esm/store/outstanding/index.js +16 -0
  257. package/esm/store/outstanding/index.js.map +1 -0
  258. package/esm/store/{createMemoryOutstandingStore.d.ts → outstanding/memory.d.ts} +14 -13
  259. package/esm/store/outstanding/memory.js +263 -0
  260. package/esm/store/outstanding/memory.js.map +1 -0
  261. package/esm/store/outstanding/redis.d.ts +11 -0
  262. package/esm/store/outstanding/redis.js +229 -0
  263. package/esm/store/outstanding/redis.js.map +1 -0
  264. package/esm/store/outstanding/types.d.ts +19 -0
  265. package/esm/store/outstanding/types.js +2 -0
  266. package/esm/store/outstanding/types.js.map +1 -0
  267. package/esm/store/processing/index.d.ts +11 -0
  268. package/esm/store/processing/index.js +17 -0
  269. package/esm/store/processing/index.js.map +1 -0
  270. package/esm/store/processing/memory.d.ts +19 -0
  271. package/esm/store/processing/memory.js +83 -0
  272. package/esm/store/processing/memory.js.map +1 -0
  273. package/esm/store/processing/redis.d.ts +26 -0
  274. package/esm/store/processing/redis.js +123 -0
  275. package/esm/store/processing/redis.js.map +1 -0
  276. package/esm/store/processing/types.d.ts +12 -0
  277. package/esm/store/processing/types.js +2 -0
  278. package/esm/store/processing/types.js.map +1 -0
  279. package/esm/store/types.d.ts +52 -0
  280. package/esm/store/types.js +2 -0
  281. package/esm/store/types.js.map +1 -0
  282. package/esm/types/contracts/Multicall3.d.ts +34 -0
  283. package/esm/types/contracts/Multicall3.js +31 -0
  284. package/esm/types/contracts/Multicall3.js.map +1 -0
  285. package/esm/types/contracts/PimlicoSimulations.d.ts +81 -0
  286. package/esm/types/contracts/PimlicoSimulations.js +105 -0
  287. package/esm/types/contracts/PimlicoSimulations.js.map +1 -1
  288. package/esm/types/contracts/index.d.ts +1 -1
  289. package/esm/types/contracts/index.js +1 -1
  290. package/esm/types/contracts/index.js.map +1 -1
  291. package/esm/types/gasPrice.js +0 -18
  292. package/esm/types/gasPrice.js.map +1 -1
  293. package/esm/types/interfaces.d.ts +15 -10
  294. package/esm/types/mempool.d.ts +3 -0
  295. package/esm/types/schemas.d.ts +13184 -4741
  296. package/esm/types/schemas.js +116 -27
  297. package/esm/types/schemas.js.map +1 -1
  298. package/esm/types/utils.d.ts +2 -5
  299. package/esm/types/utils.js +16 -18
  300. package/esm/types/utils.js.map +1 -1
  301. package/esm/types/validation.d.ts +7646 -6912
  302. package/esm/types/validation.js +122 -152
  303. package/esm/types/validation.js.map +1 -1
  304. package/esm/utils/eip7702.d.ts +2 -1
  305. package/esm/utils/eip7702.js +14 -8
  306. package/esm/utils/eip7702.js.map +1 -1
  307. package/esm/utils/entryPointOverrides.js +18 -4
  308. package/esm/utils/entryPointOverrides.js.map +1 -1
  309. package/esm/utils/helpers.d.ts +7 -1
  310. package/esm/utils/helpers.js +36 -11
  311. package/esm/utils/helpers.js.map +1 -1
  312. package/esm/utils/index.d.ts +0 -1
  313. package/esm/utils/index.js +0 -1
  314. package/esm/utils/index.js.map +1 -1
  315. package/esm/utils/metrics.d.ts +4 -1
  316. package/esm/utils/metrics.js +34 -7
  317. package/esm/utils/metrics.js.map +1 -1
  318. package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js +8 -9
  319. package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js.map +1 -1
  320. package/esm/utils/minMaxQueue/createRedisMinMaxQueue.d.ts +24 -2
  321. package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js +85 -64
  322. package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js.map +1 -1
  323. package/esm/utils/minMaxQueue/index.d.ts +2 -2
  324. package/esm/utils/minMaxQueue/index.js +4 -3
  325. package/esm/utils/minMaxQueue/index.js.map +1 -1
  326. package/esm/utils/rpc-reply.d.ts +3 -3
  327. package/esm/utils/rpc-reply.js.map +1 -1
  328. package/esm/utils/toViemStateOverrides.js +7 -7
  329. package/esm/utils/toViemStateOverrides.js.map +1 -1
  330. package/esm/utils/userop.d.ts +110 -56
  331. package/esm/utils/userop.js +161 -249
  332. package/esm/utils/userop.js.map +1 -1
  333. package/package.json +4 -2
  334. package/contracts/build-info/7710b5a048396e70.json +0 -1
  335. package/esm/executor/userOpMonitor.js +0 -326
  336. package/esm/executor/userOpMonitor.js.map +0 -1
  337. package/esm/executor/utilityWalletMonitor.d.ts +0 -19
  338. package/esm/executor/utilityWalletMonitor.js +0 -38
  339. package/esm/executor/utilityWalletMonitor.js.map +0 -1
  340. package/esm/mempool/monitoring.d.ts +0 -15
  341. package/esm/mempool/monitoring.js +0 -118
  342. package/esm/mempool/monitoring.js.map +0 -1
  343. package/esm/store/createMemoryOutstandingStore.js +0 -240
  344. package/esm/store/createMemoryOutstandingStore.js.map +0 -1
  345. package/esm/store/createRedisOutstandingStore.d.ts +0 -27
  346. package/esm/store/createRedisOutstandingStore.js +0 -344
  347. package/esm/store/createRedisOutstandingStore.js.map +0 -1
  348. package/esm/store/createRedisStore.d.ts +0 -9
  349. package/esm/store/createRedisStore.js +0 -131
  350. package/esm/store/createRedisStore.js.map +0 -1
  351. package/esm/store/createStore.d.ts +0 -6
  352. package/esm/store/createStore.js +0 -66
  353. package/esm/store/createStore.js.map +0 -1
  354. package/esm/types/contracts/CallEngine.d.ts +0 -28
  355. package/esm/types/contracts/CallEngine.js +0 -37
  356. package/esm/types/contracts/CallEngine.js.map +0 -1
  357. package/esm/utils/preVerificationGasCalulator.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { ExecutionErrors, RpcError, ValidationErrors, pimlicoSimulateAssetChangeSchema, pimlicoSimulationsAbi } from "../../types/index.js";
1
+ import { ERC7769Errors, RpcError, pimlicoSimulateAssetChangeSchema, pimlicoSimulationsAbi } from "../../types/index.js";
2
2
  import { isVersion06, isVersion07, isVersion08, toPackedUserOp } from "../../utils/index.js";
3
3
  import { getContract } from "viem";
4
4
  import { getFilterOpsStateOverride } from "../../utils/entryPointOverrides.js";
@@ -18,7 +18,7 @@ export const pimlicoSimulateAssetChangeHandler = createMethodHandler({
18
18
  // Check if pimlico simulation contract is configured
19
19
  if (!rpcHandler.config.pimlicoSimulationContract) {
20
20
  logger.warn("pimlicoSimulation must be provided");
21
- throw new RpcError("pimlicoSimulation must be provided", ValidationErrors.InvalidFields);
21
+ throw new RpcError("pimlicoSimulation must be provided", ERC7769Errors.InvalidFields);
22
22
  }
23
23
  const is07 = isVersion07(userOp);
24
24
  const is08 = isVersion08(userOp, entryPoint);
@@ -27,31 +27,20 @@ export const pimlicoSimulateAssetChangeHandler = createMethodHandler({
27
27
  address: rpcHandler.config.pimlicoSimulationContract,
28
28
  client: rpcHandler.config.publicClient
29
29
  });
30
- let epSimulationsAddress;
31
- if (is08) {
32
- epSimulationsAddress =
33
- rpcHandler.config.entrypointSimulationContractV8;
34
- }
35
- else if (is07) {
36
- epSimulationsAddress =
37
- rpcHandler.config.entrypointSimulationContractV7;
38
- }
39
30
  // Prepare state override based on version
40
31
  let stateOverride;
41
32
  if (isVersion06(userOp) && rpcHandler.config.codeOverrideSupport) {
42
33
  stateOverride = getFilterOpsStateOverride({
43
34
  version: "0.6",
44
35
  entryPoint,
45
- baseFeePerGas: await rpcHandler.gasPriceManager
46
- .getBaseFee()
47
- .catch(() => 0n)
36
+ baseFeePerGas: await rpcHandler.gasPriceManager.getBaseFee()
48
37
  });
49
38
  }
50
39
  else if (is07 || is08) {
51
40
  stateOverride = await prepareSimulationOverrides07({
52
41
  userOp: userOp,
53
42
  queuedUserOps: [],
54
- epSimulationsAddress: epSimulationsAddress,
43
+ entryPoint,
55
44
  gasPriceManager: rpcHandler.gasPriceManager,
56
45
  userStateOverrides: stateOverrides,
57
46
  config: rpcHandler.config
@@ -60,11 +49,14 @@ export const pimlicoSimulateAssetChangeHandler = createMethodHandler({
60
49
  try {
61
50
  let result;
62
51
  if (is08) {
52
+ if (!rpcHandler.config.entrypointSimulationContractV8) {
53
+ throw new RpcError("missing entrypointSimulationContractV8", ERC7769Errors.InvalidFields);
54
+ }
63
55
  // For EntryPoint v0.8
64
56
  const { result: simResult } = await pimlicoSimulation.simulate.simulateAssetChange08([
65
57
  toPackedUserOp(userOp),
66
58
  entryPoint,
67
- epSimulationsAddress,
59
+ rpcHandler.config.entrypointSimulationContractV8,
68
60
  addresses,
69
61
  tokens
70
62
  ], {
@@ -73,11 +65,14 @@ export const pimlicoSimulateAssetChangeHandler = createMethodHandler({
73
65
  result = [...simResult];
74
66
  }
75
67
  else if (is07) {
68
+ if (!rpcHandler.config.entrypointSimulationContractV7) {
69
+ throw new RpcError("missing entrypointSimulationContractV7", ERC7769Errors.InvalidFields);
70
+ }
76
71
  // For EntryPoint v0.7
77
72
  const { result: simResult } = await pimlicoSimulation.simulate.simulateAssetChange07([
78
73
  toPackedUserOp(userOp),
79
74
  entryPoint,
80
- epSimulationsAddress,
75
+ rpcHandler.config.entrypointSimulationContractV7,
81
76
  addresses,
82
77
  tokens
83
78
  ], {
@@ -108,10 +103,10 @@ export const pimlicoSimulateAssetChangeHandler = createMethodHandler({
108
103
  catch (error) {
109
104
  const decodedError = decodeSimulateHandleOpError(error, logger);
110
105
  if (decodedError.result === "failed") {
111
- throw new RpcError(`UserOperation reverted during simulation with reason: ${decodedError.data}`, ExecutionErrors.UserOperationReverted);
106
+ throw new RpcError(`UserOperation reverted during simulation with reason: ${decodedError.data}`, ERC7769Errors.UserOperationReverted);
112
107
  }
113
108
  logger.warn("Failed to decode simulation error");
114
- throw new RpcError("Failed to decode simulation error", ValidationErrors.InvalidFields);
109
+ throw new RpcError("Failed to decode simulation error", ERC7769Errors.InvalidFields);
115
110
  }
116
111
  }
117
112
  });
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico_simulateAssetChange.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_simulateAssetChange.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,QAAQ,EAIR,gBAAgB,EAChB,gCAAgC,EAChC,qBAAqB,EACxB,MAAM,aAAa,CAAA;AACpB,OAAO,EACH,WAAW,EACX,WAAW,EACX,WAAW,EACX,cAAc,EACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAoC,WAAW,EAAE,MAAM,MAAM,CAAA;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EACH,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EACnB,MAAM,qBAAqB,CAAA;AAE5B,MAAM,CAAC,MAAM,iCAAiC,GAAG,mBAAmB,CAAC;IACjE,MAAM,EAAE,6BAA6B;IACrC,MAAM,EAAE,gCAAgC;IACxC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QACtC,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,CAAC,GAAG,MAAM,CAAA;QACnE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,cAAc,CAAA;QAE5C,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC;YACnC,UAAU;YACV,SAAS;YACT,MAAM;SACT,CAAC,CAAA;QAEF,qDAAqD;QACrD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,yBAAyB,EAAE,CAAC;YAC/C,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAA;YACjD,MAAM,IAAI,QAAQ,CACd,oCAAoC,EACpC,gBAAgB,CAAC,aAAa,CACjC,CAAA;QACL,CAAC;QAED,MAAM,IAAI,GAAG,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AM,CAAC,CAAA;YAE/D,IAAI,YAAY,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACnC,MAAM,IAAI,QAAQ,CACd,yDAAyD,YAAY,CAAC,IAAI,EAAE,EAC5E,eAAe,CAAC,qBAAqB,CACxC,CAAA;YACL,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAA;YAEhD,MAAM,IAAI,QAAQ,CACd,mCAAmC,EACnC,gBAAgB,CAAC,aAAa,CACjC,CAAA;QACL,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"}
1
+ {"version":3,"file":"pimlico_simulateAssetChange.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_simulateAssetChange.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,QAAQ,EAIR,gCAAgC,EAChC,qBAAqB,EACxB,MAAM,aAAa,CAAA;AACpB,OAAO,EACH,WAAW,EACX,WAAW,EACX,WAAW,EACX,cAAc,EACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAoC,WAAW,EAAE,MAAM,MAAM,CAAA;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EACH,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EACnB,MAAM,qBAAqB,CAAA;AAE5B,MAAM,CAAC,MAAM,iCAAiC,GAAG,mBAAmB,CAAC;IACjE,MAAM,EAAE,6BAA6B;IACrC,MAAM,EAAE,gCAAgC;IACxC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QACtC,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,CAAC,GAAG,MAAM,CAAA;QACnE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,cAAc,CAAA;QAE5C,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CA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G,CAAC,GAAG,SAAS,CAAC,CAAA;YAC3B,CAAC;YAED,OAAO,MAAM,CAAC,GAAG,CACb,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,EAAE;gBACtD,OAAO;oBACH,OAAO;oBACP,KAAK;oBACL,aAAa;oBACb,YAAY;iBACf,CAAA;YACL,CAAC,CACJ,CAAA;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,YAAY,GAAG,2BAA2B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YAE/D,IAAI,YAAY,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACnC,MAAM,IAAI,QAAQ,CACd,yDAAyD,YAAY,CAAC,IAAI,EAAE,EAC5E,aAAa,CAAC,qBAAqB,CACtC,CAAA;YACL,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAA;YAEhD,MAAM,IAAI,QAAQ,CACd,mCAAmC,EACnC,aAAa,CAAC,aAAa,CAC9B,CAAA;QACL,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"}
@@ -1,36 +1,35 @@
1
1
  import { type Executor, type ExecutorManager } from "../executor/index.js";
2
2
  import type { EventManager, GasPriceManager } from "../handlers/index.js";
3
- import type { InterfaceReputationManager, Mempool, Monitor } from "../mempool/index.js";
4
- import type { ApiVersion, BundlerRequest } from "../types/index.js";
5
- import { type Address, type InterfaceValidator, type UserOperation } from "../types/index.js";
6
- import type { Logger, Metrics } from "../utils/index.js";
3
+ import type { InterfaceReputationManager, Mempool, StatusManager } from "../mempool/index.js";
4
+ import { type Address, type ApiVersion, type BundlerRequest, type InterfaceValidator, type UserOperation } from "../types/index.js";
5
+ import { type Logger, type Metrics } from "../utils/index.js";
7
6
  import type { AltoConfig } from "../createConfig.js";
8
- import type { UserOpMonitor } from "../executor/userOpMonitor.js";
7
+ import type { BundleManager } from "../executor/bundleManager.js";
9
8
  import type { MethodHandler } from "./createMethodHandler.js";
10
9
  export declare class RpcHandler {
11
- config: AltoConfig;
12
- validator: InterfaceValidator;
13
- mempool: Mempool;
14
- executor: Executor;
15
- monitor: Monitor;
16
- executorManager: ExecutorManager;
17
- reputationManager: InterfaceReputationManager;
18
- metrics: Metrics;
19
- eventManager: EventManager;
20
- gasPriceManager: GasPriceManager;
21
- userOpMonitor: UserOpMonitor;
22
- logger: Logger;
23
- private methodHandlers;
24
- private eip7702CodeCache;
25
- constructor({ config, validator, mempool, executor, monitor, executorManager, reputationManager, userOpMonitor, metrics, eventManager, gasPriceManager }: {
10
+ readonly config: AltoConfig;
11
+ readonly validator: InterfaceValidator;
12
+ readonly mempool: Mempool;
13
+ readonly executor: Executor;
14
+ readonly statusManager: StatusManager;
15
+ readonly executorManager: ExecutorManager;
16
+ readonly reputationManager: InterfaceReputationManager;
17
+ readonly metrics: Metrics;
18
+ readonly eventManager: EventManager;
19
+ readonly gasPriceManager: GasPriceManager;
20
+ readonly bundleManager: BundleManager;
21
+ readonly logger: Logger;
22
+ private readonly methodHandlers;
23
+ private readonly eip7702CodeCache;
24
+ constructor({ config, validator, mempool, executor, statusManager, executorManager, reputationManager, bundleManager, metrics, eventManager, gasPriceManager }: {
26
25
  config: AltoConfig;
27
26
  validator: InterfaceValidator;
28
27
  mempool: Mempool;
29
28
  executor: Executor;
30
- monitor: Monitor;
29
+ statusManager: StatusManager;
31
30
  executorManager: ExecutorManager;
32
31
  reputationManager: InterfaceReputationManager;
33
- userOpMonitor: UserOpMonitor;
32
+ bundleManager: BundleManager;
34
33
  metrics: Metrics;
35
34
  eventManager: EventManager;
36
35
  gasPriceManager: GasPriceManager;
@@ -39,14 +38,27 @@ export declare class RpcHandler {
39
38
  handleMethod(request: BundlerRequest, apiVersion: ApiVersion): Promise<any>;
40
39
  ensureEntryPointIsSupported(entryPoint: Address): void;
41
40
  ensureDebugEndpointsAreEnabled(methodName: string): void;
42
- preMempoolChecks(userOp: UserOperation, apiVersion: ApiVersion, boost?: boolean): Promise<[boolean, string]>;
43
- validateEip7702Auth({ userOp, validateSender }: {
41
+ validateUserOpFields({ userOp, entryPoint, isBoosted, isEstimation }: {
44
42
  userOp: UserOperation;
45
- validateSender?: boolean;
43
+ entryPoint: Address;
44
+ isBoosted?: boolean;
45
+ isEstimation?: boolean;
46
+ }): [boolean, string];
47
+ validateUserOpGasPrice({ userOp, apiVersion, isBoosted }: {
48
+ userOp: UserOperation;
49
+ apiVersion: ApiVersion;
50
+ isBoosted?: boolean;
51
+ }): Promise<[boolean, string]>;
52
+ validateEip7702Auth({ userOp, validateSignature }: {
53
+ userOp: UserOperation;
54
+ validateSignature: boolean;
46
55
  }): Promise<[
47
56
  boolean,
48
57
  string
49
58
  ]>;
50
- getNonceSeq(userOp: UserOperation, entryPoint: Address): Promise<bigint>;
59
+ getNonceSeq({ userOp, entryPoint }: {
60
+ userOp: UserOperation;
61
+ entryPoint: Address;
62
+ }): Promise<bigint>;
51
63
  }
52
64
  //# sourceMappingURL=rpcHandler.d.ts.map
@@ -1,37 +1,37 @@
1
1
  import { calculateAA95GasFloor } from "../executor/index.js";
2
- import { EntryPointV06Abi, EntryPointV07Abi, RpcError, ValidationErrors } from "../types/index.js";
3
- import { getNonceKeyAndSequence, isVersion06, isVersion07 } from "../utils/index.js";
2
+ import { ERC7769Errors, EntryPointV06Abi, EntryPointV07Abi, RpcError } from "../types/index.js";
3
+ import { getNonceKeyAndSequence, isVersion06, isVersion07, scaleBigIntByPercent, validatePaymasterSignature } from "../utils/index.js";
4
4
  import { getContract, zeroAddress } from "viem";
5
- import { generatePrivateKey, privateKeyToAddress } from "viem/accounts";
6
5
  import { recoverAuthorizationAddress } from "viem/utils";
6
+ import { getEip7702AuthAddress } from "../utils/eip7702.js";
7
7
  import { registerHandlers } from "./methods/index.js";
8
8
  export class RpcHandler {
9
9
  config;
10
10
  validator;
11
11
  mempool;
12
12
  executor;
13
- monitor;
13
+ statusManager;
14
14
  executorManager;
15
15
  reputationManager;
16
16
  metrics;
17
17
  eventManager;
18
18
  gasPriceManager;
19
- userOpMonitor;
19
+ bundleManager;
20
20
  logger;
21
21
  methodHandlers;
22
22
  eip7702CodeCache;
23
- constructor({ config, validator, mempool, executor, monitor, executorManager, reputationManager, userOpMonitor, metrics, eventManager, gasPriceManager }) {
23
+ constructor({ config, validator, mempool, executor, statusManager, executorManager, reputationManager, bundleManager, metrics, eventManager, gasPriceManager }) {
24
24
  this.config = config;
25
25
  this.validator = validator;
26
26
  this.mempool = mempool;
27
27
  this.executor = executor;
28
- this.monitor = monitor;
28
+ this.statusManager = statusManager;
29
29
  this.executorManager = executorManager;
30
30
  this.reputationManager = reputationManager;
31
31
  this.metrics = metrics;
32
32
  this.eventManager = eventManager;
33
33
  this.gasPriceManager = gasPriceManager;
34
- this.userOpMonitor = userOpMonitor;
34
+ this.bundleManager = bundleManager;
35
35
  this.logger = config.getLogger({ module: "rpc" }, {
36
36
  level: config.rpcLogLevel || config.logLevel
37
37
  });
@@ -45,7 +45,7 @@ export class RpcHandler {
45
45
  async handleMethod(request, apiVersion) {
46
46
  const handler = this.methodHandlers.get(request.method);
47
47
  if (!handler) {
48
- throw new RpcError("Method not supported", ValidationErrors.InvalidFields);
48
+ throw new RpcError("Method not supported", ERC7769Errors.InvalidFields);
49
49
  }
50
50
  return await handler.handler({
51
51
  rpcHandler: this,
@@ -55,7 +55,7 @@ export class RpcHandler {
55
55
  }
56
56
  ensureEntryPointIsSupported(entryPoint) {
57
57
  if (!this.config.entrypoints.includes(entryPoint)) {
58
- throw new RpcError(`EntryPoint ${entryPoint} not supported, supported EntryPoints: ${this.config.entrypoints.join(", ")}`, ValidationErrors.InvalidFields);
58
+ throw new RpcError(`EntryPoint ${entryPoint} not supported, supported EntryPoints: ${this.config.entrypoints.join(", ")}`, ERC7769Errors.InvalidFields);
59
59
  }
60
60
  }
61
61
  ensureDebugEndpointsAreEnabled(methodName) {
@@ -63,7 +63,29 @@ export class RpcHandler {
63
63
  throw new RpcError(`${methodName} is only available in development environment`);
64
64
  }
65
65
  }
66
- async preMempoolChecks(userOp, apiVersion, boost = false) {
66
+ validateUserOpFields({ userOp, entryPoint, isBoosted = false, isEstimation = false }) {
67
+ // Check for 0x7702 factory without eip7702Auth
68
+ if (!userOp.eip7702Auth &&
69
+ isVersion07(userOp) &&
70
+ (userOp.factory === "0x7702" ||
71
+ userOp.factory === "0x7702000000000000000000000000000000000000")) {
72
+ return [
73
+ false,
74
+ "Invalid EIP-7702 userOperation: factory is 0x7702 but eip7702Auth is not provided."
75
+ ];
76
+ }
77
+ // Skip gas/field checks during estimation
78
+ if (isEstimation) {
79
+ return [true, ""];
80
+ }
81
+ // Validate paymaster signature for EntryPoint 0.9
82
+ const paymasterSignatureError = validatePaymasterSignature({
83
+ userOp,
84
+ entryPoint
85
+ });
86
+ if (paymasterSignatureError) {
87
+ return [false, paymasterSignatureError];
88
+ }
67
89
  if (this.config.legacyTransactions &&
68
90
  userOp.maxFeePerGas !== userOp.maxPriorityFeePerGas) {
69
91
  return [
@@ -71,27 +93,10 @@ export class RpcHandler {
71
93
  "maxPriorityFeePerGas must equal maxFeePerGas on chains that don't support EIP-1559"
72
94
  ];
73
95
  }
74
- if (apiVersion !== "v1" && !this.config.safeMode && !boost) {
75
- const { lowestMaxFeePerGas, lowestMaxPriorityFeePerGas } = await this.gasPriceManager.getLowestValidGasPrices();
76
- const maxFeePerGas = userOp.maxFeePerGas;
77
- const maxPriorityFeePerGas = userOp.maxPriorityFeePerGas;
78
- if (maxFeePerGas < lowestMaxFeePerGas) {
79
- return [
80
- false,
81
- `maxFeePerGas must be at least ${lowestMaxFeePerGas} (current maxFeePerGas: ${maxFeePerGas}) - use pimlico_getUserOperationGasPrice to get the current gas price`
82
- ];
83
- }
84
- if (maxPriorityFeePerGas < lowestMaxPriorityFeePerGas) {
85
- return [
86
- false,
87
- `maxPriorityFeePerGas must be at least ${lowestMaxPriorityFeePerGas} (current maxPriorityFeePerGas: ${maxPriorityFeePerGas}) - use pimlico_getUserOperationGasPrice to get the current gas price`
88
- ];
89
- }
90
- }
91
96
  if (userOp.verificationGasLimit < 10000n) {
92
97
  return [false, "verificationGasLimit must be at least 10000"];
93
98
  }
94
- if (!boost && userOp.preVerificationGas === 0n) {
99
+ if (!isBoosted && userOp.preVerificationGas === 0n) {
95
100
  return [
96
101
  false,
97
102
  "userOperation preVerification gas must be larger than 0"
@@ -103,32 +108,79 @@ export class RpcHandler {
103
108
  "userOperation verification gas limit must be larger than 0"
104
109
  ];
105
110
  }
106
- const gasLimits = calculateAA95GasFloor({
111
+ const gasFloor = calculateAA95GasFloor({
107
112
  userOps: [userOp],
108
- beneficiary: privateKeyToAddress(generatePrivateKey())
113
+ beneficiary: this.config.utilityWalletAddress
109
114
  });
110
- if (gasLimits > this.config.maxGasPerBundle) {
115
+ // The executor scales the bundle's tx.gasLimit by executorGasMultiplier,
116
+ // compare against the scaled value to reject userOps that would
117
+ // produce a transaction that can't fit in a block.
118
+ const txGasLimit = scaleBigIntByPercent(gasFloor, this.config.executorGasMultiplier);
119
+ if (txGasLimit > this.config.maxGasPerUserOp) {
111
120
  return [
112
121
  false,
113
- `User operation gas limits exceed the max gas per bundle: ${gasLimits} > ${this.config.maxGasPerBundle}`
122
+ `User operation gas limits exceed the max gas per userOp: ${txGasLimit} > ${this.config.maxGasPerUserOp}`
114
123
  ];
115
124
  }
116
125
  return [true, ""];
117
126
  }
118
- async validateEip7702Auth({ userOp, validateSender = false }) {
127
+ async validateUserOpGasPrice({ userOp, apiVersion, isBoosted = false }) {
128
+ if (apiVersion === "v1" || this.config.safeMode || isBoosted) {
129
+ return [true, ""];
130
+ }
131
+ const { lowestMaxFeePerGas, lowestMaxPriorityFeePerGas } = await this.gasPriceManager.getLowestValidGasPrices();
132
+ const maxFeePerGas = userOp.maxFeePerGas;
133
+ const maxPriorityFeePerGas = userOp.maxPriorityFeePerGas;
134
+ if (maxFeePerGas < lowestMaxFeePerGas) {
135
+ return [
136
+ false,
137
+ `maxFeePerGas must be at least ${lowestMaxFeePerGas} (current maxFeePerGas: ${maxFeePerGas}) - use pimlico_getUserOperationGasPrice to get the current gas price`
138
+ ];
139
+ }
140
+ if (maxPriorityFeePerGas < lowestMaxPriorityFeePerGas) {
141
+ return [
142
+ false,
143
+ `maxPriorityFeePerGas must be at least ${lowestMaxPriorityFeePerGas} (current maxPriorityFeePerGas: ${maxPriorityFeePerGas}) - use pimlico_getUserOperationGasPrice to get the current gas price`
144
+ ];
145
+ }
146
+ return [true, ""];
147
+ }
148
+ async validateEip7702Auth({ userOp, validateSignature }) {
119
149
  if (!userOp.eip7702Auth) {
120
150
  return [true, ""];
121
151
  }
122
- if (!this.config.codeOverrideSupport) {
123
- return [false, "eip7702Auth is not supported on this chain"];
152
+ if (!this.config.codeOverrideSupport || !this.config.eip7702Support) {
153
+ return [
154
+ false,
155
+ "EIP-7702 user operations are not supported on this chain"
156
+ ];
124
157
  }
125
158
  // Check that auth is valid.
126
- const delegationDesignator = "address" in userOp.eip7702Auth
127
- ? userOp.eip7702Auth.address
128
- : userOp.eip7702Auth.contractAddress;
159
+ const delegationDesignator = getEip7702AuthAddress(userOp.eip7702Auth);
160
+ // Validate ECDSA signature components during submission only
161
+ // (during estimation, users send stub authorizations with dummy r/s)
162
+ if (validateSignature) {
163
+ const SECP256K1_N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n;
164
+ const r = BigInt(userOp.eip7702Auth.r);
165
+ const s = BigInt(userOp.eip7702Auth.s);
166
+ if (r < 1n || r >= SECP256K1_N || s < 1n || s >= SECP256K1_N) {
167
+ return [
168
+ false,
169
+ "Invalid EIP-7702 authorization: Invalid ECDSA signature (r and s must be in [1, secp256k1.n))"
170
+ ];
171
+ }
172
+ // Enforce EIP-2 low-S: signatures with s > secp256k1n/2 are invalid.
173
+ // https://github.com/ethereum/EIPs/blob/bbc3f958/EIPS/eip-7702.md#L111
174
+ if (s > SECP256K1_N / 2n) {
175
+ return [
176
+ false,
177
+ "Invalid EIP-7702 authorization: Invalid ECDSA signature (s must be <= secp256k1.n/2)"
178
+ ];
179
+ }
180
+ }
129
181
  // Fetch onchain data in parallel
130
182
  const [sender, nonceOnChain, delegateCode] = await Promise.all([
131
- validateSender
183
+ validateSignature
132
184
  ? recoverAuthorizationAddress({
133
185
  authorization: {
134
186
  address: delegationDesignator,
@@ -140,12 +192,12 @@ export class RpcHandler {
140
192
  yParity: userOp.eip7702Auth.yParity
141
193
  }
142
194
  })
143
- : Promise.resolve(userOp.sender),
195
+ : userOp.sender,
144
196
  this.config.publicClient.getTransactionCount({
145
197
  address: userOp.sender
146
198
  }),
147
199
  this.eip7702CodeCache.has(delegationDesignator)
148
- ? Promise.resolve("has-code")
200
+ ? "has-code"
149
201
  : this.config.publicClient.getCode({
150
202
  address: delegationDesignator
151
203
  })
@@ -183,10 +235,11 @@ export class RpcHandler {
183
235
  }
184
236
  if (isVersion07(userOp) &&
185
237
  userOp.factory !== "0x7702" &&
238
+ userOp.factory !== "0x7702000000000000000000000000000000000000" &&
186
239
  userOp.factory !== null) {
187
240
  return [
188
241
  false,
189
- "Invalid EIP-7702 authorization: UserOperation cannot contain factory that is neither null or 0x7702."
242
+ "Invalid EIP-7702 authorization: factory must be null or 0x7702."
190
243
  ];
191
244
  }
192
245
  // Check delegation designator
@@ -209,7 +262,7 @@ export class RpcHandler {
209
262
  }
210
263
  return [true, ""];
211
264
  }
212
- async getNonceSeq(userOp, entryPoint) {
265
+ async getNonceSeq({ userOp, entryPoint }) {
213
266
  const entryPointContract = getContract({
214
267
  address: entryPoint,
215
268
  abi: isVersion06(userOp) ? EntryPointV06Abi : EntryPointV07Abi,
@@ -1 +1 @@
1
- {"version":3,"file":"rpcHandler.js","sourceRoot":"","sources":["../../rpc/rpcHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,qBAAqB,EACxB,MAAM,gBAAgB,CAAA;AAQvB,OAAO,EAEH,gBAAgB,EAChB,gBAAgB,EAEhB,QAAQ,EAER,gBAAgB,EACnB,MAAM,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AAC,gBAAgB,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;QAE/D,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;gBACtD,OAAO;oBACH,KAAK;oBACL,4CAA4C,oBAAoB,eAAe;iBAClF,CAAA;YACL,CAAC;YAED,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAA;QACzD,CAAC;QAED,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EACd,MAAM,EACN,UAAU,EACmC;QAC7C,MAAM,kBAAkB,GAAG,WAAW,CAAC;YACnC,OAAO,EAAE,UAAU;YACnB,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB;YAC9D,MAAM,EAAE;gBACJ,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY;aACnC;SACJ,CAAC,CAAA;QAEF,MAAM,CAAC,QAAQ,CAAC,GAAG,sBAAsB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAEvD,MAAM,cAAc,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CACzD,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EACzB;YACI,QAAQ,EAAE,QAAQ;SACrB,CACJ,CAAA;QAED,MAAM,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,sBAAsB,CAAC,cAAc,CAAC,CAAA;QAEnE,OAAO,eAAe,CAAA;IAC1B,CAAC;CACJ"}
@@ -4,11 +4,11 @@ import type { Registry } from "prom-client";
4
4
  import type { AltoConfig } from "../createConfig.js";
5
5
  import type { RpcHandler } from "./rpcHandler.js";
6
6
  export declare class Server {
7
- private config;
8
- private fastify;
9
- private rpcEndpoint;
10
- private registry;
11
- private metrics;
7
+ private readonly config;
8
+ private readonly fastify;
9
+ private readonly rpcEndpoint;
10
+ private readonly registry;
11
+ private readonly metrics;
12
12
  constructor({ config, rpcEndpoint, registry, metrics }: {
13
13
  config: AltoConfig;
14
14
  rpcEndpoint: RpcHandler;
package/esm/rpc/server.js CHANGED
@@ -1,4 +1,5 @@
1
- import { RpcError, ValidationErrors, altoVersions, bundlerRequestSchema, jsonRpcSchema } from "../types/index.js";
1
+ import { ERC7769Errors, RpcError, altoVersions, bundlerRequestSchema, jsonRpcSchema } from "../types/index.js";
2
+ import cors from "@fastify/cors";
2
3
  import websocket from "@fastify/websocket";
3
4
  import * as sentry from "@sentry/node";
4
5
  import Fastify from "fastify";
@@ -49,6 +50,9 @@ export class Server {
49
50
  requestTimeout: config.timeout,
50
51
  disableRequestLogging: true
51
52
  });
53
+ if (config.enableCors) {
54
+ this.fastify.register(cors, { origin: true });
55
+ }
52
56
  this.fastify.register(rpcDecorators);
53
57
  this.fastify.register(websocket, {
54
58
  options: {
@@ -113,14 +117,14 @@ export class Server {
113
117
  try {
114
118
  request.body = JSON.parse(msgBuffer.toString());
115
119
  }
116
- catch (err) {
120
+ catch {
117
121
  socket.send(JSON.stringify({
118
122
  jsonrpc: "2.0",
119
123
  id: null,
120
124
  error: {
121
125
  message: "invalid JSON-RPC request",
122
126
  data: msgBuffer.toString(),
123
- code: ValidationErrors.InvalidFields
127
+ code: ERC7769Errors.InvalidFields
124
128
  }
125
129
  }));
126
130
  return;
@@ -135,24 +139,24 @@ export class Server {
135
139
  const versionParsingResult = altoVersions.safeParse(request.params?.version ?? this.config.defaultApiVersion);
136
140
  if (!versionParsingResult.success) {
137
141
  const error = fromZodError(versionParsingResult.error);
138
- throw new RpcError(`invalid version ${error.message}`, ValidationErrors.InvalidFields);
142
+ throw new RpcError(`invalid version ${error.message}`, ERC7769Errors.InvalidFields);
139
143
  }
140
144
  const apiVersion = versionParsingResult.data;
141
- if (this.config.apiVersion.indexOf(apiVersion) === -1) {
142
- throw new RpcError(`unsupported version ${apiVersion}`, ValidationErrors.InvalidFields);
145
+ if (!this.config.apiVersion.includes(apiVersion)) {
146
+ throw new RpcError(`unsupported version ${apiVersion}`, ERC7769Errors.InvalidFields);
143
147
  }
144
148
  try {
145
149
  const contentTypeHeader = request.headers["content-type"];
146
150
  // Common browser websocket API does not allow setting custom headers
147
151
  if (contentTypeHeader !== "application/json" &&
148
152
  request.ws === false) {
149
- throw new RpcError("invalid content-type, content-type must be application/json", ValidationErrors.InvalidFields);
153
+ throw new RpcError("invalid content-type, content-type must be application/json", ERC7769Errors.InvalidFields);
150
154
  }
151
155
  this.fastify.log.trace({ body: JSON.stringify(request.body) }, "received request");
152
156
  const jsonRpcParsing = jsonRpcSchema.safeParse(request.body);
153
157
  if (!jsonRpcParsing.success) {
154
158
  const validationError = fromZodError(jsonRpcParsing.error);
155
- throw new RpcError(`invalid JSON-RPC request ${validationError.message}`, ValidationErrors.InvalidFields);
159
+ throw new RpcError(`invalid JSON-RPC request ${validationError.message}`, ERC7769Errors.InvalidFields);
156
160
  }
157
161
  const jsonRpcRequest = jsonRpcParsing.data;
158
162
  requestId = jsonRpcRequest.id;
@@ -160,15 +164,15 @@ export class Server {
160
164
  if (!bundlerRequestParsing.success) {
161
165
  const validationError = fromZodError(bundlerRequestParsing.error);
162
166
  if (validationError.message.includes("Missing/invalid userOpHash")) {
163
- throw new RpcError("Missing/invalid userOpHash", ValidationErrors.InvalidFields);
167
+ throw new RpcError("Missing/invalid userOpHash", ERC7769Errors.InvalidFields);
164
168
  }
165
- throw new RpcError(validationError.message, ValidationErrors.InvalidRequest);
169
+ throw new RpcError(validationError.message, ERC7769Errors.InvalidRequest);
166
170
  }
167
171
  const bundlerRequest = bundlerRequestParsing.data;
168
172
  request.rpcMethod = bundlerRequest.method;
169
173
  if (this.config.rpcMethods !== null &&
170
174
  !this.config.rpcMethods.includes(bundlerRequest.method)) {
171
- throw new RpcError(`Method not supported: ${bundlerRequest.method}`, ValidationErrors.InvalidRequest);
175
+ throw new RpcError(`Method not supported: ${bundlerRequest.method}`, ERC7769Errors.InvalidRequest);
172
176
  }
173
177
  this.fastify.log.info({
174
178
  data: JSON.stringify(bundlerRequest, null),