@pimlico/alto 0.0.0-main.20250626T085447 → 0.0.0-main.20250627T140102
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/executorManager.js +1 -1
- package/esm/executor/executorManager.js.map +1 -1
- package/esm/executor/filterOpsAndEstimateGas.js +7 -7
- package/esm/executor/filterOpsAndEstimateGas.js.map +1 -1
- package/esm/executor/getBundleStatus.js +2 -2
- package/esm/executor/getBundleStatus.js.map +1 -1
- package/esm/executor/userOpMonitor.d.ts +1 -1
- package/esm/executor/userOpMonitor.js +17 -17
- package/esm/executor/userOpMonitor.js.map +1 -1
- package/esm/executor/utils.js +5 -2
- package/esm/executor/utils.js.map +1 -1
- package/esm/handlers/eventManager.d.ts +9 -9
- package/esm/handlers/eventManager.js +22 -22
- package/esm/handlers/eventManager.js.map +1 -1
- package/esm/mempool/mempool.js +17 -17
- package/esm/mempool/mempool.js.map +1 -1
- package/esm/mempool/monitoring.d.ts +3 -3
- package/esm/mempool/monitoring.js +11 -11
- package/esm/mempool/monitoring.js.map +1 -1
- package/esm/mempool/reputationManager.d.ts +26 -26
- package/esm/mempool/reputationManager.js +65 -65
- package/esm/mempool/reputationManager.js.map +1 -1
- package/esm/rpc/estimation/gasEstimationHandler.d.ts +8 -8
- package/esm/rpc/estimation/gasEstimationHandler.js +16 -16
- package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
- package/esm/rpc/estimation/{gasEstimationsV06.d.ts → gasEstimations06.d.ts} +5 -5
- 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/boost_sendUserOperation.js +14 -15
- package/esm/rpc/methods/boost_sendUserOperation.js.map +1 -1
- package/esm/rpc/methods/eth_estimateUserOperationGas.js +29 -32
- package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
- package/esm/rpc/methods/eth_getUserOperationByHash.js +6 -6
- package/esm/rpc/methods/eth_getUserOperationByHash.js.map +1 -1
- package/esm/rpc/methods/eth_getUserOperationReceipt.js +3 -3
- package/esm/rpc/methods/eth_getUserOperationReceipt.js.map +1 -1
- package/esm/rpc/methods/eth_sendUserOperation.d.ts +2 -2
- package/esm/rpc/methods/eth_sendUserOperation.js +33 -34
- package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js +2 -2
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js.map +1 -1
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js +11 -11
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -1
- package/esm/rpc/rpcHandler.d.ts +4 -4
- package/esm/rpc/rpcHandler.js +34 -36
- package/esm/rpc/rpcHandler.js.map +1 -1
- package/esm/rpc/validation/SafeValidator.d.ts +13 -13
- package/esm/rpc/validation/SafeValidator.js +59 -57
- package/esm/rpc/validation/SafeValidator.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV06.d.ts +2 -2
- package/esm/rpc/validation/TracerResultParserV06.js +4 -4
- package/esm/rpc/validation/TracerResultParserV06.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV07.d.ts +2 -2
- package/esm/rpc/validation/TracerResultParserV07.js +8 -8
- package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +19 -19
- package/esm/rpc/validation/UnsafeValidator.js +39 -33
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/store/createMemoryOutstandingStore.js +4 -4
- package/esm/store/createMemoryOutstandingStore.js.map +1 -1
- package/esm/store/createMempoolStore.js +2 -2
- package/esm/store/createMempoolStore.js.map +1 -1
- package/esm/store/createRedisOutstandingStore.js +4 -4
- package/esm/store/createRedisOutstandingStore.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 +14 -14
- 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/helpers.d.ts +2 -2
- package/esm/utils/helpers.js +2 -2
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/metrics.d.ts +9 -9
- package/esm/utils/metrics.js +18 -18
- package/esm/utils/metrics.js.map +1 -1
- package/esm/utils/preVerificationGasCalulator.d.ts +3 -3
- package/esm/utils/preVerificationGasCalulator.js +13 -13
- package/esm/utils/preVerificationGasCalulator.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/esm/utils/userop.d.ts +15 -15
- package/esm/utils/userop.js +77 -77
- package/esm/utils/userop.js.map +1 -1
- 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
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { getNonceKeyAndSequence,
|
|
1
|
+
import { getNonceKeyAndSequence, getUserOpHash } from "../../utils/userop.js";
|
|
2
2
|
import { createMethodHandler } from "../createMethodHandler.js";
|
|
3
3
|
import { sendUserOperationSchema, RpcError, ValidationErrors } from "../../types/index.js";
|
|
4
4
|
import { calcExecutionPvgComponent, calcL2PvgComponent, getAAError } from "../../utils/index.js";
|
|
5
|
-
const validatePvg = async (apiVersion, rpcHandler,
|
|
5
|
+
const validatePvg = async (apiVersion, rpcHandler, userOp, entryPoint, boost = false) => {
|
|
6
6
|
// PVG validation is skipped for v1
|
|
7
7
|
if (apiVersion == "v1" || boost) {
|
|
8
8
|
return [true, ""];
|
|
9
9
|
}
|
|
10
10
|
const executionGasComponent = calcExecutionPvgComponent({
|
|
11
|
-
userOp
|
|
11
|
+
userOp,
|
|
12
12
|
supportsEip7623: rpcHandler.config.supportsEip7623,
|
|
13
13
|
config: rpcHandler.config
|
|
14
14
|
});
|
|
15
15
|
const l2GasComponent = await calcL2PvgComponent({
|
|
16
16
|
config: rpcHandler.config,
|
|
17
|
-
|
|
17
|
+
userOp,
|
|
18
18
|
entryPoint,
|
|
19
19
|
gasPriceManager: rpcHandler.gasPriceManager,
|
|
20
20
|
validate: true
|
|
21
21
|
});
|
|
22
22
|
const requiredPvg = executionGasComponent + l2GasComponent;
|
|
23
|
-
if (requiredPvg >
|
|
23
|
+
if (requiredPvg > userOp.preVerificationGas) {
|
|
24
24
|
return [
|
|
25
25
|
false,
|
|
26
|
-
`preVerificationGas is not enough, required: ${requiredPvg}, got: ${
|
|
26
|
+
`preVerificationGas is not enough, required: ${requiredPvg}, got: ${userOp.preVerificationGas}`
|
|
27
27
|
];
|
|
28
28
|
}
|
|
29
29
|
return [true, ""];
|
|
30
30
|
};
|
|
31
|
-
const getUserOpValidationResult = async (rpcHandler,
|
|
32
|
-
const
|
|
33
|
-
userOp
|
|
31
|
+
const getUserOpValidationResult = async (rpcHandler, userOp, entryPoint) => {
|
|
32
|
+
const queuedUserOps = await rpcHandler.mempool.getQueuedOustandingUserOps({
|
|
33
|
+
userOp,
|
|
34
34
|
entryPoint
|
|
35
35
|
});
|
|
36
|
-
const validationResult = await rpcHandler.validator.
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const validationResult = await rpcHandler.validator.validateUserOp({
|
|
37
|
+
userOp,
|
|
38
|
+
queuedUserOps,
|
|
39
39
|
entryPoint
|
|
40
40
|
});
|
|
41
41
|
return {
|
|
42
|
-
|
|
42
|
+
queuedUserOps,
|
|
43
43
|
validationResult
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
export async function addToMempoolIfValid({ rpcHandler,
|
|
46
|
+
export async function addToMempoolIfValid({ rpcHandler, userOp, entryPoint, apiVersion, boost = false }) {
|
|
47
47
|
rpcHandler.ensureEntryPointIsSupported(entryPoint);
|
|
48
48
|
// Execute multiple async operations in parallel
|
|
49
|
-
const [userOpHash, {
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const [userOpHash, { queuedUserOps, validationResult }, currentNonceSeq, [pvgSuccess, pvgErrorReason], [preMempoolSuccess, preMempoolError], [validEip7702Auth, validEip7702AuthError]] = await Promise.all([
|
|
50
|
+
getUserOpHash({
|
|
51
|
+
userOp,
|
|
52
52
|
entryPointAddress: entryPoint,
|
|
53
53
|
chainId: rpcHandler.config.chainId,
|
|
54
54
|
publicClient: rpcHandler.config.publicClient
|
|
55
55
|
}),
|
|
56
|
-
getUserOpValidationResult(rpcHandler,
|
|
57
|
-
rpcHandler.getNonceSeq(
|
|
58
|
-
validatePvg(apiVersion, rpcHandler,
|
|
59
|
-
rpcHandler.preMempoolChecks(
|
|
56
|
+
getUserOpValidationResult(rpcHandler, userOp, entryPoint),
|
|
57
|
+
rpcHandler.getNonceSeq(userOp, entryPoint),
|
|
58
|
+
validatePvg(apiVersion, rpcHandler, userOp, entryPoint, boost),
|
|
59
|
+
rpcHandler.preMempoolChecks(userOp, apiVersion, boost),
|
|
60
60
|
rpcHandler.validateEip7702Auth({
|
|
61
|
-
|
|
61
|
+
userOp,
|
|
62
62
|
validateSender: true
|
|
63
63
|
})
|
|
64
64
|
]);
|
|
@@ -78,7 +78,7 @@ export async function addToMempoolIfValid({ rpcHandler, userOperation, entryPoin
|
|
|
78
78
|
throw new RpcError(pvgErrorReason, ValidationErrors.SimulateValidation);
|
|
79
79
|
}
|
|
80
80
|
// Nonce validation
|
|
81
|
-
const [, userOpNonceSeq] = getNonceKeyAndSequence(
|
|
81
|
+
const [, userOpNonceSeq] = getNonceKeyAndSequence(userOp.nonce);
|
|
82
82
|
if (userOpNonceSeq < currentNonceSeq) {
|
|
83
83
|
const reason = "UserOperation failed validation with reason: AA25 invalid account nonce";
|
|
84
84
|
rpcHandler.eventManager.emitFailedValidation(userOpHash, reason, "AA25");
|
|
@@ -89,15 +89,14 @@ export async function addToMempoolIfValid({ rpcHandler, userOperation, entryPoin
|
|
|
89
89
|
rpcHandler.eventManager.emitFailedValidation(userOpHash, reason, "AA25");
|
|
90
90
|
throw new RpcError(reason, ValidationErrors.InvalidFields);
|
|
91
91
|
}
|
|
92
|
-
if (userOpNonceSeq >
|
|
93
|
-
|
|
94
|
-
rpcHandler.mempool.add(userOperation, entryPoint);
|
|
92
|
+
if (userOpNonceSeq > currentNonceSeq + BigInt(queuedUserOps.length)) {
|
|
93
|
+
rpcHandler.mempool.add(userOp, entryPoint);
|
|
95
94
|
rpcHandler.eventManager.emitQueued(userOpHash);
|
|
96
95
|
return { result: "queued", userOpHash };
|
|
97
96
|
}
|
|
98
97
|
// userOp validation
|
|
99
98
|
if (rpcHandler.config.dangerousSkipUserOperationValidation) {
|
|
100
|
-
const [isMempoolAddSuccess, mempoolAddError] = await rpcHandler.mempool.add(
|
|
99
|
+
const [isMempoolAddSuccess, mempoolAddError] = await rpcHandler.mempool.add(userOp, entryPoint);
|
|
101
100
|
if (!isMempoolAddSuccess) {
|
|
102
101
|
rpcHandler.eventManager.emitFailedValidation(userOpHash, mempoolAddError, getAAError(mempoolAddError));
|
|
103
102
|
throw new RpcError(mempoolAddError, ValidationErrors.InvalidFields);
|
|
@@ -105,10 +104,10 @@ export async function addToMempoolIfValid({ rpcHandler, userOperation, entryPoin
|
|
|
105
104
|
return { result: "added", userOpHash };
|
|
106
105
|
}
|
|
107
106
|
// ERC-7562 scope rule validation
|
|
108
|
-
rpcHandler.reputationManager.checkReputation(
|
|
109
|
-
await rpcHandler.mempool.checkEntityMultipleRoleViolation(entryPoint,
|
|
107
|
+
rpcHandler.reputationManager.checkReputation(userOp, entryPoint, validationResult);
|
|
108
|
+
await rpcHandler.mempool.checkEntityMultipleRoleViolation(entryPoint, userOp);
|
|
110
109
|
// Finally, add to mempool
|
|
111
|
-
const [isMempoolAddSuccess, mempoolAddError] = await rpcHandler.mempool.add(
|
|
110
|
+
const [isMempoolAddSuccess, mempoolAddError] = await rpcHandler.mempool.add(userOp, entryPoint, validationResult.referencedContracts);
|
|
112
111
|
if (!isMempoolAddSuccess) {
|
|
113
112
|
rpcHandler.eventManager.emitFailedValidation(userOpHash, mempoolAddError, getAAError(mempoolAddError));
|
|
114
113
|
throw new RpcError(mempoolAddError, ValidationErrors.InvalidFields);
|
|
@@ -119,12 +118,12 @@ export const ethSendUserOperationHandler = createMethodHandler({
|
|
|
119
118
|
method: "eth_sendUserOperation",
|
|
120
119
|
schema: sendUserOperationSchema,
|
|
121
120
|
handler: async ({ rpcHandler, params, apiVersion }) => {
|
|
122
|
-
const [
|
|
121
|
+
const [userOp, entryPoint] = params;
|
|
123
122
|
let status = "rejected";
|
|
124
123
|
try {
|
|
125
124
|
const { result, userOpHash } = await addToMempoolIfValid({
|
|
126
125
|
rpcHandler,
|
|
127
|
-
|
|
126
|
+
userOp,
|
|
128
127
|
entryPoint,
|
|
129
128
|
apiVersion
|
|
130
129
|
});
|
|
@@ -137,10 +136,10 @@ export const ethSendUserOperationHandler = createMethodHandler({
|
|
|
137
136
|
throw error;
|
|
138
137
|
}
|
|
139
138
|
finally {
|
|
140
|
-
rpcHandler.metrics.
|
|
139
|
+
rpcHandler.metrics.userOpsReceived
|
|
141
140
|
.labels({
|
|
142
141
|
status,
|
|
143
|
-
type: !!
|
|
142
|
+
type: !!userOp.eip7702Auth ? "7702" : "regular"
|
|
144
143
|
})
|
|
145
144
|
.inc();
|
|
146
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth_sendUserOperation.js","sourceRoot":"","sources":["../../../rpc/methods/eth_sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"eth_sendUserOperation.js","sourceRoot":"","sources":["../../../rpc/methods/eth_sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EACH,uBAAuB,EACvB,QAAQ,EACR,gBAAgB,EAKnB,MAAM,aAAa,CAAA;AACpB,OAAO,EACH,yBAAyB,EACzB,kBAAkB,EAClB,UAAU,EACb,MAAM,aAAa,CAAA;AAKpB,MAAM,WAAW,GAAG,KAAK,EACrB,UAAsB,EAC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,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE;QAClD,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAAA;QAEnC,IAAI,MAAM,GAAoC,UAAU,CAAA;QACxD,IAAI,CAAC;YACD,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,mBAAmB,CAAC;gBACrD,UAAU;gBACV,MAAM;gBACN,UAAU;gBACV,UAAU;aACb,CAAC,CAAA;YAEF,MAAM,GAAG,MAAM,CAAA;YAEf,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;YAEhD,OAAO,UAAU,CAAA;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,GAAG,UAAU,CAAA;YACnB,MAAM,KAAK,CAAA;QACf,CAAC;gBAAS,CAAC;YACP,UAAU,CAAC,OAAO,CAAC,eAAe;iBAC7B,MAAM,CAAC;gBACJ,MAAM;gBACN,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;aAClD,CAAC;iBACD,GAAG,EAAE,CAAA;QACd,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"}
|
|
@@ -4,8 +4,8 @@ export const pimlicoGetUserOperationStatusHandler = createMethodHandler({
|
|
|
4
4
|
method: "pimlico_getUserOperationStatus",
|
|
5
5
|
schema: pimlicoGetUserOperationStatusSchema,
|
|
6
6
|
handler: ({ rpcHandler, params }) => {
|
|
7
|
-
const [
|
|
8
|
-
return rpcHandler.monitor.
|
|
7
|
+
const [userOpHash] = params;
|
|
8
|
+
return rpcHandler.monitor.getUserOpStatus(userOpHash);
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=pimlico_getUserOperationStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico_getUserOperationStatus.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_getUserOperationStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,mCAAmC,EAAE,MAAM,aAAa,CAAA;AAEjE,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC;IACpE,MAAM,EAAE,gCAAgC;IACxC,MAAM,EAAE,mCAAmC;IAC3C,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QAChC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"pimlico_getUserOperationStatus.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_getUserOperationStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,mCAAmC,EAAE,MAAM,aAAa,CAAA;AAEjE,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC;IACpE,MAAM,EAAE,gCAAgC;IACxC,MAAM,EAAE,mCAAmC;IAC3C,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QAChC,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAA;QAC3B,OAAO,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;IACzD,CAAC;CACJ,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getUserOpHash, isVersion07, isVersion08, parseUserOpReceipt } from "../../utils/index.js";
|
|
2
2
|
import { createMethodHandler } from "../createMethodHandler.js";
|
|
3
3
|
import { RpcError, ValidationErrors, pimlicoSendUserOperationNowSchema } from "../../types/index.js";
|
|
4
4
|
export const pimlicoSendUserOperationNowHandler = createMethodHandler({
|
|
@@ -8,23 +8,23 @@ export const pimlicoSendUserOperationNowHandler = createMethodHandler({
|
|
|
8
8
|
if (!rpcHandler.config.enableInstantBundlingEndpoint) {
|
|
9
9
|
throw new RpcError("pimlico_sendUserOperationNow endpoint is not enabled", ValidationErrors.InvalidFields);
|
|
10
10
|
}
|
|
11
|
-
const [
|
|
11
|
+
const [userOp, entryPoint] = params;
|
|
12
12
|
rpcHandler.ensureEntryPointIsSupported(entryPoint);
|
|
13
|
-
const opHash = await
|
|
14
|
-
|
|
13
|
+
const opHash = await getUserOpHash({
|
|
14
|
+
userOp,
|
|
15
15
|
entryPointAddress: entryPoint,
|
|
16
16
|
chainId: rpcHandler.config.chainId,
|
|
17
17
|
publicClient: rpcHandler.config.publicClient
|
|
18
18
|
});
|
|
19
|
-
const [preMempoolValid, preMempoolError] = await rpcHandler.preMempoolChecks(
|
|
19
|
+
const [preMempoolValid, preMempoolError] = await rpcHandler.preMempoolChecks(userOp, apiVersion);
|
|
20
20
|
if (!preMempoolValid) {
|
|
21
21
|
throw new RpcError(preMempoolError);
|
|
22
22
|
}
|
|
23
23
|
// Prepare bundle
|
|
24
24
|
const userOpInfo = {
|
|
25
|
-
userOp
|
|
26
|
-
userOpHash: await
|
|
27
|
-
|
|
25
|
+
userOp,
|
|
26
|
+
userOpHash: await getUserOpHash({
|
|
27
|
+
userOp,
|
|
28
28
|
entryPointAddress: entryPoint,
|
|
29
29
|
chainId: rpcHandler.config.chainId,
|
|
30
30
|
publicClient: rpcHandler.config.publicClient
|
|
@@ -34,10 +34,10 @@ export const pimlicoSendUserOperationNowHandler = createMethodHandler({
|
|
|
34
34
|
};
|
|
35
35
|
// Derive version
|
|
36
36
|
let version;
|
|
37
|
-
if (isVersion08(
|
|
37
|
+
if (isVersion08(userOp, entryPoint)) {
|
|
38
38
|
version = "0.8";
|
|
39
39
|
}
|
|
40
|
-
else if (isVersion07(
|
|
40
|
+
else if (isVersion07(userOp)) {
|
|
41
41
|
version = "0.7";
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
@@ -59,7 +59,7 @@ export const pimlicoSendUserOperationNowHandler = createMethodHandler({
|
|
|
59
59
|
hash: result,
|
|
60
60
|
pollingInterval: 100
|
|
61
61
|
});
|
|
62
|
-
return
|
|
62
|
+
return parseUserOpReceipt(opHash, receipt);
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
//# sourceMappingURL=pimlico_sendUserOperationNow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico_sendUserOperationNow.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_sendUserOperationNow.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"pimlico_sendUserOperationNow.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_sendUserOperationNow.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,WAAW,EACX,WAAW,EACX,kBAAkB,EACrB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EACH,QAAQ,EAGR,gBAAgB,EAChB,iCAAiC,EACpC,MAAM,aAAa,CAAA;AAGpB,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,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAAA;QACnC,UAAU,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAA;QAElD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;YAC/B,MAAM;YACN,iBAAiB,EAAE,UAAU;YAC7B,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO;YAClC,YAA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AQ,CACd,0CAA0C,EAC1C,gBAAgB,CAAC,aAAa,CACjC,CAAA;QACL,CAAC;QAED,oBAAoB;QACpB,MAAM,OAAO,GACT,MAAM,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,yBAAyB,CAAC;YAC3D,IAAI,EAAE,MAAM;YACZ,eAAe,EAAE,GAAG;SACvB,CAAC,CAAA;QAEN,OAAO,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;CACJ,CAAC,CAAA"}
|
package/esm/rpc/rpcHandler.d.ts
CHANGED
|
@@ -39,14 +39,14 @@ export declare class RpcHandler {
|
|
|
39
39
|
handleMethod(request: BundlerRequest, apiVersion: ApiVersion): Promise<any>;
|
|
40
40
|
ensureEntryPointIsSupported(entryPoint: Address): void;
|
|
41
41
|
ensureDebugEndpointsAreEnabled(methodName: string): void;
|
|
42
|
-
preMempoolChecks(
|
|
43
|
-
validateEip7702Auth({
|
|
44
|
-
|
|
42
|
+
preMempoolChecks(userOp: UserOperation, apiVersion: ApiVersion, boost?: boolean): Promise<[boolean, string]>;
|
|
43
|
+
validateEip7702Auth({ userOp, validateSender }: {
|
|
44
|
+
userOp: UserOperation;
|
|
45
45
|
validateSender?: boolean;
|
|
46
46
|
}): Promise<[
|
|
47
47
|
boolean,
|
|
48
48
|
string
|
|
49
49
|
]>;
|
|
50
|
-
getNonceSeq(
|
|
50
|
+
getNonceSeq(userOp: UserOperation, entryPoint: Address): Promise<bigint>;
|
|
51
51
|
}
|
|
52
52
|
//# sourceMappingURL=rpcHandler.d.ts.map
|
package/esm/rpc/rpcHandler.js
CHANGED
|
@@ -63,9 +63,9 @@ export class RpcHandler {
|
|
|
63
63
|
throw new RpcError(`${methodName} is only available in development environment`);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
async preMempoolChecks(
|
|
66
|
+
async preMempoolChecks(userOp, apiVersion, boost = false) {
|
|
67
67
|
if (this.config.legacyTransactions &&
|
|
68
|
-
|
|
68
|
+
userOp.maxFeePerGas !== userOp.maxPriorityFeePerGas) {
|
|
69
69
|
return [
|
|
70
70
|
false,
|
|
71
71
|
"maxPriorityFeePerGas must equal maxFeePerGas on chains that don't support EIP-1559"
|
|
@@ -73,8 +73,8 @@ export class RpcHandler {
|
|
|
73
73
|
}
|
|
74
74
|
if (apiVersion !== "v1" && !this.config.safeMode && !boost) {
|
|
75
75
|
const { lowestMaxFeePerGas, lowestMaxPriorityFeePerGas } = await this.gasPriceManager.getLowestValidGasPrices();
|
|
76
|
-
const maxFeePerGas =
|
|
77
|
-
const maxPriorityFeePerGas =
|
|
76
|
+
const maxFeePerGas = userOp.maxFeePerGas;
|
|
77
|
+
const maxPriorityFeePerGas = userOp.maxPriorityFeePerGas;
|
|
78
78
|
if (maxFeePerGas < lowestMaxFeePerGas) {
|
|
79
79
|
return [
|
|
80
80
|
false,
|
|
@@ -88,23 +88,23 @@ export class RpcHandler {
|
|
|
88
88
|
];
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
if (
|
|
91
|
+
if (userOp.verificationGasLimit < 10000n) {
|
|
92
92
|
return [false, "verificationGasLimit must be at least 10000"];
|
|
93
93
|
}
|
|
94
|
-
if (!boost &&
|
|
94
|
+
if (!boost && userOp.preVerificationGas === 0n) {
|
|
95
95
|
return [
|
|
96
96
|
false,
|
|
97
97
|
"userOperation preVerification gas must be larger than 0"
|
|
98
98
|
];
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
100
|
+
if (userOp.verificationGasLimit === 0n) {
|
|
101
101
|
return [
|
|
102
102
|
false,
|
|
103
103
|
"userOperation verification gas limit must be larger than 0"
|
|
104
104
|
];
|
|
105
105
|
}
|
|
106
106
|
const gasLimits = calculateAA95GasFloor({
|
|
107
|
-
userOps: [
|
|
107
|
+
userOps: [userOp],
|
|
108
108
|
beneficiary: privateKeyToAddress(generatePrivateKey())
|
|
109
109
|
});
|
|
110
110
|
if (gasLimits > this.config.maxGasPerBundle) {
|
|
@@ -115,34 +115,34 @@ export class RpcHandler {
|
|
|
115
115
|
}
|
|
116
116
|
return [true, ""];
|
|
117
117
|
}
|
|
118
|
-
async validateEip7702Auth({
|
|
119
|
-
if (!
|
|
118
|
+
async validateEip7702Auth({ userOp, validateSender = false }) {
|
|
119
|
+
if (!userOp.eip7702Auth) {
|
|
120
120
|
return [true, ""];
|
|
121
121
|
}
|
|
122
122
|
if (!this.config.codeOverrideSupport) {
|
|
123
123
|
return [false, "eip7702Auth is not supported on this chain"];
|
|
124
124
|
}
|
|
125
125
|
// Check that auth is valid.
|
|
126
|
-
const delegationDesignator = "address" in
|
|
127
|
-
?
|
|
128
|
-
:
|
|
126
|
+
const delegationDesignator = "address" in userOp.eip7702Auth
|
|
127
|
+
? userOp.eip7702Auth.address
|
|
128
|
+
: userOp.eip7702Auth.contractAddress;
|
|
129
129
|
// Fetch onchain data in parallel
|
|
130
130
|
const [sender, nonceOnChain, delegateCode] = await Promise.all([
|
|
131
131
|
validateSender
|
|
132
132
|
? recoverAuthorizationAddress({
|
|
133
133
|
authorization: {
|
|
134
134
|
address: delegationDesignator,
|
|
135
|
-
chainId:
|
|
136
|
-
nonce:
|
|
137
|
-
r:
|
|
138
|
-
s:
|
|
139
|
-
v:
|
|
140
|
-
yParity:
|
|
135
|
+
chainId: userOp.eip7702Auth.chainId,
|
|
136
|
+
nonce: userOp.eip7702Auth.nonce,
|
|
137
|
+
r: userOp.eip7702Auth.r,
|
|
138
|
+
s: userOp.eip7702Auth.s,
|
|
139
|
+
v: userOp.eip7702Auth.v,
|
|
140
|
+
yParity: userOp.eip7702Auth.yParity
|
|
141
141
|
}
|
|
142
142
|
})
|
|
143
|
-
: Promise.resolve(
|
|
143
|
+
: Promise.resolve(userOp.sender),
|
|
144
144
|
this.config.publicClient.getTransactionCount({
|
|
145
|
-
address:
|
|
145
|
+
address: userOp.sender
|
|
146
146
|
}),
|
|
147
147
|
this.eip7702CodeCache.has(delegationDesignator)
|
|
148
148
|
? Promise.resolve("has-code")
|
|
@@ -150,40 +150,40 @@ export class RpcHandler {
|
|
|
150
150
|
address: delegationDesignator
|
|
151
151
|
})
|
|
152
152
|
]);
|
|
153
|
-
if (
|
|
154
|
-
|
|
153
|
+
if (userOp.eip7702Auth.chainId !== this.config.chainId &&
|
|
154
|
+
userOp.eip7702Auth.chainId !== 0) {
|
|
155
155
|
return [
|
|
156
156
|
false,
|
|
157
157
|
"Invalid EIP-7702 authorization: The chainId does not match the userOperation sender address"
|
|
158
158
|
];
|
|
159
159
|
}
|
|
160
|
-
if (![0, 1].includes(
|
|
160
|
+
if (![0, 1].includes(userOp.eip7702Auth.yParity)) {
|
|
161
161
|
return [
|
|
162
162
|
false,
|
|
163
163
|
"Invalid EIP-7702 authorization: The yParity value must be either 0 or 1"
|
|
164
164
|
];
|
|
165
165
|
}
|
|
166
|
-
if (nonceOnChain !==
|
|
166
|
+
if (nonceOnChain !== userOp.eip7702Auth.nonce) {
|
|
167
167
|
return [
|
|
168
168
|
false,
|
|
169
169
|
"Invalid EIP-7702 authorization: The nonce does not match the userOperation sender address"
|
|
170
170
|
];
|
|
171
171
|
}
|
|
172
|
-
if (sender !==
|
|
172
|
+
if (sender !== userOp.sender) {
|
|
173
173
|
return [
|
|
174
174
|
false,
|
|
175
175
|
"Invalid EIP-7702 authorization: The recovered signer address does not match the userOperation sender address"
|
|
176
176
|
];
|
|
177
177
|
}
|
|
178
|
-
if (isVersion06(
|
|
178
|
+
if (isVersion06(userOp) && userOp.initCode !== "0x") {
|
|
179
179
|
return [
|
|
180
180
|
false,
|
|
181
181
|
"Invalid EIP-7702 authorization: UserOperation cannot contain initCode."
|
|
182
182
|
];
|
|
183
183
|
}
|
|
184
|
-
if (isVersion07(
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
if (isVersion07(userOp) &&
|
|
185
|
+
userOp.factory !== "0x7702" &&
|
|
186
|
+
userOp.factory !== null) {
|
|
187
187
|
return [
|
|
188
188
|
false,
|
|
189
189
|
"Invalid EIP-7702 authorization: UserOperation cannot contain factory that is neither null or 0x7702."
|
|
@@ -209,18 +209,16 @@ export class RpcHandler {
|
|
|
209
209
|
}
|
|
210
210
|
return [true, ""];
|
|
211
211
|
}
|
|
212
|
-
async getNonceSeq(
|
|
212
|
+
async getNonceSeq(userOp, entryPoint) {
|
|
213
213
|
const entryPointContract = getContract({
|
|
214
214
|
address: entryPoint,
|
|
215
|
-
abi: isVersion06(
|
|
216
|
-
? EntryPointV06Abi
|
|
217
|
-
: EntryPointV07Abi,
|
|
215
|
+
abi: isVersion06(userOp) ? EntryPointV06Abi : EntryPointV07Abi,
|
|
218
216
|
client: {
|
|
219
217
|
public: this.config.publicClient
|
|
220
218
|
}
|
|
221
219
|
});
|
|
222
|
-
const [nonceKey] = getNonceKeyAndSequence(
|
|
223
|
-
const getNonceResult = await entryPointContract.read.getNonce([
|
|
220
|
+
const [nonceKey] = getNonceKeyAndSequence(userOp.nonce);
|
|
221
|
+
const getNonceResult = await entryPointContract.read.getNonce([userOp.sender, nonceKey], {
|
|
224
222
|
blockTag: "latest"
|
|
225
223
|
});
|
|
226
224
|
const [_, currentNonceSeq] = getNonceKeyAndSequence(getNonceResult);
|
|
@@ -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,EAAE,sBAAsB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE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C,YAAY;aACnC;SACJ,CAAC,CAAA;QAEF,MAAM,CAAC,QAAQ,CAAC,GAAG,sBAAsB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAEvD,MAAM,cAAc,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CACzD,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EACzB;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"}
|
|
@@ -14,9 +14,9 @@ export declare class SafeValidator extends UnsafeValidator implements InterfaceV
|
|
|
14
14
|
metrics: Metrics;
|
|
15
15
|
gasPriceManager: GasPriceManager;
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
validateUserOp(args: {
|
|
18
|
+
userOp: UserOperation;
|
|
19
|
+
queuedUserOps: UserOperation[];
|
|
20
20
|
entryPoint: Address;
|
|
21
21
|
referencedContracts?: ReferencedCodeHashes;
|
|
22
22
|
}): Promise<(ValidationResult | ValidationResultWithAggregation) & {
|
|
@@ -24,28 +24,28 @@ export declare class SafeValidator extends UnsafeValidator implements InterfaceV
|
|
|
24
24
|
referencedContracts?: ReferencedCodeHashes;
|
|
25
25
|
}>;
|
|
26
26
|
getCodeHashes(addresses: string[]): Promise<ReferencedCodeHashes>;
|
|
27
|
-
getValidationResultV07(
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
getValidationResultV07(args: {
|
|
28
|
+
userOp: UserOperationV07;
|
|
29
|
+
queuedUserOps: UserOperation[];
|
|
30
30
|
entryPoint: Address;
|
|
31
|
-
|
|
31
|
+
codeHashes?: ReferencedCodeHashes;
|
|
32
32
|
}): Promise<(ValidationResultV07 | ValidationResultWithAggregationV07) & {
|
|
33
33
|
storageMap: StorageMap;
|
|
34
34
|
referencedContracts?: ReferencedCodeHashes;
|
|
35
35
|
}>;
|
|
36
|
-
getValidationResultV06(
|
|
37
|
-
|
|
36
|
+
getValidationResultV06(args: {
|
|
37
|
+
userOp: UserOperationV06;
|
|
38
38
|
entryPoint: Address;
|
|
39
|
-
|
|
39
|
+
codeHashes?: ReferencedCodeHashes;
|
|
40
40
|
}): Promise<(ValidationResultV06 | ValidationResultWithAggregationV06) & {
|
|
41
41
|
referencedContracts?: ReferencedCodeHashes;
|
|
42
42
|
storageMap: StorageMap;
|
|
43
43
|
}>;
|
|
44
|
-
getValidationResultWithTracerV06(
|
|
45
|
-
parseErrorResultV06(
|
|
44
|
+
getValidationResultWithTracerV06(userOp: UserOperationV06, entryPoint: Address): Promise<[ValidationResultV06, BundlerTracerResult]>;
|
|
45
|
+
parseErrorResultV06(userOp: UserOperationV06, errorResult: {
|
|
46
46
|
errorName: string;
|
|
47
47
|
errorArgs: any;
|
|
48
48
|
}): ValidationResult | ValidationResultWithAggregation;
|
|
49
|
-
getValidationResultWithTracerV07(
|
|
49
|
+
getValidationResultWithTracerV07(userOp: UserOperationV07, queuedUserOps: UserOperationV07[], entryPoint: Address): Promise<[ValidationResultV07, BundlerTracerResult]>;
|
|
50
50
|
}
|
|
51
51
|
//# sourceMappingURL=SafeValidator.d.ts.map
|