From 24207f1d61095a4a1249c7881f243d62d233fc09 Mon Sep 17 00:00:00 2001 From: "Utkir S." Date: Tue, 13 Aug 2024 19:21:34 +0500 Subject: [PATCH] Cgl fix (#236) --- lerna.json | 2 +- package.json | 2 +- packages/api/package.json | 10 +++++----- packages/cli/package.json | 14 +++++++------- packages/db/package.json | 4 ++-- packages/executor/package.json | 10 +++++----- packages/executor/src/modules/eth.ts | 19 ++++++++++++++++++- packages/monitoring/package.json | 4 ++-- packages/node/package.json | 16 ++++++++-------- packages/params/package.json | 6 +++--- packages/types/package.json | 2 +- packages/utils/package.json | 4 ++-- 12 files changed, 55 insertions(+), 38 deletions(-) diff --git a/lerna.json b/lerna.json index 88ff1cee..da63f2aa 100644 --- a/lerna.json +++ b/lerna.json @@ -3,7 +3,7 @@ "packages/*" ], "npmClient": "yarn", - "version": "2.0.16", + "version": "2.0.17", "stream": "true", "command": { "version": { diff --git a/package.json b/package.json index e75e1f70..3a02c624 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "root", "private": true, - "version": "2.0.16", + "version": "2.0.17", "engines": { "node": ">=18.0.0" }, diff --git a/packages/api/package.json b/packages/api/package.json index 00efb6bd..56008b3a 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "2.0.16", + "version": "2.0.17", "description": "The API module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -34,10 +34,10 @@ "dependencies": { "@fastify/cors": "9.0.1", "@fastify/websocket": "10.0.1", - "@skandha/executor": "^2.0.16", - "@skandha/monitoring": "^2.0.16", - "@skandha/types": "^2.0.16", - "@skandha/utils": "^2.0.16", + "@skandha/executor": "^2.0.17", + "@skandha/monitoring": "^2.0.17", + "@skandha/types": "^2.0.17", + "@skandha/utils": "^2.0.17", "class-transformer": "0.5.1", "class-validator": "0.14.1", "ethers": "5.7.2", diff --git a/packages/cli/package.json b/packages/cli/package.json index 5ab68e2b..9b7b8d02 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "2.0.16", + "version": "2.0.17", "description": "> TODO: description", "author": "zincoshine ", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -40,12 +40,12 @@ "@libp2p/peer-id-factory": "2.0.1", "@libp2p/prometheus-metrics": "1.1.3", "@multiformats/multiaddr": "12.1.3", - "@skandha/api": "^2.0.16", - "@skandha/db": "^2.0.16", - "@skandha/executor": "^2.0.16", - "@skandha/monitoring": "^2.0.16", - "@skandha/node": "^2.0.16", - "@skandha/types": "^2.0.16", + "@skandha/api": "^2.0.17", + "@skandha/db": "^2.0.17", + "@skandha/executor": "^2.0.17", + "@skandha/monitoring": "^2.0.17", + "@skandha/node": "^2.0.17", + "@skandha/types": "^2.0.17", "find-up": "5.0.0", "got": "12.5.3", "js-yaml": "4.1.0", diff --git a/packages/db/package.json b/packages/db/package.json index bc3ed344..85e7ab13 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "2.0.16", + "version": "2.0.17", "description": "The DB module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://github.com/etherspot/etherspot-bundler#readme", @@ -34,7 +34,7 @@ "dependencies": { "@chainsafe/ssz": "0.10.1", "@farcaster/rocksdb": "5.5.0", - "@skandha/types": "^2.0.16" + "@skandha/types": "^2.0.17" }, "devDependencies": { "@types/rocksdb": "3.0.1", diff --git a/packages/executor/package.json b/packages/executor/package.json index b1df7c5d..488c00c5 100644 --- a/packages/executor/package.json +++ b/packages/executor/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "2.0.16", + "version": "2.0.17", "description": "The Relayer module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -35,10 +35,10 @@ }, "dependencies": { "@flashbots/ethers-provider-bundle": "0.6.2", - "@skandha/monitoring": "^2.0.16", - "@skandha/params": "^2.0.16", - "@skandha/types": "^2.0.16", - "@skandha/utils": "^2.0.16", + "@skandha/monitoring": "^2.0.17", + "@skandha/params": "^2.0.17", + "@skandha/types": "^2.0.17", + "@skandha/utils": "^2.0.17", "async-mutex": "0.4.0", "ethers": "5.7.2", "strict-event-emitter-types": "2.0.0", diff --git a/packages/executor/src/modules/eth.ts b/packages/executor/src/modules/eth.ts index edf0521c..e8b3b5bd 100644 --- a/packages/executor/src/modules/eth.ts +++ b/packages/executor/src/modules/eth.ts @@ -225,7 +225,8 @@ export class Eth { //> let callGasLimit = minBn(binarySearchCGL, paidFeeCGL); - if (userOp.factoryData !== undefined && userOp.factoryData.length > 2) { + // check between binary search & paid fee cgl + if (userOp.factoryData !== undefined && userOp.factoryData.length <= 2) { await this.provider .estimateGas({ from: entryPoint, @@ -237,6 +238,22 @@ export class Eth { callGasLimit = maxBn(binarySearchCGL, paidFeeCGL); }); } + + callGasLimit = minBn(ethEstimateGas, callGasLimit); + + // check between eth_estimateGas & binary search & paid fee cgl + if (userOp.factoryData !== undefined && userOp.factoryData.length <= 2) { + await this.provider + .estimateGas({ + from: entryPoint, + to: userOp.sender, + data: userOp.callData, + gasLimit: callGasLimit, + }) + .catch((_) => { + callGasLimit = maxBn(ethEstimateGas, callGasLimit); + }); + } this.logger.debug( { callGasLimit, diff --git a/packages/monitoring/package.json b/packages/monitoring/package.json index 010ba85b..60974e4d 100644 --- a/packages/monitoring/package.json +++ b/packages/monitoring/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "2.0.16", + "version": "2.0.17", "description": "The Monitoring module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://github.com/etherspot/etherspot-bundler#readme", @@ -32,7 +32,7 @@ "check-readme": "typescript-docs-verifier" }, "dependencies": { - "@skandha/types": "^2.0.16", + "@skandha/types": "^2.0.17", "prom-client": "15.1.0" } } diff --git a/packages/node/package.json b/packages/node/package.json index 970bcd14..0e0d57e5 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "2.0.16", + "version": "2.0.17", "description": "The bundler node module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -56,13 +56,13 @@ "@libp2p/prometheus-metrics": "1.1.3", "@libp2p/tcp": "6.1.0", "@multiformats/multiaddr": "11.4.0", - "@skandha/api": "^2.0.16", - "@skandha/db": "^2.0.16", - "@skandha/executor": "^2.0.16", - "@skandha/monitoring": "^2.0.16", - "@skandha/params": "^2.0.16", - "@skandha/types": "^2.0.16", - "@skandha/utils": "^2.0.16", + "@skandha/api": "^2.0.17", + "@skandha/db": "^2.0.17", + "@skandha/executor": "^2.0.17", + "@skandha/monitoring": "^2.0.17", + "@skandha/params": "^2.0.17", + "@skandha/types": "^2.0.17", + "@skandha/utils": "^2.0.17", "abstract-leveldown": "7.2.0", "datastore-core": "8.0.1", "ethers": "5.7.2", diff --git a/packages/params/package.json b/packages/params/package.json index aabcd9fc..89027963 100644 --- a/packages/params/package.json +++ b/packages/params/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "2.0.16", + "version": "2.0.17", "description": "Various bundler parameters", "author": "Etherspot", "homepage": "https://github.com/etherspot/skandha#readme", @@ -28,8 +28,8 @@ "@arbitrum/sdk": "3.1.4", "@chainsafe/ssz": "0.16.0", "@mantleio/sdk": "0.2.1", - "@skandha/types": "^2.0.16", - "@skandha/utils": "^2.0.16", + "@skandha/types": "^2.0.17", + "@skandha/utils": "^2.0.17", "ethers": "5.7.2" }, "scripts": { diff --git a/packages/types/package.json b/packages/types/package.json index 2bc60925..d06f6406 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "2.0.16", + "version": "2.0.17", "description": "The types of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", diff --git a/packages/utils/package.json b/packages/utils/package.json index f2a16fd0..b009333f 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "2.0.16", + "version": "2.0.17", "description": "utils of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -33,7 +33,7 @@ }, "dependencies": { "@chainsafe/as-sha256": "0.3.1", - "@skandha/types": "^2.0.16", + "@skandha/types": "^2.0.17", "any-signal": "3.0.1", "bigint-buffer": "1.1.5", "case": "^1.6.3",