@pimlico/alto 0.0.0-main.20250624T102902 → 0.0.0-main.20250625T172702
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/esm/cli/config/bundler.d.ts +6 -0
- package/esm/cli/config/bundler.js +2 -1
- package/esm/cli/config/bundler.js.map +1 -1
- package/esm/cli/config/options.js +6 -0
- package/esm/cli/config/options.js.map +1 -1
- package/esm/executor/executor.js +8 -6
- package/esm/executor/executor.js.map +1 -1
- package/esm/executor/filterOpsAndEstimateGas.js +5 -16
- package/esm/executor/filterOpsAndEstimateGas.js.map +1 -1
- package/esm/executor/userOpMonitor.d.ts +1 -1
- package/esm/executor/userOpMonitor.js +12 -3
- package/esm/executor/userOpMonitor.js.map +1 -1
- package/esm/rpc/methods/eth_estimateUserOperationGas.js +30 -16
- package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
- package/esm/rpc/methods/eth_sendUserOperation.js +8 -2
- package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
- package/esm/utils/bigInt.d.ts +1 -0
- package/esm/utils/bigInt.js +4 -0
- package/esm/utils/bigInt.js.map +1 -1
- package/esm/utils/index.d.ts +1 -1
- package/esm/utils/index.js +1 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/preVerificationGasCalulator.d.ts +42 -0
- package/esm/utils/preVerificationGasCalulator.js +423 -0
- package/esm/utils/preVerificationGasCalulator.js.map +1 -0
- package/package.json +1 -1
- package/esm/utils/validation.d.ts +0 -58
- package/esm/utils/validation.js +0 -509
- package/esm/utils/validation.js.map +0 -1
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { GasPriceManager } from "../handlers/index.js";
|
|
2
|
-
import { type Address, type PackedUserOperation, type UserOperation, type UserOperationV06 } from "../types/index.js";
|
|
3
|
-
import { ContractFunctionRevertedError, EstimateGasExecutionError, FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooLowError, NonceTooLowError, InternalRpcError } from "viem";
|
|
4
|
-
import type { AltoConfig } from "../createConfig.js";
|
|
5
|
-
export interface GasOverheads {
|
|
6
|
-
/**
|
|
7
|
-
* fixed overhead for entire handleOp bundle.
|
|
8
|
-
*/
|
|
9
|
-
fixed: number;
|
|
10
|
-
/**
|
|
11
|
-
* per userOp overhead, added on top of the above fixed per-bundle.
|
|
12
|
-
*/
|
|
13
|
-
perUserOp: number;
|
|
14
|
-
/**
|
|
15
|
-
* overhead for userOp word (32 bytes) block
|
|
16
|
-
*/
|
|
17
|
-
perUserOpWord: number;
|
|
18
|
-
/**
|
|
19
|
-
* zero byte cost, for calldata gas cost calculations
|
|
20
|
-
*/
|
|
21
|
-
zeroByte: number;
|
|
22
|
-
/**
|
|
23
|
-
* non-zero byte cost, for calldata gas cost calculations
|
|
24
|
-
*/
|
|
25
|
-
nonZeroByte: number;
|
|
26
|
-
/**
|
|
27
|
-
* expected bundle size, to split per-bundle overhead between all ops.
|
|
28
|
-
*/
|
|
29
|
-
bundleSize: number;
|
|
30
|
-
/**
|
|
31
|
-
* expected length of the userOp signature.
|
|
32
|
-
*/
|
|
33
|
-
sigSize: number;
|
|
34
|
-
}
|
|
35
|
-
export declare const DefaultGasOverheads: GasOverheads;
|
|
36
|
-
/**
|
|
37
|
-
* pack the userOperation
|
|
38
|
-
* @param op
|
|
39
|
-
* "false" to pack entire UserOp, for calculating the calldata cost of putting it on-chain.
|
|
40
|
-
*/
|
|
41
|
-
export declare function packUserOpV06(op: UserOperationV06): `0x${string}`;
|
|
42
|
-
export declare function removeZeroBytesFromUserOp<T extends UserOperation>(userOpearation: T): T extends UserOperationV06 ? UserOperationV06 : PackedUserOperation;
|
|
43
|
-
export declare function packUserOpV07(op: PackedUserOperation): `0x${string}`;
|
|
44
|
-
export declare function calcPreVerificationGas({ config, userOperation, entryPoint, gasPriceManager, validate, overheads }: {
|
|
45
|
-
config: AltoConfig;
|
|
46
|
-
userOperation: UserOperation;
|
|
47
|
-
entryPoint: Address;
|
|
48
|
-
gasPriceManager: GasPriceManager;
|
|
49
|
-
validate: boolean;
|
|
50
|
-
overheads?: GasOverheads;
|
|
51
|
-
}): Promise<bigint>;
|
|
52
|
-
export declare function getHandleOpsCallData({ userOps, entryPoint, removeZeros }: {
|
|
53
|
-
userOps: UserOperation[];
|
|
54
|
-
entryPoint: Address;
|
|
55
|
-
removeZeros?: boolean;
|
|
56
|
-
}): `0x${string}`;
|
|
57
|
-
export declare function parseViemError(err: unknown): NonceTooLowError | FeeCapTooLowError | InsufficientFundsError | IntrinsicGasTooLowError | ContractFunctionRevertedError | EstimateGasExecutionError | InternalRpcError | undefined;
|
|
58
|
-
//# sourceMappingURL=validation.d.ts.map
|
package/esm/utils/validation.js
DELETED
|
@@ -1,509 +0,0 @@
|
|
|
1
|
-
import { EntryPointV06Abi, EntryPointV07Abi, MantleBvmGasPriceOracleAbi, OpL1FeeAbi } from "../types/index.js";
|
|
2
|
-
import { ContractFunctionExecutionError, ContractFunctionRevertedError, EstimateGasExecutionError, FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooLowError, NonceTooLowError, TransactionExecutionError, bytesToHex, encodeAbiParameters, getContract, serializeTransaction, toBytes, InternalRpcError, maxUint64, encodeFunctionData, parseGwei, parseEther, maxUint256, toHex, size, concat, slice } from "viem";
|
|
3
|
-
import { minBigInt, randomBigInt } from "./bigInt.js";
|
|
4
|
-
import { isVersion06, isVersion07, toPackedUserOperation } from "./userop.js";
|
|
5
|
-
import { ArbitrumL1FeeAbi } from "../types/contracts/ArbitrumL1FeeAbi.js";
|
|
6
|
-
import crypto from "crypto";
|
|
7
|
-
export const DefaultGasOverheads = {
|
|
8
|
-
fixed: 21000,
|
|
9
|
-
perUserOp: 18300,
|
|
10
|
-
perUserOpWord: 4,
|
|
11
|
-
zeroByte: 4,
|
|
12
|
-
nonZeroByte: 16,
|
|
13
|
-
bundleSize: 1,
|
|
14
|
-
sigSize: 65
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* pack the userOperation
|
|
18
|
-
* @param op
|
|
19
|
-
* "false" to pack entire UserOp, for calculating the calldata cost of putting it on-chain.
|
|
20
|
-
*/
|
|
21
|
-
export function packUserOpV06(op) {
|
|
22
|
-
return encodeAbiParameters([
|
|
23
|
-
{
|
|
24
|
-
internalType: "address",
|
|
25
|
-
name: "sender",
|
|
26
|
-
type: "address"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
internalType: "uint256",
|
|
30
|
-
name: "nonce",
|
|
31
|
-
type: "uint256"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
internalType: "bytes",
|
|
35
|
-
name: "initCode",
|
|
36
|
-
type: "bytes"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
internalType: "bytes",
|
|
40
|
-
name: "callData",
|
|
41
|
-
type: "bytes"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
internalType: "uint256",
|
|
45
|
-
name: "callGasLimit",
|
|
46
|
-
type: "uint256"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
internalType: "uint256",
|
|
50
|
-
name: "verificationGasLimit",
|
|
51
|
-
type: "uint256"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
internalType: "uint256",
|
|
55
|
-
name: "preVerificationGas",
|
|
56
|
-
type: "uint256"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
internalType: "uint256",
|
|
60
|
-
name: "maxFeePerGas",
|
|
61
|
-
type: "uint256"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
internalType: "uint256",
|
|
65
|
-
name: "maxPriorityFeePerGas",
|
|
66
|
-
type: "uint256"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
internalType: "bytes",
|
|
70
|
-
name: "paymasterAndData",
|
|
71
|
-
type: "bytes"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
internalType: "bytes",
|
|
75
|
-
name: "signature",
|
|
76
|
-
type: "bytes"
|
|
77
|
-
}
|
|
78
|
-
], [
|
|
79
|
-
op.sender,
|
|
80
|
-
BigInt("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
|
|
81
|
-
op.initCode,
|
|
82
|
-
op.callData,
|
|
83
|
-
BigInt("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
|
|
84
|
-
BigInt("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
|
|
85
|
-
BigInt("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
|
|
86
|
-
BigInt("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
|
|
87
|
-
BigInt("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
|
|
88
|
-
bytesToHex(new Uint8Array(op.paymasterAndData.length).fill(255)),
|
|
89
|
-
bytesToHex(new Uint8Array(op.signature.length).fill(255))
|
|
90
|
-
]);
|
|
91
|
-
}
|
|
92
|
-
export function removeZeroBytesFromUserOp(userOpearation) {
|
|
93
|
-
if (isVersion06(userOpearation)) {
|
|
94
|
-
return {
|
|
95
|
-
sender: userOpearation.sender,
|
|
96
|
-
nonce: userOpearation.nonce,
|
|
97
|
-
initCode: userOpearation.initCode,
|
|
98
|
-
callData: userOpearation.callData,
|
|
99
|
-
callGasLimit: maxUint256,
|
|
100
|
-
verificationGasLimit: maxUint256,
|
|
101
|
-
preVerificationGas: maxUint256,
|
|
102
|
-
maxFeePerGas: maxUint256,
|
|
103
|
-
maxPriorityFeePerGas: maxUint256,
|
|
104
|
-
paymasterAndData: bytesToHex(new Uint8Array(userOpearation.paymasterAndData.length).fill(255)),
|
|
105
|
-
signature: bytesToHex(new Uint8Array(userOpearation.signature.length).fill(255))
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
const packedUserOperation = toPackedUserOperation(userOpearation);
|
|
109
|
-
return {
|
|
110
|
-
sender: packedUserOperation.sender,
|
|
111
|
-
nonce: maxUint256,
|
|
112
|
-
initCode: packedUserOperation.initCode,
|
|
113
|
-
callData: packedUserOperation.callData,
|
|
114
|
-
accountGasLimits: toHex(maxUint256),
|
|
115
|
-
preVerificationGas: maxUint256,
|
|
116
|
-
gasFees: toHex(maxUint256),
|
|
117
|
-
paymasterAndData: bytesToHex(new Uint8Array(packedUserOperation.paymasterAndData.length).fill(255)),
|
|
118
|
-
signature: bytesToHex(new Uint8Array(packedUserOperation.signature.length).fill(255))
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
export function packUserOpV07(op) {
|
|
122
|
-
return encodeAbiParameters([
|
|
123
|
-
{
|
|
124
|
-
internalType: "address",
|
|
125
|
-
name: "sender",
|
|
126
|
-
type: "address"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
internalType: "uint256",
|
|
130
|
-
name: "nonce",
|
|
131
|
-
type: "uint256"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
internalType: "bytes",
|
|
135
|
-
name: "initCode",
|
|
136
|
-
type: "bytes"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
internalType: "bytes",
|
|
140
|
-
name: "callData",
|
|
141
|
-
type: "bytes"
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
internalType: "uint256",
|
|
145
|
-
name: "accountGasLimits",
|
|
146
|
-
type: "bytes32"
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
internalType: "uint256",
|
|
150
|
-
name: "preVerificationGas",
|
|
151
|
-
type: "uint256"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
internalType: "uint256",
|
|
155
|
-
name: "gasFees",
|
|
156
|
-
type: "bytes32"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
internalType: "bytes",
|
|
160
|
-
name: "paymasterAndData",
|
|
161
|
-
type: "bytes"
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
internalType: "bytes",
|
|
165
|
-
name: "signature",
|
|
166
|
-
type: "bytes"
|
|
167
|
-
}
|
|
168
|
-
], [
|
|
169
|
-
op.sender,
|
|
170
|
-
op.nonce, // need non zero bytes to get better estimations for preVerificationGas
|
|
171
|
-
op.initCode,
|
|
172
|
-
op.callData,
|
|
173
|
-
op.accountGasLimits, // need non zero bytes to get better estimations for preVerificationGas
|
|
174
|
-
op.preVerificationGas, // need non zero bytes to get better estimations for preVerificationGas
|
|
175
|
-
op.gasFees, // need non zero bytes to get better estimations for preVerificationGas
|
|
176
|
-
op.paymasterAndData,
|
|
177
|
-
op.signature
|
|
178
|
-
]);
|
|
179
|
-
}
|
|
180
|
-
export async function calcPreVerificationGas({ config, userOperation, entryPoint, gasPriceManager, validate, overheads }) {
|
|
181
|
-
let simulationUserOp = {
|
|
182
|
-
...userOperation
|
|
183
|
-
};
|
|
184
|
-
// Add random gasFields during estimations
|
|
185
|
-
if (!validate) {
|
|
186
|
-
simulationUserOp.callGasLimit = randomBigInt({ upper: 10000000n });
|
|
187
|
-
simulationUserOp.verificationGasLimit = randomBigInt({
|
|
188
|
-
upper: 10000000n
|
|
189
|
-
});
|
|
190
|
-
simulationUserOp.preVerificationGas = randomBigInt({
|
|
191
|
-
upper: 10000000n
|
|
192
|
-
});
|
|
193
|
-
if (isVersion07(simulationUserOp)) {
|
|
194
|
-
simulationUserOp.paymasterVerificationGasLimit = randomBigInt({
|
|
195
|
-
upper: 10000000n
|
|
196
|
-
});
|
|
197
|
-
simulationUserOp.paymasterPostOpGasLimit = randomBigInt({
|
|
198
|
-
upper: 10000000n
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
let preVerificationGas = calcDefaultPreVerificationGas(simulationUserOp, overheads);
|
|
203
|
-
switch (config.chainType) {
|
|
204
|
-
case "op-stack":
|
|
205
|
-
return await calcOptimismPreVerificationGas(config.publicClient, simulationUserOp, entryPoint, preVerificationGas, gasPriceManager, validate);
|
|
206
|
-
case "arbitrum":
|
|
207
|
-
return await calcArbitrumPreVerificationGas(config.publicClient, simulationUserOp, entryPoint, preVerificationGas, gasPriceManager, validate);
|
|
208
|
-
case "mantle":
|
|
209
|
-
return await calcMantlePreVerificationGas(config.publicClient, simulationUserOp, entryPoint, preVerificationGas, gasPriceManager, validate);
|
|
210
|
-
case "etherlink":
|
|
211
|
-
return await calcEtherlinkPreVerificationGas(simulationUserOp, entryPoint, preVerificationGas, gasPriceManager, validate);
|
|
212
|
-
default:
|
|
213
|
-
return preVerificationGas;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* calculate the preVerificationGas of the given UserOperation
|
|
218
|
-
* preVerificationGas (by definition) is the cost overhead that can't be calculated on-chain.
|
|
219
|
-
* it is based on parameters that are defined by the Ethereum protocol for external transactions.
|
|
220
|
-
* @param userOp filled userOp to calculate. The only possible missing fields can be the signature and preVerificationGas itself
|
|
221
|
-
* @param overheads gas overheads to use, to override the default values
|
|
222
|
-
*/
|
|
223
|
-
function calcDefaultPreVerificationGas(userOperation, overheads) {
|
|
224
|
-
const ov = { ...DefaultGasOverheads, ...(overheads ?? {}) };
|
|
225
|
-
const p = removeZeroBytesFromUserOp(userOperation);
|
|
226
|
-
let packed;
|
|
227
|
-
if (isVersion06(userOperation)) {
|
|
228
|
-
packed = toBytes(packUserOpV06(p));
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
packed = toBytes(packUserOpV07(p));
|
|
232
|
-
}
|
|
233
|
-
const lengthInWord = (packed.length + 31) / 32;
|
|
234
|
-
const callDataCost = packed
|
|
235
|
-
.map((x) => (x === 0 ? ov.zeroByte : ov.nonZeroByte))
|
|
236
|
-
.reduce((sum, x) => sum + x);
|
|
237
|
-
const authorizationCost = userOperation.eip7702Auth
|
|
238
|
-
? 37500 // overhead for PER_EMPTY_ACCOUNT_COST + PER_AUTH_BASE_COST
|
|
239
|
-
: 0;
|
|
240
|
-
const ret = Math.round(authorizationCost +
|
|
241
|
-
callDataCost +
|
|
242
|
-
ov.fixed / ov.bundleSize +
|
|
243
|
-
ov.perUserOp +
|
|
244
|
-
ov.perUserOpWord * lengthInWord);
|
|
245
|
-
return BigInt(ret);
|
|
246
|
-
}
|
|
247
|
-
// Returns back the bytes for the handleOps call
|
|
248
|
-
export function getHandleOpsCallData({ userOps, entryPoint, removeZeros = true }) {
|
|
249
|
-
if (userOps.length === 0) {
|
|
250
|
-
throw new Error("No user operations provided");
|
|
251
|
-
}
|
|
252
|
-
const isV07 = isVersion07(userOps[0]);
|
|
253
|
-
if (isV07) {
|
|
254
|
-
const processed = removeZeros
|
|
255
|
-
? userOps.map((op) => removeZeroBytesFromUserOp(op))
|
|
256
|
-
: userOps.map((op) => toPackedUserOperation(op));
|
|
257
|
-
return encodeFunctionData({
|
|
258
|
-
abi: EntryPointV07Abi,
|
|
259
|
-
functionName: "handleOps",
|
|
260
|
-
args: [processed, entryPoint]
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
const processed = removeZeros
|
|
264
|
-
? userOps.map((op) => removeZeroBytesFromUserOp(op))
|
|
265
|
-
: userOps;
|
|
266
|
-
return encodeFunctionData({
|
|
267
|
-
abi: EntryPointV06Abi,
|
|
268
|
-
functionName: "handleOps",
|
|
269
|
-
args: [processed, entryPoint]
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
async function calcEtherlinkPreVerificationGas(op, entryPoint, staticFee, gasPriceManager, verify) {
|
|
273
|
-
const data = getHandleOpsCallData({ userOps: [op], entryPoint });
|
|
274
|
-
// Etherlink calculates the inclusion fee (data availability fee) with:
|
|
275
|
-
// 0.000004 XTZ * (150 + tx.data.size() + tx.access_list.size())
|
|
276
|
-
// Get the size of data in bytes
|
|
277
|
-
const dataSize = BigInt(size(data));
|
|
278
|
-
const baseConstant = 150n;
|
|
279
|
-
const xtzRate = parseEther("0.000004");
|
|
280
|
-
const inclusionFee = (baseConstant + dataSize) * xtzRate;
|
|
281
|
-
// Get the current gas price to convert the inclusion fee to gas units
|
|
282
|
-
const maxFeePerGas = await (verify
|
|
283
|
-
? gasPriceManager.getHighestMaxFeePerGas()
|
|
284
|
-
: gasPriceManager.getGasPrice().then((res) => res.maxFeePerGas));
|
|
285
|
-
// Convert the inclusion fee to gas units and add to the static fee
|
|
286
|
-
const inclusionFeeInGas = inclusionFee / maxFeePerGas;
|
|
287
|
-
return staticFee + inclusionFeeInGas;
|
|
288
|
-
}
|
|
289
|
-
async function calcMantlePreVerificationGas(publicClient, op, entryPoint, staticFee, gasPriceManager, verify) {
|
|
290
|
-
const data = getHandleOpsCallData({ userOps: [op], entryPoint });
|
|
291
|
-
const serializedTx = serializeTransaction({
|
|
292
|
-
to: entryPoint,
|
|
293
|
-
chainId: publicClient.chain.id,
|
|
294
|
-
nonce: 999999,
|
|
295
|
-
gasLimit: maxUint64,
|
|
296
|
-
gasPrice: maxUint64,
|
|
297
|
-
data
|
|
298
|
-
}, {
|
|
299
|
-
r: "0x123451234512345123451234512345123451234512345123451234512345",
|
|
300
|
-
s: "0x123451234512345123451234512345123451234512345123451234512345",
|
|
301
|
-
v: 28n
|
|
302
|
-
});
|
|
303
|
-
let tokenRatio;
|
|
304
|
-
let scalar;
|
|
305
|
-
let rollupDataGasAndOverhead;
|
|
306
|
-
let l1GasPrice;
|
|
307
|
-
const mantleManager = gasPriceManager.mantleManager;
|
|
308
|
-
if (verify) {
|
|
309
|
-
const minValues = await mantleManager.getMinMantleOracleValues();
|
|
310
|
-
tokenRatio = minValues.minTokenRatio;
|
|
311
|
-
scalar = minValues.minScalar;
|
|
312
|
-
rollupDataGasAndOverhead = minValues.minRollupDataGasAndOverhead;
|
|
313
|
-
l1GasPrice = minValues.minL1GasPrice;
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
;
|
|
317
|
-
[tokenRatio, scalar, rollupDataGasAndOverhead, l1GasPrice] =
|
|
318
|
-
await Promise.all([
|
|
319
|
-
publicClient.readContract({
|
|
320
|
-
address: "0x420000000000000000000000000000000000000F",
|
|
321
|
-
abi: MantleBvmGasPriceOracleAbi,
|
|
322
|
-
functionName: "tokenRatio"
|
|
323
|
-
}),
|
|
324
|
-
publicClient.readContract({
|
|
325
|
-
address: "0x420000000000000000000000000000000000000F",
|
|
326
|
-
abi: MantleBvmGasPriceOracleAbi,
|
|
327
|
-
functionName: "scalar"
|
|
328
|
-
}),
|
|
329
|
-
publicClient.readContract({
|
|
330
|
-
address: "0x420000000000000000000000000000000000000F",
|
|
331
|
-
abi: MantleBvmGasPriceOracleAbi,
|
|
332
|
-
functionName: "getL1GasUsed",
|
|
333
|
-
args: [serializedTx]
|
|
334
|
-
}),
|
|
335
|
-
publicClient.readContract({
|
|
336
|
-
address: "0x420000000000000000000000000000000000000F",
|
|
337
|
-
abi: MantleBvmGasPriceOracleAbi,
|
|
338
|
-
functionName: "l1BaseFee"
|
|
339
|
-
})
|
|
340
|
-
]);
|
|
341
|
-
mantleManager.saveMantleOracleValues({
|
|
342
|
-
tokenRatio,
|
|
343
|
-
scalar,
|
|
344
|
-
rollupDataGasAndOverhead,
|
|
345
|
-
l1GasPrice
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
const mantleL1RollUpFeeDivisionFactor = 1000000n;
|
|
349
|
-
const l1RollupFee = (rollupDataGasAndOverhead * l1GasPrice * tokenRatio * scalar) /
|
|
350
|
-
mantleL1RollUpFeeDivisionFactor;
|
|
351
|
-
const maxFeePerGas = await (verify
|
|
352
|
-
? gasPriceManager.getHighestMaxFeePerGas()
|
|
353
|
-
: gasPriceManager.getGasPrice().then((res) => res.maxFeePerGas));
|
|
354
|
-
const l2MaxFee = BigInt(maxFeePerGas);
|
|
355
|
-
return staticFee + l1RollupFee / l2MaxFee;
|
|
356
|
-
}
|
|
357
|
-
function getOpStackHandleOpsCallData(op, entryPoint, verify) {
|
|
358
|
-
let modifiedOp = {
|
|
359
|
-
...op
|
|
360
|
-
};
|
|
361
|
-
// Only randomize signature during estimations.
|
|
362
|
-
if (!verify) {
|
|
363
|
-
const randomizeBytes = (length) => toHex(crypto.randomBytes(length).toString("hex"));
|
|
364
|
-
const sigLength = size(op.signature);
|
|
365
|
-
let newSignature;
|
|
366
|
-
if (sigLength < 65) {
|
|
367
|
-
// For short signatures, randomize the entire thing
|
|
368
|
-
newSignature = randomizeBytes(sigLength);
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
// For longer signatures, only randomize the last 65 bytes
|
|
372
|
-
const originalPart = slice(op.signature, 0, sigLength - 65);
|
|
373
|
-
const randomPart = randomizeBytes(65);
|
|
374
|
-
newSignature = concat([originalPart, randomPart]);
|
|
375
|
-
}
|
|
376
|
-
modifiedOp = {
|
|
377
|
-
...op,
|
|
378
|
-
signature: newSignature
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
if (isVersion07(modifiedOp)) {
|
|
382
|
-
return encodeFunctionData({
|
|
383
|
-
abi: EntryPointV07Abi,
|
|
384
|
-
functionName: "handleOps",
|
|
385
|
-
args: [[toPackedUserOperation(modifiedOp)], entryPoint]
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
return encodeFunctionData({
|
|
389
|
-
abi: EntryPointV06Abi,
|
|
390
|
-
functionName: "handleOps",
|
|
391
|
-
args: [[modifiedOp], entryPoint]
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
async function calcOptimismPreVerificationGas(publicClient, op, entryPoint, staticFee, gasPriceManager, validate) {
|
|
395
|
-
const data = getOpStackHandleOpsCallData(op, entryPoint, validate);
|
|
396
|
-
const serializedTx = serializeTransaction({
|
|
397
|
-
to: entryPoint,
|
|
398
|
-
chainId: publicClient.chain.id,
|
|
399
|
-
maxFeePerGas: parseGwei("120"),
|
|
400
|
-
maxPriorityFeePerGas: parseGwei("120"),
|
|
401
|
-
gas: 10000000n,
|
|
402
|
-
data
|
|
403
|
-
}, {
|
|
404
|
-
r: "0x123451234512345123451234512345123451234512345123451234512345",
|
|
405
|
-
s: "0x123451234512345123451234512345123451234512345123451234512345",
|
|
406
|
-
yParity: 1
|
|
407
|
-
});
|
|
408
|
-
const opGasPriceOracle = getContract({
|
|
409
|
-
abi: OpL1FeeAbi,
|
|
410
|
-
address: "0x420000000000000000000000000000000000000F",
|
|
411
|
-
client: {
|
|
412
|
-
public: publicClient
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
const [l1Fee, baseFeePerGas] = await Promise.all([
|
|
416
|
-
validate
|
|
417
|
-
? gasPriceManager.optimismManager.getMinL1Fee()
|
|
418
|
-
: opGasPriceOracle.read.getL1Fee([serializedTx]),
|
|
419
|
-
validate
|
|
420
|
-
? gasPriceManager.getMaxBaseFeePerGas()
|
|
421
|
-
: gasPriceManager.getBaseFee()
|
|
422
|
-
]);
|
|
423
|
-
let l2MaxFee;
|
|
424
|
-
let l2PriorityFee;
|
|
425
|
-
if (validate) {
|
|
426
|
-
l2MaxFee = await gasPriceManager.getHighestMaxFeePerGas();
|
|
427
|
-
l2PriorityFee =
|
|
428
|
-
baseFeePerGas +
|
|
429
|
-
(await gasPriceManager.getHighestMaxPriorityFeePerGas());
|
|
430
|
-
}
|
|
431
|
-
else {
|
|
432
|
-
const gasPrices = await gasPriceManager.getGasPrice();
|
|
433
|
-
l2MaxFee = gasPrices.maxFeePerGas;
|
|
434
|
-
l2PriorityFee = baseFeePerGas + gasPrices.maxPriorityFeePerGas;
|
|
435
|
-
}
|
|
436
|
-
const l2price = minBigInt(l2MaxFee, l2PriorityFee);
|
|
437
|
-
return staticFee + l1Fee / l2price;
|
|
438
|
-
}
|
|
439
|
-
async function calcArbitrumPreVerificationGas(publicClient, op, entryPoint, staticFee, gasPriceManager, validate) {
|
|
440
|
-
const data = getHandleOpsCallData({ userOps: [op], entryPoint });
|
|
441
|
-
const precompileAddress = "0x00000000000000000000000000000000000000C8";
|
|
442
|
-
const serializedTx = serializeTransaction({
|
|
443
|
-
to: entryPoint,
|
|
444
|
-
chainId: publicClient.chain?.id ?? 10,
|
|
445
|
-
nonce: 999999,
|
|
446
|
-
gasLimit: maxUint64,
|
|
447
|
-
gasPrice: maxUint64,
|
|
448
|
-
data
|
|
449
|
-
}, {
|
|
450
|
-
r: "0x123451234512345123451234512345123451234512345123451234512345",
|
|
451
|
-
s: "0x123451234512345123451234512345123451234512345123451234512345",
|
|
452
|
-
v: 28n
|
|
453
|
-
});
|
|
454
|
-
const arbGasPriceOracle = getContract({
|
|
455
|
-
abi: ArbitrumL1FeeAbi,
|
|
456
|
-
address: precompileAddress,
|
|
457
|
-
client: {
|
|
458
|
-
public: publicClient
|
|
459
|
-
}
|
|
460
|
-
});
|
|
461
|
-
const { result } = await arbGasPriceOracle.simulate.gasEstimateL1Component([
|
|
462
|
-
entryPoint,
|
|
463
|
-
false,
|
|
464
|
-
serializedTx
|
|
465
|
-
]);
|
|
466
|
-
let [gasForL1, l2BaseFee, l1BaseFeeEstimate] = result;
|
|
467
|
-
const arbitrumManager = gasPriceManager.arbitrumManager;
|
|
468
|
-
arbitrumManager.saveL1BaseFee(l1BaseFeeEstimate);
|
|
469
|
-
arbitrumManager.saveL2BaseFee(l2BaseFee);
|
|
470
|
-
if (validate) {
|
|
471
|
-
const [maxL1Fee, minL1Fee, maxL2Fee] = await Promise.all([
|
|
472
|
-
l1BaseFeeEstimate || arbitrumManager.getMaxL1BaseFee(),
|
|
473
|
-
arbitrumManager.getMinL1BaseFee(),
|
|
474
|
-
arbitrumManager.getMaxL2BaseFee()
|
|
475
|
-
]);
|
|
476
|
-
gasForL1 = (gasForL1 * l2BaseFee * minL1Fee) / (maxL1Fee * maxL2Fee);
|
|
477
|
-
}
|
|
478
|
-
return staticFee + gasForL1;
|
|
479
|
-
}
|
|
480
|
-
export function parseViemError(err) {
|
|
481
|
-
if (err instanceof ContractFunctionExecutionError ||
|
|
482
|
-
err instanceof TransactionExecutionError) {
|
|
483
|
-
const e = err.cause;
|
|
484
|
-
if (e instanceof NonceTooLowError) {
|
|
485
|
-
return e;
|
|
486
|
-
}
|
|
487
|
-
if (e instanceof FeeCapTooLowError) {
|
|
488
|
-
return e;
|
|
489
|
-
}
|
|
490
|
-
if (e instanceof InsufficientFundsError) {
|
|
491
|
-
return e;
|
|
492
|
-
}
|
|
493
|
-
if (e instanceof IntrinsicGasTooLowError) {
|
|
494
|
-
return e;
|
|
495
|
-
}
|
|
496
|
-
if (e instanceof ContractFunctionRevertedError) {
|
|
497
|
-
return e;
|
|
498
|
-
}
|
|
499
|
-
if (e instanceof EstimateGasExecutionError) {
|
|
500
|
-
return e;
|
|
501
|
-
}
|
|
502
|
-
if (e instanceof InternalRpcError) {
|
|
503
|
-
return e;
|
|
504
|
-
}
|
|
505
|
-
return;
|
|
506
|
-
}
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../utils/validation.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,gBAAgB,EAChB,gBAAgB,EAKhB,0BAA0B,EAC1B,UAAU,EACb,MAAM,aAAa,CAAA;AACpB,OAAO,EAEH,8BAA8B,EAC9B,6BAA6B,EAC7B,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAEhB,yBAAyB,EAEzB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,UAAU,EACV,KAAK,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACR,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,qBAA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