From 4cb6282a69ab16f6f36729f356730ccc7499df03 Mon Sep 17 00:00:00 2001 From: mous <97399882+mouseless-eth@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:24:06 +0100 Subject: [PATCH] ignore CallPhaseReverted errors (#329) --- src/cli/customTransport.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/cli/customTransport.ts b/src/cli/customTransport.ts index 7a30b201..49aa1f16 100644 --- a/src/cli/customTransport.ts +++ b/src/cli/customTransport.ts @@ -12,7 +12,10 @@ import { Hex } from "viem" import { formatAbiItem, rpc } from "viem/utils" -import { EntryPointV06Abi } from "../types/contracts" +import { + EntryPointV06Abi, + EntryPointV06SimulationsAbi +} from "../types/contracts" export type RpcRequest = { jsonrpc?: "2.0" | undefined @@ -48,6 +51,16 @@ const FAILED_OP_SELECTOR = toFunctionSelector( ) ) +// custom selector for when code overrides are used. +const CALLPHASE_REVERTED_SELECTOR = toFunctionSelector( + formatAbiItem( + getAbiItem({ + abi: EntryPointV06SimulationsAbi, + name: "CallPhaseReverted" + }) + ) +) + export function customTransport( /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */ url_: string, @@ -96,7 +109,8 @@ export function customTransport( [ EXECUTION_RESULT_SELECTOR, VALIDATION_RESULT_SELECTOR, - FAILED_OP_SELECTOR + FAILED_OP_SELECTOR, + CALLPHASE_REVERTED_SELECTOR ].includes(errorSelector as Hex) ) { loggerFn = logger.info.bind(logger)