@pimlico/alto 0.0.0-main.20250428T212302 → 0.0.0-main.20250429T114818

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 (384) hide show
  1. package/contracts/EIP712.sol/EIP712.json +1 -0
  2. package/contracts/ERC165.sol/ERC165.json +1 -0
  3. package/contracts/Eip7702Support.sol/Eip7702Support.json +1 -0
  4. package/contracts/EntryPoint.sol/EntryPoint.json +1 -0
  5. package/contracts/EntryPointCodeOverride.sol/EntryPointCodeOverride.json +1 -0
  6. package/contracts/EntryPointSimulations.sol/EntryPointSimulations.json +1 -0
  7. package/contracts/Exec.sol/Exec.json +1 -0
  8. package/contracts/IAccount.sol/IAccount.json +1 -0
  9. package/contracts/IAccountExecute.sol/IAccountExecute.json +1 -0
  10. package/contracts/IAggregator.sol/IAggregator.json +1 -0
  11. package/contracts/IERC165.sol/IERC165.json +1 -0
  12. package/contracts/IERC5267.sol/IERC5267.json +1 -0
  13. package/contracts/IEntryPoint.sol/IEntryPoint.json +1 -0
  14. package/contracts/IEntryPointSimulations.sol/IEntryPointSimulations.json +1 -0
  15. package/contracts/INonceManager.sol/INonceManager.json +1 -0
  16. package/contracts/IPaymaster.sol/IPaymaster.json +1 -0
  17. package/contracts/ISenderCreator.sol/ISenderCreator.json +1 -0
  18. package/contracts/IStakeManager.sol/IStakeManager.json +1 -0
  19. package/contracts/Math.sol/Math.json +1 -0
  20. package/contracts/MessageHashUtils.sol/MessageHashUtils.json +1 -0
  21. package/contracts/NonceManager.sol/NonceManager.json +1 -0
  22. package/contracts/Panic.sol/Panic.json +1 -0
  23. package/contracts/PimlicoEntryPointSimulationsV7.sol/PimlicoEntryPointSimulationsV7.json +1 -0
  24. package/contracts/PimlicoEntryPointSimulationsV8.sol/PimlicoEntryPointSimulationsV8.json +1 -0
  25. package/contracts/ReentrancyGuard.sol/ReentrancyGuard.json +1 -0
  26. package/contracts/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.json +1 -0
  27. package/contracts/SafeCast.sol/SafeCast.json +1 -0
  28. package/contracts/SenderCreator.sol/SenderCreator.json +1 -0
  29. package/contracts/ShortStrings.sol/ShortStrings.json +1 -0
  30. package/contracts/SignedMath.sol/SignedMath.json +1 -0
  31. package/contracts/StakeManager.sol/StakeManager.json +1 -0
  32. package/contracts/StorageSlot.sol/StorageSlot.json +1 -0
  33. package/contracts/Strings.sol/Strings.json +1 -0
  34. package/contracts/TransientSlot.sol/TransientSlot.json +1 -0
  35. package/contracts/UserOperation.sol/UserOperationLib.json +1 -0
  36. package/contracts/UserOperationLib.sol/UserOperationLib.json +1 -0
  37. package/contracts/build-info/0c52dc19c74a9a932ddddcca463ce398.json +1 -0
  38. package/contracts/build-info/a1d9af887789a0ade8ffbc8b045f0780.json +1 -0
  39. package/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -0
  40. package/esm/cli/deploySimulationsContract.js +14 -5
  41. package/esm/cli/deploySimulationsContract.js.map +1 -1
  42. package/package.json +2 -1
  43. package/lib/cli/alto.d.ts +0 -7
  44. package/lib/cli/alto.js +0 -141
  45. package/lib/cli/alto.js.map +0 -1
  46. package/lib/cli/config/bundler.d.ts +0 -2872
  47. package/lib/cli/config/bundler.js +0 -242
  48. package/lib/cli/config/bundler.js.map +0 -1
  49. package/lib/cli/config/index.d.ts +0 -3
  50. package/lib/cli/config/index.js +0 -19
  51. package/lib/cli/config/index.js.map +0 -1
  52. package/lib/cli/config/options.d.ts +0 -13
  53. package/lib/cli/config/options.js +0 -587
  54. package/lib/cli/config/options.js.map +0 -1
  55. package/lib/cli/customTransport.d.ts +0 -14
  56. package/lib/cli/customTransport.js +0 -94
  57. package/lib/cli/customTransport.js.map +0 -1
  58. package/lib/cli/deploySimulationsContract.d.ts +0 -13
  59. package/lib/cli/deploySimulationsContract.js +0 -100
  60. package/lib/cli/deploySimulationsContract.js.map +0 -1
  61. package/lib/cli/handler.d.ts +0 -3
  62. package/lib/cli/handler.js +0 -157
  63. package/lib/cli/handler.js.map +0 -1
  64. package/lib/cli/index.d.ts +0 -4
  65. package/lib/cli/index.js +0 -20
  66. package/lib/cli/index.js.map +0 -1
  67. package/lib/cli/instrumentation.d.ts +0 -2
  68. package/lib/cli/instrumentation.js +0 -47
  69. package/lib/cli/instrumentation.js.map +0 -1
  70. package/lib/cli/parseArgs.d.ts +0 -8
  71. package/lib/cli/parseArgs.js +0 -25
  72. package/lib/cli/parseArgs.js.map +0 -1
  73. package/lib/cli/setupServer.d.ts +0 -13
  74. package/lib/cli/setupServer.js +0 -266
  75. package/lib/cli/setupServer.js.map +0 -1
  76. package/lib/cli/util.d.ts +0 -22
  77. package/lib/cli/util.js +0 -34
  78. package/lib/cli/util.js.map +0 -1
  79. package/lib/createConfig.d.ts +0 -16
  80. package/lib/createConfig.js +0 -13
  81. package/lib/createConfig.js.map +0 -1
  82. package/lib/executor/executor.d.ts +0 -65
  83. package/lib/executor/executor.js +0 -301
  84. package/lib/executor/executor.js.map +0 -1
  85. package/lib/executor/executorManager.d.ts +0 -108
  86. package/lib/executor/executorManager.js +0 -702
  87. package/lib/executor/executorManager.js.map +0 -1
  88. package/lib/executor/fastlane.d.ts +0 -9
  89. package/lib/executor/fastlane.js +0 -41
  90. package/lib/executor/fastlane.js.map +0 -1
  91. package/lib/executor/filterOpsAndEStimateGas.d.ts +0 -29
  92. package/lib/executor/filterOpsAndEStimateGas.js +0 -225
  93. package/lib/executor/filterOpsAndEStimateGas.js.map +0 -1
  94. package/lib/executor/index.d.ts +0 -5
  95. package/lib/executor/index.js +0 -21
  96. package/lib/executor/index.js.map +0 -1
  97. package/lib/executor/senderManager/createMemorySenderManager.d.ts +0 -8
  98. package/lib/executor/senderManager/createMemorySenderManager.js +0 -45
  99. package/lib/executor/senderManager/createMemorySenderManager.js.map +0 -1
  100. package/lib/executor/senderManager/createRedisSenderManager.d.ts +0 -8
  101. package/lib/executor/senderManager/createRedisSenderManager.js +0 -85
  102. package/lib/executor/senderManager/createRedisSenderManager.js.map +0 -1
  103. package/lib/executor/senderManager/flushOnStartUp.d.ts +0 -9
  104. package/lib/executor/senderManager/flushOnStartUp.js +0 -37
  105. package/lib/executor/senderManager/flushOnStartUp.js.map +0 -1
  106. package/lib/executor/senderManager/index.d.ts +0 -15
  107. package/lib/executor/senderManager/index.js +0 -25
  108. package/lib/executor/senderManager/index.js.map +0 -1
  109. package/lib/executor/senderManager/validateAndRefill.d.ts +0 -11
  110. package/lib/executor/senderManager/validateAndRefill.js +0 -115
  111. package/lib/executor/senderManager/validateAndRefill.js.map +0 -1
  112. package/lib/executor/utilityWalletMonitor.d.ts +0 -19
  113. package/lib/executor/utilityWalletMonitor.js +0 -42
  114. package/lib/executor/utilityWalletMonitor.js.map +0 -1
  115. package/lib/executor/utils.d.ts +0 -34
  116. package/lib/executor/utils.js +0 -167
  117. package/lib/executor/utils.js.map +0 -1
  118. package/lib/handlers/arbitrumGasPriceManager.d.ts +0 -14
  119. package/lib/handlers/arbitrumGasPriceManager.js +0 -39
  120. package/lib/handlers/arbitrumGasPriceManager.js.map +0 -1
  121. package/lib/handlers/eventManager.d.ts +0 -29
  122. package/lib/handlers/eventManager.js +0 -225
  123. package/lib/handlers/eventManager.js.map +0 -1
  124. package/lib/handlers/gasPriceManager.d.ts +0 -36
  125. package/lib/handlers/gasPriceManager.js +0 -391
  126. package/lib/handlers/gasPriceManager.js.map +0 -1
  127. package/lib/handlers/index.d.ts +0 -3
  128. package/lib/handlers/index.js +0 -19
  129. package/lib/handlers/index.js.map +0 -1
  130. package/lib/handlers/mantleGasPriceManager.d.ts +0 -23
  131. package/lib/handlers/mantleGasPriceManager.js +0 -44
  132. package/lib/handlers/mantleGasPriceManager.js.map +0 -1
  133. package/lib/handlers/optimismManager.d.ts +0 -10
  134. package/lib/handlers/optimismManager.js +0 -21
  135. package/lib/handlers/optimismManager.js.map +0 -1
  136. package/lib/index.d.ts +0 -2
  137. package/lib/index.js +0 -4
  138. package/lib/index.js.map +0 -1
  139. package/lib/mempool/index.d.ts +0 -4
  140. package/lib/mempool/index.js +0 -20
  141. package/lib/mempool/index.js.map +0 -1
  142. package/lib/mempool/mempool.d.ts +0 -191
  143. package/lib/mempool/mempool.js +0 -499
  144. package/lib/mempool/mempool.js.map +0 -1
  145. package/lib/mempool/monitoring.d.ts +0 -14
  146. package/lib/mempool/monitoring.js +0 -101
  147. package/lib/mempool/monitoring.js.map +0 -1
  148. package/lib/mempool/reputationManager.d.ts +0 -121
  149. package/lib/mempool/reputationManager.js +0 -472
  150. package/lib/mempool/reputationManager.js.map +0 -1
  151. package/lib/rpc/createMethodHandler.d.ts +0 -31
  152. package/lib/rpc/createMethodHandler.js +0 -34
  153. package/lib/rpc/createMethodHandler.js.map +0 -1
  154. package/lib/rpc/estimation/gasEstimationHandler.d.ts +0 -30
  155. package/lib/rpc/estimation/gasEstimationHandler.js +0 -50
  156. package/lib/rpc/estimation/gasEstimationHandler.js.map +0 -1
  157. package/lib/rpc/estimation/gasEstimationsV06.d.ts +0 -19
  158. package/lib/rpc/estimation/gasEstimationsV06.js +0 -148
  159. package/lib/rpc/estimation/gasEstimationsV06.js.map +0 -1
  160. package/lib/rpc/estimation/gasEstimationsV07.d.ts +0 -101
  161. package/lib/rpc/estimation/gasEstimationsV07.js +0 -727
  162. package/lib/rpc/estimation/gasEstimationsV07.js.map +0 -1
  163. package/lib/rpc/estimation/types.d.ts +0 -120
  164. package/lib/rpc/estimation/types.js +0 -125
  165. package/lib/rpc/estimation/types.js.map +0 -1
  166. package/lib/rpc/index.d.ts +0 -4
  167. package/lib/rpc/index.js +0 -20
  168. package/lib/rpc/index.js.map +0 -1
  169. package/lib/rpc/methods/debug_bundler_clearReputation.d.ts +0 -22
  170. package/lib/rpc/methods/debug_bundler_clearReputation.js +0 -15
  171. package/lib/rpc/methods/debug_bundler_clearReputation.js.map +0 -1
  172. package/lib/rpc/methods/debug_bundler_clearState.d.ts +0 -22
  173. package/lib/rpc/methods/debug_bundler_clearState.js +0 -16
  174. package/lib/rpc/methods/debug_bundler_clearState.js.map +0 -1
  175. package/lib/rpc/methods/debug_bundler_dumpMempool.d.ts +0 -973
  176. package/lib/rpc/methods/debug_bundler_dumpMempool.js +0 -16
  177. package/lib/rpc/methods/debug_bundler_dumpMempool.js.map +0 -1
  178. package/lib/rpc/methods/debug_bundler_dumpReputation.d.ts +0 -57
  179. package/lib/rpc/methods/debug_bundler_dumpReputation.js +0 -16
  180. package/lib/rpc/methods/debug_bundler_dumpReputation.js.map +0 -1
  181. package/lib/rpc/methods/debug_bundler_getStakeStatus.d.ts +0 -79
  182. package/lib/rpc/methods/debug_bundler_getStakeStatus.js +0 -25
  183. package/lib/rpc/methods/debug_bundler_getStakeStatus.js.map +0 -1
  184. package/lib/rpc/methods/debug_bundler_sendBundleNow.d.ts +0 -22
  185. package/lib/rpc/methods/debug_bundler_sendBundleNow.js +0 -15
  186. package/lib/rpc/methods/debug_bundler_sendBundleNow.js.map +0 -1
  187. package/lib/rpc/methods/debug_bundler_setBundlingMode.d.ts +0 -22
  188. package/lib/rpc/methods/debug_bundler_setBundlingMode.js +0 -16
  189. package/lib/rpc/methods/debug_bundler_setBundlingMode.js.map +0 -1
  190. package/lib/rpc/methods/debug_bundler_setReputation.d.ts +0 -46
  191. package/lib/rpc/methods/debug_bundler_setReputation.js +0 -16
  192. package/lib/rpc/methods/debug_bundler_setReputation.js.map +0 -1
  193. package/lib/rpc/methods/eth_chainId.d.ts +0 -22
  194. package/lib/rpc/methods/eth_chainId.js +0 -13
  195. package/lib/rpc/methods/eth_chainId.js.map +0 -1
  196. package/lib/rpc/methods/eth_estimateUserOperationGas.d.ts +0 -1891
  197. package/lib/rpc/methods/eth_estimateUserOperationGas.js +0 -26
  198. package/lib/rpc/methods/eth_estimateUserOperationGas.js.map +0 -1
  199. package/lib/rpc/methods/eth_getUserOperationByHash.d.ts +0 -1775
  200. package/lib/rpc/methods/eth_getUserOperationByHash.js +0 -101
  201. package/lib/rpc/methods/eth_getUserOperationByHash.js.map +0 -1
  202. package/lib/rpc/methods/eth_getUserOperationReceipt.d.ts +0 -412
  203. package/lib/rpc/methods/eth_getUserOperationReceipt.js +0 -14
  204. package/lib/rpc/methods/eth_getUserOperationReceipt.js.map +0 -1
  205. package/lib/rpc/methods/eth_sendUserOperation.d.ts +0 -878
  206. package/lib/rpc/methods/eth_sendUserOperation.js +0 -44
  207. package/lib/rpc/methods/eth_sendUserOperation.js.map +0 -1
  208. package/lib/rpc/methods/eth_supportedEntryPoints.d.ts +0 -22
  209. package/lib/rpc/methods/eth_supportedEntryPoints.js +0 -13
  210. package/lib/rpc/methods/eth_supportedEntryPoints.js.map +0 -1
  211. package/lib/rpc/methods/index.d.ts +0 -3
  212. package/lib/rpc/methods/index.js +0 -44
  213. package/lib/rpc/methods/index.js.map +0 -1
  214. package/lib/rpc/methods/pimlico_getUserOperationGasPrice.d.ts +0 -131
  215. package/lib/rpc/methods/pimlico_getUserOperationGasPrice.js +0 -33
  216. package/lib/rpc/methods/pimlico_getUserOperationGasPrice.js.map +0 -1
  217. package/lib/rpc/methods/pimlico_getUserOperationStatus.d.ts +0 -43
  218. package/lib/rpc/methods/pimlico_getUserOperationStatus.js +0 -14
  219. package/lib/rpc/methods/pimlico_getUserOperationStatus.js.map +0 -1
  220. package/lib/rpc/methods/pimlico_sendUserOperationNow.d.ts +0 -1268
  221. package/lib/rpc/methods/pimlico_sendUserOperationNow.js +0 -55
  222. package/lib/rpc/methods/pimlico_sendUserOperationNow.js.map +0 -1
  223. package/lib/rpc/rpcHandler.d.ts +0 -75
  224. package/lib/rpc/rpcHandler.js +0 -391
  225. package/lib/rpc/rpcHandler.js.map +0 -1
  226. package/lib/rpc/server.d.ts +0 -26
  227. package/lib/rpc/server.js +0 -283
  228. package/lib/rpc/server.js.map +0 -1
  229. package/lib/rpc/validation/BundlerCollectorTracerV06.d.ts +0 -102
  230. package/lib/rpc/validation/BundlerCollectorTracerV06.js +0 -262
  231. package/lib/rpc/validation/BundlerCollectorTracerV06.js.map +0 -1
  232. package/lib/rpc/validation/BundlerCollectorTracerV07.d.ts +0 -102
  233. package/lib/rpc/validation/BundlerCollectorTracerV07.js +0 -261
  234. package/lib/rpc/validation/BundlerCollectorTracerV07.js.map +0 -1
  235. package/lib/rpc/validation/SafeValidator.d.ts +0 -51
  236. package/lib/rpc/validation/SafeValidator.js +0 -327
  237. package/lib/rpc/validation/SafeValidator.js.map +0 -1
  238. package/lib/rpc/validation/TracerResultParserV06.d.ts +0 -13
  239. package/lib/rpc/validation/TracerResultParserV06.js +0 -582
  240. package/lib/rpc/validation/TracerResultParserV06.js.map +0 -1
  241. package/lib/rpc/validation/TracerResultParserV07.d.ts +0 -33
  242. package/lib/rpc/validation/TracerResultParserV07.js +0 -599
  243. package/lib/rpc/validation/TracerResultParserV07.js.map +0 -1
  244. package/lib/rpc/validation/UnsafeValidator.d.ts +0 -97
  245. package/lib/rpc/validation/UnsafeValidator.js +0 -303
  246. package/lib/rpc/validation/UnsafeValidator.js.map +0 -1
  247. package/lib/rpc/validation/index.d.ts +0 -3
  248. package/lib/rpc/validation/index.js +0 -19
  249. package/lib/rpc/validation/index.js.map +0 -1
  250. package/lib/rpc/validation/tracer.d.ts +0 -125
  251. package/lib/rpc/validation/tracer.js +0 -112
  252. package/lib/rpc/validation/tracer.js.map +0 -1
  253. package/lib/store/createMemoryOutstandingStore.d.ts +0 -28
  254. package/lib/store/createMemoryOutstandingStore.js +0 -236
  255. package/lib/store/createMemoryOutstandingStore.js.map +0 -1
  256. package/lib/store/createMempoolStore.d.ts +0 -8
  257. package/lib/store/createMempoolStore.js +0 -199
  258. package/lib/store/createMempoolStore.js.map +0 -1
  259. package/lib/store/createRedisOutstandingStore.d.ts +0 -27
  260. package/lib/store/createRedisOutstandingStore.js +0 -349
  261. package/lib/store/createRedisOutstandingStore.js.map +0 -1
  262. package/lib/store/createRedisStore.d.ts +0 -9
  263. package/lib/store/createRedisStore.js +0 -138
  264. package/lib/store/createRedisStore.js.map +0 -1
  265. package/lib/store/createStore.d.ts +0 -6
  266. package/lib/store/createStore.js +0 -70
  267. package/lib/store/createStore.js.map +0 -1
  268. package/lib/store/index.d.ts +0 -81
  269. package/lib/store/index.js +0 -6
  270. package/lib/store/index.js.map +0 -1
  271. package/lib/types/contracts/ArbitrumL1FeeAbi.d.ts +0 -32
  272. package/lib/types/contracts/ArbitrumL1FeeAbi.js +0 -45
  273. package/lib/types/contracts/ArbitrumL1FeeAbi.js.map +0 -1
  274. package/lib/types/contracts/CallEngine.d.ts +0 -28
  275. package/lib/types/contracts/CallEngine.js +0 -40
  276. package/lib/types/contracts/CallEngine.js.map +0 -1
  277. package/lib/types/contracts/CodeHashGetter.d.ts +0 -37
  278. package/lib/types/contracts/CodeHashGetter.js +0 -48
  279. package/lib/types/contracts/CodeHashGetter.js.map +0 -1
  280. package/lib/types/contracts/EntryPoint.d.ts +0 -1789
  281. package/lib/types/contracts/EntryPoint.js +0 -2307
  282. package/lib/types/contracts/EntryPoint.js.map +0 -1
  283. package/lib/types/contracts/EntryPointSimulationsV6.d.ts +0 -34
  284. package/lib/types/contracts/EntryPointSimulationsV6.js +0 -51
  285. package/lib/types/contracts/EntryPointSimulationsV6.js.map +0 -1
  286. package/lib/types/contracts/EntryPointSimulationsV7.d.ts +0 -2076
  287. package/lib/types/contracts/EntryPointSimulationsV7.js +0 -2678
  288. package/lib/types/contracts/EntryPointSimulationsV7.js.map +0 -1
  289. package/lib/types/contracts/IAccountExecute.d.ts +0 -53
  290. package/lib/types/contracts/IAccountExecute.js +0 -71
  291. package/lib/types/contracts/IAccountExecute.js.map +0 -1
  292. package/lib/types/contracts/IPaymaster.d.ts +0 -3
  293. package/lib/types/contracts/IPaymaster.js +0 -120
  294. package/lib/types/contracts/IPaymaster.js.map +0 -1
  295. package/lib/types/contracts/MantleBvmGasPriceOracle.d.ts +0 -219
  296. package/lib/types/contracts/MantleBvmGasPriceOracle.js +0 -180
  297. package/lib/types/contracts/MantleBvmGasPriceOracle.js.map +0 -1
  298. package/lib/types/contracts/OpL1FeeAbi.d.ts +0 -114
  299. package/lib/types/contracts/OpL1FeeAbi.js +0 -77
  300. package/lib/types/contracts/OpL1FeeAbi.js.map +0 -1
  301. package/lib/types/contracts/PimlicoEntryPointSimulations.d.ts +0 -25
  302. package/lib/types/contracts/PimlicoEntryPointSimulations.js +0 -42
  303. package/lib/types/contracts/PimlicoEntryPointSimulations.js.map +0 -1
  304. package/lib/types/contracts/SenderCreator.d.ts +0 -4
  305. package/lib/types/contracts/SenderCreator.js +0 -26
  306. package/lib/types/contracts/SenderCreator.js.map +0 -1
  307. package/lib/types/contracts/SimpleAccountFactory.d.ts +0 -57
  308. package/lib/types/contracts/SimpleAccountFactory.js +0 -79
  309. package/lib/types/contracts/SimpleAccountFactory.js.map +0 -1
  310. package/lib/types/contracts/TestOpcodesAccount.d.ts +0 -4
  311. package/lib/types/contracts/TestOpcodesAccount.js +0 -284
  312. package/lib/types/contracts/TestOpcodesAccount.js.map +0 -1
  313. package/lib/types/contracts/TestOpcodesAccountFactory.d.ts +0 -4
  314. package/lib/types/contracts/TestOpcodesAccountFactory.js +0 -26
  315. package/lib/types/contracts/TestOpcodesAccountFactory.js.map +0 -1
  316. package/lib/types/contracts/TestStorageAccount.d.ts +0 -4
  317. package/lib/types/contracts/TestStorageAccount.js +0 -316
  318. package/lib/types/contracts/TestStorageAccount.js.map +0 -1
  319. package/lib/types/contracts/index.d.ts +0 -17
  320. package/lib/types/contracts/index.js +0 -33
  321. package/lib/types/contracts/index.js.map +0 -1
  322. package/lib/types/gasPrice.d.ts +0 -110
  323. package/lib/types/gasPrice.js +0 -55
  324. package/lib/types/gasPrice.js.map +0 -1
  325. package/lib/types/index.d.ts +0 -11
  326. package/lib/types/index.js +0 -27
  327. package/lib/types/index.js.map +0 -1
  328. package/lib/types/interfaces.d.ts +0 -58
  329. package/lib/types/interfaces.js +0 -3
  330. package/lib/types/interfaces.js.map +0 -1
  331. package/lib/types/mempool.d.ts +0 -60
  332. package/lib/types/mempool.js +0 -11
  333. package/lib/types/mempool.js.map +0 -1
  334. package/lib/types/schemas.d.ts +0 -20785
  335. package/lib/types/schemas.js +0 -679
  336. package/lib/types/schemas.js.map +0 -1
  337. package/lib/types/utils.d.ts +0 -25
  338. package/lib/types/utils.js +0 -35
  339. package/lib/types/utils.js.map +0 -1
  340. package/lib/types/validation.d.ts +0 -14327
  341. package/lib/types/validation.js +0 -312
  342. package/lib/types/validation.js.map +0 -1
  343. package/lib/utils/asyncTimeout.d.ts +0 -5
  344. package/lib/utils/asyncTimeout.js +0 -51
  345. package/lib/utils/asyncTimeout.js.map +0 -1
  346. package/lib/utils/bigInt.d.ts +0 -8
  347. package/lib/utils/bigInt.js +0 -24
  348. package/lib/utils/bigInt.js.map +0 -1
  349. package/lib/utils/eip7702.d.ts +0 -4
  350. package/lib/utils/eip7702.js +0 -21
  351. package/lib/utils/eip7702.js.map +0 -1
  352. package/lib/utils/fastify-rpc-decorators.d.ts +0 -19
  353. package/lib/utils/fastify-rpc-decorators.js +0 -23
  354. package/lib/utils/fastify-rpc-decorators.js.map +0 -1
  355. package/lib/utils/helpers.d.ts +0 -15
  356. package/lib/utils/helpers.js +0 -59
  357. package/lib/utils/helpers.js.map +0 -1
  358. package/lib/utils/index.d.ts +0 -9
  359. package/lib/utils/index.js +0 -24
  360. package/lib/utils/index.js.map +0 -1
  361. package/lib/utils/logger.d.ts +0 -6
  362. package/lib/utils/logger.js +0 -85
  363. package/lib/utils/logger.js.map +0 -1
  364. package/lib/utils/metrics.d.ts +0 -29
  365. package/lib/utils/metrics.js +0 -199
  366. package/lib/utils/metrics.js.map +0 -1
  367. package/lib/utils/minMaxQueue/createMemoryMinMaxQueue.d.ts +0 -6
  368. package/lib/utils/minMaxQueue/createMemoryMinMaxQueue.js +0 -57
  369. package/lib/utils/minMaxQueue/createMemoryMinMaxQueue.js.map +0 -1
  370. package/lib/utils/minMaxQueue/createRedisMinMaxQueue.d.ts +0 -7
  371. package/lib/utils/minMaxQueue/createRedisMinMaxQueue.js +0 -105
  372. package/lib/utils/minMaxQueue/createRedisMinMaxQueue.js.map +0 -1
  373. package/lib/utils/minMaxQueue/index.d.ts +0 -12
  374. package/lib/utils/minMaxQueue/index.js +0 -16
  375. package/lib/utils/minMaxQueue/index.js.map +0 -1
  376. package/lib/utils/rpc-reply.d.ts +0 -16
  377. package/lib/utils/rpc-reply.js +0 -41
  378. package/lib/utils/rpc-reply.js.map +0 -1
  379. package/lib/utils/userop.d.ts +0 -138
  380. package/lib/utils/userop.js +0 -620
  381. package/lib/utils/userop.js.map +0 -1
  382. package/lib/utils/validation.d.ts +0 -76
  383. package/lib/utils/validation.js +0 -491
  384. package/lib/utils/validation.js.map +0 -1
@@ -1,121 +0,0 @@
1
- import { type StakeInfo, type UserOperation, type ValidationResult, type ValidationResultWithAggregation } from "../types/index.js";
2
- import { type Address } from "viem";
3
- import type { AltoConfig } from "../createConfig.js";
4
- import { ReadonlyDeep } from "type-fest";
5
- export interface InterfaceReputationManager {
6
- checkReputation(userOperation: UserOperation, entryPoint: Address, validationResult: ValidationResult | ValidationResultWithAggregation): Promise<void>;
7
- increaseUserOperationSeenStatus(userOperation: UserOperation, entryPoint: Address): Promise<void>;
8
- replaceUserOperationSeenStatus(userOperation: UserOperation, entryPoint: Address): Promise<void>;
9
- decreaseUserOperationSeenStatus(userOperation: UserOperation, entryPoint: Address, error: string): Promise<void>;
10
- increaseUserOperationCount(userOperation: UserOperation): void;
11
- decreaseUserOperationCount(userOperation: UserOperation): void;
12
- getStatus(entryPoint: Address, address: Address | null): ReputationStatus;
13
- updateUserOperationIncludedStatus(userOperation: UserOperation, entryPoint: Address, accountDeployed: boolean): void;
14
- crashedHandleOps(userOperation: UserOperation, entryPoint: Address, reason: string): void;
15
- setReputation(entryPoint: Address, args: ReadonlyDeep<{
16
- address: Address;
17
- opsSeen: bigint;
18
- opsIncluded: bigint;
19
- }[]>): void;
20
- dumpReputations(entryPoint: Address): ReputationEntry[];
21
- getStakeStatus(entryPoint: Address, address: Address): Promise<{
22
- stakeInfo: StakeInfo;
23
- isStaked: boolean;
24
- }>;
25
- clear(): void;
26
- clearEntityCount(): void;
27
- }
28
- export declare enum EntityType {
29
- Account = "Account",
30
- Paymaster = "Paymaster",
31
- Factory = "Factory",
32
- Aggregator = "Aggregator"
33
- }
34
- export type ReputationStatus = 0n | 1n | 2n;
35
- export declare const ReputationStatuses: {
36
- ok: ReputationStatus;
37
- throttled: ReputationStatus;
38
- banned: ReputationStatus;
39
- };
40
- export interface ReputationEntry {
41
- address: Address;
42
- opsSeen: bigint;
43
- opsIncluded: bigint;
44
- status?: ReputationStatus;
45
- }
46
- export interface ReputationParams {
47
- minInclusionDenominator: bigint;
48
- throttlingSlack: bigint;
49
- banSlack: bigint;
50
- }
51
- export declare const BundlerReputationParams: ReputationParams;
52
- export declare class NullReputationManager implements InterfaceReputationManager {
53
- checkReputation(_userOperation: UserOperation, _entryPoint: Address, _validationResult: ValidationResult | ValidationResultWithAggregation): Promise<void>;
54
- increaseUserOperationCount(_: UserOperation): void;
55
- decreaseUserOperationCount(_: UserOperation): void;
56
- increaseUserOperationSeenStatus(_: UserOperation, _entryPoint: Address): Promise<void>;
57
- replaceUserOperationSeenStatus(_: UserOperation, _entryPoint: Address): Promise<void>;
58
- decreaseUserOperationSeenStatus(_: UserOperation, _entryPoint: Address, _error: string): Promise<void>;
59
- updateUserOperationIncludedStatus(_: UserOperation, _entryPoint: Address, __: boolean): void;
60
- crashedHandleOps(_: UserOperation, _entryPoint: Address, __: string): void;
61
- setReputation(_: Address, __: {
62
- address: Address;
63
- opsSeen: bigint;
64
- opsIncluded: bigint;
65
- }[]): void;
66
- dumpReputations(_entryPoint: Address): ReputationEntry[];
67
- getStatus(_entryPoint: Address, _address: `0x${string}` | null): ReputationStatus;
68
- getStakeStatus(_entryPoint: Address, _: Address): Promise<{
69
- stakeInfo: StakeInfo;
70
- isStaked: boolean;
71
- }>;
72
- clear(): void;
73
- clearEntityCount(): void;
74
- }
75
- export declare class ReputationManager implements InterfaceReputationManager {
76
- private config;
77
- private entityCount;
78
- private throttledEntityMinMempoolCount;
79
- private maxMempoolUserOperationsPerSender;
80
- private maxMempoolUserOperationsPerNewUnstakedEntity;
81
- private inclusionRateFactor;
82
- private entries;
83
- private whitelist;
84
- private blackList;
85
- private bundlerReputationParams;
86
- private logger;
87
- constructor(config: AltoConfig);
88
- setReputation(entryPoint: Address, reputations: {
89
- address: Address;
90
- opsSeen: bigint;
91
- opsIncluded: bigint;
92
- }[]): void;
93
- dumpReputations(entryPoint: Address): ReputationEntry[];
94
- clear(): void;
95
- clearEntityCount(): void;
96
- getStakeStatus(entryPoint: Address, address: Address): Promise<{
97
- stakeInfo: StakeInfo;
98
- isStaked: boolean;
99
- }>;
100
- checkReputation(userOperation: UserOperation, entryPoint: Address, validationResult: ValidationResult | ValidationResultWithAggregation): Promise<void>;
101
- getEntityCount(address: Address): bigint;
102
- increaseSeen(entryPoint: Address, address: Address): void;
103
- decreaseSeen(entryPoint: Address, address: Address): void;
104
- updateCrashedHandleOps(entryPoint: Address, address: Address): void;
105
- crashedHandleOps(op: UserOperation, entryPoint: Address, reason: string): void;
106
- updateIncludedStatus(entryPoint: Address, address: Address): void;
107
- updateUserOperationIncludedStatus(userOperation: UserOperation, entryPoint: Address, accountDeployed: boolean): void;
108
- increaseUserOperationSeenStatus(userOperation: UserOperation, entryPoint: Address): Promise<void>;
109
- replaceUserOperationSeenStatus(userOperation: UserOperation, entryPoint: Address): Promise<void>;
110
- decreaseUserOperationSeenStatus(userOperation: UserOperation, entryPoint: Address, errorReason: string): Promise<void>;
111
- increaseUserOperationCount(userOperation: UserOperation): void;
112
- decreaseUserOperationCount(userOperation: UserOperation): void;
113
- checkReputationStatus(entryPoint: Address, entityType: EntityType, stakeInfo: StakeInfo, maxMempoolUserOperationsPerSenderOverride?: bigint): void;
114
- getStatus(entryPoint: Address, address: Address | null): ReputationStatus;
115
- checkBanned(entryPoint: Address, entityType: EntityType, stakeInfo: StakeInfo): void;
116
- checkThrottled(entryPoint: Address, entityType: EntityType, stakeInfo: StakeInfo): void;
117
- isWhiteListed(address: Address): boolean;
118
- checkStake(entryPoint: Address, entityType: EntityType, stakeInfo: StakeInfo): void;
119
- calCulateMaxMempoolUserOperationsPerEntity(entryPoint: Address, address: Address): bigint;
120
- }
121
- //# sourceMappingURL=reputationManager.d.ts.map
@@ -1,472 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReputationManager = exports.NullReputationManager = exports.BundlerReputationParams = exports.ReputationStatuses = exports.EntityType = void 0;
4
- const types_1 = require("../types/index.js");
5
- const utils_1 = require("../utils/index.js");
6
- const viem_1 = require("viem");
7
- var EntityType;
8
- (function (EntityType) {
9
- EntityType["Account"] = "Account";
10
- EntityType["Paymaster"] = "Paymaster";
11
- EntityType["Factory"] = "Factory";
12
- EntityType["Aggregator"] = "Aggregator";
13
- })(EntityType || (exports.EntityType = EntityType = {}));
14
- exports.ReputationStatuses = {
15
- ok: 0n,
16
- throttled: 1n,
17
- banned: 2n
18
- };
19
- exports.BundlerReputationParams = {
20
- minInclusionDenominator: 10n,
21
- throttlingSlack: 10n,
22
- banSlack: 50n
23
- };
24
- class NullReputationManager {
25
- checkReputation(_userOperation, _entryPoint, _validationResult) {
26
- return Promise.resolve();
27
- }
28
- increaseUserOperationCount(_) {
29
- return;
30
- }
31
- decreaseUserOperationCount(_) {
32
- return;
33
- }
34
- increaseUserOperationSeenStatus(_, _entryPoint) {
35
- return Promise.resolve();
36
- }
37
- replaceUserOperationSeenStatus(_, _entryPoint) {
38
- return Promise.resolve();
39
- }
40
- decreaseUserOperationSeenStatus(_, _entryPoint, _error) {
41
- return Promise.resolve();
42
- }
43
- updateUserOperationIncludedStatus(_, _entryPoint, __) {
44
- return;
45
- }
46
- crashedHandleOps(_, _entryPoint, __) {
47
- return;
48
- }
49
- setReputation(_, __) {
50
- return;
51
- }
52
- dumpReputations(_entryPoint) {
53
- return [];
54
- }
55
- getStatus(_entryPoint, _address) {
56
- throw new Error("Method not implemented.");
57
- }
58
- getStakeStatus(_entryPoint, _) {
59
- throw new Error("Method not implemented.");
60
- }
61
- clear() {
62
- return;
63
- }
64
- clearEntityCount() {
65
- return;
66
- }
67
- }
68
- exports.NullReputationManager = NullReputationManager;
69
- class ReputationManager {
70
- config;
71
- entityCount = {};
72
- throttledEntityMinMempoolCount;
73
- maxMempoolUserOperationsPerSender;
74
- maxMempoolUserOperationsPerNewUnstakedEntity;
75
- inclusionRateFactor;
76
- entries = {};
77
- whitelist = new Set();
78
- blackList = new Set();
79
- bundlerReputationParams;
80
- logger;
81
- constructor(config) {
82
- this.config = config;
83
- this.logger = config.getLogger({ module: "reputation_manager" }, {
84
- level: config.reputationManagerLogLevel || config.logLevel
85
- });
86
- this.maxMempoolUserOperationsPerNewUnstakedEntity = 10n;
87
- this.inclusionRateFactor = 10n;
88
- this.throttledEntityMinMempoolCount = 4n;
89
- this.maxMempoolUserOperationsPerSender = 4n;
90
- this.bundlerReputationParams = exports.BundlerReputationParams;
91
- // Currently we don't have any args for blacklist and whitelist
92
- // for (const address of blackList || []) {
93
- // this.blackList.add(address)
94
- // }
95
- // for (const address of whiteList || []) {
96
- // this.whitelist.add(address)
97
- // }
98
- for (const entryPoint of config.entrypoints) {
99
- this.entries[entryPoint] = {};
100
- }
101
- }
102
- setReputation(entryPoint, reputations) {
103
- for (const reputation of reputations) {
104
- const address = (0, viem_1.getAddress)(reputation.address);
105
- this.entries[entryPoint][address] = {
106
- address,
107
- opsSeen: BigInt(reputation.opsSeen),
108
- opsIncluded: BigInt(reputation.opsIncluded)
109
- };
110
- }
111
- this.logger.debug({
112
- reputations: this.entries
113
- }, "Reputation set");
114
- }
115
- dumpReputations(entryPoint) {
116
- return Object.values(this.entries[entryPoint]).map((entry) => ({
117
- ...entry,
118
- status: this.getStatus(entryPoint, entry.address)
119
- }));
120
- }
121
- clear() {
122
- for (const entryPoint of Object.keys(this.entries)) {
123
- this.entries[entryPoint] = {};
124
- }
125
- this.entityCount = {};
126
- }
127
- clearEntityCount() {
128
- this.entityCount = {};
129
- }
130
- async getStakeStatus(entryPoint, address) {
131
- const entryPointContract = (0, viem_1.getContract)({
132
- abi: types_1.EntryPointV06Abi,
133
- address: entryPoint,
134
- client: {
135
- public: this.config.publicClient
136
- }
137
- });
138
- const stakeInfo = await entryPointContract.read.getDepositInfo([
139
- address
140
- ]);
141
- const stake = BigInt(stakeInfo.stake);
142
- const unstakeDelaySec = BigInt(stakeInfo.unstakeDelaySec);
143
- const isStaked = stake >= this.config.minEntityStake &&
144
- unstakeDelaySec >= this.config.minEntityUnstakeDelay;
145
- return {
146
- stakeInfo: {
147
- addr: address,
148
- stake: stake,
149
- unstakeDelaySec: unstakeDelaySec
150
- },
151
- isStaked
152
- };
153
- }
154
- checkReputation(userOperation, entryPoint, validationResult) {
155
- this.increaseUserOperationCount(userOperation);
156
- this.checkReputationStatus(entryPoint, EntityType.Account, validationResult.senderInfo, this.maxMempoolUserOperationsPerSender);
157
- if (validationResult.paymasterInfo) {
158
- this.checkReputationStatus(entryPoint, EntityType.Paymaster, validationResult.paymasterInfo);
159
- }
160
- if (validationResult.factoryInfo) {
161
- this.checkReputationStatus(entryPoint, EntityType.Factory, validationResult.factoryInfo);
162
- }
163
- const aggregatorValidationResult = validationResult;
164
- if (aggregatorValidationResult.aggregatorInfo) {
165
- this.checkReputationStatus(entryPoint, EntityType.Aggregator, aggregatorValidationResult.aggregatorInfo.stakeInfo);
166
- }
167
- return Promise.resolve();
168
- }
169
- getEntityCount(address) {
170
- return this.entityCount[address] ?? 0;
171
- }
172
- increaseSeen(entryPoint, address) {
173
- let entry = this.entries[entryPoint][address];
174
- if (!entry) {
175
- this.entries[entryPoint][address] = {
176
- address,
177
- opsSeen: 0n,
178
- opsIncluded: 0n
179
- };
180
- entry = this.entries[entryPoint][address];
181
- }
182
- entry.opsSeen++;
183
- }
184
- decreaseSeen(entryPoint, address) {
185
- const entry = this.entries[entryPoint][address];
186
- if (!entry) {
187
- return;
188
- }
189
- entry.opsSeen--;
190
- }
191
- updateCrashedHandleOps(entryPoint, address) {
192
- const entry = this.entries[entryPoint][address];
193
- if (!entry) {
194
- this.entries[entryPoint][address] = {
195
- address,
196
- opsSeen: 10000n,
197
- opsIncluded: 0n
198
- };
199
- return;
200
- }
201
- entry.opsSeen = 10000n;
202
- entry.opsIncluded = 0n;
203
- }
204
- crashedHandleOps(op, entryPoint, reason) {
205
- const isUserOpV06 = (0, utils_1.isVersion06)(op);
206
- if (reason.startsWith("AA3")) {
207
- // paymaster
208
- const paymaster = isUserOpV06
209
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(op.paymasterAndData)
210
- : op.paymaster;
211
- if (paymaster) {
212
- this.updateCrashedHandleOps(entryPoint, paymaster);
213
- }
214
- }
215
- else if (reason.startsWith("AA2")) {
216
- const factory = isUserOpV06
217
- ? undefined
218
- : op.factory;
219
- if (factory) {
220
- this.updateCrashedHandleOps(entryPoint, factory);
221
- }
222
- else {
223
- // sender
224
- const sender = op.sender;
225
- this.updateCrashedHandleOps(entryPoint, sender);
226
- }
227
- }
228
- else if (reason.startsWith("AA1")) {
229
- // init code
230
- const factory = isUserOpV06
231
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(op.initCode)
232
- : op.factory;
233
- if (factory) {
234
- this.updateCrashedHandleOps(entryPoint, factory);
235
- }
236
- }
237
- }
238
- updateIncludedStatus(entryPoint, address) {
239
- let entry = this.entries[entryPoint][address];
240
- if (!entry) {
241
- this.entries[entryPoint][address] = {
242
- address,
243
- opsSeen: 0n,
244
- opsIncluded: 0n
245
- };
246
- entry = this.entries[entryPoint][address];
247
- }
248
- entry.opsIncluded++;
249
- }
250
- updateUserOperationIncludedStatus(userOperation, entryPoint, accountDeployed) {
251
- const sender = userOperation.sender;
252
- this.updateIncludedStatus(entryPoint, sender);
253
- const isUserOpV06 = (0, utils_1.isVersion06)(userOperation);
254
- const paymaster = isUserOpV06
255
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.paymasterAndData)
256
- : userOperation.paymaster;
257
- if (paymaster) {
258
- this.updateIncludedStatus(entryPoint, paymaster);
259
- }
260
- if (accountDeployed) {
261
- const factory = (isUserOpV06
262
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.initCode)
263
- : userOperation.factory);
264
- if (factory) {
265
- this.updateIncludedStatus(entryPoint, factory);
266
- }
267
- }
268
- }
269
- async increaseUserOperationSeenStatus(userOperation, entryPoint) {
270
- const sender = userOperation.sender;
271
- const stakeInfo = await this.getStakeStatus(entryPoint, sender);
272
- if (stakeInfo.isStaked) {
273
- this.increaseSeen(entryPoint, sender);
274
- }
275
- const isUserOpV06 = (0, utils_1.isVersion06)(userOperation);
276
- const paymaster = isUserOpV06
277
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.paymasterAndData)
278
- : userOperation.paymaster;
279
- if (paymaster) {
280
- this.increaseSeen(entryPoint, paymaster);
281
- }
282
- const factory = (isUserOpV06
283
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.initCode)
284
- : userOperation.factory);
285
- this.logger.debug({ userOperation, factory }, "increaseUserOperationSeenStatus");
286
- if (factory) {
287
- this.increaseSeen(entryPoint, factory);
288
- }
289
- }
290
- async replaceUserOperationSeenStatus(userOperation, entryPoint) {
291
- const sender = userOperation.sender;
292
- const stakeInfo = await this.getStakeStatus(entryPoint, sender);
293
- if (stakeInfo.isStaked) {
294
- this.decreaseSeen(entryPoint, sender);
295
- }
296
- const isUserOpV06 = (0, utils_1.isVersion06)(userOperation);
297
- const paymaster = isUserOpV06
298
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.paymasterAndData)
299
- : userOperation.paymaster;
300
- if (paymaster) {
301
- this.decreaseSeen(entryPoint, paymaster);
302
- }
303
- const factory = (isUserOpV06
304
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.initCode)
305
- : userOperation.factory);
306
- this.logger.debug({ userOperation, factory }, "increaseUserOperationSeenStatus");
307
- if (factory) {
308
- this.decreaseSeen(entryPoint, factory);
309
- }
310
- }
311
- async decreaseUserOperationSeenStatus(userOperation, entryPoint, errorReason) {
312
- const sender = userOperation.sender;
313
- const senderStakeInfo = await this.getStakeStatus(entryPoint, sender);
314
- if (!senderStakeInfo.isStaked) {
315
- this.decreaseSeen(entryPoint, sender);
316
- }
317
- const isUserOpV06 = (0, utils_1.isVersion06)(userOperation);
318
- const paymaster = isUserOpV06
319
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.paymasterAndData)
320
- : userOperation.paymaster;
321
- // can decrease if senderStakeInfo.isStaked is true
322
- // or when error does not include aa3
323
- if (paymaster &&
324
- (senderStakeInfo.isStaked ||
325
- !errorReason.toLowerCase().includes("aa3"))) {
326
- this.decreaseSeen(entryPoint, paymaster);
327
- }
328
- const factory = (isUserOpV06
329
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.initCode)
330
- : userOperation.factory);
331
- this.logger.debug({ userOperation, factory }, "decreaseUserOperationSeenStatus");
332
- if (factory) {
333
- this.decreaseSeen(entryPoint, factory);
334
- }
335
- }
336
- increaseUserOperationCount(userOperation) {
337
- const sender = userOperation.sender;
338
- this.entityCount[sender] = (this.entityCount[sender] ?? 0n) + 1n;
339
- const isUserOpV06 = (0, utils_1.isVersion06)(userOperation);
340
- const paymaster = isUserOpV06
341
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.paymasterAndData)
342
- : userOperation.paymaster;
343
- if (paymaster) {
344
- this.entityCount[paymaster] =
345
- (this.entityCount[paymaster] ?? 0n) + 1n;
346
- }
347
- const factory = (isUserOpV06
348
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.initCode)
349
- : userOperation.factory);
350
- if (factory) {
351
- this.entityCount[factory] = (this.entityCount[factory] ?? 0n) + 1n;
352
- }
353
- }
354
- decreaseUserOperationCount(userOperation) {
355
- const sender = userOperation.sender;
356
- this.entityCount[sender] = (this.entityCount[sender] ?? 0n) - 1n;
357
- const isUserOpV06 = (0, utils_1.isVersion06)(userOperation);
358
- this.entityCount[sender] =
359
- this.entityCount[sender] < 0n ? 0n : this.entityCount[sender];
360
- const paymaster = isUserOpV06
361
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.paymasterAndData)
362
- : userOperation.paymaster;
363
- if (paymaster) {
364
- this.entityCount[paymaster] =
365
- (this.entityCount[paymaster] ?? 0n) - 1n;
366
- this.entityCount[paymaster] =
367
- this.entityCount[paymaster] < 0n
368
- ? 0n
369
- : this.entityCount[paymaster];
370
- }
371
- const factory = (isUserOpV06
372
- ? (0, utils_1.getAddressFromInitCodeOrPaymasterAndData)(userOperation.initCode)
373
- : userOperation.factory);
374
- if (factory) {
375
- this.entityCount[factory] = (this.entityCount[factory] ?? 0n) - 1n;
376
- this.entityCount[factory] =
377
- this.entityCount[factory] < 0n ? 0n : this.entityCount[factory];
378
- }
379
- }
380
- checkReputationStatus(entryPoint, entityType, stakeInfo, maxMempoolUserOperationsPerSenderOverride) {
381
- const maxTxMempoolAllowedEntity = maxMempoolUserOperationsPerSenderOverride ??
382
- this.calCulateMaxMempoolUserOperationsPerEntity(entryPoint, stakeInfo.addr);
383
- this.checkBanned(entryPoint, entityType, stakeInfo);
384
- const entityCount = this.getEntityCount(stakeInfo.addr);
385
- if (entityCount > this.throttledEntityMinMempoolCount) {
386
- this.checkThrottled(entryPoint, entityType, stakeInfo);
387
- }
388
- if (entityCount > maxTxMempoolAllowedEntity) {
389
- this.checkStake(entryPoint, entityType, stakeInfo);
390
- }
391
- }
392
- getStatus(entryPoint, address) {
393
- if (!address || this.whitelist.has(address)) {
394
- return exports.ReputationStatuses.ok;
395
- }
396
- if (this.blackList.has(address)) {
397
- return exports.ReputationStatuses.banned;
398
- }
399
- const entry = this.entries[entryPoint][address];
400
- if (!entry) {
401
- return exports.ReputationStatuses.ok;
402
- }
403
- const minExpectedIncluded = entry.opsSeen / this.bundlerReputationParams.minInclusionDenominator;
404
- this.logger.debug({
405
- address: address,
406
- minExpectedIncluded,
407
- opsSeen: entry.opsSeen,
408
- minInclusionDenominator: this.bundlerReputationParams.minInclusionDenominator,
409
- opsIncluded: entry.opsIncluded,
410
- throttlingSlack: this.bundlerReputationParams.throttlingSlack,
411
- banSlack: this.bundlerReputationParams.banSlack
412
- }, "minExpectedIncluded");
413
- if (minExpectedIncluded <=
414
- entry.opsIncluded + this.bundlerReputationParams.throttlingSlack) {
415
- entry.status = exports.ReputationStatuses.ok;
416
- return exports.ReputationStatuses.ok;
417
- }
418
- if (minExpectedIncluded <=
419
- entry.opsIncluded + this.bundlerReputationParams.banSlack) {
420
- entry.status = exports.ReputationStatuses.throttled;
421
- return exports.ReputationStatuses.throttled;
422
- }
423
- entry.status = exports.ReputationStatuses.banned;
424
- return exports.ReputationStatuses.banned;
425
- }
426
- checkBanned(entryPoint, entityType, stakeInfo) {
427
- const status = this.getStatus(entryPoint, stakeInfo.addr);
428
- if (status === exports.ReputationStatuses.banned) {
429
- throw new types_1.RpcError(`${entityType} ${stakeInfo.addr} is banned from using the pimlico`, types_1.ValidationErrors.Reputation);
430
- }
431
- }
432
- checkThrottled(entryPoint, entityType, stakeInfo) {
433
- const status = this.getStatus(entryPoint, stakeInfo.addr);
434
- if (status === exports.ReputationStatuses.throttled) {
435
- throw new types_1.RpcError(`${entityType} ${stakeInfo.addr} is throttled by the pimlico`, types_1.ValidationErrors.Reputation);
436
- }
437
- }
438
- isWhiteListed(address) {
439
- return this.whitelist.has(address);
440
- }
441
- checkStake(entryPoint, entityType, stakeInfo) {
442
- if (this.isWhiteListed(stakeInfo.addr)) {
443
- return;
444
- }
445
- this.checkBanned(entryPoint, entityType, stakeInfo);
446
- if (stakeInfo.stake < this.config.minEntityStake) {
447
- if (stakeInfo.stake === 0n) {
448
- throw new types_1.RpcError(`${entityType} ${stakeInfo.addr} is unstaked and must stake minimum ${this.config.minEntityStake} to use pimlico`, types_1.ValidationErrors.InsufficientStake);
449
- }
450
- throw new types_1.RpcError(`${entityType} ${stakeInfo.addr} does not have enough stake to use pimlico`, types_1.ValidationErrors.InsufficientStake);
451
- }
452
- if (stakeInfo.unstakeDelaySec < this.config.minEntityUnstakeDelay) {
453
- throw new types_1.RpcError(`${entityType} ${stakeInfo.addr} does not have enough unstake delay to use pimlico`, types_1.ValidationErrors.InsufficientStake);
454
- }
455
- }
456
- calCulateMaxMempoolUserOperationsPerEntity(entryPoint, address) {
457
- const entry = this.entries[entryPoint][address];
458
- if (!entry) {
459
- return this.maxMempoolUserOperationsPerNewUnstakedEntity;
460
- }
461
- let inclusionRate = 0n;
462
- if (entry.opsSeen !== 0n) {
463
- // prevent NaN of Infinity in tests
464
- inclusionRate = entry.opsIncluded / entry.opsSeen;
465
- }
466
- return (this.maxMempoolUserOperationsPerNewUnstakedEntity +
467
- inclusionRate * this.inclusionRateFactor +
468
- (entry.opsIncluded > 10000n ? 10000n : entry.opsIncluded));
469
- }
470
- }
471
- exports.ReputationManager = ReputationManager;
472
- //# sourceMappingURL=reputationManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reputationManager.js","sourceRoot":"","sources":["../../mempool/reputationManager.ts"],"names":[],"mappings":";;;AAAA,uCAQoB;AAEpB,uCAGoB;AACpB,+BAA4D;AA0D5D,IAAY,UAKX;AALD,WAAY,UAAU;IAClB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,iCAAmB,CAAA;IACnB,uCAAyB,CAAA;AAC7B,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAGY,QAAA,kBAAkB,GAI3B;IACA,EAAE,EAAE,EAAE;IACN,SAAS,EAAE,EAAE;IACb,MAAM,EAAE,EAAE;CACb,CAAA;AAeY,QAAA,uBAAuB,GAAqB;IACrD,uBAAuB,EAAE,GAAG;IAC5B,eAAe,EAAE,GAAG;IACpB,QAAQ,EAAE,GAAG;CAChB,CAAA;AAED,MAAa,qBAA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AI,SAAS,CAAC,IAAI,oDAAoD,EACnF,wBAAgB,CAAC,iBAAiB,CACrC,CAAA;QACL,CAAC;IACL,CAAC;IAED,0CAA0C,CACtC,UAAmB,EACnB,OAAgB;QAEhB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAA;QAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO,IAAI,CAAC,4CAA4C,CAAA;QAC5D,CAAC;QACD,IAAI,aAAa,GAAG,EAAE,CAAA;QACtB,IAAI,KAAK,CAAC,OAAO,KAAK,EAAE,EAAE,CAAC;YACvB,mCAAmC;YACnC,aAAa,GAAG,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,OAAO,CAAA;QACrD,CAAC;QACD,OAAO,CACH,IAAI,CAAC,4CAA4C;YACjD,aAAa,GAAG,IAAI,CAAC,mBAAmB;YACxC,CAAC,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC5D,CAAA;IACL,CAAC;CACJ;AAznBD,8CAynBC"}
@@ -1,31 +0,0 @@
1
- import type { z } from "zod";
2
- import type { RpcHandler } from "./rpcHandler.js";
3
- import type { ApiVersion } from "../types/index.js";
4
- import type { ReadonlyDeep } from "type-fest";
5
- export type MethodHandler<T extends z.ZodType = z.ZodType> = {
6
- schema: T;
7
- method: z.infer<T>["method"];
8
- handler: (args: {
9
- rpcHandler: RpcHandler;
10
- params: ReadonlyDeep<z.infer<T>["params"]>;
11
- apiVersion: ApiVersion;
12
- }) => Promise<z.infer<T>["result"]> | z.infer<T>["result"];
13
- };
14
- export declare const createMethodHandler: <T extends z.ZodType<any, z.ZodTypeDef, any>>(methodConfig: {
15
- schema: T;
16
- method: z.TypeOf<T>["method"];
17
- handler: (args: {
18
- rpcHandler: RpcHandler;
19
- params: ReadonlyDeep<z.TypeOf<T>["params"]>;
20
- apiVersion: ApiVersion;
21
- }) => z.TypeOf<T>["result"] | Promise<z.TypeOf<T>["result"]>;
22
- }) => {
23
- schema: T;
24
- method: z.TypeOf<T>["method"];
25
- handler: (args: {
26
- rpcHandler: RpcHandler;
27
- params: ReadonlyDeep<z.TypeOf<T>["params"]>;
28
- apiVersion: ApiVersion;
29
- }) => z.TypeOf<T>["result"] | Promise<z.TypeOf<T>["result"]>;
30
- };
31
- //# sourceMappingURL=createMethodHandler.d.ts.map