Skip to content

Commit

Permalink
Merge branch 'feat/optimize-get-user-operation-gas' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Oct 29, 2024
2 parents e200576 + b5494e8 commit cb96c11
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/cli/config/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 6 additions & 0 deletions src/cli/config/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ export const gasPriceOptions: CliCommandOptions<IGasPriceArgsInput> = {
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)",
Expand Down
7 changes: 5 additions & 2 deletions src/handlers/gasPriceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export class GasPriceManager {
onError: (error) => {
this.logger.error({ error }, "Error watching block number")
sentry.captureException(error)
}
},
pollingInterval: this.config.watchBlockPollingInterval
})
}

Expand All @@ -164,7 +165,9 @@ export class GasPriceManager {
await this.updateBaseFee(latestBlock)
}

this.logger.info("updated gas price values")
this.logger.info("updated gas price values ", {
gasPrice: this.gasPriceStack.peek()
})
} catch (error) {
this.logger.error({ error }, "Error updating gas prices for block")
sentry.captureException(error)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"test": "vitest dev -c ./vitest.config.ts",
"test": "vitest dev -c ./vitest.config.ts eth_sendUserOperation",
"test:ci": "CI=true && vitest -c ./vitest.config.ts"
},
"dependencies": {
Expand Down

0 comments on commit cb96c11

Please sign in to comment.