From e312a2de0775ab51d66ca1bcd0c960870b43ce3b Mon Sep 17 00:00:00 2001 From: mous <97399882+mouseless-eth@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:52:08 +0100 Subject: [PATCH] Fix/skip-call-validation-during-eth-send (#330) * skip code overrides on v06 * remove unused var * add comment --- src/rpc/estimation/gasEstimationsV06.ts | 4 +++- src/rpc/validation/UnsafeValidator.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rpc/estimation/gasEstimationsV06.ts b/src/rpc/estimation/gasEstimationsV06.ts index 13e50f4f..695aca1b 100644 --- a/src/rpc/estimation/gasEstimationsV06.ts +++ b/src/rpc/estimation/gasEstimationsV06.ts @@ -97,12 +97,14 @@ export class GasEstimatorV06 { targetAddress, targetCallData, entryPoint, + useCodeOverride = true, stateOverrides = undefined }: { userOperation: UserOperationV06 targetAddress: Address targetCallData: Hex entryPoint: Address + useCodeOverride?: boolean stateOverrides?: StateOverrides | undefined }): Promise { const publicClient = this.config.publicClient @@ -113,7 +115,7 @@ export class GasEstimatorV06 { const fixedGasLimitForEstimation = this.config.fixedGasLimitForEstimation - if (this.config.codeOverrideSupport) { + if (this.config.codeOverrideSupport && useCodeOverride) { if (stateOverrides === undefined) { stateOverrides = {} } diff --git a/src/rpc/validation/UnsafeValidator.ts b/src/rpc/validation/UnsafeValidator.ts index d9364feb..636972d6 100644 --- a/src/rpc/validation/UnsafeValidator.ts +++ b/src/rpc/validation/UnsafeValidator.ts @@ -213,6 +213,7 @@ export class UnsafeValidator implements InterfaceValidator { this.gasEstimationHandler.gasEstimatorV06.simulateHandleOpV06({ entryPoint, userOperation, + useCodeOverride: false, // disable code override so that call phase reverts aren't caught targetAddress: zeroAddress, targetCallData: "0x" })