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" })