@pimlico/alto 0.0.0-main.20250626T085447 → 0.0.0-main.20250627T074103
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.
- package/contracts/EIP712.sol/EIP712.json +1 -1
- package/contracts/Eip7702Support.sol/Eip7702Support.json +1 -1
- package/contracts/EntryPoint.sol/EntryPoint.json +1 -1
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
- package/contracts/Exec.sol/Exec.json +1 -1
- package/contracts/IAccount.sol/IAccount.json +1 -1
- package/contracts/IAccountExecute.sol/IAccountExecute.json +1 -1
- package/contracts/IAggregator.sol/IAggregator.json +1 -1
- package/contracts/IERC5267.sol/IERC5267.json +1 -1
- package/contracts/IEntryPoint.sol/IEntryPoint.json +1 -1
- package/contracts/IEntryPointSimulations.sol/IEntryPointSimulations.json +1 -1
- package/contracts/INonceManager.sol/INonceManager.json +1 -1
- package/contracts/IPaymaster.sol/IPaymaster.json +1 -1
- package/contracts/ISenderCreator.sol/ISenderCreator.json +1 -1
- package/contracts/IStakeManager.sol/IStakeManager.json +1 -1
- package/contracts/Math.sol/Math.json +1 -1
- package/contracts/MessageHashUtils.sol/MessageHashUtils.json +1 -1
- package/contracts/NonceManager.sol/NonceManager.json +1 -1
- package/contracts/Panic.sol/Panic.json +1 -1
- package/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
- package/contracts/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.json +1 -1
- package/contracts/SafeCast.sol/SafeCast.json +1 -1
- package/contracts/SenderCreator.sol/SenderCreator.json +1 -1
- package/contracts/ShortStrings.sol/ShortStrings.json +1 -1
- package/contracts/SignedMath.sol/SignedMath.json +1 -1
- package/contracts/StakeManager.sol/StakeManager.json +1 -1
- package/contracts/StorageSlot.sol/StorageSlot.json +1 -1
- package/contracts/Strings.sol/Strings.json +1 -1
- package/contracts/TransientSlot.sol/TransientSlot.json +1 -1
- package/contracts/UserOperationLib.sol/UserOperationLib.json +1 -1
- package/contracts/build-info/004071c167bc55de.json +1 -0
- package/contracts/build-info/{257ff8e2b1124ead.json → 2f5dec90e180c3a0.json} +1 -1
- package/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -1
- package/esm/cli/customTransport.js +3 -2
- package/esm/cli/customTransport.js.map +1 -1
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
- package/esm/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
- package/esm/executor/filterOpsAndEstimateGas.js +4 -4
- package/esm/executor/utils.js +3 -0
- package/esm/executor/utils.js.map +1 -1
- package/esm/rpc/estimation/gasEstimationHandler.d.ts +2 -2
- package/esm/rpc/estimation/gasEstimationHandler.js +6 -6
- package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
- package/esm/rpc/estimation/{gasEstimationsV06.d.ts → gasEstimations06.d.ts} +4 -4
- package/esm/rpc/estimation/gasEstimations06.js +68 -0
- package/esm/rpc/estimation/gasEstimations06.js.map +1 -0
- package/esm/rpc/estimation/gasEstimations07.d.ts +89 -0
- package/esm/rpc/estimation/gasEstimations07.js +386 -0
- package/esm/rpc/estimation/gasEstimations07.js.map +1 -0
- package/esm/rpc/estimation/types.d.ts +23 -111
- package/esm/rpc/estimation/types.js +5 -121
- package/esm/rpc/estimation/types.js.map +1 -1
- package/esm/rpc/estimation/utils.d.ts +51 -0
- package/esm/rpc/estimation/utils.js +182 -0
- package/esm/rpc/estimation/utils.js.map +1 -0
- package/esm/rpc/methods/eth_estimateUserOperationGas.js +4 -5
- package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
- package/esm/rpc/validation/SafeValidator.d.ts +5 -5
- package/esm/rpc/validation/SafeValidator.js +28 -29
- package/esm/rpc/validation/SafeValidator.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +2 -2
- package/esm/rpc/validation/UnsafeValidator.js +2 -2
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/types/contracts/PimlicoSimulations.d.ts +1083 -96
- package/esm/types/contracts/PimlicoSimulations.js +1357 -88
- package/esm/types/contracts/PimlicoSimulations.js.map +1 -1
- package/esm/types/contracts/index.d.ts +0 -2
- package/esm/types/contracts/index.js +0 -2
- package/esm/types/contracts/index.js.map +1 -1
- package/esm/types/interfaces.d.ts +2 -2
- package/esm/types/validation.d.ts +208 -222
- package/esm/types/validation.js +0 -8
- package/esm/types/validation.js.map +1 -1
- package/esm/utils/toViemStateOverrides.d.ts +4 -0
- package/esm/utils/toViemStateOverrides.js +44 -0
- package/esm/utils/toViemStateOverrides.js.map +1 -0
- package/package.json +1 -1
- package/contracts/build-info/10cf9b18fcc1598e.json +0 -1
- package/esm/rpc/estimation/gasEstimationsV06.js +0 -156
- package/esm/rpc/estimation/gasEstimationsV06.js.map +0 -1
- package/esm/rpc/estimation/gasEstimationsV07.d.ts +0 -101
- package/esm/rpc/estimation/gasEstimationsV07.js +0 -724
- package/esm/rpc/estimation/gasEstimationsV07.js.map +0 -1
- package/esm/types/contracts/EntryPointSimulationsV6.d.ts +0 -33
- package/esm/types/contracts/EntryPointSimulationsV6.js +0 -46
- package/esm/types/contracts/EntryPointSimulationsV6.js.map +0 -1
- package/esm/types/contracts/EntryPointSimulationsV7.d.ts +0 -2076
- package/esm/types/contracts/EntryPointSimulationsV7.js +0 -2675
- package/esm/types/contracts/EntryPointSimulationsV7.js.map +0 -1
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { ExecutionErrors, pimlicoSimulationsAbi, RpcError, ValidationErrors } from "../../types/index.js";
|
|
2
|
+
import { isVersion08, toPackedUserOperation } from "../../utils/index.js";
|
|
3
|
+
import { getContract } from "viem";
|
|
4
|
+
import { BinarySearchResultType } from "./types.js";
|
|
5
|
+
import { packUserOps } from "../../executor/utils.js";
|
|
6
|
+
import { prepareStateOverride, decodeSimulateHandleOpError, simulationErrors } from "./utils.js";
|
|
7
|
+
export class GasEstimatorV07 {
|
|
8
|
+
config;
|
|
9
|
+
logger;
|
|
10
|
+
constructor(config) {
|
|
11
|
+
this.config = config;
|
|
12
|
+
this.logger = config.getLogger({
|
|
13
|
+
module: "gas-estimator-v07"
|
|
14
|
+
}, {
|
|
15
|
+
level: config.logLevel
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
getSimulationContracts(entryPoint, userOperation) {
|
|
19
|
+
const is08 = isVersion08(userOperation, entryPoint);
|
|
20
|
+
const epSimulationsAddress = is08
|
|
21
|
+
? this.config.entrypointSimulationContractV8
|
|
22
|
+
: this.config.entrypointSimulationContractV7;
|
|
23
|
+
if (!epSimulationsAddress) {
|
|
24
|
+
const errorMsg = `Cannot find entryPointSimulations Address for version ${is08 ? "08" : "07"}`;
|
|
25
|
+
this.logger.warn(errorMsg);
|
|
26
|
+
throw new Error(errorMsg);
|
|
27
|
+
}
|
|
28
|
+
if (!this.config.pimlicoSimulationContract) {
|
|
29
|
+
this.logger.warn("pimlicoSimulation must be provided");
|
|
30
|
+
throw new RpcError("pimlicoSimulation must be provided", ValidationErrors.InvalidFields);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
epSimulationsAddress,
|
|
34
|
+
pimlicoSimulation: getContract({
|
|
35
|
+
abi: [...pimlicoSimulationsAbi, ...simulationErrors],
|
|
36
|
+
address: this.config.pimlicoSimulationContract,
|
|
37
|
+
client: this.config.publicClient
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async performBinarySearch({ entryPoint, methodName, queuedUserOps, targetUserOp, stateOverride, retryCount = 0, initialMinGas = 9000n, gasAllowance }) {
|
|
42
|
+
const { pimlicoSimulation, epSimulationsAddress } = this.getSimulationContracts(entryPoint, targetUserOp);
|
|
43
|
+
// Check if we've hit the retry limit
|
|
44
|
+
if (retryCount > this.config.binarySearchMaxRetries) {
|
|
45
|
+
this.logger.warn({ methodName, retryCount }, "Max retries reached in binary search");
|
|
46
|
+
return {
|
|
47
|
+
result: "failed",
|
|
48
|
+
data: `Max retries reached when calling ${methodName}`,
|
|
49
|
+
code: ValidationErrors.SimulateValidation
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const packedQueuedOps = packUserOps(queuedUserOps);
|
|
53
|
+
const packedTargetOp = toPackedUserOperation(targetUserOp);
|
|
54
|
+
try {
|
|
55
|
+
const { result } = await pimlicoSimulation.simulate[methodName]([
|
|
56
|
+
epSimulationsAddress,
|
|
57
|
+
entryPoint,
|
|
58
|
+
packedQueuedOps,
|
|
59
|
+
packedTargetOp,
|
|
60
|
+
initialMinGas,
|
|
61
|
+
this.config.binarySearchToleranceDelta,
|
|
62
|
+
gasAllowance ?? this.config.binarySearchGasAllowance
|
|
63
|
+
], {
|
|
64
|
+
stateOverride,
|
|
65
|
+
gas: this.config.fixedGasLimitForEstimation
|
|
66
|
+
});
|
|
67
|
+
// Check if simulation ran out of gas
|
|
68
|
+
if (result.resultType === BinarySearchResultType.OutOfGas) {
|
|
69
|
+
const { optimalGas, minGas } = result.outOfGasData;
|
|
70
|
+
const newGasAllowance = optimalGas - minGas;
|
|
71
|
+
return await this.performBinarySearch({
|
|
72
|
+
entryPoint,
|
|
73
|
+
methodName,
|
|
74
|
+
queuedUserOps,
|
|
75
|
+
targetUserOp,
|
|
76
|
+
stateOverride,
|
|
77
|
+
retryCount: retryCount + 1,
|
|
78
|
+
initialMinGas: minGas,
|
|
79
|
+
gasAllowance: newGasAllowance
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// Check for successful result
|
|
83
|
+
if (result.resultType === BinarySearchResultType.Success) {
|
|
84
|
+
const successData = result.successData;
|
|
85
|
+
return {
|
|
86
|
+
result: "success",
|
|
87
|
+
data: {
|
|
88
|
+
gasUsed: successData.gasUsed,
|
|
89
|
+
success: successData.success,
|
|
90
|
+
returnData: successData.returnData
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
result: "failed",
|
|
96
|
+
data: result.successData.returnData,
|
|
97
|
+
code: ExecutionErrors.UserOperationReverted
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
this.logger.warn({ err: error, methodName }, "Error in performBinarySearch");
|
|
102
|
+
return {
|
|
103
|
+
result: "failed",
|
|
104
|
+
data: "Unknown error, could not parse target call data result.",
|
|
105
|
+
code: ExecutionErrors.UserOperationReverted
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async simulateHandleOp({ entryPoint, queuedUserOps, targetUserOp, stateOverride }) {
|
|
110
|
+
const { pimlicoSimulation, epSimulationsAddress } = this.getSimulationContracts(entryPoint, targetUserOp);
|
|
111
|
+
const packedQueuedOps = packUserOps(queuedUserOps);
|
|
112
|
+
const packedTargetOp = toPackedUserOperation(targetUserOp);
|
|
113
|
+
try {
|
|
114
|
+
const result = await pimlicoSimulation.simulate.simulateHandleOp([
|
|
115
|
+
epSimulationsAddress,
|
|
116
|
+
entryPoint,
|
|
117
|
+
packedQueuedOps,
|
|
118
|
+
packedTargetOp
|
|
119
|
+
], {
|
|
120
|
+
stateOverride,
|
|
121
|
+
gas: this.config.fixedGasLimitForEstimation
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
result: "execution",
|
|
125
|
+
data: {
|
|
126
|
+
executionResult: result.result
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
const decodedError = decodeSimulateHandleOpError(error, this.logger);
|
|
132
|
+
this.logger.warn({ err: error, data: decodedError.data }, "Contract function reverted in executeSimulateHandleOp");
|
|
133
|
+
return decodedError;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
async simulateAndEstimateGasLimits({ entryPoint, queuedUserOps, targetUserOp, stateOverride, retryCount = 0 }) {
|
|
137
|
+
const { pimlicoSimulation, epSimulationsAddress } = this.getSimulationContracts(entryPoint, targetUserOp);
|
|
138
|
+
const packedQueuedOps = packUserOps(queuedUserOps);
|
|
139
|
+
const packedTargetOp = toPackedUserOperation(targetUserOp);
|
|
140
|
+
try {
|
|
141
|
+
const { result } = await pimlicoSimulation.simulate.simulateAndEstimateGas([
|
|
142
|
+
epSimulationsAddress,
|
|
143
|
+
entryPoint,
|
|
144
|
+
packedQueuedOps,
|
|
145
|
+
packedTargetOp,
|
|
146
|
+
9000n,
|
|
147
|
+
this.config.binarySearchToleranceDelta,
|
|
148
|
+
this.config.binarySearchGasAllowance
|
|
149
|
+
], {
|
|
150
|
+
stateOverride,
|
|
151
|
+
gas: this.config.fixedGasLimitForEstimation
|
|
152
|
+
});
|
|
153
|
+
const { verificationGasLimit, paymasterVerificationGasLimit, simulationResult } = result;
|
|
154
|
+
// Check if verification gas limit needs retry
|
|
155
|
+
let verificationGas;
|
|
156
|
+
if (verificationGasLimit.resultType ===
|
|
157
|
+
BinarySearchResultType.OutOfGas) {
|
|
158
|
+
const binarySearchResult = await this.performBinarySearch({
|
|
159
|
+
entryPoint,
|
|
160
|
+
methodName: "binarySearchVerificationGas",
|
|
161
|
+
queuedUserOps,
|
|
162
|
+
targetUserOp,
|
|
163
|
+
stateOverride,
|
|
164
|
+
retryCount: retryCount + 1,
|
|
165
|
+
initialMinGas: verificationGasLimit.outOfGasData.minGas,
|
|
166
|
+
gasAllowance: verificationGasLimit.outOfGasData.optimalGas -
|
|
167
|
+
verificationGasLimit.outOfGasData.minGas
|
|
168
|
+
});
|
|
169
|
+
if (binarySearchResult.result === "failed") {
|
|
170
|
+
return binarySearchResult;
|
|
171
|
+
}
|
|
172
|
+
verificationGas = binarySearchResult.data.gasUsed;
|
|
173
|
+
}
|
|
174
|
+
else if (verificationGasLimit.resultType ===
|
|
175
|
+
BinarySearchResultType.Success) {
|
|
176
|
+
verificationGas = verificationGasLimit.successData.gasUsed;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
return {
|
|
180
|
+
result: "failed",
|
|
181
|
+
data: verificationGasLimit.successData.returnData,
|
|
182
|
+
code: ExecutionErrors.UserOperationReverted
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
// Check if paymaster verification gas limit needs retry
|
|
186
|
+
let paymasterVerificationGas;
|
|
187
|
+
if (paymasterVerificationGasLimit.resultType ===
|
|
188
|
+
BinarySearchResultType.OutOfGas) {
|
|
189
|
+
const binarySearchResult = await this.performBinarySearch({
|
|
190
|
+
entryPoint,
|
|
191
|
+
methodName: "binarySearchPaymasterVerificationGas",
|
|
192
|
+
queuedUserOps,
|
|
193
|
+
targetUserOp,
|
|
194
|
+
stateOverride,
|
|
195
|
+
retryCount: retryCount + 1,
|
|
196
|
+
initialMinGas: paymasterVerificationGasLimit.outOfGasData.minGas,
|
|
197
|
+
gasAllowance: paymasterVerificationGasLimit.outOfGasData.optimalGas -
|
|
198
|
+
paymasterVerificationGasLimit.outOfGasData.minGas
|
|
199
|
+
});
|
|
200
|
+
if (binarySearchResult.result === "failed") {
|
|
201
|
+
return binarySearchResult;
|
|
202
|
+
}
|
|
203
|
+
paymasterVerificationGas = binarySearchResult.data.gasUsed;
|
|
204
|
+
}
|
|
205
|
+
else if (paymasterVerificationGasLimit.resultType ===
|
|
206
|
+
BinarySearchResultType.Success) {
|
|
207
|
+
paymasterVerificationGas =
|
|
208
|
+
paymasterVerificationGasLimit.successData.gasUsed;
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
return {
|
|
212
|
+
result: "failed",
|
|
213
|
+
data: paymasterVerificationGasLimit.successData.returnData,
|
|
214
|
+
code: ExecutionErrors.UserOperationReverted
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
result: "success",
|
|
219
|
+
verificationGas,
|
|
220
|
+
paymasterVerificationGas,
|
|
221
|
+
executionResult: simulationResult
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
const decodedError = decodeSimulateHandleOpError(error, this.logger);
|
|
226
|
+
this.logger.warn({ err: error, data: decodedError.data }, "Contract function reverted in simulateValidation");
|
|
227
|
+
return decodedError;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
async simulateValidation({ entryPoint, userOperation, queuedUserOperations }) {
|
|
231
|
+
const { epSimulationsAddress, pimlicoSimulation } = this.getSimulationContracts(entryPoint, userOperation);
|
|
232
|
+
const viemStateOverride = prepareStateOverride({
|
|
233
|
+
userOperations: [userOperation],
|
|
234
|
+
queuedUserOperations,
|
|
235
|
+
config: this.config
|
|
236
|
+
});
|
|
237
|
+
try {
|
|
238
|
+
const { result } = await pimlicoSimulation.simulate.simulateValidation([
|
|
239
|
+
epSimulationsAddress,
|
|
240
|
+
entryPoint,
|
|
241
|
+
packUserOps(queuedUserOperations),
|
|
242
|
+
toPackedUserOperation(userOperation)
|
|
243
|
+
], {
|
|
244
|
+
stateOverride: viemStateOverride,
|
|
245
|
+
gas: this.config.fixedGasLimitForEstimation
|
|
246
|
+
});
|
|
247
|
+
return {
|
|
248
|
+
result: "validation",
|
|
249
|
+
data: result
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
const decodedError = decodeSimulateHandleOpError(error, this.logger);
|
|
254
|
+
this.logger.warn({ err: error, data: decodedError.data }, "Contract function reverted in simulateValidation");
|
|
255
|
+
return decodedError;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async validateHandleOpV07({ entryPoint, userOperation, queuedUserOperations, stateOverrides = {} }) {
|
|
259
|
+
const { epSimulationsAddress, pimlicoSimulation } = this.getSimulationContracts(entryPoint, userOperation);
|
|
260
|
+
const viemStateOverride = prepareStateOverride({
|
|
261
|
+
userOperations: [userOperation],
|
|
262
|
+
queuedUserOperations,
|
|
263
|
+
stateOverrides,
|
|
264
|
+
config: this.config
|
|
265
|
+
});
|
|
266
|
+
try {
|
|
267
|
+
const { result } = await pimlicoSimulation.simulate.simulateHandleOp([
|
|
268
|
+
epSimulationsAddress,
|
|
269
|
+
entryPoint,
|
|
270
|
+
packUserOps(queuedUserOperations),
|
|
271
|
+
toPackedUserOperation(userOperation)
|
|
272
|
+
], {
|
|
273
|
+
stateOverride: viemStateOverride,
|
|
274
|
+
gas: this.config.fixedGasLimitForEstimation
|
|
275
|
+
});
|
|
276
|
+
return {
|
|
277
|
+
result: "execution",
|
|
278
|
+
data: {
|
|
279
|
+
callGasLimit: 0n,
|
|
280
|
+
verificationGasLimit: 0n,
|
|
281
|
+
paymasterVerificationGasLimit: 0n,
|
|
282
|
+
executionResult: result
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
287
|
+
const decodedError = decodeSimulateHandleOpError(error, this.logger);
|
|
288
|
+
this.logger.warn({ err: error, data: decodedError.data }, "Contract function reverted in validateHandleOpV07");
|
|
289
|
+
return decodedError;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
async simulateHandleOp07({ entryPoint, userOperation, queuedUserOperations, userStateOverrides = {} }) {
|
|
293
|
+
const viemStateOverride = prepareStateOverride({
|
|
294
|
+
userOperations: [userOperation],
|
|
295
|
+
queuedUserOperations,
|
|
296
|
+
stateOverrides: userStateOverrides,
|
|
297
|
+
config: this.config
|
|
298
|
+
});
|
|
299
|
+
if (this.config.splitSimulationCalls) {
|
|
300
|
+
const [sho, bsvgl, bspvgl, bscgl] = await Promise.all([
|
|
301
|
+
this.simulateHandleOp({
|
|
302
|
+
entryPoint,
|
|
303
|
+
queuedUserOps: queuedUserOperations,
|
|
304
|
+
targetUserOp: userOperation,
|
|
305
|
+
stateOverride: viemStateOverride
|
|
306
|
+
}),
|
|
307
|
+
this.performBinarySearch({
|
|
308
|
+
entryPoint,
|
|
309
|
+
methodName: "binarySearchVerificationGas",
|
|
310
|
+
queuedUserOps: queuedUserOperations,
|
|
311
|
+
targetUserOp: userOperation,
|
|
312
|
+
stateOverride: viemStateOverride
|
|
313
|
+
}),
|
|
314
|
+
this.performBinarySearch({
|
|
315
|
+
entryPoint,
|
|
316
|
+
methodName: "binarySearchPaymasterVerificationGas",
|
|
317
|
+
queuedUserOps: queuedUserOperations,
|
|
318
|
+
targetUserOp: userOperation,
|
|
319
|
+
stateOverride: viemStateOverride
|
|
320
|
+
}),
|
|
321
|
+
this.performBinarySearch({
|
|
322
|
+
entryPoint,
|
|
323
|
+
methodName: "binarySearchCallGas",
|
|
324
|
+
queuedUserOps: queuedUserOperations,
|
|
325
|
+
targetUserOp: userOperation,
|
|
326
|
+
stateOverride: viemStateOverride
|
|
327
|
+
})
|
|
328
|
+
]);
|
|
329
|
+
if (sho.result === "failed") {
|
|
330
|
+
return sho;
|
|
331
|
+
}
|
|
332
|
+
if (bsvgl.result === "failed") {
|
|
333
|
+
return bsvgl;
|
|
334
|
+
}
|
|
335
|
+
if (bspvgl.result === "failed") {
|
|
336
|
+
return bspvgl;
|
|
337
|
+
}
|
|
338
|
+
if (bscgl.result === "failed") {
|
|
339
|
+
return bscgl;
|
|
340
|
+
}
|
|
341
|
+
return {
|
|
342
|
+
result: "execution",
|
|
343
|
+
data: {
|
|
344
|
+
callGasLimit: bscgl.data.gasUsed,
|
|
345
|
+
verificationGasLimit: bsvgl.data.gasUsed,
|
|
346
|
+
paymasterVerificationGasLimit: bspvgl.data.gasUsed,
|
|
347
|
+
executionResult: sho.data.executionResult
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
const [saegl, focgl] = await Promise.all([
|
|
353
|
+
this.simulateAndEstimateGasLimits({
|
|
354
|
+
entryPoint,
|
|
355
|
+
queuedUserOps: queuedUserOperations,
|
|
356
|
+
targetUserOp: userOperation,
|
|
357
|
+
stateOverride: viemStateOverride
|
|
358
|
+
}),
|
|
359
|
+
this.performBinarySearch({
|
|
360
|
+
entryPoint,
|
|
361
|
+
methodName: "binarySearchCallGas",
|
|
362
|
+
queuedUserOps: queuedUserOperations,
|
|
363
|
+
targetUserOp: userOperation,
|
|
364
|
+
stateOverride: viemStateOverride
|
|
365
|
+
})
|
|
366
|
+
]);
|
|
367
|
+
if (saegl.result === "failed") {
|
|
368
|
+
return saegl;
|
|
369
|
+
}
|
|
370
|
+
if (focgl.result === "failed") {
|
|
371
|
+
return focgl;
|
|
372
|
+
}
|
|
373
|
+
const { verificationGas, paymasterVerificationGas, executionResult } = saegl;
|
|
374
|
+
return {
|
|
375
|
+
result: "execution",
|
|
376
|
+
data: {
|
|
377
|
+
callGasLimit: focgl.data.gasUsed,
|
|
378
|
+
verificationGasLimit: verificationGas,
|
|
379
|
+
paymasterVerificationGasLimit: paymasterVerificationGas,
|
|
380
|
+
executionResult: executionResult
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
//# sourceMappingURL=gasEstimations07.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gasEstimations07.js","sourceRoot":"","sources":["../../../rpc/estimation/gasEstimations07.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,QAAQ,EAGR,gBAAgB,EACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAe,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE7E,OAAO,EAAgB,WAAW,EAAsB,MAAM,MAAM,CAAA;AACpE,OAAO,EACH,sBAAsB,EAGzB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EACH,oBAAoB,EACpB,2BAA2B,EAC3B,gBAAgB,EACnB,MAAM,SAAS,CAAA;AAahB,MAAM,OAAO,eAAe;IAChB,MAAM,CAAY;IAClB,MAAM,CAAQ;IAEtB,YAAY,MAAkB;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC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CAAC,OAAO;oBACxC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO;oBAClD,eAAe,EAAE,GAAG,CAAC,IAAI,CAAC,eAAe;iBAC5C;aACJ,CAAA;QACL,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBACrC,IAAI,CAAC,4BAA4B,CAAC;oBAC9B,UAAU;oBACV,aAAa,EAAE,oBAAoB;oBACnC,YAAY,EAAE,aAAa;oBAC3B,aAAa,EAAE,iBAAiB;iBACnC,CAAC;gBACF,IAAI,CAAC,mBAAmB,CAAC;oBACrB,UAAU;oBACV,UAAU,EAAE,qBAAqB;oBACjC,aAAa,EAAE,oBAAoB;oBACnC,YAAY,EAAE,aAAa;oBAC3B,aAAa,EAAE,iBAAiB;iBACnC,CAAC;aACL,CAAC,CAAA;YAEF,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC5B,OAAO,KAAK,CAAA;YAChB,CAAC;YAED,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC5B,OAAO,KAAK,CAAA;YAChB,CAAC;YAED,MAAM,EACF,eAAe,EACf,wBAAwB,EACxB,eAAe,EAClB,GAAG,KAAK,CAAA;YAET,OAAO;gBACH,MAAM,EAAE,WAAW;gBACnB,IAAI,EAAE;oBACF,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;oBAChC,oBAAoB,EAAE,eAAe;oBACrC,6BAA6B,EAAE,wBAAwB;oBACvD,eAAe,EAAE,eAAe;iBACnC;aACJ,CAAA;QACL,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,120 +1,32 @@
|
|
|
1
|
-
import type { Address, ExecutionResult, PackedUserOperation, BinarySearchCallResult } from "../../types/index.js";
|
|
2
1
|
import type { Hex } from "viem";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type { ExecutionResult } from "../../types/index.js";
|
|
3
|
+
export declare enum BinarySearchResultType {
|
|
4
|
+
Success = 0,
|
|
5
|
+
OutOfGas = 1
|
|
6
|
+
}
|
|
7
|
+
export type SimulateHandleOpResult = {
|
|
8
|
+
result: "failed";
|
|
9
|
+
data: string;
|
|
10
|
+
code: number;
|
|
11
|
+
} | {
|
|
12
|
+
result: "execution";
|
|
13
|
+
data: {
|
|
6
14
|
callGasLimit?: bigint;
|
|
7
15
|
verificationGasLimit?: bigint;
|
|
8
16
|
paymasterVerificationGasLimit?: bigint;
|
|
9
17
|
executionResult: ExecutionResult;
|
|
10
18
|
};
|
|
11
|
-
code?: TypeResult extends "failed" ? number : undefined;
|
|
12
19
|
};
|
|
13
|
-
export type
|
|
14
|
-
result:
|
|
15
|
-
data:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
optimalGas: bigint;
|
|
25
|
-
minGas: bigint;
|
|
26
|
-
maxGas: bigint;
|
|
20
|
+
export type SimulateBinarySearchResult = {
|
|
21
|
+
result: "success";
|
|
22
|
+
data: {
|
|
23
|
+
gasUsed: bigint;
|
|
24
|
+
success: boolean;
|
|
25
|
+
returnData: Hex;
|
|
26
|
+
};
|
|
27
|
+
} | {
|
|
28
|
+
result: "failed";
|
|
29
|
+
data: string;
|
|
30
|
+
code: number;
|
|
27
31
|
};
|
|
28
|
-
export declare const simulationValidationResultStruct: readonly [{
|
|
29
|
-
readonly components: readonly [{
|
|
30
|
-
readonly components: readonly [{
|
|
31
|
-
readonly internalType: "uint256";
|
|
32
|
-
readonly name: "preOpGas";
|
|
33
|
-
readonly type: "uint256";
|
|
34
|
-
}, {
|
|
35
|
-
readonly internalType: "uint256";
|
|
36
|
-
readonly name: "prefund";
|
|
37
|
-
readonly type: "uint256";
|
|
38
|
-
}, {
|
|
39
|
-
readonly internalType: "uint256";
|
|
40
|
-
readonly name: "accountValidationData";
|
|
41
|
-
readonly type: "uint256";
|
|
42
|
-
}, {
|
|
43
|
-
readonly internalType: "uint256";
|
|
44
|
-
readonly name: "paymasterValidationData";
|
|
45
|
-
readonly type: "uint256";
|
|
46
|
-
}, {
|
|
47
|
-
readonly internalType: "bytes";
|
|
48
|
-
readonly name: "paymasterContext";
|
|
49
|
-
readonly type: "bytes";
|
|
50
|
-
}];
|
|
51
|
-
readonly internalType: "struct IEntryPoint.ReturnInfo";
|
|
52
|
-
readonly name: "returnInfo";
|
|
53
|
-
readonly type: "tuple";
|
|
54
|
-
}, {
|
|
55
|
-
readonly components: readonly [{
|
|
56
|
-
readonly internalType: "uint256";
|
|
57
|
-
readonly name: "stake";
|
|
58
|
-
readonly type: "uint256";
|
|
59
|
-
}, {
|
|
60
|
-
readonly internalType: "uint256";
|
|
61
|
-
readonly name: "unstakeDelaySec";
|
|
62
|
-
readonly type: "uint256";
|
|
63
|
-
}];
|
|
64
|
-
readonly internalType: "struct IStakeManager.StakeInfo";
|
|
65
|
-
readonly name: "senderInfo";
|
|
66
|
-
readonly type: "tuple";
|
|
67
|
-
}, {
|
|
68
|
-
readonly components: readonly [{
|
|
69
|
-
readonly internalType: "uint256";
|
|
70
|
-
readonly name: "stake";
|
|
71
|
-
readonly type: "uint256";
|
|
72
|
-
}, {
|
|
73
|
-
readonly internalType: "uint256";
|
|
74
|
-
readonly name: "unstakeDelaySec";
|
|
75
|
-
readonly type: "uint256";
|
|
76
|
-
}];
|
|
77
|
-
readonly internalType: "struct IStakeManager.StakeInfo";
|
|
78
|
-
readonly name: "factoryInfo";
|
|
79
|
-
readonly type: "tuple";
|
|
80
|
-
}, {
|
|
81
|
-
readonly components: readonly [{
|
|
82
|
-
readonly internalType: "uint256";
|
|
83
|
-
readonly name: "stake";
|
|
84
|
-
readonly type: "uint256";
|
|
85
|
-
}, {
|
|
86
|
-
readonly internalType: "uint256";
|
|
87
|
-
readonly name: "unstakeDelaySec";
|
|
88
|
-
readonly type: "uint256";
|
|
89
|
-
}];
|
|
90
|
-
readonly internalType: "struct IStakeManager.StakeInfo";
|
|
91
|
-
readonly name: "paymasterInfo";
|
|
92
|
-
readonly type: "tuple";
|
|
93
|
-
}, {
|
|
94
|
-
readonly components: readonly [{
|
|
95
|
-
readonly internalType: "address";
|
|
96
|
-
readonly name: "aggregator";
|
|
97
|
-
readonly type: "address";
|
|
98
|
-
}, {
|
|
99
|
-
readonly components: readonly [{
|
|
100
|
-
readonly internalType: "uint256";
|
|
101
|
-
readonly name: "stake";
|
|
102
|
-
readonly type: "uint256";
|
|
103
|
-
}, {
|
|
104
|
-
readonly internalType: "uint256";
|
|
105
|
-
readonly name: "unstakeDelaySec";
|
|
106
|
-
readonly type: "uint256";
|
|
107
|
-
}];
|
|
108
|
-
readonly internalType: "struct IStakeManager.StakeInfo";
|
|
109
|
-
readonly name: "stakeInfo";
|
|
110
|
-
readonly type: "tuple";
|
|
111
|
-
}];
|
|
112
|
-
readonly internalType: "struct IEntryPoint.AggregatorStakeInfo";
|
|
113
|
-
readonly name: "aggregatorInfo";
|
|
114
|
-
readonly type: "tuple";
|
|
115
|
-
}];
|
|
116
|
-
readonly internalType: "struct IEntryPointSimulations.ValidationResult";
|
|
117
|
-
readonly name: "";
|
|
118
|
-
readonly type: "tuple";
|
|
119
|
-
}];
|
|
120
32
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,122 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{
|
|
7
|
-
internalType: "uint256",
|
|
8
|
-
name: "preOpGas",
|
|
9
|
-
type: "uint256"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
internalType: "uint256",
|
|
13
|
-
name: "prefund",
|
|
14
|
-
type: "uint256"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
internalType: "uint256",
|
|
18
|
-
name: "accountValidationData",
|
|
19
|
-
type: "uint256"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
internalType: "uint256",
|
|
23
|
-
name: "paymasterValidationData",
|
|
24
|
-
type: "uint256"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
internalType: "bytes",
|
|
28
|
-
name: "paymasterContext",
|
|
29
|
-
type: "bytes"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
internalType: "struct IEntryPoint.ReturnInfo",
|
|
33
|
-
name: "returnInfo",
|
|
34
|
-
type: "tuple"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
components: [
|
|
38
|
-
{
|
|
39
|
-
internalType: "uint256",
|
|
40
|
-
name: "stake",
|
|
41
|
-
type: "uint256"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
internalType: "uint256",
|
|
45
|
-
name: "unstakeDelaySec",
|
|
46
|
-
type: "uint256"
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
internalType: "struct IStakeManager.StakeInfo",
|
|
50
|
-
name: "senderInfo",
|
|
51
|
-
type: "tuple"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
components: [
|
|
55
|
-
{
|
|
56
|
-
internalType: "uint256",
|
|
57
|
-
name: "stake",
|
|
58
|
-
type: "uint256"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
internalType: "uint256",
|
|
62
|
-
name: "unstakeDelaySec",
|
|
63
|
-
type: "uint256"
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
internalType: "struct IStakeManager.StakeInfo",
|
|
67
|
-
name: "factoryInfo",
|
|
68
|
-
type: "tuple"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
components: [
|
|
72
|
-
{
|
|
73
|
-
internalType: "uint256",
|
|
74
|
-
name: "stake",
|
|
75
|
-
type: "uint256"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
internalType: "uint256",
|
|
79
|
-
name: "unstakeDelaySec",
|
|
80
|
-
type: "uint256"
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
internalType: "struct IStakeManager.StakeInfo",
|
|
84
|
-
name: "paymasterInfo",
|
|
85
|
-
type: "tuple"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
components: [
|
|
89
|
-
{
|
|
90
|
-
internalType: "address",
|
|
91
|
-
name: "aggregator",
|
|
92
|
-
type: "address"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
components: [
|
|
96
|
-
{
|
|
97
|
-
internalType: "uint256",
|
|
98
|
-
name: "stake",
|
|
99
|
-
type: "uint256"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
internalType: "uint256",
|
|
103
|
-
name: "unstakeDelaySec",
|
|
104
|
-
type: "uint256"
|
|
105
|
-
}
|
|
106
|
-
],
|
|
107
|
-
internalType: "struct IStakeManager.StakeInfo",
|
|
108
|
-
name: "stakeInfo",
|
|
109
|
-
type: "tuple"
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
internalType: "struct IEntryPoint.AggregatorStakeInfo",
|
|
113
|
-
name: "aggregatorInfo",
|
|
114
|
-
type: "tuple"
|
|
115
|
-
}
|
|
116
|
-
],
|
|
117
|
-
internalType: "struct IEntryPointSimulations.ValidationResult",
|
|
118
|
-
name: "",
|
|
119
|
-
type: "tuple"
|
|
120
|
-
}
|
|
121
|
-
];
|
|
1
|
+
export var BinarySearchResultType;
|
|
2
|
+
(function (BinarySearchResultType) {
|
|
3
|
+
BinarySearchResultType[BinarySearchResultType["Success"] = 0] = "Success";
|
|
4
|
+
BinarySearchResultType[BinarySearchResultType["OutOfGas"] = 1] = "OutOfGas";
|
|
5
|
+
})(BinarySearchResultType || (BinarySearchResultType = {}));
|
|
122
6
|
//# sourceMappingURL=types.js.map
|