Skip to content

Commit

Permalink
remove runtime simulateHandleOp validation on v06
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Oct 15, 2024
1 parent 328c7bc commit 9001392
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions src/rpc/validation/UnsafeValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class UnsafeValidator implements InterfaceValidator {
}
})

const simulateValidationPromise = entryPointContract.simulate
const simulateValidationResult = await entryPointContract.simulate
.simulateValidation([userOperation])
.catch((e) => {
if (e instanceof Error) {
Expand All @@ -209,18 +209,6 @@ export class UnsafeValidator implements InterfaceValidator {
throw e
})

const runtimeValidationPromise =
this.gasEstimationHandler.gasEstimatorV06.simulateHandleOpV06({
entryPoint,
userOperation,
targetAddress: zeroAddress,
targetCallData: "0x"
})

const [simulateValidationResult, runtimeValidation] = await Promise.all(
[simulateValidationPromise, runtimeValidationPromise]
)

const validationResult = {
...((await this.getSimulationResult(
isVersion06(userOperation),
Expand Down Expand Up @@ -267,14 +255,6 @@ export class UnsafeValidator implements InterfaceValidator {
)
}

// validate runtime
if (runtimeValidation.result === "failed") {
throw new RpcError(
`UserOperation reverted during simulation with reason: ${runtimeValidation.data}`,
ValidationErrors.SimulateValidation
)
}

return validationResult
}

Expand Down

0 comments on commit 9001392

Please sign in to comment.