@pimlico/alto 0.0.2 → 0.0.4
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/alto.d.ts +6 -0
- package/esm/cli/alto.js +92 -0
- package/esm/cli/alto.js.map +1 -0
- package/esm/cli/config/bundler.d.ts +403 -0
- package/esm/cli/config/bundler.js +134 -0
- package/esm/cli/config/bundler.js.map +1 -0
- package/esm/cli/config/index.d.ts +3 -0
- package/esm/cli/config/index.js +3 -0
- package/esm/cli/config/index.js.map +1 -0
- package/esm/cli/config/options.d.ts +11 -0
- package/esm/cli/config/options.js +348 -0
- package/esm/cli/config/options.js.map +1 -0
- package/esm/cli/customTransport.d.ts +14 -0
- package/esm/cli/customTransport.js +53 -0
- package/esm/cli/customTransport.js.map +1 -0
- package/esm/cli/handler.d.ts +3 -0
- package/esm/cli/handler.js +140 -0
- package/esm/cli/handler.js.map +1 -0
- package/esm/cli/index.d.ts +4 -0
- package/esm/cli/index.js +4 -0
- package/esm/cli/index.js.map +1 -0
- package/esm/cli/instrumentation.d.ts +2 -0
- package/esm/cli/instrumentation.js +39 -0
- package/esm/cli/instrumentation.js.map +1 -0
- package/esm/cli/setupServer.d.ts +17 -0
- package/esm/cli/setupServer.js +155 -0
- package/esm/cli/setupServer.js.map +1 -0
- package/esm/cli/util.d.ts +22 -0
- package/esm/cli/util.js +30 -0
- package/esm/cli/util.js.map +1 -0
- package/esm/executor/executor.d.ts +55 -0
- package/esm/executor/executor.js +645 -0
- package/esm/executor/executor.js.map +1 -0
- package/esm/executor/executorManager.d.ts +34 -0
- package/esm/executor/executorManager.js +402 -0
- package/esm/executor/executorManager.js.map +1 -0
- package/esm/executor/index.d.ts +5 -0
- package/esm/executor/index.js +5 -0
- package/esm/executor/index.js.map +1 -0
- package/esm/executor/senderManager.d.ts +17 -0
- package/esm/executor/senderManager.js +160 -0
- package/esm/executor/senderManager.js.map +1 -0
- package/esm/executor/test/utils.d.ts +13 -0
- package/esm/executor/test/utils.js +75 -0
- package/esm/executor/test/utils.js.map +1 -0
- package/esm/executor/utils.d.ts +32 -0
- package/esm/executor/utils.js +241 -0
- package/esm/executor/utils.js.map +1 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -0
- package/esm/mempool/index.d.ts +5 -0
- package/esm/mempool/index.js +5 -0
- package/esm/mempool/index.js.map +1 -0
- package/esm/mempool/mempool.d.ts +64 -0
- package/esm/mempool/mempool.js +487 -0
- package/esm/mempool/mempool.js.map +1 -0
- package/esm/mempool/monitoring.d.ts +10 -0
- package/esm/mempool/monitoring.js +34 -0
- package/esm/mempool/monitoring.js.map +1 -0
- package/esm/mempool/nullMempool.d.ts +15 -0
- package/esm/mempool/nullMempool.js +36 -0
- package/esm/mempool/nullMempool.js.map +1 -0
- package/esm/mempool/reputationManager.d.ts +115 -0
- package/esm/mempool/reputationManager.js +401 -0
- package/esm/mempool/reputationManager.js.map +1 -0
- package/esm/mempool/store.d.ts +22 -0
- package/esm/mempool/store.js +123 -0
- package/esm/mempool/store.js.map +1 -0
- package/esm/rpc/EntryPointSimulationsV07.d.ts +62 -0
- package/esm/rpc/EntryPointSimulationsV07.js +407 -0
- package/esm/rpc/EntryPointSimulationsV07.js.map +1 -0
- package/esm/rpc/ExecuteSimulator.d.ts +37 -0
- package/esm/rpc/ExecuteSimulator.js +48 -0
- package/esm/rpc/ExecuteSimulator.js.map +1 -0
- package/esm/rpc/gasEstimation.d.ts +17 -0
- package/esm/rpc/gasEstimation.js +414 -0
- package/esm/rpc/gasEstimation.js.map +1 -0
- package/esm/rpc/index.d.ts +5 -0
- package/esm/rpc/index.js +5 -0
- package/esm/rpc/index.js.map +1 -0
- package/esm/rpc/nonceQueuer.d.ts +25 -0
- package/esm/rpc/nonceQueuer.js +135 -0
- package/esm/rpc/nonceQueuer.js.map +1 -0
- package/esm/rpc/rpcHandler.d.ts +64 -0
- package/esm/rpc/rpcHandler.js +738 -0
- package/esm/rpc/rpcHandler.js.map +1 -0
- package/esm/rpc/server.d.ts +31 -0
- package/esm/rpc/server.js +243 -0
- package/esm/rpc/server.js.map +1 -0
- package/esm/rpc/validation/BundlerCollectorTracerV06.d.ts +102 -0
- package/esm/rpc/validation/BundlerCollectorTracerV06.js +255 -0
- package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +1 -0
- package/esm/rpc/validation/BundlerCollectorTracerV07.d.ts +102 -0
- package/esm/rpc/validation/BundlerCollectorTracerV07.js +254 -0
- package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +1 -0
- package/esm/rpc/validation/SafeValidator.d.ts +31 -0
- package/esm/rpc/validation/SafeValidator.js +330 -0
- package/esm/rpc/validation/SafeValidator.js.map +1 -0
- package/esm/rpc/validation/TracerResultParserV06.d.ts +13 -0
- package/esm/rpc/validation/TracerResultParserV06.js +578 -0
- package/esm/rpc/validation/TracerResultParserV06.js.map +1 -0
- package/esm/rpc/validation/TracerResultParserV07.d.ts +33 -0
- package/esm/rpc/validation/TracerResultParserV07.js +561 -0
- package/esm/rpc/validation/TracerResultParserV07.js.map +1 -0
- package/esm/rpc/validation/UnsafeValidator.d.ts +64 -0
- package/esm/rpc/validation/UnsafeValidator.js +257 -0
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -0
- package/esm/rpc/validation/index.d.ts +3 -0
- package/esm/rpc/validation/index.js +3 -0
- package/esm/rpc/validation/index.js.map +1 -0
- package/esm/rpc/validation/tracer.d.ts +122 -0
- package/esm/rpc/validation/tracer.js +82 -0
- package/esm/rpc/validation/tracer.js.map +1 -0
- package/esm/types/contracts/BundleBulker.d.ts +120 -0
- package/esm/types/contracts/BundleBulker.js +157 -0
- package/esm/types/contracts/BundleBulker.js.map +1 -0
- package/esm/types/contracts/CallEngine.d.ts +28 -0
- package/esm/types/contracts/CallEngine.js +37 -0
- package/esm/types/contracts/CallEngine.js.map +1 -0
- package/esm/types/contracts/CodeHashGetter.d.ts +37 -0
- package/esm/types/contracts/CodeHashGetter.js +45 -0
- package/esm/types/contracts/CodeHashGetter.js.map +1 -0
- package/esm/types/contracts/EntryPoint.d.ts +1789 -0
- package/esm/types/contracts/EntryPoint.js +2304 -0
- package/esm/types/contracts/EntryPoint.js.map +1 -0
- package/esm/types/contracts/EntryPointSimulations.d.ts +152 -0
- package/esm/types/contracts/EntryPointSimulations.js +1954 -0
- package/esm/types/contracts/EntryPointSimulations.js.map +1 -0
- package/esm/types/contracts/IOpInflator.d.ts +61 -0
- package/esm/types/contracts/IOpInflator.js +80 -0
- package/esm/types/contracts/IOpInflator.js.map +1 -0
- package/esm/types/contracts/IPaymaster.d.ts +3 -0
- package/esm/types/contracts/IPaymaster.js +117 -0
- package/esm/types/contracts/IPaymaster.js.map +1 -0
- package/esm/types/contracts/Inflator.d.ts +65 -0
- package/esm/types/contracts/Inflator.js +84 -0
- package/esm/types/contracts/Inflator.js.map +1 -0
- package/esm/types/contracts/PerOpInflator.d.ts +176 -0
- package/esm/types/contracts/PerOpInflator.js +229 -0
- package/esm/types/contracts/PerOpInflator.js.map +1 -0
- package/esm/types/contracts/PimlicoEntryPointSimulations.d.ts +23 -0
- package/esm/types/contracts/PimlicoEntryPointSimulations.js +33 -0
- package/esm/types/contracts/PimlicoEntryPointSimulations.js.map +1 -0
- package/esm/types/contracts/SenderCreator.d.ts +4 -0
- package/esm/types/contracts/SenderCreator.js +23 -0
- package/esm/types/contracts/SenderCreator.js.map +1 -0
- package/esm/types/contracts/SimpleAccountFactory.d.ts +57 -0
- package/esm/types/contracts/SimpleAccountFactory.js +76 -0
- package/esm/types/contracts/SimpleAccountFactory.js.map +1 -0
- package/esm/types/contracts/TestOpcodesAccount.d.ts +4 -0
- package/esm/types/contracts/TestOpcodesAccount.js +281 -0
- package/esm/types/contracts/TestOpcodesAccount.js.map +1 -0
- package/esm/types/contracts/TestOpcodesAccountFactory.d.ts +4 -0
- package/esm/types/contracts/TestOpcodesAccountFactory.js +23 -0
- package/esm/types/contracts/TestOpcodesAccountFactory.js.map +1 -0
- package/esm/types/contracts/TestStorageAccount.d.ts +4 -0
- package/esm/types/contracts/TestStorageAccount.js +313 -0
- package/esm/types/contracts/TestStorageAccount.js.map +1 -0
- package/esm/types/contracts/index.d.ts +17 -0
- package/esm/types/contracts/index.js +17 -0
- package/esm/types/contracts/index.js.map +1 -0
- package/esm/types/gasPrice.d.ts +110 -0
- package/esm/types/gasPrice.js +52 -0
- package/esm/types/gasPrice.js.map +1 -0
- package/esm/types/index.d.ts +11 -0
- package/esm/types/index.js +11 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/interfaces.d.ts +26 -0
- package/esm/types/interfaces.js +2 -0
- package/esm/types/interfaces.js.map +1 -0
- package/esm/types/mempool.d.ts +79 -0
- package/esm/types/mempool.js +16 -0
- package/esm/types/mempool.js.map +1 -0
- package/esm/types/schemas.d.ts +4791 -0
- package/esm/types/schemas.js +497 -0
- package/esm/types/schemas.js.map +1 -0
- package/esm/types/test/validationTestErrors.d.ts +3 -0
- package/esm/types/test/validationTestErrors.js +229 -0
- package/esm/types/test/validationTestErrors.js.map +1 -0
- package/esm/types/utils.d.ts +24 -0
- package/esm/types/utils.js +30 -0
- package/esm/types/utils.js.map +1 -0
- package/esm/types/validation.d.ts +14327 -0
- package/esm/types/validation.js +304 -0
- package/esm/types/validation.js.map +1 -0
- package/esm/utils/bigInt.d.ts +3 -0
- package/esm/utils/bigInt.js +9 -0
- package/esm/utils/bigInt.js.map +1 -0
- package/esm/utils/compressionHandler.d.ts +11 -0
- package/esm/utils/compressionHandler.js +39 -0
- package/esm/utils/compressionHandler.js.map +1 -0
- package/esm/utils/gasPriceManager.d.ts +34 -0
- package/esm/utils/gasPriceManager.js +338 -0
- package/esm/utils/gasPriceManager.js.map +1 -0
- package/esm/utils/helpers.d.ts +4 -0
- package/esm/utils/helpers.js +13 -0
- package/esm/utils/helpers.js.map +1 -0
- package/esm/utils/index.d.ts +11 -0
- package/esm/utils/index.js +10 -0
- package/esm/utils/index.js.map +1 -0
- package/esm/utils/logger.d.ts +6 -0
- package/esm/utils/logger.js +76 -0
- package/esm/utils/logger.js.map +1 -0
- package/esm/utils/metrics.d.ts +22 -0
- package/esm/utils/metrics.js +150 -0
- package/esm/utils/metrics.js.map +1 -0
- package/esm/utils/rpc-reply.d.ts +17 -0
- package/esm/utils/rpc-reply.js +41 -0
- package/esm/utils/rpc-reply.js.map +1 -0
- package/esm/utils/test.d.ts +17 -0
- package/esm/utils/test.js +130 -0
- package/esm/utils/test.js.map +1 -0
- package/esm/utils/userop.d.ts +49 -0
- package/esm/utils/userop.js +408 -0
- package/esm/utils/userop.js.map +1 -0
- package/esm/utils/validation.d.ts +65 -0
- package/esm/utils/validation.js +461 -0
- package/esm/utils/validation.js.map +1 -0
- package/lib/cli/config/bundler.d.ts +12 -0
- package/lib/cli/config/bundler.js +3 -1
- package/lib/cli/config/bundler.js.map +1 -1
- package/lib/cli/config/options.js +12 -0
- package/lib/cli/config/options.js.map +1 -1
- package/lib/cli/handler.js +25 -1
- package/lib/cli/handler.js.map +1 -1
- package/lib/cli/setupServer.js +1 -1
- package/lib/cli/setupServer.js.map +1 -1
- package/lib/executor/executor.d.ts +2 -1
- package/lib/executor/executor.js +6 -4
- package/lib/executor/executor.js.map +1 -1
- package/lib/executor/utils.d.ts +1 -1
- package/lib/executor/utils.js +4 -4
- package/lib/executor/utils.js.map +1 -1
- package/lib/mempool/mempool.js +5 -7
- package/lib/mempool/mempool.js.map +1 -1
- package/lib/mempool/reputationManager.js +7 -3
- package/lib/mempool/reputationManager.js.map +1 -1
- package/lib/rpc/EntryPointSimulationsV07.d.ts +5 -1
- package/lib/rpc/EntryPointSimulationsV07.js +3 -2
- package/lib/rpc/EntryPointSimulationsV07.js.map +1 -1
- package/lib/rpc/gasEstimation.js +7 -3
- package/lib/rpc/gasEstimation.js.map +1 -1
- package/lib/rpc/rpcHandler.js +18 -7
- package/lib/rpc/rpcHandler.js.map +1 -1
- package/lib/rpc/server.js +4 -0
- package/lib/rpc/server.js.map +1 -1
- package/lib/rpc/validation/SafeValidator.d.ts +2 -6
- package/lib/rpc/validation/SafeValidator.js +48 -205
- package/lib/rpc/validation/SafeValidator.js.map +1 -1
- package/lib/rpc/validation/TracerResultParserV07.js +6 -2
- package/lib/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/lib/rpc/validation/UnsafeValidator.d.ts +2 -1
- package/lib/rpc/validation/UnsafeValidator.js +45 -68
- package/lib/rpc/validation/UnsafeValidator.js.map +1 -1
- package/lib/types/contracts/EntryPointSimulations.d.ts +0 -1
- package/lib/types/contracts/EntryPointSimulations.js +1942 -3
- package/lib/types/contracts/EntryPointSimulations.js.map +1 -1
- package/lib/types/contracts/PimlicoEntryPointSimulations.d.ts +1 -1
- package/lib/types/contracts/PimlicoEntryPointSimulations.js +2 -2
- package/lib/types/contracts/PimlicoEntryPointSimulations.js.map +1 -1
- package/lib/utils/userop.js +2 -25
- package/lib/utils/userop.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ChainType, InterfaceValidator, UserOperationV06, UserOperationV07, ValidationResult, ValidationResultV06, ValidationResultV07, ValidationResultWithAggregationV06, ValidationResultWithAggregationV07 } from "../../types/index.js";
|
|
2
|
+
import { type Address, type ReferencedCodeHashes, type StorageMap, type UserOperation, type ValidationResultWithAggregation } from "../../types/index.js";
|
|
3
|
+
import type { GasPriceManager, Logger, Metrics } from "../../utils/index.js";
|
|
4
|
+
import { type Chain, type PublicClient, type Transport } from "viem";
|
|
5
|
+
import { type BundlerTracerResult } from "./BundlerCollectorTracerV07.js";
|
|
6
|
+
import { UnsafeValidator } from "./UnsafeValidator.js";
|
|
7
|
+
import type { SenderManager } from "../../executor/index.js";
|
|
8
|
+
export declare class SafeValidator extends UnsafeValidator implements InterfaceValidator {
|
|
9
|
+
private senderManager;
|
|
10
|
+
constructor(publicClient: PublicClient<Transport, Chain>, senderManager: SenderManager, logger: Logger, metrics: Metrics, gasPriceManager: GasPriceManager, chainType: ChainType, entryPointSimulationsAddress?: Address, fixedGasLimitForEstimation?: bigint, usingTenderly?: boolean, balanceOverrideEnabled?: boolean);
|
|
11
|
+
validateUserOperation(shouldCheckPrefund: boolean, userOperation: UserOperation, queuedUserOperations: UserOperation[], entryPoint: Address, referencedContracts?: ReferencedCodeHashes): Promise<(ValidationResult | ValidationResultWithAggregation) & {
|
|
12
|
+
storageMap: StorageMap;
|
|
13
|
+
referencedContracts?: ReferencedCodeHashes;
|
|
14
|
+
}>;
|
|
15
|
+
getCodeHashes(addresses: string[]): Promise<ReferencedCodeHashes>;
|
|
16
|
+
getValidationResultV07(userOperation: UserOperationV07, queuedUserOperations: UserOperationV07[], entryPoint: Address, preCodeHashes?: ReferencedCodeHashes): Promise<(ValidationResultV07 | ValidationResultWithAggregationV07) & {
|
|
17
|
+
storageMap: StorageMap;
|
|
18
|
+
referencedContracts?: ReferencedCodeHashes;
|
|
19
|
+
}>;
|
|
20
|
+
getValidationResultV06(userOperation: UserOperationV06, entryPoint: Address, preCodeHashes?: ReferencedCodeHashes): Promise<(ValidationResultV06 | ValidationResultWithAggregationV06) & {
|
|
21
|
+
referencedContracts?: ReferencedCodeHashes;
|
|
22
|
+
storageMap: StorageMap;
|
|
23
|
+
}>;
|
|
24
|
+
getValidationResultWithTracerV06(userOperation: UserOperationV06, entryPoint: Address): Promise<[ValidationResultV06, BundlerTracerResult]>;
|
|
25
|
+
parseErrorResultV06(userOperation: UserOperationV06, errorResult: {
|
|
26
|
+
errorName: string;
|
|
27
|
+
errorArgs: any;
|
|
28
|
+
}): ValidationResult | ValidationResultWithAggregation;
|
|
29
|
+
getValidationResultWithTracerV07(userOperation: UserOperationV07, entryPoint: Address): Promise<[ValidationResultV07, BundlerTracerResult]>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=SafeValidator.d.ts.map
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { CodeHashGetterAbi, CodeHashGetterBytecode, EntryPointV06Abi, EntryPointV07SimulationsAbi, RpcError, ValidationErrors, PimlicoEntryPointSimulationsAbi } from "../../types/index.js";
|
|
2
|
+
import { calcVerificationGasAndCallGasLimit, getAddressFromInitCodeOrPaymasterAndData, isVersion06, isVersion07, toPackedUserOperation } from "../../utils/index.js";
|
|
3
|
+
import { decodeErrorResult, encodeDeployData, encodeFunctionData, zeroAddress } from "viem";
|
|
4
|
+
import { getSimulateValidationResult } from "../EntryPointSimulationsV07.js";
|
|
5
|
+
import { bundlerCollectorTracer } from "./BundlerCollectorTracerV07.js";
|
|
6
|
+
import { tracerResultParserV06 } from "./TracerResultParserV06.js";
|
|
7
|
+
import { tracerResultParserV07 } from "./TracerResultParserV07.js";
|
|
8
|
+
import { UnsafeValidator } from "./UnsafeValidator.js";
|
|
9
|
+
import { debug_traceCall } from "./tracer.js";
|
|
10
|
+
export class SafeValidator extends UnsafeValidator {
|
|
11
|
+
senderManager;
|
|
12
|
+
constructor(publicClient, senderManager, logger, metrics, gasPriceManager, chainType, entryPointSimulationsAddress, fixedGasLimitForEstimation, usingTenderly = false, balanceOverrideEnabled = false) {
|
|
13
|
+
super(publicClient, logger, metrics, gasPriceManager, chainType, entryPointSimulationsAddress, fixedGasLimitForEstimation, usingTenderly, balanceOverrideEnabled);
|
|
14
|
+
this.senderManager = senderManager;
|
|
15
|
+
}
|
|
16
|
+
async validateUserOperation(shouldCheckPrefund, userOperation, queuedUserOperations, entryPoint, referencedContracts) {
|
|
17
|
+
try {
|
|
18
|
+
const validationResult = await this.getValidationResult(userOperation, queuedUserOperations, entryPoint, referencedContracts);
|
|
19
|
+
if (shouldCheckPrefund) {
|
|
20
|
+
const prefund = validationResult.returnInfo.prefund;
|
|
21
|
+
const { verificationGasLimit, callGasLimit } = calcVerificationGasAndCallGasLimit(userOperation, {
|
|
22
|
+
preOpGas: validationResult.returnInfo.preOpGas,
|
|
23
|
+
paid: validationResult.returnInfo.prefund
|
|
24
|
+
}, this.chainId);
|
|
25
|
+
let mul = 1n;
|
|
26
|
+
if (isVersion06(userOperation) &&
|
|
27
|
+
userOperation.paymasterAndData) {
|
|
28
|
+
mul = 3n;
|
|
29
|
+
}
|
|
30
|
+
if (isVersion07(userOperation) &&
|
|
31
|
+
userOperation.paymaster === "0x") {
|
|
32
|
+
mul = 3n;
|
|
33
|
+
}
|
|
34
|
+
const requiredPreFund = callGasLimit +
|
|
35
|
+
verificationGasLimit * mul +
|
|
36
|
+
userOperation.preVerificationGas;
|
|
37
|
+
if (requiredPreFund > prefund) {
|
|
38
|
+
throw new RpcError(`prefund is not enough, required: ${requiredPreFund}, got: ${prefund}`, ValidationErrors.SimulateValidation);
|
|
39
|
+
}
|
|
40
|
+
// TODO prefund should be greater than it costs us to add it to mempool
|
|
41
|
+
}
|
|
42
|
+
this.metrics.userOperationsValidationSuccess.inc();
|
|
43
|
+
return validationResult;
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
this.metrics.userOperationsValidationFailure.inc();
|
|
47
|
+
throw e;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async getCodeHashes(addresses) {
|
|
51
|
+
const deployData = encodeDeployData({
|
|
52
|
+
abi: CodeHashGetterAbi,
|
|
53
|
+
bytecode: CodeHashGetterBytecode,
|
|
54
|
+
args: [addresses]
|
|
55
|
+
});
|
|
56
|
+
const wallet = await this.senderManager.getWallet();
|
|
57
|
+
let hash = "";
|
|
58
|
+
try {
|
|
59
|
+
await this.publicClient.call({
|
|
60
|
+
account: wallet,
|
|
61
|
+
data: deployData
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
const error = e;
|
|
66
|
+
// biome-ignore lint/suspicious/noExplicitAny: it's a generic type
|
|
67
|
+
hash = error.walk().data;
|
|
68
|
+
}
|
|
69
|
+
this.senderManager.pushWallet(wallet);
|
|
70
|
+
return {
|
|
71
|
+
hash,
|
|
72
|
+
addresses
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
async getValidationResultV07(userOperation, queuedUserOperations, entryPoint, preCodeHashes) {
|
|
76
|
+
if (this.usingTenderly) {
|
|
77
|
+
return super.getValidationResultV07(userOperation, queuedUserOperations, entryPoint);
|
|
78
|
+
}
|
|
79
|
+
if (preCodeHashes && preCodeHashes.addresses.length > 0) {
|
|
80
|
+
const { hash } = await this.getCodeHashes(preCodeHashes.addresses);
|
|
81
|
+
if (hash !== preCodeHashes.hash) {
|
|
82
|
+
throw new RpcError("code hashes mismatch", ValidationErrors.OpcodeValidation);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const [res, tracerResult] = await this.getValidationResultWithTracerV07(userOperation, entryPoint);
|
|
86
|
+
const [contractAddresses, storageMap] = tracerResultParserV07(userOperation, tracerResult, res, entryPoint.toLowerCase());
|
|
87
|
+
const codeHashes = preCodeHashes || (await this.getCodeHashes(contractAddresses));
|
|
88
|
+
// biome-ignore lint/suspicious/noExplicitAny: it's a generic type
|
|
89
|
+
if (res === "0x") {
|
|
90
|
+
throw new Error("simulateValidation reverted with no revert string!");
|
|
91
|
+
}
|
|
92
|
+
if (res.returnInfo.accountSigFailed) {
|
|
93
|
+
throw new RpcError("Invalid UserOp signature", ValidationErrors.InvalidSignature);
|
|
94
|
+
}
|
|
95
|
+
if (res.returnInfo.paymasterSigFailed) {
|
|
96
|
+
throw new RpcError("Invalid UserOp paymasterData", ValidationErrors.InvalidSignature);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
...res,
|
|
100
|
+
referencedContracts: codeHashes,
|
|
101
|
+
storageMap
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
async getValidationResultV06(userOperation, entryPoint, preCodeHashes) {
|
|
105
|
+
if (this.usingTenderly) {
|
|
106
|
+
return super.getValidationResultV06(userOperation, entryPoint);
|
|
107
|
+
}
|
|
108
|
+
if (preCodeHashes && preCodeHashes.addresses.length > 0) {
|
|
109
|
+
const { hash } = await this.getCodeHashes(preCodeHashes.addresses);
|
|
110
|
+
if (hash !== preCodeHashes.hash) {
|
|
111
|
+
throw new RpcError("code hashes mismatch", ValidationErrors.OpcodeValidation);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const [res, tracerResult] = await this.getValidationResultWithTracerV06(userOperation, entryPoint);
|
|
115
|
+
const [contractAddresses, storageMap] = tracerResultParserV06(userOperation, tracerResult, res, entryPoint.toLowerCase());
|
|
116
|
+
const codeHashes = preCodeHashes || (await this.getCodeHashes(contractAddresses));
|
|
117
|
+
// biome-ignore lint/suspicious/noExplicitAny: it's a generic type
|
|
118
|
+
if (res === "0x") {
|
|
119
|
+
throw new Error("simulateValidation reverted with no revert string!");
|
|
120
|
+
}
|
|
121
|
+
const validationResult = {
|
|
122
|
+
...res,
|
|
123
|
+
referencedContracts: codeHashes,
|
|
124
|
+
storageMap
|
|
125
|
+
};
|
|
126
|
+
if (validationResult.returnInfo.sigFailed) {
|
|
127
|
+
throw new RpcError("Invalid UserOp signature or paymaster signature", ValidationErrors.InvalidSignature);
|
|
128
|
+
}
|
|
129
|
+
const now = Date.now() / 1000;
|
|
130
|
+
this.logger.debug({
|
|
131
|
+
validAfter: validationResult.returnInfo.validAfter,
|
|
132
|
+
validUntil: validationResult.returnInfo.validUntil,
|
|
133
|
+
now: now
|
|
134
|
+
});
|
|
135
|
+
if (validationResult.returnInfo.validAfter > now - 5) {
|
|
136
|
+
throw new RpcError("User operation is not valid yet", ValidationErrors.ExpiresShortly);
|
|
137
|
+
}
|
|
138
|
+
if (validationResult.returnInfo.validUntil < now + 30) {
|
|
139
|
+
throw new RpcError("expires too soon", ValidationErrors.ExpiresShortly);
|
|
140
|
+
}
|
|
141
|
+
return validationResult;
|
|
142
|
+
}
|
|
143
|
+
async getValidationResultWithTracerV06(userOperation, entryPoint) {
|
|
144
|
+
const tracerResult = await debug_traceCall(this.publicClient, {
|
|
145
|
+
from: zeroAddress,
|
|
146
|
+
to: entryPoint,
|
|
147
|
+
data: encodeFunctionData({
|
|
148
|
+
abi: EntryPointV06Abi,
|
|
149
|
+
functionName: "simulateValidation",
|
|
150
|
+
args: [userOperation]
|
|
151
|
+
})
|
|
152
|
+
}, {
|
|
153
|
+
tracer: bundlerCollectorTracer
|
|
154
|
+
});
|
|
155
|
+
const lastResult = tracerResult.calls.slice(-1)[0];
|
|
156
|
+
if (lastResult.type !== "REVERT") {
|
|
157
|
+
throw new Error("Invalid response. simulateCall must revert");
|
|
158
|
+
}
|
|
159
|
+
const data = lastResult.data;
|
|
160
|
+
if (data === "0x") {
|
|
161
|
+
// biome-ignore lint/suspicious/noExplicitAny: it's a generic type
|
|
162
|
+
return [data, tracerResult];
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
const { errorName, args: errorArgs } = decodeErrorResult({
|
|
166
|
+
abi: EntryPointV06Abi,
|
|
167
|
+
data
|
|
168
|
+
});
|
|
169
|
+
const errFullName = `${errorName}(${errorArgs.toString()})`;
|
|
170
|
+
const errorResult = this.parseErrorResultV06(userOperation, {
|
|
171
|
+
errorName,
|
|
172
|
+
errorArgs
|
|
173
|
+
});
|
|
174
|
+
if (!errorName.includes("Result")) {
|
|
175
|
+
// a real error, not a result.
|
|
176
|
+
throw new Error(errFullName);
|
|
177
|
+
}
|
|
178
|
+
// @ts-ignore
|
|
179
|
+
return [errorResult, tracerResult];
|
|
180
|
+
// biome-ignore lint/suspicious/noExplicitAny: it's a generic type
|
|
181
|
+
}
|
|
182
|
+
catch (e) {
|
|
183
|
+
// if already parsed, throw as is
|
|
184
|
+
if (e.code != null) {
|
|
185
|
+
throw e;
|
|
186
|
+
}
|
|
187
|
+
throw new RpcError(data);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
parseErrorResultV06(userOperation,
|
|
191
|
+
// biome-ignore lint/suspicious/noExplicitAny: it's a generic type
|
|
192
|
+
errorResult) {
|
|
193
|
+
if (!errorResult?.errorName?.startsWith("ValidationResult")) {
|
|
194
|
+
// parse it as FailedOp
|
|
195
|
+
// if its FailedOp, then we have the paymaster param... otherwise its an Error(string)
|
|
196
|
+
let paymaster = errorResult.errorArgs.paymaster;
|
|
197
|
+
if (paymaster === zeroAddress) {
|
|
198
|
+
paymaster = undefined;
|
|
199
|
+
}
|
|
200
|
+
// eslint-disable-next-line
|
|
201
|
+
const msg = errorResult.errorArgs[1] ?? errorResult.toString();
|
|
202
|
+
if (paymaster == null) {
|
|
203
|
+
throw new RpcError(`account validation failed: ${msg}`, ValidationErrors.SimulateValidation);
|
|
204
|
+
}
|
|
205
|
+
throw new RpcError(`paymaster validation failed: ${msg}`, ValidationErrors.SimulatePaymasterValidation, {
|
|
206
|
+
paymaster
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
const [returnInfo, senderInfo, factoryInfo, paymasterInfo, aggregatorInfo // may be missing (exists only SimulationResultWithAggregator)
|
|
210
|
+
] = errorResult.errorArgs;
|
|
211
|
+
// extract address from "data" (first 20 bytes)
|
|
212
|
+
// add it as "addr" member to the "stakeinfo" struct
|
|
213
|
+
// if no address, then return "undefined" instead of struct.
|
|
214
|
+
function fillEntity(data, info) {
|
|
215
|
+
const addr = getAddressFromInitCodeOrPaymasterAndData(data);
|
|
216
|
+
return addr == null
|
|
217
|
+
? undefined
|
|
218
|
+
: {
|
|
219
|
+
...info,
|
|
220
|
+
addr
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function fillEntityAggregator(data, info) {
|
|
224
|
+
const addr = getAddressFromInitCodeOrPaymasterAndData(data);
|
|
225
|
+
return addr == null
|
|
226
|
+
? undefined
|
|
227
|
+
: {
|
|
228
|
+
aggregator: data,
|
|
229
|
+
stakeInfo: {
|
|
230
|
+
...info,
|
|
231
|
+
addr
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
returnInfo,
|
|
237
|
+
senderInfo: {
|
|
238
|
+
...senderInfo,
|
|
239
|
+
addr: userOperation.sender
|
|
240
|
+
},
|
|
241
|
+
factoryInfo: fillEntity(userOperation.initCode, factoryInfo),
|
|
242
|
+
paymasterInfo: fillEntity(userOperation.paymasterAndData, paymasterInfo),
|
|
243
|
+
aggregatorInfo: fillEntityAggregator(aggregatorInfo?.actualAggregator, aggregatorInfo?.stakeInfo)
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
async getValidationResultWithTracerV07(userOperation, entryPoint) {
|
|
247
|
+
if (!this.entryPointSimulationsAddress) {
|
|
248
|
+
throw new Error("entryPointSimulationsAddress is not set");
|
|
249
|
+
}
|
|
250
|
+
const packedUserOperation = toPackedUserOperation(userOperation);
|
|
251
|
+
const entryPointSimulationsCallData = encodeFunctionData({
|
|
252
|
+
abi: EntryPointV07SimulationsAbi,
|
|
253
|
+
functionName: "simulateValidationLast",
|
|
254
|
+
args: [[packedUserOperation]]
|
|
255
|
+
});
|
|
256
|
+
const callData = encodeFunctionData({
|
|
257
|
+
abi: PimlicoEntryPointSimulationsAbi,
|
|
258
|
+
functionName: "simulateEntryPoint",
|
|
259
|
+
args: [entryPoint, [entryPointSimulationsCallData]]
|
|
260
|
+
});
|
|
261
|
+
const tracerResult = await debug_traceCall(this.publicClient, {
|
|
262
|
+
from: zeroAddress,
|
|
263
|
+
to: this.entryPointSimulationsAddress,
|
|
264
|
+
data: callData
|
|
265
|
+
}, {
|
|
266
|
+
tracer: bundlerCollectorTracer
|
|
267
|
+
});
|
|
268
|
+
this.logger.info(`tracerResult: ${JSON.stringify(tracerResult, (_k, v) => typeof v === "bigint" ? v.toString() : v)}`);
|
|
269
|
+
const lastResult = tracerResult.calls.slice(-1)[0];
|
|
270
|
+
if (lastResult.type !== "REVERT") {
|
|
271
|
+
throw new Error("Invalid response. simulateCall must revert");
|
|
272
|
+
}
|
|
273
|
+
const resultData = lastResult.data;
|
|
274
|
+
const simulateValidationResult = getSimulateValidationResult(resultData);
|
|
275
|
+
if (simulateValidationResult.status === "failed") {
|
|
276
|
+
let errorCode = ValidationErrors.SimulateValidation;
|
|
277
|
+
const errorMessage = simulateValidationResult.data;
|
|
278
|
+
if (errorMessage.includes("AA24")) {
|
|
279
|
+
errorCode = ValidationErrors.InvalidSignature;
|
|
280
|
+
}
|
|
281
|
+
throw new RpcError(errorMessage, errorCode);
|
|
282
|
+
}
|
|
283
|
+
const validationResult = simulateValidationResult.data;
|
|
284
|
+
const mergedValidation = this.mergeValidationDataValues(validationResult.returnInfo.accountValidationData, validationResult.returnInfo.paymasterValidationData);
|
|
285
|
+
const res = {
|
|
286
|
+
returnInfo: {
|
|
287
|
+
...validationResult.returnInfo,
|
|
288
|
+
accountSigFailed: mergedValidation.accountSigFailed,
|
|
289
|
+
paymasterSigFailed: mergedValidation.paymasterSigFailed,
|
|
290
|
+
validUntil: mergedValidation.validUntil,
|
|
291
|
+
validAfter: mergedValidation.validAfter
|
|
292
|
+
},
|
|
293
|
+
senderInfo: {
|
|
294
|
+
...validationResult.senderInfo,
|
|
295
|
+
addr: userOperation.sender
|
|
296
|
+
},
|
|
297
|
+
factoryInfo: userOperation.factory && validationResult.factoryInfo
|
|
298
|
+
? {
|
|
299
|
+
...validationResult.factoryInfo,
|
|
300
|
+
addr: userOperation.factory
|
|
301
|
+
}
|
|
302
|
+
: undefined,
|
|
303
|
+
paymasterInfo: userOperation.paymaster && validationResult.paymasterInfo
|
|
304
|
+
? {
|
|
305
|
+
...validationResult.paymasterInfo,
|
|
306
|
+
addr: userOperation.paymaster
|
|
307
|
+
}
|
|
308
|
+
: undefined,
|
|
309
|
+
aggregatorInfo: validationResult.aggregatorInfo,
|
|
310
|
+
storageMap: {}
|
|
311
|
+
};
|
|
312
|
+
// this.validateStorageAccessList(userOperation, res, accessList)
|
|
313
|
+
if (res.returnInfo.accountSigFailed) {
|
|
314
|
+
throw new RpcError("Invalid UserOp signature", ValidationErrors.InvalidSignature);
|
|
315
|
+
}
|
|
316
|
+
if (res.returnInfo.paymasterSigFailed) {
|
|
317
|
+
throw new RpcError("Invalid UserOp paymasterData", ValidationErrors.InvalidSignature);
|
|
318
|
+
}
|
|
319
|
+
const now = Math.floor(Date.now() / 1000);
|
|
320
|
+
if (res.returnInfo.validAfter > now - 5) {
|
|
321
|
+
throw new RpcError(`User operation is not valid yet, validAfter=${res.returnInfo.validAfter}, now=${now}`, ValidationErrors.ExpiresShortly);
|
|
322
|
+
}
|
|
323
|
+
if (res.returnInfo.validUntil == null ||
|
|
324
|
+
res.returnInfo.validUntil < now + 30) {
|
|
325
|
+
throw new RpcError(`UserOperation expires too soon, validUntil=${res.returnInfo.validUntil}, now=${now}`, ValidationErrors.ExpiresShortly);
|
|
326
|
+
}
|
|
327
|
+
return [res, tracerResult];
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=SafeValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SafeValidator.js","sourceRoot":"","sources":["../../../rpc/validation/SafeValidator.ts"],"names":[],"mappings":"AAWA,OAAO,EACH,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,2BAA2B,EAC3B,QAAQ,EACR,gBAAgB,EAOhB,+BAA+B,EAClC,MAAM,aAAa,CAAA;AAEpB,OAAO,EACH,kCAAkC,EAClC,wCAAwC,EACxC,WAAW,EACX,WAAW,EACX,qBAAqB,EACxB,MAAM,aAAa,CAAA;AACpB,OAAO,EACH,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EAMd,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,EACH,sBAAsB,EAGzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,MAAM,OAAO,aACT,SAAQ,eAAe;IAGf,aAAa,CAAe;IAEpC,YACI,YAA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CAAC,UAAU,SAAS,GAAG,EAAE,EACrF,gBAAgB,CAAC,cAAc,CAClC,CAAA;QACL,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,CAAA;IAC9B,CAAC;CACJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type StorageMap, type ValidationResult, type UserOperationV06 } from "../../types/index.js";
|
|
2
|
+
import { type Address } from "viem";
|
|
3
|
+
import type { BundlerTracerResult } from "./BundlerCollectorTracerV06.js";
|
|
4
|
+
/**
|
|
5
|
+
* parse collected simulation traces and revert if they break our rules
|
|
6
|
+
* @param userOperation the userOperation that was used in this simulation
|
|
7
|
+
* @param tracerResults the tracer return value
|
|
8
|
+
* @param validationResult output from simulateValidation
|
|
9
|
+
* @param entryPoint the entryPoint that hosted the "simulatedValidation" traced call.
|
|
10
|
+
* @return list of contract addresses referenced by this UserOp
|
|
11
|
+
*/
|
|
12
|
+
export declare function tracerResultParserV06(userOperation: UserOperationV06, tracerResults: BundlerTracerResult, validationResult: ValidationResult, entryPointAddress: Address): [string[], StorageMap];
|
|
13
|
+
//# sourceMappingURL=TracerResultParserV06.d.ts.map
|