@pimlico/alto 0.0.0-main.20250430T222110 → 0.0.0-main.20250502T100438

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 (37) hide show
  1. package/esm/cli/config/bundler.d.ts +12 -6
  2. package/esm/cli/config/bundler.js +7 -2
  3. package/esm/cli/config/bundler.js.map +1 -1
  4. package/esm/cli/config/options.js +12 -5
  5. package/esm/cli/config/options.js.map +1 -1
  6. package/esm/executor/executorManager.d.ts +5 -4
  7. package/esm/executor/executorManager.js +22 -21
  8. package/esm/executor/executorManager.js.map +1 -1
  9. package/esm/handlers/gasPriceManager.d.ts +4 -1
  10. package/esm/handlers/gasPriceManager.js +5 -7
  11. package/esm/handlers/gasPriceManager.js.map +1 -1
  12. package/esm/mempool/reputationManager.d.ts +3 -3
  13. package/esm/mempool/reputationManager.js +1 -2
  14. package/esm/mempool/reputationManager.js.map +1 -1
  15. package/esm/rpc/estimation/gasEstimationsV06.js +6 -2
  16. package/esm/rpc/estimation/gasEstimationsV06.js.map +1 -1
  17. package/esm/rpc/methods/eth_estimateUserOperationGas.d.ts +2 -1
  18. package/esm/rpc/methods/eth_estimateUserOperationGas.js +164 -11
  19. package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
  20. package/esm/rpc/methods/eth_sendUserOperation.d.ts +9 -2
  21. package/esm/rpc/methods/eth_sendUserOperation.js +114 -17
  22. package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
  23. package/esm/rpc/methods/pimlico_sendUserOperationNow.js +4 -1
  24. package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -1
  25. package/esm/rpc/rpcHandler.d.ts +7 -33
  26. package/esm/rpc/rpcHandler.js +95 -262
  27. package/esm/rpc/rpcHandler.js.map +1 -1
  28. package/esm/rpc/validation/UnsafeValidator.d.ts +1 -5
  29. package/esm/rpc/validation/UnsafeValidator.js +11 -14
  30. package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
  31. package/esm/types/interfaces.d.ts +1 -5
  32. package/esm/utils/bigInt.d.ts +4 -0
  33. package/esm/utils/bigInt.js +9 -0
  34. package/esm/utils/bigInt.js.map +1 -1
  35. package/esm/utils/validation.js +26 -5
  36. package/esm/utils/validation.js.map +1 -1
  37. package/package.json +1 -1
@@ -16,7 +16,10 @@ export const pimlicoSendUserOperationNowHandler = createMethodHandler({
16
16
  chainId: rpcHandler.config.chainId,
17
17
  publicClient: rpcHandler.config.publicClient
18
18
  });
19
- await rpcHandler.preMempoolChecks(opHash, userOperation, apiVersion, entryPoint);
19
+ const [preMempoolValid, preMempoolError] = await rpcHandler.preMempoolChecks(userOperation, apiVersion);
20
+ if (!preMempoolValid) {
21
+ throw new RpcError(preMempoolError);
22
+ }
20
23
  // Prepare bundle
21
24
  const userOpInfo = {
22
25
  userOp: userOperation,
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico_sendUserOperationNow.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_sendUserOperationNow.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EACpB,WAAW,EACX,yBAAyB,EAC5B,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EACH,QAAQ,EAGR,gBAAgB,EAChB,iCAAiC,EACpC,MAAM,aAAa,CAAA;AAEpB,MAAM,CAAC,MAAM,kCAAkC,GAAG,mBAAmB,CAAC;IAClE,MAAM,EAAE,8BAA8B;IACtC,MAAM,EAAE,iCAAiC;IACzC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE;QAClD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC;YACnD,MAAM,IAAI,QAAQ,CACd,sDAAsD,EACtD,gBAAgB,CAAC,aAAa,CACjC,CAAA;QACL,CAAC;QAED,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,G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J,CAAC,CAAA"}
@@ -1,10 +1,9 @@
1
1
  import { type Executor, type ExecutorManager } from "../executor/index.js";
2
2
  import type { EventManager, GasPriceManager } from "../handlers/index.js";
3
3
  import type { InterfaceReputationManager, Mempool, Monitor } from "../mempool/index.js";
4
- import type { ApiVersion, BundlerRequest, StateOverrides } from "../types/index.js";
4
+ import type { ApiVersion, BundlerRequest } from "../types/index.js";
5
5
  import { type Address, type InterfaceValidator, type UserOperation } from "../types/index.js";
6
6
  import type { Logger, Metrics } from "../utils/index.js";
7
- import { type Hex } from "viem";
8
7
  import type { AltoConfig } from "../createConfig.js";
9
8
  import type { MethodHandler } from "./createMethodHandler.js";
10
9
  export declare class RpcHandler {
@@ -37,39 +36,14 @@ export declare class RpcHandler {
37
36
  handleMethod(request: BundlerRequest, apiVersion: ApiVersion): Promise<any>;
38
37
  ensureEntryPointIsSupported(entryPoint: Address): void;
39
38
  ensureDebugEndpointsAreEnabled(methodName: string): void;
40
- preMempoolChecks(opHash: Hex, userOperation: UserOperation, apiVersion: ApiVersion, entryPoint: Address): Promise<void>;
41
- addToMempoolIfValid(userOperation: UserOperation, entryPoint: Address, apiVersion: ApiVersion): Promise<"added" | "queued">;
39
+ preMempoolChecks(userOperation: UserOperation, apiVersion: ApiVersion): Promise<[boolean, string]>;
42
40
  validateEip7702Auth({ userOperation, validateSender }: {
43
41
  userOperation: UserOperation;
44
42
  validateSender?: boolean;
45
- }): Promise<void>;
46
- getNonceValue(userOperation: UserOperation, entryPoint: Address): Promise<bigint>;
47
- estimateGas({ apiVersion, userOperation, entryPoint, stateOverrides }: {
48
- apiVersion: ApiVersion;
49
- userOperation: UserOperation;
50
- entryPoint: Address;
51
- stateOverrides?: StateOverrides;
52
- }): Promise<{
53
- preVerificationGas: bigint;
54
- verificationGasLimit: bigint;
55
- callGasLimit: bigint;
56
- paymasterVerificationGasLimit: bigint;
57
- paymasterPostOpGasLimit: bigint;
58
- verificationGas?: undefined;
59
- } | {
60
- preVerificationGas: bigint;
61
- verificationGasLimit: bigint;
62
- callGasLimit: bigint;
63
- paymasterVerificationGasLimit?: undefined;
64
- paymasterPostOpGasLimit?: undefined;
65
- verificationGas?: undefined;
66
- } | {
67
- preVerificationGas: bigint;
68
- verificationGas: bigint;
69
- verificationGasLimit: bigint;
70
- callGasLimit: bigint;
71
- paymasterVerificationGasLimit?: undefined;
72
- paymasterPostOpGasLimit?: undefined;
73
- }>;
43
+ }): Promise<[
44
+ boolean,
45
+ string
46
+ ]>;
47
+ getNonceSeq(userOperation: UserOperation, entryPoint: Address): Promise<bigint>;
74
48
  }
75
49
  //# sourceMappingURL=rpcHandler.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { calculateAA95GasFloor } from "../executor/index.js";
2
2
  import { EntryPointV06Abi, EntryPointV07Abi, RpcError, ValidationErrors } from "../types/index.js";
3
- import { calcPreVerificationGas, calcVerificationGasAndCallGasLimit, deepHexlify, getAAError, getNonceKeyAndSequence, getUserOperationHash, isVersion06, isVersion07, maxBigInt, scaleBigIntByPercent } from "../utils/index.js";
3
+ import { getNonceKeyAndSequence, isVersion06, isVersion07 } from "../utils/index.js";
4
4
  import { getContract, zeroAddress } from "viem";
5
5
  import { registerHandlers } from "./methods/index.js";
6
6
  import { recoverAuthorizationAddress } from "viem/utils";
@@ -61,168 +61,145 @@ export class RpcHandler {
61
61
  throw new RpcError(`${methodName} is only available in development environment`);
62
62
  }
63
63
  }
64
- async preMempoolChecks(opHash, userOperation, apiVersion, entryPoint) {
64
+ async preMempoolChecks(userOperation, apiVersion) {
65
65
  if (this.config.legacyTransactions &&
66
66
  userOperation.maxFeePerGas !== userOperation.maxPriorityFeePerGas) {
67
- const reason = "maxPriorityFeePerGas must equal maxFeePerGas on chains that don't support EIP-1559";
68
- this.eventManager.emitFailedValidation(opHash, reason);
69
- throw new RpcError(reason);
67
+ return [
68
+ false,
69
+ "maxPriorityFeePerGas must equal maxFeePerGas on chains that don't support EIP-1559"
70
+ ];
70
71
  }
71
72
  if (apiVersion !== "v1" && !this.config.safeMode) {
72
- await this.gasPriceManager.validateGasPrice({
73
- maxFeePerGas: userOperation.maxFeePerGas,
74
- maxPriorityFeePerGas: userOperation.maxPriorityFeePerGas
75
- });
73
+ const { lowestMaxFeePerGas, lowestMaxPriorityFeePerGas } = await this.gasPriceManager.getLowestValidGasPrices();
74
+ const maxFeePerGas = userOperation.maxFeePerGas;
75
+ const maxPriorityFeePerGas = userOperation.maxPriorityFeePerGas;
76
+ if (maxFeePerGas < lowestMaxFeePerGas) {
77
+ return [
78
+ false,
79
+ `maxFeePerGas must be at least ${lowestMaxFeePerGas} (current maxFeePerGas: ${maxFeePerGas}) - use pimlico_getUserOperationGasPrice to get the current gas price`
80
+ ];
81
+ }
82
+ if (maxPriorityFeePerGas < lowestMaxPriorityFeePerGas) {
83
+ return [
84
+ false,
85
+ `maxPriorityFeePerGas must be at least ${lowestMaxPriorityFeePerGas} (current maxPriorityFeePerGas: ${maxPriorityFeePerGas}) - use pimlico_getUserOperationGasPrice to get the current gas price`
86
+ ];
87
+ }
76
88
  }
77
89
  if (userOperation.verificationGasLimit < 10000n) {
78
- const reason = "verificationGasLimit must be at least 10000";
79
- this.eventManager.emitFailedValidation(opHash, reason);
80
- throw new RpcError(reason);
90
+ return [false, "verificationGasLimit must be at least 10000"];
81
91
  }
82
- this.logger.trace({ userOperation, entryPoint }, "beginning validation");
83
92
  if (userOperation.preVerificationGas === 0n ||
84
93
  userOperation.verificationGasLimit === 0n) {
85
- const reason = "user operation gas limits must be larger than 0";
86
- this.eventManager.emitFailedValidation(opHash, reason);
87
- throw new RpcError(reason);
94
+ return [false, "user operation gas limits must be larger than 0"];
88
95
  }
89
- const beneficiary = this.config.utilityPrivateKey?.address ||
90
- privateKeyToAddress(generatePrivateKey());
91
96
  const gasLimits = calculateAA95GasFloor({
92
97
  userOps: [userOperation],
93
- beneficiary
98
+ beneficiary: privateKeyToAddress(generatePrivateKey())
94
99
  });
95
100
  if (gasLimits > this.config.maxGasPerBundle) {
96
- throw new RpcError(`User operation gas limits exceed the max gas per bundle: ${gasLimits} > ${this.config.maxGasPerBundle}`);
101
+ return [
102
+ false,
103
+ `User operation gas limits exceed the max gas per bundle: ${gasLimits} > ${this.config.maxGasPerBundle}`
104
+ ];
97
105
  }
98
- }
99
- // check if we want to bundle userOperation. If yes, add to mempool
100
- async addToMempoolIfValid(userOperation, entryPoint, apiVersion) {
101
- this.ensureEntryPointIsSupported(entryPoint);
102
- const opHash = await getUserOperationHash({
103
- userOperation: userOperation,
104
- entryPointAddress: entryPoint,
105
- chainId: this.config.chainId,
106
- publicClient: this.config.publicClient
107
- });
108
- await this.preMempoolChecks(opHash, userOperation, apiVersion, entryPoint);
109
- const currentNonceValue = await this.getNonceValue(userOperation, entryPoint);
110
- const [, userOperationNonceValue] = getNonceKeyAndSequence(userOperation.nonce);
111
- if (userOperationNonceValue < currentNonceValue) {
112
- const reason = "UserOperation failed validation with reason: AA25 invalid account nonce";
113
- this.eventManager.emitFailedValidation(opHash, reason, "AA25");
114
- throw new RpcError(reason, ValidationErrors.InvalidFields);
115
- }
116
- if (userOperationNonceValue > currentNonceValue + 10n) {
117
- const reason = "UserOperation failed validaiton with reason: AA25 invalid account nonce";
118
- this.eventManager.emitFailedValidation(opHash, reason, "AA25");
119
- throw new RpcError(reason, ValidationErrors.InvalidFields);
120
- }
121
- const queuedUserOperations = await this.mempool.getQueuedOustandingUserOps({
122
- userOp: userOperation,
123
- entryPoint
124
- });
125
- if (userOperationNonceValue >
126
- currentNonceValue + BigInt(queuedUserOperations.length)) {
127
- this.mempool.add(userOperation, entryPoint);
128
- this.eventManager.emitQueued(opHash);
129
- return "queued";
130
- }
131
- if (this.config.dangerousSkipUserOperationValidation) {
132
- const [success, errorReason] = await this.mempool.add(userOperation, entryPoint);
133
- if (!success) {
134
- this.eventManager.emitFailedValidation(opHash, errorReason, getAAError(errorReason));
135
- throw new RpcError(errorReason, ValidationErrors.InvalidFields);
136
- }
137
- return "added";
138
- }
139
- if (apiVersion !== "v1") {
140
- await this.validator.validatePreVerificationGas({
141
- userOperation,
142
- entryPoint
143
- });
144
- }
145
- await this.mempool.checkEntityMultipleRoleViolation(entryPoint, userOperation);
146
- const validationResult = await this.validator.validateUserOperation({
147
- userOperation,
148
- queuedUserOperations,
149
- entryPoint
150
- });
151
- await this.reputationManager.checkReputation(userOperation, entryPoint, validationResult);
152
- await this.mempool.checkEntityMultipleRoleViolation(entryPoint, userOperation);
153
- const [success, errorReason] = await this.mempool.add(userOperation, entryPoint, validationResult.referencedContracts);
154
- if (!success) {
155
- this.eventManager.emitFailedValidation(opHash, errorReason, getAAError(errorReason));
156
- throw new RpcError(errorReason, ValidationErrors.InvalidFields);
157
- }
158
- return "added";
106
+ return [true, ""];
159
107
  }
160
108
  async validateEip7702Auth({ userOperation, validateSender = false }) {
161
109
  if (!userOperation.eip7702Auth) {
162
- throw new RpcError("UserOperation is missing eip7702Auth", ValidationErrors.InvalidFields);
110
+ return [true, ""];
163
111
  }
164
112
  if (!this.config.codeOverrideSupport) {
165
- throw new RpcError("eip7702Auth is not supported on this chain", ValidationErrors.InvalidFields);
113
+ return [false, "eip7702Auth is not supported on this chain"];
166
114
  }
167
115
  // Check that auth is valid.
168
- const sender = validateSender
169
- ? await recoverAuthorizationAddress({
170
- authorization: {
171
- address: "address" in userOperation.eip7702Auth
172
- ? userOperation.eip7702Auth.address
173
- : userOperation.eip7702Auth.contractAddress,
174
- chainId: userOperation.eip7702Auth.chainId,
175
- nonce: userOperation.eip7702Auth.nonce,
176
- r: userOperation.eip7702Auth.r,
177
- s: userOperation.eip7702Auth.s,
178
- v: userOperation.eip7702Auth.v,
179
- yParity: userOperation.eip7702Auth.yParity
180
- }
181
- })
182
- : userOperation.sender;
183
- const nonceOnChain = await this.config.publicClient.getTransactionCount({
184
- address: sender
185
- });
116
+ const delegationDesignator = "address" in userOperation.eip7702Auth
117
+ ? userOperation.eip7702Auth.address
118
+ : userOperation.eip7702Auth.contractAddress;
119
+ // Fetch onchain data in parallel
120
+ const [sender, nonceOnChain, delegateCode] = await Promise.all([
121
+ validateSender
122
+ ? recoverAuthorizationAddress({
123
+ authorization: {
124
+ address: delegationDesignator,
125
+ chainId: userOperation.eip7702Auth.chainId,
126
+ nonce: userOperation.eip7702Auth.nonce,
127
+ r: userOperation.eip7702Auth.r,
128
+ s: userOperation.eip7702Auth.s,
129
+ v: userOperation.eip7702Auth.v,
130
+ yParity: userOperation.eip7702Auth.yParity
131
+ }
132
+ })
133
+ : Promise.resolve(userOperation.sender),
134
+ this.config.publicClient.getTransactionCount({
135
+ address: userOperation.sender
136
+ }),
137
+ this.eip7702CodeCache.has(delegationDesignator)
138
+ ? Promise.resolve("has-code")
139
+ : this.config.publicClient.getCode({
140
+ address: delegationDesignator
141
+ })
142
+ ]);
186
143
  if (userOperation.eip7702Auth.chainId !== this.config.chainId &&
187
144
  userOperation.eip7702Auth.chainId !== 0) {
188
- throw new RpcError("Invalid EIP-7702 authorization: The chainId does not match the userOperation sender address", ValidationErrors.InvalidFields);
145
+ return [
146
+ false,
147
+ "Invalid EIP-7702 authorization: The chainId does not match the userOperation sender address"
148
+ ];
189
149
  }
190
150
  if (![0, 1].includes(userOperation.eip7702Auth.yParity)) {
191
- throw new RpcError("Invalid EIP-7702 authorization: The yParity value must be either 0 or 1", ValidationErrors.InvalidFields);
151
+ return [
152
+ false,
153
+ "Invalid EIP-7702 authorization: The yParity value must be either 0 or 1"
154
+ ];
192
155
  }
193
156
  if (nonceOnChain !== userOperation.eip7702Auth.nonce) {
194
- throw new RpcError("Invalid EIP-7702 authorization: The nonce does not match the userOperation sender address", ValidationErrors.SimulateValidation);
157
+ return [
158
+ false,
159
+ "Invalid EIP-7702 authorization: The nonce does not match the userOperation sender address"
160
+ ];
195
161
  }
196
162
  if (sender !== userOperation.sender) {
197
- throw new RpcError("Invalid EIP-7702 authorization: The recovered signer address does not match the userOperation sender address", ValidationErrors.InvalidFields);
163
+ return [
164
+ false,
165
+ "Invalid EIP-7702 authorization: The recovered signer address does not match the userOperation sender address"
166
+ ];
198
167
  }
199
168
  if (isVersion06(userOperation) && userOperation.initCode !== "0x") {
200
- throw new RpcError("Invalid EIP-7702 authorization: UserOperation cannot contain initCode.", ValidationErrors.InvalidFields);
169
+ return [
170
+ false,
171
+ "Invalid EIP-7702 authorization: UserOperation cannot contain initCode."
172
+ ];
201
173
  }
202
174
  if (isVersion07(userOperation) &&
203
175
  userOperation.factory !== "0x7702" &&
204
176
  userOperation.factory !== null) {
205
- throw new RpcError("Invalid EIP-7702 authorization: UserOperation cannot contain factory that is neither null or 0x7702.", ValidationErrors.InvalidFields);
177
+ return [
178
+ false,
179
+ "Invalid EIP-7702 authorization: UserOperation cannot contain factory that is neither null or 0x7702."
180
+ ];
206
181
  }
207
182
  // Check delegation designator
208
- const delegationDesignator = "address" in userOperation.eip7702Auth
209
- ? userOperation.eip7702Auth.address
210
- : userOperation.eip7702Auth.contractAddress;
211
183
  if (delegationDesignator === zeroAddress) {
212
- throw new RpcError("Invalid EIP-7702 authorization: Cannot delegate to the zero address.", ValidationErrors.InvalidFields);
184
+ return [
185
+ false,
186
+ "Invalid EIP-7702 authorization: Cannot delegate to the zero address."
187
+ ];
213
188
  }
189
+ // Use the delegateCode we already got from Promise.all
214
190
  const hasCode = this.eip7702CodeCache.has(delegationDesignator);
215
191
  if (!hasCode) {
216
- const delegateCode = await this.config.publicClient.getCode({
217
- address: delegationDesignator
218
- });
219
192
  if (delegateCode === undefined || delegateCode === "0x") {
220
- throw new RpcError(`Invalid EIP-7702 authorization: Delegate ${delegationDesignator} has no code.`, ValidationErrors.InvalidFields);
193
+ return [
194
+ false,
195
+ `Invalid EIP-7702 authorization: Delegate ${delegationDesignator} has no code.`
196
+ ];
221
197
  }
222
198
  this.eip7702CodeCache.set(delegationDesignator, true);
223
199
  }
200
+ return [true, ""];
224
201
  }
225
- async getNonceValue(userOperation, entryPoint) {
202
+ async getNonceSeq(userOperation, entryPoint) {
226
203
  const entryPointContract = getContract({
227
204
  address: entryPoint,
228
205
  abi: isVersion06(userOperation)
@@ -236,152 +213,8 @@ export class RpcHandler {
236
213
  const getNonceResult = await entryPointContract.read.getNonce([userOperation.sender, nonceKey], {
237
214
  blockTag: "latest"
238
215
  });
239
- const [_, currentNonceValue] = getNonceKeyAndSequence(getNonceResult);
240
- return currentNonceValue;
241
- }
242
- async estimateGas({ apiVersion, userOperation, entryPoint, stateOverrides }) {
243
- this.ensureEntryPointIsSupported(entryPoint);
244
- if (userOperation.maxFeePerGas === 0n && !this.config.isGasFreeChain) {
245
- throw new RpcError("user operation max fee per gas must be larger than 0 during gas estimation");
246
- }
247
- // Check if the nonce is valid
248
- // If the nonce is less than the current nonce, the user operation has already been executed
249
- // If the nonce is greater than the current nonce, we may have missing user operations in the mempool
250
- const currentNonceValue = await this.getNonceValue(userOperation, entryPoint);
251
- const [, userOperationNonceValue] = getNonceKeyAndSequence(userOperation.nonce);
252
- let queuedUserOperations = [];
253
- if (userOperationNonceValue < currentNonceValue) {
254
- throw new RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", ValidationErrors.InvalidFields);
255
- }
256
- if (userOperationNonceValue > currentNonceValue) {
257
- // Nonce queues are supported only for v7 user operations
258
- if (isVersion06(userOperation)) {
259
- throw new RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", ValidationErrors.InvalidFields);
260
- }
261
- queuedUserOperations =
262
- await this.mempool.getQueuedOustandingUserOps({
263
- userOp: userOperation,
264
- entryPoint
265
- });
266
- if (userOperationNonceValue >
267
- currentNonceValue + BigInt(queuedUserOperations.length)) {
268
- throw new RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", ValidationErrors.InvalidFields);
269
- }
270
- }
271
- // Prepare userOperation for simulation
272
- const { simulationVerificationGasLimit, simulationCallGasLimit, simulationPaymasterVerificationGasLimit, simulationPaymasterPostOpGasLimit } = this.config;
273
- const simulationUserOperation = {
274
- ...userOperation,
275
- maxFeePerGas: 1n,
276
- maxPriorityFeePerGas: 1n,
277
- preVerificationGas: 0n,
278
- verificationGasLimit: simulationVerificationGasLimit,
279
- callGasLimit: simulationCallGasLimit
280
- };
281
- if (isVersion07(simulationUserOperation)) {
282
- simulationUserOperation.paymasterVerificationGasLimit =
283
- simulationPaymasterVerificationGasLimit;
284
- simulationUserOperation.paymasterPostOpGasLimit =
285
- simulationPaymasterPostOpGasLimit;
286
- }
287
- // This is necessary because entryPoint pays
288
- // min(maxFeePerGas, baseFee + maxPriorityFeePerGas) for the verification
289
- // Since we don't want our estimations to depend upon baseFee, we set
290
- // maxFeePerGas to maxPriorityFeePerGas
291
- simulationUserOperation.maxPriorityFeePerGas =
292
- simulationUserOperation.maxFeePerGas;
293
- const executionResult = await this.validator.getExecutionResult({
294
- userOperation: simulationUserOperation,
295
- entryPoint,
296
- queuedUserOperations,
297
- stateOverrides: deepHexlify(stateOverrides)
298
- });
299
- let { verificationGasLimit, callGasLimit, paymasterVerificationGasLimit } = calcVerificationGasAndCallGasLimit(simulationUserOperation, executionResult.data.executionResult, executionResult.data);
300
- let paymasterPostOpGasLimit = 0n;
301
- if (!paymasterVerificationGasLimit &&
302
- isVersion07(simulationUserOperation) &&
303
- simulationUserOperation.paymaster !== null &&
304
- "paymasterVerificationGasLimit" in
305
- executionResult.data.executionResult) {
306
- paymasterVerificationGasLimit =
307
- executionResult.data.executionResult
308
- .paymasterVerificationGasLimit || 1n;
309
- paymasterVerificationGasLimit = scaleBigIntByPercent(paymasterVerificationGasLimit, this.config.paymasterGasLimitMultiplier);
310
- }
311
- if (isVersion07(simulationUserOperation) &&
312
- simulationUserOperation.paymaster !== null &&
313
- "paymasterPostOpGasLimit" in executionResult.data.executionResult) {
314
- paymasterPostOpGasLimit =
315
- executionResult.data.executionResult.paymasterPostOpGasLimit ||
316
- 1n;
317
- const userOperationPaymasterPostOpGasLimit = "paymasterPostOpGasLimit" in userOperation
318
- ? userOperation.paymasterPostOpGasLimit ?? 1n
319
- : 1n;
320
- paymasterPostOpGasLimit = maxBigInt(userOperationPaymasterPostOpGasLimit, scaleBigIntByPercent(paymasterPostOpGasLimit, this.config.paymasterGasLimitMultiplier));
321
- }
322
- if (simulationUserOperation.callData === "0x") {
323
- callGasLimit = 0n;
324
- }
325
- if (isVersion06(simulationUserOperation)) {
326
- callGasLimit = scaleBigIntByPercent(callGasLimit, this.config.v6CallGasLimitMultiplier);
327
- verificationGasLimit = scaleBigIntByPercent(verificationGasLimit, this.config.v6VerificationGasLimitMultiplier);
328
- }
329
- if (isVersion07(simulationUserOperation)) {
330
- verificationGasLimit = scaleBigIntByPercent(verificationGasLimit, this.config.v7VerificationGasLimitMultiplier);
331
- paymasterVerificationGasLimit = scaleBigIntByPercent(paymasterVerificationGasLimit, this.config.v7PaymasterVerificationGasLimitMultiplier);
332
- callGasLimit = scaleBigIntByPercent(callGasLimit, this.config.v7CallGasLimitMultiplier);
333
- paymasterPostOpGasLimit = scaleBigIntByPercent(paymasterPostOpGasLimit, this.config.v7PaymasterPostOpGasLimitMultiplier);
334
- }
335
- let preVerificationGas = await calcPreVerificationGas({
336
- config: this.config,
337
- userOperation: {
338
- ...userOperation,
339
- callGasLimit, // use actual callGasLimit
340
- verificationGasLimit, // use actual verificationGasLimit
341
- paymasterPostOpGasLimit, // use actual paymasterPostOpGasLimit
342
- paymasterVerificationGasLimit // use actual paymasterVerificationGasLimit
343
- },
344
- entryPoint,
345
- gasPriceManager: this.gasPriceManager,
346
- validate: false
347
- });
348
- preVerificationGas = scaleBigIntByPercent(preVerificationGas, 110n);
349
- // Check if userOperation passes without estimation balance overrides
350
- await this.validator.validateHandleOp({
351
- userOperation: {
352
- ...userOperation,
353
- preVerificationGas,
354
- verificationGasLimit,
355
- callGasLimit,
356
- paymasterVerificationGasLimit,
357
- paymasterPostOpGasLimit
358
- },
359
- entryPoint,
360
- queuedUserOperations,
361
- stateOverrides: deepHexlify(stateOverrides)
362
- });
363
- if (isVersion07(simulationUserOperation)) {
364
- return {
365
- preVerificationGas,
366
- verificationGasLimit,
367
- callGasLimit,
368
- paymasterVerificationGasLimit,
369
- paymasterPostOpGasLimit
370
- };
371
- }
372
- if (apiVersion === "v2") {
373
- return {
374
- preVerificationGas,
375
- verificationGasLimit,
376
- callGasLimit
377
- };
378
- }
379
- return {
380
- preVerificationGas,
381
- verificationGas: verificationGasLimit,
382
- verificationGasLimit,
383
- callGasLimit
384
- };
216
+ const [_, currentNonceSeq] = getNonceKeyAndSequence(getNonceResult);
217
+ return currentNonceSeq;
385
218
  }
386
219
  }
387
220
  //# sourceMappingURL=rpcHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rpcHandler.js","sourceRoot":"","sources":["../../rpc/rpcHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EAGxB,MAAM,gBAAgB,CAAA;AAQvB,OAAO,EAEH,gBAAgB,EAChB,gBAAgB,EAEhB,QAAQ,EAER,gBAAgB,EACnB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACH,sBAAsB,EACtB,kCAAkC,EAClC,WAAW,EACX,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,SAAS,EACT,oBAAoB,EACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAY,WAAW,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAGzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvE,MAAM,OAAO,UAAU;IACZ,MAAM,CAAY;IAClB,SAAS,CAAoB;IAC7B,OAAO,CAAS;IAChB,QAAQ,CAAU;IAClB,OAAO,CAAS;IAChB,eAAe,CAAiB;IAChC,iBAAiB,CAA4B;IAC7C,OAAO,CAAS;IAChB,YAAY,CAAc;IAC1B,eAAe,CAAiB;IAChC,MAAM,CAAQ;IAEb,cAAc,CAA4B;IAC1C,gBAAgB,CAAuB;I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;gBACJ,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY;aACnC;SACJ,CAAC,CAAA;QAEF,MAAM,CAAC,QAAQ,CAAC,GAAG,sBAAsB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAE9D,MAAM,cAAc,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CACzD,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,EAChC;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"}
@@ -28,7 +28,7 @@ export declare class UnsafeValidator implements InterfaceValidator {
28
28
  entryPoint: Address;
29
29
  queuedUserOperations: UserOperation[];
30
30
  stateOverrides?: StateOverrides;
31
- }): Promise<SimulateHandleOpResult<"execution">>;
31
+ }): Promise<SimulateHandleOpResult<"execution" | "failed">>;
32
32
  getValidationResultV06({ userOperation, entryPoint }: {
33
33
  userOperation: UserOperationV06;
34
34
  entryPoint: Address;
@@ -80,10 +80,6 @@ export declare class UnsafeValidator implements InterfaceValidator {
80
80
  storageMap: StorageMap;
81
81
  referencedContracts?: ReferencedCodeHashes;
82
82
  }>;
83
- validatePreVerificationGas({ userOperation, entryPoint }: {
84
- userOperation: UserOperation;
85
- entryPoint: Address;
86
- }): Promise<void>;
87
83
  validateUserOperation({ userOperation, queuedUserOperations, entryPoint }: {
88
84
  userOperation: UserOperation;
89
85
  queuedUserOperations: UserOperation[];
@@ -1,5 +1,5 @@
1
1
  import { EntryPointV06Abi, ExecutionErrors, RpcError, ValidationErrors, entryPointExecutionErrorSchemaV06, entryPointExecutionErrorSchemaV07 } from "../../types/index.js";
2
- import { calcPreVerificationGas, isVersion06 } from "../../utils/index.js";
2
+ import { isVersion06 } from "../../utils/index.js";
3
3
  import * as sentry from "@sentry/node";
4
4
  import { BaseError, ContractFunctionExecutionError, getContract, pad, slice, toHex, zeroAddress } from "viem";
5
5
  import { fromZodError } from "zod-validation-error";
@@ -91,8 +91,17 @@ export class UnsafeValidator {
91
91
  let errorCode = ExecutionErrors.UserOperationReverted;
92
92
  if (error.data.toString().includes("AA23")) {
93
93
  errorCode = ValidationErrors.SimulateValidation;
94
+ return {
95
+ result: "failed",
96
+ data: error.data,
97
+ code: errorCode
98
+ };
94
99
  }
95
- throw new RpcError(`UserOperation reverted during simulation with reason: ${error.data}`, errorCode);
100
+ return {
101
+ result: "failed",
102
+ data: `UserOperation reverted during simulation with reason: ${error.data}`,
103
+ code: errorCode
104
+ };
96
105
  }
97
106
  return error;
98
107
  }
@@ -244,18 +253,6 @@ export class UnsafeValidator {
244
253
  entryPoint
245
254
  });
246
255
  }
247
- async validatePreVerificationGas({ userOperation, entryPoint }) {
248
- const preVerificationGas = await calcPreVerificationGas({
249
- config: this.config,
250
- userOperation,
251
- entryPoint,
252
- gasPriceManager: this.gasPriceManager,
253
- validate: true
254
- });
255
- if (preVerificationGas > userOperation.preVerificationGas) {
256
- throw new RpcError(`preVerificationGas is not enough, required: ${preVerificationGas}, got: ${userOperation.preVerificationGas}`, ValidationErrors.SimulateValidation);
257
- }
258
- }
259
256
  async validateUserOperation({ userOperation, queuedUserOperations, entryPoint }) {
260
257
  try {
261
258
  const validationResult = await this.getValidationResult({