From b1b9f83dc0558a5efa06ffaaa0476b8af3bb679e Mon Sep 17 00:00:00 2001 From: mouseless <97399882+mouseless-eth@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:34:04 +0000 Subject: [PATCH 1/2] cleanup --- src/handlers/gasPriceManager.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/handlers/gasPriceManager.ts b/src/handlers/gasPriceManager.ts index 529c7031..ee49e788 100644 --- a/src/handlers/gasPriceManager.ts +++ b/src/handlers/gasPriceManager.ts @@ -163,10 +163,6 @@ export class GasPriceManager { if (!this.config.legacyTransactions) { await this.updateBaseFee(latestBlock) } - - if (this.config.chainType === "arbitrum") { - //await this.arbitrumManager. - } } catch (error) { this.logger.error({ error }, "Error updating gas prices for block") sentry.captureException(error) From b5494e8efe412cfedac3623e7b8254cca2df5cfe Mon Sep 17 00:00:00 2001 From: mouseless <97399882+mouseless-eth@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:49:46 +0000 Subject: [PATCH 2/2] make flag for watch block polling --- src/cli/config/bundler.ts | 1 + src/cli/config/options.ts | 6 ++++++ src/handlers/gasPriceManager.ts | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cli/config/bundler.ts b/src/cli/config/bundler.ts index dc96f058..f094020a 100644 --- a/src/cli/config/bundler.ts +++ b/src/cli/config/bundler.ts @@ -189,6 +189,7 @@ export const gasPriceArgsSchema = z.object({ .string() .transform((val) => BigInt(val)) .default("100"), + "watch-block-polling-interval": z.number().int().min(0).default(500), "gas-price-multipliers": z .string() .transform((value) => value.split(",").map(BigInt)) diff --git a/src/cli/config/options.ts b/src/cli/config/options.ts index ff2fc30a..0fb162c2 100644 --- a/src/cli/config/options.ts +++ b/src/cli/config/options.ts @@ -169,6 +169,12 @@ export const gasPriceOptions: CliCommandOptions = { require: false, default: "100" }, + "watch-block-polling-interval": { + description: "How often should the block number be polled", + type: "number", + require: false, + default: 500 + }, "gas-price-staleness-threshold": { description: "Maximum that the gas prices fetched using pimlico_getUserOperationGasPrice will be accepted for (number of blocks)", diff --git a/src/handlers/gasPriceManager.ts b/src/handlers/gasPriceManager.ts index ee49e788..dfdea910 100644 --- a/src/handlers/gasPriceManager.ts +++ b/src/handlers/gasPriceManager.ts @@ -151,7 +151,8 @@ export class GasPriceManager { onError: (error) => { this.logger.error({ error }, "Error watching block number") sentry.captureException(error) - } + }, + pollingInterval: this.config.watchBlockPollingInterval }) }