From 872cb4d9dc0e7ab2b3e684a592246ee9687989a7 Mon Sep 17 00:00:00 2001 From: Utkir S Date: Mon, 13 May 2024 20:34:28 +0500 Subject: [PATCH] publish to npm (#179) --- .github/actions/setup-and-build/action.yml | 58 ++++++++++ .github/workflows/binaries.yml | 56 +++++++++ .github/workflows/release.yml | 108 ++++++++++++++++-- .../scripts/assert-same-package-version.sh | 19 +++ .gitignore | 4 +- event.json | 4 + package.json | 9 +- packages/api/package.json | 10 +- packages/api/src/app.ts | 10 +- packages/api/src/dto/SetReputation.dto.ts | 2 +- packages/api/src/modules/debug.ts | 10 +- packages/api/src/modules/eth.ts | 4 +- packages/api/src/modules/redirect.ts | 2 +- packages/api/src/modules/skandha.ts | 10 +- packages/api/src/modules/subscription.ts | 6 +- packages/api/src/modules/web3.ts | 2 +- packages/api/src/server.ts | 4 +- packages/api/src/utils/RpcMethodValidator.ts | 4 +- packages/cli/.git-data.json | 4 - packages/cli/package.json | 14 +-- packages/cli/src/cmds/node/handler.ts | 28 +++-- .../cli/src/cmds/node/initPeerIdAndEnr.ts | 4 +- packages/cli/src/cmds/standalone/handler.ts | 18 +-- .../cli/src/options/bundlerOptions/api.ts | 2 +- .../src/options/bundlerOptions/executor.ts | 2 +- .../cli/src/options/bundlerOptions/metrics.ts | 2 +- .../cli/src/options/bundlerOptions/network.ts | 2 +- .../cli/src/options/bundlerOptions/options.ts | 8 +- packages/contracts/package.json | 2 +- packages/db/package.json | 4 +- packages/db/src/localDb.ts | 2 +- packages/db/src/rocksDb.ts | 2 +- packages/executor/package.json | 10 +- packages/executor/src/config.ts | 2 +- .../executor/src/entities/MempoolEntry.ts | 8 +- .../executor/src/entities/ReputationEntry.ts | 2 +- packages/executor/src/entities/interfaces.ts | 4 +- packages/executor/src/executor.ts | 8 +- packages/executor/src/interfaces.ts | 4 +- packages/executor/src/modules/debug.ts | 10 +- packages/executor/src/modules/eth.ts | 22 ++-- packages/executor/src/modules/interfaces.ts | 2 +- packages/executor/src/modules/skandha.ts | 18 +-- packages/executor/src/modules/web3.ts | 2 +- .../services/BundlingService/relayers/base.ts | 6 +- .../BundlingService/relayers/classic.ts | 4 +- .../services/BundlingService/relayers/echo.ts | 6 +- .../BundlingService/relayers/fastlane.ts | 8 +- .../BundlingService/relayers/flashbots.ts | 6 +- .../BundlingService/relayers/kolibri.ts | 6 +- .../BundlingService/relayers/merkle.ts | 6 +- .../src/services/BundlingService/service.ts | 14 +-- .../utils/estimateBundleGasLimit.ts | 2 +- .../BundlingService/utils/getUserOpHashes.ts | 4 +- .../executor/src/services/EventsService.ts | 12 +- .../src/services/MempoolService/reputation.ts | 8 +- .../src/services/MempoolService/service.ts | 10 +- packages/executor/src/services/P2PService.ts | 2 +- .../src/services/ReputationService.ts | 6 +- .../src/services/SubscriptionService.ts | 6 +- .../services/UserOpValidation/GethTracer.ts | 2 +- .../src/services/UserOpValidation/service.ts | 8 +- .../src/services/UserOpValidation/utils.ts | 12 +- .../UserOpValidation/validators/estimation.ts | 14 +-- .../UserOpValidation/validators/safe.ts | 18 +-- .../UserOpValidation/validators/unsafe.ts | 6 +- packages/executor/src/utils/index.ts | 4 +- packages/executor/test/fixtures/getClient.ts | 2 +- packages/executor/test/fixtures/userOp.ts | 4 +- packages/executor/test/mocks/GethTracer.ts | 2 +- packages/executor/test/mocks/database.ts | 2 +- packages/executor/test/mocks/logger.ts | 2 +- .../executor/test/unit/modules/eth.test.ts | 2 +- .../unit/services/BundlingService.test.ts | 4 +- .../test/utils/applyEstimatedUserOp.ts | 4 +- packages/monitoring/package.json | 4 +- packages/monitoring/src/createMetrics.ts | 2 +- packages/monitoring/src/server/http.ts | 2 +- packages/node/package.json | 16 +-- packages/node/src/api/index.ts | 2 +- .../src/api/publishVerifiedUserOperation.ts | 2 +- .../api/publishVerifiedUserOperationJSON.ts | 4 +- packages/node/src/index.ts | 24 ++-- packages/node/src/network/events.ts | 2 +- packages/node/src/network/gossip/encoding.ts | 2 +- packages/node/src/network/gossip/handler.ts | 10 +- packages/node/src/network/gossip/interface.ts | 2 +- packages/node/src/network/gossip/topic.ts | 2 +- packages/node/src/network/interface.ts | 4 +- packages/node/src/network/metadata.ts | 2 +- packages/node/src/network/network.ts | 12 +- packages/node/src/network/nodejs/util.ts | 2 +- packages/node/src/network/peers/discover.ts | 6 +- .../node/src/network/peers/peerManager.ts | 4 +- packages/node/src/network/peers/peersData.ts | 2 +- packages/node/src/network/peers/score.ts | 2 +- .../network/peers/utils/prioritizePeers.ts | 2 +- .../src/network/processor/gossipHandlers.ts | 12 +- .../src/network/processor/gossipQueues.ts | 2 +- packages/node/src/network/processor/index.ts | 6 +- packages/node/src/network/processor/types.ts | 2 +- packages/node/src/network/processor/worker.ts | 2 +- .../node/src/network/reqresp/ReqRespNode.ts | 6 +- .../src/network/reqresp/handlers/index.ts | 8 +- .../reqresp/handlers/pooledUserOpHashes.ts | 14 +-- .../reqresp/handlers/pooledUserOpsByHash.ts | 12 +- .../src/network/reqresp/handlers/status.ts | 6 +- .../node/src/network/reqresp/interface.ts | 2 +- .../src/network/reqresp/pooledUserOpHashes.ts | 6 +- .../network/reqresp/pooledUserOpsByHash.ts | 6 +- packages/node/src/network/reqresp/types.ts | 2 +- packages/node/src/network/statusCache.ts | 4 +- .../validation/verifiedUserOperation.ts | 4 +- packages/node/src/options/bundler.ts | 2 +- packages/node/src/options/network.ts | 2 +- packages/node/src/reqresp/ReqResp.ts | 2 +- .../encodingStrategies/sszSnappy/errors.ts | 2 +- .../node/src/reqresp/protocols/Goodbye.ts | 2 +- .../node/src/reqresp/protocols/Metadata.ts | 2 +- packages/node/src/reqresp/protocols/Ping.ts | 2 +- .../reqresp/protocols/PooledUserOpHashes.ts | 2 +- .../reqresp/protocols/PooledUserOpsByHash.ts | 2 +- packages/node/src/reqresp/protocols/Status.ts | 4 +- packages/node/src/reqresp/request/errors.ts | 2 +- packages/node/src/reqresp/request/index.ts | 4 +- packages/node/src/reqresp/response/errors.ts | 2 +- packages/node/src/reqresp/response/index.ts | 4 +- packages/node/src/reqresp/types.ts | 2 +- packages/node/src/sync/interface.ts | 8 +- packages/node/src/sync/sync.ts | 16 +-- packages/params/package.json | 6 +- .../params/src/gas-estimation/ancient8.ts | 4 +- .../params/src/gas-estimation/arbitrum.ts | 4 +- packages/params/src/gas-estimation/mantle.ts | 4 +- .../params/src/gas-estimation/optimism.ts | 4 +- .../gas-price-oracles/oracles/interfaces.ts | 2 +- .../src/gas-price-oracles/oracles/mantle.ts | 2 +- packages/params/src/types/IPVGEstimator.ts | 2 +- packages/params/src/utils/cursor.ts | 4 +- packages/params/src/utils/mempool.ts | 2 +- packages/params/src/utils/userOp.ts | 8 +- packages/types/package.json | 2 +- packages/utils/package.json | 4 +- tasks/get_prev_tag.js | 46 ++++++++ 144 files changed, 671 insertions(+), 387 deletions(-) create mode 100644 .github/actions/setup-and-build/action.yml create mode 100644 .github/workflows/binaries.yml create mode 100644 .github/workflows/scripts/assert-same-package-version.sh create mode 100644 event.json delete mode 100644 packages/cli/.git-data.json create mode 100644 tasks/get_prev_tag.js diff --git a/.github/actions/setup-and-build/action.yml b/.github/actions/setup-and-build/action.yml new file mode 100644 index 00000000..ccb170d6 --- /dev/null +++ b/.github/actions/setup-and-build/action.yml @@ -0,0 +1,58 @@ +name: "Setup and build the repo" +description: "A task to reuse setup steps during multiple jobs" +inputs: + node: + description: Node version + required: true + +runs: + using: "composite" + steps: + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{inputs.node}} + check-latest: true + cache: yarn + + - name: Node.js version + id: node + shell: bash + run: echo "v8CppApiVersion=$(node --print "process.versions.modules")" >> $GITHUB_OUTPUT + + - name: Restore build + uses: actions/cache/restore@v4 + id: cache-build-restore + with: + path: | + node_modules + packages/*/node_modules + lib/ + packages/*/lib + packages/*/.git-data.json + key: ${{ runner.os }}-${{ runner.arch }}-node-${{ inputs.node }}-${{ github.sha }} + + - name: Install & build + if: steps.cache-build-restore.outputs.cache-hit != 'true' + shell: bash + run: yarn install --frozen-lockfile && yarn build + + - name: Build + if: steps.cache-build-restore.outputs.cache-hit == 'true' + shell: bash + run: yarn build + + - name: Check Build + shell: bash + run: yarn check-build + + - name: Cache build artifacts + uses: actions/cache@master + with: + path: | + node_modules + packages/*/node_modules + lib/ + packages/*/lib + packages/*/.git-data.json + key: ${{ runner.os }}-${{ runner.arch }}-node-${{ inputs.node }}-${{ github.sha }} diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml new file mode 100644 index 00000000..48ad1399 --- /dev/null +++ b/.github/workflows/binaries.yml @@ -0,0 +1,56 @@ +name: Build binaries + +on: + workflow_dispatch: + inputs: + version: + required: true + type: string + workflow_call: + inputs: + version: + required: true + type: string + +jobs: + binaries: + name: Build skandha binaries + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + platform: linux + arch: amd64 + - os: skandha-arm64-runner + platform: linux + arch: arm64 + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v4 + - name: Install arm64 specifics + run: |- + # Install missing yarn + # See https://github.com/github-early-access/arm-runners-beta/issues/5 + curl -fsSL --create-dirs -o $HOME/bin/yarn \ + https://github.com/yarnpkg/yarn/releases/download/v1.22.22/yarn-1.22.22.js + chmod +x $HOME/bin/yarn + echo "$HOME/bin" >> $GITHUB_PATH + # Install missing build-essential + sudo apt-get update + sudo apt-get install -y build-essential + - uses: "./.github/actions/setup-and-build" + with: + node: 20 + - run: | + mkdir -p dist + yarn global add caxa@3.0.1 + npx caxa -m "Unpacking skandha binary, please wait..." -D -p "yarn install --frozen-lockfile --production" --input . --output "skandha" -- "{{caxa}}/node_modules/.bin/node" "--max-old-space-size=8192" "{{caxa}}/node_modules/.bin/skandha" + tar -czf "dist/skandha-${{ inputs.version }}-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz" "skandha" + - name: Upload binaries + if: ${{ !github.event.act }} # skip during local actions testing + uses: actions/upload-artifact@v4 + with: + name: binaries-${{ matrix.os }} + path: dist/ + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9f6556c..cc97f545 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,105 @@ on: - "master" jobs: - build: + tag: + name: Check tag + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get tag + id: get_tag + run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + + - name: Assert tag == package.json version + run: ./.github/workflows/scripts/assert-same-package-version.sh + env: + TAG: ${{ steps.get_tag.outputs.tag }} + + - name: Get previous tag + id: get_prev_tag + run: node tasks/get_prev_tag.js + env: + CURRENT_TAG: ${{ steps.get_tag.outputs.tag }} + IGNORE_PATTERN: rc + outputs: + tag: ${{ steps.get_tag.outputs.tag }} + prev_tag: ${{ steps.get_prev_tag.outputs.prev_tag }} + + binaries: + name: Build skandha binaries + uses: ./.github/workflows/binaries.yml + needs: tag + with: + version: ${{ needs.tag.outputs.tag }} + + npm: + name: Publish to NPM & Github + runs-on: ubuntu-latest + needs: [tag, binaries] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Needs full depth for changelog generation + + - name: Install arm64 specifics + run: |- + # Install missing yarn + # See https://github.com/github-early-access/arm-runners-beta/issues/5 + curl -fsSL --create-dirs -o $HOME/bin/yarn \ + https://github.com/yarnpkg/yarn/releases/download/v1.22.22/yarn-1.22.22.js + chmod +x $HOME/bin/yarn + echo "$HOME/bin" >> $GITHUB_PATH + # Install missing build-essential + sudo apt-get update + sudo apt-get install -y build-essential + - uses: "./.github/actions/setup-and-build" + with: + node: 20 + + - name: Get binaries + uses: actions/download-artifact@v4 + with: + path: dist/ + merge-multiple: true + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: dist/* + fail_on_unmatched_files: true + tag_name: ${{ needs.tag.outputs.tag }} + body_path: "CHANGELOG.md" + body: Release ${{ needs.tag.outputs.tag }} + name: Release ${{ needs.tag.outputs.tag }} + prerelease: false + - run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish to npm registry (release) + if: ${{ !github.event.act }} # skip during local actions testing + run: yarn run release:publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Rollback on failure + if: failure() + uses: author/action-rollback@9ec72a6af74774e00343c6de3e946b0901c23013 + with: + id: ${{ steps.create_release.outputs.id }} + tag: ${{ needs.tag.outputs.tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + docker: + if: ${{ !github.event.act }} # skip during local actions testing runs-on: ubuntu-latest steps: - @@ -40,14 +138,6 @@ jobs: tags: | ${{ secrets.DOCKERHUB_USERNAME }}/skandha:${{ steps.get_version.outputs.version }} ${{ secrets.DOCKERHUB_USERNAME }}/skandha:latest - - - name: Create GitHub release - uses: "marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: ${{ steps.get_version.outputs.version }} - prerelease: false - title: Release ${{ steps.get_version.outputs.version }} - name: Trigger pipeline run: ${{ secrets.PIPELINE_TRIGGER }} diff --git a/.github/workflows/scripts/assert-same-package-version.sh b/.github/workflows/scripts/assert-same-package-version.sh new file mode 100644 index 00000000..5dee55c5 --- /dev/null +++ b/.github/workflows/scripts/assert-same-package-version.sh @@ -0,0 +1,19 @@ +# Our current release strategy does not gurantee that the tagged commit +# has the same version in the package.json. +# +# If that's not the case, no version will be published to NPM and a faulty image will be published to dockerhub + +LOCAL_VERSION=$(jq -r .version lerna.json) + +if [ -z "$TAG" ]; then + echo "ENV TAG is empty" + exit 1 +fi + +if [[ $TAG == *"$LOCAL_VERSION"* ]]; then + echo "TAG $TAG includes LOCAL_VERSION $LOCAL_VERSION" + exit 0 +else + echo "TAG $TAG does not include LOCAL_VERSION $LOCAL_VERSION" + exit 1 +fi diff --git a/.gitignore b/.gitignore index a44d3232..a648a77f 100644 --- a/.gitignore +++ b/.gitignore @@ -126,11 +126,11 @@ Temporary Items dist data -scripts/ +/scripts/ **/lib packages/*/lib skandha -db +/db/ # foundry files packages/contracts/cache/ diff --git a/event.json b/event.json new file mode 100644 index 00000000..7054e433 --- /dev/null +++ b/event.json @@ -0,0 +1,4 @@ +{ + "act": true, + "ref": "refs/tags/1.5.6" +} diff --git a/package.json b/package.json index 37e3141e..4558ea52 100644 --- a/package.json +++ b/package.json @@ -8,16 +8,19 @@ "scripts": { "clean": "rm -rf ./packages/*/lib ./packages/*/*.tsbuildinfo", "bootstrap": "lerna bootstrap & lerna link", - "prebuild": "yarn workspace types run build", - "build": "yarn workspace types run build && yarn workspace db run build & lerna run build", + "prebuild": "yarn workspace @skandha/types run build", + "build-db": "yarn workspace @skandha/db run build", + "build": "yarn prebuild && yarn build-db & lerna run build", "lint": "eslint --color --ext .ts packages/*/src/", "fix-lint": "eslint --ext .ts --fix packages/*/src/", "test": "lerna run test --concurrency 1", "test:unit": "lerna run test:unit --no-bail --concurrency 1", "coverage": "vitest run --coverage", + "check-build": "lerna run check-build", "check-readme": "lerna run check-readme", "release:publish": "lerna publish from-package --yes --no-verify-access", - "release:docker": "exit 0" + "release:docker": "exit 0", + "act": "act -W .github/workflows/release.yml -e event.json -b" }, "dependencies": { "abstract-leveldown": "7.2.0", diff --git a/packages/api/package.json b/packages/api/package.json index a476e177..2f37f006 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,5 +1,5 @@ { - "name": "api", + "name": "@skandha/api", "version": "1.5.6", "description": "The API module of Etherspot bundler client", "author": "Etherspot", @@ -28,19 +28,19 @@ "check-readme": "typescript-docs-verifier" }, "dependencies": { + "@skandha/executor": "^1.5.6", + "@skandha/monitoring": "^1.5.6", + "@skandha/types": "^1.5.6", + "@skandha/utils": "^1.5.6", "@fastify/cors": "9.0.1", "@fastify/websocket": "10.0.1", "class-transformer": "0.5.1", "class-validator": "0.14.1", "ethers": "5.7.2", - "executor": "^1.5.6", "fastify": "4.25.2", - "monitoring": "^1.5.6", "pino": "8.11.0", "pino-pretty": "10.0.0", "reflect-metadata": "0.1.13", - "types": "^1.5.6", - "utils": "^1.5.6", "ws": "8.16.0" }, "devDependencies": { diff --git a/packages/api/src/app.ts b/packages/api/src/app.ts index 2e27f4c9..576d9bd8 100644 --- a/packages/api/src/app.ts +++ b/packages/api/src/app.ts @@ -1,9 +1,9 @@ import { WebSocket } from "ws"; -import { Executor } from "executor/lib/executor"; -import { Config } from "executor/lib/config"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; -import { deepHexlify } from "utils/lib/hexlify"; +import { Executor } from "@skandha/executor/lib/executor"; +import { Config } from "@skandha/executor/lib/config"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; +import { deepHexlify } from "@skandha/utils/lib/hexlify"; import { BundlerRPCMethods, CustomRPCMethods, diff --git a/packages/api/src/dto/SetReputation.dto.ts b/packages/api/src/dto/SetReputation.dto.ts index 6ea0fbb3..877a8aa1 100644 --- a/packages/api/src/dto/SetReputation.dto.ts +++ b/packages/api/src/dto/SetReputation.dto.ts @@ -6,7 +6,7 @@ import { IsNumber, ValidateNested, } from "class-validator"; -import { ReputationStatus } from "types/lib/executor"; +import { ReputationStatus } from "@skandha/types/lib/executor"; export class SetReputationEntry { @IsEthereumAddress() diff --git a/packages/api/src/modules/debug.ts b/packages/api/src/modules/debug.ts index 23ca6d33..a936a86b 100644 --- a/packages/api/src/modules/debug.ts +++ b/packages/api/src/modules/debug.ts @@ -1,9 +1,9 @@ -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; -import { Debug } from "executor/lib/modules"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; +import { Debug } from "@skandha/executor/lib/modules"; import { IsEthereumAddress } from "class-validator"; -import { BundlingMode } from "types/lib/api/interfaces"; -import { GetStakeStatus } from "executor/lib/interfaces"; -import { MempoolEntrySerialized } from "executor/lib/entities/interfaces"; +import { BundlingMode } from "@skandha/types/lib/api/interfaces"; +import { GetStakeStatus } from "@skandha/executor/lib/interfaces"; +import { MempoolEntrySerialized } from "@skandha/executor/lib/entities/interfaces"; import { RpcMethodValidator } from "../utils/RpcMethodValidator"; import { SetReputationArgs, diff --git a/packages/api/src/modules/eth.ts b/packages/api/src/modules/eth.ts index c896f990..af5d7df6 100644 --- a/packages/api/src/modules/eth.ts +++ b/packages/api/src/modules/eth.ts @@ -1,9 +1,9 @@ -import { Eth } from "executor/lib/modules/eth"; +import { Eth } from "@skandha/executor/lib/modules/eth"; import { EstimatedUserOperationGas, UserOperationByHashResponse, UserOperationReceipt, -} from "types/lib/api/interfaces"; +} from "@skandha/types/lib/api/interfaces"; import { RpcMethodValidator } from "../utils/RpcMethodValidator"; import { SendUserOperationGasArgs } from "../dto/SendUserOperation.dto"; import { EstimateUserOperationGasArgs } from "../dto/EstimateUserOperation.dto"; diff --git a/packages/api/src/modules/redirect.ts b/packages/api/src/modules/redirect.ts index fe687dff..e983661d 100644 --- a/packages/api/src/modules/redirect.ts +++ b/packages/api/src/modules/redirect.ts @@ -1,5 +1,5 @@ import { providers } from "ethers"; -import { Config } from "executor/lib/config"; +import { Config } from "@skandha/executor/lib/config"; export class RedirectAPI { private provider: providers.JsonRpcProvider; diff --git a/packages/api/src/modules/skandha.ts b/packages/api/src/modules/skandha.ts index 5ceeb25c..5b07f773 100644 --- a/packages/api/src/modules/skandha.ts +++ b/packages/api/src/modules/skandha.ts @@ -1,13 +1,13 @@ -import { Eth } from "executor/lib/modules/eth"; +import { Eth } from "@skandha/executor/lib/modules/eth"; import { GetConfigResponse, GetFeeHistoryResponse, GetGasPriceResponse, UserOperationStatus, -} from "types/lib/api/interfaces"; -import { Skandha } from "executor/lib/modules"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; +} from "@skandha/types/lib/api/interfaces"; +import { Skandha } from "@skandha/executor/lib/modules"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; import { RpcMethodValidator } from "../utils/RpcMethodValidator"; import { FeeHistoryArgs } from "../dto/FeeHistory.dto"; diff --git a/packages/api/src/modules/subscription.ts b/packages/api/src/modules/subscription.ts index 4d21860e..7f8f09f8 100644 --- a/packages/api/src/modules/subscription.ts +++ b/packages/api/src/modules/subscription.ts @@ -1,7 +1,7 @@ import { WebSocket } from "ws"; -import { SubscriptionService, ExecutorEvent } from "executor/lib/services"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; +import { SubscriptionService, ExecutorEvent } from "@skandha/executor/lib/services"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; export class SubscriptionApi { constructor(private subscriptionService: SubscriptionService) {} diff --git a/packages/api/src/modules/web3.ts b/packages/api/src/modules/web3.ts index 16b0a433..14854511 100644 --- a/packages/api/src/modules/web3.ts +++ b/packages/api/src/modules/web3.ts @@ -1,4 +1,4 @@ -import { Web3 } from "executor/lib/modules"; +import { Web3 } from "@skandha/executor/lib/modules"; export class Web3API { constructor(private web3Module: Web3) {} diff --git a/packages/api/src/server.ts b/packages/api/src/server.ts index 4b10356e..7fb26b8f 100644 --- a/packages/api/src/server.ts +++ b/packages/api/src/server.ts @@ -6,8 +6,8 @@ import fastify, { } from "fastify"; import cors from "@fastify/cors"; import websocket from "@fastify/websocket"; -import RpcError from "types/lib/api/errors/rpc-error"; -import { ServerConfig } from "types/lib/api/interfaces"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import { ServerConfig } from "@skandha/types/lib/api/interfaces"; import logger from "./logger"; import { HttpStatus } from "./constants"; import { JsonRpcRequest } from "./interface"; diff --git a/packages/api/src/utils/RpcMethodValidator.ts b/packages/api/src/utils/RpcMethodValidator.ts index 8e6592ed..af70f7cc 100644 --- a/packages/api/src/utils/RpcMethodValidator.ts +++ b/packages/api/src/utils/RpcMethodValidator.ts @@ -2,8 +2,8 @@ import "reflect-metadata"; import { validate } from "class-validator"; import { plainToInstance } from "class-transformer"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; import logger from "../logger"; export function validationFactory( diff --git a/packages/cli/.git-data.json b/packages/cli/.git-data.json deleted file mode 100644 index acfe00bd..00000000 --- a/packages/cli/.git-data.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "branch": "websocket", - "commit": "c282c10746adb418c4006d5179b019619f32d2fa" -} \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json index 7af08d9c..35f53807 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,5 +1,5 @@ { - "name": "cli", + "name": "@skandha/cli", "version": "1.5.6", "description": "> TODO: description", "author": "zincoshine ", @@ -36,15 +36,15 @@ "@libp2p/peer-id-factory": "2.0.1", "@libp2p/prometheus-metrics": "1.1.3", "@multiformats/multiaddr": "12.1.3", - "api": "^1.5.6", - "db": "^1.5.6", - "executor": "^1.5.6", + "@skandha/api": "^1.5.6", + "@skandha/db": "^1.5.6", + "@skandha/executor": "^1.5.6", + "@skandha/monitoring": "^1.5.6", + "@skandha/node": "^1.5.6", + "@skandha/types": "^1.5.6", "find-up": "5.0.0", "got": "12.5.3", "js-yaml": "4.1.0", - "monitoring": "^1.5.6", - "node": "^1.5.6", - "types": "^1.5.6", "yargs": "17.6.2" }, "devDependencies": { diff --git a/packages/cli/src/cmds/node/handler.ts b/packages/cli/src/cmds/node/handler.ts index 801d64f3..b4ef5290 100644 --- a/packages/cli/src/cmds/node/handler.ts +++ b/packages/cli/src/cmds/node/handler.ts @@ -1,12 +1,24 @@ import { resolve } from "node:path"; -import { Config } from "executor/lib/config"; -import { Namespace, getNamespaceByValue, RocksDbController } from "db/lib"; -import { NetworkConfig } from "executor/lib/interfaces"; -import { BundlerNode, IBundlerNodeOptions, defaultOptions } from "node/lib"; -import { initNetworkOptions } from "node/lib"; -import logger from "api/lib/logger"; -import { ExecutorOptions, ApiOptions, P2POptions } from "types/lib/options"; -import { MetricsOptions } from "types/lib/options/metrics"; +import { Config } from "@skandha/executor/lib/config"; +import { + Namespace, + getNamespaceByValue, + RocksDbController, +} from "@skandha/db/lib"; +import { NetworkConfig } from "@skandha/executor/lib/interfaces"; +import { + BundlerNode, + IBundlerNodeOptions, + defaultOptions, +} from "@skandha/node/lib"; +import { initNetworkOptions } from "@skandha/node/lib"; +import logger from "@skandha/api/lib/logger"; +import { + ExecutorOptions, + ApiOptions, + P2POptions, +} from "@skandha/types/lib/options"; +import { MetricsOptions } from "@skandha/types/lib/options/metrics"; import { IGlobalArgs } from "../../options"; import { mkdir, readFile } from "../../util"; import { getVersionData } from "../../util/version"; diff --git a/packages/cli/src/cmds/node/initPeerIdAndEnr.ts b/packages/cli/src/cmds/node/initPeerIdAndEnr.ts index d1abea38..f7af7996 100644 --- a/packages/cli/src/cmds/node/initPeerIdAndEnr.ts +++ b/packages/cli/src/cmds/node/initPeerIdAndEnr.ts @@ -3,8 +3,8 @@ import path from "node:path"; import { SignableENR, createKeypairFromPeerId } from "@chainsafe/discv5"; import { createSecp256k1PeerId } from "@libp2p/peer-id-factory"; import { PeerId } from "@libp2p/interface-peer-id"; -import { defaultP2POptions } from "types/lib/options"; -import { Logger } from "api/lib/logger"; +import { defaultP2POptions } from "@skandha/types/lib/options"; +import { Logger } from "@skandha/api/lib/logger"; import { fromString as uint8ArrayFromString } from "uint8arrays/from-string"; import { toString as uint8ArrayToString } from "uint8arrays/to-string"; import { peerIdFromBytes } from "@libp2p/peer-id"; diff --git a/packages/cli/src/cmds/standalone/handler.ts b/packages/cli/src/cmds/standalone/handler.ts index a807a053..e71afc79 100644 --- a/packages/cli/src/cmds/standalone/handler.ts +++ b/packages/cli/src/cmds/standalone/handler.ts @@ -1,17 +1,17 @@ -import { Server } from "api/lib/server"; -import { ApiApp } from "api/lib/app"; -import { Config } from "executor/lib/config"; +import { Server } from "@skandha/api/lib/server"; +import { ApiApp } from "@skandha/api/lib/app"; +import { Config } from "@skandha/executor/lib/config"; import { Namespace, getNamespaceByValue, RocksDbController, LocalDbController, -} from "db/lib"; -import { NetworkConfig } from "executor/lib/interfaces"; -import { IDbController } from "types/lib"; -import { Executor } from "executor/lib/executor"; -import logger from "api/lib/logger"; -import { createMetrics, getHttpMetricsServer } from "monitoring/lib"; +} from "@skandha/db/lib"; +import { NetworkConfig } from "@skandha/executor/lib/interfaces"; +import { IDbController } from "@skandha/types/lib"; +import { Executor } from "@skandha/executor/lib/executor"; +import logger from "@skandha/api/lib/logger"; +import { createMetrics, getHttpMetricsServer } from "@skandha/monitoring/lib"; import { mkdir, readFile } from "../../util"; import { IStandaloneGlobalArgs } from "../../options"; import { getVersionData } from "../../util/version"; diff --git a/packages/cli/src/options/bundlerOptions/api.ts b/packages/cli/src/options/bundlerOptions/api.ts index 7db47bee..0ad5a759 100644 --- a/packages/cli/src/options/bundlerOptions/api.ts +++ b/packages/cli/src/options/bundlerOptions/api.ts @@ -1,4 +1,4 @@ -import { defaultApiOptions } from "types/lib/options/api"; +import { defaultApiOptions } from "@skandha/types/lib/options/api"; import { ICliCommandOptions } from "../../util"; import { IBundlerOptions } from "./options"; diff --git a/packages/cli/src/options/bundlerOptions/executor.ts b/packages/cli/src/options/bundlerOptions/executor.ts index 2de845c4..8bf5224a 100644 --- a/packages/cli/src/options/bundlerOptions/executor.ts +++ b/packages/cli/src/options/bundlerOptions/executor.ts @@ -1,4 +1,4 @@ -import { defaultExecutorOptions } from "types/lib/options/executor"; +import { defaultExecutorOptions } from "@skandha/types/lib/options/executor"; import { ICliCommandOptions } from "../../util"; import { IBundlerOptions } from "./options"; diff --git a/packages/cli/src/options/bundlerOptions/metrics.ts b/packages/cli/src/options/bundlerOptions/metrics.ts index 3c11a1fd..2a2284ab 100644 --- a/packages/cli/src/options/bundlerOptions/metrics.ts +++ b/packages/cli/src/options/bundlerOptions/metrics.ts @@ -1,4 +1,4 @@ -import { defaultMetricsOptions } from "types/lib/options/metrics"; +import { defaultMetricsOptions } from "@skandha/types/lib/options/metrics"; import { ICliCommandOptions } from "../../util"; import { IBundlerOptions } from "./options"; diff --git a/packages/cli/src/options/bundlerOptions/network.ts b/packages/cli/src/options/bundlerOptions/network.ts index 86171adc..bc8e4fd8 100644 --- a/packages/cli/src/options/bundlerOptions/network.ts +++ b/packages/cli/src/options/bundlerOptions/network.ts @@ -1,4 +1,4 @@ -import { defaultP2POptions } from "types/lib/options"; +import { defaultP2POptions } from "@skandha/types/lib/options"; import { ICliCommandOptions } from "../../util"; import { IBundlerOptions } from "./options"; diff --git a/packages/cli/src/options/bundlerOptions/options.ts b/packages/cli/src/options/bundlerOptions/options.ts index bd3f0cc7..7c65fd43 100644 --- a/packages/cli/src/options/bundlerOptions/options.ts +++ b/packages/cli/src/options/bundlerOptions/options.ts @@ -1,7 +1,7 @@ -import { ApiOptions } from "types/lib/options/api"; -import { ExecutorOptions } from "types/lib/options/executor"; -import { MetricsOptions } from "types/lib/options/metrics"; -import { P2POptions } from "types/lib/options/network"; +import { ApiOptions } from "@skandha/types/lib/options/api"; +import { ExecutorOptions } from "@skandha/types/lib/options/executor"; +import { MetricsOptions } from "@skandha/types/lib/options/metrics"; +import { P2POptions } from "@skandha/types/lib/options/network"; export interface IBundlerOptions { api: ApiOptions; diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 11a136c2..5d7cafe3 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,5 +1,5 @@ { - "name": "contracts", + "name": "@skandha/contracts", "version": "1.5.6", "description": "Smart contracts of Etherspot bundler client", "author": "Etherspot", diff --git a/packages/db/package.json b/packages/db/package.json index e6e6c48d..6228b199 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,5 +1,5 @@ { - "name": "db", + "name": "@skandha/db", "version": "1.5.6", "description": "The DB module of Etherspot bundler client", "author": "Etherspot", @@ -30,7 +30,7 @@ "dependencies": { "@chainsafe/ssz": "0.10.1", "@farcaster/rocksdb": "5.5.0", - "types": "^1.5.6" + "@skandha/types": "^1.5.6" }, "devDependencies": { "@types/rocksdb": "3.0.1", diff --git a/packages/db/src/localDb.ts b/packages/db/src/localDb.ts index 42742373..4b17df65 100644 --- a/packages/db/src/localDb.ts +++ b/packages/db/src/localDb.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { IDbController } from "types/lib"; +import { IDbController } from "@skandha/types/lib"; enum Status { started = "started", diff --git a/packages/db/src/rocksDb.ts b/packages/db/src/rocksDb.ts index c1161732..37ec169a 100644 --- a/packages/db/src/rocksDb.ts +++ b/packages/db/src/rocksDb.ts @@ -1,7 +1,7 @@ import path from "node:path"; import rocks from "@farcaster/rocksdb"; // eslint-disable-next-line import/no-extraneous-dependencies -import { IDbController } from "types/lib"; +import { IDbController } from "@skandha/types/lib"; enum Status { started = "started", diff --git a/packages/executor/package.json b/packages/executor/package.json index 18dff15d..2394cce6 100644 --- a/packages/executor/package.json +++ b/packages/executor/package.json @@ -1,5 +1,5 @@ { - "name": "executor", + "name": "@skandha/executor", "version": "1.5.6", "description": "The Relayer module of Etherspot bundler client", "author": "Etherspot", @@ -30,14 +30,14 @@ "check-readme": "typescript-docs-verifier" }, "dependencies": { + "@skandha/monitoring": "^1.5.6", + "@skandha/params": "^1.5.6", + "@skandha/types": "^1.5.6", + "@skandha/utils": "^1.5.6", "@flashbots/ethers-provider-bundle": "0.6.2", "async-mutex": "0.4.0", "ethers": "5.7.2", - "monitoring": "^1.5.6", - "params": "^1.5.6", "strict-event-emitter-types": "2.0.0", - "types": "^1.5.6", - "utils": "^1.5.6", "ws": "8.16.0" }, "devDependencies": { diff --git a/packages/executor/src/config.ts b/packages/executor/src/config.ts index 0b6ebaa5..acfe2a79 100644 --- a/packages/executor/src/config.ts +++ b/packages/executor/src/config.ts @@ -1,6 +1,6 @@ // TODO: create a new package "config" instead of this file and refactor import { BigNumber, Wallet, providers, utils } from "ethers"; -import { IEntity, RelayingMode } from "types/lib/executor"; +import { IEntity, RelayingMode } from "@skandha/types/lib/executor"; import { getAddress } from "ethers/lib/utils"; import { BundlerConfig, ConfigOptions, NetworkConfig } from "./interfaces"; diff --git a/packages/executor/src/entities/MempoolEntry.ts b/packages/executor/src/entities/MempoolEntry.ts index a5b56d87..15c805d9 100644 --- a/packages/executor/src/entities/MempoolEntry.ts +++ b/packages/executor/src/entities/MempoolEntry.ts @@ -1,9 +1,9 @@ import { BigNumber, BigNumberish, ethers } from "ethers"; import { getAddress, hexValue } from "ethers/lib/utils"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; -import RpcError from "types/lib/api/errors/rpc-error"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; -import { MempoolEntryStatus } from "types/lib/executor"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; +import { MempoolEntryStatus } from "@skandha/types/lib/executor"; import { now } from "../utils"; import { IMempoolEntry, MempoolEntrySerialized } from "./interfaces"; diff --git a/packages/executor/src/entities/ReputationEntry.ts b/packages/executor/src/entities/ReputationEntry.ts index 6ec7a12e..f5010af1 100644 --- a/packages/executor/src/entities/ReputationEntry.ts +++ b/packages/executor/src/entities/ReputationEntry.ts @@ -1,4 +1,4 @@ -import { ReputationStatus } from "types/lib/executor"; +import { ReputationStatus } from "@skandha/types/lib/executor"; import { now } from "../utils"; import { IReputationEntry, ReputationEntrySerialized } from "./interfaces"; diff --git a/packages/executor/src/entities/interfaces.ts b/packages/executor/src/entities/interfaces.ts index 12fcd53b..227854a5 100644 --- a/packages/executor/src/entities/interfaces.ts +++ b/packages/executor/src/entities/interfaces.ts @@ -1,6 +1,6 @@ import { BigNumberish, BytesLike } from "ethers"; -import { MempoolEntryStatus, ReputationStatus } from "types/lib/executor"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { MempoolEntryStatus, ReputationStatus } from "@skandha/types/lib/executor"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; export interface IMempoolEntry { chainId: number; diff --git a/packages/executor/src/executor.ts b/packages/executor/src/executor.ts index d3b41635..da8a7bd3 100644 --- a/packages/executor/src/executor.ts +++ b/packages/executor/src/executor.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/explicit-member-accessibility */ import { BigNumber, providers } from "ethers"; -import { IDbController, Logger } from "types/lib"; -import { chainsWithoutEIP1559 } from "params/lib"; -import { PerChainMetrics } from "monitoring/lib"; -import { SkandhaVersion } from "types/lib/executor"; +import { IDbController, Logger } from "@skandha/types/lib"; +import { chainsWithoutEIP1559 } from "@skandha/params/lib"; +import { PerChainMetrics } from "@skandha/monitoring/lib"; +import { SkandhaVersion } from "@skandha/types/lib/executor"; import { Web3, Debug, Eth, Skandha } from "./modules"; import { MempoolService, diff --git a/packages/executor/src/interfaces.ts b/packages/executor/src/interfaces.ts index 11045d6e..88f945fb 100644 --- a/packages/executor/src/interfaces.ts +++ b/packages/executor/src/interfaces.ts @@ -1,6 +1,6 @@ import { BigNumber, BigNumberish, BytesLike } from "ethers"; -import { IWhitelistedEntities, RelayingMode } from "types/lib/executor"; -import { INodeAPI } from "types/lib/node"; +import { IWhitelistedEntities, RelayingMode } from "@skandha/types/lib/executor"; +import { INodeAPI } from "@skandha/types/lib/node"; import { MempoolEntry } from "./entities/MempoolEntry"; export interface Log { diff --git a/packages/executor/src/modules/debug.ts b/packages/executor/src/modules/debug.ts index 7b51f36d..dfa9edc0 100644 --- a/packages/executor/src/modules/debug.ts +++ b/packages/executor/src/modules/debug.ts @@ -1,12 +1,12 @@ import { BigNumber, providers } from "ethers"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { IEntryPoint__factory, StakeManager__factory, -} from "types/lib/executor/contracts"; -import { MempoolEntryStatus } from "types/lib/executor"; +} from "@skandha/types/lib/executor/contracts"; +import { MempoolEntryStatus } from "@skandha/types/lib/executor"; import { BundlingService, MempoolService, diff --git a/packages/executor/src/modules/eth.ts b/packages/executor/src/modules/eth.ts index 3338d5cd..333551a0 100644 --- a/packages/executor/src/modules/eth.ts +++ b/packages/executor/src/modules/eth.ts @@ -1,30 +1,30 @@ import { BigNumber, BigNumberish, ethers } from "ethers"; import { arrayify, hexlify } from "ethers/lib/utils"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; import { IEntryPoint, UserOperationEventEvent, UserOperationStruct, -} from "types/lib/executor/contracts/EntryPoint"; +} from "@skandha/types/lib/executor/contracts/EntryPoint"; import { EstimatedUserOperationGas, UserOperationByHashResponse, UserOperationReceipt, -} from "types/lib/api/interfaces"; -import { MempoolEntryStatus } from "types/lib/executor"; -import { IEntryPoint__factory } from "types/lib/executor/contracts/factories"; -import { IPVGEstimator } from "params/lib/types/IPVGEstimator"; +} from "@skandha/types/lib/api/interfaces"; +import { MempoolEntryStatus } from "@skandha/types/lib/executor"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts/factories"; +import { IPVGEstimator } from "@skandha/params/lib/types/IPVGEstimator"; import { estimateOptimismPVG, estimateArbitrumPVG, ECDSA_DUMMY_SIGNATURE, estimateMantlePVG, estimateAncient8PVG, -} from "params/lib"; -import { Logger } from "types/lib"; -import { PerChainMetrics } from "monitoring/lib"; -import { deepHexlify } from "utils/lib/hexlify"; +} from "@skandha/params/lib"; +import { Logger } from "@skandha/types/lib"; +import { PerChainMetrics } from "@skandha/monitoring/lib"; +import { deepHexlify } from "@skandha/utils/lib/hexlify"; import { packUserOp } from "../utils"; import { UserOpValidationService, MempoolService } from "../services"; import { GetNodeAPI, Log, NetworkConfig } from "../interfaces"; diff --git a/packages/executor/src/modules/interfaces.ts b/packages/executor/src/modules/interfaces.ts index de75b50b..f53e1a25 100644 --- a/packages/executor/src/modules/interfaces.ts +++ b/packages/executor/src/modules/interfaces.ts @@ -1,5 +1,5 @@ import { BigNumberish, BytesLike } from "ethers"; -import { ReputationStatus } from "types/lib/executor"; +import { ReputationStatus } from "@skandha/types/lib/executor"; export class EstimateUserOperationStruct { sender!: string; diff --git a/packages/executor/src/modules/skandha.ts b/packages/executor/src/modules/skandha.ts index 7c6480ee..1e69c655 100644 --- a/packages/executor/src/modules/skandha.ts +++ b/packages/executor/src/modules/skandha.ts @@ -1,18 +1,18 @@ import { BigNumber, BigNumberish, ethers } from "ethers"; -import { Logger } from "types/lib"; +import { Logger } from "@skandha/types/lib"; import { GetConfigResponse, GetFeeHistoryResponse, GetGasPriceResponse, UserOperationStatus, -} from "types/lib/api/interfaces"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; -import { GasPriceMarkupOne } from "params/lib"; -import { getGasFee } from "params/lib"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; -import { MempoolEntryStatus } from "types/lib/executor"; +} from "@skandha/types/lib/api/interfaces"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; +import { GasPriceMarkupOne } from "@skandha/params/lib"; +import { getGasFee } from "@skandha/params/lib"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; +import { MempoolEntryStatus } from "@skandha/types/lib/executor"; import { GetNodeAPI, NetworkConfig } from "../interfaces"; import { Config } from "../config"; import { MempoolService } from "../services"; diff --git a/packages/executor/src/modules/web3.ts b/packages/executor/src/modules/web3.ts index 5709d800..65698eac 100644 --- a/packages/executor/src/modules/web3.ts +++ b/packages/executor/src/modules/web3.ts @@ -1,4 +1,4 @@ -import { SkandhaVersion } from "types/lib/executor"; +import { SkandhaVersion } from "@skandha/types/lib/executor"; import { Config } from "../config"; export class Web3 { diff --git a/packages/executor/src/services/BundlingService/relayers/base.ts b/packages/executor/src/services/BundlingService/relayers/base.ts index 76bec3b1..d2f6ff41 100644 --- a/packages/executor/src/services/BundlingService/relayers/base.ts +++ b/packages/executor/src/services/BundlingService/relayers/base.ts @@ -1,8 +1,8 @@ import { Mutex } from "async-mutex"; import { constants, providers, utils } from "ethers"; -import { Logger } from "types/lib"; -import { PerChainMetrics } from "monitoring/lib"; -import { MempoolEntryStatus } from "types/lib/executor"; +import { Logger } from "@skandha/types/lib"; +import { PerChainMetrics } from "@skandha/monitoring/lib"; +import { MempoolEntryStatus } from "@skandha/types/lib/executor"; import { Config } from "../../../config"; import { Bundle, NetworkConfig } from "../../../interfaces"; import { IRelayingMode, Relayer } from "../interfaces"; diff --git a/packages/executor/src/services/BundlingService/relayers/classic.ts b/packages/executor/src/services/BundlingService/relayers/classic.ts index 57f75ee8..cc83c737 100644 --- a/packages/executor/src/services/BundlingService/relayers/classic.ts +++ b/packages/executor/src/services/BundlingService/relayers/classic.ts @@ -1,6 +1,6 @@ import { providers } from "ethers"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; -import { chainsWithoutEIP1559 } from "params/lib"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; +import { chainsWithoutEIP1559 } from "@skandha/params/lib"; import { AccessList } from "ethers/lib/utils"; import { Relayer } from "../interfaces"; import { Bundle, StorageMap } from "../../../interfaces"; diff --git a/packages/executor/src/services/BundlingService/relayers/echo.ts b/packages/executor/src/services/BundlingService/relayers/echo.ts index 4f8c1215..161e6f71 100644 --- a/packages/executor/src/services/BundlingService/relayers/echo.ts +++ b/packages/executor/src/services/BundlingService/relayers/echo.ts @@ -1,7 +1,7 @@ import { providers } from "ethers"; -import { PerChainMetrics } from "monitoring/lib"; -import { Logger } from "types/lib"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { PerChainMetrics } from "@skandha/monitoring/lib"; +import { Logger } from "@skandha/types/lib"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import { Config } from "../../../config"; import { Bundle, NetworkConfig } from "../../../interfaces"; import { MempoolService } from "../../MempoolService"; diff --git a/packages/executor/src/services/BundlingService/relayers/fastlane.ts b/packages/executor/src/services/BundlingService/relayers/fastlane.ts index a2f225f1..417e44ca 100644 --- a/packages/executor/src/services/BundlingService/relayers/fastlane.ts +++ b/packages/executor/src/services/BundlingService/relayers/fastlane.ts @@ -1,8 +1,8 @@ import { providers } from "ethers"; -import { Logger } from "types/lib"; -import { PerChainMetrics } from "monitoring/lib"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; -import { chainsWithoutEIP1559 } from "params/lib"; +import { Logger } from "@skandha/types/lib"; +import { PerChainMetrics } from "@skandha/monitoring/lib"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; +import { chainsWithoutEIP1559 } from "@skandha/params/lib"; import { AccessList } from "ethers/lib/utils"; import { Relayer } from "../interfaces"; import { Config } from "../../../config"; diff --git a/packages/executor/src/services/BundlingService/relayers/flashbots.ts b/packages/executor/src/services/BundlingService/relayers/flashbots.ts index 7721e9f2..0afa36aa 100644 --- a/packages/executor/src/services/BundlingService/relayers/flashbots.ts +++ b/packages/executor/src/services/BundlingService/relayers/flashbots.ts @@ -1,7 +1,7 @@ import { providers } from "ethers"; -import { PerChainMetrics } from "monitoring/lib"; -import { Logger } from "types/lib"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { PerChainMetrics } from "@skandha/monitoring/lib"; +import { Logger } from "@skandha/types/lib"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import { FlashbotsBundleProvider, FlashbotsBundleResolution, diff --git a/packages/executor/src/services/BundlingService/relayers/kolibri.ts b/packages/executor/src/services/BundlingService/relayers/kolibri.ts index 0adb8709..fdde1a16 100644 --- a/packages/executor/src/services/BundlingService/relayers/kolibri.ts +++ b/packages/executor/src/services/BundlingService/relayers/kolibri.ts @@ -1,7 +1,7 @@ import { providers } from "ethers"; -import { PerChainMetrics } from "monitoring/lib"; -import { Logger } from "types/lib"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { PerChainMetrics } from "@skandha/monitoring/lib"; +import { Logger } from "@skandha/types/lib"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import { fetchJson } from "ethers/lib/utils"; import { Config } from "../../../config"; import { Bundle, NetworkConfig } from "../../../interfaces"; diff --git a/packages/executor/src/services/BundlingService/relayers/merkle.ts b/packages/executor/src/services/BundlingService/relayers/merkle.ts index c796b616..d024f373 100644 --- a/packages/executor/src/services/BundlingService/relayers/merkle.ts +++ b/packages/executor/src/services/BundlingService/relayers/merkle.ts @@ -1,8 +1,8 @@ import path from "node:path"; import { providers } from "ethers"; -import { PerChainMetrics } from "monitoring/lib"; -import { Logger } from "types/lib"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { PerChainMetrics } from "@skandha/monitoring/lib"; +import { Logger } from "@skandha/types/lib"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import { AccessList, fetchJson } from "ethers/lib/utils"; import { Config } from "../../../config"; import { Bundle, NetworkConfig } from "../../../interfaces"; diff --git a/packages/executor/src/services/BundlingService/service.ts b/packages/executor/src/services/BundlingService/service.ts index 8d454ecc..4285bff1 100644 --- a/packages/executor/src/services/BundlingService/service.ts +++ b/packages/executor/src/services/BundlingService/service.ts @@ -1,15 +1,15 @@ import { BigNumber, providers } from "ethers"; -import { PerChainMetrics } from "monitoring/lib"; -import { Logger } from "types/lib"; -import { BundlingMode } from "types/lib/api/interfaces"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { PerChainMetrics } from "@skandha/monitoring/lib"; +import { Logger } from "@skandha/types/lib"; +import { BundlingMode } from "@skandha/types/lib/api/interfaces"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import { MempoolEntryStatus, RelayingMode, ReputationStatus, -} from "types/lib/executor"; -import { GasPriceMarkupOne, chainsWithoutEIP1559, getGasFee } from "params/lib"; -import { IGetGasFeeResult } from "params/lib/gas-price-oracles/oracles"; +} from "@skandha/types/lib/executor"; +import { GasPriceMarkupOne, chainsWithoutEIP1559, getGasFee } from "@skandha/params/lib"; +import { IGetGasFeeResult } from "@skandha/params/lib/gas-price-oracles/oracles"; import { Mutex } from "async-mutex"; import { Config } from "../../config"; import { diff --git a/packages/executor/src/services/BundlingService/utils/estimateBundleGasLimit.ts b/packages/executor/src/services/BundlingService/utils/estimateBundleGasLimit.ts index 14b87a7a..738d2d82 100644 --- a/packages/executor/src/services/BundlingService/utils/estimateBundleGasLimit.ts +++ b/packages/executor/src/services/BundlingService/utils/estimateBundleGasLimit.ts @@ -1,5 +1,5 @@ import { BigNumber } from "ethers"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { MempoolEntry } from "../../../entities/MempoolEntry"; export function estimateBundleGasLimit( diff --git a/packages/executor/src/services/BundlingService/utils/getUserOpHashes.ts b/packages/executor/src/services/BundlingService/utils/getUserOpHashes.ts index dceaf043..d48ce0f2 100644 --- a/packages/executor/src/services/BundlingService/utils/getUserOpHashes.ts +++ b/packages/executor/src/services/BundlingService/utils/getUserOpHashes.ts @@ -1,6 +1,6 @@ -import { IEntryPoint } from "types/lib/executor/contracts"; +import { IEntryPoint } from "@skandha/types/lib/executor/contracts"; import { providers } from "ethers"; -import { IMulticall3__factory } from "types/lib/executor/contracts/factories/IMulticall3__factory"; +import { IMulticall3__factory } from "@skandha/types/lib/executor/contracts/factories/IMulticall3__factory"; import { MempoolEntry } from "../../../entities/MempoolEntry"; /** diff --git a/packages/executor/src/services/EventsService.ts b/packages/executor/src/services/EventsService.ts index 8b25c2b2..12d91b58 100644 --- a/packages/executor/src/services/EventsService.ts +++ b/packages/executor/src/services/EventsService.ts @@ -1,14 +1,14 @@ import { providers } from "ethers"; -import { IDbController, Logger } from "types/lib"; -import { IEntryPoint } from "types/lib/executor/contracts"; -import { IEntryPoint__factory } from "types/lib/executor/contracts/factories"; +import { IDbController, Logger } from "@skandha/types/lib"; +import { IEntryPoint } from "@skandha/types/lib/executor/contracts"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts/factories"; import { AccountDeployedEvent, SignatureAggregatorChangedEvent, UserOperationEventEvent, -} from "types/lib/executor/contracts/EntryPoint"; -import { TypedEvent, TypedListener } from "types/lib/executor/contracts/common"; -import { MempoolEntryStatus } from "types/lib/executor"; +} from "@skandha/types/lib/executor/contracts/EntryPoint"; +import { TypedEvent, TypedListener } from "@skandha/types/lib/executor/contracts/common"; +import { MempoolEntryStatus } from "@skandha/types/lib/executor"; import { ReputationService } from "./ReputationService"; import { MempoolService } from "./MempoolService"; import { ExecutorEvent, ExecutorEventBus } from "./SubscriptionService"; diff --git a/packages/executor/src/services/MempoolService/reputation.ts b/packages/executor/src/services/MempoolService/reputation.ts index 66a21d8c..0a663b0c 100644 --- a/packages/executor/src/services/MempoolService/reputation.ts +++ b/packages/executor/src/services/MempoolService/reputation.ts @@ -1,12 +1,12 @@ import { utils } from "ethers"; -import RpcError from "types/lib/api/errors/rpc-error"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; import { IEntityWithAggregator, IWhitelistedEntities, ReputationStatus, -} from "types/lib/executor"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +} from "@skandha/types/lib/executor"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { MempoolEntry } from "../../entities/MempoolEntry"; import { KnownEntities, NetworkConfig, StakeInfo } from "../../interfaces"; import { ReputationService } from "../ReputationService"; diff --git a/packages/executor/src/services/MempoolService/service.ts b/packages/executor/src/services/MempoolService/service.ts index 5381705b..007a1f9e 100644 --- a/packages/executor/src/services/MempoolService/service.ts +++ b/packages/executor/src/services/MempoolService/service.ts @@ -1,9 +1,9 @@ import { Mutex } from "async-mutex"; -import { IDbController, Logger } from "types/lib"; -import { MempoolEntryStatus } from "types/lib/executor"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { IDbController, Logger } from "@skandha/types/lib"; +import { MempoolEntryStatus } from "@skandha/types/lib/executor"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { BigNumberish } from "ethers"; import { ReputationService } from "../ReputationService"; import { ExecutorEvent, ExecutorEventBus } from "../SubscriptionService"; diff --git a/packages/executor/src/services/P2PService.ts b/packages/executor/src/services/P2PService.ts index aef4ebc4..88c2ce85 100644 --- a/packages/executor/src/services/P2PService.ts +++ b/packages/executor/src/services/P2PService.ts @@ -1,4 +1,4 @@ -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { MempoolService } from "./MempoolService"; export type PooledUserOpHashesResponse = { diff --git a/packages/executor/src/services/ReputationService.ts b/packages/executor/src/services/ReputationService.ts index 4b339f3f..f8892f53 100644 --- a/packages/executor/src/services/ReputationService.ts +++ b/packages/executor/src/services/ReputationService.ts @@ -1,8 +1,8 @@ import { Mutex } from "async-mutex"; import { BigNumber, utils } from "ethers"; -import { IDbController } from "types/lib"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; -import { ReputationStatus } from "types/lib/executor"; +import { IDbController } from "@skandha/types/lib"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; +import { ReputationStatus } from "@skandha/types/lib/executor"; import { ReputationEntry } from "../entities/ReputationEntry"; import { ReputationEntryDump, diff --git a/packages/executor/src/services/SubscriptionService.ts b/packages/executor/src/services/SubscriptionService.ts index b79805df..46aff79c 100644 --- a/packages/executor/src/services/SubscriptionService.ts +++ b/packages/executor/src/services/SubscriptionService.ts @@ -2,9 +2,9 @@ import EventEmitter from "node:events"; import { WebSocket } from "ws"; import { ethers } from "ethers"; import StrictEventEmitter from "strict-event-emitter-types"; -import { Logger } from "types/lib"; -import { deepHexlify } from "utils/lib/hexlify"; -import { MempoolEntryStatus } from "types/lib/executor"; +import { Logger } from "@skandha/types/lib"; +import { deepHexlify } from "@skandha/utils/lib/hexlify"; +import { MempoolEntryStatus } from "@skandha/types/lib/executor"; import { MempoolEntry } from "../entities/MempoolEntry"; export enum ExecutorEvent { diff --git a/packages/executor/src/services/UserOpValidation/GethTracer.ts b/packages/executor/src/services/UserOpValidation/GethTracer.ts index c0f5c091..73feb2c5 100644 --- a/packages/executor/src/services/UserOpValidation/GethTracer.ts +++ b/packages/executor/src/services/UserOpValidation/GethTracer.ts @@ -1,7 +1,7 @@ import { readFileSync } from "node:fs"; import { resolve } from "node:path"; import { BigNumber, providers } from "ethers"; -import { BundlerCollectorReturn } from "types/lib/executor"; +import { BundlerCollectorReturn } from "@skandha/types/lib/executor"; import { TracerPrestateResponse } from "../../interfaces"; const tracer = readFileSync( diff --git a/packages/executor/src/services/UserOpValidation/service.ts b/packages/executor/src/services/UserOpValidation/service.ts index 5fd86d68..4cba6c34 100644 --- a/packages/executor/src/services/UserOpValidation/service.ts +++ b/packages/executor/src/services/UserOpValidation/service.ts @@ -1,8 +1,8 @@ import { BigNumber, providers } from "ethers"; -import { Logger } from "types/lib"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; +import { Logger } from "@skandha/types/lib"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; import { Config } from "../../config"; import { ExecutionResult, diff --git a/packages/executor/src/services/UserOpValidation/utils.ts b/packages/executor/src/services/UserOpValidation/utils.ts index e7262996..41ef3339 100644 --- a/packages/executor/src/services/UserOpValidation/utils.ts +++ b/packages/executor/src/services/UserOpValidation/utils.ts @@ -1,6 +1,6 @@ import { BigNumber, BytesLike } from "ethers"; -import { AddressZero } from "params/lib"; -import RpcError from "types/lib/api/errors/rpc-error"; +import { AddressZero } from "@skandha/params/lib"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; import { IEntryPoint, IEntryPoint__factory, @@ -9,11 +9,11 @@ import { IAggregator__factory, IPaymaster__factory, SenderCreator__factory, -} from "types/lib/executor/contracts"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; +} from "@skandha/types/lib/executor/contracts"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; import { Interface, hexZeroPad, hexlify, keccak256 } from "ethers/lib/utils"; -import { BundlerCollectorReturn, CallEntry } from "types/lib/executor"; +import { BundlerCollectorReturn, CallEntry } from "@skandha/types/lib/executor"; import { UserOpValidationResult, StakeInfo } from "../../interfaces"; import { getAddr } from "../../utils"; diff --git a/packages/executor/src/services/UserOpValidation/validators/estimation.ts b/packages/executor/src/services/UserOpValidation/validators/estimation.ts index ba4f1119..9c1fe89d 100644 --- a/packages/executor/src/services/UserOpValidation/validators/estimation.ts +++ b/packages/executor/src/services/UserOpValidation/validators/estimation.ts @@ -1,11 +1,11 @@ -import { AddressZero, BytesZero } from "params/lib"; -import RpcError from "types/lib/api/errors/rpc-error"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; -import { BundlerCollectorReturn, ExitInfo } from "types/lib/executor"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; +import { AddressZero, BytesZero } from "@skandha/params/lib"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; +import { BundlerCollectorReturn, ExitInfo } from "@skandha/types/lib/executor"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; import { BigNumber, Contract, providers } from "ethers"; -import { Logger } from "types/lib"; +import { Logger } from "@skandha/types/lib"; import { nonGethErrorHandler } from "../utils"; import { ExecutionResult, NetworkConfig } from "../../../interfaces"; import { GethTracer } from "../GethTracer"; diff --git a/packages/executor/src/services/UserOpValidation/validators/safe.ts b/packages/executor/src/services/UserOpValidation/validators/safe.ts index 335b87e2..7e53fac5 100644 --- a/packages/executor/src/services/UserOpValidation/validators/safe.ts +++ b/packages/executor/src/services/UserOpValidation/validators/safe.ts @@ -1,16 +1,16 @@ -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import { IEntryPoint, UserOperationStruct, -} from "types/lib/executor/contracts/EntryPoint"; +} from "@skandha/types/lib/executor/contracts/EntryPoint"; import { BigNumber, ethers, providers } from "ethers"; -import { BundlerCollectorReturn, ExitInfo } from "types/lib/executor"; -import RpcError from "types/lib/api/errors/rpc-error"; -import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; -import { Logger } from "types/lib"; -import { IWhitelistedEntities } from "types/lib/executor"; -import { AddressZero, BytesZero, EPv6UserOpEventHash } from "params/lib"; -import { GetGasPriceResponse } from "types/lib/api/interfaces"; +import { BundlerCollectorReturn, ExitInfo } from "@skandha/types/lib/executor"; +import RpcError from "@skandha/types/lib/api/errors/rpc-error"; +import * as RpcErrorCodes from "@skandha/types/lib/api/errors/rpc-error-codes"; +import { Logger } from "@skandha/types/lib"; +import { IWhitelistedEntities } from "@skandha/types/lib/executor"; +import { AddressZero, BytesZero, EPv6UserOpEventHash } from "@skandha/params/lib"; +import { GetGasPriceResponse } from "@skandha/types/lib/api/interfaces"; import { NetworkConfig, StorageMap, diff --git a/packages/executor/src/services/UserOpValidation/validators/unsafe.ts b/packages/executor/src/services/UserOpValidation/validators/unsafe.ts index 00eeca78..55cfc294 100644 --- a/packages/executor/src/services/UserOpValidation/validators/unsafe.ts +++ b/packages/executor/src/services/UserOpValidation/validators/unsafe.ts @@ -1,7 +1,7 @@ -import { IEntryPoint__factory } from "types/lib/executor/contracts"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { BigNumber, Contract, providers } from "ethers"; -import { Logger } from "types/lib"; +import { Logger } from "@skandha/types/lib"; import { NetworkConfig, UserOpValidationResult } from "../../../interfaces"; import { nonGethErrorHandler, parseErrorResult } from "../utils"; diff --git a/packages/executor/src/utils/index.ts b/packages/executor/src/utils/index.ts index 4073d6bc..44ee3cf4 100644 --- a/packages/executor/src/utils/index.ts +++ b/packages/executor/src/utils/index.ts @@ -5,8 +5,8 @@ import { hexlify, keccak256, } from "ethers/lib/utils"; -import { IEntryPoint__factory } from "types/lib/executor/contracts/factories"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts/factories"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; const UserOpType = ( IEntryPoint__factory.abi.find( diff --git a/packages/executor/test/fixtures/getClient.ts b/packages/executor/test/fixtures/getClient.ts index 5bea4658..df47170f 100644 --- a/packages/executor/test/fixtures/getClient.ts +++ b/packages/executor/test/fixtures/getClient.ts @@ -1,7 +1,7 @@ import { exec } from "child_process"; import { now, wait } from "../../src/utils"; import { BytesLike, hexConcat, hexZeroPad, hexlify } from "ethers/lib/utils"; -import { IEntryPoint__factory, SimpleAccountFactory__factory } from "types/src/executor/contracts"; +import { IEntryPoint__factory, SimpleAccountFactory__factory } from "@skandha/types/src/executor/contracts"; import { DefaultRpcUrl, EntryPointAddress } from "../constants"; import { Wallet, constants, providers, utils } from "ethers"; import { testAccounts } from "./accounts"; diff --git a/packages/executor/test/fixtures/userOp.ts b/packages/executor/test/fixtures/userOp.ts index 4eaccb20..758cc32c 100644 --- a/packages/executor/test/fixtures/userOp.ts +++ b/packages/executor/test/fixtures/userOp.ts @@ -1,8 +1,8 @@ -import { IEntryPoint__factory, SimpleAccountFactory__factory, SimpleAccount__factory } from "types/src/executor/contracts" +import { IEntryPoint__factory, SimpleAccountFactory__factory, SimpleAccount__factory } from "@skandha/types/src/executor/contracts" import { ChainId, DefaultRpcUrl, EntryPointAddress, SimpleFactoryAddress } from "../constants" import { BigNumber, BigNumberish, Contract, Wallet, ethers, providers, utils } from "ethers"; import { arrayify, defaultAbiCoder, hexConcat, keccak256 } from "ethers/lib/utils"; -import { UserOperationStruct } from "types/src/executor/contracts/EntryPoint"; +import { UserOperationStruct } from "@skandha/types/src/executor/contracts/EntryPoint"; import { applyEstimatedUserOp, randomAddress } from "../utils"; import { packUserOp } from "../../src/utils"; import { Eth } from "../../src/modules"; diff --git a/packages/executor/test/mocks/GethTracer.ts b/packages/executor/test/mocks/GethTracer.ts index b88c5c07..df0a8ff7 100644 --- a/packages/executor/test/mocks/GethTracer.ts +++ b/packages/executor/test/mocks/GethTracer.ts @@ -1,5 +1,5 @@ import { providers } from "ethers"; -import { BundlerCollectorReturn } from "types/lib/executor"; +import { BundlerCollectorReturn } from "@skandha/types/lib/executor"; import { TracerPrestateResponse } from "../../src/interfaces"; export class GethTracer { diff --git a/packages/executor/test/mocks/database.ts b/packages/executor/test/mocks/database.ts index 7c8d208a..205d5d93 100644 --- a/packages/executor/test/mocks/database.ts +++ b/packages/executor/test/mocks/database.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { IDbController } from "types/src"; +import { IDbController } from "@skandha/types/src"; enum Status { started = "started", diff --git a/packages/executor/test/mocks/logger.ts b/packages/executor/test/mocks/logger.ts index 3521a8fd..10dda1e2 100644 --- a/packages/executor/test/mocks/logger.ts +++ b/packages/executor/test/mocks/logger.ts @@ -1,4 +1,4 @@ -import { Logger } from "types/src"; +import { Logger } from "@skandha/types/src"; export const logger: Logger = { fatal: (...args: any[]) => {}, diff --git a/packages/executor/test/unit/modules/eth.test.ts b/packages/executor/test/unit/modules/eth.test.ts index cf2ddc32..8ff25a87 100644 --- a/packages/executor/test/unit/modules/eth.test.ts +++ b/packages/executor/test/unit/modules/eth.test.ts @@ -3,7 +3,7 @@ import { Wallet } from "ethers"; import { createRandomUnsignedUserOp, getClient, getConfigs, getCounterFactualAddress, getModules, testAccounts } from "../../fixtures"; import { setBalance } from "../../utils"; import { EntryPointAddress } from "../../constants"; -import { EstimatedUserOperationGas } from "types/src/api/interfaces"; +import { EstimatedUserOperationGas } from "@skandha/types/src/api/interfaces"; describe("Eth module", async () => { const client = await getClient(); // runs anvil diff --git a/packages/executor/test/unit/services/BundlingService.test.ts b/packages/executor/test/unit/services/BundlingService.test.ts index e872916c..0dd4e515 100644 --- a/packages/executor/test/unit/services/BundlingService.test.ts +++ b/packages/executor/test/unit/services/BundlingService.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi } from "vitest"; -import { MempoolEntryStatus } from "types/src/executor"; -import { UserOperationEventEvent } from "types/src/executor/contracts/EntryPoint"; +import { MempoolEntryStatus } from "@skandha/types/src/executor"; +import { UserOperationEventEvent } from "@skandha/types/src/executor/contracts/EntryPoint"; import { getConfigs, getModules, diff --git a/packages/executor/test/utils/applyEstimatedUserOp.ts b/packages/executor/test/utils/applyEstimatedUserOp.ts index 247a0ae4..4096012c 100644 --- a/packages/executor/test/utils/applyEstimatedUserOp.ts +++ b/packages/executor/test/utils/applyEstimatedUserOp.ts @@ -1,5 +1,5 @@ -import { EstimatedUserOperationGas } from "types/src/api/interfaces"; -import { UserOperationStruct } from "types/src/executor/contracts/EntryPoint"; +import { EstimatedUserOperationGas } from "@skandha/types/src/api/interfaces"; +import { UserOperationStruct } from "@skandha/types/src/executor/contracts/EntryPoint"; export function applyEstimatedUserOp(userOp: UserOperationStruct, estimated: EstimatedUserOperationGas) { userOp.maxFeePerGas = estimated.maxFeePerGas; diff --git a/packages/monitoring/package.json b/packages/monitoring/package.json index d7bf295f..5c442fca 100644 --- a/packages/monitoring/package.json +++ b/packages/monitoring/package.json @@ -1,5 +1,5 @@ { - "name": "monitoring", + "name": "@skandha/monitoring", "version": "1.5.6", "description": "The Monitoring module of Etherspot bundler client", "author": "Etherspot", @@ -29,6 +29,6 @@ }, "dependencies": { "prom-client": "^14.2.0", - "types": "^1.5.6" + "@skandha/types": "^1.5.6" } } diff --git a/packages/monitoring/src/createMetrics.ts b/packages/monitoring/src/createMetrics.ts index 65a26dd9..d94af085 100644 --- a/packages/monitoring/src/createMetrics.ts +++ b/packages/monitoring/src/createMetrics.ts @@ -1,5 +1,5 @@ import { Registry } from "prom-client"; -import { Logger } from "types/lib"; +import { Logger } from "@skandha/types/lib"; import { IChainMetrics, IP2PMetrics, diff --git a/packages/monitoring/src/server/http.ts b/packages/monitoring/src/server/http.ts index 74e23db7..41498dc0 100644 --- a/packages/monitoring/src/server/http.ts +++ b/packages/monitoring/src/server/http.ts @@ -1,7 +1,7 @@ import http from "node:http"; import { AddressInfo } from "node:net"; import { Registry, Histogram } from "prom-client"; -import { Logger } from "types/lib"; +import { Logger } from "@skandha/types/lib"; import { wrapError } from "../utils"; export type HttpMetricsServerOpts = { diff --git a/packages/node/package.json b/packages/node/package.json index 971c5278..ec400782 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,5 +1,5 @@ { - "name": "node", + "name": "@skandha/node", "version": "1.5.6", "description": "The bundler node module of Etherspot bundler client", "author": "Etherspot", @@ -54,24 +54,24 @@ "@multiformats/multiaddr": "11.4.0", "@types/varint": "6.0.1", "abstract-leveldown": "7.2.0", - "api": "^1.5.6", + "@skandha/api": "^1.5.6", + "@skandha/executor": "^1.5.6", + "@skandha/db": "^1.5.6", + "@skandha/monitoring": "^1.5.6", + "@skandha/params": "^1.5.6", + "@skandha/types": "^1.5.6", + "@skandha/utils": "^1.5.6", "datastore-core": "8.0.1", - "db": "^1.5.6", "ethers": "5.7.2", - "executor": "^1.5.6", "it-filter": "1.0.2", "it-map": "1.0.5", "it-sort": "1.0.0", "it-take": "1.0.1", "libp2p": "0.42.2", - "monitoring": "^1.5.6", - "params": "^1.5.6", "snappy": "7.2.2", "snappyjs": "0.7.0", "stream-to-it": "0.2.4", "strict-event-emitter-types": "2.0.0", - "types": "^1.5.6", - "utils": "^1.5.6", "varint": "6.0.0", "xxhash-wasm": "1.0.2" }, diff --git a/packages/node/src/api/index.ts b/packages/node/src/api/index.ts index 1e612bcd..d444f84c 100644 --- a/packages/node/src/api/index.ts +++ b/packages/node/src/api/index.ts @@ -1,4 +1,4 @@ -import { INodeAPI } from "types/lib/node"; +import { INodeAPI } from "@skandha/types/lib/node"; import { NodeAPIModules } from "./types"; import publishVerifiedUserOperation from "./publishVerifiedUserOperation"; import publishVerifiedUserOperationJSON from "./publishVerifiedUserOperationJSON"; diff --git a/packages/node/src/api/publishVerifiedUserOperation.ts b/packages/node/src/api/publishVerifiedUserOperation.ts index 22073f64..c803051c 100644 --- a/packages/node/src/api/publishVerifiedUserOperation.ts +++ b/packages/node/src/api/publishVerifiedUserOperation.ts @@ -1,4 +1,4 @@ -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; import { NodeAPIModules } from "./types"; export default function api(modules: NodeAPIModules) { diff --git a/packages/node/src/api/publishVerifiedUserOperationJSON.ts b/packages/node/src/api/publishVerifiedUserOperationJSON.ts index 36188fee..631d2d0f 100644 --- a/packages/node/src/api/publishVerifiedUserOperationJSON.ts +++ b/packages/node/src/api/publishVerifiedUserOperationJSON.ts @@ -1,5 +1,5 @@ -import { toVerifiedUserOperation } from "params/lib/utils/userOp"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { toVerifiedUserOperation } from "@skandha/params/lib/utils/userOp"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { NodeAPIModules } from "./types"; export default function api(modules: NodeAPIModules) { diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index 2ee4aa50..564b2520 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -1,17 +1,17 @@ import { PeerId } from "@libp2p/interface-peer-id"; -import { Server } from "api/lib/server"; -import { ApiApp } from "api/lib/app"; -import { Config } from "executor/lib/config"; -import { IDbController } from "types/lib"; +import { Server } from "@skandha/api/lib/server"; +import { ApiApp } from "@skandha/api/lib/app"; +import { Config } from "@skandha/executor/lib/config"; +import { IDbController } from "@skandha/types/lib"; import { SignableENR } from "@chainsafe/discv5"; -import { INodeAPI } from "types/lib/node"; -import { Executor } from "executor/lib/executor"; -import logger from "api/lib/logger"; -import { BundlingMode } from "types/lib/api/interfaces"; -import { createMetrics, getHttpMetricsServer } from "monitoring/lib"; -import { MetricsOptions } from "types/lib/options/metrics"; -import { GetNodeAPI } from "executor/lib/interfaces"; -import { SkandhaVersion } from "types/lib/executor"; +import { INodeAPI } from "@skandha/types/lib/node"; +import { Executor } from "@skandha/executor/lib/executor"; +import logger from "@skandha/api/lib/logger"; +import { BundlingMode } from "@skandha/types/lib/api/interfaces"; +import { createMetrics, getHttpMetricsServer } from "@skandha/monitoring/lib"; +import { MetricsOptions } from "@skandha/types/lib/options/metrics"; +import { GetNodeAPI } from "@skandha/executor/lib/interfaces"; +import { SkandhaVersion } from "@skandha/types/lib/executor"; import { Network } from "./network/network"; import { SyncService } from "./sync"; import { IBundlerNodeOptions } from "./options"; diff --git a/packages/node/src/network/events.ts b/packages/node/src/network/events.ts index 24b80252..1cb71c70 100644 --- a/packages/node/src/network/events.ts +++ b/packages/node/src/network/events.ts @@ -1,7 +1,7 @@ import { EventEmitter } from "events"; import { PeerId } from "@libp2p/interface-peer-id"; import StrictEventEmitter from "strict-event-emitter-types"; -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; import { TopicValidatorResult } from "@libp2p/interface-pubsub"; import { RequestTypedContainer } from "./reqresp"; import { PendingGossipsubMessage } from "./processor/types"; diff --git a/packages/node/src/network/gossip/encoding.ts b/packages/node/src/network/gossip/encoding.ts index 8b5d6e97..9bb6fd93 100644 --- a/packages/node/src/network/gossip/encoding.ts +++ b/packages/node/src/network/gossip/encoding.ts @@ -3,7 +3,7 @@ import xxhashFactory from "xxhash-wasm"; import { Message } from "@libp2p/interface-pubsub"; import { digest } from "@chainsafe/as-sha256"; import { RPC } from "@chainsafe/libp2p-gossipsub/message"; -import { intToBytes, toHex } from "utils/lib"; +import { intToBytes, toHex } from "@skandha/utils/lib"; import { MESSAGE_DOMAIN_VALID_SNAPPY } from "./constants"; import { getGossipSSZType, GossipTopicCache } from "./topic"; diff --git a/packages/node/src/network/gossip/handler.ts b/packages/node/src/network/gossip/handler.ts index e8f9f605..fe06c37f 100644 --- a/packages/node/src/network/gossip/handler.ts +++ b/packages/node/src/network/gossip/handler.ts @@ -1,9 +1,9 @@ import { GossipSub, GossipsubEvents } from "@chainsafe/libp2p-gossipsub"; -import logger, { Logger } from "api/lib/logger"; -import { ts } from "types/lib"; -import { deserializeMempoolId, networksConfig } from "params/lib"; -import { GOSSIP_MAX_SIZE } from "types/lib/sszTypes"; -import { AllChainsMetrics } from "monitoring/lib"; +import logger, { Logger } from "@skandha/api/lib/logger"; +import { ts } from "@skandha/types/lib"; +import { deserializeMempoolId, networksConfig } from "@skandha/params/lib"; +import { GOSSIP_MAX_SIZE } from "@skandha/types/lib/sszTypes"; +import { AllChainsMetrics } from "@skandha/monitoring/lib"; import { SignaturePolicy } from "@chainsafe/libp2p-gossipsub/types"; import { Libp2p } from "../interface"; import { NetworkEvent, NetworkEventBus } from "../events"; diff --git a/packages/node/src/network/gossip/interface.ts b/packages/node/src/network/gossip/interface.ts index db2daa32..b4f5ca42 100644 --- a/packages/node/src/network/gossip/interface.ts +++ b/packages/node/src/network/gossip/interface.ts @@ -3,7 +3,7 @@ import { Libp2p } from "libp2p"; import { Message, TopicValidatorResult } from "@libp2p/interface-pubsub"; import StrictEventEmitter from "strict-event-emitter-types"; import { PeerIdStr } from "@chainsafe/libp2p-gossipsub/types"; -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; import { NetworkEvent } from "../events"; export enum GossipType { diff --git a/packages/node/src/network/gossip/topic.ts b/packages/node/src/network/gossip/topic.ts index eef0b11c..86d40cdd 100644 --- a/packages/node/src/network/gossip/topic.ts +++ b/packages/node/src/network/gossip/topic.ts @@ -1,4 +1,4 @@ -import { ssz } from "types/lib"; +import { ssz } from "@skandha/types/lib"; import { GossipEncoding, GossipTopic, diff --git a/packages/node/src/network/interface.ts b/packages/node/src/network/interface.ts index 36545b8c..53868516 100644 --- a/packages/node/src/network/interface.ts +++ b/packages/node/src/network/interface.ts @@ -3,11 +3,11 @@ import { Connection } from "@libp2p/interface-connection"; import { Multiaddr } from "@multiformats/multiaddr"; import { PeerId } from "@libp2p/interface-peer-id"; // eslint-disable-next-line import/namespace -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; import { SignableENR } from "@chainsafe/discv5"; import type { ConnectionManager } from "@libp2p/interface-connection-manager"; import type { Registrar } from "@libp2p/interface-registrar"; -import { Logger } from "api/lib/logger"; +import { Logger } from "@skandha/api/lib/logger"; import { INetworkEventBus } from "./events"; import { MetadataController } from "./metadata"; import { BundlerGossipsub } from "./gossip"; diff --git a/packages/node/src/network/metadata.ts b/packages/node/src/network/metadata.ts index 3d300a3e..0bc53641 100644 --- a/packages/node/src/network/metadata.ts +++ b/packages/node/src/network/metadata.ts @@ -1,4 +1,4 @@ -import { ts, ssz } from "types/lib"; +import { ts, ssz } from "@skandha/types/lib"; export enum ENRKey { tcp = "tcp", diff --git a/packages/node/src/network/network.ts b/packages/node/src/network/network.ts index 93b83fa2..ddd323e6 100644 --- a/packages/node/src/network/network.ts +++ b/packages/node/src/network/network.ts @@ -2,13 +2,13 @@ import { Connection } from "@libp2p/interface-connection"; import { Multiaddr } from "@multiformats/multiaddr"; import { PeerId } from "@libp2p/interface-peer-id"; -import { ssz, ts } from "types/lib"; +import { ssz, ts } from "@skandha/types/lib"; import { SignableENR } from "@chainsafe/discv5"; -import logger, { Logger } from "api/lib/logger"; -import { serializeMempoolId } from "params/lib"; -import { Config } from "executor/lib/config"; -import { AllChainsMetrics } from "monitoring/lib"; -import { Executor } from "executor/lib/executor"; +import logger, { Logger } from "@skandha/api/lib/logger"; +import { serializeMempoolId } from "@skandha/params/lib"; +import { Config } from "@skandha/executor/lib/config"; +import { AllChainsMetrics } from "@skandha/monitoring/lib"; +import { Executor } from "@skandha/executor/lib/executor"; import { INetworkOptions } from "../options"; import { getConnectionsMap } from "../utils"; import { INetwork, Libp2p } from "./interface"; diff --git a/packages/node/src/network/nodejs/util.ts b/packages/node/src/network/nodejs/util.ts index 450a2474..a94ed7d4 100644 --- a/packages/node/src/network/nodejs/util.ts +++ b/packages/node/src/network/nodejs/util.ts @@ -1,6 +1,6 @@ import { PeerId } from "@libp2p/interface-peer-id"; import { ENR, SignableENR } from "@chainsafe/discv5"; -import logger from "api/lib/logger"; +import logger from "@skandha/api/lib/logger"; import { Libp2p } from "../interface"; import { Eth2PeerDataStore } from "../peers/datastore"; import { INetworkOptions } from "../../options"; diff --git a/packages/node/src/network/peers/discover.ts b/packages/node/src/network/peers/discover.ts index 792da117..8514bfd5 100644 --- a/packages/node/src/network/peers/discover.ts +++ b/packages/node/src/network/peers/discover.ts @@ -2,9 +2,9 @@ import { PeerId } from "@libp2p/interface-peer-id"; import { Multiaddr } from "@multiformats/multiaddr"; import { PeerInfo } from "@libp2p/interface-peer-info"; import { ENR, IDiscv5DiscoveryInputOptions } from "@chainsafe/discv5"; -import Logger from "api/lib/logger"; -import { pruneSetToMax, sleep } from "utils/lib"; -import { ssz } from "types/lib"; +import Logger from "@skandha/api/lib/logger"; +import { pruneSetToMax, sleep } from "@skandha/utils/lib"; +import { ssz } from "@skandha/types/lib"; import { Libp2p } from "../interface"; import { ENRKey } from "../metadata"; import { diff --git a/packages/node/src/network/peers/peerManager.ts b/packages/node/src/network/peers/peerManager.ts index c4429b05..49d2c518 100644 --- a/packages/node/src/network/peers/peerManager.ts +++ b/packages/node/src/network/peers/peerManager.ts @@ -1,8 +1,8 @@ import { Connection } from "@libp2p/interface-connection"; import { PeerId } from "@libp2p/interface-peer-id"; import { IDiscv5DiscoveryInputOptions } from "@chainsafe/discv5"; -import Logger from "api/lib/logger"; -import { ts } from "types/lib"; +import Logger from "@skandha/api/lib/logger"; +import { ts } from "@skandha/types/lib"; import { GoodByeReasonCode, GOODBYE_KNOWN_CODES, diff --git a/packages/node/src/network/peers/peersData.ts b/packages/node/src/network/peers/peersData.ts index b9775253..0815d148 100644 --- a/packages/node/src/network/peers/peersData.ts +++ b/packages/node/src/network/peers/peersData.ts @@ -1,5 +1,5 @@ import { PeerId } from "@libp2p/interface-peer-id"; -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; import { ClientKind } from "./client"; type PeerIdStr = string; diff --git a/packages/node/src/network/peers/score.ts b/packages/node/src/network/peers/score.ts index 806963b4..c9f21930 100644 --- a/packages/node/src/network/peers/score.ts +++ b/packages/node/src/network/peers/score.ts @@ -1,5 +1,5 @@ import { PeerId } from "@libp2p/interface-peer-id"; -import { MapDef, pruneSetToMax } from "utils/lib"; +import { MapDef, pruneSetToMax } from "@skandha/utils/lib"; import { gossipScoreThresholds, negativeGossipScoreIgnoreThreshold, diff --git a/packages/node/src/network/peers/utils/prioritizePeers.ts b/packages/node/src/network/peers/utils/prioritizePeers.ts index e0a489ab..3d0966f1 100644 --- a/packages/node/src/network/peers/utils/prioritizePeers.ts +++ b/packages/node/src/network/peers/utils/prioritizePeers.ts @@ -1,6 +1,6 @@ import { PeerId } from "@libp2p/interface-peer-id"; import { Direction } from "@libp2p/interface-connection"; -import { shuffle, MapDef } from "utils/lib"; +import { shuffle, MapDef } from "@skandha/utils/lib"; const LOW_SCORE_TO_PRUNE_IF_TOO_MANY_PEERS = -2; diff --git a/packages/node/src/network/processor/gossipHandlers.ts b/packages/node/src/network/processor/gossipHandlers.ts index 90bd786e..534d16e7 100644 --- a/packages/node/src/network/processor/gossipHandlers.ts +++ b/packages/node/src/network/processor/gossipHandlers.ts @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { ts } from "types/lib"; -import logger from "api/lib/logger"; -import { Config } from "executor/lib/config"; -import { deserializeVerifiedUserOperation } from "params/lib/utils/userOp"; -import { AllChainsMetrics } from "monitoring/lib"; -import { Executor } from "executor/lib/executor"; +import { ts } from "@skandha/types/lib"; +import logger from "@skandha/api/lib/logger"; +import { Config } from "@skandha/executor/lib/config"; +import { deserializeVerifiedUserOperation } from "@skandha/params/lib/utils/userOp"; +import { AllChainsMetrics } from "@skandha/monitoring/lib"; +import { Executor } from "@skandha/executor/lib/executor"; import { GossipHandlers, GossipType } from "../gossip/interface"; import { validateGossipVerifiedUserOperation } from "../validation"; import { NetworkEventBus } from "../events"; diff --git a/packages/node/src/network/processor/gossipQueues.ts b/packages/node/src/network/processor/gossipQueues.ts index 1987f839..964d087c 100644 --- a/packages/node/src/network/processor/gossipQueues.ts +++ b/packages/node/src/network/processor/gossipQueues.ts @@ -1,4 +1,4 @@ -import { mapValues, LinkedList } from "utils/lib"; +import { mapValues, LinkedList } from "@skandha/utils/lib"; import { GossipType } from "../gossip/interface"; enum QueueType { diff --git a/packages/node/src/network/processor/index.ts b/packages/node/src/network/processor/index.ts index ab939d5b..0ccebbba 100644 --- a/packages/node/src/network/processor/index.ts +++ b/packages/node/src/network/processor/index.ts @@ -1,6 +1,6 @@ -import { mapValues } from "utils/lib"; -import logger from "api/lib/logger"; -import { Config } from "executor/lib/config"; +import { mapValues } from "@skandha/utils/lib"; +import logger from "@skandha/api/lib/logger"; +import { Config } from "@skandha/executor/lib/config"; import { NetworkEvent, NetworkEventBus } from "../events"; import { GossipType } from "../gossip/interface"; import { createGossipQueues } from "./gossipQueues"; diff --git a/packages/node/src/network/processor/types.ts b/packages/node/src/network/processor/types.ts index 125b3a7d..8177c491 100644 --- a/packages/node/src/network/processor/types.ts +++ b/packages/node/src/network/processor/types.ts @@ -1,6 +1,6 @@ import { PeerId } from "@libp2p/interface-peer-id"; import { Message } from "@libp2p/interface-pubsub"; -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; import { GossipTopic, GossipType } from "../gossip"; export type GossipAttestationsWork = { diff --git a/packages/node/src/network/processor/worker.ts b/packages/node/src/network/processor/worker.ts index fb1d0048..ca6fc865 100644 --- a/packages/node/src/network/processor/worker.ts +++ b/packages/node/src/network/processor/worker.ts @@ -1,4 +1,4 @@ -import { Config } from "executor/lib/config"; +import { Config } from "@skandha/executor/lib/config"; import { NetworkEvent, NetworkEventBus } from "../events"; import { GossipHandlers, GossipValidatorFn } from "../gossip/interface"; import { getGossipHandlers, ValidatorFnsModules } from "./gossipHandlers"; diff --git a/packages/node/src/network/reqresp/ReqRespNode.ts b/packages/node/src/network/reqresp/ReqRespNode.ts index 275bb5fe..8bf33ee6 100644 --- a/packages/node/src/network/reqresp/ReqRespNode.ts +++ b/packages/node/src/network/reqresp/ReqRespNode.ts @@ -1,8 +1,8 @@ import { PeerId } from "@libp2p/interface-peer-id"; import { Libp2p } from "libp2p"; -import { ts } from "types/lib"; -import { Logger } from "api/lib/logger"; -import { AllChainsMetrics } from "monitoring/lib"; +import { ts } from "@skandha/types/lib"; +import { Logger } from "@skandha/api/lib/logger"; +import { AllChainsMetrics } from "@skandha/monitoring/lib"; import * as reqRespProtocols from "../../reqresp/protocols"; import { INetworkEventBus, NetworkEvent } from "../events"; import { MetadataController } from "../metadata"; diff --git a/packages/node/src/network/reqresp/handlers/index.ts b/packages/node/src/network/reqresp/handlers/index.ts index dbc95fd8..a31c0eb4 100644 --- a/packages/node/src/network/reqresp/handlers/index.ts +++ b/packages/node/src/network/reqresp/handlers/index.ts @@ -1,12 +1,12 @@ -import { Config } from "executor/lib/config"; -import { Executor } from "executor/lib/executor"; -import { AllChainsMetrics } from "monitoring/lib"; +import { Config } from "@skandha/executor/lib/config"; +import { Executor } from "@skandha/executor/lib/executor"; +import { AllChainsMetrics } from "@skandha/monitoring/lib"; import * as protocols from "../../../reqresp/protocols"; import { EncodedPayloadSsz, HandlerTypeFromMessage } from "../../../reqresp/types"; import { onStatus } from "./status"; import { onPooledUserOpHashes } from "./pooledUserOpHashes"; import { onPooledUserOpsByHash } from "./pooledUserOpsByHash"; -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; export interface ReqRespHandlers { onStatus: () => AsyncIterable>; diff --git a/packages/node/src/network/reqresp/handlers/pooledUserOpHashes.ts b/packages/node/src/network/reqresp/handlers/pooledUserOpHashes.ts index 27852a45..932cc8b8 100644 --- a/packages/node/src/network/reqresp/handlers/pooledUserOpHashes.ts +++ b/packages/node/src/network/reqresp/handlers/pooledUserOpHashes.ts @@ -1,10 +1,10 @@ -import { ts, ssz } from "types/lib"; -import { Config } from "executor/lib/config"; -import { Executor } from "executor/lib/executor"; -import { MAX_OPS_PER_REQUEST } from "types/lib/sszTypes"; -import logger from "api/lib/logger"; -import { userOpHashToBytes } from "params/lib/utils/userOp"; -import { bytes32ToNumber, numberToBytes32 } from "params/lib/utils/cursor"; +import { ts, ssz } from "@skandha/types/lib"; +import { Config } from "@skandha/executor/lib/config"; +import { Executor } from "@skandha/executor/lib/executor"; +import { MAX_OPS_PER_REQUEST } from "@skandha/types/lib/sszTypes"; +import logger from "@skandha/api/lib/logger"; +import { userOpHashToBytes } from "@skandha/params/lib/utils/userOp"; +import { bytes32ToNumber, numberToBytes32 } from "@skandha/params/lib/utils/cursor"; import { EncodedPayload, EncodedPayloadType } from "../../../reqresp/types"; export async function* onPooledUserOpHashes( diff --git a/packages/node/src/network/reqresp/handlers/pooledUserOpsByHash.ts b/packages/node/src/network/reqresp/handlers/pooledUserOpsByHash.ts index 8e7a309e..5a9d1130 100644 --- a/packages/node/src/network/reqresp/handlers/pooledUserOpsByHash.ts +++ b/packages/node/src/network/reqresp/handlers/pooledUserOpsByHash.ts @@ -1,9 +1,9 @@ -import { ts } from "types/lib"; -import { Config } from "executor/lib/config"; -import { Executor } from "executor/lib/executor"; -import { serializeUserOp, userOpHashToString } from "params/lib/utils/userOp"; -import logger from "api/lib/logger"; -import { AllChainsMetrics } from "monitoring/lib"; +import { ts } from "@skandha/types/lib"; +import { Config } from "@skandha/executor/lib/config"; +import { Executor } from "@skandha/executor/lib/executor"; +import { serializeUserOp, userOpHashToString } from "@skandha/params/lib/utils/userOp"; +import logger from "@skandha/api/lib/logger"; +import { AllChainsMetrics } from "@skandha/monitoring/lib"; import { EncodedPayload, EncodedPayloadType } from "../../../reqresp/types"; export async function* onPooledUserOpsByHash( diff --git a/packages/node/src/network/reqresp/handlers/status.ts b/packages/node/src/network/reqresp/handlers/status.ts index 3c189065..57769a4d 100644 --- a/packages/node/src/network/reqresp/handlers/status.ts +++ b/packages/node/src/network/reqresp/handlers/status.ts @@ -1,6 +1,6 @@ -import { ts } from "types/lib"; -import { Config } from "executor/lib/config"; -import { fromHex } from "utils/lib"; +import { ts } from "@skandha/types/lib"; +import { Config } from "@skandha/executor/lib/config"; +import { fromHex } from "@skandha/utils/lib"; import { EncodedPayloadSsz, EncodedPayloadType } from "../../../reqresp/types"; export async function* onStatus( diff --git a/packages/node/src/network/reqresp/interface.ts b/packages/node/src/network/reqresp/interface.ts index 6302e779..f179dfd2 100644 --- a/packages/node/src/network/reqresp/interface.ts +++ b/packages/node/src/network/reqresp/interface.ts @@ -1,5 +1,5 @@ import { PeerId } from "@libp2p/interface-peer-id"; -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; export interface IReqRespNode { status(peerId: PeerId, request: ts.Status): Promise; diff --git a/packages/node/src/network/reqresp/pooledUserOpHashes.ts b/packages/node/src/network/reqresp/pooledUserOpHashes.ts index 46d9dfc9..c642dd6b 100644 --- a/packages/node/src/network/reqresp/pooledUserOpHashes.ts +++ b/packages/node/src/network/reqresp/pooledUserOpHashes.ts @@ -1,6 +1,6 @@ -import { Executor } from "executor/lib/executor"; -import { Config } from "executor/lib/config"; -import { ts } from "types/lib"; +import { Executor } from "@skandha/executor/lib/executor"; +import { Config } from "@skandha/executor/lib/config"; +import { ts } from "@skandha/types/lib"; import { PeerId } from "@libp2p/interface-peer-id"; import { IReqRespNode } from "./interface"; diff --git a/packages/node/src/network/reqresp/pooledUserOpsByHash.ts b/packages/node/src/network/reqresp/pooledUserOpsByHash.ts index 8a94776c..2420f678 100644 --- a/packages/node/src/network/reqresp/pooledUserOpsByHash.ts +++ b/packages/node/src/network/reqresp/pooledUserOpsByHash.ts @@ -1,6 +1,6 @@ -import { Executor } from "executor/lib/executor"; -import { Config } from "executor/lib/config"; -import { ts } from "types/lib"; +import { Executor } from "@skandha/executor/lib/executor"; +import { Config } from "@skandha/executor/lib/config"; +import { ts } from "@skandha/types/lib"; import { PeerId } from "@libp2p/interface-peer-id"; import { IReqRespNode } from "./interface"; diff --git a/packages/node/src/network/reqresp/types.ts b/packages/node/src/network/reqresp/types.ts index 01877659..169a27c5 100644 --- a/packages/node/src/network/reqresp/types.ts +++ b/packages/node/src/network/reqresp/types.ts @@ -1,4 +1,4 @@ -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; export enum ReqRespMethod { Status = "status", diff --git a/packages/node/src/network/statusCache.ts b/packages/node/src/network/statusCache.ts index b4e1794c..79b71192 100644 --- a/packages/node/src/network/statusCache.ts +++ b/packages/node/src/network/statusCache.ts @@ -1,6 +1,6 @@ -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; import { ReqRespHandlers } from "./reqresp/handlers"; -import { now } from "executor/lib/utils"; +import { now } from "@skandha/executor/lib/utils"; export interface StatusCache { get(): Promise; diff --git a/packages/node/src/network/validation/verifiedUserOperation.ts b/packages/node/src/network/validation/verifiedUserOperation.ts index 58dc9d99..1f21d300 100644 --- a/packages/node/src/network/validation/verifiedUserOperation.ts +++ b/packages/node/src/network/validation/verifiedUserOperation.ts @@ -1,6 +1,6 @@ import { toHexString } from "@chainsafe/ssz"; -import { Config } from "executor/lib/config"; -import { ts } from "types/lib"; +import { Config } from "@skandha/executor/lib/config"; +import { ts } from "@skandha/types/lib"; import { GossipErrorCode, GossipValidationError } from "../gossip/errors"; export async function validateGossipVerifiedUserOperation( diff --git a/packages/node/src/options/bundler.ts b/packages/node/src/options/bundler.ts index ceaa7b67..46ef23e6 100644 --- a/packages/node/src/options/bundler.ts +++ b/packages/node/src/options/bundler.ts @@ -1,4 +1,4 @@ -import { ApiOptions, defaultApiOptions } from "types/lib/options"; +import { ApiOptions, defaultApiOptions } from "@skandha/types/lib/options"; import { IDBOptions, defaultDBOptions } from "./db"; import { INetworkOptions, defaultNetworkOptions } from "./network"; diff --git a/packages/node/src/options/network.ts b/packages/node/src/options/network.ts index 937ec652..56225e2e 100644 --- a/packages/node/src/options/network.ts +++ b/packages/node/src/options/network.ts @@ -3,7 +3,7 @@ import { SignableENR, createKeypairFromPeerId, } from "@chainsafe/discv5"; -import { P2POptions, defaultP2POptions } from "types/lib/options"; +import { P2POptions, defaultP2POptions } from "@skandha/types/lib/options"; import { createSecp256k1PeerId } from "@libp2p/peer-id-factory"; import { PeerManagerOpts } from "./peers"; diff --git a/packages/node/src/reqresp/ReqResp.ts b/packages/node/src/reqresp/ReqResp.ts index ca6a6290..c30402b9 100644 --- a/packages/node/src/reqresp/ReqResp.ts +++ b/packages/node/src/reqresp/ReqResp.ts @@ -1,5 +1,5 @@ import { setMaxListeners } from "node:events"; -import { Logger } from "api/lib/logger"; +import { Logger } from "@skandha/api/lib/logger"; import { Libp2p } from "libp2p"; import { Connection, Stream } from "@libp2p/interface-connection"; import { PeerId } from "@libp2p/interface-peer-id"; diff --git a/packages/node/src/reqresp/encodingStrategies/sszSnappy/errors.ts b/packages/node/src/reqresp/encodingStrategies/sszSnappy/errors.ts index b83472da..d38e6b4b 100644 --- a/packages/node/src/reqresp/encodingStrategies/sszSnappy/errors.ts +++ b/packages/node/src/reqresp/encodingStrategies/sszSnappy/errors.ts @@ -1,4 +1,4 @@ -import { SkandhaError } from "utils/lib"; +import { SkandhaError } from "@skandha/utils/lib"; export enum SszSnappyErrorCode { /** Invalid number of bytes for protobuf varint */ diff --git a/packages/node/src/reqresp/protocols/Goodbye.ts b/packages/node/src/reqresp/protocols/Goodbye.ts index 23824c35..6efaeca1 100644 --- a/packages/node/src/reqresp/protocols/Goodbye.ts +++ b/packages/node/src/reqresp/protocols/Goodbye.ts @@ -1,4 +1,4 @@ -import { ssz, ts } from "types/lib"; +import { ssz, ts } from "@skandha/types/lib"; import { ContextBytesType, DuplexProtocolDefinitionGenerator, diff --git a/packages/node/src/reqresp/protocols/Metadata.ts b/packages/node/src/reqresp/protocols/Metadata.ts index a10fd3e5..cd2d9382 100644 --- a/packages/node/src/reqresp/protocols/Metadata.ts +++ b/packages/node/src/reqresp/protocols/Metadata.ts @@ -1,4 +1,4 @@ -import { ssz, ts } from "types/lib"; +import { ssz, ts } from "@skandha/types/lib"; import { ContextBytesType, DuplexProtocolDefinitionGenerator, diff --git a/packages/node/src/reqresp/protocols/Ping.ts b/packages/node/src/reqresp/protocols/Ping.ts index a845ed8b..969a1c5f 100644 --- a/packages/node/src/reqresp/protocols/Ping.ts +++ b/packages/node/src/reqresp/protocols/Ping.ts @@ -1,4 +1,4 @@ -import { ssz, ts } from "types/lib"; +import { ssz, ts } from "@skandha/types/lib"; import { ContextBytesType, Encoding, diff --git a/packages/node/src/reqresp/protocols/PooledUserOpHashes.ts b/packages/node/src/reqresp/protocols/PooledUserOpHashes.ts index 69b16cd4..bbe72b4e 100644 --- a/packages/node/src/reqresp/protocols/PooledUserOpHashes.ts +++ b/packages/node/src/reqresp/protocols/PooledUserOpHashes.ts @@ -1,4 +1,4 @@ -import { ssz, ts } from "types/lib"; +import { ssz, ts } from "@skandha/types/lib"; import { ContextBytesType, DuplexProtocolDefinitionGenerator, diff --git a/packages/node/src/reqresp/protocols/PooledUserOpsByHash.ts b/packages/node/src/reqresp/protocols/PooledUserOpsByHash.ts index 170d45f0..6505e77e 100644 --- a/packages/node/src/reqresp/protocols/PooledUserOpsByHash.ts +++ b/packages/node/src/reqresp/protocols/PooledUserOpsByHash.ts @@ -1,4 +1,4 @@ -import { ssz, ts } from "types/lib"; +import { ssz, ts } from "@skandha/types/lib"; import { ContextBytesType, DuplexProtocolDefinitionGenerator, diff --git a/packages/node/src/reqresp/protocols/Status.ts b/packages/node/src/reqresp/protocols/Status.ts index 73f36532..ec804e5d 100644 --- a/packages/node/src/reqresp/protocols/Status.ts +++ b/packages/node/src/reqresp/protocols/Status.ts @@ -1,5 +1,5 @@ -import { ssz, ts } from "types/lib"; -import { MAX_MEMPOOLS_PER_BUNDLER } from "types/lib/sszTypes"; +import { ssz, ts } from "@skandha/types/lib"; +import { MAX_MEMPOOLS_PER_BUNDLER } from "@skandha/types/lib/sszTypes"; import { ContextBytesType, DialOnlyProtocolDefinition, diff --git a/packages/node/src/reqresp/request/errors.ts b/packages/node/src/reqresp/request/errors.ts index 896d9c67..899782cc 100644 --- a/packages/node/src/reqresp/request/errors.ts +++ b/packages/node/src/reqresp/request/errors.ts @@ -1,4 +1,4 @@ -import { SkandhaError } from "utils/lib"; +import { SkandhaError } from "@skandha/utils/lib"; import { Encoding } from "../types"; import { ResponseError } from "../response"; import { RespStatus, RpcResponseStatusError } from "../interface"; diff --git a/packages/node/src/reqresp/request/index.ts b/packages/node/src/reqresp/request/index.ts index ece15408..68d217ec 100644 --- a/packages/node/src/reqresp/request/index.ts +++ b/packages/node/src/reqresp/request/index.ts @@ -2,8 +2,8 @@ import { pipe } from "it-pipe"; import { PeerId } from "@libp2p/interface-peer-id"; import { Libp2p } from "libp2p"; import { Uint8ArrayList } from "uint8arraylist"; -import { ErrorAborted, withTimeout, TimeoutError } from "utils/lib"; -import { Logger } from "api/lib/logger"; +import { ErrorAborted, withTimeout, TimeoutError } from "@skandha/utils/lib"; +import { Logger } from "@skandha/api/lib/logger"; import { MixedProtocolDefinition } from "../types"; import { prettyPrintPeerId, abortableSource } from "../utils"; import { ResponseError } from "../response"; diff --git a/packages/node/src/reqresp/response/errors.ts b/packages/node/src/reqresp/response/errors.ts index d127a9b8..adeb44ab 100644 --- a/packages/node/src/reqresp/response/errors.ts +++ b/packages/node/src/reqresp/response/errors.ts @@ -1,4 +1,4 @@ -import { SkandhaError } from "utils/lib"; +import { SkandhaError } from "@skandha/utils/lib"; import { RespStatus, RpcResponseStatusError } from "../interface"; type RpcResponseStatusNotSuccess = Exclude; diff --git a/packages/node/src/reqresp/response/index.ts b/packages/node/src/reqresp/response/index.ts index 6e971b78..bf1000e6 100644 --- a/packages/node/src/reqresp/response/index.ts +++ b/packages/node/src/reqresp/response/index.ts @@ -2,8 +2,8 @@ import { pipe } from "it-pipe"; import { PeerId } from "@libp2p/interface-peer-id"; import { Stream } from "@libp2p/interface-connection"; import { Uint8ArrayList } from "uint8arraylist"; -import { TimeoutError, withTimeout } from "utils/lib"; -import { Logger } from "api/lib/logger"; +import { TimeoutError, withTimeout } from "@skandha/utils/lib"; +import { Logger } from "@skandha/api/lib/logger"; import { prettyPrintPeerId } from "../utils"; import { ProtocolDefinition } from "../types"; import { requestDecode } from "../encoders/requestDecode"; diff --git a/packages/node/src/reqresp/types.ts b/packages/node/src/reqresp/types.ts index b89319f8..5db47d6c 100644 --- a/packages/node/src/reqresp/types.ts +++ b/packages/node/src/reqresp/types.ts @@ -1,5 +1,5 @@ import { PeerId } from "@libp2p/interface-peer-id"; -import { ts } from "types/lib"; +import { ts } from "@skandha/types/lib"; import { RateLimiterQuota } from "./rate_limiter/rateLimiterGRCA"; /** diff --git a/packages/node/src/sync/interface.ts b/packages/node/src/sync/interface.ts index 24a754eb..3aa618d1 100644 --- a/packages/node/src/sync/interface.ts +++ b/packages/node/src/sync/interface.ts @@ -1,7 +1,7 @@ -import { ts } from "types/lib"; -import { AllChainsMetrics } from "monitoring/lib"; -import { Executor } from "executor/lib/executor"; -import { Config } from "executor/lib/config"; +import { ts } from "@skandha/types/lib"; +import { AllChainsMetrics } from "@skandha/monitoring/lib"; +import { Executor } from "@skandha/executor/lib/executor"; +import { Config } from "@skandha/executor/lib/config"; import { INetwork } from "../network/interface"; export interface ISyncService { diff --git a/packages/node/src/sync/sync.ts b/packages/node/src/sync/sync.ts index b0e92855..e3081af0 100644 --- a/packages/node/src/sync/sync.ts +++ b/packages/node/src/sync/sync.ts @@ -1,12 +1,12 @@ -import logger from "api/lib/logger"; +import logger from "@skandha/api/lib/logger"; import { PeerId } from "@libp2p/interface-peer-id"; -import { ts } from "types/lib"; -import { deserializeMempoolId, isMempoolIdEqual } from "params/lib"; -import { deserializeUserOp, userOpHashToString } from "params/lib/utils/userOp"; -import { AllChainsMetrics } from "monitoring/lib"; -import { Executor } from "executor/lib/executor"; -import { Config } from "executor/lib/config"; -import { numberToBytes32 } from "params/lib/utils/cursor"; +import { ts } from "@skandha/types/lib"; +import { deserializeMempoolId, isMempoolIdEqual } from "@skandha/params/lib"; +import { deserializeUserOp, userOpHashToString } from "@skandha/params/lib/utils/userOp"; +import { AllChainsMetrics } from "@skandha/monitoring/lib"; +import { Executor } from "@skandha/executor/lib/executor"; +import { Config } from "@skandha/executor/lib/config"; +import { numberToBytes32 } from "@skandha/params/lib/utils/cursor"; import { INetwork } from "../network/interface"; import { NetworkEvent } from "../network/events"; import { PeerMap } from "../utils"; diff --git a/packages/params/package.json b/packages/params/package.json index 0051bd36..a5903787 100644 --- a/packages/params/package.json +++ b/packages/params/package.json @@ -1,5 +1,5 @@ { - "name": "params", + "name": "@skandha/params", "version": "1.5.6", "description": "Various bundler parameters", "author": "Etherspot", @@ -26,8 +26,8 @@ "@eth-optimism/sdk": "3.2.3", "@mantleio/sdk": "0.2.1", "ethers": "5.7.2", - "types": "^1.5.6", - "utils": "^1.5.6" + "@skandha/types": "^1.5.6", + "@skandha/utils": "^1.5.6" }, "scripts": { "clean": "rm -rf lib && rm -f *.tsbuildinfo", diff --git a/packages/params/src/gas-estimation/ancient8.ts b/packages/params/src/gas-estimation/ancient8.ts index 597a2146..e974ade0 100644 --- a/packages/params/src/gas-estimation/ancient8.ts +++ b/packages/params/src/gas-estimation/ancient8.ts @@ -1,6 +1,6 @@ import { BigNumber, BigNumberish, ethers, Contract } from "ethers"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import { serializeTransaction } from "ethers/lib/utils"; import { IPVGEstimatorWrapper, IPVGEstimator } from "../types/IPVGEstimator"; diff --git a/packages/params/src/gas-estimation/arbitrum.ts b/packages/params/src/gas-estimation/arbitrum.ts index e88b1150..4447eac9 100644 --- a/packages/params/src/gas-estimation/arbitrum.ts +++ b/packages/params/src/gas-estimation/arbitrum.ts @@ -1,8 +1,8 @@ import { NodeInterface__factory } from "@arbitrum/sdk/dist/lib/abi/factories/NodeInterface__factory"; import { NODE_INTERFACE_ADDRESS } from "@arbitrum/sdk/dist/lib/dataEntities/constants"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { BigNumber, BigNumberish, ethers } from "ethers"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import { IPVGEstimator, IPVGEstimatorWrapper } from "../types/IPVGEstimator"; export const estimateArbitrumPVG: IPVGEstimatorWrapper = ( diff --git a/packages/params/src/gas-estimation/mantle.ts b/packages/params/src/gas-estimation/mantle.ts index 4224a259..73f6c71b 100644 --- a/packages/params/src/gas-estimation/mantle.ts +++ b/packages/params/src/gas-estimation/mantle.ts @@ -1,6 +1,6 @@ -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { BigNumber, BigNumberish, ethers } from "ethers"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import mantleSDK from "@mantleio/sdk"; import { IPVGEstimator, IPVGEstimatorWrapper } from "../types/IPVGEstimator"; diff --git a/packages/params/src/gas-estimation/optimism.ts b/packages/params/src/gas-estimation/optimism.ts index 2f894b95..8e95a3c3 100644 --- a/packages/params/src/gas-estimation/optimism.ts +++ b/packages/params/src/gas-estimation/optimism.ts @@ -1,6 +1,6 @@ -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { BigNumber, BigNumberish, ethers } from "ethers"; -import { IEntryPoint__factory } from "types/lib/executor/contracts"; +import { IEntryPoint__factory } from "@skandha/types/lib/executor/contracts"; import { estimateL1GasCost } from "@eth-optimism/sdk"; import { IPVGEstimator, IPVGEstimatorWrapper } from "../types/IPVGEstimator"; diff --git a/packages/params/src/gas-price-oracles/oracles/interfaces.ts b/packages/params/src/gas-price-oracles/oracles/interfaces.ts index fbdccbac..22a7fa97 100644 --- a/packages/params/src/gas-price-oracles/oracles/interfaces.ts +++ b/packages/params/src/gas-price-oracles/oracles/interfaces.ts @@ -1,5 +1,5 @@ import { BigNumberish, ethers } from "ethers"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; export type IGetGasFeeResult = { maxPriorityFeePerGas: BigNumberish | undefined; diff --git a/packages/params/src/gas-price-oracles/oracles/mantle.ts b/packages/params/src/gas-price-oracles/oracles/mantle.ts index 588edae3..96337882 100644 --- a/packages/params/src/gas-price-oracles/oracles/mantle.ts +++ b/packages/params/src/gas-price-oracles/oracles/mantle.ts @@ -1,5 +1,5 @@ import { BigNumber, ethers } from "ethers"; -import { MantleGasOracleABI } from "types/lib/executor/abis"; +import { MantleGasOracleABI } from "@skandha/types/lib/executor/abis"; import { IGetGasFeeResult, IOracle } from "./interfaces"; const oracleAddress = "0x420000000000000000000000000000000000000F"; diff --git a/packages/params/src/types/IPVGEstimator.ts b/packages/params/src/types/IPVGEstimator.ts index b6665eed..a55575b5 100644 --- a/packages/params/src/types/IPVGEstimator.ts +++ b/packages/params/src/types/IPVGEstimator.ts @@ -1,5 +1,5 @@ import { BigNumber, BigNumberish, providers } from "ethers"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; export type IPVGEstimatorWrapper = ( provider: providers.StaticJsonRpcProvider diff --git a/packages/params/src/utils/cursor.ts b/packages/params/src/utils/cursor.ts index fc636d71..5ca61fd7 100644 --- a/packages/params/src/utils/cursor.ts +++ b/packages/params/src/utils/cursor.ts @@ -1,5 +1,5 @@ -import * as ts from "types/lib/primitive/types"; -import * as ssz from "types/lib/primitive/sszTypes"; +import * as ts from "@skandha/types/lib/primitive/types"; +import * as ssz from "@skandha/types/lib/primitive/sszTypes"; import { ethers } from "ethers"; export function bytes32ToNumber(bytes: ts.Bytes32): number { diff --git a/packages/params/src/utils/mempool.ts b/packages/params/src/utils/mempool.ts index d2b42cf1..36c2e314 100644 --- a/packages/params/src/utils/mempool.ts +++ b/packages/params/src/utils/mempool.ts @@ -1,4 +1,4 @@ -import { MempoolId } from "types/lib/sszTypes"; +import { MempoolId } from "@skandha/types/lib/sszTypes"; import { utils } from "ethers"; export function serializeMempoolId(mempoolId: string): Uint8Array { diff --git a/packages/params/src/utils/userOp.ts b/packages/params/src/utils/userOp.ts index 349f6821..6058d355 100644 --- a/packages/params/src/utils/userOp.ts +++ b/packages/params/src/utils/userOp.ts @@ -1,8 +1,8 @@ -import { ssz, ts } from "types/lib"; -import { Bytes32, UintBn256 } from "types/lib/primitive/sszTypes"; -import { fromHex, toHex } from "utils/lib"; +import { ssz, ts } from "@skandha/types/lib"; +import { Bytes32, UintBn256 } from "@skandha/types/lib/primitive/sszTypes"; +import { fromHex, toHex } from "@skandha/utils/lib"; import { BigNumber, BigNumberish } from "ethers"; -import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint"; +import { UserOperationStruct } from "@skandha/types/lib/executor/contracts/EntryPoint"; import { getAddress } from "ethers/lib/utils"; const bigintToBigNumber = (bn: bigint): BigNumberish => { diff --git a/packages/types/package.json b/packages/types/package.json index 03b6df00..889b2fa5 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,5 +1,5 @@ { - "name": "types", + "name": "@skandha/types", "version": "1.5.6", "description": "The types of Etherspot bundler client", "author": "Etherspot", diff --git a/packages/utils/package.json b/packages/utils/package.json index f501a8ad..9eec5495 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,5 +1,5 @@ { - "name": "utils", + "name": "@skandha/utils", "version": "1.5.6", "description": "utils of Etherspot bundler client", "author": "Etherspot", @@ -35,6 +35,6 @@ "ethers": "5.7.2", "pino": "8.11.0", "pino-pretty": "10.0.0", - "types": "^1.5.6" + "@skandha/types": "^1.5.6" } } diff --git a/tasks/get_prev_tag.js b/tasks/get_prev_tag.js new file mode 100644 index 00000000..e87171c6 --- /dev/null +++ b/tasks/get_prev_tag.js @@ -0,0 +1,46 @@ +/* eslint-disable no-console, + @typescript-eslint/explicit-function-return-type, + @typescript-eslint/no-var-requires, + @typescript-eslint/no-require-imports */ + +// Script used in .github/workflows/release.yml to get the previous tag +// to generate a changelog from 'prev_tag' to 'tag' +// Returns the most recent tag that: +// - is not equal to CURRENT_TAG +// - does not contain IGNORE_PATTERN +// +// Outputs to output.prev_tag + +const { exec } = require("node:child_process"); +const { promisify } = require("node:util"); + +async function run() { + const { CURRENT_TAG, IGNORE_PATTERN } = process.env; + if (!CURRENT_TAG) throw Error("CURRENT_TAG must be defined"); + if (!IGNORE_PATTERN) throw Error("IGNORE_PATTERN must be defined"); + + const { stdout } = await promisify(exec)("git tag --sort=-version:refname"); + // Returns sorted list of tags + // v0.32.0 + // v0.31.0 + // v0.30.0 + // v0.29.3 + + // Pick the first tag that doesn't match current tag + const tags = stdout.trim().split("\n"); + for (const tag of tags) { + if (tag !== CURRENT_TAG && !tag.includes(IGNORE_PATTERN)) { + const cmd = `echo "prev_tag=${tag}" >> ${process.env.GITHUB_OUTPUT}`; + console.log("Execute command on shell", cmd); + await promisify(exec)(cmd); + return; + } + } + + throw Error("No tag found"); +} + +run().catch((e) => { + console.error(e); + process.exit(1); +});