Skip to content

Commit

Permalink
fix estimations contract
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Jan 10, 2025
1 parent 57617f0 commit b3f7c53
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/cli/config/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,13 @@ export const gasEstimationArgsSchema = z.object({
.string()
.transform((val) => BigInt(val))
.default("1000000"),
"call-gas-limit-multiplier": z.string().transform((val) => BigInt(val)),
"v6-call-gas-limit-multiplier": z.string().transform((val) => BigInt(val)),
"v7-verification-gas-limit-multiplier": z
.string()
.transform((val) => BigInt(val)),
"v7-paymaster-verification-gas-limit-multiplier": z
.string()
.transform((val) => BigInt(val)),
"simulation-call-gas-limit": z.string().transform((val) => BigInt(val)),
"simulation-verification-gas-limit": z
.string()
Expand Down
18 changes: 16 additions & 2 deletions src/cli/config/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,27 @@ export const gasEstimationOptions: CliCommandOptions<IGasEstimationArgsInput> =
require: false,
default: "30000000"
},
"call-gas-limit-multiplier": {
"v6-call-gas-limit-multiplier": {
description:
"Amount to multiply the call gas limits fetched from simulations",
"Amount to multiply the call gas limits fetched from simulations for v6 userOperations",
type: "string",
require: true,
default: "100"
},
"v7-verification-gas-limit-multiplier": {
description:
"Amount to multiply the verification gas limits fetched from simulations for v7 userOperations",
type: "string",
require: true,
default: "130"
},
"v7-paymaster-verification-gas-limit-multiplier": {
description:
"Amount to multiply the paymaster verification gas limits fetched from simulations for v7 userOperations",
type: "string",
require: true,
default: "130"
},
"paymaster-gas-limit-multiplier": {
description:
"Amount to multiply the paymaster gas limits fetched from simulations",
Expand Down
13 changes: 12 additions & 1 deletion src/rpc/rpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,18 @@ export class RpcHandler implements IRpcEndpoint {
if (isVersion06(simulationUserOperation)) {
callGasLimit = scaleBigIntByPercent(
callGasLimit,
Number(this.config.callGasLimitMultiplier)
Number(this.config.v6CallGasLimitMultiplier)
)
}

if (isVersion07(simulationUserOperation)) {
verificationGasLimit = scaleBigIntByPercent(
verificationGasLimit,
Number(this.config.v7VerificationGasLimitMultiplier)
)
paymasterVerificationGasLimit = scaleBigIntByPercent(
paymasterVerificationGasLimit,
Number(this.config.v7PaymasterVerificationGasLimitMultiplier)
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/types/contracts/PimlicoEntryPointSimulations.ts

Large diffs are not rendered by default.

0 comments on commit b3f7c53

Please sign in to comment.