From 96db6b8bc7f95836f1afe8578b45e16df4705bcd Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Wed, 15 May 2024 14:31:27 +0500 Subject: [PATCH 1/4] fix ancient8 oracle --- .gitignore | 1 + package.json | 5 +- .../params/src/gas-price-oracles/getGasFee.ts | 3 +- .../src/gas-price-oracles/oracles/ancient8.ts | 51 ++++++++++++------- 4 files changed, 37 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index a648a77f..becc5993 100644 --- a/.gitignore +++ b/.gitignore @@ -138,3 +138,4 @@ packages/contracts/out-via-ir/ packages/contracts/.env packages/contracts/broadcast/*/*/* packages/contracts/out/ +packages/cli/.git-data.json \ No newline at end of file diff --git a/package.json b/package.json index 43a5fecb..b9962d21 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,6 @@ { "name": "root", - "private": false, - "publishConfig": { - "access": "public" - }, + "private": true, "version": "1.5.7", "engines": { "node": ">=18.0.0" diff --git a/packages/params/src/gas-price-oracles/getGasFee.ts b/packages/params/src/gas-price-oracles/getGasFee.ts index 0b118e2d..51210b38 100644 --- a/packages/params/src/gas-price-oracles/getGasFee.ts +++ b/packages/params/src/gas-price-oracles/getGasFee.ts @@ -19,7 +19,8 @@ export const getGasFee = async ( try { const feeData = await provider.getFeeData(); return { - maxPriorityFeePerGas: feeData.maxPriorityFeePerGas ?? feeData.gasPrice ?? 0, + maxPriorityFeePerGas: + feeData.maxPriorityFeePerGas ?? feeData.gasPrice ?? 0, maxFeePerGas: feeData.maxFeePerGas ?? feeData.gasPrice ?? 0, gasPrice: feeData.gasPrice ?? 0, }; diff --git a/packages/params/src/gas-price-oracles/oracles/ancient8.ts b/packages/params/src/gas-price-oracles/oracles/ancient8.ts index 05f5b650..85db6216 100644 --- a/packages/params/src/gas-price-oracles/oracles/ancient8.ts +++ b/packages/params/src/gas-price-oracles/oracles/ancient8.ts @@ -1,26 +1,41 @@ import { fetchJson, hexValue } from "ethers/lib/utils"; -import { BigNumber } from "ethers"; +import { BigNumber, providers } from "ethers"; import { parseGwei } from "./utils"; import { IGetGasFeeResult, IOracle } from "./interfaces"; -export const getAncient8GasFee: IOracle = - async (): Promise => { - const { gas_prices }: Ancient8Response = await fetchJson({ - url: "https://scan.ancient8.gg/api/v2/stats", - headers: { - "updated-gas-oracle": "true", - }, - }); - const maxPriorityFeePerGas = hexValue( - BigNumber.from(gas_prices.fast.priority_fee_wei) - ); - const maxFeePerGas = parseGwei(gas_prices.fast.priority_fee); - return { - maxPriorityFeePerGas: maxPriorityFeePerGas, - gasPrice: maxFeePerGas, - maxFeePerGas: maxFeePerGas, - }; +export const getAncient8GasFee: IOracle = async ( + apiKey: string, + provider?: providers.JsonRpcProvider +): Promise => { + try { + if (provider) { + const gasPrice = await provider.getGasPrice(); + return { + maxPriorityFeePerGas: gasPrice, + gasPrice: gasPrice, + maxFeePerGas: gasPrice, + }; + } + } catch (err) { + /* empty */ + } + + const { gas_prices }: Ancient8Response = await fetchJson({ + url: "https://scan.ancient8.gg/api/v2/stats", + headers: { + "updated-gas-oracle": "true", + }, + }); + const maxPriorityFeePerGas = hexValue( + BigNumber.from(gas_prices.average.priority_fee_wei) + ); + const maxFeePerGas = parseGwei(gas_prices.average.priority_fee); + return { + maxPriorityFeePerGas: maxPriorityFeePerGas, + gasPrice: maxFeePerGas, + maxFeePerGas: maxFeePerGas, }; +}; type Ancient8Response = { gas_prices: { From 716b6d056597a7f9d2f373a2e03f10614251391c Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Wed, 15 May 2024 14:37:50 +0500 Subject: [PATCH 2/4] use geth v13 for bundler-spec-tests --- .github/workflows/bundler-spec-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bundler-spec-tests.yml b/.github/workflows/bundler-spec-tests.yml index 4bfc23c8..c4744084 100644 --- a/.github/workflows/bundler-spec-tests.yml +++ b/.github/workflows/bundler-spec-tests.yml @@ -44,13 +44,13 @@ jobs: - name: Install Geth run: | - sudo add-apt-repository -y ppa:ethereum/ethereum && \ - sudo apt-get update && \ - sudo apt-get install ethereum + wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.13.15-c5ba367e.tar.gz + tar -xvf geth-linux-amd64-1.13.15-c5ba367e.tar.gz - name: Run Geth run: | - geth \ + cd geth-linux-amd64-1.13.15-c5ba367e && + ./geth \ --verbosity 1 \ --http.vhosts '*,localhost,host.docker.internal' \ --http \ From afb439937410125580b729ecedcae5b2eefca881 Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Wed, 15 May 2024 14:43:49 +0500 Subject: [PATCH 3/4] fix workflow --- .github/workflows/bundler-spec-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bundler-spec-tests.yml b/.github/workflows/bundler-spec-tests.yml index c4744084..79b35481 100644 --- a/.github/workflows/bundler-spec-tests.yml +++ b/.github/workflows/bundler-spec-tests.yml @@ -76,7 +76,8 @@ jobs: - name: Fund bundler run: | - geth \ + cd geth-linux-amd64-1.13.15-c5ba367e && + ./geth \ --exec "eth.sendTransaction({from: eth.accounts[0], to: \"0x55082761664aEb8062B3427ba5E0455bFb7b68CB\", value: web3.toWei(4337, \"ether\")})" \ attach http://localhost:8545/ From 1d6f7fd4f767d04bf30df3b6f5b8384842eaec3a Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Wed, 15 May 2024 14:55:26 +0500 Subject: [PATCH 4/4] chore(release): v1.5.8 --- lerna.json | 2 +- package.json | 2 +- packages/api/package.json | 10 +++++----- packages/cli/package.json | 14 +++++++------- packages/contracts/package.json | 2 +- packages/db/package.json | 4 ++-- packages/executor/package.json | 10 +++++----- 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, 38 insertions(+), 38 deletions(-) diff --git a/lerna.json b/lerna.json index a3696516..ab495fc4 100644 --- a/lerna.json +++ b/lerna.json @@ -3,7 +3,7 @@ "packages/*" ], "npmClient": "yarn", - "version": "1.5.7", + "version": "1.5.8", "stream": "true", "command": { "version": { diff --git a/package.json b/package.json index b9962d21..b979d7ed 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "root", "private": true, - "version": "1.5.7", + "version": "1.5.8", "engines": { "node": ">=18.0.0" }, diff --git a/packages/api/package.json b/packages/api/package.json index d8d5d3cc..e2875dea 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "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": "^1.5.7", - "@skandha/monitoring": "^1.5.7", - "@skandha/types": "^1.5.7", - "@skandha/utils": "^1.5.7", + "@skandha/executor": "^1.5.8", + "@skandha/monitoring": "^1.5.8", + "@skandha/types": "^1.5.8", + "@skandha/utils": "^1.5.8", "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 d7e3b919..a90e8edc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "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": "^1.5.7", - "@skandha/db": "^1.5.7", - "@skandha/executor": "^1.5.7", - "@skandha/monitoring": "^1.5.7", - "@skandha/node": "^1.5.7", - "@skandha/types": "^1.5.7", + "@skandha/api": "^1.5.8", + "@skandha/db": "^1.5.8", + "@skandha/executor": "^1.5.8", + "@skandha/monitoring": "^1.5.8", + "@skandha/node": "^1.5.8", + "@skandha/types": "^1.5.8", "find-up": "5.0.0", "got": "12.5.3", "js-yaml": "4.1.0", diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 927d5cb6..778bc7a0 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "description": "Smart contracts of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", diff --git a/packages/db/package.json b/packages/db/package.json index f131dda0..71efde33 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "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": "^1.5.7" + "@skandha/types": "^1.5.8" }, "devDependencies": { "@types/rocksdb": "3.0.1", diff --git a/packages/executor/package.json b/packages/executor/package.json index d68ac164..44602ab4 100644 --- a/packages/executor/package.json +++ b/packages/executor/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "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": "^1.5.7", - "@skandha/params": "^1.5.7", - "@skandha/types": "^1.5.7", - "@skandha/utils": "^1.5.7", + "@skandha/monitoring": "^1.5.8", + "@skandha/params": "^1.5.8", + "@skandha/types": "^1.5.8", + "@skandha/utils": "^1.5.8", "async-mutex": "0.4.0", "ethers": "5.7.2", "strict-event-emitter-types": "2.0.0", diff --git a/packages/monitoring/package.json b/packages/monitoring/package.json index bc349177..13b2beb4 100644 --- a/packages/monitoring/package.json +++ b/packages/monitoring/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "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": "^1.5.7", + "@skandha/types": "^1.5.8", "prom-client": "^14.2.0" } } diff --git a/packages/node/package.json b/packages/node/package.json index e43db380..d1685cf5 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "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": "^1.5.7", - "@skandha/db": "^1.5.7", - "@skandha/executor": "^1.5.7", - "@skandha/monitoring": "^1.5.7", - "@skandha/params": "^1.5.7", - "@skandha/types": "^1.5.7", - "@skandha/utils": "^1.5.7", + "@skandha/api": "^1.5.8", + "@skandha/db": "^1.5.8", + "@skandha/executor": "^1.5.8", + "@skandha/monitoring": "^1.5.8", + "@skandha/params": "^1.5.8", + "@skandha/types": "^1.5.8", + "@skandha/utils": "^1.5.8", "@types/varint": "6.0.1", "abstract-leveldown": "7.2.0", "datastore-core": "8.0.1", diff --git a/packages/params/package.json b/packages/params/package.json index 3020eec5..acff2439 100644 --- a/packages/params/package.json +++ b/packages/params/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "description": "Various bundler parameters", "author": "Etherspot", "homepage": "https://github.com/etherspot/skandha#readme", @@ -29,8 +29,8 @@ "@chainsafe/ssz": "0.10.1", "@eth-optimism/sdk": "3.2.3", "@mantleio/sdk": "0.2.1", - "@skandha/types": "^1.5.7", - "@skandha/utils": "^1.5.7", + "@skandha/types": "^1.5.8", + "@skandha/utils": "^1.5.8", "ethers": "5.7.2" }, "scripts": { diff --git a/packages/types/package.json b/packages/types/package.json index defbcaca..e2d25324 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "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 2f153537..3ef3d635 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "1.5.7", + "version": "1.5.8", "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": "^1.5.7", + "@skandha/types": "^1.5.8", "any-signal": "3.0.1", "bigint-buffer": "1.1.5", "case": "^1.6.3",