From 28142ff4c50f6350d65b809cdb482f89722571e5 Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Fri, 28 Jul 2023 15:46:10 +0500 Subject: [PATCH 1/3] always set gas limits to max value during estimation --- packages/executor/src/modules/eth.ts | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/packages/executor/src/modules/eth.ts b/packages/executor/src/modules/eth.ts index a3cc8a3a..70995b37 100644 --- a/packages/executor/src/modules/eth.ts +++ b/packages/executor/src/modules/eth.ts @@ -104,22 +104,14 @@ export class Eth { ...userOp, }; - if (BigNumber.from(userOpComplemented.callGasLimit).eq(0)) { - userOpComplemented.callGasLimit = BigNumber.from(10e6); - } - if (BigNumber.from(userOpComplemented.preVerificationGas).eq(0)) { - userOpComplemented.preVerificationGas = BigNumber.from(1e6); - } - if (BigNumber.from(userOpComplemented.verificationGasLimit).eq(0)) { - userOpComplemented.verificationGasLimit = BigNumber.from(10e6); - } + userOpComplemented.callGasLimit = BigNumber.from(10e6); + userOpComplemented.preVerificationGas = BigNumber.from(1e6); + userOpComplemented.verificationGasLimit = BigNumber.from(10e6); - if (userOpComplemented.signature === "0x") { - userOpComplemented.signature = await this.getDummySignature({ - userOp: userOpComplemented, - entryPoint: args.entryPoint, - }); - } + userOpComplemented.signature = await this.getDummySignature({ + userOp: userOpComplemented, + entryPoint: args.entryPoint, + }); const returnInfo = await this.userOpValidationService.validateForEstimation( userOpComplemented, From a3bfd9c492cccef283a10ff4f472430b5bf9448a Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Fri, 28 Jul 2023 15:46:43 +0500 Subject: [PATCH 2/3] chore(release): v0.0.25 --- lerna.json | 2 +- package.json | 2 +- packages/api/package.json | 6 +++--- packages/cli/package.json | 10 +++++----- packages/db/package.json | 4 ++-- packages/executor/package.json | 6 +++--- packages/params/package.json | 4 ++-- packages/types/package.json | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lerna.json b/lerna.json index 79a03998..04132fa7 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "0.0.24", + "version": "0.0.25", "stream": "true", "command": { "version": { diff --git a/package.json b/package.json index a4b17ee6..8211b0a8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "root", "private": true, - "version": "0.0.24", + "version": "0.0.25", "engines": { "node": ">=18.0.0" }, diff --git a/packages/api/package.json b/packages/api/package.json index 502a7d4e..1feade8d 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "api", - "version": "0.0.24", + "version": "0.0.25", "description": "The API module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -35,12 +35,12 @@ "class-transformer": "0.5.1", "class-validator": "0.14.0", "ethers": "5.7.2", - "executor": "^0.0.24", + "executor": "^0.0.25", "fastify": "4.14.1", "pino": "8.11.0", "pino-pretty": "10.0.0", "reflect-metadata": "0.1.13", - "types": "^0.0.24" + "types": "^0.0.25" }, "devDependencies": { "@types/connect": "3.4.35" diff --git a/packages/cli/package.json b/packages/cli/package.json index 86909043..33214188 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "cli", - "version": "0.0.24", + "version": "0.0.25", "description": "> TODO: description", "author": "zincoshine ", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -31,13 +31,13 @@ "url": "https://https://github.com/etherspot/skandha/issues" }, "dependencies": { - "api": "^0.0.24", - "db": "^0.0.24", - "executor": "^0.0.24", + "api": "^0.0.25", + "db": "^0.0.25", + "executor": "^0.0.25", "find-up": "5.0.0", "got": "12.5.3", "js-yaml": "4.1.0", - "types": "^0.0.24", + "types": "^0.0.25", "yargs": "17.6.2" }, "devDependencies": { diff --git a/packages/db/package.json b/packages/db/package.json index f7b1e24b..ca2c326c 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "db", - "version": "0.0.24", + "version": "0.0.25", "description": "The DB module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://github.com/etherspot/etherspot-bundler#readme", @@ -37,6 +37,6 @@ "devDependencies": { "@types/rocksdb": "3.0.1", "prettier": "^2.8.4", - "types": "^0.0.24" + "types": "^0.0.25" } } diff --git a/packages/executor/package.json b/packages/executor/package.json index 14a5dc82..db33a159 100644 --- a/packages/executor/package.json +++ b/packages/executor/package.json @@ -1,6 +1,6 @@ { "name": "executor", - "version": "0.0.24", + "version": "0.0.25", "description": "The Relayer module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -33,7 +33,7 @@ "dependencies": { "async-mutex": "0.4.0", "ethers": "5.7.2", - "params": "^0.0.24", - "types": "^0.0.24" + "params": "^0.0.25", + "types": "^0.0.25" } } diff --git a/packages/params/package.json b/packages/params/package.json index 5a390d19..b2c8067d 100644 --- a/packages/params/package.json +++ b/packages/params/package.json @@ -1,6 +1,6 @@ { "name": "params", - "version": "0.0.24", + "version": "0.0.25", "description": "Various bundler parameters", "author": "Etherspot", "homepage": "https://github.com/etherspot/skandha#readme", @@ -24,7 +24,7 @@ "@arbitrum/sdk": "3.1.4", "@eth-optimism/sdk": "3.0.0", "ethers": "5.7.2", - "types": "^0.0.24" + "types": "^0.0.25" }, "scripts": { "clean": "rm -rf lib && rm -f *.tsbuildinfo", diff --git a/packages/types/package.json b/packages/types/package.json index de8b9c53..b71dff52 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "types", - "version": "0.0.24", + "version": "0.0.25", "description": "The types of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", From 589f2e837d12843c6f41872b066df1ab698cfb68 Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Fri, 28 Jul 2023 15:49:00 +0500 Subject: [PATCH 3/3] fix maxFeePerGas = 0 --- packages/executor/src/modules/eth.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/executor/src/modules/eth.ts b/packages/executor/src/modules/eth.ts index 70995b37..1b587254 100644 --- a/packages/executor/src/modules/eth.ts +++ b/packages/executor/src/modules/eth.ts @@ -140,6 +140,11 @@ export class Eth { ?.mul(100) .div(100 + (estimationBaseFeeDivisor || 0)); + // handle the edge case where maxFeePerGas = 0 + if (BigNumber.from(userOpComplemented.maxFeePerGas).eq(0)) { + userOpComplemented.maxFeePerGas = BigNumber.from(1); + } + if (!estimatedBaseFee) { callGasLimit = BigNumber.from(paid).div(userOpComplemented.maxFeePerGas); } else {