diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 0b1c2234..154484f7 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -3,9 +3,6 @@ on: push: branches: - main - pull_request: - branches: - - main workflow_dispatch: jobs: diff --git a/src/cli/config/bundler.ts b/src/cli/config/bundler.ts index 9711ab33..5d61a1d7 100644 --- a/src/cli/config/bundler.ts +++ b/src/cli/config/bundler.ts @@ -124,7 +124,8 @@ export const rpcArgsSchema = z.object({ "rpc-url": z.string().url(), "send-transaction-rpc-url": z.string().url().optional(), "polling-interval": z.number().int().min(0), - "max-block-range": z.number().int().min(0).optional() + "max-block-range": z.number().int().min(0).optional(), + "block-tag-support-disabled": z.boolean().optional().default(false) }) export const bundleCopmressionArgsSchema = z.object({ diff --git a/src/cli/config/options.ts b/src/cli/config/options.ts index 5eed5969..0f02846d 100644 --- a/src/cli/config/options.ts +++ b/src/cli/config/options.ts @@ -252,6 +252,13 @@ export const rpcOptions: CliCommandOptions = { description: "Max block range for getLogs calls", type: "number", require: false + }, + "block-tag-support-disabled": { + description: + "Disable sending block tag when sending eth_estimateGas call", + type: "boolean", + require: false, + default: false } } diff --git a/src/cli/setupServer.ts b/src/cli/setupServer.ts index 9635d2fe..fe51fd9f 100644 --- a/src/cli/setupServer.ts +++ b/src/cli/setupServer.ts @@ -203,6 +203,7 @@ const getExecutor = ({ !parsedArgs.tenderly, parsedArgs["legacy-transactions"], parsedArgs["fixed-gas-limit-for-estimation"], + parsedArgs["block-tag-support-disabled"], parsedArgs["local-gas-limit-calculation"] ) } diff --git a/src/executor/executor.ts b/src/executor/executor.ts index ae692166..83ce8076 100644 --- a/src/executor/executor.ts +++ b/src/executor/executor.ts @@ -116,6 +116,7 @@ export class Executor { reputationManager: InterfaceReputationManager compressionHandler: CompressionHandler | null gasPriceManager: GasPriceManager + disableBlockTagSupport: boolean mutex: Mutex constructor( @@ -131,6 +132,7 @@ export class Executor { simulateTransaction = false, legacyTransactions = false, fixedGasLimitForEstimation?: bigint, + disableBlockTagSupport = false, localGasLimitCalculation = false ) { this.publicClient = publicClient @@ -145,6 +147,7 @@ export class Executor { this.localGasLimitCalculation = localGasLimitCalculation this.compressionHandler = compressionHandler this.gasPriceManager = gasPriceManager + this.disableBlockTagSupport = disableBlockTagSupport this.entryPoints = entryPoints this.mutex = new Mutex() @@ -263,7 +266,7 @@ export class Executor { newRequest.nonce, newRequest.maxFeePerGas, newRequest.maxPriorityFeePerGas, - "latest", + this.disableBlockTagSupport ? undefined : "latest", this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, @@ -574,7 +577,7 @@ export class Executor { nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, - "pending", + this.disableBlockTagSupport ? undefined : "pending", this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, @@ -854,7 +857,7 @@ export class Executor { nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, - "pending", + this.disableBlockTagSupport ? undefined : "pending", this.legacyTransactions, this.fixedGasLimitForEstimation, this.reputationManager, diff --git a/src/executor/utils.ts b/src/executor/utils.ts index 0e98e707..7064c610 100644 --- a/src/executor/utils.ts +++ b/src/executor/utils.ts @@ -127,7 +127,7 @@ export async function filterOpsAndEstimateGas( nonce: number, maxFeePerGas: bigint, maxPriorityFeePerGas: bigint, - blockTag: "latest" | "pending", + blockTag: "latest" | "pending" | undefined, onlyPre1559: boolean, fixedGasLimitForEstimation: bigint | undefined, reputationManager: InterfaceReputationManager, @@ -176,7 +176,7 @@ export async function filterOpsAndEstimateGas( { account: wallet, nonce: nonce, - blockTag, + blockTag: blockTag, ...(fixedGasLimitForEstimation !== undefined && { gas: fixedGasLimitForEstimation }), @@ -200,14 +200,14 @@ export async function filterOpsAndEstimateGas( data: createCompressedCalldata(opsToSend, perOpInflatorId), gas: fixedGasLimitForEstimation, nonce: nonce, - blockTag, + blockTag: blockTag, ...gasOptions }) } return { simulatedOps, gasLimit, resubmitAllOps: false } } catch (err: unknown) { - logger.error({ err }, "error estimating gas") + logger.error({ err, blockTag }, "error estimating gas") const e = parseViemError(err) if (e instanceof ContractFunctionRevertedError) { @@ -345,7 +345,7 @@ export async function filterOpsAndEstimateGas( } else { sentry.captureException(err) logger.error( - { error: JSON.stringify(err) }, + { error: JSON.stringify(err), blockTag }, "error estimating gas" ) return { simulatedOps: [], gasLimit: 0n, resubmitAllOps: false }