@pimlico/alto 0.0.0-staging.20240606T101741 → 0.0.0-staging.20240606T103333

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 (220) hide show
  1. package/esm/cli/alto.d.ts +6 -0
  2. package/esm/cli/alto.js +92 -0
  3. package/esm/cli/alto.js.map +1 -0
  4. package/esm/cli/config/bundler.d.ts +391 -0
  5. package/esm/cli/config/bundler.js +132 -0
  6. package/esm/cli/config/bundler.js.map +1 -0
  7. package/esm/cli/config/index.d.ts +3 -0
  8. package/esm/cli/config/index.js +3 -0
  9. package/esm/cli/config/index.js.map +1 -0
  10. package/esm/cli/config/options.d.ts +11 -0
  11. package/esm/cli/config/options.js +336 -0
  12. package/esm/cli/config/options.js.map +1 -0
  13. package/esm/cli/customTransport.d.ts +14 -0
  14. package/esm/cli/customTransport.js +53 -0
  15. package/esm/cli/customTransport.js.map +1 -0
  16. package/esm/cli/handler.d.ts +3 -0
  17. package/esm/cli/handler.js +116 -0
  18. package/esm/cli/handler.js.map +1 -0
  19. package/esm/cli/index.d.ts +4 -0
  20. package/esm/cli/index.js +4 -0
  21. package/esm/cli/index.js.map +1 -0
  22. package/esm/cli/instrumentation.d.ts +2 -0
  23. package/esm/cli/instrumentation.js +39 -0
  24. package/esm/cli/instrumentation.js.map +1 -0
  25. package/esm/cli/setupServer.d.ts +17 -0
  26. package/esm/cli/setupServer.js +155 -0
  27. package/esm/cli/setupServer.js.map +1 -0
  28. package/esm/cli/util.d.ts +22 -0
  29. package/esm/cli/util.js +30 -0
  30. package/esm/cli/util.js.map +1 -0
  31. package/esm/executor/executor.d.ts +54 -0
  32. package/esm/executor/executor.js +637 -0
  33. package/esm/executor/executor.js.map +1 -0
  34. package/esm/executor/executorManager.d.ts +34 -0
  35. package/esm/executor/executorManager.js +401 -0
  36. package/esm/executor/executorManager.js.map +1 -0
  37. package/esm/executor/index.d.ts +5 -0
  38. package/esm/executor/index.js +5 -0
  39. package/esm/executor/index.js.map +1 -0
  40. package/esm/executor/senderManager.d.ts +17 -0
  41. package/esm/executor/senderManager.js +160 -0
  42. package/esm/executor/senderManager.js.map +1 -0
  43. package/esm/executor/test/utils.d.ts +13 -0
  44. package/esm/executor/test/utils.js +75 -0
  45. package/esm/executor/test/utils.js.map +1 -0
  46. package/esm/executor/utils.d.ts +32 -0
  47. package/esm/executor/utils.js +239 -0
  48. package/esm/executor/utils.js.map +1 -0
  49. package/esm/index.d.ts +2 -0
  50. package/esm/index.js +2 -0
  51. package/esm/index.js.map +1 -0
  52. package/esm/mempool/index.d.ts +5 -0
  53. package/esm/mempool/index.js +5 -0
  54. package/esm/mempool/index.js.map +1 -0
  55. package/esm/mempool/mempool.d.ts +64 -0
  56. package/esm/mempool/mempool.js +489 -0
  57. package/esm/mempool/mempool.js.map +1 -0
  58. package/esm/mempool/monitoring.d.ts +10 -0
  59. package/esm/mempool/monitoring.js +34 -0
  60. package/esm/mempool/monitoring.js.map +1 -0
  61. package/esm/mempool/nullMempool.d.ts +15 -0
  62. package/esm/mempool/nullMempool.js +36 -0
  63. package/esm/mempool/nullMempool.js.map +1 -0
  64. package/esm/mempool/reputationManager.d.ts +115 -0
  65. package/esm/mempool/reputationManager.js +397 -0
  66. package/esm/mempool/reputationManager.js.map +1 -0
  67. package/esm/mempool/store.d.ts +22 -0
  68. package/esm/mempool/store.js +123 -0
  69. package/esm/mempool/store.js.map +1 -0
  70. package/esm/rpc/EntryPointSimulationsV07.d.ts +58 -0
  71. package/esm/rpc/EntryPointSimulationsV07.js +407 -0
  72. package/esm/rpc/EntryPointSimulationsV07.js.map +1 -0
  73. package/esm/rpc/ExecuteSimulator.d.ts +37 -0
  74. package/esm/rpc/ExecuteSimulator.js +48 -0
  75. package/esm/rpc/ExecuteSimulator.js.map +1 -0
  76. package/esm/rpc/gasEstimation.d.ts +17 -0
  77. package/esm/rpc/gasEstimation.js +410 -0
  78. package/esm/rpc/gasEstimation.js.map +1 -0
  79. package/esm/rpc/index.d.ts +5 -0
  80. package/esm/rpc/index.js +5 -0
  81. package/esm/rpc/index.js.map +1 -0
  82. package/esm/rpc/nonceQueuer.d.ts +25 -0
  83. package/esm/rpc/nonceQueuer.js +135 -0
  84. package/esm/rpc/nonceQueuer.js.map +1 -0
  85. package/esm/rpc/rpcHandler.d.ts +64 -0
  86. package/esm/rpc/rpcHandler.js +727 -0
  87. package/esm/rpc/rpcHandler.js.map +1 -0
  88. package/esm/rpc/server.d.ts +31 -0
  89. package/esm/rpc/server.js +238 -0
  90. package/esm/rpc/server.js.map +1 -0
  91. package/esm/rpc/validation/BundlerCollectorTracerV06.d.ts +102 -0
  92. package/esm/rpc/validation/BundlerCollectorTracerV06.js +255 -0
  93. package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +1 -0
  94. package/esm/rpc/validation/BundlerCollectorTracerV07.d.ts +102 -0
  95. package/esm/rpc/validation/BundlerCollectorTracerV07.js +254 -0
  96. package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +1 -0
  97. package/esm/rpc/validation/SafeValidator.d.ts +35 -0
  98. package/esm/rpc/validation/SafeValidator.js +487 -0
  99. package/esm/rpc/validation/SafeValidator.js.map +1 -0
  100. package/esm/rpc/validation/TracerResultParserV06.d.ts +13 -0
  101. package/esm/rpc/validation/TracerResultParserV06.js +578 -0
  102. package/esm/rpc/validation/TracerResultParserV06.js.map +1 -0
  103. package/esm/rpc/validation/TracerResultParserV07.d.ts +33 -0
  104. package/esm/rpc/validation/TracerResultParserV07.js +557 -0
  105. package/esm/rpc/validation/TracerResultParserV07.js.map +1 -0
  106. package/esm/rpc/validation/UnsafeValidator.d.ts +63 -0
  107. package/esm/rpc/validation/UnsafeValidator.js +257 -0
  108. package/esm/rpc/validation/UnsafeValidator.js.map +1 -0
  109. package/esm/rpc/validation/index.d.ts +3 -0
  110. package/esm/rpc/validation/index.js +3 -0
  111. package/esm/rpc/validation/index.js.map +1 -0
  112. package/esm/rpc/validation/tracer.d.ts +122 -0
  113. package/esm/rpc/validation/tracer.js +82 -0
  114. package/esm/rpc/validation/tracer.js.map +1 -0
  115. package/esm/types/contracts/BundleBulker.d.ts +120 -0
  116. package/esm/types/contracts/BundleBulker.js +157 -0
  117. package/esm/types/contracts/BundleBulker.js.map +1 -0
  118. package/esm/types/contracts/CallEngine.d.ts +28 -0
  119. package/esm/types/contracts/CallEngine.js +37 -0
  120. package/esm/types/contracts/CallEngine.js.map +1 -0
  121. package/esm/types/contracts/CodeHashGetter.d.ts +37 -0
  122. package/esm/types/contracts/CodeHashGetter.js +45 -0
  123. package/esm/types/contracts/CodeHashGetter.js.map +1 -0
  124. package/esm/types/contracts/EntryPoint.d.ts +1789 -0
  125. package/esm/types/contracts/EntryPoint.js +2304 -0
  126. package/esm/types/contracts/EntryPoint.js.map +1 -0
  127. package/esm/types/contracts/EntryPointSimulations.d.ts +153 -0
  128. package/esm/types/contracts/EntryPointSimulations.js +15 -0
  129. package/esm/types/contracts/EntryPointSimulations.js.map +1 -0
  130. package/esm/types/contracts/IOpInflator.d.ts +61 -0
  131. package/esm/types/contracts/IOpInflator.js +80 -0
  132. package/esm/types/contracts/IOpInflator.js.map +1 -0
  133. package/esm/types/contracts/IPaymaster.d.ts +3 -0
  134. package/esm/types/contracts/IPaymaster.js +117 -0
  135. package/esm/types/contracts/IPaymaster.js.map +1 -0
  136. package/esm/types/contracts/Inflator.d.ts +65 -0
  137. package/esm/types/contracts/Inflator.js +84 -0
  138. package/esm/types/contracts/Inflator.js.map +1 -0
  139. package/esm/types/contracts/PerOpInflator.d.ts +176 -0
  140. package/esm/types/contracts/PerOpInflator.js +229 -0
  141. package/esm/types/contracts/PerOpInflator.js.map +1 -0
  142. package/esm/types/contracts/PimlicoEntryPointSimulations.d.ts +23 -0
  143. package/esm/types/contracts/PimlicoEntryPointSimulations.js +33 -0
  144. package/esm/types/contracts/PimlicoEntryPointSimulations.js.map +1 -0
  145. package/esm/types/contracts/SenderCreator.d.ts +4 -0
  146. package/esm/types/contracts/SenderCreator.js +23 -0
  147. package/esm/types/contracts/SenderCreator.js.map +1 -0
  148. package/esm/types/contracts/SimpleAccountFactory.d.ts +57 -0
  149. package/esm/types/contracts/SimpleAccountFactory.js +76 -0
  150. package/esm/types/contracts/SimpleAccountFactory.js.map +1 -0
  151. package/esm/types/contracts/TestOpcodesAccount.d.ts +4 -0
  152. package/esm/types/contracts/TestOpcodesAccount.js +281 -0
  153. package/esm/types/contracts/TestOpcodesAccount.js.map +1 -0
  154. package/esm/types/contracts/TestOpcodesAccountFactory.d.ts +4 -0
  155. package/esm/types/contracts/TestOpcodesAccountFactory.js +23 -0
  156. package/esm/types/contracts/TestOpcodesAccountFactory.js.map +1 -0
  157. package/esm/types/contracts/TestStorageAccount.d.ts +4 -0
  158. package/esm/types/contracts/TestStorageAccount.js +313 -0
  159. package/esm/types/contracts/TestStorageAccount.js.map +1 -0
  160. package/esm/types/contracts/index.d.ts +17 -0
  161. package/esm/types/contracts/index.js +17 -0
  162. package/esm/types/contracts/index.js.map +1 -0
  163. package/esm/types/gasPrice.d.ts +110 -0
  164. package/esm/types/gasPrice.js +52 -0
  165. package/esm/types/gasPrice.js.map +1 -0
  166. package/esm/types/index.d.ts +11 -0
  167. package/esm/types/index.js +11 -0
  168. package/esm/types/index.js.map +1 -0
  169. package/esm/types/interfaces.d.ts +26 -0
  170. package/esm/types/interfaces.js +2 -0
  171. package/esm/types/interfaces.js.map +1 -0
  172. package/esm/types/mempool.d.ts +78 -0
  173. package/esm/types/mempool.js +16 -0
  174. package/esm/types/mempool.js.map +1 -0
  175. package/esm/types/schemas.d.ts +4791 -0
  176. package/esm/types/schemas.js +497 -0
  177. package/esm/types/schemas.js.map +1 -0
  178. package/esm/types/test/validationTestErrors.d.ts +3 -0
  179. package/esm/types/test/validationTestErrors.js +229 -0
  180. package/esm/types/test/validationTestErrors.js.map +1 -0
  181. package/esm/types/utils.d.ts +24 -0
  182. package/esm/types/utils.js +30 -0
  183. package/esm/types/utils.js.map +1 -0
  184. package/esm/types/validation.d.ts +14327 -0
  185. package/esm/types/validation.js +304 -0
  186. package/esm/types/validation.js.map +1 -0
  187. package/esm/utils/bigInt.d.ts +3 -0
  188. package/esm/utils/bigInt.js +9 -0
  189. package/esm/utils/bigInt.js.map +1 -0
  190. package/esm/utils/compressionHandler.d.ts +11 -0
  191. package/esm/utils/compressionHandler.js +39 -0
  192. package/esm/utils/compressionHandler.js.map +1 -0
  193. package/esm/utils/gasPriceManager.d.ts +34 -0
  194. package/esm/utils/gasPriceManager.js +338 -0
  195. package/esm/utils/gasPriceManager.js.map +1 -0
  196. package/esm/utils/helpers.d.ts +4 -0
  197. package/esm/utils/helpers.js +13 -0
  198. package/esm/utils/helpers.js.map +1 -0
  199. package/esm/utils/index.d.ts +11 -0
  200. package/esm/utils/index.js +10 -0
  201. package/esm/utils/index.js.map +1 -0
  202. package/esm/utils/logger.d.ts +6 -0
  203. package/esm/utils/logger.js +76 -0
  204. package/esm/utils/logger.js.map +1 -0
  205. package/esm/utils/metrics.d.ts +22 -0
  206. package/esm/utils/metrics.js +150 -0
  207. package/esm/utils/metrics.js.map +1 -0
  208. package/esm/utils/rpc-reply.d.ts +17 -0
  209. package/esm/utils/rpc-reply.js +41 -0
  210. package/esm/utils/rpc-reply.js.map +1 -0
  211. package/esm/utils/test.d.ts +17 -0
  212. package/esm/utils/test.js +130 -0
  213. package/esm/utils/test.js.map +1 -0
  214. package/esm/utils/userop.d.ts +49 -0
  215. package/esm/utils/userop.js +408 -0
  216. package/esm/utils/userop.js.map +1 -0
  217. package/esm/utils/validation.d.ts +65 -0
  218. package/esm/utils/validation.js +461 -0
  219. package/esm/utils/validation.js.map +1 -0
  220. package/package.json +70 -66
@@ -0,0 +1 @@
1
+ {"version":3,"file":"senderManager.js","sourceRoot":"","sources":["../../executor/senderManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAIhB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO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C,OAAO,EAAE,EAC5B,gCAAgC,CACnC,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;QAE/D,OAAO,MAAM,CAAA;IACjB,CAAC;IAED,UAAU,CAAC,MAAe;QACtB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAClC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;QACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,EAC5B,iCAAiC,CACpC,CAAA;QACD,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;QAC/D,OAAM;IACV,CAAC;CACJ"}
@@ -0,0 +1,13 @@
1
+ import { type Address, type HexData, UserOperationV06 } from "../../types/index.js";
2
+ import { type Clients } from "../../utils/index.js";
3
+ import { type Account } from "viem";
4
+ export declare const TEST_OP: UserOperationV06;
5
+ export declare function getSender(entryPoint: Address, initCode: HexData, clients: Clients): Promise<Address>;
6
+ export declare function createOp(entryPoint: Address, simpleAccountFactory: Address, signer: Account, clients: Clients, maxFeePerGas?: bigint, nonce?: bigint): Promise<UserOperationV06>;
7
+ export declare const generateAccounts: (clients: Clients) => Promise<(import("viem").CustomSource & {
8
+ address: `0x${string}`;
9
+ publicKey: `0x${string}`;
10
+ source: "privateKey";
11
+ type: "local";
12
+ })[]>;
13
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,75 @@
1
+ import { EntryPointV06Abi } from "../../types/index.js";
2
+ import { SimpleAccountFactoryAbi } from "../../types/index.js";
3
+ import { getUserOpHash, parseSenderAddressError } from "../../utils/index.js";
4
+ import { concat, encodeFunctionData, getContract, parseEther } from "viem";
5
+ import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
6
+ import { foundry } from "viem/chains";
7
+ export const TEST_OP = {
8
+ sender: "0x0000000000000000000000000000000000000000",
9
+ nonce: 0n,
10
+ initCode: "0x",
11
+ callData: "0x",
12
+ callGasLimit: 100000n,
13
+ verificationGasLimit: 1000000n,
14
+ preVerificationGas: 60000n,
15
+ maxFeePerGas: 1n,
16
+ maxPriorityFeePerGas: 1n,
17
+ paymasterAndData: "0x",
18
+ signature: "0x"
19
+ };
20
+ export async function getSender(entryPoint, initCode, clients) {
21
+ const entryPointContract = getContract({
22
+ address: entryPoint,
23
+ abi: EntryPointV06Abi,
24
+ client: {
25
+ public: clients.public
26
+ }
27
+ });
28
+ const sender = await entryPointContract.simulate
29
+ .getSenderAddress([initCode])
30
+ .then((_) => {
31
+ throw new Error("Expected error");
32
+ })
33
+ .catch((e) => {
34
+ return parseSenderAddressError(e);
35
+ });
36
+ await clients.test.setBalance({ address: sender, value: parseEther("1") });
37
+ return sender;
38
+ }
39
+ export async function createOp(entryPoint, simpleAccountFactory, signer, clients, maxFeePerGas, nonce) {
40
+ const initCode = concat([
41
+ simpleAccountFactory,
42
+ encodeFunctionData({
43
+ abi: SimpleAccountFactoryAbi,
44
+ functionName: "createAccount",
45
+ args: [signer.address, 0n]
46
+ })
47
+ ]);
48
+ const sender = await getSender(entryPoint, initCode, clients);
49
+ const op = Object.assign({}, TEST_OP);
50
+ op.sender = sender;
51
+ op.initCode = initCode;
52
+ op.nonce = nonce ?? 0n;
53
+ op.maxFeePerGas = maxFeePerGas ?? (await clients.public.getGasPrice());
54
+ const opHash = getUserOpHash(op, entryPoint, foundry.id);
55
+ const signature = await clients.wallet.signMessage({
56
+ account: signer,
57
+ message: { raw: opHash }
58
+ });
59
+ op.signature = signature;
60
+ return op;
61
+ }
62
+ export const generateAccounts = async (clients) => {
63
+ const accountsPromises = [...Array(10)].map(async (_) => {
64
+ const privateKey = generatePrivateKey();
65
+ const account = privateKeyToAccount(privateKey);
66
+ await clients.test.setBalance({
67
+ address: account.address,
68
+ value: parseEther("100")
69
+ });
70
+ return account;
71
+ });
72
+ const accounts = await Promise.all(accountsPromises);
73
+ return accounts;
74
+ };
75
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../executor/test/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,gBAAgB,EAGnB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAEH,aAAa,EACb,uBAAuB,EAC1B,MAAM,aAAa,CAAA;AACpB,OAAO,EAEH,MAAM,EACN,kBAAkB,EAClB,WAAW,EACX,UAAU,EACb,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,MAAM,CAAC,MAAM,OAAO,GAAqB;IACrC,MAAM,EAAE,4CAA4C;IACpD,KAAK,EAAE,EAAE;IACT,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,OAAQ;IACtB,oBAAoB,EAAE,QAAU;IAChC,kBAAkB,EAAE,MAAO;IAC3B,YAAY,EAAE,EAAE;IAChB,oBAAoB,EAAE,EAAE;IACxB,gBAAgB,EAAE,IAAI;IACtB,SAAS,EAAE,IAAI;CAClB,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAC3B,UAAmB,EACnB,QAAiB,EACjB,OAAgB;IAEhB,MAAM,kBAAkB,GAAG,WAAW,CAAC;QACnC,OAAO,EAAE,UAAU;QACnB,GAAG,EAAE,gBAAgB;QACrB,MAAM,EAAE;YACJ,MAAM,EAAE,OAAO,CAAC,MAAM;SACzB;KACJ,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,QAAQ;SAC3C,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC;SAC5B,IA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G,MAAM,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;QAC/C,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE;KAC3B,CAAC,CAAA;IACF,EAAE,CAAC,SAAS,GAAG,SAAS,CAAA;IAExB,OAAO,EAAE,CAAA;AACb,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAAgB,EAAE,EAAE;IACvD,MAAM,gBAAgB,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QACpD,MAAM,UAAU,GAAG,kBAAkB,EAAE,CAAA;QACvC,MAAM,OAAO,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAA;QAC/C,MAAM,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;YAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC;SAC3B,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAClB,CAAC,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;IACpD,OAAO,QAAQ,CAAA;AACnB,CAAC,CAAA"}
@@ -0,0 +1,32 @@
1
+ import type { InterfaceReputationManager } from "../mempool/index.js";
2
+ import { type BundleResult, type CompressedUserOperation, EntryPointV06Abi, EntryPointV07Abi, type TransactionInfo, type UserOperationWithHash } from "../types/index.js";
3
+ import type { Logger } from "../utils/index.js";
4
+ import { type Account, type Address, type Chain, type GetContractReturnType, type Hex, type PublicClient, type Transport, type WalletClient } from "viem";
5
+ export declare function simulatedOpsToResults(simulatedOps: {
6
+ owh: UserOperationWithHash;
7
+ reason: string | undefined;
8
+ }[], transactionInfo: TransactionInfo): BundleResult[];
9
+ export type DefaultFilterOpsAndEstimateGasParams = {
10
+ ep: GetContractReturnType<typeof EntryPointV06Abi | typeof EntryPointV07Abi, {
11
+ public: PublicClient;
12
+ wallet: WalletClient;
13
+ }>;
14
+ type: "default";
15
+ };
16
+ export type CompressedFilterOpsAndEstimateGasParams = {
17
+ publicClient: PublicClient;
18
+ bundleBulker: Address;
19
+ perOpInflatorId: number;
20
+ type: "compressed";
21
+ };
22
+ export declare function createCompressedCalldata(compressedOps: CompressedUserOperation[], perOpInflatorId: number): Hex;
23
+ export declare function filterOpsAndEstimateGas(entryPoint: Address, callContext: DefaultFilterOpsAndEstimateGasParams | CompressedFilterOpsAndEstimateGasParams, wallet: Account, ops: UserOperationWithHash[], nonce: number, maxFeePerGas: bigint, maxPriorityFeePerGas: bigint, blockTag: "latest" | "pending", onlyPre1559: boolean, fixedGasLimitForEstimation: bigint | undefined, reputationManager: InterfaceReputationManager, logger: Logger): Promise<{
24
+ simulatedOps: {
25
+ owh: UserOperationWithHash;
26
+ reason: string | undefined;
27
+ }[];
28
+ gasLimit: bigint;
29
+ resubmitAllOps: boolean;
30
+ }>;
31
+ export declare function flushStuckTransaction(publicClient: PublicClient, walletClient: WalletClient<Transport, Chain, Account | undefined>, wallet: Account, gasPrice: bigint, logger: Logger, entryPoint: Address): Promise<void>;
32
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,239 @@
1
+ import { EntryPointV06Abi, EntryPointV07Abi, deriveUserOperation, failedOpErrorSchema, failedOpWithRevertErrorSchema } from "../types/index.js";
2
+ import { getRevertErrorData, isVersion06, parseViemError, toPackedUserOperation, transactionIncluded } from "../utils/index.js";
3
+ import * as sentry from "@sentry/node";
4
+ import { ContractFunctionRevertedError, EstimateGasExecutionError, FeeCapTooLowError, concat, decodeErrorResult, hexToBytes, numberToHex } from "viem";
5
+ export function simulatedOpsToResults(simulatedOps, transactionInfo) {
6
+ return simulatedOps.map((sop) => {
7
+ if (sop.reason === undefined) {
8
+ return {
9
+ status: "success",
10
+ value: {
11
+ userOperation: {
12
+ entryPoint: transactionInfo.entryPoint,
13
+ mempoolUserOperation: sop.owh.mempoolUserOperation,
14
+ userOperationHash: sop.owh.userOperationHash,
15
+ lastReplaced: Date.now(),
16
+ firstSubmitted: Date.now()
17
+ },
18
+ transactionInfo
19
+ }
20
+ };
21
+ }
22
+ return {
23
+ status: "failure",
24
+ error: {
25
+ entryPoint: transactionInfo.entryPoint,
26
+ userOpHash: sop.owh.userOperationHash,
27
+ reason: sop.reason
28
+ }
29
+ };
30
+ });
31
+ }
32
+ export function createCompressedCalldata(compressedOps, perOpInflatorId) {
33
+ const bundleBulkerPayload = numberToHex(perOpInflatorId, { size: 4 }); // bytes used in BundleBulker
34
+ const perOpInflatorPayload = numberToHex(compressedOps.length, { size: 1 }); // bytes used in perOpInflator
35
+ return compressedOps.reduce((currentCallData, op) => {
36
+ const nextCallData = concat([
37
+ numberToHex(op.inflatorId, { size: 4 }),
38
+ numberToHex(hexToBytes(op.compressedCalldata).length, {
39
+ size: 2
40
+ }),
41
+ op.compressedCalldata
42
+ ]);
43
+ return concat([currentCallData, nextCallData]);
44
+ }, concat([bundleBulkerPayload, perOpInflatorPayload]));
45
+ }
46
+ export async function filterOpsAndEstimateGas(entryPoint, callContext, wallet, ops, nonce, maxFeePerGas, maxPriorityFeePerGas, blockTag, onlyPre1559, fixedGasLimitForEstimation, reputationManager, logger) {
47
+ const simulatedOps = ops.map((owh) => {
48
+ return { owh, reason: undefined };
49
+ });
50
+ let gasLimit;
51
+ // TODO compressed ops are not supported in V07
52
+ const isUserOpV06 = callContext.type === "default"
53
+ ? isVersion06(simulatedOps[0].owh.mempoolUserOperation)
54
+ : true;
55
+ while (simulatedOps.filter((op) => op.reason === undefined).length > 0) {
56
+ try {
57
+ const gasOptions = onlyPre1559
58
+ ? { gasPrice: maxFeePerGas }
59
+ : { maxFeePerGas, maxPriorityFeePerGas };
60
+ if (callContext.type === "default") {
61
+ const ep = callContext.ep;
62
+ const opsToSend = simulatedOps
63
+ .filter((op) => op.reason === undefined)
64
+ .map((op) => {
65
+ return isUserOpV06
66
+ ? op.owh.mempoolUserOperation
67
+ : toPackedUserOperation(op.owh
68
+ .mempoolUserOperation);
69
+ });
70
+ gasLimit = await ep.estimateGas.handleOps(
71
+ // @ts-ignore - ep is set correctly for opsToSend, but typescript doesn't know that
72
+ [opsToSend, wallet.address], {
73
+ account: wallet,
74
+ nonce: nonce,
75
+ blockTag,
76
+ ...(fixedGasLimitForEstimation !== undefined && {
77
+ gas: fixedGasLimitForEstimation
78
+ }),
79
+ ...gasOptions
80
+ });
81
+ }
82
+ else {
83
+ const { publicClient, bundleBulker, perOpInflatorId } = callContext;
84
+ const opsToSend = simulatedOps
85
+ .filter((op) => op.reason === undefined)
86
+ .map((op) => op.owh
87
+ .mempoolUserOperation);
88
+ gasLimit = await publicClient.estimateGas({
89
+ to: bundleBulker,
90
+ account: wallet,
91
+ data: createCompressedCalldata(opsToSend, perOpInflatorId),
92
+ gas: fixedGasLimitForEstimation,
93
+ nonce: nonce,
94
+ blockTag,
95
+ ...gasOptions
96
+ });
97
+ }
98
+ return { simulatedOps, gasLimit, resubmitAllOps: false };
99
+ }
100
+ catch (err) {
101
+ logger.error({ err }, "error estimating gas");
102
+ const e = parseViemError(err);
103
+ if (e instanceof ContractFunctionRevertedError) {
104
+ const failedOpError = failedOpErrorSchema.safeParse(e.data);
105
+ const failedOpWithRevertError = failedOpWithRevertErrorSchema.safeParse(e.data);
106
+ let errorData = undefined;
107
+ if (failedOpError.success) {
108
+ errorData = failedOpError.data.args;
109
+ }
110
+ if (failedOpWithRevertError.success) {
111
+ errorData = failedOpWithRevertError.data.args;
112
+ }
113
+ if (errorData) {
114
+ logger.debug({
115
+ errorData,
116
+ userOpHashes: simulatedOps
117
+ .filter((op) => op.reason === undefined)
118
+ .map((op) => op.owh.userOperationHash)
119
+ }, "user op in batch invalid");
120
+ const failingOp = simulatedOps.filter((op) => op.reason === undefined)[Number(errorData.opIndex)];
121
+ failingOp.reason = `${errorData.reason}${errorData?.inner
122
+ ? ` - ${errorData.inner}`
123
+ : ""}`;
124
+ reputationManager.crashedHandleOps(deriveUserOperation(failingOp.owh.mempoolUserOperation), entryPoint, failingOp.reason);
125
+ }
126
+ if (!(failedOpError.success || failedOpWithRevertError.success)) {
127
+ sentry.captureException(err);
128
+ logger.error({
129
+ error: `${failedOpError.error} ${failedOpWithRevertError.error}`
130
+ }, "failed to parse failedOpError");
131
+ return {
132
+ simulatedOps: [],
133
+ gasLimit: 0n,
134
+ resubmitAllOps: false
135
+ };
136
+ }
137
+ }
138
+ else if (e instanceof EstimateGasExecutionError ||
139
+ err instanceof EstimateGasExecutionError) {
140
+ if (e?.cause instanceof FeeCapTooLowError) {
141
+ logger.info({ error: e.shortMessage }, "error estimating gas due to max fee < basefee");
142
+ return {
143
+ simulatedOps: simulatedOps,
144
+ gasLimit: 0n,
145
+ resubmitAllOps: true
146
+ };
147
+ }
148
+ try {
149
+ let errorHexData = "0x";
150
+ if (err instanceof EstimateGasExecutionError) {
151
+ errorHexData = getRevertErrorData(err);
152
+ }
153
+ else {
154
+ errorHexData = e?.details.split("Reverted ")[1];
155
+ }
156
+ const errorResult = decodeErrorResult({
157
+ abi: isUserOpV06 ? EntryPointV06Abi : EntryPointV07Abi,
158
+ data: errorHexData
159
+ });
160
+ logger.debug({
161
+ errorName: errorResult.errorName,
162
+ args: errorResult.args,
163
+ userOpHashes: simulatedOps
164
+ .filter((op) => op.reason === undefined)
165
+ .map((op) => op.owh.userOperationHash)
166
+ }, "user op in batch invalid");
167
+ if (errorResult.errorName !== "FailedOp") {
168
+ logger.error({
169
+ errorName: errorResult.errorName,
170
+ args: errorResult.args
171
+ }, "unexpected error result");
172
+ return {
173
+ simulatedOps: [],
174
+ gasLimit: 0n,
175
+ resubmitAllOps: false
176
+ };
177
+ }
178
+ const failingOp = simulatedOps.filter((op) => op.reason === undefined)[Number(errorResult.args[0])];
179
+ failingOp.reason = errorResult.args[1];
180
+ }
181
+ catch (e) {
182
+ logger.error({ error: JSON.stringify(err) }, "failed to parse error result");
183
+ return {
184
+ simulatedOps: [],
185
+ gasLimit: 0n,
186
+ resubmitAllOps: false
187
+ };
188
+ }
189
+ }
190
+ else {
191
+ sentry.captureException(err);
192
+ logger.error({ error: JSON.stringify(err) }, "error estimating gas");
193
+ return { simulatedOps: [], gasLimit: 0n, resubmitAllOps: false };
194
+ }
195
+ }
196
+ }
197
+ return { simulatedOps, gasLimit: 0n, resubmitAllOps: false };
198
+ }
199
+ export async function flushStuckTransaction(publicClient, walletClient, wallet, gasPrice, logger, entryPoint) {
200
+ const latestNonce = await publicClient.getTransactionCount({
201
+ address: wallet.address,
202
+ blockTag: "latest"
203
+ });
204
+ const pendingNonce = await publicClient.getTransactionCount({
205
+ address: wallet.address,
206
+ blockTag: "pending"
207
+ });
208
+ logger.debug({ latestNonce, pendingNonce, wallet: wallet.address }, "checking for stuck transactions");
209
+ // same nonce is okay
210
+ if (latestNonce === pendingNonce) {
211
+ return;
212
+ }
213
+ // one nonce ahead is also okay
214
+ if (latestNonce + 1 === pendingNonce) {
215
+ return;
216
+ }
217
+ logger.info({ latestNonce, pendingNonce, wallet: wallet.address }, "found stuck transaction, flushing");
218
+ for (let nonceToFlush = latestNonce; nonceToFlush < pendingNonce; nonceToFlush++) {
219
+ try {
220
+ const txHash = await walletClient.sendTransaction({
221
+ account: wallet,
222
+ to: wallet.address,
223
+ value: 0n,
224
+ nonce: nonceToFlush,
225
+ maxFeePerGas: gasPrice,
226
+ maxPriorityFeePerGas: gasPrice
227
+ });
228
+ logger.debug({ txHash, nonce: nonceToFlush, wallet: wallet.address }, "flushed stuck transaction");
229
+ // TODO: We don't know if the entrypoint is the V06 or V07. So we try and catch both.
230
+ await transactionIncluded(true, txHash, publicClient, entryPoint);
231
+ await transactionIncluded(false, txHash, publicClient, entryPoint);
232
+ }
233
+ catch (e) {
234
+ sentry.captureException(e);
235
+ logger.warn({ error: e }, "error flushing stuck transaction");
236
+ }
237
+ }
238
+ }
239
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":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YACjE,MAAM,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,CAAA;QACtE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAA;YAC1B,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,kCAAkC,CAAC,CAAA;QACjE,CAAC;IACL,CAAC;AACL,CAAC"}
package/esm/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import "./cli/alto.js";
2
+ //# sourceMappingURL=index.d.ts.map
package/esm/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import "./cli/alto.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from "./mempool.js";
2
+ export * from "./monitoring.js";
3
+ export * from "./reputationManager.js";
4
+ export * from "./nullMempool.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ export * from "./mempool.js";
2
+ export * from "./monitoring.js";
3
+ export * from "./reputationManager.js";
4
+ export * from "./nullMempool.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../mempool/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA"}
@@ -0,0 +1,64 @@
1
+ import type { Metrics } from "../utils/index.js";
2
+ import { type InterfaceValidator, type MempoolUserOperation, type ReferencedCodeHashes, type StorageMap, type SubmittedUserOperation, type TransactionInfo, type UserOperation, type UserOperationInfo } from "../types/index.js";
3
+ import type { HexData32 } from "../types/index.js";
4
+ import type { Logger } from "../utils/index.js";
5
+ import { type Address, type Chain, type PublicClient, type Transport } from "viem";
6
+ import type { Monitor } from "./monitoring.js";
7
+ import { type InterfaceReputationManager } from "./reputationManager.js";
8
+ export declare class MemoryMempool {
9
+ private monitor;
10
+ private publicClient;
11
+ private reputationManager;
12
+ private store;
13
+ private throttledEntityBundleCount;
14
+ private logger;
15
+ private validator;
16
+ private safeMode;
17
+ private parallelUserOpsMaxSize;
18
+ private queuedUserOpsMaxSize;
19
+ private onlyUniqueSendersPerBundle;
20
+ constructor(monitor: Monitor, reputationManager: InterfaceReputationManager, validator: InterfaceValidator, publicClient: PublicClient<Transport, Chain>, safeMode: boolean, logger: Logger, metrics: Metrics, parallelUserOpsMaxSize: number, queuedUserOpsMaxSize: number, onlyUniqueSendersPerBundle: boolean, throttledEntityBundleCount?: number);
21
+ replaceSubmitted(userOperation: UserOperationInfo, transactionInfo: TransactionInfo): void;
22
+ markSubmitted(userOpHash: `0x${string}`, transactionInfo: TransactionInfo): void;
23
+ dumpOutstanding(): UserOperationInfo[];
24
+ dumpProcessing(): UserOperationInfo[];
25
+ dumpSubmittedOps(): SubmittedUserOperation[];
26
+ removeSubmitted(userOpHash: `0x${string}`): void;
27
+ removeProcessing(userOpHash: `0x${string}`): void;
28
+ checkEntityMultipleRoleViolation(op: UserOperation): Promise<void>;
29
+ getKnownEntities(): {
30
+ sender: Set<Address>;
31
+ paymasters: Set<Address>;
32
+ factories: Set<Address>;
33
+ };
34
+ add(mempoolUserOperation: MempoolUserOperation, entryPoint: Address, referencedContracts?: ReferencedCodeHashes): boolean;
35
+ shouldSkip(opInfo: UserOperationInfo, paymasterDeposit: {
36
+ [paymaster: string]: bigint;
37
+ }, stakedEntityCount: {
38
+ [addr: string]: number;
39
+ }, knownEntities: {
40
+ sender: Set<`0x${string}`>;
41
+ paymasters: Set<`0x${string}`>;
42
+ factories: Set<`0x${string}`>;
43
+ }, senders: Set<string>, storageMap: StorageMap): Promise<{
44
+ skip: boolean;
45
+ paymasterDeposit: {
46
+ [paymaster: string]: bigint;
47
+ };
48
+ stakedEntityCount: {
49
+ [addr: string]: number;
50
+ };
51
+ knownEntities: {
52
+ sender: Set<`0x${string}`>;
53
+ paymasters: Set<`0x${string}`>;
54
+ factories: Set<`0x${string}`>;
55
+ };
56
+ senders: Set<string>;
57
+ storageMap: StorageMap;
58
+ }>;
59
+ process(maxGasLimit: bigint, minOps?: number): Promise<UserOperationInfo[]>;
60
+ get(opHash: HexData32): UserOperation | null;
61
+ getQueuedUserOperations(userOperation: UserOperation, entryPoint: Address, _currentNonceValue?: bigint): Promise<UserOperation[]>;
62
+ clear(): void;
63
+ }
64
+ //# sourceMappingURL=mempool.d.ts.map