diff --git a/.eslintrc.js b/.eslintrc.js index efc122f9d0e1..ba5ab8d2e002 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -31,6 +31,13 @@ module.exports = { "error", { groups: ["builtin", "external", "internal", "parent", "sibling", "index"], + pathGroups: [ + { + pattern: "@lodestar/**", + group: "internal", + } + ], + pathGroupsExcludedImportTypes: ["builtin"], }, ], "@typescript-eslint/await-thenable": "error", diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 19da0e79598e..062d2de3f721 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -50,8 +50,8 @@ jobs: - name: Restore performance state cache uses: actions/cache@master with: - path: packages/beacon-state-transition/test-cache - key: perf-states-${{ hashFiles('packages/beacon-state-transition/test/perf/params.ts') }} + path: packages/state-transition/test-cache + key: perf-states-${{ hashFiles('packages/state-transition/test/perf/params.ts') }} - name: Run benchmarks run: yarn benchmark diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index 370f2e84476f..074e2fbf5a0c 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -86,7 +86,7 @@ jobs: # --exact # lerna will link the dependencies of monorepo packages without ^ operator as npm # is apparently bad at resolving ^ dependencies of the canary versions. For e.g - # @chainsafe/lodestar-cli@^0.34.0-dev.4 resolves to => 0.34.0 + # @chainsafe/lodestar@^0.34.0-dev.4 resolves to => 0.34.0 # # NOTE: Using --preid dev.$(git rev-parse --short=7 HEAD) results in `0.24.3-dev.3ddb91d.0+3ddb91d` run: | diff --git a/.github/workflows/test-sim-merge.yml b/.github/workflows/test-sim-merge.yml index cc69328efac3..f1d2024c55ff 100644 --- a/.github/workflows/test-sim-merge.yml +++ b/.github/workflows/test-sim-merge.yml @@ -46,7 +46,7 @@ jobs: - name: Test Lodestar <> Geth interop run: yarn test:sim:merge-interop - working-directory: packages/lodestar + working-directory: packages/beacon-node env: EL_BINARY_DIR: ../../go-ethereum/build/bin EL_SCRIPT_DIR: kiln/geth @@ -65,7 +65,7 @@ jobs: - name: Test Lodestar <> Nethermind interop run: yarn test:sim:merge-interop - working-directory: packages/lodestar + working-directory: packages/beacon-node env: EL_BINARY_DIR: ../../nethermind/src/Nethermind/Nethermind.Runner EL_SCRIPT_DIR: kiln/nethermind @@ -77,4 +77,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: debug-test-logs - path: packages/lodestar/test-logs + path: packages/beacon-node/test-logs diff --git a/.github/workflows/test-sim.yml b/.github/workflows/test-sim.yml index a0c7320fbdcb..0a26ee4f8522 100644 --- a/.github/workflows/test-sim.yml +++ b/.github/workflows/test-sim.yml @@ -33,25 +33,25 @@ jobs: - name: Simulation single thread single node test run: yarn test:sim:singleThread - working-directory: packages/lodestar + working-directory: packages/beacon-node - name: Simulation single thread multi node test run: yarn test:sim:singleThreadMultiNode - working-directory: packages/lodestar + working-directory: packages/beacon-node # - name: Simulation multi thread multi node test phase0 # run: yarn test:sim:multiThread - # working-directory: packages/lodestar + # working-directory: packages/beacon-node # env: {RUN_ONLY_SIM_TEST: phase0} # - name: Simulation multi thread multi node test altair epoch genesis # run: yarn test:sim:multiThread - # working-directory: packages/lodestar + # working-directory: packages/beacon-node # env: {RUN_ONLY_SIM_TEST: altair-genesis} # - name: Simulation multi thread multi node test altair epoch 2 # run: yarn test:sim:multiThread - # working-directory: packages/lodestar + # working-directory: packages/beacon-node # env: {RUN_ONLY_SIM_TEST: altair-epoch2} - name: Upload debug log test files if: ${{ always() }} uses: actions/upload-artifact@v2 with: name: debug-test-logs - path: packages/lodestar/test-logs + path: packages/beacon-node/test-logs diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index e6b050408c9a..fc4cf2f56163 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -38,21 +38,21 @@ jobs: - name: Restore spec tests cache uses: actions/cache@master with: - path: packages/lodestar/spec-tests - key: spec-test-data-${{ hashFiles('packages/lodestar/test/spec/specTestVersioning.ts') }} + path: packages/beacon-node/spec-tests + key: spec-test-data-${{ hashFiles('packages/beacon-node/test/spec/specTestVersioning.ts') }} - name: Download spec tests run: yarn download-spec-tests - working-directory: packages/lodestar + working-directory: packages/beacon-node # Run them in different steps to quickly identifying which command failed # Otherwise just doing `yarn test:spec` you can't tell which specific suite failed # many of the suites have identical names for minimal and mainnet - name: Spec tests general run: yarn test:spec-general - working-directory: packages/lodestar + working-directory: packages/beacon-node - name: Spec tests minimal run: yarn test:spec-minimal - working-directory: packages/lodestar + working-directory: packages/beacon-node - name: Spec tests mainnet run: yarn test:spec-mainnet - working-directory: packages/lodestar + working-directory: packages/beacon-node diff --git a/.gitignore b/.gitignore index a29bbc858d2e..3a2642fd95c6 100644 --- a/.gitignore +++ b/.gitignore @@ -28,11 +28,11 @@ validators # Tests artifacts packages/*/spec-tests packages/*/benchmark_data -packages/lodestar/test-logs/ -packages/beacon-state-transition/test-cache +packages/beacon-node/test-logs/ +packages/state-transition/test-cache benchmark_data invalidSszObjects/ -packages/lodestar/mainnet_pubkeys.csv +packages/beacon-node/mainnet_pubkeys.csv # Autogenerated docs packages/**/docs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32dcb67307ff..f7a82711a34c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -168,19 +168,19 @@ Status labels only apply to pull requests. The Module labels should be applied to all issues and pull requests if possible. -- `mod1-beaconchain`: The @chainsafe/lodestar beacon-chain module. -- `mod2-validator`: The @chainsafe/lodestar-validator module. -- `mod3-lightclient`: The @chainsafe/lodestar-light-client module. -- `mod4-api`: The @chainsafe/lodestar-api module. -- `mod5-cli`: The @chainsafe/lodestar-cli module. -- `mod6-statetransition`: The @chainsafe/lodestar-beacon-state-transition module. -- `mod7-types`: The @chainsafe/lodestar-types module. -- `mod8-params`: The @chainsafe/lodestar-params module. -- `mod9-utils`: The @chainsafe/lodestar-utils module. -- `moda-config`: The @chainsafe/lodestar-config module. -- `modb-database`: The @chainsafe/lodestar-db module. -- `modc-forkchoice`: The @chainsafe/lodestar-fork-choice module. -- `modd-spectests`: The @chainsafe/lodestar-spec-test-\* modules. +- `mod1-beaconchain`: The @lodestar/beacon-node beacon-chain module. +- `mod2-validator`: The @lodestar/validator module. +- `mod3-lightclient`: The @lodestar/light-client module. +- `mod4-api`: The @lodestar/api module. +- `mod5-cli`: The @chainsafe/lodestar module. +- `mod6-statetransition`: The @lodestar/state-transition module. +- `mod7-types`: The @lodestar/types module. +- `mod8-params`: The @lodestar/params module. +- `mod9-utils`: The @lodestar/utils module. +- `moda-config`: The @lodestar/config module. +- `modb-database`: The @lodestar/db module. +- `modc-forkchoice`: The @lodestar/fork-choice module. +- `modd-spectests`: The @lodestar/spec-test-\* modules. ###### `scope.*` Scope Indicator diff --git a/Dockerfile b/Dockerfile index d1c5b47be06a..66674d7f5fe1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ RUN apk update && apk add --no-cache g++ make python3 && rm -rf /var/cache/apk/* ARG VERSION=latest ENV VERSION=$VERSION -RUN npm install @chainsafe/lodestar-cli@$VERSION +RUN npm install @chainsafe/lodestar@$VERSION FROM node:16-alpine WORKDIR /usr/app diff --git a/README.md b/README.md index 65d303f81b48..7a49bdf20a3d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Lodestar Ethereum Consensus Implementation [![GitHub release (latest by date)](https://img.shields.io/github/v/release/chainsafe/lodestar?label=Github)](https://github.com/ChainSafe/lodestar/releases/latest) -[![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-cli)](https://www.npmjs.com/package/@chainsafe/lodestar-cli) +[![npm](https://img.shields.io/npm/v/@chainsafe/lodestar)](https://www.npmjs.com/package/@chainsafe/lodestar) [![Docker Image Version (latest by date)](https://img.shields.io/docker/v/chainsafe/lodestar?color=blue&label=Docker&sort=semver)](https://hub.docker.com/r/chainsafe/lodestar) [![Eth Consensus Spec v1.1.10](https://img.shields.io/badge/ETH%20consensus--spec-1.1.10-blue)](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10) [![codecov](https://codecov.io/gh/ChainSafe/lodestar/branch/unstable/graph/badge.svg)](https://codecov.io/gh/ChainSafe/lodestar) @@ -47,20 +47,19 @@ yarn build | Package | Version | License | Docs | Description | | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- | -| [@chainsafe/lodestar](https://github.com/ChainSafe/lodestar/tree/unstable/packages/lodestar) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar)](https://www.npmjs.com/package/@chainsafe/lodestar) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://chainsafe.github.io/lodestar) | :rotating_light: Beacon-chain client | -| [@chainsafe/lodestar-validator](https://github.com/ChainSafe/lodestar/tree/unstable/packages/validator) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-validator)](https://www.npmjs.com/package/@chainsafe/lodestar-validator) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/validator) | :bank: Validator client | -| [@chainsafe/lodestar-light-client](https://github.com/ChainSafe/lodestar/tree/unstable/packages/light-client) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-light-client)](https://www.npmjs.com/package/@chainsafe/lodestar-light-client) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/light-client) | :bird: Ethereum Light client | -| [@chainsafe/lodestar-api](https://github.com/ChainSafe/lodestar/tree/unstable/packages/api) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-api)](https://www.npmjs.com/package/@chainsafe/lodestar-api) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/api) | :clipboard: REST Client for the Eth Beacon API | -| [@chainsafe/lodestar-cli](https://github.com/ChainSafe/lodestar/tree/unstable/packages/cli) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-cli)](https://www.npmjs.com/package/@chainsafe/lodestar-cli) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://chainsafe.github.io/lodestar/reference/cli/) | :computer: Command-line tool for Lodestar | -| [@chainsafe/lodestar-beacon-state-transition](https://github.com/ChainSafe/lodestar/tree/unstable/packages/beacon-state-transition) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-beacon-state-transition)](https://www.npmjs.com/package/@chainsafe/lodestar-beacon-state-transition) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/beacon-state-transition) | :mag_right: Eth Consensus beacon-state transition | -| [@chainsafe/lodestar-types](https://github.com/ChainSafe/lodestar/tree/unstable/packages/types) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-types)](https://www.npmjs.com/package/@chainsafe/lodestar-types) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/types) | :spiral_notepad: Eth Consensus TypeScript and SSZ types | -| [@chainsafe/lodestar-params](https://github.com/ChainSafe/lodestar/tree/unstable/packages/params) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-params)](https://www.npmjs.com/package/@chainsafe/lodestar-params) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/params) | :spider_web: Eth Consensus network parameters | -| [@chainsafe/lodestar-utils](https://github.com/ChainSafe/lodestar/tree/unstable/packages/utils) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-utils)](https://www.npmjs.com/package/@chainsafe/lodestar-utils) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/utils) | :toolbox: Miscellaneous utility functions used across Lodestar | -| [@chainsafe/lodestar-config](https://github.com/ChainSafe/lodestar/tree/unstable/packages/config) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-config)](https://www.npmjs.com/package/@chainsafe/lodestar-config) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/config) | :spiral_notepad: Eth Consensus types and params bundled together | -| [@chainsafe/lodestar-spec-test-util](https://github.com/ChainSafe/lodestar/tree/unstable/packages/spec-test-util) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-spec-test-util)](https://www.npmjs.com/package/@chainsafe/lodestar-spec-test-util) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/spec-test-util) | :test_tube: Test harness for Eth Consensus spec tests | -| [@chainsafe/lodestar-spec-test-runner](https://github.com/ChainSafe/lodestar/tree/unstable/packages/spec-test-runner) | | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | | :test_tube: Run all Eth Consensus spec tests | -| [@chainsafe/lodestar-db](https://github.com/ChainSafe/lodestar/tree/unstable/packages/db) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-db)](https://www.npmjs.com/package/@chainsafe/lodestar-db) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/db) | :floppy_disk: Read/write persistent Eth Consensus data | -| [@chainsafe/lodestar-fork-choice](https://github.com/ChainSafe/lodestar/tree/unstable/packages/fork-choice) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-fork-choice)](https://www.npmjs.com/package/@chainsafe/lodestar-fork-choice) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/fork-choice) | :fork_and_knife: Beacon-chain fork choice | +| [@lodestar/beacon-node](https://github.com/ChainSafe/lodestar/tree/unstable/packages/beacon-node) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar)](https://www.npmjs.com/package/@chainsafe/lodestar) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://chainsafe.github.io/lodestar) | :rotating_light: Beacon-chain client | +| [@lodestar/validator](https://github.com/ChainSafe/lodestar/tree/unstable/packages/validator) | [![npm](https://img.shields.io/npm/v/@lodestar/validator)](https://www.npmjs.com/package/@lodestar/validator) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/validator) | :bank: Validator client | +| [@lodestar/light-client](https://github.com/ChainSafe/lodestar/tree/unstable/packages/light-client) | [![npm](https://img.shields.io/npm/v/@lodestar/light-client)](https://www.npmjs.com/package/@lodestar/light-client) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/light-client) | :bird: Ethereum Light client | +| [@lodestar/api](https://github.com/ChainSafe/lodestar/tree/unstable/packages/api) | [![npm](https://img.shields.io/npm/v/@lodestar/api)](https://www.npmjs.com/package/@lodestar/api) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/api) | :clipboard: REST Client for the Eth Beacon API | +| [@chainsafe/lodestar](https://github.com/ChainSafe/lodestar/tree/unstable/packages/cli) | [![npm](https://img.shields.io/npm/v/@chainsafe/lodestar)](https://www.npmjs.com/package/@chainsafe/lodestar) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/typedoc-blue)](https://chainsafe.github.io/lodestar/reference/cli/) | :computer: Command-line tool for Lodestar | +| [@lodestar/state-transition](https://github.com/ChainSafe/lodestar/tree/unstable/packages/state-transition) | [![npm](https://img.shields.io/npm/v/@lodestar/state-transition)](https://www.npmjs.com/package/@lodestar/state-transition) | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/state-transition) | :mag_right: Eth Consensus beacon-state transition | +| [@lodestar/types](https://github.com/ChainSafe/lodestar/tree/unstable/packages/types) | [![npm](https://img.shields.io/npm/v/@lodestar/types)](https://www.npmjs.com/package/@lodestar/types) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/types) | :spiral_notepad: Eth Consensus TypeScript and SSZ types | +| [@lodestar/params](https://github.com/ChainSafe/lodestar/tree/unstable/packages/params) | [![npm](https://img.shields.io/npm/v/@lodestar/params)](https://www.npmjs.com/package/@lodestar/params) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/params) | :spider_web: Eth Consensus network parameters | +| [@lodestar/utils](https://github.com/ChainSafe/lodestar/tree/unstable/packages/utils) | [![npm](https://img.shields.io/npm/v/@lodestar/utils)](https://www.npmjs.com/package/@lodestar/utils) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/utils) | :toolbox: Miscellaneous utility functions used across Lodestar | +| [@lodestar/config](https://github.com/ChainSafe/lodestar/tree/unstable/packages/config) | [![npm](https://img.shields.io/npm/v/@lodestar/config)](https://www.npmjs.com/package/@lodestar/config) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/config) | :spiral_notepad: Eth Consensus types and params bundled together | +| [@lodestar/spec-test-util](https://github.com/ChainSafe/lodestar/tree/unstable/packages/spec-test-util) | [![npm](https://img.shields.io/npm/v/@lodestar/spec-test-util)](https://www.npmjs.com/package/@lodestar/spec-test-util) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/spec-test-util) | :test_tube: Test harness for Eth Consensus spec tests | +| [@lodestar/db](https://github.com/ChainSafe/lodestar/tree/unstable/packages/db) | [![npm](https://img.shields.io/npm/v/@lodestar/db)](https://www.npmjs.com/package/@lodestar/db) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/db) | :floppy_disk: Read/write persistent Eth Consensus data | +| [@lodestar/fork-choice](https://github.com/ChainSafe/lodestar/tree/unstable/packages/fork-choice) | [![npm](https://img.shields.io/npm/v/@lodestar/fork-choice)](https://www.npmjs.com/package/@lodestar/fork-choice) | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | [![documentation](https://img.shields.io/badge/readme-blue)](https://github.com/ChainSafe/lodestar/tree/unstable/packages/fork-choice) | :fork_and_knife: Beacon-chain fork choice | ## Contributors diff --git a/docs/design/depgraph.md b/docs/design/depgraph.md index 1efb59e80fff..ec2e068e383b 100644 --- a/docs/design/depgraph.md +++ b/docs/design/depgraph.md @@ -16,7 +16,7 @@ graph TD types["lodestar-types"]:::nodemodule utils["lodestar-utils"]:::nodemodule validator["lodestar-validator"]:::nodemodule - state-trans["lodestar-beacon-state-transition"]:::nodemodule + state-trans["lodestar-state-transition"]:::nodemodule params-->config params-->types @@ -54,11 +54,11 @@ graph TD validator-->cli click cli "https://github.com/ChainSafe/lodestar/tree/unstable/packages/cli" - click lodestar "https://github.com/ChainSafe/lodestar/tree/unstable/packages/lodestar" + click lodestar "https://github.com/ChainSafe/lodestar/tree/unstable/packages/beacon-node" click validator "https://github.com/ChainSafe/lodestar/tree/unstable/packages/validator" click db "https://github.com/ChainSafe/lodestar/tree/unstable/packages/db" click params "https://github.com/ChainSafe/lodestar/tree/unstable/packages/params" - click state-trans "https://github.com/ChainSafe/lodestar/tree/unstable/packages/beacon-state-transition" + click state-trans "https://github.com/ChainSafe/lodestar/tree/unstable/packages/state-transition" click fork-choice "https://github.com/ChainSafe/lodestar/tree/unstable/packages/fork-choice" click types "https://github.com/ChainSafe/lodestar/tree/unstable/packages/types" click utils "https://github.com/ChainSafe/lodestar/tree/unstable/packages/utils" @@ -72,43 +72,43 @@ For a list of all the packages in the monorepo and a description for each, click Let's talk about how each package fits together in finer detail, from top to bottom, following the chart. -## @chainsafe/lodestar-params +## @lodestar/params -[@chainsafe/lodestar-params](https://github.com/ChainSafe/lodestar/tree/unstable/packages/params) contains the parameters for configuring an Ethereum Consensus network. For example, the [mainnet params](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#configuration) +[@lodestar/params](https://github.com/ChainSafe/lodestar/tree/unstable/packages/params) contains the parameters for configuring an Ethereum Consensus network. For example, the [mainnet params](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#configuration) -## @chainsafe/lodestar-types +## @lodestar/types -[@chainsafe/lodestar-types](https://github.com/ChainSafe/lodestar/tree/unstable/packages/types) contains Eth Consensus ssz types and data structures. +[@lodestar/types](https://github.com/ChainSafe/lodestar/tree/unstable/packages/types) contains Eth Consensus ssz types and data structures. -## @chainsafe/lodestar-config +## @lodestar/config -[@chainsafe/lodestar-config](https://github.com/ChainSafe/lodestar/tree/unstable/packages/config) combines [`lodestar-params`](#chainsafelodestar-params) and [`lodestar-types`](#chainsafelodestar-types) together to be used as a single config object across the other Lodestar packages. +[@lodestar/config](https://github.com/ChainSafe/lodestar/tree/unstable/packages/config) combines [`lodestar-params`](#chainsafelodestar-params) and [`lodestar-types`](#chainsafelodestar-types) together to be used as a single config object across the other Lodestar packages. -## @chainsafe/lodestar-utils +## @lodestar/utils -[@chainsafe/lodestar-utils](https://github.com/ChainSafe/lodestar/tree/unstable/packages/utils) contains various utilities that are common among the various Lodestar monorepo packages. +[@lodestar/utils](https://github.com/ChainSafe/lodestar/tree/unstable/packages/utils) contains various utilities that are common among the various Lodestar monorepo packages. -## @chainsafe/lodestar-beacon-state-transition +## @lodestar/state-transition -[@chainsafe/lodestar-beacon-state-transition](https://github.com/ChainSafe/lodestar/tree/unstable/packages/beacon-state-transition) contains the Lodestar implementation of the [beacon state transition function](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#beacon-chain-state-transition-function), which is used by [`@chainsafe/lodestar`](#chainsafelodestar) to perform the actual beacon state transition. This package also contains various functions used to calculate info about the beacon chain (such as `computeEpochAtSlot`) which are used by [@chainsafe/lodestar-fork-choice](#chainsafelodestar-fork-choice) and [@chainsafe/lodestar-validator](#chainsafelodestar-validator) +[@lodestar/state-transition](https://github.com/ChainSafe/lodestar/tree/unstable/packages/state-transition) contains the Lodestar implementation of the [beacon state transition function](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#beacon-chain-state-transition-function), which is used by [`@lodestar/beacon-node`](#chainsafelodestar) to perform the actual beacon state transition. This package also contains various functions used to calculate info about the beacon chain (such as `computeEpochAtSlot`) which are used by [@lodestar/fork-choice](#chainsafelodestar-fork-choice) and [@lodestar/validator](#chainsafelodestar-validator) -## @chainsafe/lodestar-db +## @lodestar/db -[@chainsafe/lodestar-db](https://github.com/ChainSafe/lodestar/tree/unstable/packages/db) is where all persistent data about the beacon node is stored. Any package that needs to read or write persistent beacon node data depends on `lodestar-db`. +[@lodestar/db](https://github.com/ChainSafe/lodestar/tree/unstable/packages/db) is where all persistent data about the beacon node is stored. Any package that needs to read or write persistent beacon node data depends on `lodestar-db`. -## @chainsafe/lodestar-fork-choice +## @lodestar/fork-choice -[@chainsafe/lodestar-fork-choice](https://github.com/ChainSafe/lodestar/tree/unstable/packages/fork-choice) holds the methods for reading/writing the fork choice DAG. The [`@chainsafe/lodestar`](#chainsafelodestar) package is the sole consumer of this package because the beacon node itself is what controls when the fork choice DAG is updated. +[@lodestar/fork-choice](https://github.com/ChainSafe/lodestar/tree/unstable/packages/fork-choice) holds the methods for reading/writing the fork choice DAG. The [`@lodestar/beacon-node`](#chainsafelodestar) package is the sole consumer of this package because the beacon node itself is what controls when the fork choice DAG is updated. For a good explainer on how the fork choice itself works, see the [annotated fork choice spec](https://github.com/ethereum/annotated-spec/blob/v1.1.10/phase0/fork-choice.md). This is an annotated version of the [Eth Consensus fork choice spec](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md) which `lodestar-fork-choice` is based on. -## @chainsafe/lodestar-validator +## @lodestar/validator -[@chainsafe/lodestar-validator](https://github.com/ChainSafe/lodestar/tree/unstable/packages/validator) contains the validator client. The sole consumer of this package is [@chainsafe/lodestar-cli](#chainsafelodestar-cli), which provides CLI access to run and configure the validator client. However, the validator client communicates to a REST API that is contained in [@chainsafe/lodestar](#chainsafelodestar) (specifically in the `api` module) to perform the validator duties. +[@lodestar/validator](https://github.com/ChainSafe/lodestar/tree/unstable/packages/validator) contains the validator client. The sole consumer of this package is [@chainsafe/lodestar](#chainsafelodestar-cli), which provides CLI access to run and configure the validator client. However, the validator client communicates to a REST API that is contained in [@lodestar/beacon-node](#chainsafelodestar) (specifically in the `api` module) to perform the validator duties. -## @chainsafe/lodestar +## @lodestar/beacon-node -[@chainsafe/lodestar](https://github.com/ChainSafe/lodestar/tree/unstable/packages/lodestar) contains the actual beacon node process itself, which is the aggregate of all the above packages and the "brain" of the Lodestar beacon chain implementation. All of the node modules live in this package as well. +[@lodestar/beacon-node](https://github.com/ChainSafe/lodestar/tree/unstable/packages/beacon-node) contains the actual beacon node process itself, which is the aggregate of all the above packages and the "brain" of the Lodestar beacon chain implementation. All of the node modules live in this package as well. -## @chainsafe/lodestar-cli +## @chainsafe/lodestar -[@chainsafe/lodestar-cli](https://github.com/ChainSafe/lodestar/tree/unstable/packages/cli) combines everything together for CLI usage and configuration of the beacon node and validator. +[@chainsafe/lodestar](https://github.com/ChainSafe/lodestar/tree/unstable/packages/cli) combines everything together for CLI usage and configuration of the beacon node and validator. diff --git a/docs/packages.md b/docs/packages.md index dc983ce118f2..fd48803d3afe 100644 --- a/docs/packages.md +++ b/docs/packages.md @@ -2,12 +2,12 @@ Autogenerated [Typedoc](https://typedoc.org/) documentation -- [@chainsafe/lodestar](lodestar) -- [@chainsafe/lodestar-beacon-state-transition](lodestar-beacon-state-transition) -- [@chainsafe/lodestar-cli](lodestar-cli) -- [@chainsafe/lodestar-config](lodestar-config) -- [@chainsafe/lodestar-params](lodestar-params) -- [@chainsafe/lodestar-spec-test-util](lodestar-spec-test-util) -- [@chainsafe/lodestar-types](lodestar-types) -- [@chainsafe/lodestar-utils](lodestar-utils) -- [@chainsafe/lodestar-validator](lodestar-validator) +- [@lodestar/beacon-node](lodestar) +- [@lodestar/state-transition](lodestar-state-transition) +- [@chainsafe/lodestar](lodestar-cli) +- [@lodestar/config](lodestar-config) +- [@lodestar/params](lodestar-params) +- [@lodestar/spec-test-util](lodestar-spec-test-util) +- [@lodestar/types](lodestar-types) +- [@lodestar/utils](lodestar-utils) +- [@lodestar/validator](lodestar-validator) diff --git a/packages/api/README.md b/packages/api/README.md index bfc3b17a5eb6..db185572d371 100644 --- a/packages/api/README.md +++ b/packages/api/README.md @@ -12,8 +12,8 @@ Typescript REST client for the [Ethereum Consensus API spec](https://github.com/ ## Usage ```typescript -import {getClient} from "@chainsafe/lodestar-api"; -import {config} from "@chainsafe/lodestar-config/default"; +import {getClient} from "@lodestar/api"; +import {config} from "@lodestar/config/default"; const api = getClient({ baseUrl: "http://localhost:9596", diff --git a/packages/api/package.json b/packages/api/package.json index 014c7e6ae49c..787de2879748 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-api", + "name": "@lodestar/api", "description": "A Typescript implementation of the Ethereum Consensus light client", "license": "Apache-2.0", "author": "ChainSafe Systems", @@ -69,10 +69,10 @@ "check-readme": "typescript-docs-verifier" }, "dependencies": { - "@chainsafe/lodestar-config": "^0.39.0", - "@chainsafe/lodestar-params": "^0.39.0", - "@chainsafe/lodestar-types": "^0.39.0", - "@chainsafe/lodestar-utils": "^0.39.0", + "@lodestar/config": "^0.39.0", + "@lodestar/params": "^0.39.0", + "@lodestar/types": "^0.39.0", + "@lodestar/utils": "^0.39.0", "@chainsafe/persistent-merkle-tree": "^0.4.2", "@chainsafe/ssz": "^0.9.2", "cross-fetch": "^3.1.4", diff --git a/packages/api/src/beacon/client/beacon.ts b/packages/api/src/beacon/client/beacon.ts index 43684a23130a..11f21031cad3 100644 --- a/packages/api/src/beacon/client/beacon.ts +++ b/packages/api/src/beacon/client/beacon.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReqSerializers, getReturnTypes} from "../routes/beacon/index.js"; import {IHttpClient, generateGenericJsonClient} from "../../utils/client/index.js"; diff --git a/packages/api/src/beacon/client/config.ts b/packages/api/src/beacon/client/config.ts index a277e6269241..eea401419b7a 100644 --- a/packages/api/src/beacon/client/config.ts +++ b/packages/api/src/beacon/client/config.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReqSerializers, getReturnTypes} from "../routes/config.js"; import {IHttpClient, generateGenericJsonClient} from "../../utils/client/index.js"; diff --git a/packages/api/src/beacon/client/debug.ts b/packages/api/src/beacon/client/debug.ts index 9229cfb08781..b3fff6bf1027 100644 --- a/packages/api/src/beacon/client/debug.ts +++ b/packages/api/src/beacon/client/debug.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReqSerializers, getReturnTypes, StateFormat} from "../routes/debug.js"; import {IHttpClient, getFetchOptsSerializers, generateGenericJsonClient} from "../../utils/client/index.js"; diff --git a/packages/api/src/beacon/client/events.ts b/packages/api/src/beacon/client/events.ts index 24205784a640..a2690db6d39f 100644 --- a/packages/api/src/beacon/client/events.ts +++ b/packages/api/src/beacon/client/events.ts @@ -1,5 +1,5 @@ import EventSource from "eventsource"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, BeaconEvent, routesData, getEventSerdes} from "../routes/events.js"; import {stringifyQuery} from "../../utils/client/format.js"; diff --git a/packages/api/src/beacon/client/index.ts b/packages/api/src/beacon/client/index.ts index 6510858d5b7a..9601021108be 100644 --- a/packages/api/src/beacon/client/index.ts +++ b/packages/api/src/beacon/client/index.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api} from "../routes/index.js"; import {IHttpClient, HttpClient, HttpClientOptions, HttpClientModules} from "../../utils/client/index.js"; diff --git a/packages/api/src/beacon/client/lightclient.ts b/packages/api/src/beacon/client/lightclient.ts index 7f7c7902ac47..3f99eaf3b867 100644 --- a/packages/api/src/beacon/client/lightclient.ts +++ b/packages/api/src/beacon/client/lightclient.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {deserializeProof} from "@chainsafe/persistent-merkle-tree"; import {Api, ReqTypes, routesData, getReqSerializers, getReturnTypes} from "../routes/lightclient.js"; import {IHttpClient, getFetchOptsSerializers, generateGenericJsonClient} from "../../utils/client/index.js"; diff --git a/packages/api/src/beacon/client/lodestar.ts b/packages/api/src/beacon/client/lodestar.ts index 3d73f6be5a16..55773a3ef799 100644 --- a/packages/api/src/beacon/client/lodestar.ts +++ b/packages/api/src/beacon/client/lodestar.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReqSerializers, getReturnTypes} from "../routes/lodestar.js"; import {IHttpClient, generateGenericJsonClient} from "../../utils/client/index.js"; diff --git a/packages/api/src/beacon/client/node.ts b/packages/api/src/beacon/client/node.ts index 34cff9a966b4..3bf63a73a87a 100644 --- a/packages/api/src/beacon/client/node.ts +++ b/packages/api/src/beacon/client/node.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReqSerializers, getReturnTypes} from "../routes/node.js"; import {IHttpClient, generateGenericJsonClient} from "../../utils/client/index.js"; diff --git a/packages/api/src/beacon/client/validator.ts b/packages/api/src/beacon/client/validator.ts index c187c5f93857..97524fdf80c8 100644 --- a/packages/api/src/beacon/client/validator.ts +++ b/packages/api/src/beacon/client/validator.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReqSerializers, getReturnTypes} from "../routes/validator.js"; import {IHttpClient, generateGenericJsonClient} from "../../utils/client/index.js"; diff --git a/packages/api/src/beacon/routes/beacon/block.ts b/packages/api/src/beacon/routes/beacon/block.ts index f3d637a46082..165e7c1e7344 100644 --- a/packages/api/src/beacon/routes/beacon/block.ts +++ b/packages/api/src/beacon/routes/beacon/block.ts @@ -1,7 +1,7 @@ import {ContainerType} from "@chainsafe/ssz"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {phase0, allForks, Slot, Root, ssz, bellatrix} from "@chainsafe/lodestar-types"; +import {ForkName} from "@lodestar/params"; +import {IChainForkConfig} from "@lodestar/config"; +import {phase0, allForks, Slot, Root, ssz, bellatrix} from "@lodestar/types"; import { RoutesData, diff --git a/packages/api/src/beacon/routes/beacon/index.ts b/packages/api/src/beacon/routes/beacon/index.ts index 1a561820e30e..8d4ebf7c7bee 100644 --- a/packages/api/src/beacon/routes/beacon/index.ts +++ b/packages/api/src/beacon/routes/beacon/index.ts @@ -1,5 +1,5 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {phase0, ssz} from "@lodestar/types"; import {RoutesData, ReturnTypes, reqEmpty, ContainerData} from "../../../utils/index.js"; import * as block from "./block.js"; import * as pool from "./pool.js"; diff --git a/packages/api/src/beacon/routes/beacon/pool.ts b/packages/api/src/beacon/routes/beacon/pool.ts index 214a50670b11..f9e61b836408 100644 --- a/packages/api/src/beacon/routes/beacon/pool.ts +++ b/packages/api/src/beacon/routes/beacon/pool.ts @@ -1,4 +1,4 @@ -import {phase0, altair, CommitteeIndex, Slot, ssz} from "@chainsafe/lodestar-types"; +import {phase0, altair, CommitteeIndex, Slot, ssz} from "@lodestar/types"; import { RoutesData, ReturnTypes, diff --git a/packages/api/src/beacon/routes/beacon/state.ts b/packages/api/src/beacon/routes/beacon/state.ts index 44336d4ab5c0..fbb9f97b2b92 100644 --- a/packages/api/src/beacon/routes/beacon/state.ts +++ b/packages/api/src/beacon/routes/beacon/state.ts @@ -1,5 +1,5 @@ import {ContainerType} from "@chainsafe/ssz"; -import {phase0, CommitteeIndex, Slot, ValidatorIndex, Epoch, Root, ssz, StringType} from "@chainsafe/lodestar-types"; +import {phase0, CommitteeIndex, Slot, ValidatorIndex, Epoch, Root, ssz, StringType} from "@lodestar/types"; import { RoutesData, ReturnTypes, diff --git a/packages/api/src/beacon/routes/config.ts b/packages/api/src/beacon/routes/config.ts index 3ff665b162f5..38f42f986e55 100644 --- a/packages/api/src/beacon/routes/config.ts +++ b/packages/api/src/beacon/routes/config.ts @@ -1,7 +1,7 @@ -import {BeaconPreset} from "@chainsafe/lodestar-params"; -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {Bytes32, UintNum64, phase0, ssz} from "@chainsafe/lodestar-types"; -import {mapValues} from "@chainsafe/lodestar-utils"; +import {BeaconPreset} from "@lodestar/params"; +import {IChainConfig} from "@lodestar/config"; +import {Bytes32, UintNum64, phase0, ssz} from "@lodestar/types"; +import {mapValues} from "@lodestar/utils"; import {ByteVectorType, ContainerType} from "@chainsafe/ssz"; import { ArrayOf, diff --git a/packages/api/src/beacon/routes/debug.ts b/packages/api/src/beacon/routes/debug.ts index 8bd5b48fde9d..bb4aca3d6998 100644 --- a/packages/api/src/beacon/routes/debug.ts +++ b/packages/api/src/beacon/routes/debug.ts @@ -1,5 +1,5 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {allForks, Slot, RootHex, ssz, StringType} from "@chainsafe/lodestar-types"; +import {ForkName} from "@lodestar/params"; +import {allForks, Slot, RootHex, ssz, StringType} from "@lodestar/types"; import {ContainerType} from "@chainsafe/ssz"; import { ArrayOf, diff --git a/packages/api/src/beacon/routes/events.ts b/packages/api/src/beacon/routes/events.ts index f22b34a5ff30..a6c400a3d01b 100644 --- a/packages/api/src/beacon/routes/events.ts +++ b/packages/api/src/beacon/routes/events.ts @@ -1,6 +1,6 @@ -import {Epoch, phase0, Slot, ssz, StringType, RootHex, altair, UintNum64} from "@chainsafe/lodestar-types"; +import {Epoch, phase0, Slot, ssz, StringType, RootHex, altair, UintNum64} from "@lodestar/types"; import {ContainerType, Type, VectorCompositeType} from "@chainsafe/ssz"; -import {FINALIZED_ROOT_DEPTH} from "@chainsafe/lodestar-params"; +import {FINALIZED_ROOT_DEPTH} from "@lodestar/params"; import {RouteDef, TypeJson} from "../../utils/index.js"; // See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes diff --git a/packages/api/src/beacon/routes/lightclient.ts b/packages/api/src/beacon/routes/lightclient.ts index a177757de4d3..800367756112 100644 --- a/packages/api/src/beacon/routes/lightclient.ts +++ b/packages/api/src/beacon/routes/lightclient.ts @@ -1,7 +1,7 @@ import {ContainerType, JsonPath, VectorCompositeType} from "@chainsafe/ssz"; import {Proof} from "@chainsafe/persistent-merkle-tree"; -import {FINALIZED_ROOT_DEPTH} from "@chainsafe/lodestar-params"; -import {altair, phase0, ssz, SyncPeriod} from "@chainsafe/lodestar-types"; +import {FINALIZED_ROOT_DEPTH} from "@lodestar/params"; +import {altair, phase0, ssz, SyncPeriod} from "@lodestar/types"; import { ArrayOf, ReturnTypes, diff --git a/packages/api/src/beacon/routes/lodestar.ts b/packages/api/src/beacon/routes/lodestar.ts index 76934383fb77..6d43994797ba 100644 --- a/packages/api/src/beacon/routes/lodestar.ts +++ b/packages/api/src/beacon/routes/lodestar.ts @@ -1,4 +1,4 @@ -import {Epoch, RootHex, Slot} from "@chainsafe/lodestar-types"; +import {Epoch, RootHex, Slot} from "@lodestar/types"; import { jsonType, ReqEmpty, diff --git a/packages/api/src/beacon/routes/node.ts b/packages/api/src/beacon/routes/node.ts index 03ef481c866f..3091a4098250 100644 --- a/packages/api/src/beacon/routes/node.ts +++ b/packages/api/src/beacon/routes/node.ts @@ -1,4 +1,4 @@ -import {allForks, ssz, StringType} from "@chainsafe/lodestar-types"; +import {allForks, ssz, StringType} from "@lodestar/types"; import {ContainerType} from "@chainsafe/ssz"; import { ArrayOf, diff --git a/packages/api/src/beacon/routes/validator.ts b/packages/api/src/beacon/routes/validator.ts index 2cbd3b47d63c..89dfa8cf5600 100644 --- a/packages/api/src/beacon/routes/validator.ts +++ b/packages/api/src/beacon/routes/validator.ts @@ -1,5 +1,5 @@ import {ContainerType, fromHexString, toHexString, Type} from "@chainsafe/ssz"; -import {ForkName} from "@chainsafe/lodestar-params"; +import {ForkName} from "@lodestar/params"; import { allForks, altair, @@ -14,7 +14,7 @@ import { ssz, UintNum64, ValidatorIndex, -} from "@chainsafe/lodestar-types"; +} from "@lodestar/types"; import { RoutesData, ReturnTypes, diff --git a/packages/api/src/beacon/server/beacon.ts b/packages/api/src/beacon/server/beacon.ts index 487f567cda6d..5ecb7513e423 100644 --- a/packages/api/src/beacon/server/beacon.ts +++ b/packages/api/src/beacon/server/beacon.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReturnTypes, getReqSerializers} from "../routes/beacon/index.js"; import {ServerRoutes, getGenericJsonServer} from "../../utils/server/index.js"; diff --git a/packages/api/src/beacon/server/config.ts b/packages/api/src/beacon/server/config.ts index 8260bd0c6697..cdbf992c699e 100644 --- a/packages/api/src/beacon/server/config.ts +++ b/packages/api/src/beacon/server/config.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReturnTypes, getReqSerializers} from "../routes/config.js"; import {ServerRoutes, getGenericJsonServer} from "../../utils/server/index.js"; diff --git a/packages/api/src/beacon/server/debug.ts b/packages/api/src/beacon/server/debug.ts index 9c15f5ffd296..165e4469a8b8 100644 --- a/packages/api/src/beacon/server/debug.ts +++ b/packages/api/src/beacon/server/debug.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReturnTypes, getReqSerializers} from "../routes/debug.js"; import {ServerRoutes, getGenericJsonServer} from "../../utils/server/index.js"; diff --git a/packages/api/src/beacon/server/events.ts b/packages/api/src/beacon/server/events.ts index 787984077390..20d2df2839f9 100644 --- a/packages/api/src/beacon/server/events.ts +++ b/packages/api/src/beacon/server/events.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getEventSerdes} from "../routes/events.js"; import {ServerRoutes} from "../../utils/server/index.js"; diff --git a/packages/api/src/beacon/server/index.ts b/packages/api/src/beacon/server/index.ts index ded4f602b87f..c768d17b2515 100644 --- a/packages/api/src/beacon/server/index.ts +++ b/packages/api/src/beacon/server/index.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api} from "../routes/index.js"; import {ServerInstance, ServerRoute, RouteConfig, registerRoute} from "../../utils/server/index.js"; diff --git a/packages/api/src/beacon/server/lightclient.ts b/packages/api/src/beacon/server/lightclient.ts index df04f88e1a22..92b4a7bc2798 100644 --- a/packages/api/src/beacon/server/lightclient.ts +++ b/packages/api/src/beacon/server/lightclient.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {serializeProof} from "@chainsafe/persistent-merkle-tree"; import {Api, ReqTypes, routesData, getReturnTypes, getReqSerializers} from "../routes/lightclient.js"; import {ServerRoutes, getGenericJsonServer} from "../../utils/server/index.js"; diff --git a/packages/api/src/beacon/server/lodestar.ts b/packages/api/src/beacon/server/lodestar.ts index eef9154ceaaf..1c649c088c48 100644 --- a/packages/api/src/beacon/server/lodestar.ts +++ b/packages/api/src/beacon/server/lodestar.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReturnTypes, getReqSerializers} from "../routes/lodestar.js"; import {ServerRoutes, getGenericJsonServer} from "../../utils/server/index.js"; diff --git a/packages/api/src/beacon/server/node.ts b/packages/api/src/beacon/server/node.ts index 34cdf5623d57..7805cc46f9b8 100644 --- a/packages/api/src/beacon/server/node.ts +++ b/packages/api/src/beacon/server/node.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReturnTypes, getReqSerializers} from "../routes/node.js"; import {ServerRoutes, getGenericJsonServer} from "../../utils/server/index.js"; diff --git a/packages/api/src/beacon/server/validator.ts b/packages/api/src/beacon/server/validator.ts index 795530346f6a..246e4dc519b7 100644 --- a/packages/api/src/beacon/server/validator.ts +++ b/packages/api/src/beacon/server/validator.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Api, ReqTypes, routesData, getReturnTypes, getReqSerializers} from "../routes/validator.js"; import {ServerRoutes, getGenericJsonServer} from "../../utils/server/index.js"; diff --git a/packages/api/src/builder/client.ts b/packages/api/src/builder/client.ts index a5368722539a..92d230592271 100644 --- a/packages/api/src/builder/client.ts +++ b/packages/api/src/builder/client.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {IHttpClient, generateGenericJsonClient} from "../utils/client/index.js"; import {Api, ReqTypes, routesData, getReqSerializers, getReturnTypes} from "./routes.js"; diff --git a/packages/api/src/builder/index.ts b/packages/api/src/builder/index.ts index 82108ed3d060..f97d76d84c5a 100644 --- a/packages/api/src/builder/index.ts +++ b/packages/api/src/builder/index.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {HttpClient, HttpClientModules, HttpClientOptions, IHttpClient} from "../utils/client/httpClient.js"; import {Api} from "./routes.js"; import * as builder from "./client.js"; diff --git a/packages/api/src/builder/routes.ts b/packages/api/src/builder/routes.ts index 8568d1732c3a..1236c7288838 100644 --- a/packages/api/src/builder/routes.ts +++ b/packages/api/src/builder/routes.ts @@ -1,4 +1,4 @@ -import {ssz, bellatrix, Slot, Root, BLSPubkey} from "@chainsafe/lodestar-types"; +import {ssz, bellatrix, Slot, Root, BLSPubkey} from "@lodestar/types"; import {fromHexString, toHexString} from "@chainsafe/ssz"; import { ReturnTypes, diff --git a/packages/api/src/builder/server/index.ts b/packages/api/src/builder/server/index.ts index b73866fb7a57..2e2530502c4d 100644 --- a/packages/api/src/builder/server/index.ts +++ b/packages/api/src/builder/server/index.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import { ServerInstance, ServerRoutes, diff --git a/packages/api/src/keymanager/client.ts b/packages/api/src/keymanager/client.ts index 923ff7dda515..00c0c882ed92 100644 --- a/packages/api/src/keymanager/client.ts +++ b/packages/api/src/keymanager/client.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {IHttpClient, generateGenericJsonClient} from "../utils/client/index.js"; import {Api, ReqTypes, routesData, getReqSerializers, getReturnTypes} from "./routes.js"; diff --git a/packages/api/src/keymanager/index.ts b/packages/api/src/keymanager/index.ts index 5532ed246cdd..a8217d03653e 100644 --- a/packages/api/src/keymanager/index.ts +++ b/packages/api/src/keymanager/index.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {} from "../beacon/client/index.js"; import {IHttpClient, HttpClient, HttpClientModules, HttpClientOptions} from "../utils/client/index.js"; import {Api} from "./routes.js"; diff --git a/packages/api/src/keymanager/server/index.ts b/packages/api/src/keymanager/server/index.ts index b73866fb7a57..2e2530502c4d 100644 --- a/packages/api/src/keymanager/server/index.ts +++ b/packages/api/src/keymanager/server/index.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import { ServerInstance, ServerRoutes, diff --git a/packages/api/src/utils/client/client.ts b/packages/api/src/utils/client/client.ts index 026960f6ef0a..b4f96fe75cc1 100644 --- a/packages/api/src/utils/client/client.ts +++ b/packages/api/src/utils/client/client.ts @@ -1,4 +1,4 @@ -import {mapValues} from "@chainsafe/lodestar-utils"; +import {mapValues} from "@lodestar/utils"; import {compileRouteUrlFormater} from "../urlFormat.js"; import { RouteDef, diff --git a/packages/api/src/utils/client/httpClient.ts b/packages/api/src/utils/client/httpClient.ts index f7aef8c7bd32..ce857ae8a3ff 100644 --- a/packages/api/src/utils/client/httpClient.ts +++ b/packages/api/src/utils/client/httpClient.ts @@ -1,5 +1,5 @@ import {fetch} from "cross-fetch"; -import {ErrorAborted, ILogger, TimeoutError} from "@chainsafe/lodestar-utils"; +import {ErrorAborted, ILogger, TimeoutError} from "@lodestar/utils"; import {ReqGeneric, RouteDef} from "../index.js"; import {stringifyQuery, urlJoin} from "./format.js"; import {Metrics} from "./metrics.js"; diff --git a/packages/api/src/utils/server/genericJsonServer.ts b/packages/api/src/utils/server/genericJsonServer.ts index 96864b73150b..1cb240e65da7 100644 --- a/packages/api/src/utils/server/genericJsonServer.ts +++ b/packages/api/src/utils/server/genericJsonServer.ts @@ -1,6 +1,6 @@ -import {mapValues} from "@chainsafe/lodestar-utils"; +import {mapValues} from "@lodestar/utils"; // eslint-disable-next-line import/no-extraneous-dependencies -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {ReqGeneric, RouteGeneric, ReturnTypes, TypeJson, Resolves, RouteGroupDefinition} from "../types.js"; import {getFastifySchema} from "../schema.js"; import {ServerRoute} from "./types.js"; diff --git a/packages/api/src/utils/types.ts b/packages/api/src/utils/types.ts index b8c3b15b8907..fb072a3aabc6 100644 --- a/packages/api/src/utils/types.ts +++ b/packages/api/src/utils/types.ts @@ -1,7 +1,7 @@ import {isBasicType, ListBasicType, Type, isCompositeType, ListCompositeType, ArrayType} from "@chainsafe/ssz"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {objectToExpectedCase} from "@chainsafe/lodestar-utils"; +import {ForkName} from "@lodestar/params"; +import {IChainForkConfig} from "@lodestar/config"; +import {objectToExpectedCase} from "@lodestar/utils"; import {Schema, SchemaDefinition} from "./schema.js"; // See /packages/api/src/routes/index.ts for reasoning diff --git a/packages/api/test/unit/beacon/beacon.test.ts b/packages/api/test/unit/beacon/beacon.test.ts index b678606375f6..b053781d3365 100644 --- a/packages/api/test/unit/beacon/beacon.test.ts +++ b/packages/api/test/unit/beacon/beacon.test.ts @@ -1,6 +1,6 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; -import {config} from "@chainsafe/lodestar-config/default"; +import {ForkName} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; +import {config} from "@lodestar/config/default"; import {toHexString} from "@chainsafe/ssz"; import {Api, ReqTypes, BlockHeaderResponse, ValidatorResponse} from "../../../src/beacon/routes/beacon/index.js"; import {getClient} from "../../../src/beacon/client/beacon.js"; diff --git a/packages/api/test/unit/beacon/config.test.ts b/packages/api/test/unit/beacon/config.test.ts index c30996c00cad..81e673346d7b 100644 --- a/packages/api/test/unit/beacon/config.test.ts +++ b/packages/api/test/unit/beacon/config.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {ssz} from "@chainsafe/lodestar-types"; -import {chainConfigToJson} from "@chainsafe/lodestar-config"; -import {config, chainConfig} from "@chainsafe/lodestar-config/default"; -import {activePreset, presetToJson} from "@chainsafe/lodestar-params"; +import {ssz} from "@lodestar/types"; +import {chainConfigToJson} from "@lodestar/config"; +import {config, chainConfig} from "@lodestar/config/default"; +import {activePreset, presetToJson} from "@lodestar/params"; import {Api, ReqTypes, getReturnTypes} from "../../../src/beacon/routes/config.js"; import {getClient} from "../../../src/beacon/client/config.js"; import {getRoutes} from "../../../src/beacon/server/config.js"; diff --git a/packages/api/test/unit/beacon/debug.test.ts b/packages/api/test/unit/beacon/debug.test.ts index 33e3a152fec2..4ef41bb56715 100644 --- a/packages/api/test/unit/beacon/debug.test.ts +++ b/packages/api/test/unit/beacon/debug.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ForkName} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import {Api, ReqTypes, routesData} from "../../../src/beacon/routes/debug.js"; import {getClient} from "../../../src/beacon/client/debug.js"; import {getRoutes} from "../../../src/beacon/server/debug.js"; diff --git a/packages/api/test/unit/beacon/events.test.ts b/packages/api/test/unit/beacon/events.test.ts index 4b6fb4614e17..53d7872f040e 100644 --- a/packages/api/test/unit/beacon/events.test.ts +++ b/packages/api/test/unit/beacon/events.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {sleep} from "@chainsafe/lodestar-utils"; -import {config} from "@chainsafe/lodestar-config/default"; +import {sleep} from "@lodestar/utils"; +import {config} from "@lodestar/config/default"; import {Api, routesData, EventType, BeaconEvent} from "../../../src/beacon/routes/events.js"; import {getClient} from "../../../src/beacon/client/events.js"; import {getRoutes} from "../../../src/beacon/server/events.js"; diff --git a/packages/api/test/unit/beacon/lightclient.test.ts b/packages/api/test/unit/beacon/lightclient.test.ts index 5b495574b7b9..683c0ca7ca6e 100644 --- a/packages/api/test/unit/beacon/lightclient.test.ts +++ b/packages/api/test/unit/beacon/lightclient.test.ts @@ -1,5 +1,5 @@ -import {ssz} from "@chainsafe/lodestar-types"; -import {config} from "@chainsafe/lodestar-config/default"; +import {ssz} from "@lodestar/types"; +import {config} from "@lodestar/config/default"; import {ProofType} from "@chainsafe/persistent-merkle-tree"; import {toHexString} from "@chainsafe/ssz"; import {Api, ReqTypes} from "../../../src/beacon/routes/lightclient.js"; diff --git a/packages/api/test/unit/beacon/node.test.ts b/packages/api/test/unit/beacon/node.test.ts index 0a4a67262837..2a1508e34541 100644 --- a/packages/api/test/unit/beacon/node.test.ts +++ b/packages/api/test/unit/beacon/node.test.ts @@ -1,5 +1,5 @@ -import {ssz} from "@chainsafe/lodestar-types"; -import {config} from "@chainsafe/lodestar-config/default"; +import {ssz} from "@lodestar/types"; +import {config} from "@lodestar/config/default"; import {Api, ReqTypes, NodePeer} from "../../../src/beacon/routes/node.js"; import {getClient} from "../../../src/beacon/client/node.js"; import {getRoutes} from "../../../src/beacon/server/node.js"; diff --git a/packages/api/test/unit/beacon/validator.test.ts b/packages/api/test/unit/beacon/validator.test.ts index 295075272b87..cfc3618c74ad 100644 --- a/packages/api/test/unit/beacon/validator.test.ts +++ b/packages/api/test/unit/beacon/validator.test.ts @@ -1,6 +1,6 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; -import {config} from "@chainsafe/lodestar-config/default"; +import {ForkName} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; +import {config} from "@lodestar/config/default"; import {Api, ReqTypes} from "../../../src/beacon/routes/validator.js"; import {getClient} from "../../../src/beacon/client/validator.js"; import {getRoutes} from "../../../src/beacon/server/validator.js"; diff --git a/packages/api/test/unit/builder/builder.test.ts b/packages/api/test/unit/builder/builder.test.ts index e39508384766..3d230ac169fb 100644 --- a/packages/api/test/unit/builder/builder.test.ts +++ b/packages/api/test/unit/builder/builder.test.ts @@ -1,5 +1,5 @@ -import {config} from "@chainsafe/lodestar-config/default"; -import {ssz} from "@chainsafe/lodestar-types"; +import {config} from "@lodestar/config/default"; +import {ssz} from "@lodestar/types"; import {fromHexString} from "@chainsafe/ssz"; import {Api, ReqTypes} from "../../../src/builder/routes.js"; diff --git a/packages/api/test/unit/client/httpClient.test.ts b/packages/api/test/unit/client/httpClient.test.ts index 147140b22879..d39def72bea1 100644 --- a/packages/api/test/unit/client/httpClient.test.ts +++ b/packages/api/test/unit/client/httpClient.test.ts @@ -2,7 +2,7 @@ import {IncomingMessage} from "node:http"; import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; import fastify, {RouteOptions} from "fastify"; -import {ErrorAborted, TimeoutError} from "@chainsafe/lodestar-utils"; +import {ErrorAborted, TimeoutError} from "@lodestar/utils"; import {HttpClient, HttpError} from "../../../src/utils/client/index.js"; chai.use(chaiAsPromised); diff --git a/packages/api/test/unit/keymanager/keymanager.test.ts b/packages/api/test/unit/keymanager/keymanager.test.ts index 92c9d0a6f943..4d653aa6f638 100644 --- a/packages/api/test/unit/keymanager/keymanager.test.ts +++ b/packages/api/test/unit/keymanager/keymanager.test.ts @@ -1,4 +1,4 @@ -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import { Api, DeleteRemoteKeyStatus, diff --git a/packages/api/test/utils/genericServerTest.ts b/packages/api/test/utils/genericServerTest.ts index 67b9dae81495..9bf9a83c8a11 100644 --- a/packages/api/test/utils/genericServerTest.ts +++ b/packages/api/test/utils/genericServerTest.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {RouteGeneric, ReqGeneric, Resolves} from "../../src/utils/index.js"; import {FetchOpts, HttpClient, IHttpClient} from "../../src/utils/client/index.js"; import {ServerRoutes} from "../../src/utils/server/genericJsonServer.js"; diff --git a/packages/api/test/utils/utils.ts b/packages/api/test/utils/utils.ts index 05fbc5508f6b..99b4993a5b3c 100644 --- a/packages/api/test/utils/utils.ts +++ b/packages/api/test/utils/utils.ts @@ -1,7 +1,7 @@ import querystring from "querystring"; import fastify, {FastifyInstance} from "fastify"; import Sinon from "sinon"; -import {mapValues} from "@chainsafe/lodestar-utils"; +import {mapValues} from "@lodestar/utils"; export function getTestServer(): {baseUrl: string; server: FastifyInstance} { const port = Math.floor(Math.random() * (65535 - 49152)) + 49152; diff --git a/packages/lodestar/.babel-register b/packages/beacon-node/.babel-register similarity index 100% rename from packages/lodestar/.babel-register rename to packages/beacon-node/.babel-register diff --git a/packages/lodestar/.gitignore b/packages/beacon-node/.gitignore similarity index 100% rename from packages/lodestar/.gitignore rename to packages/beacon-node/.gitignore diff --git a/packages/lodestar/.mocharc.spec.cjs b/packages/beacon-node/.mocharc.spec.cjs similarity index 100% rename from packages/lodestar/.mocharc.spec.cjs rename to packages/beacon-node/.mocharc.spec.cjs diff --git a/packages/lodestar/.mocharc.yml b/packages/beacon-node/.mocharc.yml similarity index 100% rename from packages/lodestar/.mocharc.yml rename to packages/beacon-node/.mocharc.yml diff --git a/packages/lodestar/.nycrc.json b/packages/beacon-node/.nycrc.json similarity index 100% rename from packages/lodestar/.nycrc.json rename to packages/beacon-node/.nycrc.json diff --git a/packages/beacon-state-transition/LICENSE b/packages/beacon-node/LICENSE similarity index 100% rename from packages/beacon-state-transition/LICENSE rename to packages/beacon-node/LICENSE diff --git a/packages/lodestar/README.md b/packages/beacon-node/README.md similarity index 100% rename from packages/lodestar/README.md rename to packages/beacon-node/README.md diff --git a/packages/lodestar/package.json b/packages/beacon-node/package.json similarity index 91% rename from packages/lodestar/package.json rename to packages/beacon-node/package.json index d3070390d2cc..c4e8b87642cd 100644 --- a/packages/lodestar/package.json +++ b/packages/beacon-node/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar", + "name": "@lodestar/beacon-node", "description": "A Typescript implementation of the beacon chain", "license": "LGPL-3.0", "author": "ChainSafe Systems", @@ -104,16 +104,16 @@ "@chainsafe/bls": "7.1.1", "@chainsafe/discv5": "^0.7.1", "@chainsafe/libp2p-noise": "5.0.3", - "@chainsafe/lodestar-api": "^0.39.0", - "@chainsafe/lodestar-beacon-state-transition": "^0.39.0", - "@chainsafe/lodestar-config": "^0.39.0", - "@chainsafe/lodestar-db": "^0.39.0", - "@chainsafe/lodestar-fork-choice": "^0.39.0", - "@chainsafe/lodestar-light-client": "^0.39.0", - "@chainsafe/lodestar-params": "^0.39.0", - "@chainsafe/lodestar-types": "^0.39.0", - "@chainsafe/lodestar-utils": "^0.39.0", - "@chainsafe/lodestar-validator": "^0.39.0", + "@lodestar/api": "^0.39.0", + "@lodestar/state-transition": "^0.39.0", + "@lodestar/config": "^0.39.0", + "@lodestar/db": "^0.39.0", + "@lodestar/fork-choice": "^0.39.0", + "@lodestar/light-client": "^0.39.0", + "@lodestar/params": "^0.39.0", + "@lodestar/types": "^0.39.0", + "@lodestar/utils": "^0.39.0", + "@lodestar/validator": "^0.39.0", "@chainsafe/persistent-merkle-tree": "^0.4.2", "@chainsafe/snappy-stream": "5.1.1", "@chainsafe/ssz": "^0.9.2", diff --git a/packages/lodestar/src/.gitignore b/packages/beacon-node/src/.gitignore similarity index 100% rename from packages/lodestar/src/.gitignore rename to packages/beacon-node/src/.gitignore diff --git a/packages/lodestar/src/api/impl/api.ts b/packages/beacon-node/src/api/impl/api.ts similarity index 95% rename from packages/lodestar/src/api/impl/api.ts rename to packages/beacon-node/src/api/impl/api.ts index a5a2fe5681d5..ff5872c29cb0 100644 --- a/packages/lodestar/src/api/impl/api.ts +++ b/packages/beacon-node/src/api/impl/api.ts @@ -1,4 +1,4 @@ -import {Api} from "@chainsafe/lodestar-api"; +import {Api} from "@lodestar/api"; import {IApiOptions} from "../options.js"; import {ApiModules} from "./types.js"; import {getBeaconApi} from "./beacon/index.js"; diff --git a/packages/lodestar/src/api/impl/beacon/blocks/index.ts b/packages/beacon-node/src/api/impl/beacon/blocks/index.ts similarity index 96% rename from packages/lodestar/src/api/impl/beacon/blocks/index.ts rename to packages/beacon-node/src/api/impl/beacon/blocks/index.ts index d504eed95aef..ff80df54491c 100644 --- a/packages/lodestar/src/api/impl/beacon/blocks/index.ts +++ b/packages/beacon-node/src/api/impl/beacon/blocks/index.ts @@ -1,8 +1,8 @@ -import {routes} from "@chainsafe/lodestar-api"; +import {routes} from "@lodestar/api"; -import {computeTimeAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {SLOTS_PER_HISTORICAL_ROOT} from "@chainsafe/lodestar-params"; -import {sleep} from "@chainsafe/lodestar-utils"; +import {computeTimeAtSlot} from "@lodestar/state-transition"; +import {SLOTS_PER_HISTORICAL_ROOT} from "@lodestar/params"; +import {sleep} from "@lodestar/utils"; import {fromHexString, toHexString} from "@chainsafe/ssz"; import {BlockError, BlockErrorCode} from "../../../../chain/errors/index.js"; import {OpSource} from "../../../../metrics/validatorMonitor.js"; diff --git a/packages/lodestar/src/api/impl/beacon/blocks/utils.ts b/packages/beacon-node/src/api/impl/beacon/blocks/utils.ts similarity index 90% rename from packages/lodestar/src/api/impl/beacon/blocks/utils.ts rename to packages/beacon-node/src/api/impl/beacon/blocks/utils.ts index 6ac6fcf0443c..b564af1c9461 100644 --- a/packages/lodestar/src/api/impl/beacon/blocks/utils.ts +++ b/packages/beacon-node/src/api/impl/beacon/blocks/utils.ts @@ -1,8 +1,8 @@ -import {allForks} from "@chainsafe/lodestar-types"; -import {routes} from "@chainsafe/lodestar-api"; -import {blockToHeader} from "@chainsafe/lodestar-beacon-state-transition"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {IForkChoice} from "@chainsafe/lodestar-fork-choice"; +import {allForks} from "@lodestar/types"; +import {routes} from "@lodestar/api"; +import {blockToHeader} from "@lodestar/state-transition"; +import {IChainForkConfig} from "@lodestar/config"; +import {IForkChoice} from "@lodestar/fork-choice"; import {fromHexString} from "@chainsafe/ssz"; import {IBeaconDb} from "../../../../db/index.js"; import {GENESIS_SLOT} from "../../../../constants/index.js"; diff --git a/packages/lodestar/src/api/impl/beacon/index.ts b/packages/beacon-node/src/api/impl/beacon/index.ts similarity index 89% rename from packages/lodestar/src/api/impl/beacon/index.ts rename to packages/beacon-node/src/api/impl/beacon/index.ts index 34b9d1da8ebe..6170d7657e44 100644 --- a/packages/lodestar/src/api/impl/beacon/index.ts +++ b/packages/beacon-node/src/api/impl/beacon/index.ts @@ -1,5 +1,5 @@ -import {routes} from "@chainsafe/lodestar-api"; -import {GENESIS_SLOT} from "@chainsafe/lodestar-params"; +import {routes} from "@lodestar/api"; +import {GENESIS_SLOT} from "@lodestar/params"; import {ApiModules} from "../types.js"; import {getBeaconBlockApi} from "./blocks/index.js"; import {getBeaconPoolApi} from "./pool/index.js"; diff --git a/packages/lodestar/src/api/impl/beacon/pool/index.ts b/packages/beacon-node/src/api/impl/beacon/pool/index.ts similarity index 97% rename from packages/lodestar/src/api/impl/beacon/pool/index.ts rename to packages/beacon-node/src/api/impl/beacon/pool/index.ts index 8d5d5c0c8ff1..108a73437a9c 100644 --- a/packages/lodestar/src/api/impl/beacon/pool/index.ts +++ b/packages/beacon-node/src/api/impl/beacon/pool/index.ts @@ -1,6 +1,6 @@ -import {routes} from "@chainsafe/lodestar-api"; -import {Epoch, ssz} from "@chainsafe/lodestar-types"; -import {SYNC_COMMITTEE_SUBNET_SIZE} from "@chainsafe/lodestar-params"; +import {routes} from "@lodestar/api"; +import {Epoch, ssz} from "@lodestar/types"; +import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; import {validateGossipAttestation} from "../../../../chain/validation/index.js"; import {validateGossipAttesterSlashing} from "../../../../chain/validation/attesterSlashing.js"; import {validateGossipProposerSlashing} from "../../../../chain/validation/proposerSlashing.js"; diff --git a/packages/lodestar/src/api/impl/beacon/state/index.ts b/packages/beacon-node/src/api/impl/beacon/state/index.ts similarity index 98% rename from packages/lodestar/src/api/impl/beacon/state/index.ts rename to packages/beacon-node/src/api/impl/beacon/state/index.ts index 841b49dc6a62..b50b94870999 100644 --- a/packages/lodestar/src/api/impl/beacon/state/index.ts +++ b/packages/beacon-node/src/api/impl/beacon/state/index.ts @@ -1,10 +1,10 @@ -import {routes} from "@chainsafe/lodestar-api"; +import {routes} from "@lodestar/api"; import { BeaconStateAllForks, CachedBeaconStateAltair, computeEpochAtSlot, getCurrentEpoch, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import {ApiError} from "../../errors.js"; import {ApiModules} from "../../types.js"; import { diff --git a/packages/lodestar/src/api/impl/beacon/state/utils.ts b/packages/beacon-node/src/api/impl/beacon/state/utils.ts similarity index 93% rename from packages/lodestar/src/api/impl/beacon/state/utils.ts rename to packages/beacon-node/src/api/impl/beacon/state/utils.ts index cb28b62d19dc..fe1250a37b52 100644 --- a/packages/lodestar/src/api/impl/beacon/state/utils.ts +++ b/packages/beacon-node/src/api/impl/beacon/state/utils.ts @@ -1,5 +1,5 @@ -import {routes} from "@chainsafe/lodestar-api"; -import {FAR_FUTURE_EPOCH, GENESIS_SLOT, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {routes} from "@lodestar/api"; +import {FAR_FUTURE_EPOCH, GENESIS_SLOT, SLOTS_PER_EPOCH} from "@lodestar/params"; // this will need async once we wan't to resolve archive slot import { CachedBeaconStateAllForks, @@ -7,14 +7,14 @@ import { createCachedBeaconState, createEmptyEpochContextImmutableData, PubkeyIndexMap, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {BLSPubkey, phase0} from "@chainsafe/lodestar-types"; -import {stateTransition, processSlots} from "@chainsafe/lodestar-beacon-state-transition"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {IForkChoice} from "@chainsafe/lodestar-fork-choice"; -import {Epoch, ValidatorIndex, Slot} from "@chainsafe/lodestar-types"; +} from "@lodestar/state-transition"; +import {BLSPubkey, phase0} from "@lodestar/types"; +import {stateTransition, processSlots} from "@lodestar/state-transition"; +import {IChainForkConfig} from "@lodestar/config"; +import {IForkChoice} from "@lodestar/fork-choice"; +import {Epoch, ValidatorIndex, Slot} from "@lodestar/types"; import {fromHexString} from "@chainsafe/ssz"; -import {sleep, assert} from "@chainsafe/lodestar-utils"; +import {sleep, assert} from "@lodestar/utils"; import {IBeaconChain} from "../../../../chain/index.js"; import {StateContextCache} from "../../../../chain/stateCache/index.js"; import {IBeaconDb} from "../../../../db/index.js"; diff --git a/packages/lodestar/src/api/impl/config/index.ts b/packages/beacon-node/src/api/impl/config/index.ts similarity index 86% rename from packages/lodestar/src/api/impl/config/index.ts rename to packages/beacon-node/src/api/impl/config/index.ts index fb399911516a..82e2765e0c00 100644 --- a/packages/lodestar/src/api/impl/config/index.ts +++ b/packages/beacon-node/src/api/impl/config/index.ts @@ -1,6 +1,6 @@ -import {routes} from "@chainsafe/lodestar-api"; -import {chainConfigToJson} from "@chainsafe/lodestar-config"; -import {activePreset, presetToJson} from "@chainsafe/lodestar-params"; +import {routes} from "@lodestar/api"; +import {chainConfigToJson} from "@lodestar/config"; +import {activePreset, presetToJson} from "@lodestar/params"; import {ApiModules} from "../types.js"; export function getConfigApi({config}: Pick): routes.config.Api { @@ -15,7 +15,7 @@ export function getConfigApi({config}: Pick): routes.confi let jsonSpec: Record | null = null; function getJsonSpec(): Record { - // TODO: Include static constants exported in @chainsafe/lodestar-params (i.e. DOMAIN_BEACON_PROPOSER) + // TODO: Include static constants exported in @lodestar/params (i.e. DOMAIN_BEACON_PROPOSER) const configJson = chainConfigToJson(config); const presetJson = presetToJson(activePreset); jsonSpec = {...configJson, ...presetJson}; diff --git a/packages/lodestar/src/api/impl/debug/index.ts b/packages/beacon-node/src/api/impl/debug/index.ts similarity index 97% rename from packages/lodestar/src/api/impl/debug/index.ts rename to packages/beacon-node/src/api/impl/debug/index.ts index 9ac6da810e74..c1b1ffac5449 100644 --- a/packages/lodestar/src/api/impl/debug/index.ts +++ b/packages/beacon-node/src/api/impl/debug/index.ts @@ -1,6 +1,6 @@ import {Multiaddr} from "multiaddr"; import {createFromB58String} from "peer-id"; -import {routes} from "@chainsafe/lodestar-api"; +import {routes} from "@lodestar/api"; import {resolveStateId} from "../beacon/state/utils.js"; import {ApiModules} from "../types.js"; diff --git a/packages/lodestar/src/api/impl/errors.ts b/packages/beacon-node/src/api/impl/errors.ts similarity index 100% rename from packages/lodestar/src/api/impl/errors.ts rename to packages/beacon-node/src/api/impl/errors.ts diff --git a/packages/lodestar/src/api/impl/events/index.ts b/packages/beacon-node/src/api/impl/events/index.ts similarity index 96% rename from packages/lodestar/src/api/impl/events/index.ts rename to packages/beacon-node/src/api/impl/events/index.ts index cd5ac456699d..7debc0b4dc7e 100644 --- a/packages/lodestar/src/api/impl/events/index.ts +++ b/packages/beacon-node/src/api/impl/events/index.ts @@ -1,9 +1,5 @@ -import { - computeEpochAtSlot, - computeStartSlotAtEpoch, - getBlockRootAtSlot, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {routes} from "@chainsafe/lodestar-api"; +import {computeEpochAtSlot, computeStartSlotAtEpoch, getBlockRootAtSlot} from "@lodestar/state-transition"; +import {routes} from "@lodestar/api"; import {toHexString} from "@chainsafe/ssz"; import {ApiModules} from "../types.js"; import {ChainEvent, IChainEvents} from "../../../chain/index.js"; diff --git a/packages/lodestar/src/api/impl/index.ts b/packages/beacon-node/src/api/impl/index.ts similarity index 100% rename from packages/lodestar/src/api/impl/index.ts rename to packages/beacon-node/src/api/impl/index.ts diff --git a/packages/lodestar/src/api/impl/lightclient/index.ts b/packages/beacon-node/src/api/impl/lightclient/index.ts similarity index 97% rename from packages/lodestar/src/api/impl/lightclient/index.ts rename to packages/beacon-node/src/api/impl/lightclient/index.ts index 1e2a873e9fae..f5ad48435c81 100644 --- a/packages/lodestar/src/api/impl/lightclient/index.ts +++ b/packages/beacon-node/src/api/impl/lightclient/index.ts @@ -1,4 +1,4 @@ -import {routes} from "@chainsafe/lodestar-api"; +import {routes} from "@lodestar/api"; import {fromHexString} from "@chainsafe/ssz"; import {ProofType, Tree} from "@chainsafe/persistent-merkle-tree"; import {ApiModules} from "../types.js"; diff --git a/packages/lodestar/src/api/impl/lodestar/index.ts b/packages/beacon-node/src/api/impl/lodestar/index.ts similarity index 95% rename from packages/lodestar/src/api/impl/lodestar/index.ts rename to packages/beacon-node/src/api/impl/lodestar/index.ts index c900363e64d3..5e2679d877ca 100644 --- a/packages/lodestar/src/api/impl/lodestar/index.ts +++ b/packages/beacon-node/src/api/impl/lodestar/index.ts @@ -1,10 +1,10 @@ import PeerId from "peer-id"; import {Multiaddr} from "multiaddr"; -import {routes} from "@chainsafe/lodestar-api"; -import {getLatestWeakSubjectivityCheckpointEpoch} from "@chainsafe/lodestar-beacon-state-transition"; +import {routes} from "@lodestar/api"; +import {getLatestWeakSubjectivityCheckpointEpoch} from "@lodestar/state-transition"; import {toHexString} from "@chainsafe/ssz"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ssz} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {ssz} from "@lodestar/types"; import {BeaconChain} from "../../../chain/index.js"; import {QueuedStateRegenerator, RegenRequest} from "../../../chain/regen/index.js"; import {GossipType} from "../../../network/index.js"; diff --git a/packages/lodestar/src/api/impl/node/index.ts b/packages/beacon-node/src/api/impl/node/index.ts similarity index 98% rename from packages/lodestar/src/api/impl/node/index.ts rename to packages/beacon-node/src/api/impl/node/index.ts index 43466da9bed2..828f80e5c0dd 100644 --- a/packages/lodestar/src/api/impl/node/index.ts +++ b/packages/beacon-node/src/api/impl/node/index.ts @@ -1,4 +1,4 @@ -import {routes} from "@chainsafe/lodestar-api"; +import {routes} from "@lodestar/api"; import {createKeypairFromPeerId} from "@chainsafe/discv5"; import {ApiError} from "../errors.js"; import {ApiModules} from "../types.js"; diff --git a/packages/lodestar/src/api/impl/node/utils.ts b/packages/beacon-node/src/api/impl/node/utils.ts similarity index 97% rename from packages/lodestar/src/api/impl/node/utils.ts rename to packages/beacon-node/src/api/impl/node/utils.ts index 1308658f915b..b9ea0c199bfd 100644 --- a/packages/lodestar/src/api/impl/node/utils.ts +++ b/packages/beacon-node/src/api/impl/node/utils.ts @@ -1,5 +1,5 @@ import {Connection} from "libp2p"; -import {routes} from "@chainsafe/lodestar-api"; +import {routes} from "@lodestar/api"; import {PeerStatus} from "../../../network/index.js"; /** diff --git a/packages/lodestar/src/api/impl/types.ts b/packages/beacon-node/src/api/impl/types.ts similarity index 79% rename from packages/lodestar/src/api/impl/types.ts rename to packages/beacon-node/src/api/impl/types.ts index 334f0b0f46dc..fed1191d5f04 100644 --- a/packages/lodestar/src/api/impl/types.ts +++ b/packages/beacon-node/src/api/impl/types.ts @@ -1,5 +1,5 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {IChainForkConfig} from "@lodestar/config"; +import {ILogger} from "@lodestar/utils"; import {IBeaconChain} from "../../chain/index.js"; import {IBeaconDb} from "../../db/index.js"; diff --git a/packages/lodestar/src/api/impl/validator/index.ts b/packages/beacon-node/src/api/impl/validator/index.ts similarity index 98% rename from packages/lodestar/src/api/impl/validator/index.ts rename to packages/beacon-node/src/api/impl/validator/index.ts index a4012f0a3719..00ee3b87d961 100644 --- a/packages/lodestar/src/api/impl/validator/index.ts +++ b/packages/beacon-node/src/api/impl/validator/index.ts @@ -1,4 +1,4 @@ -import {routes} from "@chainsafe/lodestar-api"; +import {routes} from "@lodestar/api"; import { CachedBeaconStateAllForks, computeStartSlotAtEpoch, @@ -6,16 +6,16 @@ import { attesterShufflingDecisionRoot, getBlockRootAtSlot, computeEpochAtSlot, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import { GENESIS_SLOT, SLOTS_PER_EPOCH, SLOTS_PER_HISTORICAL_ROOT, SYNC_COMMITTEE_SUBNET_SIZE, ForkName, -} from "@chainsafe/lodestar-params"; -import {Root, Slot, ValidatorIndex, ssz, Epoch, BLSSignature} from "@chainsafe/lodestar-types"; -import {ExecutionStatus} from "@chainsafe/lodestar-fork-choice"; +} from "@lodestar/params"; +import {Root, Slot, ValidatorIndex, ssz, Epoch, BLSSignature} from "@lodestar/types"; +import {ExecutionStatus} from "@lodestar/fork-choice"; import {fromHexString} from "@chainsafe/ssz"; import {assembleBlock, BlockType, AssembledBlockType} from "../../../chain/factory/block/index.js"; @@ -54,7 +54,7 @@ const SYNC_TOLERANCE_EPOCHS = 1; /** * Server implementation for handling validator duties. - * See `@chainsafe/lodestar-validator/src/api` for the client implementation). + * See `@lodestar/validator/src/api` for the client implementation). */ export function getValidatorApi({chain, config, logger, metrics, network, sync}: ApiModules): routes.validator.Api { let genesisBlockRoot: Root | null = null; diff --git a/packages/lodestar/src/api/impl/validator/utils.ts b/packages/beacon-node/src/api/impl/validator/utils.ts similarity index 86% rename from packages/lodestar/src/api/impl/validator/utils.ts rename to packages/beacon-node/src/api/impl/validator/utils.ts index 4d66c4471b87..86ea223d59ab 100644 --- a/packages/lodestar/src/api/impl/validator/utils.ts +++ b/packages/beacon-node/src/api/impl/validator/utils.ts @@ -1,6 +1,6 @@ -import {BeaconStateAllForks, computeSlotsSinceEpochStart} from "@chainsafe/lodestar-beacon-state-transition"; -import {ATTESTATION_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {BLSPubkey, CommitteeIndex, Slot, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {BeaconStateAllForks, computeSlotsSinceEpochStart} from "@lodestar/state-transition"; +import {ATTESTATION_SUBNET_COUNT} from "@lodestar/params"; +import {BLSPubkey, CommitteeIndex, Slot, ValidatorIndex} from "@lodestar/types"; export function computeSubnetForCommitteesAtSlot( slot: Slot, @@ -19,7 +19,7 @@ export function computeSubnetForCommitteesAtSlot( * Uses special BranchNodeStruct state.validators data structure to optimize getting pubkeys. * Type-unsafe: assumes state.validators[i] is of BranchNodeStruct type. * Note: This is the fastest way of getting compressed pubkeys. - * See benchmark -> packages/lodestar/test/perf/api/impl/validator/attester.test.ts + * See benchmark -> packages/beacon-node/test/perf/api/impl/validator/attester.test.ts */ export function getPubkeysForIndices( validators: BeaconStateAllForks["validators"], diff --git a/packages/lodestar/src/api/index.ts b/packages/beacon-node/src/api/index.ts similarity index 100% rename from packages/lodestar/src/api/index.ts rename to packages/beacon-node/src/api/index.ts diff --git a/packages/lodestar/src/api/options.ts b/packages/beacon-node/src/api/options.ts similarity index 100% rename from packages/lodestar/src/api/options.ts rename to packages/beacon-node/src/api/options.ts diff --git a/packages/lodestar/src/api/rest/activeSockets.ts b/packages/beacon-node/src/api/rest/activeSockets.ts similarity index 100% rename from packages/lodestar/src/api/rest/activeSockets.ts rename to packages/beacon-node/src/api/rest/activeSockets.ts diff --git a/packages/lodestar/src/api/rest/base.ts b/packages/beacon-node/src/api/rest/base.ts similarity index 97% rename from packages/lodestar/src/api/rest/base.ts rename to packages/beacon-node/src/api/rest/base.ts index b752dd753793..73f9c85a5c5b 100644 --- a/packages/lodestar/src/api/rest/base.ts +++ b/packages/beacon-node/src/api/rest/base.ts @@ -2,8 +2,8 @@ import querystring from "querystring"; import fastify, {FastifyError, FastifyInstance} from "fastify"; import fastifyCors from "fastify-cors"; import bearerAuthPlugin from "fastify-bearer-auth"; -import {RouteConfig} from "@chainsafe/lodestar-api/beacon/server"; -import {ErrorAborted, ILogger} from "@chainsafe/lodestar-utils"; +import {RouteConfig} from "@lodestar/api/beacon/server"; +import {ErrorAborted, ILogger} from "@lodestar/utils"; import {IGauge, IHistogram} from "../../metrics/index.js"; import {ApiError, NodeIsSyncing} from "../impl/errors.js"; import {HttpActiveSocketsTracker, SocketMetrics} from "./activeSockets.js"; diff --git a/packages/lodestar/src/api/rest/index.ts b/packages/beacon-node/src/api/rest/index.ts similarity index 83% rename from packages/lodestar/src/api/rest/index.ts rename to packages/beacon-node/src/api/rest/index.ts index 67daa4cec3e1..a30eb67d45ad 100644 --- a/packages/lodestar/src/api/rest/index.ts +++ b/packages/beacon-node/src/api/rest/index.ts @@ -1,10 +1,10 @@ -import {Api} from "@chainsafe/lodestar-api"; -import {registerRoutes} from "@chainsafe/lodestar-api/beacon/server"; -import {ErrorAborted, ILogger} from "@chainsafe/lodestar-utils"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {Api} from "@lodestar/api"; +import {registerRoutes} from "@lodestar/api/beacon/server"; +import {ErrorAborted, ILogger} from "@lodestar/utils"; +import {IChainForkConfig} from "@lodestar/config"; import {NodeIsSyncing} from "../impl/errors.js"; import {RestApiServer, RestApiServerModules, RestApiServerMetrics} from "./base.js"; -export {allNamespaces} from "@chainsafe/lodestar-api"; +export {allNamespaces} from "@lodestar/api"; export type BeaconRestApiServerOpts = { enabled: boolean; diff --git a/packages/lodestar/src/chain/archiver/archiveBlocks.ts b/packages/beacon-node/src/chain/archiver/archiveBlocks.ts similarity index 95% rename from packages/lodestar/src/chain/archiver/archiveBlocks.ts rename to packages/beacon-node/src/chain/archiver/archiveBlocks.ts index c7d30ad41342..e70f3c9f2b61 100644 --- a/packages/lodestar/src/chain/archiver/archiveBlocks.ts +++ b/packages/beacon-node/src/chain/archiver/archiveBlocks.ts @@ -1,9 +1,9 @@ import {fromHexString} from "@chainsafe/ssz"; -import {Epoch, Slot} from "@chainsafe/lodestar-types"; -import {IForkChoice} from "@chainsafe/lodestar-fork-choice"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; +import {Epoch, Slot} from "@lodestar/types"; +import {IForkChoice} from "@lodestar/fork-choice"; +import {ILogger} from "@lodestar/utils"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {computeEpochAtSlot} from "@lodestar/state-transition"; import {IBeaconDb} from "../../db/index.js"; import {BlockArchiveBatchPutBinaryItem} from "../../db/repositories/index.js"; import {LightClientServer} from "../lightClient/index.js"; diff --git a/packages/lodestar/src/chain/archiver/archiveStates.ts b/packages/beacon-node/src/chain/archiver/archiveStates.ts similarity index 94% rename from packages/lodestar/src/chain/archiver/archiveStates.ts rename to packages/beacon-node/src/chain/archiver/archiveStates.ts index ba64c390caa3..b1a1214dbc4a 100644 --- a/packages/lodestar/src/chain/archiver/archiveStates.ts +++ b/packages/beacon-node/src/chain/archiver/archiveStates.ts @@ -2,9 +2,9 @@ * @module tasks */ -import {ILogger} from "@chainsafe/lodestar-utils"; -import {computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {CheckpointWithHex} from "@chainsafe/lodestar-fork-choice"; +import {ILogger} from "@lodestar/utils"; +import {computeEpochAtSlot} from "@lodestar/state-transition"; +import {CheckpointWithHex} from "@lodestar/fork-choice"; import {IBeaconDb} from "../../db/index.js"; import {CheckpointStateCache} from "../stateCache/index.js"; diff --git a/packages/lodestar/src/chain/archiver/index.ts b/packages/beacon-node/src/chain/archiver/index.ts similarity index 97% rename from packages/lodestar/src/chain/archiver/index.ts rename to packages/beacon-node/src/chain/archiver/index.ts index 6d73ba060530..d2b8a575e6b8 100644 --- a/packages/lodestar/src/chain/archiver/index.ts +++ b/packages/beacon-node/src/chain/archiver/index.ts @@ -1,6 +1,6 @@ -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ILogger} from "@lodestar/utils"; -import {CheckpointWithHex} from "@chainsafe/lodestar-fork-choice"; +import {CheckpointWithHex} from "@lodestar/fork-choice"; import {IBeaconDb} from "../../db/index.js"; import {JobItemQueue} from "../../util/queue/index.js"; import {IBeaconChain} from "../interface.js"; diff --git a/packages/lodestar/src/chain/beaconProposerCache.ts b/packages/beacon-node/src/chain/beaconProposerCache.ts similarity index 94% rename from packages/lodestar/src/chain/beaconProposerCache.ts rename to packages/beacon-node/src/chain/beaconProposerCache.ts index 6cb933639fc5..dd4eaff957ea 100644 --- a/packages/lodestar/src/chain/beaconProposerCache.ts +++ b/packages/beacon-node/src/chain/beaconProposerCache.ts @@ -1,5 +1,5 @@ -import {Epoch} from "@chainsafe/lodestar-types"; -import {routes} from "@chainsafe/lodestar-api"; +import {Epoch} from "@lodestar/types"; +import {routes} from "@lodestar/api"; import {MapDef} from "../util/map.js"; import {IMetrics} from "../metrics/index.js"; diff --git a/packages/lodestar/src/chain/blocks/importBlock.ts b/packages/beacon-node/src/chain/blocks/importBlock.ts similarity index 98% rename from packages/lodestar/src/chain/blocks/importBlock.ts rename to packages/beacon-node/src/chain/blocks/importBlock.ts index e19d4feb6739..c6902f080db2 100644 --- a/packages/lodestar/src/chain/blocks/importBlock.ts +++ b/packages/beacon-node/src/chain/blocks/importBlock.ts @@ -1,5 +1,5 @@ -import {altair, allForks, ssz} from "@chainsafe/lodestar-types"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {altair, allForks, ssz} from "@lodestar/types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {toHexString} from "@chainsafe/ssz"; import { CachedBeaconStateAllForks, @@ -8,10 +8,10 @@ import { getEffectiveBalanceIncrementsZeroInactive, computeEpochAtSlot, RootCache, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {IForkChoice, OnBlockPrecachedData, ForkChoiceError, ForkChoiceErrorCode} from "@chainsafe/lodestar-fork-choice"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +} from "@lodestar/state-transition"; +import {IForkChoice, OnBlockPrecachedData, ForkChoiceError, ForkChoiceErrorCode} from "@lodestar/fork-choice"; +import {ILogger} from "@lodestar/utils"; +import {IChainForkConfig} from "@lodestar/config"; import {IMetrics} from "../../metrics/index.js"; import {IExecutionEngine} from "../../execution/engine/interface.js"; import {IBeaconDb} from "../../db/index.js"; diff --git a/packages/lodestar/src/chain/blocks/index.ts b/packages/beacon-node/src/chain/blocks/index.ts similarity index 98% rename from packages/lodestar/src/chain/blocks/index.ts rename to packages/beacon-node/src/chain/blocks/index.ts index 46f1985c581a..70ff6ea99902 100644 --- a/packages/lodestar/src/chain/blocks/index.ts +++ b/packages/beacon-node/src/chain/blocks/index.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */ -import {allForks} from "@chainsafe/lodestar-types"; -import {sleep, toHex} from "@chainsafe/lodestar-utils"; +import {allForks} from "@lodestar/types"; +import {sleep, toHex} from "@lodestar/utils"; import {JobItemQueue} from "../../util/queue/index.js"; import {BlockError, BlockErrorCode, ChainSegmentError} from "../errors/index.js"; import {BlockProcessOpts} from "../options.js"; diff --git a/packages/lodestar/src/chain/blocks/types.ts b/packages/beacon-node/src/chain/blocks/types.ts similarity index 90% rename from packages/lodestar/src/chain/blocks/types.ts rename to packages/beacon-node/src/chain/blocks/types.ts index 89de1e5fd351..a9f1299c4f13 100644 --- a/packages/lodestar/src/chain/blocks/types.ts +++ b/packages/beacon-node/src/chain/blocks/types.ts @@ -1,6 +1,6 @@ -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {ProtoBlock, ExecutionStatus} from "@chainsafe/lodestar-fork-choice"; -import {allForks} from "@chainsafe/lodestar-types"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; +import {ProtoBlock, ExecutionStatus} from "@lodestar/fork-choice"; +import {allForks} from "@lodestar/types"; export type FullyVerifiedBlockFlags = { /** diff --git a/packages/lodestar/src/chain/blocks/utils/chainSegment.ts b/packages/beacon-node/src/chain/blocks/utils/chainSegment.ts similarity index 89% rename from packages/lodestar/src/chain/blocks/utils/chainSegment.ts rename to packages/beacon-node/src/chain/blocks/utils/chainSegment.ts index 050e8f24368d..b2609edb3f50 100644 --- a/packages/lodestar/src/chain/blocks/utils/chainSegment.ts +++ b/packages/beacon-node/src/chain/blocks/utils/chainSegment.ts @@ -1,5 +1,5 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {allForks, ssz} from "@lodestar/types"; import {BlockError, BlockErrorCode} from "../../errors/index.js"; /** diff --git a/packages/lodestar/src/chain/blocks/utils/checkpoint.ts b/packages/beacon-node/src/chain/blocks/utils/checkpoint.ts similarity index 76% rename from packages/lodestar/src/chain/blocks/utils/checkpoint.ts rename to packages/beacon-node/src/chain/blocks/utils/checkpoint.ts index c1db0eff740c..2ff77600b2b8 100644 --- a/packages/lodestar/src/chain/blocks/utils/checkpoint.ts +++ b/packages/beacon-node/src/chain/blocks/utils/checkpoint.ts @@ -1,6 +1,6 @@ -import {CachedBeaconStateAllForks, computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {CachedBeaconStateAllForks, computeEpochAtSlot} from "@lodestar/state-transition"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {phase0, ssz} from "@lodestar/types"; import {ZERO_HASH} from "../../../constants/index.js"; /** diff --git a/packages/lodestar/src/chain/blocks/utils/pandaMergeTransitionBanner.ts b/packages/beacon-node/src/chain/blocks/utils/pandaMergeTransitionBanner.ts similarity index 100% rename from packages/lodestar/src/chain/blocks/utils/pandaMergeTransitionBanner.ts rename to packages/beacon-node/src/chain/blocks/utils/pandaMergeTransitionBanner.ts diff --git a/packages/lodestar/src/chain/blocks/utils/pendingEvents.ts b/packages/beacon-node/src/chain/blocks/utils/pendingEvents.ts similarity index 100% rename from packages/lodestar/src/chain/blocks/utils/pendingEvents.ts rename to packages/beacon-node/src/chain/blocks/utils/pendingEvents.ts diff --git a/packages/lodestar/src/chain/blocks/verifyBlock.ts b/packages/beacon-node/src/chain/blocks/verifyBlock.ts similarity index 98% rename from packages/lodestar/src/chain/blocks/verifyBlock.ts rename to packages/beacon-node/src/chain/blocks/verifyBlock.ts index c51e23594c6b..21f1ff34751d 100644 --- a/packages/lodestar/src/chain/blocks/verifyBlock.ts +++ b/packages/beacon-node/src/chain/blocks/verifyBlock.ts @@ -8,12 +8,12 @@ import { getAllBlockSignatureSetsExceptProposer, getAllBlockSignatureSets, stateTransition, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {bellatrix} from "@chainsafe/lodestar-types"; +} from "@lodestar/state-transition"; +import {bellatrix} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; -import {IForkChoice, ProtoBlock, ExecutionStatus, assertValidTerminalPowBlock} from "@chainsafe/lodestar-fork-choice"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {IForkChoice, ProtoBlock, ExecutionStatus, assertValidTerminalPowBlock} from "@lodestar/fork-choice"; +import {IChainForkConfig} from "@lodestar/config"; +import {ILogger} from "@lodestar/utils"; import {IMetrics} from "../../metrics/index.js"; import {IExecutionEngine} from "../../execution/engine/index.js"; import {BlockError, BlockErrorCode} from "../errors/index.js"; diff --git a/packages/lodestar/src/chain/bls/index.ts b/packages/beacon-node/src/chain/bls/index.ts similarity index 100% rename from packages/lodestar/src/chain/bls/index.ts rename to packages/beacon-node/src/chain/bls/index.ts diff --git a/packages/lodestar/src/chain/bls/interface.ts b/packages/beacon-node/src/chain/bls/interface.ts similarity index 96% rename from packages/lodestar/src/chain/bls/interface.ts rename to packages/beacon-node/src/chain/bls/interface.ts index 11cbc3f12ca3..4ce95a675d01 100644 --- a/packages/lodestar/src/chain/bls/interface.ts +++ b/packages/beacon-node/src/chain/bls/interface.ts @@ -1,4 +1,4 @@ -import {ISignatureSet} from "@chainsafe/lodestar-beacon-state-transition"; +import {ISignatureSet} from "@lodestar/state-transition"; export type VerifySignatureOpts = { /** diff --git a/packages/lodestar/src/chain/bls/maybeBatch.ts b/packages/beacon-node/src/chain/bls/maybeBatch.ts similarity index 100% rename from packages/lodestar/src/chain/bls/maybeBatch.ts rename to packages/beacon-node/src/chain/bls/maybeBatch.ts diff --git a/packages/lodestar/src/chain/bls/multithread/index.ts b/packages/beacon-node/src/chain/bls/multithread/index.ts similarity index 99% rename from packages/lodestar/src/chain/bls/multithread/index.ts rename to packages/beacon-node/src/chain/bls/multithread/index.ts index cdaf149383a8..5999d9c96455 100644 --- a/packages/lodestar/src/chain/bls/multithread/index.ts +++ b/packages/beacon-node/src/chain/bls/multithread/index.ts @@ -8,8 +8,8 @@ import {spawn, Worker} from "@chainsafe/threads"; self = undefined; import bls from "@chainsafe/bls"; import {Implementation, PointFormat} from "@chainsafe/bls/types"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {ISignatureSet} from "@chainsafe/lodestar-beacon-state-transition"; +import {ILogger} from "@lodestar/utils"; +import {ISignatureSet} from "@lodestar/state-transition"; import {QueueError, QueueErrorCode} from "../../../util/queue/index.js"; import {IMetrics} from "../../../metrics/index.js"; import {IBlsVerifier, VerifySignatureOpts} from "../interface.js"; diff --git a/packages/lodestar/src/chain/bls/multithread/poolSize.ts b/packages/beacon-node/src/chain/bls/multithread/poolSize.ts similarity index 100% rename from packages/lodestar/src/chain/bls/multithread/poolSize.ts rename to packages/beacon-node/src/chain/bls/multithread/poolSize.ts diff --git a/packages/lodestar/src/chain/bls/multithread/types.ts b/packages/beacon-node/src/chain/bls/multithread/types.ts similarity index 100% rename from packages/lodestar/src/chain/bls/multithread/types.ts rename to packages/beacon-node/src/chain/bls/multithread/types.ts diff --git a/packages/lodestar/src/chain/bls/multithread/utils.ts b/packages/beacon-node/src/chain/bls/multithread/utils.ts similarity index 100% rename from packages/lodestar/src/chain/bls/multithread/utils.ts rename to packages/beacon-node/src/chain/bls/multithread/utils.ts diff --git a/packages/lodestar/src/chain/bls/multithread/worker.ts b/packages/beacon-node/src/chain/bls/multithread/worker.ts similarity index 100% rename from packages/lodestar/src/chain/bls/multithread/worker.ts rename to packages/beacon-node/src/chain/bls/multithread/worker.ts diff --git a/packages/lodestar/src/chain/bls/singleThread.ts b/packages/beacon-node/src/chain/bls/singleThread.ts similarity index 93% rename from packages/lodestar/src/chain/bls/singleThread.ts rename to packages/beacon-node/src/chain/bls/singleThread.ts index 5b782e0d863b..c6180ee513ee 100644 --- a/packages/lodestar/src/chain/bls/singleThread.ts +++ b/packages/beacon-node/src/chain/bls/singleThread.ts @@ -1,4 +1,4 @@ -import {ISignatureSet} from "@chainsafe/lodestar-beacon-state-transition"; +import {ISignatureSet} from "@lodestar/state-transition"; import {IMetrics} from "../../metrics/index.js"; import {IBlsVerifier} from "./interface.js"; import {verifySignatureSetsMaybeBatch} from "./maybeBatch.js"; diff --git a/packages/lodestar/src/chain/bls/utils.ts b/packages/beacon-node/src/chain/bls/utils.ts similarity index 88% rename from packages/lodestar/src/chain/bls/utils.ts rename to packages/beacon-node/src/chain/bls/utils.ts index 2dacd2c21463..0b1010de27f6 100644 --- a/packages/lodestar/src/chain/bls/utils.ts +++ b/packages/beacon-node/src/chain/bls/utils.ts @@ -1,6 +1,6 @@ import type {PublicKey} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; -import {ISignatureSet, SignatureSetType} from "@chainsafe/lodestar-beacon-state-transition"; +import {ISignatureSet, SignatureSetType} from "@lodestar/state-transition"; export function getAggregatedPubkey(signatureSet: ISignatureSet): PublicKey { switch (signatureSet.type) { diff --git a/packages/lodestar/src/chain/chain.ts b/packages/beacon-node/src/chain/chain.ts similarity index 98% rename from packages/lodestar/src/chain/chain.ts rename to packages/beacon-node/src/chain/chain.ts index a19b70736d6f..9996a1580fc1 100644 --- a/packages/lodestar/src/chain/chain.ts +++ b/packages/beacon-node/src/chain/chain.ts @@ -10,11 +10,11 @@ import { createCachedBeaconState, Index2PubkeyCache, PubkeyIndexMap, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {allForks, UintNum64, Root, phase0, Slot, RootHex, Epoch, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {CheckpointWithHex, IForkChoice, ProtoBlock} from "@chainsafe/lodestar-fork-choice"; -import {ILogger, toHex} from "@chainsafe/lodestar-utils"; +} from "@lodestar/state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {allForks, UintNum64, Root, phase0, Slot, RootHex, Epoch, ValidatorIndex} from "@lodestar/types"; +import {CheckpointWithHex, IForkChoice, ProtoBlock} from "@lodestar/fork-choice"; +import {ILogger, toHex} from "@lodestar/utils"; import {CompositeTypeAny, fromHexString, TreeView, Type} from "@chainsafe/ssz"; import {GENESIS_EPOCH, ZERO_HASH} from "../constants/index.js"; import {IBeaconDb} from "../db/index.js"; diff --git a/packages/lodestar/src/chain/clock/LocalClock.ts b/packages/beacon-node/src/chain/clock/LocalClock.ts similarity index 95% rename from packages/lodestar/src/chain/clock/LocalClock.ts rename to packages/beacon-node/src/chain/clock/LocalClock.ts index 8f89278e5f25..da4fa6bd5661 100644 --- a/packages/lodestar/src/chain/clock/LocalClock.ts +++ b/packages/beacon-node/src/chain/clock/LocalClock.ts @@ -1,7 +1,7 @@ -import {Epoch, Slot} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ErrorAborted} from "@chainsafe/lodestar-utils"; -import {computeEpochAtSlot, computeTimeAtSlot, getCurrentSlot} from "@chainsafe/lodestar-beacon-state-transition"; +import {Epoch, Slot} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {ErrorAborted} from "@lodestar/utils"; +import {computeEpochAtSlot, computeTimeAtSlot, getCurrentSlot} from "@lodestar/state-transition"; import {ChainEvent, ChainEventEmitter} from "../emitter.js"; diff --git a/packages/lodestar/src/chain/clock/index.ts b/packages/beacon-node/src/chain/clock/index.ts similarity index 100% rename from packages/lodestar/src/chain/clock/index.ts rename to packages/beacon-node/src/chain/clock/index.ts diff --git a/packages/lodestar/src/chain/clock/interface.ts b/packages/beacon-node/src/chain/clock/interface.ts similarity index 95% rename from packages/lodestar/src/chain/clock/interface.ts rename to packages/beacon-node/src/chain/clock/interface.ts index 691ddf530870..a795b2ac4be4 100644 --- a/packages/lodestar/src/chain/clock/interface.ts +++ b/packages/beacon-node/src/chain/clock/interface.ts @@ -1,4 +1,4 @@ -import {Epoch, Slot} from "@chainsafe/lodestar-types"; +import {Epoch, Slot} from "@lodestar/types"; /** * Tracks the current chain time, measured in `Slot`s and `Epoch`s diff --git a/packages/lodestar/src/chain/emitter.ts b/packages/beacon-node/src/chain/emitter.ts similarity index 95% rename from packages/lodestar/src/chain/emitter.ts rename to packages/beacon-node/src/chain/emitter.ts index b31783ee24cc..cae2c813f63f 100644 --- a/packages/lodestar/src/chain/emitter.ts +++ b/packages/beacon-node/src/chain/emitter.ts @@ -1,10 +1,10 @@ import {EventEmitter} from "events"; import StrictEventEmitter from "strict-event-emitter-types"; -import {routes} from "@chainsafe/lodestar-api"; -import {phase0, Epoch, Slot, allForks} from "@chainsafe/lodestar-types"; -import {CheckpointWithHex, ProtoBlock} from "@chainsafe/lodestar-fork-choice"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {routes} from "@lodestar/api"; +import {phase0, Epoch, Slot, allForks} from "@lodestar/types"; +import {CheckpointWithHex, ProtoBlock} from "@lodestar/fork-choice"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; /** * Important chain events that occur during normal chain operation. diff --git a/packages/lodestar/src/chain/errors/attestationError.ts b/packages/beacon-node/src/chain/errors/attestationError.ts similarity index 99% rename from packages/lodestar/src/chain/errors/attestationError.ts rename to packages/beacon-node/src/chain/errors/attestationError.ts index 3c7b67509d45..7e430db758db 100644 --- a/packages/lodestar/src/chain/errors/attestationError.ts +++ b/packages/beacon-node/src/chain/errors/attestationError.ts @@ -1,4 +1,4 @@ -import {CommitteeIndex, Epoch, Slot, ValidatorIndex, RootHex} from "@chainsafe/lodestar-types"; +import {CommitteeIndex, Epoch, Slot, ValidatorIndex, RootHex} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; import {GossipActionError} from "./gossipValidation.js"; diff --git a/packages/lodestar/src/chain/errors/attesterSlashingError.ts b/packages/beacon-node/src/chain/errors/attesterSlashingError.ts similarity index 100% rename from packages/lodestar/src/chain/errors/attesterSlashingError.ts rename to packages/beacon-node/src/chain/errors/attesterSlashingError.ts diff --git a/packages/lodestar/src/chain/errors/blockError.ts b/packages/beacon-node/src/chain/errors/blockError.ts similarity index 96% rename from packages/lodestar/src/chain/errors/blockError.ts rename to packages/beacon-node/src/chain/errors/blockError.ts index 7567c9a646cc..0e8b06e6900a 100644 --- a/packages/lodestar/src/chain/errors/blockError.ts +++ b/packages/beacon-node/src/chain/errors/blockError.ts @@ -1,7 +1,7 @@ -import {allForks, RootHex, Slot, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {allForks, RootHex, Slot, ValidatorIndex} from "@lodestar/types"; +import {LodestarError} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; import {ExecutePayloadStatus} from "../../execution/engine/interface.js"; import {GossipActionError} from "./gossipValidation.js"; diff --git a/packages/lodestar/src/chain/errors/gossipValidation.ts b/packages/beacon-node/src/chain/errors/gossipValidation.ts similarity index 82% rename from packages/lodestar/src/chain/errors/gossipValidation.ts rename to packages/beacon-node/src/chain/errors/gossipValidation.ts index 87750c6658b8..fbf9fd7086d6 100644 --- a/packages/lodestar/src/chain/errors/gossipValidation.ts +++ b/packages/beacon-node/src/chain/errors/gossipValidation.ts @@ -1,4 +1,4 @@ -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {LodestarError} from "@lodestar/utils"; export enum GossipAction { IGNORE = "IGNORE", diff --git a/packages/lodestar/src/chain/errors/index.ts b/packages/beacon-node/src/chain/errors/index.ts similarity index 100% rename from packages/lodestar/src/chain/errors/index.ts rename to packages/beacon-node/src/chain/errors/index.ts diff --git a/packages/lodestar/src/chain/errors/proposerSlashingError.ts b/packages/beacon-node/src/chain/errors/proposerSlashingError.ts similarity index 100% rename from packages/lodestar/src/chain/errors/proposerSlashingError.ts rename to packages/beacon-node/src/chain/errors/proposerSlashingError.ts diff --git a/packages/lodestar/src/chain/errors/syncCommitteeError.ts b/packages/beacon-node/src/chain/errors/syncCommitteeError.ts similarity index 96% rename from packages/lodestar/src/chain/errors/syncCommitteeError.ts rename to packages/beacon-node/src/chain/errors/syncCommitteeError.ts index 5454fca26b9c..e5d738f26de5 100644 --- a/packages/lodestar/src/chain/errors/syncCommitteeError.ts +++ b/packages/beacon-node/src/chain/errors/syncCommitteeError.ts @@ -1,4 +1,4 @@ -import {altair, ValidatorIndex, Slot} from "@chainsafe/lodestar-types"; +import {altair, ValidatorIndex, Slot} from "@lodestar/types"; import {GossipActionError} from "./gossipValidation.js"; export enum SyncCommitteeErrorCode { diff --git a/packages/lodestar/src/chain/errors/voluntaryExitError.ts b/packages/beacon-node/src/chain/errors/voluntaryExitError.ts similarity index 100% rename from packages/lodestar/src/chain/errors/voluntaryExitError.ts rename to packages/beacon-node/src/chain/errors/voluntaryExitError.ts diff --git a/packages/lodestar/src/chain/factory/block/body.ts b/packages/beacon-node/src/chain/factory/block/body.ts similarity index 97% rename from packages/lodestar/src/chain/factory/block/body.ts rename to packages/beacon-node/src/chain/factory/block/body.ts index 09d072b6c73e..35d8621ddcf5 100644 --- a/packages/lodestar/src/chain/factory/block/body.ts +++ b/packages/beacon-node/src/chain/factory/block/body.ts @@ -15,7 +15,7 @@ import { ssz, ValidatorIndex, BLSPubkey, -} from "@chainsafe/lodestar-types"; +} from "@lodestar/types"; import { CachedBeaconStateAllForks, CachedBeaconStateBellatrix, @@ -24,9 +24,9 @@ import { getRandaoMix, getCurrentEpoch, isMergeTransitionComplete, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {toHex} from "@chainsafe/lodestar-utils"; +} from "@lodestar/state-transition"; +import {IChainForkConfig} from "@lodestar/config"; +import {toHex} from "@lodestar/utils"; import {IBeaconChain} from "../../interface.js"; import {PayloadId, IExecutionEngine, IExecutionBuilder} from "../../../execution/index.js"; diff --git a/packages/lodestar/src/chain/factory/block/index.ts b/packages/beacon-node/src/chain/factory/block/index.ts similarity index 93% rename from packages/lodestar/src/chain/factory/block/index.ts rename to packages/beacon-node/src/chain/factory/block/index.ts index 66892642e026..f7118590facd 100644 --- a/packages/lodestar/src/chain/factory/block/index.ts +++ b/packages/beacon-node/src/chain/factory/block/index.ts @@ -2,8 +2,8 @@ * @module chain/blockAssembly */ -import {CachedBeaconStateAllForks, stateTransition} from "@chainsafe/lodestar-beacon-state-transition"; -import {allForks, Bytes32, Bytes96, Root, Slot} from "@chainsafe/lodestar-types"; +import {CachedBeaconStateAllForks, stateTransition} from "@lodestar/state-transition"; +import {allForks, Bytes32, Bytes96, Root, Slot} from "@lodestar/types"; import {fromHexString} from "@chainsafe/ssz"; import {ZERO_HASH} from "../../../constants/index.js"; diff --git a/packages/lodestar/src/chain/forkChoice/index.ts b/packages/beacon-node/src/chain/forkChoice/index.ts similarity index 93% rename from packages/lodestar/src/chain/forkChoice/index.ts rename to packages/beacon-node/src/chain/forkChoice/index.ts index afdb7576cd5d..ce95f7dc258d 100644 --- a/packages/lodestar/src/chain/forkChoice/index.ts +++ b/packages/beacon-node/src/chain/forkChoice/index.ts @@ -3,15 +3,15 @@ */ import {toHexString} from "@chainsafe/ssz"; -import {Slot} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ForkChoice, ProtoArray, ForkChoiceStore, ExecutionStatus} from "@chainsafe/lodestar-fork-choice"; +import {Slot} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {ForkChoice, ProtoArray, ForkChoiceStore, ExecutionStatus} from "@lodestar/fork-choice"; import { CachedBeaconStateAllForks, getEffectiveBalanceIncrementsZeroInactive, isBellatrixStateType, isMergeTransitionComplete, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import {computeAnchorCheckpoint} from "../initState.js"; import {ChainEventEmitter} from "../emitter.js"; diff --git a/packages/lodestar/src/chain/genesis/genesis.ts b/packages/beacon-node/src/chain/genesis/genesis.ts similarity index 95% rename from packages/lodestar/src/chain/genesis/genesis.ts rename to packages/beacon-node/src/chain/genesis/genesis.ts index c5b5d2aa55ac..c2602acf71f0 100644 --- a/packages/lodestar/src/chain/genesis/genesis.ts +++ b/packages/beacon-node/src/chain/genesis/genesis.ts @@ -2,9 +2,9 @@ * @module chain/genesis */ -import {GENESIS_EPOCH, GENESIS_SLOT} from "@chainsafe/lodestar-params"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {IBeaconConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; +import {GENESIS_EPOCH, GENESIS_SLOT} from "@lodestar/params"; +import {phase0, ssz} from "@lodestar/types"; +import {IBeaconConfig, IChainForkConfig} from "@lodestar/config"; import {toGindex, Tree} from "@chainsafe/persistent-merkle-tree"; import { getTemporaryBlockHeader, @@ -17,8 +17,8 @@ import { BeaconStateAllForks, createEmptyEpochContextImmutableData, getActiveValidatorIndices, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {ILogger} from "@chainsafe/lodestar-utils"; +} from "@lodestar/state-transition"; +import {ILogger} from "@lodestar/utils"; import {IEth1Provider} from "../../eth1/index.js"; import {IEth1StreamParams} from "../../eth1/interface.js"; import {getDepositsAndBlockStreamForGenesis, getDepositsStream} from "../../eth1/stream.js"; diff --git a/packages/lodestar/src/chain/genesis/interface.ts b/packages/beacon-node/src/chain/genesis/interface.ts similarity index 73% rename from packages/lodestar/src/chain/genesis/interface.ts rename to packages/beacon-node/src/chain/genesis/interface.ts index 889c8e9a8c1d..24a2ed7cf86a 100644 --- a/packages/lodestar/src/chain/genesis/interface.ts +++ b/packages/beacon-node/src/chain/genesis/interface.ts @@ -1,5 +1,5 @@ -import {ssz} from "@chainsafe/lodestar-types"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {ssz} from "@lodestar/types"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; import {CompositeViewDU, VectorCompositeType} from "@chainsafe/ssz"; import {Eth1Block} from "../../eth1/interface.js"; diff --git a/packages/lodestar/src/chain/index.ts b/packages/beacon-node/src/chain/index.ts similarity index 100% rename from packages/lodestar/src/chain/index.ts rename to packages/beacon-node/src/chain/index.ts diff --git a/packages/lodestar/src/chain/initState.ts b/packages/beacon-node/src/chain/initState.ts similarity index 95% rename from packages/lodestar/src/chain/initState.ts rename to packages/beacon-node/src/chain/initState.ts index 0d8763534b17..55b7078738a4 100644 --- a/packages/lodestar/src/chain/initState.ts +++ b/packages/beacon-node/src/chain/initState.ts @@ -7,12 +7,12 @@ import { computeEpochAtSlot, BeaconStateAllForks, CachedBeaconStateAllForks, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {phase0, allForks, ssz} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ILogger} from "@chainsafe/lodestar-utils"; +} from "@lodestar/state-transition"; +import {phase0, allForks, ssz} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {ILogger} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {GENESIS_SLOT, ZERO_HASH} from "../constants/index.js"; import {IBeaconDb} from "../db/index.js"; import {Eth1Provider} from "../eth1/index.js"; diff --git a/packages/lodestar/src/chain/interface.ts b/packages/beacon-node/src/chain/interface.ts similarity index 95% rename from packages/lodestar/src/chain/interface.ts rename to packages/beacon-node/src/chain/interface.ts index 27f7be40353e..927b302bd5d8 100644 --- a/packages/lodestar/src/chain/interface.ts +++ b/packages/beacon-node/src/chain/interface.ts @@ -1,9 +1,9 @@ -import {allForks, UintNum64, Root, phase0, Slot, RootHex, Epoch, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +import {allForks, UintNum64, Root, phase0, Slot, RootHex, Epoch, ValidatorIndex} from "@lodestar/types"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; +import {IBeaconConfig} from "@lodestar/config"; import {CompositeTypeAny, TreeView, Type} from "@chainsafe/ssz"; -import {IForkChoice} from "@chainsafe/lodestar-fork-choice"; +import {IForkChoice} from "@lodestar/fork-choice"; import {IEth1ForBlockProduction} from "../eth1/index.js"; import {IExecutionEngine, IExecutionBuilder} from "../execution/index.js"; import {IBeaconClock} from "./clock/interface.js"; diff --git a/packages/lodestar/src/chain/lightClient/index.ts b/packages/beacon-node/src/chain/lightClient/index.ts similarity index 98% rename from packages/lodestar/src/chain/lightClient/index.ts rename to packages/beacon-node/src/chain/lightClient/index.ts index 094b7106a15e..2561c90d20e5 100644 --- a/packages/lodestar/src/chain/lightClient/index.ts +++ b/packages/beacon-node/src/chain/lightClient/index.ts @@ -1,14 +1,10 @@ -import {altair, phase0, Root, RootHex, Slot, ssz, SyncPeriod} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import { - CachedBeaconStateAltair, - computeSyncPeriodAtEpoch, - computeSyncPeriodAtSlot, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {routes} from "@chainsafe/lodestar-api"; +import {altair, phase0, Root, RootHex, Slot, ssz, SyncPeriod} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {CachedBeaconStateAltair, computeSyncPeriodAtEpoch, computeSyncPeriodAtSlot} from "@lodestar/state-transition"; +import {ILogger} from "@lodestar/utils"; +import {routes} from "@lodestar/api"; import {BitArray, CompositeViewDU, toHexString} from "@chainsafe/ssz"; -import {SYNC_COMMITTEE_SIZE} from "@chainsafe/lodestar-params"; +import {SYNC_COMMITTEE_SIZE} from "@lodestar/params"; import {IBeaconDb} from "../../db/index.js"; import {IMetrics} from "../../metrics/index.js"; import {MapDef, pruneSetToMax} from "../../util/map.js"; @@ -196,7 +192,7 @@ export class LightClientServer { parentBlock: {blockRoot: RootHex; slot: Slot} ): void { // What is the syncAggregate signing? - // From the beacon-state-transition + // From the state-transition // ``` // const previousSlot = Math.max(block.slot, 1) - 1; // const rootSigned = getBlockRootAtSlot(state, previousSlot); diff --git a/packages/lodestar/src/chain/lightClient/proofs.ts b/packages/beacon-node/src/chain/lightClient/proofs.ts similarity index 90% rename from packages/lodestar/src/chain/lightClient/proofs.ts rename to packages/beacon-node/src/chain/lightClient/proofs.ts index 39e15a771d48..633dcba9c308 100644 --- a/packages/lodestar/src/chain/lightClient/proofs.ts +++ b/packages/beacon-node/src/chain/lightClient/proofs.ts @@ -1,5 +1,5 @@ -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {FINALIZED_ROOT_GINDEX} from "@chainsafe/lodestar-params"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; +import {FINALIZED_ROOT_GINDEX} from "@lodestar/params"; import {Tree} from "@chainsafe/persistent-merkle-tree"; import {SyncCommitteeWitness} from "./types.js"; diff --git a/packages/lodestar/src/chain/lightClient/types.ts b/packages/beacon-node/src/chain/lightClient/types.ts similarity index 97% rename from packages/lodestar/src/chain/lightClient/types.ts rename to packages/beacon-node/src/chain/lightClient/types.ts index 75b8c99751e2..9258c444a837 100644 --- a/packages/lodestar/src/chain/lightClient/types.ts +++ b/packages/beacon-node/src/chain/lightClient/types.ts @@ -1,4 +1,4 @@ -import {altair, phase0} from "@chainsafe/lodestar-types"; +import {altair, phase0} from "@lodestar/types"; /** * We aren't creating the sync committee proofs separately because our ssz library automatically adds leaves to composite types, diff --git a/packages/lodestar/src/chain/opPools/aggregatedAttestationPool.ts b/packages/beacon-node/src/chain/opPools/aggregatedAttestationPool.ts similarity index 98% rename from packages/lodestar/src/chain/opPools/aggregatedAttestationPool.ts rename to packages/beacon-node/src/chain/opPools/aggregatedAttestationPool.ts index 26ecdf561b68..8738100db26e 100644 --- a/packages/lodestar/src/chain/opPools/aggregatedAttestationPool.ts +++ b/packages/beacon-node/src/chain/opPools/aggregatedAttestationPool.ts @@ -5,14 +5,14 @@ import { MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH, TIMELY_SOURCE_FLAG_INDEX, -} from "@chainsafe/lodestar-params"; -import {phase0, Epoch, Slot, ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; +} from "@lodestar/params"; +import {phase0, Epoch, Slot, ssz, ValidatorIndex} from "@lodestar/types"; import { CachedBeaconStateAllForks, CachedBeaconStatePhase0, CachedBeaconStateAltair, computeEpochAtSlot, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import {toHexString} from "@chainsafe/ssz"; import {MapDef} from "../../util/map.js"; import {intersectUint8Arrays, IntersectResult} from "../../util/bitArray.js"; @@ -358,7 +358,7 @@ export function getParticipationFn(state: CachedBeaconStateAllForks): GetPartici else { // Get attestations to be included in an altair block. // Attestations are sorted by inclusion distance then number of attesters. - // Attestations should pass the validation when processing attestations in beacon-state-transition. + // Attestations should pass the validation when processing attestations in state-transition. // check for altair block already const altairState = state as CachedBeaconStateAltair; const previousParticipation = altairState.previousEpochParticipation.getAll(); diff --git a/packages/lodestar/src/chain/opPools/attestationPool.ts b/packages/beacon-node/src/chain/opPools/attestationPool.ts similarity index 99% rename from packages/lodestar/src/chain/opPools/attestationPool.ts rename to packages/beacon-node/src/chain/opPools/attestationPool.ts index 87fbe249f5b0..d9f2c773ee0e 100644 --- a/packages/lodestar/src/chain/opPools/attestationPool.ts +++ b/packages/beacon-node/src/chain/opPools/attestationPool.ts @@ -1,4 +1,4 @@ -import {phase0, Slot, Root, ssz} from "@chainsafe/lodestar-types"; +import {phase0, Slot, Root, ssz} from "@lodestar/types"; import {PointFormat, Signature} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; import {BitArray, toHexString} from "@chainsafe/ssz"; diff --git a/packages/lodestar/src/chain/opPools/index.ts b/packages/beacon-node/src/chain/opPools/index.ts similarity index 100% rename from packages/lodestar/src/chain/opPools/index.ts rename to packages/beacon-node/src/chain/opPools/index.ts diff --git a/packages/lodestar/src/chain/opPools/opPool.ts b/packages/beacon-node/src/chain/opPools/opPool.ts similarity index 97% rename from packages/lodestar/src/chain/opPools/opPool.ts rename to packages/beacon-node/src/chain/opPools/opPool.ts index 7397cffe4227..26f69c89af2a 100644 --- a/packages/lodestar/src/chain/opPools/opPool.ts +++ b/packages/beacon-node/src/chain/opPools/opPool.ts @@ -4,10 +4,10 @@ import { computeEpochAtSlot, getAttesterSlashableIndices, isValidVoluntaryExit, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {Repository, Id} from "@chainsafe/lodestar-db"; -import {MAX_PROPOSER_SLASHINGS, MAX_VOLUNTARY_EXITS} from "@chainsafe/lodestar-params"; -import {Epoch, phase0, ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; +} from "@lodestar/state-transition"; +import {Repository, Id} from "@lodestar/db"; +import {MAX_PROPOSER_SLASHINGS, MAX_VOLUNTARY_EXITS} from "@lodestar/params"; +import {Epoch, phase0, ssz, ValidatorIndex} from "@lodestar/types"; import {fromHexString, toHexString} from "@chainsafe/ssz"; import {IBeaconDb} from "../../db/index.js"; diff --git a/packages/lodestar/src/chain/opPools/syncCommitteeMessagePool.ts b/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts similarity index 97% rename from packages/lodestar/src/chain/opPools/syncCommitteeMessagePool.ts rename to packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts index 8e695363df98..2a2129eae784 100644 --- a/packages/lodestar/src/chain/opPools/syncCommitteeMessagePool.ts +++ b/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts @@ -1,7 +1,7 @@ import {PointFormat, Signature} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; -import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {altair, Root, Slot, SubcommitteeIndex} from "@chainsafe/lodestar-types"; +import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {altair, Root, Slot, SubcommitteeIndex} from "@lodestar/types"; import {BitArray, toHexString} from "@chainsafe/ssz"; import {MapDef} from "../../util/map.js"; import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js"; diff --git a/packages/lodestar/src/chain/opPools/syncContributionAndProofPool.ts b/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts similarity index 97% rename from packages/lodestar/src/chain/opPools/syncContributionAndProofPool.ts rename to packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts index 3ec73a5a71f3..ed03bfb1b514 100644 --- a/packages/lodestar/src/chain/opPools/syncContributionAndProofPool.ts +++ b/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts @@ -1,8 +1,8 @@ import type {Signature} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; -import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_SIZE} from "@chainsafe/lodestar-params"; -import {altair, Slot, Root, ssz} from "@chainsafe/lodestar-types"; -import {G2_POINT_AT_INFINITY} from "@chainsafe/lodestar-beacon-state-transition"; +import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; +import {altair, Slot, Root, ssz} from "@lodestar/types"; +import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition"; import {BitArray, toHexString} from "@chainsafe/ssz"; import {MapDef} from "../../util/map.js"; import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js"; diff --git a/packages/lodestar/src/chain/opPools/types.ts b/packages/beacon-node/src/chain/opPools/types.ts similarity index 91% rename from packages/lodestar/src/chain/opPools/types.ts rename to packages/beacon-node/src/chain/opPools/types.ts index 49e5948d8fef..393f821bfa11 100644 --- a/packages/lodestar/src/chain/opPools/types.ts +++ b/packages/beacon-node/src/chain/opPools/types.ts @@ -1,5 +1,5 @@ -import {Slot} from "@chainsafe/lodestar-types"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {Slot} from "@lodestar/types"; +import {LodestarError} from "@lodestar/utils"; /** * Result of adding data to an operation pool of an aggregatable object. diff --git a/packages/lodestar/src/chain/opPools/utils.ts b/packages/beacon-node/src/chain/opPools/utils.ts similarity index 93% rename from packages/lodestar/src/chain/opPools/utils.ts rename to packages/beacon-node/src/chain/opPools/utils.ts index 49a23ab82fe5..6d9a37432633 100644 --- a/packages/lodestar/src/chain/opPools/utils.ts +++ b/packages/beacon-node/src/chain/opPools/utils.ts @@ -1,4 +1,4 @@ -import {Slot} from "@chainsafe/lodestar-types"; +import {Slot} from "@lodestar/types"; /** * Prune a Map indexed by slot to keep the most recent slots, up to `slotsRetained` diff --git a/packages/lodestar/src/chain/options.ts b/packages/beacon-node/src/chain/options.ts similarity index 86% rename from packages/lodestar/src/chain/options.ts rename to packages/beacon-node/src/chain/options.ts index da26e16abc0d..4271d7deea6f 100644 --- a/packages/lodestar/src/chain/options.ts +++ b/packages/beacon-node/src/chain/options.ts @@ -1,5 +1,5 @@ -import {SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY} from "@chainsafe/lodestar-params"; -import {defaultOptions as defaultValidatorOptions} from "@chainsafe/lodestar-validator"; +import {SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY} from "@lodestar/params"; +import {defaultOptions as defaultValidatorOptions} from "@lodestar/validator"; import {ArchiverOpts} from "./archiver/index.js"; import {ForkChoiceOpts} from "./forkChoice/index.js"; diff --git a/packages/lodestar/src/chain/prepareNextSlot.ts b/packages/beacon-node/src/chain/prepareNextSlot.ts similarity index 94% rename from packages/lodestar/src/chain/prepareNextSlot.ts rename to packages/beacon-node/src/chain/prepareNextSlot.ts index 55e39c344252..eadd3aef692e 100644 --- a/packages/lodestar/src/chain/prepareNextSlot.ts +++ b/packages/beacon-node/src/chain/prepareNextSlot.ts @@ -1,8 +1,8 @@ -import {computeEpochAtSlot, isBellatrixStateType} from "@chainsafe/lodestar-beacon-state-transition"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ForkSeq, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {Slot} from "@chainsafe/lodestar-types"; -import {ILogger, sleep} from "@chainsafe/lodestar-utils"; +import {computeEpochAtSlot, isBellatrixStateType} from "@lodestar/state-transition"; +import {IChainForkConfig} from "@lodestar/config"; +import {ForkSeq, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {Slot} from "@lodestar/types"; +import {ILogger, sleep} from "@lodestar/utils"; import {GENESIS_EPOCH, ZERO_HASH_HEX} from "../constants/constants.js"; import {IMetrics} from "../metrics/index.js"; import {ChainEvent} from "./emitter.js"; diff --git a/packages/lodestar/src/chain/regen/errors.ts b/packages/beacon-node/src/chain/regen/errors.ts similarity index 94% rename from packages/lodestar/src/chain/regen/errors.ts rename to packages/beacon-node/src/chain/regen/errors.ts index c0ce7319c03d..85d43d1a4fe8 100644 --- a/packages/lodestar/src/chain/regen/errors.ts +++ b/packages/beacon-node/src/chain/regen/errors.ts @@ -1,4 +1,4 @@ -import {Root, Slot, RootHex} from "@chainsafe/lodestar-types"; +import {Root, Slot, RootHex} from "@lodestar/types"; export enum RegenErrorCode { BLOCK_NOT_IN_FORKCHOICE = "REGEN_ERROR_BLOCK_NOT_IN_FORKCHOICE", diff --git a/packages/lodestar/src/chain/regen/index.ts b/packages/beacon-node/src/chain/regen/index.ts similarity index 100% rename from packages/lodestar/src/chain/regen/index.ts rename to packages/beacon-node/src/chain/regen/index.ts diff --git a/packages/lodestar/src/chain/regen/interface.ts b/packages/beacon-node/src/chain/regen/interface.ts similarity index 90% rename from packages/lodestar/src/chain/regen/interface.ts rename to packages/beacon-node/src/chain/regen/interface.ts index 9fde0be87b73..2873d90c5ae7 100644 --- a/packages/lodestar/src/chain/regen/interface.ts +++ b/packages/beacon-node/src/chain/regen/interface.ts @@ -1,5 +1,5 @@ -import {allForks, phase0, Slot, RootHex} from "@chainsafe/lodestar-types"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {allForks, phase0, Slot, RootHex} from "@lodestar/types"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; export enum RegenCaller { getDuties = "getDuties", diff --git a/packages/lodestar/src/chain/regen/queued.ts b/packages/beacon-node/src/chain/regen/queued.ts similarity index 96% rename from packages/lodestar/src/chain/regen/queued.ts rename to packages/beacon-node/src/chain/regen/queued.ts index d96adc582d58..87c7b7cd9857 100644 --- a/packages/lodestar/src/chain/regen/queued.ts +++ b/packages/beacon-node/src/chain/regen/queued.ts @@ -1,6 +1,6 @@ -import {phase0, Slot, allForks, RootHex} from "@chainsafe/lodestar-types"; -import {IForkChoice} from "@chainsafe/lodestar-fork-choice"; -import {CachedBeaconStateAllForks, computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; +import {phase0, Slot, allForks, RootHex} from "@lodestar/types"; +import {IForkChoice} from "@lodestar/fork-choice"; +import {CachedBeaconStateAllForks, computeEpochAtSlot} from "@lodestar/state-transition"; import {toHexString} from "@chainsafe/ssz"; import {CheckpointStateCache, StateContextCache, toCheckpointHex} from "../stateCache/index.js"; import {IMetrics} from "../../metrics/index.js"; diff --git a/packages/lodestar/src/chain/regen/regen.ts b/packages/beacon-node/src/chain/regen/regen.ts similarity index 95% rename from packages/lodestar/src/chain/regen/regen.ts rename to packages/beacon-node/src/chain/regen/regen.ts index 6368c2d118d4..0241a6ef4323 100644 --- a/packages/lodestar/src/chain/regen/regen.ts +++ b/packages/beacon-node/src/chain/regen/regen.ts @@ -1,16 +1,16 @@ -import {allForks, phase0, Slot, RootHex} from "@chainsafe/lodestar-types"; +import {allForks, phase0, Slot, RootHex} from "@lodestar/types"; import { CachedBeaconStateAllForks, computeEpochAtSlot, computeStartSlotAtEpoch, processSlots, stateTransition, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import {fromHexString, toHexString} from "@chainsafe/ssz"; -import {IForkChoice, ProtoBlock} from "@chainsafe/lodestar-fork-choice"; -import {sleep} from "@chainsafe/lodestar-utils"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IForkChoice, ProtoBlock} from "@lodestar/fork-choice"; +import {sleep} from "@lodestar/utils"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {IChainForkConfig} from "@lodestar/config"; import {IMetrics} from "../../metrics/index.js"; import {IBeaconDb} from "../../db/index.js"; import {CheckpointStateCache, StateContextCache} from "../stateCache/index.js"; diff --git a/packages/lodestar/src/chain/reprocess.ts b/packages/beacon-node/src/chain/reprocess.ts similarity index 99% rename from packages/lodestar/src/chain/reprocess.ts rename to packages/beacon-node/src/chain/reprocess.ts index cb885ebce589..62ec68736de3 100644 --- a/packages/lodestar/src/chain/reprocess.ts +++ b/packages/beacon-node/src/chain/reprocess.ts @@ -1,4 +1,4 @@ -import {Slot, RootHex} from "@chainsafe/lodestar-types"; +import {Slot, RootHex} from "@lodestar/types"; import {IMetrics} from "../metrics/index.js"; import {MapDef} from "../util/map.js"; diff --git a/packages/lodestar/src/chain/seenCache/index.ts b/packages/beacon-node/src/chain/seenCache/index.ts similarity index 100% rename from packages/lodestar/src/chain/seenCache/index.ts rename to packages/beacon-node/src/chain/seenCache/index.ts diff --git a/packages/lodestar/src/chain/seenCache/seenAggregateAndProof.ts b/packages/beacon-node/src/chain/seenCache/seenAggregateAndProof.ts similarity index 98% rename from packages/lodestar/src/chain/seenCache/seenAggregateAndProof.ts rename to packages/beacon-node/src/chain/seenCache/seenAggregateAndProof.ts index b8a20932d340..9dc4007abf92 100644 --- a/packages/lodestar/src/chain/seenCache/seenAggregateAndProof.ts +++ b/packages/beacon-node/src/chain/seenCache/seenAggregateAndProof.ts @@ -1,4 +1,4 @@ -import {Epoch, RootHex} from "@chainsafe/lodestar-types"; +import {Epoch, RootHex} from "@lodestar/types"; import {BitArray} from "@chainsafe/ssz"; import {IMetrics} from "../../metrics/index.js"; import {isSuperSetOrEqual} from "../../util/bitArray.js"; diff --git a/packages/lodestar/src/chain/seenCache/seenAttesters.ts b/packages/beacon-node/src/chain/seenCache/seenAttesters.ts similarity index 96% rename from packages/lodestar/src/chain/seenCache/seenAttesters.ts rename to packages/beacon-node/src/chain/seenCache/seenAttesters.ts index 97f523fea9a8..dd4a908640af 100644 --- a/packages/lodestar/src/chain/seenCache/seenAttesters.ts +++ b/packages/beacon-node/src/chain/seenCache/seenAttesters.ts @@ -1,4 +1,4 @@ -import {Epoch, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {Epoch, ValidatorIndex} from "@lodestar/types"; import {MapDef} from "../../util/map.js"; // The next, current and previous epochs. We require the next epoch due to the diff --git a/packages/lodestar/src/chain/seenCache/seenBlockAttesters.ts b/packages/beacon-node/src/chain/seenCache/seenBlockAttesters.ts similarity index 90% rename from packages/lodestar/src/chain/seenCache/seenBlockAttesters.ts rename to packages/beacon-node/src/chain/seenCache/seenBlockAttesters.ts index 12e58dd917a4..dd1fd60167b2 100644 --- a/packages/lodestar/src/chain/seenCache/seenBlockAttesters.ts +++ b/packages/beacon-node/src/chain/seenCache/seenBlockAttesters.ts @@ -1,4 +1,4 @@ -import {Epoch, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {Epoch, ValidatorIndex} from "@lodestar/types"; import {SeenAttesters} from "./seenAttesters.js"; // TODO abstract out the Seen* caches into an abstract abstract data structure // that all the caches can extend since they share similar structure. diff --git a/packages/lodestar/src/chain/seenCache/seenBlockProposers.ts b/packages/beacon-node/src/chain/seenCache/seenBlockProposers.ts similarity index 90% rename from packages/lodestar/src/chain/seenCache/seenBlockProposers.ts rename to packages/beacon-node/src/chain/seenCache/seenBlockProposers.ts index 08420f284f58..a3084e0a14cb 100644 --- a/packages/lodestar/src/chain/seenCache/seenBlockProposers.ts +++ b/packages/beacon-node/src/chain/seenCache/seenBlockProposers.ts @@ -1,5 +1,5 @@ -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; -import {Epoch, Slot, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; +import {Epoch, Slot, ValidatorIndex} from "@lodestar/types"; import {MapDef} from "../../util/map.js"; /** diff --git a/packages/lodestar/src/chain/seenCache/seenCommittee.ts b/packages/beacon-node/src/chain/seenCache/seenCommittee.ts similarity index 94% rename from packages/lodestar/src/chain/seenCache/seenCommittee.ts rename to packages/beacon-node/src/chain/seenCache/seenCommittee.ts index 218bf5ef171e..b732df0c4509 100644 --- a/packages/lodestar/src/chain/seenCache/seenCommittee.ts +++ b/packages/beacon-node/src/chain/seenCache/seenCommittee.ts @@ -1,4 +1,4 @@ -import {SubcommitteeIndex, Slot, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {SubcommitteeIndex, Slot, ValidatorIndex} from "@lodestar/types"; import {MapDef} from "../../util/map.js"; /** diff --git a/packages/lodestar/src/chain/seenCache/seenCommitteeContribution.ts b/packages/beacon-node/src/chain/seenCache/seenCommitteeContribution.ts similarity index 97% rename from packages/lodestar/src/chain/seenCache/seenCommitteeContribution.ts rename to packages/beacon-node/src/chain/seenCache/seenCommitteeContribution.ts index b140139eee54..8cba5654d5f4 100644 --- a/packages/lodestar/src/chain/seenCache/seenCommitteeContribution.ts +++ b/packages/beacon-node/src/chain/seenCache/seenCommitteeContribution.ts @@ -1,5 +1,5 @@ -import {Slot, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {ContributionAndProof, SyncCommitteeContribution} from "@chainsafe/lodestar-types/altair"; +import {Slot, ValidatorIndex} from "@lodestar/types"; +import {ContributionAndProof, SyncCommitteeContribution} from "@lodestar/types/altair"; import {toHexString} from "@chainsafe/ssz"; import {IMetrics} from "../../metrics/index.js"; import {isSuperSetOrEqual} from "../../util/bitArray.js"; diff --git a/packages/lodestar/src/chain/stateCache/index.ts b/packages/beacon-node/src/chain/stateCache/index.ts similarity index 100% rename from packages/lodestar/src/chain/stateCache/index.ts rename to packages/beacon-node/src/chain/stateCache/index.ts diff --git a/packages/lodestar/src/chain/stateCache/mapMetrics.ts b/packages/beacon-node/src/chain/stateCache/mapMetrics.ts similarity index 100% rename from packages/lodestar/src/chain/stateCache/mapMetrics.ts rename to packages/beacon-node/src/chain/stateCache/mapMetrics.ts diff --git a/packages/lodestar/src/chain/stateCache/stateContextCache.ts b/packages/beacon-node/src/chain/stateCache/stateContextCache.ts similarity index 94% rename from packages/lodestar/src/chain/stateCache/stateContextCache.ts rename to packages/beacon-node/src/chain/stateCache/stateContextCache.ts index b3eb393f576b..a506afbe23a9 100644 --- a/packages/lodestar/src/chain/stateCache/stateContextCache.ts +++ b/packages/beacon-node/src/chain/stateCache/stateContextCache.ts @@ -1,7 +1,7 @@ import {toHexString} from "@chainsafe/ssz"; -import {Epoch, Root, RootHex} from "@chainsafe/lodestar-types"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {routes} from "@chainsafe/lodestar-api"; +import {Epoch, Root, RootHex} from "@lodestar/types"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; +import {routes} from "@lodestar/api"; import {IMetrics} from "../../metrics/index.js"; import {MapTracker} from "./mapMetrics.js"; diff --git a/packages/lodestar/src/chain/stateCache/stateContextCheckpointsCache.ts b/packages/beacon-node/src/chain/stateCache/stateContextCheckpointsCache.ts similarity index 96% rename from packages/lodestar/src/chain/stateCache/stateContextCheckpointsCache.ts rename to packages/beacon-node/src/chain/stateCache/stateContextCheckpointsCache.ts index 358d94199ee9..11c885cd2f14 100644 --- a/packages/lodestar/src/chain/stateCache/stateContextCheckpointsCache.ts +++ b/packages/beacon-node/src/chain/stateCache/stateContextCheckpointsCache.ts @@ -1,7 +1,7 @@ import {toHexString} from "@chainsafe/ssz"; -import {phase0, Epoch, RootHex} from "@chainsafe/lodestar-types"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {routes} from "@chainsafe/lodestar-api"; +import {phase0, Epoch, RootHex} from "@lodestar/types"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; +import {routes} from "@lodestar/api"; import {IMetrics} from "../../metrics/index.js"; import {MapDef} from "../../util/map.js"; import {MapTracker} from "./mapMetrics.js"; diff --git a/packages/lodestar/src/chain/validation/aggregateAndProof.ts b/packages/beacon-node/src/chain/validation/aggregateAndProof.ts similarity index 98% rename from packages/lodestar/src/chain/validation/aggregateAndProof.ts rename to packages/beacon-node/src/chain/validation/aggregateAndProof.ts index 834727271ee8..bbbf89e45cd8 100644 --- a/packages/lodestar/src/chain/validation/aggregateAndProof.ts +++ b/packages/beacon-node/src/chain/validation/aggregateAndProof.ts @@ -1,10 +1,10 @@ import {toHexString} from "@chainsafe/ssz"; -import {phase0, ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {phase0, ssz, ValidatorIndex} from "@lodestar/types"; import { computeEpochAtSlot, isAggregatorFromCommitteeLength, getIndexedAttestationSignatureSet, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import {IBeaconChain} from ".."; import {AttestationError, AttestationErrorCode, GossipAction} from "../errors/index.js"; import {RegenCaller} from "../regen/index.js"; diff --git a/packages/lodestar/src/chain/validation/attestation.ts b/packages/beacon-node/src/chain/validation/attestation.ts similarity index 98% rename from packages/lodestar/src/chain/validation/attestation.ts rename to packages/beacon-node/src/chain/validation/attestation.ts index fcf5f675e08a..60ef8d27878d 100644 --- a/packages/lodestar/src/chain/validation/attestation.ts +++ b/packages/beacon-node/src/chain/validation/attestation.ts @@ -1,12 +1,12 @@ -import {phase0, Epoch, Root, Slot} from "@chainsafe/lodestar-types"; -import {ProtoBlock} from "@chainsafe/lodestar-fork-choice"; -import {ATTESTATION_SUBNET_COUNT, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {phase0, Epoch, Root, Slot} from "@lodestar/types"; +import {ProtoBlock} from "@lodestar/fork-choice"; +import {ATTESTATION_SUBNET_COUNT, SLOTS_PER_EPOCH} from "@lodestar/params"; import {toHexString} from "@chainsafe/ssz"; import { computeEpochAtSlot, CachedBeaconStateAllForks, getIndexedAttestationSignatureSet, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import {IBeaconChain} from ".."; import {AttestationError, AttestationErrorCode, GossipAction} from "../errors/index.js"; import {MAXIMUM_GOSSIP_CLOCK_DISPARITY_SEC} from "../../constants/index.js"; diff --git a/packages/lodestar/src/chain/validation/attesterSlashing.ts b/packages/beacon-node/src/chain/validation/attesterSlashing.ts similarity index 94% rename from packages/lodestar/src/chain/validation/attesterSlashing.ts rename to packages/beacon-node/src/chain/validation/attesterSlashing.ts index 30ea4090a6f1..b1f800264f82 100644 --- a/packages/lodestar/src/chain/validation/attesterSlashing.ts +++ b/packages/beacon-node/src/chain/validation/attesterSlashing.ts @@ -1,9 +1,9 @@ -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import { getAttesterSlashableIndices, assertValidAttesterSlashing, getAttesterSlashingSignatureSets, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import {IBeaconChain} from ".."; import {AttesterSlashingError, AttesterSlashingErrorCode, GossipAction} from "../errors/index.js"; diff --git a/packages/lodestar/src/chain/validation/block.ts b/packages/beacon-node/src/chain/validation/block.ts similarity index 96% rename from packages/lodestar/src/chain/validation/block.ts rename to packages/beacon-node/src/chain/validation/block.ts index 6f373606ccc1..9cd43a0b9a8a 100644 --- a/packages/lodestar/src/chain/validation/block.ts +++ b/packages/beacon-node/src/chain/validation/block.ts @@ -1,5 +1,5 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {allForks} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {allForks} from "@lodestar/types"; import { computeStartSlotAtEpoch, computeTimeAtSlot, @@ -7,9 +7,9 @@ import { isBellatrixStateType, isExecutionEnabled, getProposerSignatureSet, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {sleep} from "@chainsafe/lodestar-utils"; -import {ForkName} from "@chainsafe/lodestar-params"; +} from "@lodestar/state-transition"; +import {sleep} from "@lodestar/utils"; +import {ForkName} from "@lodestar/params"; import {toHexString} from "@chainsafe/ssz"; import {MAXIMUM_GOSSIP_CLOCK_DISPARITY} from "../../constants/index.js"; import {IBeaconChain} from "../interface.js"; diff --git a/packages/lodestar/src/chain/validation/index.ts b/packages/beacon-node/src/chain/validation/index.ts similarity index 100% rename from packages/lodestar/src/chain/validation/index.ts rename to packages/beacon-node/src/chain/validation/index.ts diff --git a/packages/lodestar/src/chain/validation/proposerSlashing.ts b/packages/beacon-node/src/chain/validation/proposerSlashing.ts similarity index 88% rename from packages/lodestar/src/chain/validation/proposerSlashing.ts rename to packages/beacon-node/src/chain/validation/proposerSlashing.ts index 86654c24f348..543f4ded892b 100644 --- a/packages/lodestar/src/chain/validation/proposerSlashing.ts +++ b/packages/beacon-node/src/chain/validation/proposerSlashing.ts @@ -1,8 +1,5 @@ -import {phase0} from "@chainsafe/lodestar-types"; -import { - assertValidProposerSlashing, - getProposerSlashingSignatureSets, -} from "@chainsafe/lodestar-beacon-state-transition"; +import {phase0} from "@lodestar/types"; +import {assertValidProposerSlashing, getProposerSlashingSignatureSets} from "@lodestar/state-transition"; import {IBeaconChain} from ".."; import {ProposerSlashingError, ProposerSlashingErrorCode, GossipAction} from "../errors/index.js"; diff --git a/packages/lodestar/src/chain/validation/signatureSets/aggregateAndProof.ts b/packages/beacon-node/src/chain/validation/signatureSets/aggregateAndProof.ts similarity index 76% rename from packages/lodestar/src/chain/validation/signatureSets/aggregateAndProof.ts rename to packages/beacon-node/src/chain/validation/signatureSets/aggregateAndProof.ts index 4a013f409fb1..85db76e36d3a 100644 --- a/packages/lodestar/src/chain/validation/signatureSets/aggregateAndProof.ts +++ b/packages/beacon-node/src/chain/validation/signatureSets/aggregateAndProof.ts @@ -1,6 +1,6 @@ -import {DOMAIN_AGGREGATE_AND_PROOF} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; -import {Epoch, phase0} from "@chainsafe/lodestar-types"; +import {DOMAIN_AGGREGATE_AND_PROOF} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; +import {Epoch, phase0} from "@lodestar/types"; import type {PublicKey} from "@chainsafe/bls/types"; import { CachedBeaconStateAllForks, @@ -8,7 +8,7 @@ import { computeStartSlotAtEpoch, ISignatureSet, SignatureSetType, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; export function getAggregateAndProofSignatureSet( state: CachedBeaconStateAllForks, diff --git a/packages/lodestar/src/chain/validation/signatureSets/contributionAndProof.ts b/packages/beacon-node/src/chain/validation/signatureSets/contributionAndProof.ts similarity index 80% rename from packages/lodestar/src/chain/validation/signatureSets/contributionAndProof.ts rename to packages/beacon-node/src/chain/validation/signatureSets/contributionAndProof.ts index a8fd97e54634..799978cb2927 100644 --- a/packages/lodestar/src/chain/validation/signatureSets/contributionAndProof.ts +++ b/packages/beacon-node/src/chain/validation/signatureSets/contributionAndProof.ts @@ -1,11 +1,11 @@ -import {DOMAIN_CONTRIBUTION_AND_PROOF} from "@chainsafe/lodestar-params"; -import {altair, ssz} from "@chainsafe/lodestar-types"; +import {DOMAIN_CONTRIBUTION_AND_PROOF} from "@lodestar/params"; +import {altair, ssz} from "@lodestar/types"; import { CachedBeaconStateAllForks, computeSigningRoot, ISignatureSet, SignatureSetType, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; export function getContributionAndProofSignatureSet( state: CachedBeaconStateAllForks, diff --git a/packages/lodestar/src/chain/validation/signatureSets/index.ts b/packages/beacon-node/src/chain/validation/signatureSets/index.ts similarity index 100% rename from packages/lodestar/src/chain/validation/signatureSets/index.ts rename to packages/beacon-node/src/chain/validation/signatureSets/index.ts diff --git a/packages/lodestar/src/chain/validation/signatureSets/selectionProof.ts b/packages/beacon-node/src/chain/validation/signatureSets/selectionProof.ts similarity index 77% rename from packages/lodestar/src/chain/validation/signatureSets/selectionProof.ts rename to packages/beacon-node/src/chain/validation/signatureSets/selectionProof.ts index cb19885e87ed..e68f5bea8d25 100644 --- a/packages/lodestar/src/chain/validation/signatureSets/selectionProof.ts +++ b/packages/beacon-node/src/chain/validation/signatureSets/selectionProof.ts @@ -1,12 +1,12 @@ -import {DOMAIN_SELECTION_PROOF} from "@chainsafe/lodestar-params"; -import {phase0, Slot, ssz} from "@chainsafe/lodestar-types"; +import {DOMAIN_SELECTION_PROOF} from "@lodestar/params"; +import {phase0, Slot, ssz} from "@lodestar/types"; import type {PublicKey} from "@chainsafe/bls/types"; import { CachedBeaconStateAllForks, computeSigningRoot, ISignatureSet, SignatureSetType, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; export function getSelectionProofSignatureSet( state: CachedBeaconStateAllForks, diff --git a/packages/lodestar/src/chain/validation/signatureSets/syncCommittee.ts b/packages/beacon-node/src/chain/validation/signatureSets/syncCommittee.ts similarity index 76% rename from packages/lodestar/src/chain/validation/signatureSets/syncCommittee.ts rename to packages/beacon-node/src/chain/validation/signatureSets/syncCommittee.ts index 1c5d02732c36..25b80504483d 100644 --- a/packages/lodestar/src/chain/validation/signatureSets/syncCommittee.ts +++ b/packages/beacon-node/src/chain/validation/signatureSets/syncCommittee.ts @@ -1,11 +1,11 @@ -import {DOMAIN_SYNC_COMMITTEE} from "@chainsafe/lodestar-params"; -import {altair, ssz} from "@chainsafe/lodestar-types"; +import {DOMAIN_SYNC_COMMITTEE} from "@lodestar/params"; +import {altair, ssz} from "@lodestar/types"; import { CachedBeaconStateAllForks, computeSigningRoot, ISignatureSet, SignatureSetType, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; export function getSyncCommitteeSignatureSet( state: CachedBeaconStateAllForks, diff --git a/packages/lodestar/src/chain/validation/signatureSets/syncCommitteeContribution.ts b/packages/beacon-node/src/chain/validation/signatureSets/syncCommitteeContribution.ts similarity index 65% rename from packages/lodestar/src/chain/validation/signatureSets/syncCommitteeContribution.ts rename to packages/beacon-node/src/chain/validation/signatureSets/syncCommitteeContribution.ts index 7d4e3fc16c09..8f854114d7ba 100644 --- a/packages/lodestar/src/chain/validation/signatureSets/syncCommitteeContribution.ts +++ b/packages/beacon-node/src/chain/validation/signatureSets/syncCommitteeContribution.ts @@ -1,12 +1,7 @@ import type {PublicKey} from "@chainsafe/bls/types"; -import {altair, ssz} from "@chainsafe/lodestar-types"; -import {DOMAIN_SYNC_COMMITTEE} from "@chainsafe/lodestar-params"; -import { - CachedBeaconStateAltair, - computeSigningRoot, - ISignatureSet, - SignatureSetType, -} from "@chainsafe/lodestar-beacon-state-transition"; +import {altair, ssz} from "@lodestar/types"; +import {DOMAIN_SYNC_COMMITTEE} from "@lodestar/params"; +import {CachedBeaconStateAltair, computeSigningRoot, ISignatureSet, SignatureSetType} from "@lodestar/state-transition"; export function getSyncCommitteeContributionSignatureSet( state: CachedBeaconStateAltair, diff --git a/packages/lodestar/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts b/packages/beacon-node/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts similarity index 81% rename from packages/lodestar/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts rename to packages/beacon-node/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts index ca7428b6ea4c..a180e43c9de4 100644 --- a/packages/lodestar/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +++ b/packages/beacon-node/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts @@ -1,11 +1,11 @@ -import {DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF} from "@chainsafe/lodestar-params"; -import {altair, ssz} from "@chainsafe/lodestar-types"; +import {DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF} from "@lodestar/params"; +import {altair, ssz} from "@lodestar/types"; import { CachedBeaconStateAllForks, computeSigningRoot, ISignatureSet, SignatureSetType, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; export function getSyncCommitteeSelectionProofSignatureSet( state: CachedBeaconStateAllForks, diff --git a/packages/lodestar/src/chain/validation/syncCommittee.ts b/packages/beacon-node/src/chain/validation/syncCommittee.ts similarity index 96% rename from packages/lodestar/src/chain/validation/syncCommittee.ts rename to packages/beacon-node/src/chain/validation/syncCommittee.ts index 933280ca6705..2fe39bf4c76b 100644 --- a/packages/lodestar/src/chain/validation/syncCommittee.ts +++ b/packages/beacon-node/src/chain/validation/syncCommittee.ts @@ -1,6 +1,6 @@ -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {SYNC_COMMITTEE_SUBNET_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {altair} from "@chainsafe/lodestar-types"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; +import {SYNC_COMMITTEE_SUBNET_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {altair} from "@lodestar/types"; import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js"; import {IBeaconChain} from "../interface.js"; import {getSyncCommitteeSignatureSet} from "./signatureSets/index.js"; diff --git a/packages/lodestar/src/chain/validation/syncCommitteeContributionAndProof.ts b/packages/beacon-node/src/chain/validation/syncCommitteeContributionAndProof.ts similarity index 96% rename from packages/lodestar/src/chain/validation/syncCommitteeContributionAndProof.ts rename to packages/beacon-node/src/chain/validation/syncCommitteeContributionAndProof.ts index 95ffbd257ff8..98266cdaa1ac 100644 --- a/packages/lodestar/src/chain/validation/syncCommitteeContributionAndProof.ts +++ b/packages/beacon-node/src/chain/validation/syncCommitteeContributionAndProof.ts @@ -1,6 +1,6 @@ -import {CachedBeaconStateAltair, isSyncCommitteeAggregator} from "@chainsafe/lodestar-beacon-state-transition"; -import {altair, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {SYNC_COMMITTEE_SUBNET_SIZE} from "@chainsafe/lodestar-params"; +import {CachedBeaconStateAltair, isSyncCommitteeAggregator} from "@lodestar/state-transition"; +import {altair, ValidatorIndex} from "@lodestar/types"; +import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js"; import {IBeaconChain} from "../interface.js"; import {validateGossipSyncCommitteeExceptSig} from "./syncCommittee.js"; diff --git a/packages/lodestar/src/chain/validation/voluntaryExit.ts b/packages/beacon-node/src/chain/validation/voluntaryExit.ts similarity index 94% rename from packages/lodestar/src/chain/validation/voluntaryExit.ts rename to packages/beacon-node/src/chain/validation/voluntaryExit.ts index 4b96124bef74..ba981678b6b0 100644 --- a/packages/lodestar/src/chain/validation/voluntaryExit.ts +++ b/packages/beacon-node/src/chain/validation/voluntaryExit.ts @@ -1,5 +1,5 @@ -import {phase0} from "@chainsafe/lodestar-types"; -import {isValidVoluntaryExit, getVoluntaryExitSignatureSet} from "@chainsafe/lodestar-beacon-state-transition"; +import {phase0} from "@lodestar/types"; +import {isValidVoluntaryExit, getVoluntaryExitSignatureSet} from "@lodestar/state-transition"; import {IBeaconChain} from ".."; import {VoluntaryExitError, VoluntaryExitErrorCode, GossipAction} from "../errors/index.js"; diff --git a/packages/lodestar/src/constants/constants.ts b/packages/beacon-node/src/constants/constants.ts similarity index 100% rename from packages/lodestar/src/constants/constants.ts rename to packages/beacon-node/src/constants/constants.ts diff --git a/packages/lodestar/src/constants/index.ts b/packages/beacon-node/src/constants/index.ts similarity index 100% rename from packages/lodestar/src/constants/index.ts rename to packages/beacon-node/src/constants/index.ts diff --git a/packages/lodestar/src/constants/network.ts b/packages/beacon-node/src/constants/network.ts similarity index 100% rename from packages/lodestar/src/constants/network.ts rename to packages/beacon-node/src/constants/network.ts diff --git a/packages/lodestar/src/db/beacon.ts b/packages/beacon-node/src/db/beacon.ts similarity index 94% rename from packages/lodestar/src/db/beacon.ts rename to packages/beacon-node/src/db/beacon.ts index d73caa79512d..335879c3ee79 100644 --- a/packages/lodestar/src/db/beacon.ts +++ b/packages/beacon-node/src/db/beacon.ts @@ -2,7 +2,7 @@ * @module db/api/beacon */ -import {DatabaseService, IDatabaseApiOptions} from "@chainsafe/lodestar-db"; +import {DatabaseService, IDatabaseApiOptions} from "@lodestar/db"; import {IBeaconDb} from "./interface.js"; import { AttesterSlashingRepository, @@ -48,7 +48,7 @@ export class BeaconDb extends DatabaseService implements IBeaconDb { constructor(opts: IDatabaseApiOptions) { super(opts); - // Warning: If code is ever run in the constructor, must change this stub to not extend 'packages/lodestar/test/utils/stub/beaconDb.ts' - + // Warning: If code is ever run in the constructor, must change this stub to not extend 'packages/beacon-node/test/utils/stub/beaconDb.ts' - this.block = new BlockRepository(this.config, this.db); this.blockArchive = new BlockArchiveRepository(this.config, this.db); this.stateArchive = new StateArchiveRepository(this.config, this.db); diff --git a/packages/lodestar/src/db/index.ts b/packages/beacon-node/src/db/index.ts similarity index 100% rename from packages/lodestar/src/db/index.ts rename to packages/beacon-node/src/db/index.ts diff --git a/packages/lodestar/src/db/interface.ts b/packages/beacon-node/src/db/interface.ts similarity index 96% rename from packages/lodestar/src/db/interface.ts rename to packages/beacon-node/src/db/interface.ts index be4a6647717d..4d10f8d328f1 100644 --- a/packages/lodestar/src/db/interface.ts +++ b/packages/beacon-node/src/db/interface.ts @@ -2,7 +2,7 @@ * @module db/api/beacon */ -import {ILevelDbControllerMetrics} from "@chainsafe/lodestar-db"; +import {ILevelDbControllerMetrics} from "@lodestar/db"; import { AttesterSlashingRepository, BlockArchiveRepository, diff --git a/packages/lodestar/src/db/options.ts b/packages/beacon-node/src/db/options.ts similarity index 100% rename from packages/lodestar/src/db/options.ts rename to packages/beacon-node/src/db/options.ts diff --git a/packages/lodestar/src/db/repositories/attesterSlashing.ts b/packages/beacon-node/src/db/repositories/attesterSlashing.ts similarity index 82% rename from packages/lodestar/src/db/repositories/attesterSlashing.ts rename to packages/beacon-node/src/db/repositories/attesterSlashing.ts index 4a28fc614945..438efa8ebf54 100644 --- a/packages/lodestar/src/db/repositories/attesterSlashing.ts +++ b/packages/beacon-node/src/db/repositories/attesterSlashing.ts @@ -1,6 +1,6 @@ -import {phase0, ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Db, Bucket, Repository} from "@chainsafe/lodestar-db"; +import {phase0, ssz, ValidatorIndex} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Db, Bucket, Repository} from "@lodestar/db"; /** * AttesterSlashing indexed by root diff --git a/packages/lodestar/src/db/repositories/backfilledRanges.ts b/packages/beacon-node/src/db/repositories/backfilledRanges.ts similarity index 77% rename from packages/lodestar/src/db/repositories/backfilledRanges.ts rename to packages/beacon-node/src/db/repositories/backfilledRanges.ts index e4c974973d16..143e6a440181 100644 --- a/packages/lodestar/src/db/repositories/backfilledRanges.ts +++ b/packages/beacon-node/src/db/repositories/backfilledRanges.ts @@ -1,7 +1,7 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Slot, ssz} from "@chainsafe/lodestar-types"; -import {IDatabaseController, Bucket, Repository} from "@chainsafe/lodestar-db"; -import {bytesToInt} from "@chainsafe/lodestar-utils"; +import {IChainForkConfig} from "@lodestar/config"; +import {Slot, ssz} from "@lodestar/types"; +import {IDatabaseController, Bucket, Repository} from "@lodestar/db"; +import {bytesToInt} from "@lodestar/utils"; /** * Slot to slot ranges that ensure that block range is fully backfilled diff --git a/packages/lodestar/src/db/repositories/block.ts b/packages/beacon-node/src/db/repositories/block.ts similarity index 83% rename from packages/lodestar/src/db/repositories/block.ts rename to packages/beacon-node/src/db/repositories/block.ts index 94e835b04722..1e313b056fa7 100644 --- a/packages/lodestar/src/db/repositories/block.ts +++ b/packages/beacon-node/src/db/repositories/block.ts @@ -1,6 +1,6 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Bucket, Db, Repository} from "@chainsafe/lodestar-db"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Bucket, Db, Repository} from "@lodestar/db"; +import {allForks, ssz} from "@lodestar/types"; import {getSignedBlockTypeFromBytes} from "../../util/multifork.js"; /** diff --git a/packages/lodestar/src/db/repositories/blockArchive.ts b/packages/beacon-node/src/db/repositories/blockArchive.ts similarity index 96% rename from packages/lodestar/src/db/repositories/blockArchive.ts rename to packages/beacon-node/src/db/repositories/blockArchive.ts index 25e4bb433f52..efa88373dc25 100644 --- a/packages/lodestar/src/db/repositories/blockArchive.ts +++ b/packages/beacon-node/src/db/repositories/blockArchive.ts @@ -1,8 +1,8 @@ import all from "it-all"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Db, Repository, IKeyValue, IFilterOptions, Bucket} from "@chainsafe/lodestar-db"; -import {Slot, Root, allForks, ssz} from "@chainsafe/lodestar-types"; -import {bytesToInt} from "@chainsafe/lodestar-utils"; +import {IChainForkConfig} from "@lodestar/config"; +import {Db, Repository, IKeyValue, IFilterOptions, Bucket} from "@lodestar/db"; +import {Slot, Root, allForks, ssz} from "@lodestar/types"; +import {bytesToInt} from "@lodestar/utils"; import {getSignedBlockTypeFromBytes} from "../../util/multifork.js"; import {getRootIndexKey, getParentRootIndexKey} from "./blockArchiveIndex.js"; import {deleteParentRootIndex, deleteRootIndex, storeParentRootIndex, storeRootIndex} from "./blockArchiveIndex.js"; diff --git a/packages/lodestar/src/db/repositories/blockArchiveIndex.ts b/packages/beacon-node/src/db/repositories/blockArchiveIndex.ts similarity index 86% rename from packages/lodestar/src/db/repositories/blockArchiveIndex.ts rename to packages/beacon-node/src/db/repositories/blockArchiveIndex.ts index 3587eea954fd..12e501e41b1f 100644 --- a/packages/lodestar/src/db/repositories/blockArchiveIndex.ts +++ b/packages/beacon-node/src/db/repositories/blockArchiveIndex.ts @@ -1,6 +1,6 @@ -import {Db, encodeKey, Bucket} from "@chainsafe/lodestar-db"; -import {Slot, Root, allForks, ssz} from "@chainsafe/lodestar-types"; -import {intToBytes} from "@chainsafe/lodestar-utils"; +import {Db, encodeKey, Bucket} from "@lodestar/db"; +import {Slot, Root, allForks, ssz} from "@lodestar/types"; +import {intToBytes} from "@lodestar/utils"; export async function storeRootIndex(db: Db, slot: Slot, blockRoot: Root): Promise { return db.put(getRootIndexKey(blockRoot), intToBytes(slot, 8, "be")); diff --git a/packages/lodestar/src/db/repositories/depositDataRoot.ts b/packages/beacon-node/src/db/repositories/depositDataRoot.ts similarity index 90% rename from packages/lodestar/src/db/repositories/depositDataRoot.ts rename to packages/beacon-node/src/db/repositories/depositDataRoot.ts index 9cabfe9704c0..65d7fc4cf46d 100644 --- a/packages/lodestar/src/db/repositories/depositDataRoot.ts +++ b/packages/beacon-node/src/db/repositories/depositDataRoot.ts @@ -1,8 +1,8 @@ import {ByteVectorType, CompositeViewDU, ListCompositeType} from "@chainsafe/ssz"; -import {Root, ssz} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {bytesToInt} from "@chainsafe/lodestar-utils"; -import {Db, Bucket, Repository, IKeyValue} from "@chainsafe/lodestar-db"; +import {Root, ssz} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {bytesToInt} from "@lodestar/utils"; +import {Db, Bucket, Repository, IKeyValue} from "@lodestar/db"; // TODO: Review where is best to put this type export type DepositTree = CompositeViewDU>; diff --git a/packages/lodestar/src/db/repositories/depositEvent.ts b/packages/beacon-node/src/db/repositories/depositEvent.ts similarity index 82% rename from packages/lodestar/src/db/repositories/depositEvent.ts rename to packages/beacon-node/src/db/repositories/depositEvent.ts index a9f5048b79bb..714b586ba2e7 100644 --- a/packages/lodestar/src/db/repositories/depositEvent.ts +++ b/packages/beacon-node/src/db/repositories/depositEvent.ts @@ -1,6 +1,6 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {Db, Bucket, Repository} from "@chainsafe/lodestar-db"; +import {IChainForkConfig} from "@lodestar/config"; +import {phase0, ssz} from "@lodestar/types"; +import {Db, Bucket, Repository} from "@lodestar/db"; /** * DepositData indexed by deposit index diff --git a/packages/lodestar/src/db/repositories/eth1Data.ts b/packages/beacon-node/src/db/repositories/eth1Data.ts similarity index 79% rename from packages/lodestar/src/db/repositories/eth1Data.ts rename to packages/beacon-node/src/db/repositories/eth1Data.ts index e69f5dcdd756..2f2681ec60b1 100644 --- a/packages/lodestar/src/db/repositories/eth1Data.ts +++ b/packages/beacon-node/src/db/repositories/eth1Data.ts @@ -1,7 +1,7 @@ -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {bytesToInt} from "@chainsafe/lodestar-utils"; -import {Db, Bucket, Repository} from "@chainsafe/lodestar-db"; +import {phase0, ssz} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {bytesToInt} from "@lodestar/utils"; +import {Db, Bucket, Repository} from "@lodestar/db"; export class Eth1DataRepository extends Repository { constructor(config: IChainForkConfig, db: Db) { diff --git a/packages/lodestar/src/db/repositories/index.ts b/packages/beacon-node/src/db/repositories/index.ts similarity index 100% rename from packages/lodestar/src/db/repositories/index.ts rename to packages/beacon-node/src/db/repositories/index.ts diff --git a/packages/lodestar/src/db/repositories/lightclientBestPartialUpdate.ts b/packages/beacon-node/src/db/repositories/lightclientBestPartialUpdate.ts similarity index 87% rename from packages/lodestar/src/db/repositories/lightclientBestPartialUpdate.ts rename to packages/beacon-node/src/db/repositories/lightclientBestPartialUpdate.ts index a23dff7e1579..1f7aab481ff2 100644 --- a/packages/lodestar/src/db/repositories/lightclientBestPartialUpdate.ts +++ b/packages/beacon-node/src/db/repositories/lightclientBestPartialUpdate.ts @@ -1,7 +1,7 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Bucket, IDatabaseController, Repository} from "@chainsafe/lodestar-db"; -import {FINALIZED_ROOT_DEPTH} from "@chainsafe/lodestar-params"; -import {ssz, SyncPeriod} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Bucket, IDatabaseController, Repository} from "@lodestar/db"; +import {FINALIZED_ROOT_DEPTH} from "@lodestar/params"; +import {ssz, SyncPeriod} from "@lodestar/types"; import {BooleanType, ContainerType, VectorCompositeType} from "@chainsafe/ssz"; import {PartialLightClientUpdate} from "../../chain/lightClient/types.js"; diff --git a/packages/lodestar/src/db/repositories/lightclientCheckpointHeader.ts b/packages/beacon-node/src/db/repositories/lightclientCheckpointHeader.ts similarity index 72% rename from packages/lodestar/src/db/repositories/lightclientCheckpointHeader.ts rename to packages/beacon-node/src/db/repositories/lightclientCheckpointHeader.ts index 706885e159c2..907e964e67c3 100644 --- a/packages/lodestar/src/db/repositories/lightclientCheckpointHeader.ts +++ b/packages/beacon-node/src/db/repositories/lightclientCheckpointHeader.ts @@ -1,6 +1,6 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Bucket, IDatabaseController, Repository} from "@chainsafe/lodestar-db"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Bucket, IDatabaseController, Repository} from "@lodestar/db"; +import {phase0, ssz} from "@lodestar/types"; /** * Block headers by block root. Until finality includes all headers seen by this node. After finality, diff --git a/packages/lodestar/src/db/repositories/lightclientSyncCommittee.ts b/packages/beacon-node/src/db/repositories/lightclientSyncCommittee.ts similarity index 67% rename from packages/lodestar/src/db/repositories/lightclientSyncCommittee.ts rename to packages/beacon-node/src/db/repositories/lightclientSyncCommittee.ts index 82ffa27e6245..b99c2d28291d 100644 --- a/packages/lodestar/src/db/repositories/lightclientSyncCommittee.ts +++ b/packages/beacon-node/src/db/repositories/lightclientSyncCommittee.ts @@ -1,6 +1,6 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Bucket, IDatabaseController, Repository} from "@chainsafe/lodestar-db"; -import {altair, ssz} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Bucket, IDatabaseController, Repository} from "@lodestar/db"; +import {altair, ssz} from "@lodestar/types"; /** * Historical sync committees by SyncCommittee hash tree root diff --git a/packages/lodestar/src/db/repositories/lightclientSyncCommitteeWitness.ts b/packages/beacon-node/src/db/repositories/lightclientSyncCommitteeWitness.ts similarity index 79% rename from packages/lodestar/src/db/repositories/lightclientSyncCommitteeWitness.ts rename to packages/beacon-node/src/db/repositories/lightclientSyncCommitteeWitness.ts index 6d2c3b13e77c..47756362255e 100644 --- a/packages/lodestar/src/db/repositories/lightclientSyncCommitteeWitness.ts +++ b/packages/beacon-node/src/db/repositories/lightclientSyncCommitteeWitness.ts @@ -1,6 +1,6 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Bucket, IDatabaseController, Repository} from "@chainsafe/lodestar-db"; -import {ssz} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Bucket, IDatabaseController, Repository} from "@lodestar/db"; +import {ssz} from "@lodestar/types"; import {ContainerType, VectorCompositeType} from "@chainsafe/ssz"; import {SyncCommitteeWitness} from "../../chain/lightClient/types.js"; diff --git a/packages/lodestar/src/db/repositories/proposerSlashing.ts b/packages/beacon-node/src/db/repositories/proposerSlashing.ts similarity index 64% rename from packages/lodestar/src/db/repositories/proposerSlashing.ts rename to packages/beacon-node/src/db/repositories/proposerSlashing.ts index 6056d6bf72a0..6f72601a335a 100644 --- a/packages/lodestar/src/db/repositories/proposerSlashing.ts +++ b/packages/beacon-node/src/db/repositories/proposerSlashing.ts @@ -1,6 +1,6 @@ -import {phase0, ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Db, Bucket, Repository} from "@chainsafe/lodestar-db"; +import {phase0, ssz, ValidatorIndex} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Db, Bucket, Repository} from "@lodestar/db"; export class ProposerSlashingRepository extends Repository { constructor(config: IChainForkConfig, db: Db) { diff --git a/packages/lodestar/src/db/repositories/stateArchive.ts b/packages/beacon-node/src/db/repositories/stateArchive.ts similarity index 84% rename from packages/lodestar/src/db/repositories/stateArchive.ts rename to packages/beacon-node/src/db/repositories/stateArchive.ts index 6b5e033adb6c..6a946286ef96 100644 --- a/packages/lodestar/src/db/repositories/stateArchive.ts +++ b/packages/beacon-node/src/db/repositories/stateArchive.ts @@ -1,8 +1,8 @@ -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {Epoch, Root, Slot, ssz} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {bytesToInt} from "@chainsafe/lodestar-utils"; -import {Db, Bucket, Repository} from "@chainsafe/lodestar-db"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; +import {Epoch, Root, Slot, ssz} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {bytesToInt} from "@lodestar/utils"; +import {Db, Bucket, Repository} from "@lodestar/db"; import {getStateTypeFromBytes} from "../../util/multifork.js"; import {getRootIndexKey, storeRootIndex} from "./stateArchiveIndex.js"; diff --git a/packages/lodestar/src/db/repositories/stateArchiveIndex.ts b/packages/beacon-node/src/db/repositories/stateArchiveIndex.ts similarity index 62% rename from packages/lodestar/src/db/repositories/stateArchiveIndex.ts rename to packages/beacon-node/src/db/repositories/stateArchiveIndex.ts index 62e585be79ce..ec0b2b3fdbe6 100644 --- a/packages/lodestar/src/db/repositories/stateArchiveIndex.ts +++ b/packages/beacon-node/src/db/repositories/stateArchiveIndex.ts @@ -1,6 +1,6 @@ -import {Bucket, encodeKey, Db} from "@chainsafe/lodestar-db"; -import {Root, Slot} from "@chainsafe/lodestar-types"; -import {intToBytes} from "@chainsafe/lodestar-utils"; +import {Bucket, encodeKey, Db} from "@lodestar/db"; +import {Root, Slot} from "@lodestar/types"; +import {intToBytes} from "@lodestar/utils"; export function storeRootIndex(db: Db, slot: Slot, stateRoot: Root): Promise { return db.put(getRootIndexKey(stateRoot), intToBytes(slot, 8, "be")); diff --git a/packages/lodestar/src/db/repositories/voluntaryExit.ts b/packages/beacon-node/src/db/repositories/voluntaryExit.ts similarity index 63% rename from packages/lodestar/src/db/repositories/voluntaryExit.ts rename to packages/beacon-node/src/db/repositories/voluntaryExit.ts index a16fe2f11180..2db104c13d28 100644 --- a/packages/lodestar/src/db/repositories/voluntaryExit.ts +++ b/packages/beacon-node/src/db/repositories/voluntaryExit.ts @@ -1,6 +1,6 @@ -import {phase0, ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Db, Bucket, Repository} from "@chainsafe/lodestar-db"; +import {phase0, ssz, ValidatorIndex} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Db, Bucket, Repository} from "@lodestar/db"; export class VoluntaryExitRepository extends Repository { constructor(config: IChainForkConfig, db: Db) { diff --git a/packages/lodestar/src/db/single/index.ts b/packages/beacon-node/src/db/single/index.ts similarity index 100% rename from packages/lodestar/src/db/single/index.ts rename to packages/beacon-node/src/db/single/index.ts diff --git a/packages/lodestar/src/db/single/preGenesisState.ts b/packages/beacon-node/src/db/single/preGenesisState.ts similarity index 74% rename from packages/lodestar/src/db/single/preGenesisState.ts rename to packages/beacon-node/src/db/single/preGenesisState.ts index 6cd44e59bbcc..a6f05aa476ed 100644 --- a/packages/lodestar/src/db/single/preGenesisState.ts +++ b/packages/beacon-node/src/db/single/preGenesisState.ts @@ -1,8 +1,8 @@ -import {GENESIS_SLOT} from "@chainsafe/lodestar-params"; -import {allForks} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Db, Bucket} from "@chainsafe/lodestar-db"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {GENESIS_SLOT} from "@lodestar/params"; +import {allForks} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Db, Bucket} from "@lodestar/db"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; export class PreGenesisState { private readonly config: IChainForkConfig; diff --git a/packages/lodestar/src/db/single/preGenesisStateLastProcessedBlock.ts b/packages/beacon-node/src/db/single/preGenesisStateLastProcessedBlock.ts similarity index 83% rename from packages/lodestar/src/db/single/preGenesisStateLastProcessedBlock.ts rename to packages/beacon-node/src/db/single/preGenesisStateLastProcessedBlock.ts index 0e032ee33444..e37bfc449ad9 100644 --- a/packages/lodestar/src/db/single/preGenesisStateLastProcessedBlock.ts +++ b/packages/beacon-node/src/db/single/preGenesisStateLastProcessedBlock.ts @@ -1,7 +1,7 @@ import {UintNumberType} from "@chainsafe/ssz"; -import {ssz} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Db, Bucket} from "@chainsafe/lodestar-db"; +import {ssz} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {Db, Bucket} from "@lodestar/db"; export class PreGenesisStateLastProcessedBlock { private readonly bucket: Bucket; diff --git a/packages/lodestar/src/eth1/errors.ts b/packages/beacon-node/src/eth1/errors.ts similarity index 97% rename from packages/lodestar/src/eth1/errors.ts rename to packages/beacon-node/src/eth1/errors.ts index 8585b8f227b8..914a5448ade3 100644 --- a/packages/lodestar/src/eth1/errors.ts +++ b/packages/beacon-node/src/eth1/errors.ts @@ -1,4 +1,4 @@ -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {LodestarError} from "@lodestar/utils"; export enum Eth1ErrorCode { /** Deposit index too high */ diff --git a/packages/lodestar/src/eth1/eth1DataCache.ts b/packages/beacon-node/src/eth1/eth1DataCache.ts similarity index 86% rename from packages/lodestar/src/eth1/eth1DataCache.ts rename to packages/beacon-node/src/eth1/eth1DataCache.ts index 0dd4d28b8636..3fb9b81b5acd 100644 --- a/packages/lodestar/src/eth1/eth1DataCache.ts +++ b/packages/beacon-node/src/eth1/eth1DataCache.ts @@ -1,5 +1,5 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {phase0} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {phase0} from "@lodestar/types"; import {IBeaconDb} from "../db/index.js"; export class Eth1DataCache { diff --git a/packages/lodestar/src/eth1/eth1DepositDataTracker.ts b/packages/beacon-node/src/eth1/eth1DepositDataTracker.ts similarity index 97% rename from packages/lodestar/src/eth1/eth1DepositDataTracker.ts rename to packages/beacon-node/src/eth1/eth1DepositDataTracker.ts index dc28b2b65143..f4f366a1200b 100644 --- a/packages/lodestar/src/eth1/eth1DepositDataTracker.ts +++ b/packages/beacon-node/src/eth1/eth1DepositDataTracker.ts @@ -1,7 +1,7 @@ -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {BeaconStateAllForks, becomesNewEth1Data} from "@chainsafe/lodestar-beacon-state-transition"; -import {ErrorAborted, ILogger, isErrorAborted, sleep} from "@chainsafe/lodestar-utils"; +import {phase0, ssz} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {BeaconStateAllForks, becomesNewEth1Data} from "@lodestar/state-transition"; +import {ErrorAborted, ILogger, isErrorAborted, sleep} from "@lodestar/utils"; import {IBeaconDb} from "../db/index.js"; import {IMetrics} from "../metrics/index.js"; import {Eth1DepositsCache} from "./eth1DepositsCache.js"; diff --git a/packages/lodestar/src/eth1/eth1DepositsCache.ts b/packages/beacon-node/src/eth1/eth1DepositsCache.ts similarity index 97% rename from packages/lodestar/src/eth1/eth1DepositsCache.ts rename to packages/beacon-node/src/eth1/eth1DepositsCache.ts index 4a3b23588b2e..d9100bfd0d95 100644 --- a/packages/lodestar/src/eth1/eth1DepositsCache.ts +++ b/packages/beacon-node/src/eth1/eth1DepositsCache.ts @@ -1,7 +1,7 @@ -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {phase0, ssz} from "@lodestar/types"; import {byteArrayEquals} from "@chainsafe/ssz"; -import {IFilterOptions} from "@chainsafe/lodestar-db"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IFilterOptions} from "@lodestar/db"; +import {IChainForkConfig} from "@lodestar/config"; import {IBeaconDb} from "../db/index.js"; import {getEth1DataForBlocks} from "./utils/eth1Data.js"; diff --git a/packages/lodestar/src/eth1/eth1MergeBlockTracker.ts b/packages/beacon-node/src/eth1/eth1MergeBlockTracker.ts similarity index 98% rename from packages/lodestar/src/eth1/eth1MergeBlockTracker.ts rename to packages/beacon-node/src/eth1/eth1MergeBlockTracker.ts index 85fad3b7533d..7424835a7e70 100644 --- a/packages/lodestar/src/eth1/eth1MergeBlockTracker.ts +++ b/packages/beacon-node/src/eth1/eth1MergeBlockTracker.ts @@ -1,8 +1,8 @@ -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {Epoch, RootHex} from "@chainsafe/lodestar-types"; -import {ILogger, isErrorAborted, sleep} from "@chainsafe/lodestar-utils"; +import {IChainConfig} from "@lodestar/config"; +import {Epoch, RootHex} from "@lodestar/types"; +import {ILogger, isErrorAborted, sleep} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {ZERO_HASH_HEX} from "../constants/index.js"; import {IEth1Provider, EthJsonRpcBlockRaw, PowMergeBlock} from "./interface.js"; import {quantityToNum, quantityToBigint, dataToRootHex} from "./provider/utils.js"; diff --git a/packages/lodestar/src/eth1/index.ts b/packages/beacon-node/src/eth1/index.ts similarity index 98% rename from packages/lodestar/src/eth1/index.ts rename to packages/beacon-node/src/eth1/index.ts index 2b14641b7b1f..30e942a68352 100644 --- a/packages/lodestar/src/eth1/index.ts +++ b/packages/beacon-node/src/eth1/index.ts @@ -5,8 +5,8 @@ import { getCurrentSlot, isBellatrixStateType, isMergeTransitionComplete, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {Root} from "@chainsafe/lodestar-types"; +} from "@lodestar/state-transition"; +import {Root} from "@lodestar/types"; import {fromHexString} from "@chainsafe/ssz"; import {IEth1ForBlockProduction, Eth1DataAndDeposits, IEth1Provider, PowMergeBlock} from "./interface.js"; import {Eth1DepositDataTracker, Eth1DepositDataTrackerModules} from "./eth1DepositDataTracker.js"; diff --git a/packages/lodestar/src/eth1/interface.ts b/packages/beacon-node/src/eth1/interface.ts similarity index 93% rename from packages/lodestar/src/eth1/interface.ts rename to packages/beacon-node/src/eth1/interface.ts index cf11b78bb336..187143a9501c 100644 --- a/packages/lodestar/src/eth1/interface.ts +++ b/packages/beacon-node/src/eth1/interface.ts @@ -2,9 +2,9 @@ * @module eth1 */ -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {phase0, Root, RootHex} from "@chainsafe/lodestar-types"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {phase0, Root, RootHex} from "@lodestar/types"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; export type EthJsonRpcBlockRaw = { /** the block number. null when its pending block. `"0x1b4"` */ diff --git a/packages/lodestar/src/eth1/options.ts b/packages/beacon-node/src/eth1/options.ts similarity index 100% rename from packages/lodestar/src/eth1/options.ts rename to packages/beacon-node/src/eth1/options.ts diff --git a/packages/lodestar/src/eth1/provider/eth1Provider.ts b/packages/beacon-node/src/eth1/provider/eth1Provider.ts similarity index 97% rename from packages/lodestar/src/eth1/provider/eth1Provider.ts rename to packages/beacon-node/src/eth1/provider/eth1Provider.ts index e983603212dc..b066b3026348 100644 --- a/packages/lodestar/src/eth1/provider/eth1Provider.ts +++ b/packages/beacon-node/src/eth1/provider/eth1Provider.ts @@ -1,7 +1,7 @@ import {toHexString} from "@chainsafe/ssz"; -import {phase0} from "@chainsafe/lodestar-types"; -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {fromHex, retry} from "@chainsafe/lodestar-utils"; +import {phase0} from "@lodestar/types"; +import {IChainConfig} from "@lodestar/config"; +import {fromHex, retry} from "@lodestar/utils"; import {chunkifyInclusiveRange} from "../../util/chunkify.js"; import {linspace} from "../../util/numpy.js"; diff --git a/packages/lodestar/src/eth1/provider/jsonRpcHttpClient.ts b/packages/beacon-node/src/eth1/provider/jsonRpcHttpClient.ts similarity index 99% rename from packages/lodestar/src/eth1/provider/jsonRpcHttpClient.ts rename to packages/beacon-node/src/eth1/provider/jsonRpcHttpClient.ts index 343637d10994..2f97bf8a77ef 100644 --- a/packages/lodestar/src/eth1/provider/jsonRpcHttpClient.ts +++ b/packages/beacon-node/src/eth1/provider/jsonRpcHttpClient.ts @@ -2,7 +2,7 @@ // Note: isomorphic-fetch is not well mantained and does not support abort signals import fetch from "cross-fetch"; -import {ErrorAborted, TimeoutError} from "@chainsafe/lodestar-utils"; +import {ErrorAborted, TimeoutError} from "@lodestar/utils"; import {IGauge, IHistogram} from "../../metrics/interface.js"; import {IJson, IRpcPayload} from "../interface.js"; import {encodeJwtToken} from "./jwt.js"; diff --git a/packages/lodestar/src/eth1/provider/jwt.ts b/packages/beacon-node/src/eth1/provider/jwt.ts similarity index 100% rename from packages/lodestar/src/eth1/provider/jwt.ts rename to packages/beacon-node/src/eth1/provider/jwt.ts diff --git a/packages/lodestar/src/eth1/provider/utils.ts b/packages/beacon-node/src/eth1/provider/utils.ts similarity index 97% rename from packages/lodestar/src/eth1/provider/utils.ts rename to packages/beacon-node/src/eth1/provider/utils.ts index 6dd9361866d4..55a431b020d7 100644 --- a/packages/lodestar/src/eth1/provider/utils.ts +++ b/packages/beacon-node/src/eth1/provider/utils.ts @@ -1,5 +1,5 @@ -import {RootHex} from "@chainsafe/lodestar-types"; -import {bytesToBigInt, bigIntToBytes} from "@chainsafe/lodestar-utils"; +import {RootHex} from "@lodestar/types"; +import {bytesToBigInt, bigIntToBytes} from "@lodestar/utils"; import {fromHexString, toHexString} from "@chainsafe/ssz"; import {ErrorParseJson} from "./jsonRpcHttpClient.js"; diff --git a/packages/lodestar/src/eth1/stream.ts b/packages/beacon-node/src/eth1/stream.ts similarity index 96% rename from packages/lodestar/src/eth1/stream.ts rename to packages/beacon-node/src/eth1/stream.ts index 73da07aca400..89640e4b6e3a 100644 --- a/packages/lodestar/src/eth1/stream.ts +++ b/packages/beacon-node/src/eth1/stream.ts @@ -2,8 +2,8 @@ * @module eth1 */ -import {sleep} from "@chainsafe/lodestar-utils"; -import {phase0} from "@chainsafe/lodestar-types"; +import {sleep} from "@lodestar/utils"; +import {phase0} from "@lodestar/types"; import {Eth1Block, IBatchDepositEvents, IEth1Provider, IEth1StreamParams} from "./interface.js"; import {groupDepositEventsByBlock} from "./utils/groupDepositEventsByBlock.js"; import {optimizeNextBlockDiffForGenesis} from "./utils/optimizeNextBlockDiffForGenesis.js"; diff --git a/packages/lodestar/src/eth1/utils/depositContract.ts b/packages/beacon-node/src/eth1/utils/depositContract.ts similarity index 96% rename from packages/lodestar/src/eth1/utils/depositContract.ts rename to packages/beacon-node/src/eth1/utils/depositContract.ts index 090727338319..4954ac74bf24 100644 --- a/packages/lodestar/src/eth1/utils/depositContract.ts +++ b/packages/beacon-node/src/eth1/utils/depositContract.ts @@ -4,7 +4,7 @@ import {Interface} from "@ethersproject/abi"; import {fromHexString} from "@chainsafe/ssz"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {phase0, ssz} from "@lodestar/types"; const depositEventFragment = "event DepositEvent(bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index)"; diff --git a/packages/lodestar/src/eth1/utils/deposits.ts b/packages/beacon-node/src/eth1/utils/deposits.ts similarity index 90% rename from packages/lodestar/src/eth1/utils/deposits.ts rename to packages/beacon-node/src/eth1/utils/deposits.ts index 139aa6cf8405..cc78a57a2c00 100644 --- a/packages/lodestar/src/eth1/utils/deposits.ts +++ b/packages/beacon-node/src/eth1/utils/deposits.ts @@ -1,9 +1,9 @@ -import {MAX_DEPOSITS} from "@chainsafe/lodestar-params"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {MAX_DEPOSITS} from "@lodestar/params"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; +import {phase0, ssz} from "@lodestar/types"; import {toGindex, Tree} from "@chainsafe/persistent-merkle-tree"; import {toHexString} from "@chainsafe/ssz"; -import {IFilterOptions} from "@chainsafe/lodestar-db"; +import {IFilterOptions} from "@lodestar/db"; import {Eth1Error, Eth1ErrorCode} from "../errors.js"; import {DepositTree} from "../../db/repositories/depositDataRoot.js"; diff --git a/packages/lodestar/src/eth1/utils/eth1Data.ts b/packages/beacon-node/src/eth1/utils/eth1Data.ts similarity index 98% rename from packages/lodestar/src/eth1/utils/eth1Data.ts rename to packages/beacon-node/src/eth1/utils/eth1Data.ts index cf81a148ad7f..2b8e976cac2e 100644 --- a/packages/lodestar/src/eth1/utils/eth1Data.ts +++ b/packages/beacon-node/src/eth1/utils/eth1Data.ts @@ -1,4 +1,4 @@ -import {Root, phase0} from "@chainsafe/lodestar-types"; +import {Root, phase0} from "@lodestar/types"; import {binarySearchLte} from "../../util/binarySearch.js"; import {Eth1Error, Eth1ErrorCode} from "../errors.js"; import {DepositTree} from "../../db/repositories/depositDataRoot.js"; diff --git a/packages/lodestar/src/eth1/utils/eth1DepositEvent.ts b/packages/beacon-node/src/eth1/utils/eth1DepositEvent.ts similarity index 100% rename from packages/lodestar/src/eth1/utils/eth1DepositEvent.ts rename to packages/beacon-node/src/eth1/utils/eth1DepositEvent.ts diff --git a/packages/lodestar/src/eth1/utils/eth1Vote.ts b/packages/beacon-node/src/eth1/utils/eth1Vote.ts similarity index 94% rename from packages/lodestar/src/eth1/utils/eth1Vote.ts rename to packages/beacon-node/src/eth1/utils/eth1Vote.ts index 38d663feb286..20d297455e78 100644 --- a/packages/lodestar/src/eth1/utils/eth1Vote.ts +++ b/packages/beacon-node/src/eth1/utils/eth1Vote.ts @@ -1,8 +1,8 @@ -import {EPOCHS_PER_ETH1_VOTING_PERIOD, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {phase0, RootHex} from "@chainsafe/lodestar-types"; -import {BeaconStateAllForks, computeTimeAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {toHex} from "@chainsafe/lodestar-utils"; +import {EPOCHS_PER_ETH1_VOTING_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {IChainForkConfig} from "@lodestar/config"; +import {phase0, RootHex} from "@lodestar/types"; +import {BeaconStateAllForks, computeTimeAtSlot} from "@lodestar/state-transition"; +import {toHex} from "@lodestar/utils"; export type Eth1DataGetter = ({ timestampRange, diff --git a/packages/lodestar/src/eth1/utils/groupDepositEventsByBlock.ts b/packages/beacon-node/src/eth1/utils/groupDepositEventsByBlock.ts similarity index 93% rename from packages/lodestar/src/eth1/utils/groupDepositEventsByBlock.ts rename to packages/beacon-node/src/eth1/utils/groupDepositEventsByBlock.ts index 9670a4ed35b4..c058b6b67f8a 100644 --- a/packages/lodestar/src/eth1/utils/groupDepositEventsByBlock.ts +++ b/packages/beacon-node/src/eth1/utils/groupDepositEventsByBlock.ts @@ -1,4 +1,4 @@ -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {IBatchDepositEvents} from "../interface.js"; /** diff --git a/packages/lodestar/src/eth1/utils/optimizeNextBlockDiffForGenesis.ts b/packages/beacon-node/src/eth1/utils/optimizeNextBlockDiffForGenesis.ts similarity index 92% rename from packages/lodestar/src/eth1/utils/optimizeNextBlockDiffForGenesis.ts rename to packages/beacon-node/src/eth1/utils/optimizeNextBlockDiffForGenesis.ts index 82128bb7aeba..24ec85544e43 100644 --- a/packages/lodestar/src/eth1/utils/optimizeNextBlockDiffForGenesis.ts +++ b/packages/beacon-node/src/eth1/utils/optimizeNextBlockDiffForGenesis.ts @@ -1,4 +1,4 @@ -import {IChainConfig} from "@chainsafe/lodestar-config"; +import {IChainConfig} from "@lodestar/config"; /** * Utility for fetching genesis min genesis time block diff --git a/packages/lodestar/src/execution/builder/http.ts b/packages/beacon-node/src/execution/builder/http.ts similarity index 91% rename from packages/lodestar/src/execution/builder/http.ts rename to packages/beacon-node/src/execution/builder/http.ts index c5833cdf9c11..9ac19eaea90b 100644 --- a/packages/lodestar/src/execution/builder/http.ts +++ b/packages/beacon-node/src/execution/builder/http.ts @@ -1,6 +1,6 @@ -import {bellatrix, Slot, Root, BLSPubkey, ssz} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {getClient, Api as BuilderApi} from "@chainsafe/lodestar-api/builder"; +import {bellatrix, Slot, Root, BLSPubkey, ssz} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {getClient, Api as BuilderApi} from "@lodestar/api/builder"; import {byteArrayEquals, toHexString} from "@chainsafe/ssz"; import {IExecutionBuilder} from "./interface.js"; diff --git a/packages/lodestar/src/execution/builder/index.ts b/packages/beacon-node/src/execution/builder/index.ts similarity index 91% rename from packages/lodestar/src/execution/builder/index.ts rename to packages/beacon-node/src/execution/builder/index.ts index 65b283117a0c..fadb649bb64b 100644 --- a/packages/lodestar/src/execution/builder/index.ts +++ b/packages/beacon-node/src/execution/builder/index.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {IExecutionBuilder} from "./interface.js"; import {ExecutionBuilderHttp, ExecutionBuilderHttpOpts, defaultExecutionBuilderHttpOpts} from "./http.js"; diff --git a/packages/lodestar/src/execution/builder/interface.ts b/packages/beacon-node/src/execution/builder/interface.ts similarity index 88% rename from packages/lodestar/src/execution/builder/interface.ts rename to packages/beacon-node/src/execution/builder/interface.ts index 65d2e1002c3f..ee6bce95edfd 100644 --- a/packages/lodestar/src/execution/builder/interface.ts +++ b/packages/beacon-node/src/execution/builder/interface.ts @@ -1,4 +1,4 @@ -import {bellatrix, Root, Slot, BLSPubkey} from "@chainsafe/lodestar-types"; +import {bellatrix, Root, Slot, BLSPubkey} from "@lodestar/types"; export interface IExecutionBuilder { /** diff --git a/packages/lodestar/src/execution/engine/disabled.ts b/packages/beacon-node/src/execution/engine/disabled.ts similarity index 100% rename from packages/lodestar/src/execution/engine/disabled.ts rename to packages/beacon-node/src/execution/engine/disabled.ts diff --git a/packages/lodestar/src/execution/engine/http.ts b/packages/beacon-node/src/execution/engine/http.ts similarity index 98% rename from packages/lodestar/src/execution/engine/http.ts rename to packages/beacon-node/src/execution/engine/http.ts index bdae98ff6576..1ef66a322a82 100644 --- a/packages/lodestar/src/execution/engine/http.ts +++ b/packages/beacon-node/src/execution/engine/http.ts @@ -1,6 +1,6 @@ -import {bellatrix, RootHex, Root} from "@chainsafe/lodestar-types"; -import {BYTES_PER_LOGS_BLOOM} from "@chainsafe/lodestar-params"; -import {fromHex} from "@chainsafe/lodestar-utils"; +import {bellatrix, RootHex, Root} from "@lodestar/types"; +import {BYTES_PER_LOGS_BLOOM} from "@lodestar/params"; +import {fromHex} from "@lodestar/utils"; import {ErrorJsonRpcResponse, HttpRpcError, JsonRpcHttpClient} from "../../eth1/provider/jsonRpcHttpClient.js"; import { diff --git a/packages/lodestar/src/execution/engine/index.ts b/packages/beacon-node/src/execution/engine/index.ts similarity index 100% rename from packages/lodestar/src/execution/engine/index.ts rename to packages/beacon-node/src/execution/engine/index.ts diff --git a/packages/lodestar/src/execution/engine/interface.ts b/packages/beacon-node/src/execution/engine/interface.ts similarity index 98% rename from packages/lodestar/src/execution/engine/interface.ts rename to packages/beacon-node/src/execution/engine/interface.ts index 0b8bd792c482..d89c2fc3ba5d 100644 --- a/packages/lodestar/src/execution/engine/interface.ts +++ b/packages/beacon-node/src/execution/engine/interface.ts @@ -1,4 +1,4 @@ -import {bellatrix, Root, RootHex} from "@chainsafe/lodestar-types"; +import {bellatrix, Root, RootHex} from "@lodestar/types"; import {PayloadIdCache, PayloadId, ApiPayloadAttributes} from "./payloadIdCache.js"; export {PayloadIdCache, PayloadId, ApiPayloadAttributes}; diff --git a/packages/lodestar/src/execution/engine/mock.ts b/packages/beacon-node/src/execution/engine/mock.ts similarity index 97% rename from packages/lodestar/src/execution/engine/mock.ts rename to packages/beacon-node/src/execution/engine/mock.ts index 4ba16479e2a9..6066612c06d5 100644 --- a/packages/lodestar/src/execution/engine/mock.ts +++ b/packages/beacon-node/src/execution/engine/mock.ts @@ -1,7 +1,7 @@ import crypto from "node:crypto"; -import {bellatrix, RootHex, Root} from "@chainsafe/lodestar-types"; +import {bellatrix, RootHex, Root} from "@lodestar/types"; import {toHexString, fromHexString} from "@chainsafe/ssz"; -import {BYTES_PER_LOGS_BLOOM} from "@chainsafe/lodestar-params"; +import {BYTES_PER_LOGS_BLOOM} from "@lodestar/params"; import {ZERO_HASH, ZERO_HASH_HEX} from "../../constants/index.js"; import { ExecutePayloadStatus, diff --git a/packages/lodestar/src/execution/engine/payloadIdCache.ts b/packages/beacon-node/src/execution/engine/payloadIdCache.ts similarity index 96% rename from packages/lodestar/src/execution/engine/payloadIdCache.ts rename to packages/beacon-node/src/execution/engine/payloadIdCache.ts index 687d17d848af..7b2d5af80e90 100644 --- a/packages/lodestar/src/execution/engine/payloadIdCache.ts +++ b/packages/beacon-node/src/execution/engine/payloadIdCache.ts @@ -1,4 +1,4 @@ -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {pruneSetToMax} from "../../util/map.js"; import {IMetrics} from "../../metrics/index.js"; import {DATA, QUANTITY} from "../../eth1/provider/utils.js"; diff --git a/packages/lodestar/src/execution/index.ts b/packages/beacon-node/src/execution/index.ts similarity index 100% rename from packages/lodestar/src/execution/index.ts rename to packages/beacon-node/src/execution/index.ts diff --git a/packages/lodestar/src/index.ts b/packages/beacon-node/src/index.ts similarity index 100% rename from packages/lodestar/src/index.ts rename to packages/beacon-node/src/index.ts diff --git a/packages/lodestar/src/metrics/index.ts b/packages/beacon-node/src/metrics/index.ts similarity index 100% rename from packages/lodestar/src/metrics/index.ts rename to packages/beacon-node/src/metrics/index.ts diff --git a/packages/lodestar/src/metrics/interface.ts b/packages/beacon-node/src/metrics/interface.ts similarity index 100% rename from packages/lodestar/src/metrics/interface.ts rename to packages/beacon-node/src/metrics/interface.ts diff --git a/packages/lodestar/src/metrics/metrics.ts b/packages/beacon-node/src/metrics/metrics.ts similarity index 92% rename from packages/lodestar/src/metrics/metrics.ts rename to packages/beacon-node/src/metrics/metrics.ts index d099561f563a..25790c572678 100644 --- a/packages/lodestar/src/metrics/metrics.ts +++ b/packages/beacon-node/src/metrics/metrics.ts @@ -3,9 +3,9 @@ */ import {collectDefaultMetrics, Metric, Registry} from "prom-client"; import gcStats from "prometheus-gc-stats"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {BeaconStateAllForks, getCurrentSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {ILogger} from "@lodestar/utils"; +import {BeaconStateAllForks, getCurrentSlot} from "@lodestar/state-transition"; +import {IChainForkConfig} from "@lodestar/config"; import {createBeaconMetrics, IBeaconMetrics} from "./metrics/beacon.js"; import {createLodestarMetrics, ILodestarMetrics} from "./metrics/lodestar.js"; import {MetricsOptions} from "./options.js"; diff --git a/packages/lodestar/src/metrics/metrics/beacon.ts b/packages/beacon-node/src/metrics/metrics/beacon.ts similarity index 100% rename from packages/lodestar/src/metrics/metrics/beacon.ts rename to packages/beacon-node/src/metrics/metrics/beacon.ts diff --git a/packages/lodestar/src/metrics/metrics/lodestar.ts b/packages/beacon-node/src/metrics/metrics/lodestar.ts similarity index 99% rename from packages/lodestar/src/metrics/metrics/lodestar.ts rename to packages/beacon-node/src/metrics/metrics/lodestar.ts index 2aa30923a934..3210b18a47a6 100644 --- a/packages/lodestar/src/metrics/metrics/lodestar.ts +++ b/packages/beacon-node/src/metrics/metrics/lodestar.ts @@ -1,4 +1,4 @@ -import {allForks} from "@chainsafe/lodestar-types"; +import {allForks} from "@lodestar/types"; import {RegistryMetricCreator} from "../utils/registryMetricCreator.js"; import {LodestarMetadata} from "../options.js"; diff --git a/packages/lodestar/src/metrics/options.ts b/packages/beacon-node/src/metrics/options.ts similarity index 100% rename from packages/lodestar/src/metrics/options.ts rename to packages/beacon-node/src/metrics/options.ts diff --git a/packages/lodestar/src/metrics/server/http.ts b/packages/beacon-node/src/metrics/server/http.ts similarity index 98% rename from packages/lodestar/src/metrics/server/http.ts rename to packages/beacon-node/src/metrics/server/http.ts index 01d2333307cd..75fe8bf7dfe8 100644 --- a/packages/lodestar/src/metrics/server/http.ts +++ b/packages/beacon-node/src/metrics/server/http.ts @@ -3,7 +3,7 @@ */ import http from "node:http"; import {Registry} from "prom-client"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ILogger} from "@lodestar/utils"; import {wrapError} from "../../util/wrapError.js"; import {HistogramExtra} from "../utils/histogram.js"; import {HttpActiveSocketsTracker} from "../../api/rest/activeSockets.js"; diff --git a/packages/lodestar/src/metrics/server/index.ts b/packages/beacon-node/src/metrics/server/index.ts similarity index 100% rename from packages/lodestar/src/metrics/server/index.ts rename to packages/beacon-node/src/metrics/server/index.ts diff --git a/packages/lodestar/src/metrics/utils/avgMinMax.ts b/packages/beacon-node/src/metrics/utils/avgMinMax.ts similarity index 100% rename from packages/lodestar/src/metrics/utils/avgMinMax.ts rename to packages/beacon-node/src/metrics/utils/avgMinMax.ts diff --git a/packages/lodestar/src/metrics/utils/gauge.ts b/packages/beacon-node/src/metrics/utils/gauge.ts similarity index 100% rename from packages/lodestar/src/metrics/utils/gauge.ts rename to packages/beacon-node/src/metrics/utils/gauge.ts diff --git a/packages/lodestar/src/metrics/utils/histogram.ts b/packages/beacon-node/src/metrics/utils/histogram.ts similarity index 100% rename from packages/lodestar/src/metrics/utils/histogram.ts rename to packages/beacon-node/src/metrics/utils/histogram.ts diff --git a/packages/lodestar/src/metrics/utils/registryMetricCreator.ts b/packages/beacon-node/src/metrics/utils/registryMetricCreator.ts similarity index 100% rename from packages/lodestar/src/metrics/utils/registryMetricCreator.ts rename to packages/beacon-node/src/metrics/utils/registryMetricCreator.ts diff --git a/packages/lodestar/src/metrics/validatorMonitor.ts b/packages/beacon-node/src/metrics/validatorMonitor.ts similarity index 97% rename from packages/lodestar/src/metrics/validatorMonitor.ts rename to packages/beacon-node/src/metrics/validatorMonitor.ts index 997a95b504f7..79668cfc2208 100644 --- a/packages/lodestar/src/metrics/validatorMonitor.ts +++ b/packages/beacon-node/src/metrics/validatorMonitor.ts @@ -1,15 +1,10 @@ -import { - computeEpochAtSlot, - IAttesterStatus, - parseAttesterFlags, - RootCache, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {allForks} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {Epoch, Slot, ValidatorIndex, ssz} from "@chainsafe/lodestar-types"; -import {IndexedAttestation, SignedAggregateAndProof} from "@chainsafe/lodestar-types/phase0"; +import {computeEpochAtSlot, IAttesterStatus, parseAttesterFlags, RootCache} from "@lodestar/state-transition"; +import {ILogger} from "@lodestar/utils"; +import {allForks} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {Epoch, Slot, ValidatorIndex, ssz} from "@lodestar/types"; +import {IndexedAttestation, SignedAggregateAndProof} from "@lodestar/types/phase0"; import {ILodestarMetrics} from "./metrics/lodestar.js"; /** The validator monitor collects per-epoch data about each monitored validator. diff --git a/packages/lodestar/src/network/events.ts b/packages/beacon-node/src/network/events.ts similarity index 94% rename from packages/lodestar/src/network/events.ts rename to packages/beacon-node/src/network/events.ts index ca6afb6ad05e..226df44fe28f 100644 --- a/packages/lodestar/src/network/events.ts +++ b/packages/beacon-node/src/network/events.ts @@ -1,7 +1,7 @@ import {EventEmitter} from "events"; import PeerId from "peer-id"; import StrictEventEmitter from "strict-event-emitter-types"; -import {allForks, phase0} from "@chainsafe/lodestar-types"; +import {allForks, phase0} from "@lodestar/types"; import {RequestTypedContainer} from "./reqresp/index.js"; export enum NetworkEvent { diff --git a/packages/lodestar/src/network/forks.ts b/packages/beacon-node/src/network/forks.ts similarity index 94% rename from packages/lodestar/src/network/forks.ts rename to packages/beacon-node/src/network/forks.ts index 49964ff16223..7072d92b25bc 100644 --- a/packages/lodestar/src/network/forks.ts +++ b/packages/beacon-node/src/network/forks.ts @@ -1,6 +1,6 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {IChainForkConfig, IForkInfo} from "@chainsafe/lodestar-config"; -import {Epoch} from "@chainsafe/lodestar-types"; +import {ForkName} from "@lodestar/params"; +import {IChainForkConfig, IForkInfo} from "@lodestar/config"; +import {Epoch} from "@lodestar/types"; /** * Subscribe topics to the new fork N epochs before the fork. Remove all subscriptions N epochs after the fork diff --git a/packages/lodestar/src/network/gossip/constants.ts b/packages/beacon-node/src/network/gossip/constants.ts similarity index 100% rename from packages/lodestar/src/network/gossip/constants.ts rename to packages/beacon-node/src/network/gossip/constants.ts diff --git a/packages/lodestar/src/network/gossip/encoding.ts b/packages/beacon-node/src/network/gossip/encoding.ts similarity index 96% rename from packages/lodestar/src/network/gossip/encoding.ts rename to packages/beacon-node/src/network/gossip/encoding.ts index 7002b51ec064..8defe67e8522 100644 --- a/packages/lodestar/src/network/gossip/encoding.ts +++ b/packages/beacon-node/src/network/gossip/encoding.ts @@ -2,8 +2,8 @@ import {compress, uncompress} from "snappyjs"; import {RPC} from "libp2p-gossipsub/src/message/rpc"; import {GossipsubMessage} from "libp2p-gossipsub/src/types"; import {digest} from "@chainsafe/as-sha256"; -import {intToBytes} from "@chainsafe/lodestar-utils"; -import {ForkName} from "@chainsafe/lodestar-params"; +import {intToBytes} from "@lodestar/utils"; +import {ForkName} from "@lodestar/params"; import {MESSAGE_DOMAIN_VALID_SNAPPY} from "./constants.js"; import {GossipTopicCache} from "./topic.js"; diff --git a/packages/lodestar/src/network/gossip/errors.ts b/packages/beacon-node/src/network/gossip/errors.ts similarity index 100% rename from packages/lodestar/src/network/gossip/errors.ts rename to packages/beacon-node/src/network/gossip/errors.ts diff --git a/packages/lodestar/src/network/gossip/gossipsub.ts b/packages/beacon-node/src/network/gossip/gossipsub.ts similarity index 98% rename from packages/lodestar/src/network/gossip/gossipsub.ts rename to packages/beacon-node/src/network/gossip/gossipsub.ts index 31e9b5cf97fe..3f3ca70a69e1 100644 --- a/packages/lodestar/src/network/gossip/gossipsub.ts +++ b/packages/beacon-node/src/network/gossip/gossipsub.ts @@ -7,11 +7,11 @@ import {GossipsubMessage, SignaturePolicy, TopicStr} from "libp2p-gossipsub/src/ import {PeerScore, PeerScoreParams} from "libp2p-gossipsub/src/score/index.js"; import PeerId from "peer-id"; import {MetricsRegister, TopicLabel, TopicStrToLabel} from "libp2p-gossipsub/src/metrics"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ATTESTATION_SUBNET_COUNT, ForkName, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {allForks, altair, phase0} from "@chainsafe/lodestar-types"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {ATTESTATION_SUBNET_COUNT, ForkName, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {allForks, altair, phase0} from "@lodestar/types"; +import {ILogger} from "@lodestar/utils"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; import {IMetrics} from "../../metrics/index.js"; import {Map2d, Map2dArr} from "../../util/map.js"; diff --git a/packages/lodestar/src/network/gossip/handlers/index.ts b/packages/beacon-node/src/network/gossip/handlers/index.ts similarity index 98% rename from packages/lodestar/src/network/gossip/handlers/index.ts rename to packages/beacon-node/src/network/gossip/handlers/index.ts index b218dee2c17f..463a9dc2d069 100644 --- a/packages/lodestar/src/network/gossip/handlers/index.ts +++ b/packages/beacon-node/src/network/gossip/handlers/index.ts @@ -1,8 +1,8 @@ import PeerId from "peer-id"; import {toHexString} from "@chainsafe/ssz"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {ILogger, prettyBytes} from "@chainsafe/lodestar-utils"; +import {IBeaconConfig} from "@lodestar/config"; +import {phase0, ssz} from "@lodestar/types"; +import {ILogger, prettyBytes} from "@lodestar/utils"; import {IMetrics} from "../../../metrics/index.js"; import {OpSource} from "../../../metrics/validatorMonitor.js"; import {IBeaconChain} from "../../../chain/index.js"; diff --git a/packages/lodestar/src/network/gossip/index.ts b/packages/beacon-node/src/network/gossip/index.ts similarity index 100% rename from packages/lodestar/src/network/gossip/index.ts rename to packages/beacon-node/src/network/gossip/index.ts diff --git a/packages/lodestar/src/network/gossip/interface.ts b/packages/beacon-node/src/network/gossip/interface.ts similarity index 95% rename from packages/lodestar/src/network/gossip/interface.ts rename to packages/beacon-node/src/network/gossip/interface.ts index a63d06f515a4..77f8adc56291 100644 --- a/packages/lodestar/src/network/gossip/interface.ts +++ b/packages/beacon-node/src/network/gossip/interface.ts @@ -6,10 +6,10 @@ import {EventEmitter} from "events"; import StrictEventEmitter from "strict-event-emitter-types"; import LibP2p from "libp2p"; import {GossipsubMessage, MessageAcceptance, PeerIdStr} from "libp2p-gossipsub/src/types"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {allForks, altair, phase0} from "@chainsafe/lodestar-types"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ForkName} from "@lodestar/params"; +import {allForks, altair, phase0} from "@lodestar/types"; +import {IBeaconConfig} from "@lodestar/config"; +import {ILogger} from "@lodestar/utils"; import {IBeaconChain} from "../../chain/index.js"; import {NetworkEvent} from "../events.js"; import {JobItemQueue} from "../../util/queue/index.js"; diff --git a/packages/lodestar/src/network/gossip/scoringParameters.ts b/packages/beacon-node/src/network/gossip/scoringParameters.ts similarity index 98% rename from packages/lodestar/src/network/gossip/scoringParameters.ts rename to packages/beacon-node/src/network/gossip/scoringParameters.ts index 1d29eb9f831e..a190e65b2872 100644 --- a/packages/lodestar/src/network/gossip/scoringParameters.ts +++ b/packages/beacon-node/src/network/gossip/scoringParameters.ts @@ -4,9 +4,9 @@ import { PeerScoreParams, TopicScoreParams, } from "libp2p-gossipsub/src/score/peer-score-params.js"; -import {computeCommitteeCount} from "@chainsafe/lodestar-beacon-state-transition"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ATTESTATION_SUBNET_COUNT, SLOTS_PER_EPOCH, TARGET_AGGREGATORS_PER_COMMITTEE} from "@chainsafe/lodestar-params"; +import {computeCommitteeCount} from "@lodestar/state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {ATTESTATION_SUBNET_COUNT, SLOTS_PER_EPOCH, TARGET_AGGREGATORS_PER_COMMITTEE} from "@lodestar/params"; import {Eth2Context} from "../../chain/index.js"; import {getActiveForks} from "../forks.js"; import {Eth2GossipsubModules} from "./gossipsub.js"; diff --git a/packages/lodestar/src/network/gossip/topic.ts b/packages/beacon-node/src/network/gossip/topic.ts similarity index 98% rename from packages/lodestar/src/network/gossip/topic.ts rename to packages/beacon-node/src/network/gossip/topic.ts index 42ac6afd6884..9a421a0b0797 100644 --- a/packages/lodestar/src/network/gossip/topic.ts +++ b/packages/beacon-node/src/network/gossip/topic.ts @@ -2,8 +2,8 @@ * @module network/gossip */ -import {ssz} from "@chainsafe/lodestar-types"; -import {IForkDigestContext} from "@chainsafe/lodestar-config"; +import {ssz} from "@lodestar/types"; +import {IForkDigestContext} from "@lodestar/config"; import {GossipType, GossipTopic, GossipEncoding} from "./interface.js"; import {DEFAULT_ENCODING} from "./constants.js"; diff --git a/packages/lodestar/src/network/gossip/validation/index.ts b/packages/beacon-node/src/network/gossip/validation/index.ts similarity index 97% rename from packages/lodestar/src/network/gossip/validation/index.ts rename to packages/beacon-node/src/network/gossip/validation/index.ts index f8fc0e26ca52..75ee58759c80 100644 --- a/packages/lodestar/src/network/gossip/validation/index.ts +++ b/packages/beacon-node/src/network/gossip/validation/index.ts @@ -1,6 +1,6 @@ import {MessageAcceptance} from "libp2p-gossipsub/src/types.js"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ILogger, mapValues} from "@chainsafe/lodestar-utils"; +import {IChainForkConfig} from "@lodestar/config"; +import {ILogger, mapValues} from "@lodestar/utils"; import {IMetrics} from "../../../metrics/index.js"; import {getGossipSSZType} from "../topic.js"; import { diff --git a/packages/lodestar/src/network/gossip/validation/onAccept.ts b/packages/beacon-node/src/network/gossip/validation/onAccept.ts similarity index 88% rename from packages/lodestar/src/network/gossip/validation/onAccept.ts rename to packages/beacon-node/src/network/gossip/validation/onAccept.ts index f9d6dd53d08d..d005e2b133ff 100644 --- a/packages/lodestar/src/network/gossip/validation/onAccept.ts +++ b/packages/beacon-node/src/network/gossip/validation/onAccept.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {GossipType, GossipTypeMap, GossipTopicTypeMap} from "../interface.js"; export type GetGossipAcceptMetadataFn = ( diff --git a/packages/lodestar/src/network/gossip/validation/queue.ts b/packages/beacon-node/src/network/gossip/validation/queue.ts similarity index 98% rename from packages/lodestar/src/network/gossip/validation/queue.ts rename to packages/beacon-node/src/network/gossip/validation/queue.ts index e39b8d34dd07..096d98fdb38c 100644 --- a/packages/lodestar/src/network/gossip/validation/queue.ts +++ b/packages/beacon-node/src/network/gossip/validation/queue.ts @@ -1,4 +1,4 @@ -import {mapValues} from "@chainsafe/lodestar-utils"; +import {mapValues} from "@lodestar/utils"; import {IMetrics} from "../../../metrics/index.js"; import {JobItemQueue, JobQueueOpts, QueueType} from "../../../util/queue/index.js"; import {GossipJobQueues, GossipType, GossipValidatorFn, ResolvedType, ValidatorFnsByType} from "../interface.js"; diff --git a/packages/lodestar/src/network/index.ts b/packages/beacon-node/src/network/index.ts similarity index 100% rename from packages/lodestar/src/network/index.ts rename to packages/beacon-node/src/network/index.ts diff --git a/packages/lodestar/src/network/interface.ts b/packages/beacon-node/src/network/interface.ts similarity index 100% rename from packages/lodestar/src/network/interface.ts rename to packages/beacon-node/src/network/interface.ts diff --git a/packages/lodestar/src/network/metadata.ts b/packages/beacon-node/src/network/metadata.ts similarity index 94% rename from packages/lodestar/src/network/metadata.ts rename to packages/beacon-node/src/network/metadata.ts index 5e94e0aaf199..c5ca7bcf7b72 100644 --- a/packages/lodestar/src/network/metadata.ts +++ b/packages/beacon-node/src/network/metadata.ts @@ -1,9 +1,9 @@ import {ENR} from "@chainsafe/discv5"; import {BitArray, toHexString} from "@chainsafe/ssz"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {altair, Epoch, phase0, ssz} from "@chainsafe/lodestar-types"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ForkName} from "@lodestar/params"; +import {altair, Epoch, phase0, ssz} from "@lodestar/types"; +import {IBeaconConfig} from "@lodestar/config"; +import {ILogger} from "@lodestar/utils"; import {IBeaconChain} from "../chain/index.js"; import {FAR_FUTURE_EPOCH} from "../constants/index.js"; import {getCurrentAndNextFork} from "./forks.js"; diff --git a/packages/lodestar/src/network/network.ts b/packages/beacon-node/src/network/network.ts similarity index 97% rename from packages/lodestar/src/network/network.ts rename to packages/beacon-node/src/network/network.ts index 309e56b10e0e..40603b03a16b 100644 --- a/packages/lodestar/src/network/network.ts +++ b/packages/beacon-node/src/network/network.ts @@ -5,12 +5,12 @@ import LibP2p, {Connection} from "libp2p"; import PeerId from "peer-id"; import {Multiaddr} from "multiaddr"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {ATTESTATION_SUBNET_COUNT, ForkName, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; +import {IBeaconConfig} from "@lodestar/config"; +import {ILogger} from "@lodestar/utils"; +import {ATTESTATION_SUBNET_COUNT, ForkName, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; import {Discv5, ENR} from "@chainsafe/discv5"; -import {computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {Epoch} from "@chainsafe/lodestar-types"; +import {computeEpochAtSlot} from "@lodestar/state-transition"; +import {Epoch} from "@lodestar/types"; import {IMetrics} from "../metrics/index.js"; import {ChainEvent, IBeaconChain, IBeaconClock} from "../chain/index.js"; import {INetworkOptions} from "./options.js"; diff --git a/packages/lodestar/src/network/nodejs/bundle.ts b/packages/beacon-node/src/network/nodejs/bundle.ts similarity index 100% rename from packages/lodestar/src/network/nodejs/bundle.ts rename to packages/beacon-node/src/network/nodejs/bundle.ts diff --git a/packages/lodestar/src/network/nodejs/index.ts b/packages/beacon-node/src/network/nodejs/index.ts similarity index 100% rename from packages/lodestar/src/network/nodejs/index.ts rename to packages/beacon-node/src/network/nodejs/index.ts diff --git a/packages/lodestar/src/network/nodejs/util.ts b/packages/beacon-node/src/network/nodejs/util.ts similarity index 100% rename from packages/lodestar/src/network/nodejs/util.ts rename to packages/beacon-node/src/network/nodejs/util.ts diff --git a/packages/lodestar/src/network/options.ts b/packages/beacon-node/src/network/options.ts similarity index 100% rename from packages/lodestar/src/network/options.ts rename to packages/beacon-node/src/network/options.ts diff --git a/packages/lodestar/src/network/peers/client.ts b/packages/beacon-node/src/network/peers/client.ts similarity index 100% rename from packages/lodestar/src/network/peers/client.ts rename to packages/beacon-node/src/network/peers/client.ts diff --git a/packages/lodestar/src/network/peers/datastore.ts b/packages/beacon-node/src/network/peers/datastore.ts similarity index 100% rename from packages/lodestar/src/network/peers/datastore.ts rename to packages/beacon-node/src/network/peers/datastore.ts diff --git a/packages/lodestar/src/network/peers/discover.ts b/packages/beacon-node/src/network/peers/discover.ts similarity index 99% rename from packages/lodestar/src/network/peers/discover.ts rename to packages/beacon-node/src/network/peers/discover.ts index 02d08d5f39ac..8601c2538f58 100644 --- a/packages/lodestar/src/network/peers/discover.ts +++ b/packages/beacon-node/src/network/peers/discover.ts @@ -3,10 +3,10 @@ import {promisify} from "node:util"; import LibP2p from "libp2p"; import PeerId from "peer-id"; import {Multiaddr} from "multiaddr"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {IBeaconConfig} from "@lodestar/config"; +import {ILogger} from "@lodestar/utils"; import {Discv5, ENR, IDiscv5Metrics, IDiscv5DiscoveryInputOptions} from "@chainsafe/discv5"; -import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; +import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; import {IMetrics} from "../../metrics/index.js"; import {ENRKey, SubnetType} from "../metadata.js"; import {prettyPrintPeerId} from "../util.js"; diff --git a/packages/lodestar/src/network/peers/index.ts b/packages/beacon-node/src/network/peers/index.ts similarity index 100% rename from packages/lodestar/src/network/peers/index.ts rename to packages/beacon-node/src/network/peers/index.ts diff --git a/packages/lodestar/src/network/peers/peerManager.ts b/packages/beacon-node/src/network/peers/peerManager.ts similarity index 99% rename from packages/lodestar/src/network/peers/peerManager.ts rename to packages/beacon-node/src/network/peers/peerManager.ts index 1bd4f550d7fe..9dd3ff5d20c7 100644 --- a/packages/lodestar/src/network/peers/peerManager.ts +++ b/packages/beacon-node/src/network/peers/peerManager.ts @@ -2,10 +2,10 @@ import LibP2p, {Connection} from "libp2p"; import PeerId from "peer-id"; import {IDiscv5DiscoveryInputOptions} from "@chainsafe/discv5"; import {BitArray} from "@chainsafe/ssz"; -import {SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {allForks, altair, phase0} from "@chainsafe/lodestar-types"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {IBeaconConfig} from "@lodestar/config"; +import {allForks, altair, phase0} from "@lodestar/types"; +import {ILogger} from "@lodestar/utils"; import {IBeaconChain} from "../../chain/index.js"; import {GoodByeReasonCode, GOODBYE_KNOWN_CODES, Libp2pEvent} from "../../constants/index.js"; import {IMetrics} from "../../metrics/index.js"; diff --git a/packages/lodestar/src/network/peers/peersData.ts b/packages/beacon-node/src/network/peers/peersData.ts similarity index 96% rename from packages/lodestar/src/network/peers/peersData.ts rename to packages/beacon-node/src/network/peers/peersData.ts index 5fa4759e9b97..7682a491d6c2 100644 --- a/packages/lodestar/src/network/peers/peersData.ts +++ b/packages/beacon-node/src/network/peers/peersData.ts @@ -1,5 +1,5 @@ import PeerId from "peer-id"; -import {altair} from "@chainsafe/lodestar-types"; +import {altair} from "@lodestar/types"; import {Encoding} from "../reqresp/types.js"; import {ClientKind} from "./client.js"; diff --git a/packages/lodestar/src/network/peers/score.ts b/packages/beacon-node/src/network/peers/score.ts similarity index 100% rename from packages/lodestar/src/network/peers/score.ts rename to packages/beacon-node/src/network/peers/score.ts diff --git a/packages/lodestar/src/network/peers/utils/assertPeerRelevance.ts b/packages/beacon-node/src/network/peers/utils/assertPeerRelevance.ts similarity index 95% rename from packages/lodestar/src/network/peers/utils/assertPeerRelevance.ts rename to packages/beacon-node/src/network/peers/utils/assertPeerRelevance.ts index e88e12e0b359..757705175c75 100644 --- a/packages/lodestar/src/network/peers/utils/assertPeerRelevance.ts +++ b/packages/beacon-node/src/network/peers/utils/assertPeerRelevance.ts @@ -1,6 +1,6 @@ -import {computeStartSlotAtEpoch, getBlockRootAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {SLOTS_PER_HISTORICAL_ROOT} from "@chainsafe/lodestar-params"; -import {Epoch, ForkDigest, Root, phase0, ssz} from "@chainsafe/lodestar-types"; +import {computeStartSlotAtEpoch, getBlockRootAtSlot} from "@lodestar/state-transition"; +import {SLOTS_PER_HISTORICAL_ROOT} from "@lodestar/params"; +import {Epoch, ForkDigest, Root, phase0, ssz} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; import {IBeaconChain} from "../../../chain/index.js"; import {GENESIS_EPOCH} from "../../../constants/index.js"; diff --git a/packages/lodestar/src/network/peers/utils/enrSubnetsDeserialize.ts b/packages/beacon-node/src/network/peers/utils/enrSubnetsDeserialize.ts similarity index 89% rename from packages/lodestar/src/network/peers/utils/enrSubnetsDeserialize.ts rename to packages/beacon-node/src/network/peers/utils/enrSubnetsDeserialize.ts index d50702f5e7cd..0a26cce9b215 100644 --- a/packages/lodestar/src/network/peers/utils/enrSubnetsDeserialize.ts +++ b/packages/beacon-node/src/network/peers/utils/enrSubnetsDeserialize.ts @@ -1,6 +1,6 @@ import {getUint8ByteToBitBooleanArray} from "@chainsafe/ssz"; -import {newFilledArray} from "@chainsafe/lodestar-beacon-state-transition"; -import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; +import {newFilledArray} from "@lodestar/state-transition"; +import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; export const zeroAttnets = newFilledArray(ATTESTATION_SUBNET_COUNT, false); export const zeroSyncnets = newFilledArray(SYNC_COMMITTEE_SUBNET_COUNT, false); diff --git a/packages/lodestar/src/network/peers/utils/getConnectedPeerIds.ts b/packages/beacon-node/src/network/peers/utils/getConnectedPeerIds.ts similarity index 100% rename from packages/lodestar/src/network/peers/utils/getConnectedPeerIds.ts rename to packages/beacon-node/src/network/peers/utils/getConnectedPeerIds.ts diff --git a/packages/lodestar/src/network/peers/utils/index.ts b/packages/beacon-node/src/network/peers/utils/index.ts similarity index 100% rename from packages/lodestar/src/network/peers/utils/index.ts rename to packages/beacon-node/src/network/peers/utils/index.ts diff --git a/packages/lodestar/src/network/peers/utils/prioritizePeers.ts b/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts similarity index 99% rename from packages/lodestar/src/network/peers/utils/prioritizePeers.ts rename to packages/beacon-node/src/network/peers/utils/prioritizePeers.ts index 6625ca595d93..9e0cce820c22 100644 --- a/packages/lodestar/src/network/peers/utils/prioritizePeers.ts +++ b/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts @@ -1,7 +1,7 @@ import PeerId from "peer-id"; -import {altair, phase0} from "@chainsafe/lodestar-types"; +import {altair, phase0} from "@lodestar/types"; import {BitArray} from "@chainsafe/ssz"; -import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; +import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; import {shuffle} from "../../../util/shuffle.js"; import {sortBy} from "../../../util/sortBy.js"; import {MapDef} from "../../../util/map.js"; diff --git a/packages/lodestar/src/network/peers/utils/subnetMap.ts b/packages/beacon-node/src/network/peers/utils/subnetMap.ts similarity index 97% rename from packages/lodestar/src/network/peers/utils/subnetMap.ts rename to packages/beacon-node/src/network/peers/utils/subnetMap.ts index 9a318a370010..97985b3d8da0 100644 --- a/packages/lodestar/src/network/peers/utils/subnetMap.ts +++ b/packages/beacon-node/src/network/peers/utils/subnetMap.ts @@ -1,4 +1,4 @@ -import {Slot} from "@chainsafe/lodestar-types"; +import {Slot} from "@lodestar/types"; export type RequestedSubnet = { subnet: number; diff --git a/packages/lodestar/src/network/reqresp/encoders/requestDecode.ts b/packages/beacon-node/src/network/reqresp/encoders/requestDecode.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/encoders/requestDecode.ts rename to packages/beacon-node/src/network/reqresp/encoders/requestDecode.ts diff --git a/packages/lodestar/src/network/reqresp/encoders/requestEncode.ts b/packages/beacon-node/src/network/reqresp/encoders/requestEncode.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/encoders/requestEncode.ts rename to packages/beacon-node/src/network/reqresp/encoders/requestEncode.ts diff --git a/packages/lodestar/src/network/reqresp/encoders/responseDecode.ts b/packages/beacon-node/src/network/reqresp/encoders/responseDecode.ts similarity index 97% rename from packages/lodestar/src/network/reqresp/encoders/responseDecode.ts rename to packages/beacon-node/src/network/reqresp/encoders/responseDecode.ts index 675e89628a82..569c14276953 100644 --- a/packages/lodestar/src/network/reqresp/encoders/responseDecode.ts +++ b/packages/beacon-node/src/network/reqresp/encoders/responseDecode.ts @@ -1,5 +1,5 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {IForkDigestContext} from "@chainsafe/lodestar-config"; +import {ForkName} from "@lodestar/params"; +import {IForkDigestContext} from "@lodestar/config"; import {RespStatus} from "../../../constants/index.js"; import {BufferedSource, decodeErrorMessage} from "../utils/index.js"; import {readEncodedPayload} from "../encodingStrategies/index.js"; diff --git a/packages/lodestar/src/network/reqresp/encoders/responseEncode.ts b/packages/beacon-node/src/network/reqresp/encoders/responseEncode.ts similarity index 96% rename from packages/lodestar/src/network/reqresp/encoders/responseEncode.ts rename to packages/beacon-node/src/network/reqresp/encoders/responseEncode.ts index 3fafd90db329..f82b2d28e44d 100644 --- a/packages/lodestar/src/network/reqresp/encoders/responseEncode.ts +++ b/packages/beacon-node/src/network/reqresp/encoders/responseEncode.ts @@ -1,5 +1,5 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +import {ForkName} from "@lodestar/params"; +import {IBeaconConfig} from "@lodestar/config"; import {RespStatus, RpcResponseStatusError} from "../../../constants/index.js"; import {writeEncodedPayload} from "../encodingStrategies/index.js"; import {encodeErrorMessage} from "../utils/index.js"; diff --git a/packages/lodestar/src/network/reqresp/encodingStrategies/index.ts b/packages/beacon-node/src/network/reqresp/encodingStrategies/index.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/encodingStrategies/index.ts rename to packages/beacon-node/src/network/reqresp/encodingStrategies/index.ts diff --git a/packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/decode.ts b/packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/decode.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/decode.ts rename to packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/decode.ts diff --git a/packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/encode.ts b/packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/encode.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/encode.ts rename to packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/encode.ts diff --git a/packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/errors.ts b/packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/errors.ts similarity index 96% rename from packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/errors.ts rename to packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/errors.ts index 0a15349820d2..12113ceb42fb 100644 --- a/packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/errors.ts +++ b/packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/errors.ts @@ -1,4 +1,4 @@ -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {LodestarError} from "@lodestar/utils"; export enum SszSnappyErrorCode { /** Invalid number of bytes for protobuf varint */ diff --git a/packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/index.ts b/packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/index.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/index.ts rename to packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/index.ts diff --git a/packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/snappyFrames/uncompress.ts b/packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/snappyFrames/uncompress.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/snappyFrames/uncompress.ts rename to packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/snappyFrames/uncompress.ts diff --git a/packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/utils.ts b/packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/utils.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/encodingStrategies/sszSnappy/utils.ts rename to packages/beacon-node/src/network/reqresp/encodingStrategies/sszSnappy/utils.ts diff --git a/packages/lodestar/src/network/reqresp/handlers/beaconBlocksByRange.ts b/packages/beacon-node/src/network/reqresp/handlers/beaconBlocksByRange.ts similarity index 96% rename from packages/lodestar/src/network/reqresp/handlers/beaconBlocksByRange.ts rename to packages/beacon-node/src/network/reqresp/handlers/beaconBlocksByRange.ts index a6c0e8e77195..2cba8a9452cf 100644 --- a/packages/lodestar/src/network/reqresp/handlers/beaconBlocksByRange.ts +++ b/packages/beacon-node/src/network/reqresp/handlers/beaconBlocksByRange.ts @@ -1,5 +1,5 @@ -import {GENESIS_SLOT, MAX_REQUEST_BLOCKS} from "@chainsafe/lodestar-params"; -import {phase0, Slot} from "@chainsafe/lodestar-types"; +import {GENESIS_SLOT, MAX_REQUEST_BLOCKS} from "@lodestar/params"; +import {phase0, Slot} from "@lodestar/types"; import {fromHexString} from "@chainsafe/ssz"; import {IBeaconChain} from "../../../chain/index.js"; import {IBeaconDb} from "../../../db/index.js"; diff --git a/packages/lodestar/src/network/reqresp/handlers/beaconBlocksByRoot.ts b/packages/beacon-node/src/network/reqresp/handlers/beaconBlocksByRoot.ts similarity index 95% rename from packages/lodestar/src/network/reqresp/handlers/beaconBlocksByRoot.ts rename to packages/beacon-node/src/network/reqresp/handlers/beaconBlocksByRoot.ts index 38a00434a657..a08881258983 100644 --- a/packages/lodestar/src/network/reqresp/handlers/beaconBlocksByRoot.ts +++ b/packages/beacon-node/src/network/reqresp/handlers/beaconBlocksByRoot.ts @@ -1,4 +1,4 @@ -import {phase0, Slot} from "@chainsafe/lodestar-types"; +import {phase0, Slot} from "@lodestar/types"; import {IBeaconChain} from "../../../chain/index.js"; import {IBeaconDb} from "../../../db/index.js"; import {getSlotFromBytes} from "../../../util/multifork.js"; diff --git a/packages/lodestar/src/network/reqresp/handlers/index.ts b/packages/beacon-node/src/network/reqresp/handlers/index.ts similarity index 95% rename from packages/lodestar/src/network/reqresp/handlers/index.ts rename to packages/beacon-node/src/network/reqresp/handlers/index.ts index 0dd8bc7f420d..391baddfdd18 100644 --- a/packages/lodestar/src/network/reqresp/handlers/index.ts +++ b/packages/beacon-node/src/network/reqresp/handlers/index.ts @@ -1,4 +1,4 @@ -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {IBeaconChain} from "../../../chain/index.js"; import {IBeaconDb} from "../../../db/index.js"; import {ReqRespBlockResponse} from "../types.js"; diff --git a/packages/lodestar/src/network/reqresp/index.ts b/packages/beacon-node/src/network/reqresp/index.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/index.ts rename to packages/beacon-node/src/network/reqresp/index.ts diff --git a/packages/lodestar/src/network/reqresp/interface.ts b/packages/beacon-node/src/network/reqresp/interface.ts similarity index 92% rename from packages/lodestar/src/network/reqresp/interface.ts rename to packages/beacon-node/src/network/reqresp/interface.ts index 980a53c63465..be23c6d67e77 100644 --- a/packages/lodestar/src/network/reqresp/interface.ts +++ b/packages/beacon-node/src/network/reqresp/interface.ts @@ -1,9 +1,9 @@ import LibP2p from "libp2p"; import PeerId from "peer-id"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {allForks, phase0} from "@chainsafe/lodestar-types"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ForkName} from "@lodestar/params"; +import {IBeaconConfig} from "@lodestar/config"; +import {allForks, phase0} from "@lodestar/types"; +import {ILogger} from "@lodestar/utils"; import {IPeerRpcScoreStore} from "../peers/index.js"; import {MetadataController} from "../metadata.js"; import {INetworkEventBus} from "../events.js"; diff --git a/packages/lodestar/src/network/reqresp/rateTracker.ts b/packages/beacon-node/src/network/reqresp/rateTracker.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/rateTracker.ts rename to packages/beacon-node/src/network/reqresp/rateTracker.ts diff --git a/packages/lodestar/src/network/reqresp/reqResp.ts b/packages/beacon-node/src/network/reqresp/reqResp.ts similarity index 97% rename from packages/lodestar/src/network/reqresp/reqResp.ts rename to packages/beacon-node/src/network/reqresp/reqResp.ts index 05dc4a14aa69..e0bd5007c768 100644 --- a/packages/lodestar/src/network/reqresp/reqResp.ts +++ b/packages/beacon-node/src/network/reqresp/reqResp.ts @@ -5,10 +5,10 @@ import {Connection} from "libp2p"; import {HandlerProps} from "libp2p/src/registrar"; import LibP2p from "libp2p"; import PeerId from "peer-id"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {allForks, phase0} from "@chainsafe/lodestar-types"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ForkName} from "@lodestar/params"; +import {IBeaconConfig} from "@lodestar/config"; +import {allForks, phase0} from "@lodestar/types"; +import {ILogger} from "@lodestar/utils"; import {RespStatus, timeoutOptions} from "../../constants/index.js"; import {IPeerRpcScoreStore} from "../peers/index.js"; import {MetadataController} from "../metadata.js"; diff --git a/packages/lodestar/src/network/reqresp/request/collectResponses.ts b/packages/beacon-node/src/network/reqresp/request/collectResponses.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/request/collectResponses.ts rename to packages/beacon-node/src/network/reqresp/request/collectResponses.ts diff --git a/packages/lodestar/src/network/reqresp/request/errors.ts b/packages/beacon-node/src/network/reqresp/request/errors.ts similarity index 98% rename from packages/lodestar/src/network/reqresp/request/errors.ts rename to packages/beacon-node/src/network/reqresp/request/errors.ts index 8e416dd46e18..6c3b7019154b 100644 --- a/packages/lodestar/src/network/reqresp/request/errors.ts +++ b/packages/beacon-node/src/network/reqresp/request/errors.ts @@ -1,4 +1,4 @@ -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {LodestarError} from "@lodestar/utils"; import {RespStatus, RpcResponseStatusError} from "../../../constants/index.js"; import {Method, Encoding} from "../types.js"; import {ResponseError} from "../response/index.js"; diff --git a/packages/lodestar/src/network/reqresp/request/index.ts b/packages/beacon-node/src/network/reqresp/request/index.ts similarity index 98% rename from packages/lodestar/src/network/reqresp/request/index.ts rename to packages/beacon-node/src/network/reqresp/request/index.ts index 89b9d27e580f..9b836d08ef02 100644 --- a/packages/lodestar/src/network/reqresp/request/index.ts +++ b/packages/beacon-node/src/network/reqresp/request/index.ts @@ -1,8 +1,8 @@ import pipe from "it-pipe"; import PeerId from "peer-id"; import {Libp2p} from "libp2p/src/connection-manager"; -import {IForkDigestContext} from "@chainsafe/lodestar-config"; -import {ErrorAborted, ILogger, withTimeout, TimeoutError} from "@chainsafe/lodestar-utils"; +import {IForkDigestContext} from "@lodestar/config"; +import {ErrorAborted, ILogger, withTimeout, TimeoutError} from "@lodestar/utils"; import {timeoutOptions} from "../../../constants/index.js"; import {prettyPrintPeerId} from "../../util.js"; import {PeersData} from "../../peers/peersData.js"; diff --git a/packages/lodestar/src/network/reqresp/request/responseTimeoutsHandler.ts b/packages/beacon-node/src/network/reqresp/request/responseTimeoutsHandler.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/request/responseTimeoutsHandler.ts rename to packages/beacon-node/src/network/reqresp/request/responseTimeoutsHandler.ts diff --git a/packages/lodestar/src/network/reqresp/response/errors.ts b/packages/beacon-node/src/network/reqresp/response/errors.ts similarity index 94% rename from packages/lodestar/src/network/reqresp/response/errors.ts rename to packages/beacon-node/src/network/reqresp/response/errors.ts index a021cfa71beb..b6af866959bc 100644 --- a/packages/lodestar/src/network/reqresp/response/errors.ts +++ b/packages/beacon-node/src/network/reqresp/response/errors.ts @@ -1,4 +1,4 @@ -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {LodestarError} from "@lodestar/utils"; import {RespStatus, RpcResponseStatusError} from "../../../constants/index.js"; type RpcResponseStatusNotSuccess = Exclude; diff --git a/packages/lodestar/src/network/reqresp/response/index.ts b/packages/beacon-node/src/network/reqresp/response/index.ts similarity index 97% rename from packages/lodestar/src/network/reqresp/response/index.ts rename to packages/beacon-node/src/network/reqresp/response/index.ts index d3406a5da130..d87079bf7681 100644 --- a/packages/lodestar/src/network/reqresp/response/index.ts +++ b/packages/beacon-node/src/network/reqresp/response/index.ts @@ -1,7 +1,7 @@ import PeerId from "peer-id"; import pipe from "it-pipe"; -import {ILogger, TimeoutError, withTimeout} from "@chainsafe/lodestar-utils"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +import {ILogger, TimeoutError, withTimeout} from "@lodestar/utils"; +import {IBeaconConfig} from "@lodestar/config"; import {REQUEST_TIMEOUT, RespStatus} from "../../../constants/index.js"; import {prettyPrintPeerId} from "../../util.js"; import {PeersData} from "../../peers/peersData.js"; diff --git a/packages/lodestar/src/network/reqresp/response/rateLimiter.ts b/packages/beacon-node/src/network/reqresp/response/rateLimiter.ts similarity index 99% rename from packages/lodestar/src/network/reqresp/response/rateLimiter.ts rename to packages/beacon-node/src/network/reqresp/response/rateLimiter.ts index e7ba1313ccba..8a2568af0a31 100644 --- a/packages/lodestar/src/network/reqresp/response/rateLimiter.ts +++ b/packages/beacon-node/src/network/reqresp/response/rateLimiter.ts @@ -1,5 +1,5 @@ import PeerId from "peer-id"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ILogger} from "@lodestar/utils"; import {IMetrics} from "../../../metrics/index.js"; import {MapDef} from "../../../util/map.js"; import {IPeerRpcScoreStore, PeerAction} from "../../peers/score.js"; diff --git a/packages/lodestar/src/network/reqresp/score.ts b/packages/beacon-node/src/network/reqresp/score.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/score.ts rename to packages/beacon-node/src/network/reqresp/score.ts diff --git a/packages/lodestar/src/network/reqresp/types.ts b/packages/beacon-node/src/network/reqresp/types.ts similarity index 98% rename from packages/lodestar/src/network/reqresp/types.ts rename to packages/beacon-node/src/network/reqresp/types.ts index f100cc73ba5d..952aa7856b4a 100644 --- a/packages/lodestar/src/network/reqresp/types.ts +++ b/packages/beacon-node/src/network/reqresp/types.ts @@ -1,5 +1,5 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {allForks, phase0, ssz, Slot} from "@chainsafe/lodestar-types"; +import {ForkName} from "@lodestar/params"; +import {allForks, phase0, ssz, Slot} from "@lodestar/types"; export const protocolPrefix = "/eth2/beacon_chain/req"; diff --git a/packages/lodestar/src/network/reqresp/utils/assertSequentialBlocksInRange.ts b/packages/beacon-node/src/network/reqresp/utils/assertSequentialBlocksInRange.ts similarity index 94% rename from packages/lodestar/src/network/reqresp/utils/assertSequentialBlocksInRange.ts rename to packages/beacon-node/src/network/reqresp/utils/assertSequentialBlocksInRange.ts index 08114e1f3382..a532bf15a4e5 100644 --- a/packages/lodestar/src/network/reqresp/utils/assertSequentialBlocksInRange.ts +++ b/packages/beacon-node/src/network/reqresp/utils/assertSequentialBlocksInRange.ts @@ -1,5 +1,5 @@ -import {allForks, phase0} from "@chainsafe/lodestar-types"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {allForks, phase0} from "@lodestar/types"; +import {LodestarError} from "@lodestar/utils"; /** * Asserts a response from BeaconBlocksByRange respects the request and is sequential diff --git a/packages/lodestar/src/network/reqresp/utils/bufferedSource.ts b/packages/beacon-node/src/network/reqresp/utils/bufferedSource.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/utils/bufferedSource.ts rename to packages/beacon-node/src/network/reqresp/utils/bufferedSource.ts diff --git a/packages/lodestar/src/network/reqresp/utils/errorMessage.ts b/packages/beacon-node/src/network/reqresp/utils/errorMessage.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/utils/errorMessage.ts rename to packages/beacon-node/src/network/reqresp/utils/errorMessage.ts diff --git a/packages/lodestar/src/network/reqresp/utils/index.ts b/packages/beacon-node/src/network/reqresp/utils/index.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/utils/index.ts rename to packages/beacon-node/src/network/reqresp/utils/index.ts diff --git a/packages/lodestar/src/network/reqresp/utils/onChunk.ts b/packages/beacon-node/src/network/reqresp/utils/onChunk.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/utils/onChunk.ts rename to packages/beacon-node/src/network/reqresp/utils/onChunk.ts diff --git a/packages/lodestar/src/network/reqresp/utils/protocolId.ts b/packages/beacon-node/src/network/reqresp/utils/protocolId.ts similarity index 100% rename from packages/lodestar/src/network/reqresp/utils/protocolId.ts rename to packages/beacon-node/src/network/reqresp/utils/protocolId.ts diff --git a/packages/lodestar/src/network/reqresp/utils/renderRequestBody.ts b/packages/beacon-node/src/network/reqresp/utils/renderRequestBody.ts similarity index 94% rename from packages/lodestar/src/network/reqresp/utils/renderRequestBody.ts rename to packages/beacon-node/src/network/reqresp/utils/renderRequestBody.ts index c2e6b394b1cf..a9e476294f08 100644 --- a/packages/lodestar/src/network/reqresp/utils/renderRequestBody.ts +++ b/packages/beacon-node/src/network/reqresp/utils/renderRequestBody.ts @@ -1,4 +1,4 @@ -import {toHexString} from "@chainsafe/lodestar-utils"; +import {toHexString} from "@lodestar/utils"; import {Method, RequestBodyByMethod, RequestBody} from "../types.js"; /** diff --git a/packages/lodestar/src/network/subnets/attnetsService.ts b/packages/beacon-node/src/network/subnets/attnetsService.ts similarity index 97% rename from packages/lodestar/src/network/subnets/attnetsService.ts rename to packages/beacon-node/src/network/subnets/attnetsService.ts index 86bdbd5faae5..b6e56d42af09 100644 --- a/packages/lodestar/src/network/subnets/attnetsService.ts +++ b/packages/beacon-node/src/network/subnets/attnetsService.ts @@ -1,14 +1,14 @@ -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; +import {IChainForkConfig} from "@lodestar/config"; import { ATTESTATION_SUBNET_COUNT, EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION, ForkName, RANDOM_SUBNETS_PER_VALIDATOR, SLOTS_PER_EPOCH, -} from "@chainsafe/lodestar-params"; -import {Epoch, Slot, ssz} from "@chainsafe/lodestar-types"; -import {ILogger, randBetween} from "@chainsafe/lodestar-utils"; +} from "@lodestar/params"; +import {Epoch, Slot, ssz} from "@lodestar/types"; +import {ILogger, randBetween} from "@lodestar/utils"; import {shuffle} from "../../util/shuffle.js"; import {ChainEvent, IBeaconChain} from "../../chain/index.js"; import {Eth2Gossipsub, GossipType} from "../gossip/index.js"; diff --git a/packages/lodestar/src/network/subnets/index.ts b/packages/beacon-node/src/network/subnets/index.ts similarity index 100% rename from packages/lodestar/src/network/subnets/index.ts rename to packages/beacon-node/src/network/subnets/index.ts diff --git a/packages/lodestar/src/network/subnets/interface.ts b/packages/beacon-node/src/network/subnets/interface.ts similarity index 86% rename from packages/lodestar/src/network/subnets/interface.ts rename to packages/beacon-node/src/network/subnets/interface.ts index 0afb0a3b2d80..df029d0d3447 100644 --- a/packages/lodestar/src/network/subnets/interface.ts +++ b/packages/beacon-node/src/network/subnets/interface.ts @@ -1,5 +1,5 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {Slot, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {ForkName} from "@lodestar/params"; +import {Slot, ValidatorIndex} from "@lodestar/types"; import {RequestedSubnet} from "../peers/utils/index.js"; /** Generic CommitteeSubscription for both beacon attnets subs and syncnets subs */ diff --git a/packages/lodestar/src/network/subnets/syncnetsService.ts b/packages/beacon-node/src/network/subnets/syncnetsService.ts similarity index 93% rename from packages/lodestar/src/network/subnets/syncnetsService.ts rename to packages/beacon-node/src/network/subnets/syncnetsService.ts index 8916f74ad770..fcf54e971376 100644 --- a/packages/lodestar/src/network/subnets/syncnetsService.ts +++ b/packages/beacon-node/src/network/subnets/syncnetsService.ts @@ -1,8 +1,8 @@ -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ForkName, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {Epoch, ssz} from "@chainsafe/lodestar-types"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {ForkName, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {Epoch, ssz} from "@lodestar/types"; +import {ILogger} from "@lodestar/utils"; import {ChainEvent, IBeaconChain} from "../../chain/index.js"; import {getActiveForks} from "../forks.js"; import {Eth2Gossipsub, GossipType} from "../gossip/index.js"; diff --git a/packages/lodestar/src/network/util.ts b/packages/beacon-node/src/network/util.ts similarity index 100% rename from packages/lodestar/src/network/util.ts rename to packages/beacon-node/src/network/util.ts diff --git a/packages/lodestar/src/node/index.ts b/packages/beacon-node/src/node/index.ts similarity index 100% rename from packages/lodestar/src/node/index.ts rename to packages/beacon-node/src/node/index.ts diff --git a/packages/lodestar/src/node/loggerOptions.ts b/packages/beacon-node/src/node/loggerOptions.ts similarity index 92% rename from packages/lodestar/src/node/loggerOptions.ts rename to packages/beacon-node/src/node/loggerOptions.ts index 8bada4440088..0351e1f40622 100644 --- a/packages/lodestar/src/node/loggerOptions.ts +++ b/packages/beacon-node/src/node/loggerOptions.ts @@ -1,4 +1,4 @@ -import {defaultLogLevel, ILoggerOptions, LogLevel} from "@chainsafe/lodestar-utils"; +import {defaultLogLevel, ILoggerOptions, LogLevel} from "@lodestar/utils"; export interface IBeaconLoggerOptions { chain: ILoggerOptions; diff --git a/packages/lodestar/src/node/nodejs.ts b/packages/beacon-node/src/node/nodejs.ts similarity index 95% rename from packages/lodestar/src/node/nodejs.ts rename to packages/beacon-node/src/node/nodejs.ts index 20504142ab15..7ea39a000774 100644 --- a/packages/lodestar/src/node/nodejs.ts +++ b/packages/beacon-node/src/node/nodejs.ts @@ -5,11 +5,11 @@ import LibP2p from "libp2p"; import {Registry} from "prom-client"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {phase0} from "@chainsafe/lodestar-types"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {Api} from "@chainsafe/lodestar-api"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {phase0} from "@lodestar/types"; +import {ILogger} from "@lodestar/utils"; +import {Api} from "@lodestar/api"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; import {IBeaconDb} from "../db/index.js"; import {INetwork, Network, getReqRespHandlers} from "../network/index.js"; diff --git a/packages/lodestar/src/node/notifier.ts b/packages/beacon-node/src/node/notifier.ts similarity index 93% rename from packages/lodestar/src/node/notifier.ts rename to packages/beacon-node/src/node/notifier.ts index 3b2a2a789188..fd93f006b0f2 100644 --- a/packages/lodestar/src/node/notifier.ts +++ b/packages/beacon-node/src/node/notifier.ts @@ -1,11 +1,7 @@ -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ErrorAborted, ILogger, sleep, prettyBytes} from "@chainsafe/lodestar-utils"; -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import { - computeEpochAtSlot, - isBellatrixCachedStateType, - isMergeTransitionComplete, -} from "@chainsafe/lodestar-beacon-state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {ErrorAborted, ILogger, sleep, prettyBytes} from "@lodestar/utils"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {computeEpochAtSlot, isBellatrixCachedStateType, isMergeTransitionComplete} from "@lodestar/state-transition"; import {IBeaconChain} from "../chain/index.js"; import {INetwork} from "../network/index.js"; import {IBeaconSync, SyncState} from "../sync/index.js"; diff --git a/packages/lodestar/src/node/options.ts b/packages/beacon-node/src/node/options.ts similarity index 100% rename from packages/lodestar/src/node/options.ts rename to packages/beacon-node/src/node/options.ts diff --git a/packages/lodestar/src/node/utils/interop/deposits.ts b/packages/beacon-node/src/node/utils/interop/deposits.ts similarity index 83% rename from packages/lodestar/src/node/utils/interop/deposits.ts rename to packages/beacon-node/src/node/utils/interop/deposits.ts index 0a467a386503..56a6c4300f50 100644 --- a/packages/lodestar/src/node/utils/interop/deposits.ts +++ b/packages/beacon-node/src/node/utils/interop/deposits.ts @@ -1,14 +1,9 @@ import {digest} from "@chainsafe/as-sha256"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {phase0, ssz} from "@lodestar/types"; import {toGindex, Tree} from "@chainsafe/persistent-merkle-tree"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import { - computeDomain, - computeSigningRoot, - interopSecretKeys, - ZERO_HASH, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {BLS_WITHDRAWAL_PREFIX, DOMAIN_DEPOSIT, MAX_EFFECTIVE_BALANCE} from "@chainsafe/lodestar-params"; +import {IChainForkConfig} from "@lodestar/config"; +import {computeDomain, computeSigningRoot, interopSecretKeys, ZERO_HASH} from "@lodestar/state-transition"; +import {BLS_WITHDRAWAL_PREFIX, DOMAIN_DEPOSIT, MAX_EFFECTIVE_BALANCE} from "@lodestar/params"; import {DepositTree} from "../../../db/repositories/depositDataRoot.js"; /** diff --git a/packages/lodestar/src/node/utils/interop/state.ts b/packages/beacon-node/src/node/utils/interop/state.ts similarity index 79% rename from packages/lodestar/src/node/utils/interop/state.ts rename to packages/beacon-node/src/node/utils/interop/state.ts index 6fd1731393f3..ad5fd1eadf2b 100644 --- a/packages/lodestar/src/node/utils/interop/state.ts +++ b/packages/beacon-node/src/node/utils/interop/state.ts @@ -1,8 +1,8 @@ -import {Bytes32, phase0, ssz, TimeSeconds} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {BeaconStateAllForks, initializeBeaconStateFromEth1} from "@chainsafe/lodestar-beacon-state-transition"; -import {createEmptyEpochContextImmutableData} from "@chainsafe/lodestar-beacon-state-transition"; -import {GENESIS_BASE_FEE_PER_GAS, GENESIS_GAS_LIMIT} from "@chainsafe/lodestar-params"; +import {Bytes32, phase0, ssz, TimeSeconds} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {BeaconStateAllForks, initializeBeaconStateFromEth1} from "@lodestar/state-transition"; +import {createEmptyEpochContextImmutableData} from "@lodestar/state-transition"; +import {GENESIS_BASE_FEE_PER_GAS, GENESIS_GAS_LIMIT} from "@lodestar/params"; import {DepositTree} from "../../../db/repositories/depositDataRoot.js"; export const INTEROP_BLOCK_HASH = Buffer.alloc(32, "B"); diff --git a/packages/lodestar/src/node/utils/state.ts b/packages/beacon-node/src/node/utils/state.ts similarity index 86% rename from packages/lodestar/src/node/utils/state.ts rename to packages/beacon-node/src/node/utils/state.ts index cb164da253b8..cb858bfb603a 100644 --- a/packages/lodestar/src/node/utils/state.ts +++ b/packages/beacon-node/src/node/utils/state.ts @@ -1,6 +1,6 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; +import {phase0, ssz} from "@lodestar/types"; import {IBeaconDb} from "../../db/index.js"; import {GENESIS_SLOT} from "../../constants/index.js"; import {interopDeposits} from "./interop/deposits.js"; diff --git a/packages/lodestar/src/sync/backfill/backfill.ts b/packages/beacon-node/src/sync/backfill/backfill.ts similarity index 98% rename from packages/lodestar/src/sync/backfill/backfill.ts rename to packages/beacon-node/src/sync/backfill/backfill.ts index 823f13ec897a..64e0b4fb2ebe 100644 --- a/packages/lodestar/src/sync/backfill/backfill.ts +++ b/packages/beacon-node/src/sync/backfill/backfill.ts @@ -1,13 +1,13 @@ import {EventEmitter} from "events"; import PeerId from "peer-id"; import {StrictEventEmitter} from "strict-event-emitter-types"; -import {BeaconStateAllForks, blockToHeader} from "@chainsafe/lodestar-beacon-state-transition"; -import {IBeaconConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; -import {phase0, Root, Slot, allForks, ssz} from "@chainsafe/lodestar-types"; -import {ErrorAborted, ILogger, sleep} from "@chainsafe/lodestar-utils"; +import {BeaconStateAllForks, blockToHeader} from "@lodestar/state-transition"; +import {IBeaconConfig, IChainForkConfig} from "@lodestar/config"; +import {phase0, Root, Slot, allForks, ssz} from "@lodestar/types"; +import {ErrorAborted, ILogger, sleep} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {IBeaconChain} from "../../chain/index.js"; import {GENESIS_SLOT, ZERO_HASH} from "../../constants/index.js"; import {IBeaconDb} from "../../db/index.js"; diff --git a/packages/lodestar/src/sync/backfill/errors.ts b/packages/beacon-node/src/sync/backfill/errors.ts similarity index 88% rename from packages/lodestar/src/sync/backfill/errors.ts rename to packages/beacon-node/src/sync/backfill/errors.ts index 5f1e04980079..548b993b50fa 100644 --- a/packages/lodestar/src/sync/backfill/errors.ts +++ b/packages/beacon-node/src/sync/backfill/errors.ts @@ -1,6 +1,6 @@ import PeerId from "peer-id"; -import {LodestarError} from "@chainsafe/lodestar-utils"; -import {Root} from "@chainsafe/lodestar-types"; +import {LodestarError} from "@lodestar/utils"; +import {Root} from "@lodestar/types"; export enum BackfillSyncErrorCode { /** fetched block doesn't connect to anchor block */ diff --git a/packages/lodestar/src/sync/backfill/index.ts b/packages/beacon-node/src/sync/backfill/index.ts similarity index 100% rename from packages/lodestar/src/sync/backfill/index.ts rename to packages/beacon-node/src/sync/backfill/index.ts diff --git a/packages/lodestar/src/sync/backfill/verify.ts b/packages/beacon-node/src/sync/backfill/verify.ts similarity index 87% rename from packages/lodestar/src/sync/backfill/verify.ts rename to packages/beacon-node/src/sync/backfill/verify.ts index 8d6d9d9a051c..db68e7f66a53 100644 --- a/packages/lodestar/src/sync/backfill/verify.ts +++ b/packages/beacon-node/src/sync/backfill/verify.ts @@ -1,11 +1,7 @@ -import { - CachedBeaconStateAllForks, - ISignatureSet, - getProposerSignatureSet, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {allForks, Root, allForks as allForkTypes, ssz, Slot} from "@chainsafe/lodestar-types"; -import {GENESIS_SLOT} from "@chainsafe/lodestar-params"; +import {CachedBeaconStateAllForks, ISignatureSet, getProposerSignatureSet} from "@lodestar/state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {allForks, Root, allForks as allForkTypes, ssz, Slot} from "@lodestar/types"; +import {GENESIS_SLOT} from "@lodestar/params"; import {IBlsVerifier} from "../../chain/bls/index.js"; import {BackfillSyncError, BackfillSyncErrorCode} from "./errors.js"; diff --git a/packages/lodestar/src/sync/constants.ts b/packages/beacon-node/src/sync/constants.ts similarity index 100% rename from packages/lodestar/src/sync/constants.ts rename to packages/beacon-node/src/sync/constants.ts diff --git a/packages/lodestar/src/sync/index.ts b/packages/beacon-node/src/sync/index.ts similarity index 100% rename from packages/lodestar/src/sync/index.ts rename to packages/beacon-node/src/sync/index.ts diff --git a/packages/lodestar/src/sync/interface.ts b/packages/beacon-node/src/sync/interface.ts similarity index 88% rename from packages/lodestar/src/sync/interface.ts rename to packages/beacon-node/src/sync/interface.ts index 9baeaac65d76..8debff8982ad 100644 --- a/packages/lodestar/src/sync/interface.ts +++ b/packages/beacon-node/src/sync/interface.ts @@ -1,7 +1,7 @@ -import {ILogger} from "@chainsafe/lodestar-utils"; -import {allForks, RootHex, Slot, phase0} from "@chainsafe/lodestar-types"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {routes} from "@chainsafe/lodestar-api"; +import {ILogger} from "@lodestar/utils"; +import {allForks, RootHex, Slot, phase0} from "@lodestar/types"; +import {IBeaconConfig} from "@lodestar/config"; +import {routes} from "@lodestar/api"; import {INetwork} from "../network/index.js"; import {IBeaconChain} from "../chain/index.js"; import {IMetrics} from "../metrics/index.js"; diff --git a/packages/lodestar/src/sync/options.ts b/packages/beacon-node/src/sync/options.ts similarity index 100% rename from packages/lodestar/src/sync/options.ts rename to packages/beacon-node/src/sync/options.ts diff --git a/packages/lodestar/src/sync/range/batch.ts b/packages/beacon-node/src/sync/range/batch.ts similarity index 96% rename from packages/lodestar/src/sync/range/batch.ts rename to packages/beacon-node/src/sync/range/batch.ts index f35d8f357aad..f998c67d6c81 100644 --- a/packages/lodestar/src/sync/range/batch.ts +++ b/packages/beacon-node/src/sync/range/batch.ts @@ -1,9 +1,9 @@ import PeerId from "peer-id"; -import {allForks, Epoch, phase0} from "@chainsafe/lodestar-types"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {LodestarError} from "@chainsafe/lodestar-utils"; -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; +import {allForks, Epoch, phase0} from "@lodestar/types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {IChainForkConfig} from "@lodestar/config"; +import {LodestarError} from "@lodestar/utils"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; import {BATCH_SLOT_OFFSET, MAX_BATCH_DOWNLOAD_ATTEMPTS, MAX_BATCH_PROCESSING_ATTEMPTS} from "../constants.js"; import {ChainSegmentError, BlockErrorCode} from "../../chain/errors/index.js"; import {hashBlocks} from "./utils/index.js"; diff --git a/packages/lodestar/src/sync/range/chain.ts b/packages/beacon-node/src/sync/range/chain.ts similarity index 98% rename from packages/lodestar/src/sync/range/chain.ts rename to packages/beacon-node/src/sync/range/chain.ts index fd8fdc33bdf1..e33ff4ec7bb1 100644 --- a/packages/lodestar/src/sync/range/chain.ts +++ b/packages/beacon-node/src/sync/range/chain.ts @@ -1,8 +1,8 @@ import PeerId from "peer-id"; -import {Epoch, Root, Slot, phase0, allForks} from "@chainsafe/lodestar-types"; -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; -import {ErrorAborted, ILogger} from "@chainsafe/lodestar-utils"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {Epoch, Root, Slot, phase0, allForks} from "@lodestar/types"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; +import {ErrorAborted, ILogger} from "@lodestar/utils"; +import {IChainForkConfig} from "@lodestar/config"; import {toHexString} from "@chainsafe/ssz"; import {PeerAction} from "../../network/index.js"; import {ChainSegmentError} from "../../chain/errors/index.js"; diff --git a/packages/lodestar/src/sync/range/range.ts b/packages/beacon-node/src/sync/range/range.ts similarity index 97% rename from packages/lodestar/src/sync/range/range.ts rename to packages/beacon-node/src/sync/range/range.ts index bc7037d02fbc..90fc597d94a3 100644 --- a/packages/lodestar/src/sync/range/range.ts +++ b/packages/beacon-node/src/sync/range/range.ts @@ -1,10 +1,10 @@ import {EventEmitter} from "events"; import StrictEventEmitter from "strict-event-emitter-types"; import PeerId from "peer-id"; -import {computeEpochAtSlot, computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {Epoch, Slot, phase0} from "@chainsafe/lodestar-types"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {computeEpochAtSlot, computeStartSlotAtEpoch} from "@lodestar/state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {Epoch, Slot, phase0} from "@lodestar/types"; +import {ILogger} from "@lodestar/utils"; import {IBeaconChain} from "../../chain/index.js"; import {INetwork} from "../../network/index.js"; import {IMetrics} from "../../metrics/index.js"; diff --git a/packages/lodestar/src/sync/range/utils/batches.ts b/packages/beacon-node/src/sync/range/utils/batches.ts similarity index 98% rename from packages/lodestar/src/sync/range/utils/batches.ts rename to packages/beacon-node/src/sync/range/utils/batches.ts index 26214a4ef161..ef73cc63b528 100644 --- a/packages/lodestar/src/sync/range/utils/batches.ts +++ b/packages/beacon-node/src/sync/range/utils/batches.ts @@ -1,4 +1,4 @@ -import {Epoch} from "@chainsafe/lodestar-types"; +import {Epoch} from "@lodestar/types"; import {Batch, BatchOpts, BatchStatus} from "../batch.js"; /** diff --git a/packages/lodestar/src/sync/range/utils/chainTarget.ts b/packages/beacon-node/src/sync/range/utils/chainTarget.ts similarity index 94% rename from packages/lodestar/src/sync/range/utils/chainTarget.ts rename to packages/beacon-node/src/sync/range/utils/chainTarget.ts index 9cb9c88d5787..e7c4c0bb3164 100644 --- a/packages/lodestar/src/sync/range/utils/chainTarget.ts +++ b/packages/beacon-node/src/sync/range/utils/chainTarget.ts @@ -1,4 +1,4 @@ -import {Root, Slot} from "@chainsafe/lodestar-types"; +import {Root, Slot} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; /** diff --git a/packages/lodestar/src/sync/range/utils/hashBlocks.ts b/packages/beacon-node/src/sync/range/utils/hashBlocks.ts similarity index 78% rename from packages/lodestar/src/sync/range/utils/hashBlocks.ts rename to packages/beacon-node/src/sync/range/utils/hashBlocks.ts index 47c5ac23c402..b4e63fa36e34 100644 --- a/packages/lodestar/src/sync/range/utils/hashBlocks.ts +++ b/packages/beacon-node/src/sync/range/utils/hashBlocks.ts @@ -1,5 +1,5 @@ -import {allForks} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {allForks} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; import {byteArrayConcat} from "../../../util/bytes.js"; /** diff --git a/packages/lodestar/src/sync/range/utils/index.ts b/packages/beacon-node/src/sync/range/utils/index.ts similarity index 100% rename from packages/lodestar/src/sync/range/utils/index.ts rename to packages/beacon-node/src/sync/range/utils/index.ts diff --git a/packages/lodestar/src/sync/range/utils/peerBalancer.ts b/packages/beacon-node/src/sync/range/utils/peerBalancer.ts similarity index 100% rename from packages/lodestar/src/sync/range/utils/peerBalancer.ts rename to packages/beacon-node/src/sync/range/utils/peerBalancer.ts diff --git a/packages/lodestar/src/sync/range/utils/updateChains.ts b/packages/beacon-node/src/sync/range/utils/updateChains.ts similarity index 100% rename from packages/lodestar/src/sync/range/utils/updateChains.ts rename to packages/beacon-node/src/sync/range/utils/updateChains.ts diff --git a/packages/lodestar/src/sync/sync.ts b/packages/beacon-node/src/sync/sync.ts similarity index 98% rename from packages/lodestar/src/sync/sync.ts rename to packages/beacon-node/src/sync/sync.ts index 2d77865da73b..d788d11c4a37 100644 --- a/packages/lodestar/src/sync/sync.ts +++ b/packages/beacon-node/src/sync/sync.ts @@ -1,7 +1,7 @@ import PeerId from "peer-id"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {Slot, phase0} from "@chainsafe/lodestar-types"; +import {ILogger} from "@lodestar/utils"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {Slot, phase0} from "@lodestar/types"; import {INetwork, NetworkEvent} from "../network/index.js"; import {IMetrics} from "../metrics/index.js"; import {ChainEvent, IBeaconChain} from "../chain/index.js"; diff --git a/packages/lodestar/src/sync/unknownBlock.ts b/packages/beacon-node/src/sync/unknownBlock.ts similarity index 98% rename from packages/lodestar/src/sync/unknownBlock.ts rename to packages/beacon-node/src/sync/unknownBlock.ts index 17a0bd219aef..48e058913421 100644 --- a/packages/lodestar/src/sync/unknownBlock.ts +++ b/packages/beacon-node/src/sync/unknownBlock.ts @@ -1,7 +1,7 @@ import PeerId from "peer-id"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {allForks, Root, RootHex} from "@chainsafe/lodestar-types"; +import {IChainForkConfig} from "@lodestar/config"; +import {ILogger} from "@lodestar/utils"; +import {allForks, Root, RootHex} from "@lodestar/types"; import {fromHexString, toHexString} from "@chainsafe/ssz"; import {INetwork, NetworkEvent, PeerAction} from "../network/index.js"; import {IBeaconChain} from "../chain/index.js"; diff --git a/packages/lodestar/src/sync/utils/pendingBlocksTree.ts b/packages/beacon-node/src/sync/utils/pendingBlocksTree.ts similarity index 97% rename from packages/lodestar/src/sync/utils/pendingBlocksTree.ts rename to packages/beacon-node/src/sync/utils/pendingBlocksTree.ts index a6f359184905..230f1a67e6e4 100644 --- a/packages/lodestar/src/sync/utils/pendingBlocksTree.ts +++ b/packages/beacon-node/src/sync/utils/pendingBlocksTree.ts @@ -1,4 +1,4 @@ -import {RootHex} from "@chainsafe/lodestar-types"; +import {RootHex} from "@lodestar/types"; import {MapDef} from "../../util/map.js"; import {PendingBlock, PendingBlockStatus} from "../interface.js"; diff --git a/packages/lodestar/src/sync/utils/remoteSyncType.ts b/packages/beacon-node/src/sync/utils/remoteSyncType.ts similarity index 97% rename from packages/lodestar/src/sync/utils/remoteSyncType.ts rename to packages/beacon-node/src/sync/utils/remoteSyncType.ts index 26ed7ba70ce7..a250d9bd8358 100644 --- a/packages/lodestar/src/sync/utils/remoteSyncType.ts +++ b/packages/beacon-node/src/sync/utils/remoteSyncType.ts @@ -1,5 +1,5 @@ -import {IForkChoice} from "@chainsafe/lodestar-fork-choice"; -import {phase0} from "@chainsafe/lodestar-types"; +import {IForkChoice} from "@lodestar/fork-choice"; +import {phase0} from "@lodestar/types"; /** The type of peer relative to our current state */ export enum PeerSyncType { diff --git a/packages/lodestar/src/util/abortableSource.ts b/packages/beacon-node/src/util/abortableSource.ts similarity index 100% rename from packages/lodestar/src/util/abortableSource.ts rename to packages/beacon-node/src/util/abortableSource.ts diff --git a/packages/lodestar/src/util/address.ts b/packages/beacon-node/src/util/address.ts similarity index 100% rename from packages/lodestar/src/util/address.ts rename to packages/beacon-node/src/util/address.ts diff --git a/packages/lodestar/src/util/array.ts b/packages/beacon-node/src/util/array.ts similarity index 100% rename from packages/lodestar/src/util/array.ts rename to packages/beacon-node/src/util/array.ts diff --git a/packages/lodestar/src/util/binarySearch.ts b/packages/beacon-node/src/util/binarySearch.ts similarity index 100% rename from packages/lodestar/src/util/binarySearch.ts rename to packages/beacon-node/src/util/binarySearch.ts diff --git a/packages/lodestar/src/util/bitArray.ts b/packages/beacon-node/src/util/bitArray.ts similarity index 100% rename from packages/lodestar/src/util/bitArray.ts rename to packages/beacon-node/src/util/bitArray.ts diff --git a/packages/lodestar/src/util/bytes.ts b/packages/beacon-node/src/util/bytes.ts similarity index 92% rename from packages/lodestar/src/util/bytes.ts rename to packages/beacon-node/src/util/bytes.ts index 0881825a649b..ffc60758939d 100644 --- a/packages/lodestar/src/util/bytes.ts +++ b/packages/beacon-node/src/util/bytes.ts @@ -1,4 +1,4 @@ -import {Root} from "@chainsafe/lodestar-types"; +import {Root} from "@lodestar/types"; export function byteArrayConcat(bytesArr: Uint8Array[]): Uint8Array { const totalBytes = bytesArr.reduce((total, bytes) => total + bytes.length, 0); diff --git a/packages/lodestar/src/util/chunkify.ts b/packages/beacon-node/src/util/chunkify.ts similarity index 100% rename from packages/lodestar/src/util/chunkify.ts rename to packages/beacon-node/src/util/chunkify.ts diff --git a/packages/lodestar/src/util/file.ts b/packages/beacon-node/src/util/file.ts similarity index 100% rename from packages/lodestar/src/util/file.ts rename to packages/beacon-node/src/util/file.ts diff --git a/packages/lodestar/src/util/forkName.ts b/packages/beacon-node/src/util/forkName.ts similarity index 77% rename from packages/lodestar/src/util/forkName.ts rename to packages/beacon-node/src/util/forkName.ts index fa190bee1130..bda5895dbcd5 100644 --- a/packages/lodestar/src/util/forkName.ts +++ b/packages/beacon-node/src/util/forkName.ts @@ -1,6 +1,6 @@ -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {Slot} from "@chainsafe/lodestar-types"; +import {IBeaconConfig} from "@lodestar/config"; +import {ForkName} from "@lodestar/params"; +import {Slot} from "@lodestar/types"; /** * Group an array of items by ForkName according to the slot associted to each item diff --git a/packages/lodestar/src/util/graffiti.ts b/packages/beacon-node/src/util/graffiti.ts similarity index 100% rename from packages/lodestar/src/util/graffiti.ts rename to packages/beacon-node/src/util/graffiti.ts diff --git a/packages/lodestar/src/util/hex.ts b/packages/beacon-node/src/util/hex.ts similarity index 79% rename from packages/lodestar/src/util/hex.ts rename to packages/beacon-node/src/util/hex.ts index 978b45fae4f8..a0654e627f78 100644 --- a/packages/lodestar/src/util/hex.ts +++ b/packages/beacon-node/src/util/hex.ts @@ -1,4 +1,4 @@ -import {RootHex} from "@chainsafe/lodestar-types"; +import {RootHex} from "@lodestar/types"; export function bufferToHex(buffer: Buffer): RootHex { return "0x" + buffer.toString("hex"); diff --git a/packages/lodestar/src/util/itTrigger.ts b/packages/beacon-node/src/util/itTrigger.ts similarity index 100% rename from packages/lodestar/src/util/itTrigger.ts rename to packages/beacon-node/src/util/itTrigger.ts diff --git a/packages/lodestar/src/util/map.ts b/packages/beacon-node/src/util/map.ts similarity index 100% rename from packages/lodestar/src/util/map.ts rename to packages/beacon-node/src/util/map.ts diff --git a/packages/lodestar/src/util/multifork.ts b/packages/beacon-node/src/util/multifork.ts similarity index 89% rename from packages/lodestar/src/util/multifork.ts rename to packages/beacon-node/src/util/multifork.ts index 167f152137ff..a9b226d65c5d 100644 --- a/packages/lodestar/src/util/multifork.ts +++ b/packages/beacon-node/src/util/multifork.ts @@ -1,6 +1,6 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {allForks, Slot} from "@chainsafe/lodestar-types"; -import {bytesToInt} from "@chainsafe/lodestar-utils"; +import {IChainForkConfig} from "@lodestar/config"; +import {allForks, Slot} from "@lodestar/types"; +import {bytesToInt} from "@lodestar/utils"; /** * Slot uint64 diff --git a/packages/lodestar/src/util/numpy.ts b/packages/beacon-node/src/util/numpy.ts similarity index 100% rename from packages/lodestar/src/util/numpy.ts rename to packages/beacon-node/src/util/numpy.ts diff --git a/packages/lodestar/src/util/peerMap.ts b/packages/beacon-node/src/util/peerMap.ts similarity index 100% rename from packages/lodestar/src/util/peerMap.ts rename to packages/beacon-node/src/util/peerMap.ts diff --git a/packages/lodestar/src/util/queue/errors.ts b/packages/beacon-node/src/util/queue/errors.ts similarity index 86% rename from packages/lodestar/src/util/queue/errors.ts rename to packages/beacon-node/src/util/queue/errors.ts index b38a8d5b267d..d910f781a64c 100644 --- a/packages/lodestar/src/util/queue/errors.ts +++ b/packages/beacon-node/src/util/queue/errors.ts @@ -1,4 +1,4 @@ -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {LodestarError} from "@lodestar/utils"; export enum QueueErrorCode { QUEUE_ABORTED = "QUEUE_ERROR_QUEUE_ABORTED", diff --git a/packages/lodestar/src/util/queue/fnQueue.ts b/packages/beacon-node/src/util/queue/fnQueue.ts similarity index 100% rename from packages/lodestar/src/util/queue/fnQueue.ts rename to packages/beacon-node/src/util/queue/fnQueue.ts diff --git a/packages/lodestar/src/util/queue/index.ts b/packages/beacon-node/src/util/queue/index.ts similarity index 100% rename from packages/lodestar/src/util/queue/index.ts rename to packages/beacon-node/src/util/queue/index.ts diff --git a/packages/lodestar/src/util/queue/itemQueue.ts b/packages/beacon-node/src/util/queue/itemQueue.ts similarity index 98% rename from packages/lodestar/src/util/queue/itemQueue.ts rename to packages/beacon-node/src/util/queue/itemQueue.ts index 8efbb7160c82..3b2c25816b4e 100644 --- a/packages/lodestar/src/util/queue/itemQueue.ts +++ b/packages/beacon-node/src/util/queue/itemQueue.ts @@ -1,4 +1,4 @@ -import {sleep} from "@chainsafe/lodestar-utils"; +import {sleep} from "@lodestar/utils"; import {LinkedList} from "../array.js"; import {QueueError, QueueErrorCode} from "./errors.js"; import {defaultQueueOpts, IQueueMetrics, JobQueueOpts, QueueType} from "./options.js"; diff --git a/packages/lodestar/src/util/queue/options.ts b/packages/beacon-node/src/util/queue/options.ts similarity index 100% rename from packages/lodestar/src/util/queue/options.ts rename to packages/beacon-node/src/util/queue/options.ts diff --git a/packages/lodestar/src/util/shuffle.ts b/packages/beacon-node/src/util/shuffle.ts similarity index 100% rename from packages/lodestar/src/util/shuffle.ts rename to packages/beacon-node/src/util/shuffle.ts diff --git a/packages/lodestar/src/util/sortBy.ts b/packages/beacon-node/src/util/sortBy.ts similarity index 100% rename from packages/lodestar/src/util/sortBy.ts rename to packages/beacon-node/src/util/sortBy.ts diff --git a/packages/lodestar/src/util/time.ts b/packages/beacon-node/src/util/time.ts similarity index 100% rename from packages/lodestar/src/util/time.ts rename to packages/beacon-node/src/util/time.ts diff --git a/packages/lodestar/src/util/timeSeries.ts b/packages/beacon-node/src/util/timeSeries.ts similarity index 100% rename from packages/lodestar/src/util/timeSeries.ts rename to packages/beacon-node/src/util/timeSeries.ts diff --git a/packages/lodestar/src/util/wrapError.ts b/packages/beacon-node/src/util/wrapError.ts similarity index 100% rename from packages/lodestar/src/util/wrapError.ts rename to packages/beacon-node/src/util/wrapError.ts diff --git a/packages/lodestar/test/e2e/api/impl/beacon/state/endpoint.test.ts b/packages/beacon-node/test/e2e/api/impl/beacon/state/endpoint.test.ts similarity index 94% rename from packages/lodestar/test/e2e/api/impl/beacon/state/endpoint.test.ts rename to packages/beacon-node/test/e2e/api/impl/beacon/state/endpoint.test.ts index 4eb86ae74e1c..be297d1e9831 100644 --- a/packages/lodestar/test/e2e/api/impl/beacon/state/endpoint.test.ts +++ b/packages/beacon-node/test/e2e/api/impl/beacon/state/endpoint.test.ts @@ -1,8 +1,8 @@ import chaiAsPromised from "chai-as-promised"; import chai, {expect} from "chai"; -import {createIBeaconConfig, IChainConfig} from "@chainsafe/lodestar-config"; -import {chainConfig as chainConfigDef} from "@chainsafe/lodestar-config/default"; -import {getClient} from "@chainsafe/lodestar-api"; +import {createIBeaconConfig, IChainConfig} from "@lodestar/config"; +import {chainConfig as chainConfigDef} from "@lodestar/config/default"; +import {getClient} from "@lodestar/api"; import {toHexString} from "@chainsafe/ssz"; import {LogLevel, testLogger, TestLoggerOpts} from "../../../../../utils/logger.js"; import {getDevBeaconNode} from "../../../../../utils/node/beacon.js"; diff --git a/packages/lodestar/test/e2e/api/lodestar/lodestar.test.ts b/packages/beacon-node/test/e2e/api/lodestar/lodestar.test.ts similarity index 94% rename from packages/lodestar/test/e2e/api/lodestar/lodestar.test.ts rename to packages/beacon-node/test/e2e/api/lodestar/lodestar.test.ts index a6d558834ee9..9a8982fef1f4 100644 --- a/packages/lodestar/test/e2e/api/lodestar/lodestar.test.ts +++ b/packages/beacon-node/test/e2e/api/lodestar/lodestar.test.ts @@ -1,10 +1,10 @@ import chaiAsPromised from "chai-as-promised"; import chai, {expect} from "chai"; -import {createIBeaconConfig, IChainConfig} from "@chainsafe/lodestar-config"; -import {chainConfig as chainConfigDef} from "@chainsafe/lodestar-config/default"; -import {phase0} from "@chainsafe/lodestar-types"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {getClient} from "@chainsafe/lodestar-api"; +import {createIBeaconConfig, IChainConfig} from "@lodestar/config"; +import {chainConfig as chainConfigDef} from "@lodestar/config/default"; +import {phase0} from "@lodestar/types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {getClient} from "@lodestar/api"; import {LogLevel, testLogger, TestLoggerOpts} from "../../../utils/logger.js"; import {getDevBeaconNode} from "../../../utils/node/beacon.js"; import {waitForEvent} from "../../../utils/events/resolver.js"; diff --git a/packages/lodestar/test/e2e/chain/bls/multithread.test.ts b/packages/beacon-node/test/e2e/chain/bls/multithread.test.ts similarity index 97% rename from packages/lodestar/test/e2e/chain/bls/multithread.test.ts rename to packages/beacon-node/test/e2e/chain/bls/multithread.test.ts index 8c3cb044e4d0..6bd72486c1ac 100644 --- a/packages/lodestar/test/e2e/chain/bls/multithread.test.ts +++ b/packages/beacon-node/test/e2e/chain/bls/multithread.test.ts @@ -1,7 +1,7 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; import bls from "@chainsafe/bls"; -import {ISignatureSet, SignatureSetType} from "@chainsafe/lodestar-beacon-state-transition"; +import {ISignatureSet, SignatureSetType} from "@lodestar/state-transition"; import {BlsMultiThreadWorkerPool} from "../../../../src/chain/bls/multithread/index.js"; import {testLogger} from "../../../utils/logger.js"; import {VerifySignatureOpts} from "../../../../src/chain/bls/interface.js"; diff --git a/packages/lodestar/test/e2e/chain/lightclient.test.ts b/packages/beacon-node/test/e2e/chain/lightclient.test.ts similarity index 94% rename from packages/lodestar/test/e2e/chain/lightclient.test.ts rename to packages/beacon-node/test/e2e/chain/lightclient.test.ts index 2937e7b6864a..858da505f806 100644 --- a/packages/lodestar/test/e2e/chain/lightclient.test.ts +++ b/packages/beacon-node/test/e2e/chain/lightclient.test.ts @@ -1,12 +1,12 @@ import {expect} from "chai"; -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {ssz} from "@chainsafe/lodestar-types"; +import {IChainConfig} from "@lodestar/config"; +import {ssz} from "@lodestar/types"; import {fromHexString, toHexString} from "@chainsafe/ssz"; -import {TimestampFormatCode} from "@chainsafe/lodestar-utils"; -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {Lightclient} from "@chainsafe/lodestar-light-client"; -import {ProtoBlock} from "@chainsafe/lodestar-fork-choice"; -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; +import {TimestampFormatCode} from "@lodestar/utils"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {Lightclient} from "@lodestar/light-client"; +import {ProtoBlock} from "@lodestar/fork-choice"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; import {testLogger, LogLevel, TestLoggerOpts} from "../../utils/logger.js"; import {getDevBeaconNode} from "../../utils/node/beacon.js"; import {getAndInitDevValidators} from "../../utils/node/validator.js"; diff --git a/packages/lodestar/test/e2e/db/api/beacon/repositories/blockArchive.test.ts b/packages/beacon-node/test/e2e/db/api/beacon/repositories/blockArchive.test.ts similarity index 96% rename from packages/lodestar/test/e2e/db/api/beacon/repositories/blockArchive.test.ts rename to packages/beacon-node/test/e2e/db/api/beacon/repositories/blockArchive.test.ts index f7546f0af5b0..8b3f9f0916bb 100644 --- a/packages/lodestar/test/e2e/db/api/beacon/repositories/blockArchive.test.ts +++ b/packages/beacon-node/test/e2e/db/api/beacon/repositories/blockArchive.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; -import {LevelDbController} from "@chainsafe/lodestar-db"; +import {config} from "@lodestar/config/default"; +import {LevelDbController} from "@lodestar/db"; import {fromHexString} from "@chainsafe/ssz"; -import {allForks, phase0, ssz} from "@chainsafe/lodestar-types"; +import {allForks, phase0, ssz} from "@lodestar/types"; import {BeaconDb} from "../../../../../../src/db/index.js"; import {generateSignedBlock} from "../../../../../utils/block.js"; import {testLogger} from "../../../../../utils/logger.js"; diff --git a/packages/lodestar/test/e2e/doppelganger/doppelganger.test.ts b/packages/beacon-node/test/e2e/doppelganger/doppelganger.test.ts similarity index 97% rename from packages/lodestar/test/e2e/doppelganger/doppelganger.test.ts rename to packages/beacon-node/test/e2e/doppelganger/doppelganger.test.ts index 21b3c32be9fe..cdfe255fea01 100644 --- a/packages/lodestar/test/e2e/doppelganger/doppelganger.test.ts +++ b/packages/beacon-node/test/e2e/doppelganger/doppelganger.test.ts @@ -1,12 +1,12 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; -import {routes} from "@chainsafe/lodestar-api/beacon"; -import {BLSPubkey, phase0, Slot, ssz} from "@chainsafe/lodestar-types"; -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {routes} from "@lodestar/api/beacon"; +import {BLSPubkey, phase0, Slot, ssz} from "@lodestar/types"; +import {IChainConfig} from "@lodestar/config"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {fromHexString} from "@chainsafe/ssz"; -import {Validator} from "@chainsafe/lodestar-validator"; -import {PubkeyHex} from "@chainsafe/lodestar-validator/src/types"; +import {Validator} from "@lodestar/validator"; +import {PubkeyHex} from "@lodestar/validator/src/types"; import {getAndInitDevValidators} from "../../utils/node/validator.js"; import {ChainEvent} from "../../../src/chain/index.js"; import {Network} from "../../../src/network/index.js"; diff --git a/packages/lodestar/test/e2e/eth1/eth1ForBlockProduction.test.ts b/packages/beacon-node/test/e2e/eth1/eth1ForBlockProduction.test.ts similarity index 96% rename from packages/lodestar/test/e2e/eth1/eth1ForBlockProduction.test.ts rename to packages/beacon-node/test/e2e/eth1/eth1ForBlockProduction.test.ts index 6901a4d4b677..fe336e38e5a6 100644 --- a/packages/lodestar/test/e2e/eth1/eth1ForBlockProduction.test.ts +++ b/packages/beacon-node/test/e2e/eth1/eth1ForBlockProduction.test.ts @@ -3,11 +3,11 @@ import "mocha"; import {promisify} from "node:util"; import {expect} from "chai"; import leveldown from "leveldown"; -import {sleep} from "@chainsafe/lodestar-utils"; -import {LevelDbController} from "@chainsafe/lodestar-db"; +import {sleep} from "@lodestar/utils"; +import {LevelDbController} from "@lodestar/db"; import {fromHexString, toHexString} from "@chainsafe/ssz"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {Eth1ForBlockProduction} from "../../../src/eth1/index.js"; import {Eth1Options} from "../../../src/eth1/options.js"; import {getTestnetConfig, medallaTestnetConfig} from "../../utils/testnet.js"; diff --git a/packages/lodestar/test/e2e/eth1/eth1MergeBlockTracker.test.ts b/packages/beacon-node/test/e2e/eth1/eth1MergeBlockTracker.test.ts similarity index 98% rename from packages/lodestar/test/e2e/eth1/eth1MergeBlockTracker.test.ts rename to packages/beacon-node/test/e2e/eth1/eth1MergeBlockTracker.test.ts index a5d08fc68882..c11899dc8d27 100644 --- a/packages/lodestar/test/e2e/eth1/eth1MergeBlockTracker.test.ts +++ b/packages/beacon-node/test/e2e/eth1/eth1MergeBlockTracker.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {sleep} from "@chainsafe/lodestar-utils"; +import {IChainConfig} from "@lodestar/config"; +import {sleep} from "@lodestar/utils"; import {fromHexString} from "@chainsafe/ssz"; import {Eth1Provider, IEth1Provider} from "../../../src/index.js"; import {Eth1MergeBlockTracker, StatusCode} from "../../../src/eth1/eth1MergeBlockTracker.js"; diff --git a/packages/lodestar/test/e2e/eth1/eth1Provider.test.ts b/packages/beacon-node/test/e2e/eth1/eth1Provider.test.ts similarity index 100% rename from packages/lodestar/test/e2e/eth1/eth1Provider.test.ts rename to packages/beacon-node/test/e2e/eth1/eth1Provider.test.ts diff --git a/packages/lodestar/test/e2e/eth1/jsonRpcHttpClient.test.ts b/packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts similarity index 100% rename from packages/lodestar/test/e2e/eth1/jsonRpcHttpClient.test.ts rename to packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts diff --git a/packages/lodestar/test/e2e/eth1/stream.test.ts b/packages/beacon-node/test/e2e/eth1/stream.test.ts similarity index 100% rename from packages/lodestar/test/e2e/eth1/stream.test.ts rename to packages/beacon-node/test/e2e/eth1/stream.test.ts diff --git a/packages/lodestar/test/e2e/interop/genesisState.test.ts b/packages/beacon-node/test/e2e/interop/genesisState.test.ts similarity index 96% rename from packages/lodestar/test/e2e/interop/genesisState.test.ts rename to packages/beacon-node/test/e2e/interop/genesisState.test.ts index e51b6a8f229b..3c3a65c58464 100644 --- a/packages/lodestar/test/e2e/interop/genesisState.test.ts +++ b/packages/beacon-node/test/e2e/interop/genesisState.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; import {toHexString} from "@chainsafe/ssz"; -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ssz} from "@chainsafe/lodestar-types"; +import {LevelDbController} from "@lodestar/db"; +import {config} from "@lodestar/config/default"; +import {ssz} from "@lodestar/types"; import {BeaconDb} from "../../../src/index.js"; import {initDevState} from "../../../src/node/utils/state.js"; import {testLogger} from "../../utils/logger.js"; diff --git a/packages/lodestar/test/e2e/network/gossipsub.test.ts b/packages/beacon-node/test/e2e/network/gossipsub.test.ts similarity index 96% rename from packages/lodestar/test/e2e/network/gossipsub.test.ts rename to packages/beacon-node/test/e2e/network/gossipsub.test.ts index d87ea51a83f3..c5523d4d568d 100644 --- a/packages/lodestar/test/e2e/network/gossipsub.test.ts +++ b/packages/beacon-node/test/e2e/network/gossipsub.test.ts @@ -1,9 +1,9 @@ import sinon from "sinon"; import {expect} from "chai"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {config} from "@chainsafe/lodestar-config/default"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {sleep} from "@chainsafe/lodestar-utils"; +import {createIBeaconConfig} from "@lodestar/config"; +import {config} from "@lodestar/config/default"; +import {phase0, ssz} from "@lodestar/types"; +import {sleep} from "@lodestar/utils"; import {getReqRespHandlers, Network} from "../../../src/network/index.js"; import {defaultNetworkOptions, INetworkOptions} from "../../../src/network/options.js"; diff --git a/packages/lodestar/test/e2e/network/network.test.ts b/packages/beacon-node/test/e2e/network/network.test.ts similarity index 97% rename from packages/lodestar/test/e2e/network/network.test.ts rename to packages/beacon-node/test/e2e/network/network.test.ts index 813cb6a3fc86..95ad1b7be5c9 100644 --- a/packages/lodestar/test/e2e/network/network.test.ts +++ b/packages/beacon-node/test/e2e/network/network.test.ts @@ -5,10 +5,10 @@ import PeerId from "peer-id"; import {Multiaddr} from "multiaddr"; import {ENR} from "@chainsafe/discv5"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {config} from "@chainsafe/lodestar-config/default"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {sleep} from "@chainsafe/lodestar-utils"; +import {createIBeaconConfig} from "@lodestar/config"; +import {config} from "@lodestar/config/default"; +import {phase0, ssz} from "@lodestar/types"; +import {sleep} from "@lodestar/utils"; import {Network, NetworkEvent, ReqRespMethod, getReqRespHandlers} from "../../../src/network/index.js"; import {defaultNetworkOptions, INetworkOptions} from "../../../src/network/options.js"; diff --git a/packages/lodestar/test/e2e/network/peers/peerManager.test.ts b/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts similarity index 97% rename from packages/lodestar/test/e2e/network/peers/peerManager.test.ts rename to packages/beacon-node/test/e2e/network/peers/peerManager.test.ts index 194f1cf68db7..05bb9776e4f9 100644 --- a/packages/lodestar/test/e2e/network/peers/peerManager.test.ts +++ b/packages/beacon-node/test/e2e/network/peers/peerManager.test.ts @@ -2,11 +2,11 @@ import {EventEmitter} from "events"; import {Connection} from "libp2p"; import sinon from "sinon"; import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import {BitArray} from "@chainsafe/ssz"; -import {altair, phase0, ssz} from "@chainsafe/lodestar-types"; -import {sleep} from "@chainsafe/lodestar-utils"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; +import {altair, phase0, ssz} from "@lodestar/types"; +import {sleep} from "@lodestar/utils"; +import {createIBeaconConfig} from "@lodestar/config"; import {IReqResp, ReqRespMethod} from "../../../../src/network/reqresp/index.js"; import {PeerRpcScoreStore, PeerManager} from "../../../../src/network/peers/index.js"; import {Eth2Gossipsub, NetworkEvent, NetworkEventBus} from "../../../../src/network/index.js"; diff --git a/packages/lodestar/test/e2e/network/reqresp.test.ts b/packages/beacon-node/test/e2e/network/reqresp.test.ts similarity index 97% rename from packages/lodestar/test/e2e/network/reqresp.test.ts rename to packages/beacon-node/test/e2e/network/reqresp.test.ts index e63887a32ef3..f7e8e52b6556 100644 --- a/packages/lodestar/test/e2e/network/reqresp.test.ts +++ b/packages/beacon-node/test/e2e/network/reqresp.test.ts @@ -1,11 +1,11 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; import PeerId from "peer-id"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {config} from "@chainsafe/lodestar-config/default"; -import {sleep as _sleep} from "@chainsafe/lodestar-utils"; -import {altair, phase0, ssz} from "@chainsafe/lodestar-types"; -import {ForkName} from "@chainsafe/lodestar-params"; +import {createIBeaconConfig} from "@lodestar/config"; +import {config} from "@lodestar/config/default"; +import {sleep as _sleep} from "@lodestar/utils"; +import {altair, phase0, ssz} from "@lodestar/types"; +import {ForkName} from "@lodestar/params"; import {BitArray} from "@chainsafe/ssz"; import {createPeerId, IReqRespOptions, Network, prettyPrintPeerId} from "../../../src/network/index.js"; import {defaultNetworkOptions, INetworkOptions} from "../../../src/network/options.js"; diff --git a/packages/lodestar/test/e2e/sync/endpoint.test.ts b/packages/beacon-node/test/e2e/sync/endpoint.test.ts similarity index 90% rename from packages/lodestar/test/e2e/sync/endpoint.test.ts rename to packages/beacon-node/test/e2e/sync/endpoint.test.ts index 53551bc5a7d0..88cd7de3bb02 100644 --- a/packages/lodestar/test/e2e/sync/endpoint.test.ts +++ b/packages/beacon-node/test/e2e/sync/endpoint.test.ts @@ -1,8 +1,8 @@ import chaiAsPromised from "chai-as-promised"; import chai, {expect} from "chai"; -import {createIBeaconConfig, IChainConfig} from "@chainsafe/lodestar-config"; -import {chainConfig as chainConfigDef} from "@chainsafe/lodestar-config/default"; -import {getClient} from "@chainsafe/lodestar-api"; +import {createIBeaconConfig, IChainConfig} from "@lodestar/config"; +import {chainConfig as chainConfigDef} from "@lodestar/config/default"; +import {getClient} from "@lodestar/api"; import {getDevBeaconNode} from "../../utils/node/beacon.js"; import {LogLevel, testLogger, TestLoggerOpts} from "../../utils/logger.js"; diff --git a/packages/lodestar/test/e2e/sync/finalizedSync.test.ts b/packages/beacon-node/test/e2e/sync/finalizedSync.test.ts similarity index 96% rename from packages/lodestar/test/e2e/sync/finalizedSync.test.ts rename to packages/beacon-node/test/e2e/sync/finalizedSync.test.ts index 26013baeb521..bd9235706450 100644 --- a/packages/lodestar/test/e2e/sync/finalizedSync.test.ts +++ b/packages/beacon-node/test/e2e/sync/finalizedSync.test.ts @@ -1,6 +1,6 @@ import {assert} from "chai"; -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {IChainConfig} from "@lodestar/config"; +import {phase0, ssz} from "@lodestar/types"; import {fromHexString} from "@chainsafe/ssz"; import {getDevBeaconNode} from "../../utils/node/beacon.js"; import {waitForEvent} from "../../utils/events/resolver.js"; diff --git a/packages/lodestar/test/e2e/sync/unknownBlockSync.test.ts b/packages/beacon-node/test/e2e/sync/unknownBlockSync.test.ts similarity index 94% rename from packages/lodestar/test/e2e/sync/unknownBlockSync.test.ts rename to packages/beacon-node/test/e2e/sync/unknownBlockSync.test.ts index b95ce26fb812..7d5e1714bede 100644 --- a/packages/lodestar/test/e2e/sync/unknownBlockSync.test.ts +++ b/packages/beacon-node/test/e2e/sync/unknownBlockSync.test.ts @@ -1,8 +1,8 @@ -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {IChainConfig} from "@lodestar/config"; +import {phase0, ssz} from "@lodestar/types"; import {fromHexString} from "@chainsafe/ssz"; -import {TimestampFormatCode} from "@chainsafe/lodestar-utils"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {TimestampFormatCode} from "@lodestar/utils"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {getDevBeaconNode} from "../../utils/node/beacon.js"; import {waitForEvent} from "../../utils/events/resolver.js"; import {getAndInitDevValidators} from "../../utils/node/validator.js"; diff --git a/packages/lodestar/test/e2e/sync/wss.test.ts b/packages/beacon-node/test/e2e/sync/wss.test.ts similarity index 93% rename from packages/lodestar/test/e2e/sync/wss.test.ts rename to packages/beacon-node/test/e2e/sync/wss.test.ts index 2c0b5efa252b..9e7db73f0177 100644 --- a/packages/lodestar/test/e2e/sync/wss.test.ts +++ b/packages/beacon-node/test/e2e/sync/wss.test.ts @@ -1,8 +1,8 @@ -import {GENESIS_SLOT, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0, Slot} from "@chainsafe/lodestar-types"; -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {config} from "@chainsafe/lodestar-config/default"; -import {TimestampFormatCode} from "@chainsafe/lodestar-utils"; +import {GENESIS_SLOT, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {phase0, Slot} from "@lodestar/types"; +import {IChainConfig} from "@lodestar/config"; +import {config} from "@lodestar/config/default"; +import {TimestampFormatCode} from "@lodestar/utils"; import {fetchWeakSubjectivityState} from "../../../../cli/src/networks/index.js"; import {getDevBeaconNode} from "../../utils/node/beacon.js"; import {waitForEvent} from "../../utils/events/resolver.js"; diff --git a/packages/lodestar/test/memory/bytesHex.ts b/packages/beacon-node/test/memory/bytesHex.ts similarity index 100% rename from packages/lodestar/test/memory/bytesHex.ts rename to packages/beacon-node/test/memory/bytesHex.ts diff --git a/packages/lodestar/test/memory/pubkeysToIndex.ts b/packages/beacon-node/test/memory/pubkeysToIndex.ts similarity index 100% rename from packages/lodestar/test/memory/pubkeysToIndex.ts rename to packages/beacon-node/test/memory/pubkeysToIndex.ts diff --git a/packages/lodestar/test/memory/testRunnerMemory.ts b/packages/beacon-node/test/memory/testRunnerMemory.ts similarity index 100% rename from packages/lodestar/test/memory/testRunnerMemory.ts rename to packages/beacon-node/test/memory/testRunnerMemory.ts diff --git a/packages/lodestar/test/perf/api/impl/validator/attester.test.ts b/packages/beacon-node/test/perf/api/impl/validator/attester.test.ts similarity index 95% rename from packages/lodestar/test/perf/api/impl/validator/attester.test.ts rename to packages/beacon-node/test/perf/api/impl/validator/attester.test.ts index 558971d7c787..68784032f5f0 100644 --- a/packages/lodestar/test/perf/api/impl/validator/attester.test.ts +++ b/packages/beacon-node/test/perf/api/impl/validator/attester.test.ts @@ -1,9 +1,6 @@ import {itBench} from "@dapplion/benchmark"; import {PointFormat} from "@chainsafe/bls/types"; -import { - generatePerfTestCachedStatePhase0, - numValidators, -} from "../../../../../../beacon-state-transition/test/perf/util.js"; +import {generatePerfTestCachedStatePhase0, numValidators} from "../../../../../../state-transition/test/perf/util.js"; import {getPubkeysForIndices} from "../../../../../src/api/impl/validator/utils.js"; import {linspace} from "../../../../../src/util/numpy.js"; diff --git a/packages/lodestar/test/perf/bls/bls.test.ts b/packages/beacon-node/test/perf/bls/bls.test.ts similarity index 100% rename from packages/lodestar/test/perf/bls/bls.test.ts rename to packages/beacon-node/test/perf/bls/bls.test.ts diff --git a/packages/lodestar/test/perf/chain/opPools/aggregatedAttestationPool.test.ts b/packages/beacon-node/test/perf/chain/opPools/aggregatedAttestationPool.test.ts similarity index 94% rename from packages/lodestar/test/perf/chain/opPools/aggregatedAttestationPool.test.ts rename to packages/beacon-node/test/perf/chain/opPools/aggregatedAttestationPool.test.ts index bc4b6b2035d5..8c0f6f0770d3 100644 --- a/packages/lodestar/test/perf/chain/opPools/aggregatedAttestationPool.test.ts +++ b/packages/beacon-node/test/perf/chain/opPools/aggregatedAttestationPool.test.ts @@ -5,11 +5,11 @@ import { computeEpochAtSlot, computeStartSlotAtEpoch, getBlockRootAtSlot, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {SLOTS_PER_EPOCH, TIMELY_SOURCE_FLAG_INDEX} from "@chainsafe/lodestar-params"; +} from "@lodestar/state-transition"; +import {SLOTS_PER_EPOCH, TIMELY_SOURCE_FLAG_INDEX} from "@lodestar/params"; import {BitArray} from "@chainsafe/ssz"; import {AggregatedAttestationPool} from "../../../../src/chain/opPools/aggregatedAttestationPool.js"; -import {generatePerfTestCachedStateAltair} from "../../../../../beacon-state-transition/test/perf/util.js"; +import {generatePerfTestCachedStateAltair} from "../../../../../state-transition/test/perf/util.js"; /** Same to https://github.com/ethereum/eth2.0-specs/blob/v1.1.0-alpha.5/specs/altair/beacon-chain.md#has_flag */ const TIMELY_SOURCE = 1 << TIMELY_SOURCE_FLAG_INDEX; diff --git a/packages/lodestar/test/perf/chain/seenCache/seenAggregateAndProof.test.ts b/packages/beacon-node/test/perf/chain/seenCache/seenAggregateAndProof.test.ts similarity index 96% rename from packages/lodestar/test/perf/chain/seenCache/seenAggregateAndProof.test.ts rename to packages/beacon-node/test/perf/chain/seenCache/seenAggregateAndProof.test.ts index b51fef5a256a..54eee0e907db 100644 --- a/packages/lodestar/test/perf/chain/seenCache/seenAggregateAndProof.test.ts +++ b/packages/beacon-node/test/perf/chain/seenCache/seenAggregateAndProof.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {TARGET_AGGREGATORS_PER_COMMITTEE} from "@chainsafe/lodestar-params"; +import {TARGET_AGGREGATORS_PER_COMMITTEE} from "@lodestar/params"; import {BitArray} from "@chainsafe/ssz"; import {SeenAggregatedAttestations} from "../../../../src/chain/seenCache/seenAggregateAndProof.js"; diff --git a/packages/lodestar/test/perf/chain/stateCache/stateContextCheckpointsCache.test.ts b/packages/beacon-node/test/perf/chain/stateCache/stateContextCheckpointsCache.test.ts similarity index 85% rename from packages/lodestar/test/perf/chain/stateCache/stateContextCheckpointsCache.test.ts rename to packages/beacon-node/test/perf/chain/stateCache/stateContextCheckpointsCache.test.ts index aef2c1e494cf..cf0ab1fa16b2 100644 --- a/packages/lodestar/test/perf/chain/stateCache/stateContextCheckpointsCache.test.ts +++ b/packages/beacon-node/test/perf/chain/stateCache/stateContextCheckpointsCache.test.ts @@ -1,6 +1,6 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {ssz, phase0} from "@chainsafe/lodestar-types"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; +import {ssz, phase0} from "@lodestar/types"; import {generateCachedState} from "../../../utils/state.js"; import {CheckpointStateCache, toCheckpointHex} from "../../../../src/chain/stateCache/index.js"; diff --git a/packages/lodestar/test/perf/chain/validation/aggregateAndProof.test.ts b/packages/beacon-node/test/perf/chain/validation/aggregateAndProof.test.ts similarity index 95% rename from packages/lodestar/test/perf/chain/validation/aggregateAndProof.test.ts rename to packages/beacon-node/test/perf/chain/validation/aggregateAndProof.test.ts index 9296e8611e75..114a0b2ee011 100644 --- a/packages/lodestar/test/perf/chain/validation/aggregateAndProof.test.ts +++ b/packages/beacon-node/test/perf/chain/validation/aggregateAndProof.test.ts @@ -1,6 +1,6 @@ import {itBench} from "@dapplion/benchmark"; import {validateGossipAggregateAndProof} from "../../../../src/chain/validation/index.js"; -import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../beacon-state-transition/test/perf/util.js"; +import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../state-transition/test/perf/util.js"; import {getAggregateAndProofValidData} from "../../../utils/validationData/aggregateAndProof.js"; describe("validate gossip signedAggregateAndProof", () => { diff --git a/packages/lodestar/test/perf/chain/validation/attestation.test.ts b/packages/beacon-node/test/perf/chain/validation/attestation.test.ts similarity index 94% rename from packages/lodestar/test/perf/chain/validation/attestation.test.ts rename to packages/beacon-node/test/perf/chain/validation/attestation.test.ts index d0e4d3e72666..351217e5549e 100644 --- a/packages/lodestar/test/perf/chain/validation/attestation.test.ts +++ b/packages/beacon-node/test/perf/chain/validation/attestation.test.ts @@ -1,6 +1,6 @@ import {itBench} from "@dapplion/benchmark"; import {validateGossipAttestation} from "../../../../src/chain/validation/index.js"; -import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../beacon-state-transition/test/perf/util.js"; +import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../state-transition/test/perf/util.js"; import {getAttestationValidData} from "../../../utils/validationData/attestation.js"; describe("validate gossip attestation", () => { diff --git a/packages/lodestar/test/perf/chain/verifyImportBlocks.test.ts b/packages/beacon-node/test/perf/chain/verifyImportBlocks.test.ts similarity index 89% rename from packages/lodestar/test/perf/chain/verifyImportBlocks.test.ts rename to packages/beacon-node/test/perf/chain/verifyImportBlocks.test.ts index b5d75c0bd274..3543cc645745 100644 --- a/packages/lodestar/test/perf/chain/verifyImportBlocks.test.ts +++ b/packages/beacon-node/test/perf/chain/verifyImportBlocks.test.ts @@ -1,15 +1,15 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import {config} from "@chainsafe/lodestar-config/default"; -import {SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {sleep} from "@chainsafe/lodestar-utils"; -import {defaultOptions as defaultValidatorOptions} from "@chainsafe/lodestar-validator"; +import {config} from "@lodestar/config/default"; +import {SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {LevelDbController} from "@lodestar/db"; +import {sleep} from "@lodestar/utils"; +import {defaultOptions as defaultValidatorOptions} from "@lodestar/validator"; import { beforeValue, getNetworkCachedState, getNetworkCachedBlock, -} from "../../../../beacon-state-transition/test/utils/index.js"; -import {rangeSyncTest} from "../../../../beacon-state-transition/test/perf/params.js"; +} from "../../../../state-transition/test/utils/index.js"; +import {rangeSyncTest} from "../../../../state-transition/test/perf/params.js"; import {BeaconChain} from "../../../src/chain/index.js"; import {ExecutionEngineDisabled} from "../../../src/execution/engine/index.js"; import {Eth1ForBlockProductionDisabled} from "../../../src/eth1/index.js"; @@ -17,7 +17,7 @@ import {testLogger} from "../../utils/logger.js"; import {linspace} from "../../../src/util/numpy.js"; import {BeaconDb} from "../../../src/index.js"; -// Define this params in `packages/beacon-state-transition/test/perf/params.ts` +// Define this params in `packages/state-transition/test/perf/params.ts` // to trigger Github actions CI cache const {network, startSlot, endSlot} = rangeSyncTest; const slotCount = endSlot - startSlot; diff --git a/packages/lodestar/test/perf/eth1/pickEth1Vote.test.ts b/packages/beacon-node/test/perf/eth1/pickEth1Vote.test.ts similarity index 96% rename from packages/lodestar/test/perf/eth1/pickEth1Vote.test.ts rename to packages/beacon-node/test/perf/eth1/pickEth1Vote.test.ts index a34e654273f4..56f88eb15de3 100644 --- a/packages/lodestar/test/perf/eth1/pickEth1Vote.test.ts +++ b/packages/beacon-node/test/perf/eth1/pickEth1Vote.test.ts @@ -1,7 +1,7 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {phase0, ssz} from "@lodestar/types"; import {ContainerType, ListCompositeType} from "@chainsafe/ssz"; -import {newFilledArray, BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {newFilledArray, BeaconStateAllForks} from "@lodestar/state-transition"; import {fastSerializeEth1Data, pickEth1Vote} from "../../../src/eth1/utils/eth1Vote.js"; describe("eth1 / pickEth1Vote", () => { diff --git a/packages/lodestar/test/perf/misc/bytesHex.test.ts b/packages/beacon-node/test/perf/misc/bytesHex.test.ts similarity index 100% rename from packages/lodestar/test/perf/misc/bytesHex.test.ts rename to packages/beacon-node/test/perf/misc/bytesHex.test.ts diff --git a/packages/lodestar/test/perf/misc/map.test.ts b/packages/beacon-node/test/perf/misc/map.test.ts similarity index 100% rename from packages/lodestar/test/perf/misc/map.test.ts rename to packages/beacon-node/test/perf/misc/map.test.ts diff --git a/packages/lodestar/test/perf/misc/throw.test.ts b/packages/beacon-node/test/perf/misc/throw.test.ts similarity index 100% rename from packages/lodestar/test/perf/misc/throw.test.ts rename to packages/beacon-node/test/perf/misc/throw.test.ts diff --git a/packages/lodestar/test/perf/network/peers/enrSubnetsDeserialize.test.ts b/packages/beacon-node/test/perf/network/peers/enrSubnetsDeserialize.test.ts similarity index 94% rename from packages/lodestar/test/perf/network/peers/enrSubnetsDeserialize.test.ts rename to packages/beacon-node/test/perf/network/peers/enrSubnetsDeserialize.test.ts index 6cda9581e82b..f8ed571f9622 100644 --- a/packages/lodestar/test/perf/network/peers/enrSubnetsDeserialize.test.ts +++ b/packages/beacon-node/test/perf/network/peers/enrSubnetsDeserialize.test.ts @@ -1,7 +1,7 @@ import {itBench} from "@dapplion/benchmark"; import {expect} from "chai"; -import {SYNC_COMMITTEE_SUBNET_COUNT, ATTESTATION_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; +import {SYNC_COMMITTEE_SUBNET_COUNT, ATTESTATION_SUBNET_COUNT} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; import {deserializeEnrSubnets} from "../../../../src/network/peers/utils/enrSubnetsDeserialize.js"; /** diff --git a/packages/lodestar/test/perf/network/peers/util/prioritizePeers.test.ts b/packages/beacon-node/test/perf/network/peers/util/prioritizePeers.test.ts similarity index 97% rename from packages/lodestar/test/perf/network/peers/util/prioritizePeers.test.ts rename to packages/beacon-node/test/perf/network/peers/util/prioritizePeers.test.ts index 5f5a766bce9e..63dcd2c3e0bb 100644 --- a/packages/lodestar/test/perf/network/peers/util/prioritizePeers.test.ts +++ b/packages/beacon-node/test/perf/network/peers/util/prioritizePeers.test.ts @@ -1,7 +1,7 @@ import {itBench} from "@dapplion/benchmark"; import PeerId from "peer-id"; -import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {altair, phase0} from "@chainsafe/lodestar-types"; +import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {altair, phase0} from "@lodestar/types"; import {defaultNetworkOptions} from "../../../../../src/network/options.js"; import {prioritizePeers, RequestedSubnet} from "../../../../../src/network/peers/utils/index.js"; import {getAttnets, getSyncnets} from "../../../../utils/network.js"; diff --git a/packages/lodestar/test/perf/network/reqresp/rateTracker.test.ts b/packages/beacon-node/test/perf/network/reqresp/rateTracker.test.ts similarity index 100% rename from packages/lodestar/test/perf/network/reqresp/rateTracker.test.ts rename to packages/beacon-node/test/perf/network/reqresp/rateTracker.test.ts diff --git a/packages/lodestar/test/perf/util/array.test.ts b/packages/beacon-node/test/perf/util/array.test.ts similarity index 100% rename from packages/lodestar/test/perf/util/array.test.ts rename to packages/beacon-node/test/perf/util/array.test.ts diff --git a/packages/lodestar/test/perf/util/bitArray.test.ts b/packages/beacon-node/test/perf/util/bitArray.test.ts similarity index 100% rename from packages/lodestar/test/perf/util/bitArray.test.ts rename to packages/beacon-node/test/perf/util/bitArray.test.ts diff --git a/packages/lodestar/test/rewiremock.ts b/packages/beacon-node/test/rewiremock.ts similarity index 100% rename from packages/lodestar/test/rewiremock.ts rename to packages/beacon-node/test/rewiremock.ts diff --git a/packages/lodestar/test/scripts/blsPubkeyBytesFrequency.ts b/packages/beacon-node/test/scripts/blsPubkeyBytesFrequency.ts similarity index 95% rename from packages/lodestar/test/scripts/blsPubkeyBytesFrequency.ts rename to packages/beacon-node/test/scripts/blsPubkeyBytesFrequency.ts index f6995548cdba..8cfecae2752f 100644 --- a/packages/lodestar/test/scripts/blsPubkeyBytesFrequency.ts +++ b/packages/beacon-node/test/scripts/blsPubkeyBytesFrequency.ts @@ -1,7 +1,7 @@ import fs from "node:fs"; -import {getClient} from "@chainsafe/lodestar-api"; -import {config} from "@chainsafe/lodestar-config/default"; -import {newZeroedArray} from "@chainsafe/lodestar-beacon-state-transition"; +import {getClient} from "@lodestar/api"; +import {config} from "@lodestar/config/default"; +import {newZeroedArray} from "@lodestar/state-transition"; import {digest} from "@chainsafe/as-sha256"; // Script to analyze if a raw BLS pubkey bytes are sufficiently even distributed. diff --git a/packages/lodestar/test/setupPreset.ts b/packages/beacon-node/test/setupPreset.ts similarity index 100% rename from packages/lodestar/test/setupPreset.ts rename to packages/beacon-node/test/setupPreset.ts diff --git a/packages/lodestar/test/sim/merge-interop.test.ts b/packages/beacon-node/test/sim/merge-interop.test.ts similarity index 98% rename from packages/lodestar/test/sim/merge-interop.test.ts rename to packages/beacon-node/test/sim/merge-interop.test.ts index eae36f4a3695..00054bc920ed 100644 --- a/packages/lodestar/test/sim/merge-interop.test.ts +++ b/packages/beacon-node/test/sim/merge-interop.test.ts @@ -3,11 +3,11 @@ import net from "node:net"; import {spawn} from "node:child_process"; import {Context} from "mocha"; import {fromHexString} from "@chainsafe/ssz"; -import {isBellatrixStateType, isMergeTransitionComplete} from "@chainsafe/lodestar-beacon-state-transition"; -import {LogLevel, sleep, TimestampFormatCode} from "@chainsafe/lodestar-utils"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {Epoch} from "@chainsafe/lodestar-types"; +import {isBellatrixStateType, isMergeTransitionComplete} from "@lodestar/state-transition"; +import {LogLevel, sleep, TimestampFormatCode} from "@lodestar/utils"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {IChainConfig} from "@lodestar/config"; +import {Epoch} from "@lodestar/types"; import {ExecutePayloadStatus} from "../../src/execution/engine/interface.js"; import {ExecutionEngineHttp} from "../../src/execution/engine/http.js"; @@ -25,7 +25,7 @@ import {shell} from "./shell.js"; // NOTE: Must specify // EL_BINARY_DIR: File path to locate the EL executable -// EL_SCRIPT_DIR: Directory in packages/lodestar for the EL client, from where to +// EL_SCRIPT_DIR: Directory in packages/beacon-node for the EL client, from where to // execute post-merge/pre-merge EL scenario scripts // ETH_PORT: EL port on localhost hosting non auth protected eth_ methods // ENGINE_PORT: Specify the port on which an jwt auth protected engine api is being hosted, diff --git a/packages/lodestar/test/sim/multiNodeMultiThread.test.ts b/packages/beacon-node/test/sim/multiNodeMultiThread.test.ts similarity index 98% rename from packages/lodestar/test/sim/multiNodeMultiThread.test.ts rename to packages/beacon-node/test/sim/multiNodeMultiThread.test.ts index 6e1ca80e0084..ef4fc47089c7 100644 --- a/packages/lodestar/test/sim/multiNodeMultiThread.test.ts +++ b/packages/beacon-node/test/sim/multiNodeMultiThread.test.ts @@ -2,9 +2,9 @@ import path from "node:path"; import os from "node:os"; import {Worker} from "worker_threads"; import {fileURLToPath} from "node:url"; -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; -import {IChainConfig} from "@chainsafe/lodestar-config"; +import {IChainConfig} from "@lodestar/config"; import {waitForEvent} from "../utils/events/resolver.js"; import {ChainEvent} from "../../src/chain/index.js"; import {createPeerId} from "../../src/network/index.js"; diff --git a/packages/lodestar/test/sim/multiNodeSingleThread.test.ts b/packages/beacon-node/test/sim/multiNodeSingleThread.test.ts similarity index 94% rename from packages/lodestar/test/sim/multiNodeSingleThread.test.ts rename to packages/beacon-node/test/sim/multiNodeSingleThread.test.ts index d24777c29a3e..b12fa26f02a0 100644 --- a/packages/lodestar/test/sim/multiNodeSingleThread.test.ts +++ b/packages/beacon-node/test/sim/multiNodeSingleThread.test.ts @@ -1,8 +1,8 @@ -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {phase0} from "@chainsafe/lodestar-types"; -import {Validator} from "@chainsafe/lodestar-validator/lib"; -import {ILogger, sleep, TimestampFormatCode} from "@chainsafe/lodestar-utils"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {IChainConfig} from "@lodestar/config"; +import {phase0} from "@lodestar/types"; +import {Validator} from "@lodestar/validator/lib"; +import {ILogger, sleep, TimestampFormatCode} from "@lodestar/utils"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {BeaconNode} from "../../src/index.js"; import {getDevBeaconNode} from "../utils/node/beacon.js"; import {waitForEvent} from "../utils/events/resolver.js"; diff --git a/packages/lodestar/test/sim/params.ts b/packages/beacon-node/test/sim/params.ts similarity index 100% rename from packages/lodestar/test/sim/params.ts rename to packages/beacon-node/test/sim/params.ts diff --git a/packages/lodestar/test/sim/shell.ts b/packages/beacon-node/test/sim/shell.ts similarity index 100% rename from packages/lodestar/test/sim/shell.ts rename to packages/beacon-node/test/sim/shell.ts diff --git a/packages/lodestar/test/sim/singleNodeSingleThread.test.ts b/packages/beacon-node/test/sim/singleNodeSingleThread.test.ts similarity index 96% rename from packages/lodestar/test/sim/singleNodeSingleThread.test.ts rename to packages/beacon-node/test/sim/singleNodeSingleThread.test.ts index 6b91f5c9d2af..deaac60727d9 100644 --- a/packages/lodestar/test/sim/singleNodeSingleThread.test.ts +++ b/packages/beacon-node/test/sim/singleNodeSingleThread.test.ts @@ -1,8 +1,8 @@ -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; -import {sleep, TimestampFormatCode} from "@chainsafe/lodestar-utils"; -import {IChainConfig} from "@chainsafe/lodestar-config"; +import {sleep, TimestampFormatCode} from "@lodestar/utils"; +import {IChainConfig} from "@lodestar/config"; import {getDevBeaconNode} from "../utils/node/beacon.js"; import {waitForEvent} from "../utils/events/resolver.js"; import {getAndInitDevValidators} from "../utils/node/validator.js"; diff --git a/packages/lodestar/test/sim/threaded/noEth1SimWorker.ts b/packages/beacon-node/test/sim/threaded/noEth1SimWorker.ts similarity index 94% rename from packages/lodestar/test/sim/threaded/noEth1SimWorker.ts rename to packages/beacon-node/test/sim/threaded/noEth1SimWorker.ts index 0df19125043a..42b61156f81a 100644 --- a/packages/lodestar/test/sim/threaded/noEth1SimWorker.ts +++ b/packages/beacon-node/test/sim/threaded/noEth1SimWorker.ts @@ -4,11 +4,11 @@ import {parentPort, workerData} from "worker_threads"; import {Multiaddr} from "multiaddr"; import {createFromPrivKey} from "peer-id"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {phase0, ssz} from "@lodestar/types"; -import {sleep, TimestampFormatCode, withTimeout} from "@chainsafe/lodestar-utils"; +import {sleep, TimestampFormatCode, withTimeout} from "@lodestar/utils"; import {fromHexString} from "@chainsafe/ssz"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {getDevBeaconNode} from "../../utils/node/beacon.js"; import {getAndInitDevValidators} from "../../utils/node/validator.js"; import {testLogger, LogLevel, TestLoggerOpts} from "../../utils/logger.js"; diff --git a/packages/lodestar/test/sim/threaded/types.ts b/packages/beacon-node/test/sim/threaded/types.ts similarity index 86% rename from packages/lodestar/test/sim/threaded/types.ts rename to packages/beacon-node/test/sim/threaded/types.ts index f36a1c7c07ea..c14d6f511d67 100644 --- a/packages/lodestar/test/sim/threaded/types.ts +++ b/packages/beacon-node/test/sim/threaded/types.ts @@ -1,5 +1,5 @@ -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {RecursivePartial} from "@chainsafe/lodestar-utils"; +import {IChainConfig} from "@lodestar/config"; +import {RecursivePartial} from "@lodestar/utils"; import {ChainEvent} from "../../../src/chain/index.js"; import {IBeaconNodeOptions} from "../../../src/node/options.js"; diff --git a/packages/lodestar/test/sim/threaded/worker.js b/packages/beacon-node/test/sim/threaded/worker.js similarity index 100% rename from packages/lodestar/test/sim/threaded/worker.js rename to packages/beacon-node/test/sim/threaded/worker.js diff --git a/packages/lodestar/test/spec/downloadTests.ts b/packages/beacon-node/test/spec/downloadTests.ts similarity index 84% rename from packages/lodestar/test/spec/downloadTests.ts rename to packages/beacon-node/test/spec/downloadTests.ts index 3792c8c961d7..c3e062bad4e0 100644 --- a/packages/lodestar/test/spec/downloadTests.ts +++ b/packages/beacon-node/test/spec/downloadTests.ts @@ -1,4 +1,4 @@ -import {downloadTests} from "@chainsafe/lodestar-spec-test-util"; +import {downloadTests} from "@lodestar/spec-test-util"; import {SPEC_TEST_LOCATION, SPEC_TEST_VERSION, SPEC_TEST_REPO_URL} from "./specTestVersioning.js"; /* eslint-disable no-console */ diff --git a/packages/lodestar/test/spec/general/bls.ts b/packages/beacon-node/test/spec/general/bls.ts similarity index 97% rename from packages/lodestar/test/spec/general/bls.ts rename to packages/beacon-node/test/spec/general/bls.ts index 8204975c0752..bd61c6f541cd 100644 --- a/packages/lodestar/test/spec/general/bls.ts +++ b/packages/beacon-node/test/spec/general/bls.ts @@ -1,7 +1,7 @@ import bls from "@chainsafe/bls"; import {CoordType} from "@chainsafe/bls/types"; -import {InputType} from "@chainsafe/lodestar-spec-test-util"; -import {toHexString} from "@chainsafe/lodestar-utils"; +import {InputType} from "@lodestar/spec-test-util"; +import {toHexString} from "@lodestar/utils"; import {fromHexString} from "@chainsafe/ssz"; import {TestRunnerFn} from "../utils/types.js"; diff --git a/packages/lodestar/test/spec/general/index.test.ts b/packages/beacon-node/test/spec/general/index.test.ts similarity index 100% rename from packages/lodestar/test/spec/general/index.test.ts rename to packages/beacon-node/test/spec/general/index.test.ts diff --git a/packages/lodestar/test/spec/general/ssz_generic.ts b/packages/beacon-node/test/spec/general/ssz_generic.ts similarity index 100% rename from packages/lodestar/test/spec/general/ssz_generic.ts rename to packages/beacon-node/test/spec/general/ssz_generic.ts diff --git a/packages/lodestar/test/spec/general/ssz_generic_types.ts b/packages/beacon-node/test/spec/general/ssz_generic_types.ts similarity index 100% rename from packages/lodestar/test/spec/general/ssz_generic_types.ts rename to packages/beacon-node/test/spec/general/ssz_generic_types.ts diff --git a/packages/lodestar/test/spec/presets/epoch_processing.ts b/packages/beacon-node/test/spec/presets/epoch_processing.ts similarity index 93% rename from packages/lodestar/test/spec/presets/epoch_processing.ts rename to packages/beacon-node/test/spec/presets/epoch_processing.ts index 7a6bb57fa527..181e298d96af 100644 --- a/packages/lodestar/test/spec/presets/epoch_processing.ts +++ b/packages/beacon-node/test/spec/presets/epoch_processing.ts @@ -3,9 +3,9 @@ import { EpochProcess, BeaconStateAllForks, beforeProcessEpoch, -} from "@chainsafe/lodestar-beacon-state-transition"; -import * as epochFns from "@chainsafe/lodestar-beacon-state-transition/epoch"; -import {ssz} from "@chainsafe/lodestar-types"; +} from "@lodestar/state-transition"; +import * as epochFns from "@lodestar/state-transition/epoch"; +import {ssz} from "@lodestar/types"; import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js"; import {expectEqualBeaconState, inputTypeSszTreeViewDU} from "../utils/expectEqualBeaconState.js"; import {getConfig} from "../utils/getConfig.js"; diff --git a/packages/lodestar/test/spec/presets/finality.ts b/packages/beacon-node/test/spec/presets/finality.ts similarity index 90% rename from packages/lodestar/test/spec/presets/finality.ts rename to packages/beacon-node/test/spec/presets/finality.ts index 1c641dfd8561..e8663f5e15b1 100644 --- a/packages/lodestar/test/spec/presets/finality.ts +++ b/packages/beacon-node/test/spec/presets/finality.ts @@ -1,6 +1,6 @@ -import {BeaconStateAllForks, stateTransition} from "@chainsafe/lodestar-beacon-state-transition"; -import {altair, bellatrix, ssz} from "@chainsafe/lodestar-types"; -import {ForkName} from "@chainsafe/lodestar-params"; +import {BeaconStateAllForks, stateTransition} from "@lodestar/state-transition"; +import {altair, bellatrix, ssz} from "@lodestar/types"; +import {ForkName} from "@lodestar/params"; import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js"; import {expectEqualBeaconState, inputTypeSszTreeViewDU} from "../utils/expectEqualBeaconState.js"; import {shouldVerify, TestRunnerFn} from "../utils/types.js"; diff --git a/packages/lodestar/test/spec/presets/fork.ts b/packages/beacon-node/test/spec/presets/fork.ts similarity index 81% rename from packages/lodestar/test/spec/presets/fork.ts rename to packages/beacon-node/test/spec/presets/fork.ts index 883db52df113..2210dd541ab9 100644 --- a/packages/lodestar/test/spec/presets/fork.ts +++ b/packages/beacon-node/test/spec/presets/fork.ts @@ -1,12 +1,8 @@ -import { - BeaconStateAllForks, - CachedBeaconStateAltair, - CachedBeaconStatePhase0, -} from "@chainsafe/lodestar-beacon-state-transition"; -import * as slotFns from "@chainsafe/lodestar-beacon-state-transition/slot"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {createIChainForkConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; +import {BeaconStateAllForks, CachedBeaconStateAltair, CachedBeaconStatePhase0} from "@lodestar/state-transition"; +import * as slotFns from "@lodestar/state-transition/slot"; +import {phase0, ssz} from "@lodestar/types"; +import {ForkName} from "@lodestar/params"; +import {createIChainForkConfig, IChainForkConfig} from "@lodestar/config"; import {expectEqualBeaconState, inputTypeSszTreeViewDU} from "../utils/expectEqualBeaconState.js"; import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js"; import {TestRunnerFn} from "../utils/types.js"; diff --git a/packages/lodestar/test/spec/presets/fork_choice.ts b/packages/beacon-node/test/spec/presets/fork_choice.ts similarity index 97% rename from packages/lodestar/test/spec/presets/fork_choice.ts rename to packages/beacon-node/test/spec/presets/fork_choice.ts index 078ec4b86c89..d954303272ab 100644 --- a/packages/lodestar/test/spec/presets/fork_choice.ts +++ b/packages/beacon-node/test/spec/presets/fork_choice.ts @@ -12,8 +12,8 @@ import { isMergeTransitionBlock as isMergeTransitionBlockFn, processSlots, stateTransition, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {InputType} from "@chainsafe/lodestar-spec-test-util"; +} from "@lodestar/state-transition"; +import {InputType} from "@lodestar/spec-test-util"; import {toHexString} from "@chainsafe/ssz"; import { CheckpointWithHex, @@ -23,10 +23,10 @@ import { assertValidTerminalPowBlock, ExecutionStatus, PowBlockHex, -} from "@chainsafe/lodestar-fork-choice"; -import {phase0, allForks, bellatrix, ssz, RootHex} from "@chainsafe/lodestar-types"; -import {bnToNum} from "@chainsafe/lodestar-utils"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +} from "@lodestar/fork-choice"; +import {phase0, allForks, bellatrix, ssz, RootHex} from "@lodestar/types"; +import {bnToNum} from "@lodestar/utils"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import { ChainEventEmitter, initializeForkChoice, diff --git a/packages/lodestar/test/spec/presets/genesis.ts b/packages/beacon-node/test/spec/presets/genesis.ts similarity index 94% rename from packages/lodestar/test/spec/presets/genesis.ts rename to packages/beacon-node/test/spec/presets/genesis.ts index 59926c3fcc4e..09a99d25eb7c 100644 --- a/packages/lodestar/test/spec/presets/genesis.ts +++ b/packages/beacon-node/test/spec/presets/genesis.ts @@ -1,13 +1,13 @@ import {expect} from "chai"; -import {phase0, Root, ssz, bellatrix, TimeSeconds} from "@chainsafe/lodestar-types"; -import {InputType} from "@chainsafe/lodestar-spec-test-util"; +import {phase0, Root, ssz, bellatrix, TimeSeconds} from "@lodestar/types"; +import {InputType} from "@lodestar/spec-test-util"; import { BeaconStateAllForks, createEmptyEpochContextImmutableData, initializeBeaconStateFromEth1, isValidGenesisState, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {bnToNum} from "@chainsafe/lodestar-utils"; +} from "@lodestar/state-transition"; +import {bnToNum} from "@lodestar/utils"; import {expectEqualBeaconState} from "../utils/expectEqualBeaconState.js"; import {TestRunnerFn} from "../utils/types.js"; import {getConfig} from "../utils/getConfig.js"; diff --git a/packages/lodestar/test/spec/presets/index.test.ts b/packages/beacon-node/test/spec/presets/index.test.ts similarity index 96% rename from packages/lodestar/test/spec/presets/index.test.ts rename to packages/beacon-node/test/spec/presets/index.test.ts index 5a49b4d8f1f7..214ef8c9ad46 100644 --- a/packages/lodestar/test/spec/presets/index.test.ts +++ b/packages/beacon-node/test/spec/presets/index.test.ts @@ -1,4 +1,4 @@ -import {ACTIVE_PRESET} from "@chainsafe/lodestar-params"; +import {ACTIVE_PRESET} from "@lodestar/params"; import {RunnerType} from "../utils/types.js"; import {specTestIterator} from "../utils/specTestIterator.js"; import {epochProcessing} from "./epoch_processing.js"; diff --git a/packages/lodestar/test/spec/presets/merkle.ts b/packages/beacon-node/test/spec/presets/merkle.ts similarity index 88% rename from packages/lodestar/test/spec/presets/merkle.ts rename to packages/beacon-node/test/spec/presets/merkle.ts index 0242e3b5bc34..6545a29c30c5 100644 --- a/packages/lodestar/test/spec/presets/merkle.ts +++ b/packages/beacon-node/test/spec/presets/merkle.ts @@ -1,10 +1,10 @@ import {expect} from "chai"; -import {ssz} from "@chainsafe/lodestar-types"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {InputType} from "@chainsafe/lodestar-spec-test-util"; +import {ssz} from "@lodestar/types"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; +import {InputType} from "@lodestar/spec-test-util"; import {ProofType, SingleProof, Tree} from "@chainsafe/persistent-merkle-tree"; import {fromHexString, toHexString} from "@chainsafe/ssz"; -import {verifyMerkleBranch} from "@chainsafe/lodestar-utils"; +import {verifyMerkleBranch} from "@lodestar/utils"; import {TestRunnerFn} from "../utils/types.js"; /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/packages/lodestar/test/spec/presets/operations.ts b/packages/beacon-node/test/spec/presets/operations.ts similarity index 92% rename from packages/lodestar/test/spec/presets/operations.ts rename to packages/beacon-node/test/spec/presets/operations.ts index 7ee4e258c3c2..4df032cd6fe5 100644 --- a/packages/lodestar/test/spec/presets/operations.ts +++ b/packages/beacon-node/test/spec/presets/operations.ts @@ -1,11 +1,7 @@ -import { - BeaconStateAllForks, - CachedBeaconStateAllForks, - CachedBeaconStateBellatrix, -} from "@chainsafe/lodestar-beacon-state-transition"; -import * as blockFns from "@chainsafe/lodestar-beacon-state-transition/block"; -import {ssz, phase0, altair, bellatrix} from "@chainsafe/lodestar-types"; -import {InputType} from "@chainsafe/lodestar-spec-test-util"; +import {BeaconStateAllForks, CachedBeaconStateAllForks, CachedBeaconStateBellatrix} from "@lodestar/state-transition"; +import * as blockFns from "@lodestar/state-transition/block"; +import {ssz, phase0, altair, bellatrix} from "@lodestar/types"; +import {InputType} from "@lodestar/spec-test-util"; import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js"; import {expectEqualBeaconState, inputTypeSszTreeViewDU} from "../utils/expectEqualBeaconState.js"; import {getConfig} from "../utils/getConfig.js"; diff --git a/packages/lodestar/test/spec/presets/rewards.ts b/packages/beacon-node/test/spec/presets/rewards.ts similarity index 92% rename from packages/lodestar/test/spec/presets/rewards.ts rename to packages/beacon-node/test/spec/presets/rewards.ts index 4ab3e7fcc118..f823e0a9ba76 100644 --- a/packages/lodestar/test/spec/presets/rewards.ts +++ b/packages/beacon-node/test/spec/presets/rewards.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {BeaconStateAllForks, beforeProcessEpoch} from "@chainsafe/lodestar-beacon-state-transition"; -import {getRewardsAndPenalties} from "@chainsafe/lodestar-beacon-state-transition/epoch"; +import {BeaconStateAllForks, beforeProcessEpoch} from "@lodestar/state-transition"; +import {getRewardsAndPenalties} from "@lodestar/state-transition/epoch"; import {VectorCompositeType} from "@chainsafe/ssz"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js"; import {inputTypeSszTreeViewDU} from "../utils/expectEqualBeaconState.js"; import {getConfig} from "../utils/getConfig.js"; diff --git a/packages/lodestar/test/spec/presets/sanity.ts b/packages/beacon-node/test/spec/presets/sanity.ts similarity index 92% rename from packages/lodestar/test/spec/presets/sanity.ts rename to packages/beacon-node/test/spec/presets/sanity.ts index e4d449c33530..b4a485102989 100644 --- a/packages/lodestar/test/spec/presets/sanity.ts +++ b/packages/beacon-node/test/spec/presets/sanity.ts @@ -1,8 +1,8 @@ -import {InputType} from "@chainsafe/lodestar-spec-test-util"; -import {BeaconStateAllForks, processSlots, stateTransition} from "@chainsafe/lodestar-beacon-state-transition"; -import {allForks, bellatrix, ssz} from "@chainsafe/lodestar-types"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {bnToNum} from "@chainsafe/lodestar-utils"; +import {InputType} from "@lodestar/spec-test-util"; +import {BeaconStateAllForks, processSlots, stateTransition} from "@lodestar/state-transition"; +import {allForks, bellatrix, ssz} from "@lodestar/types"; +import {ForkName} from "@lodestar/params"; +import {bnToNum} from "@lodestar/utils"; import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js"; import {expectEqualBeaconState, inputTypeSszTreeViewDU} from "../utils/expectEqualBeaconState.js"; import {shouldVerify, TestRunnerFn} from "../utils/types.js"; diff --git a/packages/lodestar/test/spec/presets/shuffling.ts b/packages/beacon-node/test/spec/presets/shuffling.ts similarity index 77% rename from packages/lodestar/test/spec/presets/shuffling.ts rename to packages/beacon-node/test/spec/presets/shuffling.ts index 21c34cf5cc27..f89df03464a1 100644 --- a/packages/lodestar/test/spec/presets/shuffling.ts +++ b/packages/beacon-node/test/spec/presets/shuffling.ts @@ -1,6 +1,6 @@ -import {unshuffleList} from "@chainsafe/lodestar-beacon-state-transition"; -import {InputType} from "@chainsafe/lodestar-spec-test-util"; -import {bnToNum, fromHex} from "@chainsafe/lodestar-utils"; +import {unshuffleList} from "@lodestar/state-transition"; +import {InputType} from "@lodestar/spec-test-util"; +import {bnToNum, fromHex} from "@lodestar/utils"; import {TestRunnerFn} from "../utils/types.js"; export const shuffling: TestRunnerFn = () => { diff --git a/packages/lodestar/test/spec/presets/ssz_static.ts b/packages/beacon-node/test/spec/presets/ssz_static.ts similarity index 94% rename from packages/lodestar/test/spec/presets/ssz_static.ts rename to packages/beacon-node/test/spec/presets/ssz_static.ts index facf39b521a3..b0281e750eb9 100644 --- a/packages/lodestar/test/spec/presets/ssz_static.ts +++ b/packages/beacon-node/test/spec/presets/ssz_static.ts @@ -1,8 +1,8 @@ import fs from "node:fs"; import path from "node:path"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {Type} from "@chainsafe/ssz"; -import {ACTIVE_PRESET, ForkName} from "@chainsafe/lodestar-params"; +import {ACTIVE_PRESET, ForkName} from "@lodestar/params"; import {replaceUintTypeWithUintBigintType} from "../utils/replaceUintTypeWithUintBigintType.js"; import {parseSszStaticTestcase} from "../utils/sszTestCaseParser.js"; import {runValidSszTest} from "../utils/runValidSszTest.js"; diff --git a/packages/lodestar/test/spec/presets/transition.ts b/packages/beacon-node/test/spec/presets/transition.ts similarity index 88% rename from packages/lodestar/test/spec/presets/transition.ts rename to packages/beacon-node/test/spec/presets/transition.ts index 6f452e1e0187..a97a1919153c 100644 --- a/packages/lodestar/test/spec/presets/transition.ts +++ b/packages/beacon-node/test/spec/presets/transition.ts @@ -1,9 +1,9 @@ -import {BeaconStateAllForks, stateTransition} from "@chainsafe/lodestar-beacon-state-transition"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; -import {createIChainForkConfig, IChainConfig} from "@chainsafe/lodestar-config"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {bnToNum} from "@chainsafe/lodestar-utils"; -import {config} from "@chainsafe/lodestar-config/default"; +import {BeaconStateAllForks, stateTransition} from "@lodestar/state-transition"; +import {allForks, ssz} from "@lodestar/types"; +import {createIChainForkConfig, IChainConfig} from "@lodestar/config"; +import {ForkName} from "@lodestar/params"; +import {bnToNum} from "@lodestar/utils"; +import {config} from "@lodestar/config/default"; import {expectEqualBeaconState, inputTypeSszTreeViewDU} from "../utils/expectEqualBeaconState.js"; import {createCachedBeaconStateTest} from "../../utils/cachedBeaconState.js"; import {TestRunnerFn} from "../utils/types.js"; diff --git a/packages/lodestar/test/spec/specTestVersioning.ts b/packages/beacon-node/test/spec/specTestVersioning.ts similarity index 100% rename from packages/lodestar/test/spec/specTestVersioning.ts rename to packages/beacon-node/test/spec/specTestVersioning.ts diff --git a/packages/lodestar/test/spec/utils/expectEqualBeaconState.ts b/packages/beacon-node/test/spec/utils/expectEqualBeaconState.ts similarity index 76% rename from packages/lodestar/test/spec/utils/expectEqualBeaconState.ts rename to packages/beacon-node/test/spec/utils/expectEqualBeaconState.ts index bfa78c10dff3..356fcb724125 100644 --- a/packages/lodestar/test/spec/utils/expectEqualBeaconState.ts +++ b/packages/beacon-node/test/spec/utils/expectEqualBeaconState.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {InputType} from "@chainsafe/lodestar-spec-test-util"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {allForks, ssz} from "@lodestar/types"; +import {ForkName} from "@lodestar/params"; +import {InputType} from "@lodestar/spec-test-util"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; /** Compare each field in BeaconState to help debug failed test easier. */ export function expectEqualBeaconState( diff --git a/packages/lodestar/test/spec/utils/getConfig.ts b/packages/beacon-node/test/spec/utils/getConfig.ts similarity index 74% rename from packages/lodestar/test/spec/utils/getConfig.ts rename to packages/beacon-node/test/spec/utils/getConfig.ts index 1be8cdec55dd..58d6184767c6 100644 --- a/packages/lodestar/test/spec/utils/getConfig.ts +++ b/packages/beacon-node/test/spec/utils/getConfig.ts @@ -1,6 +1,6 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {config} from "@chainsafe/lodestar-config/default"; -import {IChainForkConfig, createIChainForkConfig} from "@chainsafe/lodestar-config"; +import {ForkName} from "@lodestar/params"; +import {config} from "@lodestar/config/default"; +import {IChainForkConfig, createIChainForkConfig} from "@lodestar/config"; /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/packages/lodestar/test/spec/utils/replaceUintTypeWithUintBigintType.ts b/packages/beacon-node/test/spec/utils/replaceUintTypeWithUintBigintType.ts similarity index 100% rename from packages/lodestar/test/spec/utils/replaceUintTypeWithUintBigintType.ts rename to packages/beacon-node/test/spec/utils/replaceUintTypeWithUintBigintType.ts diff --git a/packages/lodestar/test/spec/utils/runValidSszTest.ts b/packages/beacon-node/test/spec/utils/runValidSszTest.ts similarity index 100% rename from packages/lodestar/test/spec/utils/runValidSszTest.ts rename to packages/beacon-node/test/spec/utils/runValidSszTest.ts diff --git a/packages/lodestar/test/spec/utils/specTestIterator.ts b/packages/beacon-node/test/spec/utils/specTestIterator.ts similarity index 96% rename from packages/lodestar/test/spec/utils/specTestIterator.ts rename to packages/beacon-node/test/spec/utils/specTestIterator.ts index d9dc438b6d80..337d21294dc6 100644 --- a/packages/lodestar/test/spec/utils/specTestIterator.ts +++ b/packages/beacon-node/test/spec/utils/specTestIterator.ts @@ -1,8 +1,8 @@ import fs from "node:fs"; import path from "node:path"; import {expect} from "chai"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {describeDirectorySpecTest} from "@chainsafe/lodestar-spec-test-util"; +import {ForkName} from "@lodestar/params"; +import {describeDirectorySpecTest} from "@lodestar/spec-test-util"; import {SPEC_TEST_LOCATION} from "../specTestVersioning.js"; import {RunnerType, TestRunner} from "./types.js"; diff --git a/packages/lodestar/test/spec/utils/sszTestCaseParser.ts b/packages/beacon-node/test/spec/utils/sszTestCaseParser.ts similarity index 98% rename from packages/lodestar/test/spec/utils/sszTestCaseParser.ts rename to packages/beacon-node/test/spec/utils/sszTestCaseParser.ts index c50f33b5c0f9..5c2e176e2396 100644 --- a/packages/lodestar/test/spec/utils/sszTestCaseParser.ts +++ b/packages/beacon-node/test/spec/utils/sszTestCaseParser.ts @@ -2,7 +2,7 @@ import path from "node:path"; import fs from "node:fs"; import {uncompress} from "snappyjs"; import jsyaml from "js-yaml"; -import {loadYaml} from "@chainsafe/lodestar-utils"; +import {loadYaml} from "@lodestar/utils"; /* eslint-disable @typescript-eslint/explicit-module-boundary-types, diff --git a/packages/lodestar/test/spec/utils/types.ts b/packages/beacon-node/test/spec/utils/types.ts similarity index 87% rename from packages/lodestar/test/spec/utils/types.ts rename to packages/beacon-node/test/spec/utils/types.ts index d8664ebcae59..d8ac9a604ed9 100644 --- a/packages/lodestar/test/spec/utils/types.ts +++ b/packages/beacon-node/test/spec/utils/types.ts @@ -1,5 +1,5 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {ISpecTestOptions} from "@chainsafe/lodestar-spec-test-util"; +import {ForkName} from "@lodestar/params"; +import {ISpecTestOptions} from "@lodestar/spec-test-util"; export enum RunnerType { custom, diff --git a/packages/lodestar/test/testParams.ts b/packages/beacon-node/test/testParams.ts similarity index 100% rename from packages/lodestar/test/testParams.ts rename to packages/beacon-node/test/testParams.ts diff --git a/packages/lodestar/test/unit-mainnet/network/gossip/scoringParameters.test.ts b/packages/beacon-node/test/unit-mainnet/network/gossip/scoringParameters.test.ts similarity index 98% rename from packages/lodestar/test/unit-mainnet/network/gossip/scoringParameters.test.ts rename to packages/beacon-node/test/unit-mainnet/network/gossip/scoringParameters.test.ts index eafd739493d7..458e310bf61e 100644 --- a/packages/lodestar/test/unit-mainnet/network/gossip/scoringParameters.test.ts +++ b/packages/beacon-node/test/unit-mainnet/network/gossip/scoringParameters.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; import {TopicScoreParams} from "libp2p-gossipsub/src/score/index.js"; -import {ATTESTATION_SUBNET_COUNT, ForkName, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {mainnetChainConfig} from "@chainsafe/lodestar-config/presets"; +import {ATTESTATION_SUBNET_COUNT, ForkName, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {createIBeaconConfig} from "@lodestar/config"; +import {mainnetChainConfig} from "@lodestar/config/presets"; import {computeGossipPeerScoreParams, gossipScoreThresholds} from "../../../../src/network/gossip/scoringParameters.js"; import {stringifyGossipTopic} from "../../../../src/network/gossip/topic.js"; import {GossipType} from "../../../../src/network/index.js"; diff --git a/packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts b/packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts similarity index 100% rename from packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts rename to packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts diff --git a/packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts b/packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts similarity index 96% rename from packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts rename to packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts index 7434a7adc1a6..9fec9855b2f3 100644 --- a/packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts +++ b/packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts @@ -3,7 +3,7 @@ import pipe from "it-pipe"; import {expect} from "chai"; import varint from "varint"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; +import {allForks, ssz} from "@lodestar/types"; import {reqRespBlockResponseSerializer} from "../../../../../../src/network/reqresp/types.js"; import {writeSszSnappyPayload} from "../../../../../../src/network/reqresp/encodingStrategies/sszSnappy/index.js"; diff --git a/packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/goerliShadowForkBlock.13249/serialized.ssz b/packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/goerliShadowForkBlock.13249/serialized.ssz similarity index 100% rename from packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/goerliShadowForkBlock.13249/serialized.ssz rename to packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/goerliShadowForkBlock.13249/serialized.ssz diff --git a/packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/goerliShadowForkBlock.13249/streamed.snappy b/packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/goerliShadowForkBlock.13249/streamed.snappy similarity index 100% rename from packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/goerliShadowForkBlock.13249/streamed.snappy rename to packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/goerliShadowForkBlock.13249/streamed.snappy diff --git a/packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/testData.ts b/packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/testData.ts similarity index 95% rename from packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/testData.ts rename to packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/testData.ts index d0b819ece1da..c71d85195314 100644 --- a/packages/lodestar/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/testData.ts +++ b/packages/beacon-node/test/unit-mainnet/network/reqresp/encodingStrategies/sszSnappy/testData.ts @@ -2,7 +2,7 @@ import fs from "node:fs"; import path from "node:path"; import {fileURLToPath} from "node:url"; -import {bellatrix, ssz} from "@chainsafe/lodestar-types"; +import {bellatrix, ssz} from "@lodestar/types"; import {RequestOrIncomingResponseBody, RequestOrResponseType} from "../../../../../../src/network/reqresp/types.js"; // Global variable __dirname no longer available in ES6 modules. diff --git a/packages/lodestar/test/unit/api/impl/beacon/beacon.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/beacon.test.ts similarity index 96% rename from packages/lodestar/test/unit/api/impl/beacon/beacon.test.ts rename to packages/beacon-node/test/unit/api/impl/beacon/beacon.test.ts index d7f4423199b2..38d3918200d0 100644 --- a/packages/lodestar/test/unit/api/impl/beacon/beacon.test.ts +++ b/packages/beacon-node/test/unit/api/impl/beacon/beacon.test.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import {getBeaconApi} from "../../../../../src/api/impl/beacon/index.js"; import {StubbedBeaconDb} from "../../../../utils/stub/index.js"; import {setupApiImplTestServer, ApiImplTestModules} from "../index.test.js"; diff --git a/packages/lodestar/test/unit/api/impl/beacon/blocks/getBlock.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/blocks/getBlock.test.ts similarity index 100% rename from packages/lodestar/test/unit/api/impl/beacon/blocks/getBlock.test.ts rename to packages/beacon-node/test/unit/api/impl/beacon/blocks/getBlock.test.ts diff --git a/packages/lodestar/test/unit/api/impl/beacon/blocks/getBlockHeader.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/blocks/getBlockHeader.test.ts similarity index 100% rename from packages/lodestar/test/unit/api/impl/beacon/blocks/getBlockHeader.test.ts rename to packages/beacon-node/test/unit/api/impl/beacon/blocks/getBlockHeader.test.ts diff --git a/packages/lodestar/test/unit/api/impl/beacon/blocks/getBlockHeaders.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/blocks/getBlockHeaders.test.ts similarity index 99% rename from packages/lodestar/test/unit/api/impl/beacon/blocks/getBlockHeaders.test.ts rename to packages/beacon-node/test/unit/api/impl/beacon/blocks/getBlockHeaders.test.ts index 4db064d3cd96..fcdf1aed80cf 100644 --- a/packages/lodestar/test/unit/api/impl/beacon/blocks/getBlockHeaders.test.ts +++ b/packages/beacon-node/test/unit/api/impl/beacon/blocks/getBlockHeaders.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; import { generateProtoBlock, diff --git a/packages/lodestar/test/unit/api/impl/beacon/blocks/publishBlock.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/blocks/publishBlock.test.ts similarity index 97% rename from packages/lodestar/test/unit/api/impl/beacon/blocks/publishBlock.test.ts rename to packages/beacon-node/test/unit/api/impl/beacon/blocks/publishBlock.test.ts index 5ad1b7fce66b..5020541f1e13 100644 --- a/packages/lodestar/test/unit/api/impl/beacon/blocks/publishBlock.test.ts +++ b/packages/beacon-node/test/unit/api/impl/beacon/blocks/publishBlock.test.ts @@ -1,7 +1,7 @@ import {expect, use} from "chai"; import chaiAsPromised from "chai-as-promised"; import sinon, {SinonStubbedInstance} from "sinon"; -import {allForks} from "@chainsafe/lodestar-types"; +import {allForks} from "@lodestar/types"; import {getBeaconBlockApi} from "../../../../../../src/api/impl/beacon/blocks/index.js"; import {BeaconChain} from "../../../../../../src/chain/index.js"; import {Eth2Gossipsub} from "../../../../../../src/network/gossip/index.js"; diff --git a/packages/lodestar/test/unit/api/impl/beacon/blocks/utils.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/blocks/utils.test.ts similarity index 97% rename from packages/lodestar/test/unit/api/impl/beacon/blocks/utils.test.ts rename to packages/beacon-node/test/unit/api/impl/beacon/blocks/utils.test.ts index df4470ecd622..5d245ac19493 100644 --- a/packages/lodestar/test/unit/api/impl/beacon/blocks/utils.test.ts +++ b/packages/beacon-node/test/unit/api/impl/beacon/blocks/utils.test.ts @@ -1,7 +1,7 @@ import {SinonStubbedInstance} from "sinon"; import {expect, use} from "chai"; import chaiAsPromised from "chai-as-promised"; -import {ForkChoice, ProtoBlock, ExecutionStatus} from "@chainsafe/lodestar-fork-choice"; +import {ForkChoice, ProtoBlock, ExecutionStatus} from "@lodestar/fork-choice"; import {toHexString} from "@chainsafe/ssz"; import {resolveBlockId} from "../../../../../../src/api/impl/beacon/blocks/utils.js"; import {generateEmptySignedBlock, generateProtoBlock} from "../../../../../utils/block.js"; diff --git a/packages/lodestar/test/unit/api/impl/beacon/pool/pool.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/pool/pool.test.ts similarity index 98% rename from packages/lodestar/test/unit/api/impl/beacon/pool/pool.test.ts rename to packages/beacon-node/test/unit/api/impl/beacon/pool/pool.test.ts index e32148eaa4fb..a416f9825ff0 100644 --- a/packages/lodestar/test/unit/api/impl/beacon/pool/pool.test.ts +++ b/packages/beacon-node/test/unit/api/impl/beacon/pool/pool.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; import sinon from "sinon"; import {SinonStubbedInstance} from "sinon"; -import {phase0} from "@chainsafe/lodestar-types"; -import {generateAttestationDataBigint} from "../../../../../../../beacon-state-transition/test/utils/attestation.js"; +import {phase0} from "@lodestar/types"; +import {generateAttestationDataBigint} from "../../../../../../../state-transition/test/utils/attestation.js"; import {getBeaconPoolApi} from "../../../../../../src/api/impl/beacon/pool/index.js"; import {Network} from "../../../../../../src/network/network.js"; import { diff --git a/packages/lodestar/test/unit/api/impl/beacon/state/fork.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/state/fork.test.ts similarity index 95% rename from packages/lodestar/test/unit/api/impl/beacon/state/fork.test.ts rename to packages/beacon-node/test/unit/api/impl/beacon/state/fork.test.ts index cc786fa1f164..54bd0c67c072 100644 --- a/packages/lodestar/test/unit/api/impl/beacon/state/fork.test.ts +++ b/packages/beacon-node/test/unit/api/impl/beacon/state/fork.test.ts @@ -1,6 +1,6 @@ import sinon, {SinonStubbedMember} from "sinon"; import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import {getBeaconStateApi} from "../../../../../../src/api/impl/beacon/state/index.js"; import * as stateApiUtils from "../../../../../../src/api/impl/beacon/state/utils.js"; import {generateCachedState} from "../../../../../utils/state.js"; diff --git a/packages/lodestar/test/unit/api/impl/beacon/state/utils.test.ts b/packages/beacon-node/test/unit/api/impl/beacon/state/utils.test.ts similarity index 98% rename from packages/lodestar/test/unit/api/impl/beacon/state/utils.test.ts rename to packages/beacon-node/test/unit/api/impl/beacon/state/utils.test.ts index 1c782d551346..3415bbf08ac2 100644 --- a/packages/lodestar/test/unit/api/impl/beacon/state/utils.test.ts +++ b/packages/beacon-node/test/unit/api/impl/beacon/state/utils.test.ts @@ -1,9 +1,9 @@ import {expect, use} from "chai"; import chaiAsPromised from "chai-as-promised"; import sinon from "sinon"; -import {phase0} from "@chainsafe/lodestar-types"; -import {config} from "@chainsafe/lodestar-config/default"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {phase0} from "@lodestar/types"; +import {config} from "@lodestar/config/default"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {toHexString} from "@chainsafe/ssz"; import {resolveStateId, getValidatorStatus} from "../../../../../../src/api/impl/beacon/state/utils.js"; import {IBeaconChain} from "../../../../../../src/chain/index.js"; diff --git a/packages/lodestar/test/unit/api/impl/config/config.test.ts b/packages/beacon-node/test/unit/api/impl/config/config.test.ts similarity index 95% rename from packages/lodestar/test/unit/api/impl/config/config.test.ts rename to packages/beacon-node/test/unit/api/impl/config/config.test.ts index 5eb134f4d14d..b542fbba2e6d 100644 --- a/packages/lodestar/test/unit/api/impl/config/config.test.ts +++ b/packages/beacon-node/test/unit/api/impl/config/config.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import {getConfigApi} from "../../../../../src/api/impl/config/index.js"; describe("config api implementation", function () { diff --git a/packages/lodestar/test/unit/api/impl/debug/index.test.ts b/packages/beacon-node/test/unit/api/impl/debug/index.test.ts similarity index 89% rename from packages/lodestar/test/unit/api/impl/debug/index.test.ts rename to packages/beacon-node/test/unit/api/impl/debug/index.test.ts index e0ded292bdf0..7880f2a293ae 100644 --- a/packages/lodestar/test/unit/api/impl/debug/index.test.ts +++ b/packages/beacon-node/test/unit/api/impl/debug/index.test.ts @@ -1,11 +1,11 @@ import {expect} from "chai"; import sinon from "sinon"; import {SinonStubbedInstance} from "sinon"; -import {config} from "@chainsafe/lodestar-config/default"; -import {config as minimalConfig} from "@chainsafe/lodestar-config/default"; -import {altair, phase0, ssz} from "@chainsafe/lodestar-types"; -import {ZERO_HASH} from "@chainsafe/lodestar-beacon-state-transition"; -import {ForkChoice, IForkChoice} from "@chainsafe/lodestar-fork-choice"; +import {config} from "@lodestar/config/default"; +import {config as minimalConfig} from "@lodestar/config/default"; +import {altair, phase0, ssz} from "@lodestar/types"; +import {ZERO_HASH} from "@lodestar/state-transition"; +import {ForkChoice, IForkChoice} from "@lodestar/fork-choice"; import {toHexString} from "@chainsafe/ssz"; import * as stateApiUtils from "../../../../../src/api/impl/beacon/state/utils.js"; import {getDebugApi} from "../../../../../src/api/impl/debug/index.js"; diff --git a/packages/lodestar/test/unit/api/impl/events/events.test.ts b/packages/beacon-node/test/unit/api/impl/events/events.test.ts similarity index 98% rename from packages/lodestar/test/unit/api/impl/events/events.test.ts rename to packages/beacon-node/test/unit/api/impl/events/events.test.ts index a55621f6c8ea..d484dfbe883e 100644 --- a/packages/lodestar/test/unit/api/impl/events/events.test.ts +++ b/packages/beacon-node/test/unit/api/impl/events/events.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; import sinon, {SinonStubbedInstance} from "sinon"; -import {routes} from "@chainsafe/lodestar-api"; -import {config} from "@chainsafe/lodestar-config/default"; +import {routes} from "@lodestar/api"; +import {config} from "@lodestar/config/default"; import {BeaconChain, ChainEvent, ChainEventEmitter, IBeaconChain} from "../../../../../src/chain/index.js"; import {getEventsApi} from "../../../../../src/api/impl/events/index.js"; import {generateProtoBlock, generateEmptySignedBlock, generateSignedBlock} from "../../../../utils/block.js"; diff --git a/packages/lodestar/test/unit/api/impl/index.test.ts b/packages/beacon-node/test/unit/api/impl/index.test.ts similarity index 89% rename from packages/lodestar/test/unit/api/impl/index.test.ts rename to packages/beacon-node/test/unit/api/impl/index.test.ts index c4074b9a25a2..038e15d7c0e6 100644 --- a/packages/lodestar/test/unit/api/impl/index.test.ts +++ b/packages/beacon-node/test/unit/api/impl/index.test.ts @@ -1,8 +1,8 @@ import {SinonSandbox, SinonStubbedInstance} from "sinon"; import sinon from "sinon"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ForkChoice} from "@chainsafe/lodestar-fork-choice"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {config} from "@lodestar/config/default"; +import {ForkChoice} from "@lodestar/fork-choice"; +import {IChainForkConfig} from "@lodestar/config"; import {getBeaconBlockApi} from "../../../../src/api/impl/beacon/blocks/index.js"; import {BeaconChain} from "../../../../src/chain/index.js"; import {Network} from "../../../../src/network/index.js"; diff --git a/packages/lodestar/test/unit/api/impl/node/node.test.ts b/packages/beacon-node/test/unit/api/impl/node/node.test.ts similarity index 98% rename from packages/lodestar/test/unit/api/impl/node/node.test.ts rename to packages/beacon-node/test/unit/api/impl/node/node.test.ts index 9697ace46c28..55491dc5ec2c 100644 --- a/packages/lodestar/test/unit/api/impl/node/node.test.ts +++ b/packages/beacon-node/test/unit/api/impl/node/node.test.ts @@ -8,8 +8,8 @@ import chaiAsPromised from "chai-as-promised"; import {Multiaddr} from "multiaddr"; import {BitArray} from "@chainsafe/ssz"; import {createKeypairFromPeerId, ENR} from "@chainsafe/discv5"; -import {altair} from "@chainsafe/lodestar-types"; -import {routes} from "@chainsafe/lodestar-api"; +import {altair} from "@lodestar/types"; +import {routes} from "@lodestar/api"; import {createPeerId, INetwork, Network} from "../../../../../src/network/index.js"; import {BeaconSync, IBeaconSync} from "../../../../../src/sync/index.js"; import {MetadataController} from "../../../../../src/network/metadata.js"; diff --git a/packages/lodestar/test/unit/api/impl/validator/duties/proposer.test.ts b/packages/beacon-node/test/unit/api/impl/validator/duties/proposer.test.ts similarity index 95% rename from packages/lodestar/test/unit/api/impl/validator/duties/proposer.test.ts rename to packages/beacon-node/test/unit/api/impl/validator/duties/proposer.test.ts index 89642962e560..e9a8b2cb0ae7 100644 --- a/packages/lodestar/test/unit/api/impl/validator/duties/proposer.test.ts +++ b/packages/beacon-node/test/unit/api/impl/validator/duties/proposer.test.ts @@ -1,11 +1,11 @@ import sinon, {SinonStubbedInstance} from "sinon"; import {use, expect} from "chai"; import chaiAsPromised from "chai-as-promised"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ForkChoice} from "@chainsafe/lodestar-fork-choice"; +import {config} from "@lodestar/config/default"; +import {ForkChoice} from "@lodestar/fork-choice"; -import {ssz} from "@chainsafe/lodestar-types"; -import {MAX_EFFECTIVE_BALANCE, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {ssz} from "@lodestar/types"; +import {MAX_EFFECTIVE_BALANCE, SLOTS_PER_EPOCH} from "@lodestar/params"; import {IBeaconChain} from "../../../../../../src/chain/index.js"; import {LocalClock} from "../../../../../../src/chain/clock/index.js"; import {FAR_FUTURE_EPOCH} from "../../../../../../src/constants/index.js"; diff --git a/packages/lodestar/test/unit/api/impl/validator/produceAttestationData.test.ts b/packages/beacon-node/test/unit/api/impl/validator/produceAttestationData.test.ts similarity index 94% rename from packages/lodestar/test/unit/api/impl/validator/produceAttestationData.test.ts rename to packages/beacon-node/test/unit/api/impl/validator/produceAttestationData.test.ts index 9e56e07b38e0..6dee7c8ece84 100644 --- a/packages/lodestar/test/unit/api/impl/validator/produceAttestationData.test.ts +++ b/packages/beacon-node/test/unit/api/impl/validator/produceAttestationData.test.ts @@ -1,8 +1,8 @@ import sinon, {SinonStubbedInstance} from "sinon"; import chaiAsPromised from "chai-as-promised"; import {use, expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ProtoBlock} from "@chainsafe/lodestar-fork-choice"; +import {config} from "@lodestar/config/default"; +import {ProtoBlock} from "@lodestar/fork-choice"; import {IBeaconSync, SyncState} from "../../../../../src/sync/interface.js"; import {ApiModules} from "../../../../../src/api/impl/types.js"; import {getValidatorApi} from "../../../../../src/api/impl/validator/index.js"; diff --git a/packages/lodestar/test/unit/api/impl/validator/utils.test.ts b/packages/beacon-node/test/unit/api/impl/validator/utils.test.ts similarity index 85% rename from packages/lodestar/test/unit/api/impl/validator/utils.test.ts rename to packages/beacon-node/test/unit/api/impl/validator/utils.test.ts index 9e10a71b464a..a0ff6c9c6178 100644 --- a/packages/lodestar/test/unit/api/impl/validator/utils.test.ts +++ b/packages/beacon-node/test/unit/api/impl/validator/utils.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; import {toHexString} from "@chainsafe/ssz"; -import {BLSPubkey, ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {BLSPubkey, ssz, ValidatorIndex} from "@lodestar/types"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; import {getPubkeysForIndices} from "../../../../../src/api/impl/validator/utils.js"; describe("api / impl / validator / utils", () => { diff --git a/packages/lodestar/test/unit/chain/archive/blockArchiver.test.ts b/packages/beacon-node/test/unit/chain/archive/blockArchiver.test.ts similarity index 96% rename from packages/lodestar/test/unit/chain/archive/blockArchiver.test.ts rename to packages/beacon-node/test/unit/chain/archive/blockArchiver.test.ts index 87f4ee21fb2f..2df858347800 100644 --- a/packages/lodestar/test/unit/chain/archive/blockArchiver.test.ts +++ b/packages/beacon-node/test/unit/chain/archive/blockArchiver.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; import sinon, {SinonStubbedInstance} from "sinon"; -import {ssz} from "@chainsafe/lodestar-types"; -import {ForkChoice} from "@chainsafe/lodestar-fork-choice"; +import {ssz} from "@lodestar/types"; +import {ForkChoice} from "@lodestar/fork-choice"; import {fromHexString, toHexString} from "@chainsafe/ssz"; import {ZERO_HASH_HEX} from "../../../../src/constants/index.js"; import {generateProtoBlock, generateEmptySignedBlock} from "../../../utils/block.js"; diff --git a/packages/lodestar/test/unit/chain/archive/nonCheckpoint.test.ts b/packages/beacon-node/test/unit/chain/archive/nonCheckpoint.test.ts similarity index 94% rename from packages/lodestar/test/unit/chain/archive/nonCheckpoint.test.ts rename to packages/beacon-node/test/unit/chain/archive/nonCheckpoint.test.ts index fd29f2254be9..1f00c2b9ed75 100644 --- a/packages/lodestar/test/unit/chain/archive/nonCheckpoint.test.ts +++ b/packages/beacon-node/test/unit/chain/archive/nonCheckpoint.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {Slot} from "@chainsafe/lodestar-types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {Slot} from "@lodestar/types"; import {getNonCheckpointBlocks} from "../../../../src/chain/archiver/archiveBlocks.js"; describe("chain / archive / getNonCheckpointBlocks", () => { diff --git a/packages/lodestar/test/unit/chain/archive/stateArchiver.test.ts b/packages/beacon-node/test/unit/chain/archive/stateArchiver.test.ts similarity index 100% rename from packages/lodestar/test/unit/chain/archive/stateArchiver.test.ts rename to packages/beacon-node/test/unit/chain/archive/stateArchiver.test.ts diff --git a/packages/lodestar/test/unit/chain/beaconProposerCache.ts b/packages/beacon-node/test/unit/chain/beaconProposerCache.ts similarity index 100% rename from packages/lodestar/test/unit/chain/beaconProposerCache.ts rename to packages/beacon-node/test/unit/chain/beaconProposerCache.ts diff --git a/packages/lodestar/test/unit/chain/blocks/verifyBlock.test.ts b/packages/beacon-node/test/unit/chain/blocks/verifyBlock.test.ts similarity index 92% rename from packages/lodestar/test/unit/chain/blocks/verifyBlock.test.ts rename to packages/beacon-node/test/unit/chain/blocks/verifyBlock.test.ts index 92092fd8e1a9..3769ad8ec112 100644 --- a/packages/lodestar/test/unit/chain/blocks/verifyBlock.test.ts +++ b/packages/beacon-node/test/unit/chain/blocks/verifyBlock.test.ts @@ -1,9 +1,9 @@ import sinon, {SinonStubbedInstance} from "sinon"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ForkChoice, ProtoBlock} from "@chainsafe/lodestar-fork-choice"; +import {config} from "@lodestar/config/default"; +import {ForkChoice, ProtoBlock} from "@lodestar/fork-choice"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; +import {allForks, ssz} from "@lodestar/types"; import {verifyBlockSanityChecks, VerifyBlockModules} from "../../../../src/chain/blocks/verifyBlock.js"; import {LocalClock} from "../../../../src/chain/clock/index.js"; import {BlockErrorCode} from "../../../../src/chain/errors/index.js"; diff --git a/packages/lodestar/test/unit/chain/bls/utils.test.ts b/packages/beacon-node/test/unit/chain/bls/utils.test.ts similarity index 100% rename from packages/lodestar/test/unit/chain/bls/utils.test.ts rename to packages/beacon-node/test/unit/chain/bls/utils.test.ts diff --git a/packages/lodestar/test/unit/chain/clock/local.test.ts b/packages/beacon-node/test/unit/chain/clock/local.test.ts similarity index 96% rename from packages/lodestar/test/unit/chain/clock/local.test.ts rename to packages/beacon-node/test/unit/chain/clock/local.test.ts index 9167344e1f50..4587937c42fb 100644 --- a/packages/lodestar/test/unit/chain/clock/local.test.ts +++ b/packages/beacon-node/test/unit/chain/clock/local.test.ts @@ -1,8 +1,8 @@ import sinon from "sinon"; import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {LocalClock} from "../../../../src/chain/clock/LocalClock.js"; import {ChainEvent, ChainEventEmitter} from "../../../../src/chain/emitter.js"; import {MAXIMUM_GOSSIP_CLOCK_DISPARITY} from "../../../../src/constants/index.js"; diff --git a/packages/lodestar/test/unit/chain/factory/block/body.test.ts b/packages/beacon-node/test/unit/chain/factory/block/body.test.ts similarity index 95% rename from packages/lodestar/test/unit/chain/factory/block/body.test.ts rename to packages/beacon-node/test/unit/chain/factory/block/body.test.ts index 55ca9da47976..5485aa985fa2 100644 --- a/packages/lodestar/test/unit/chain/factory/block/body.test.ts +++ b/packages/beacon-node/test/unit/chain/factory/block/body.test.ts @@ -1,8 +1,8 @@ import sinon, {SinonStubbedInstance} from "sinon"; import {expect} from "chai"; -import {ssz} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {config} from "@chainsafe/lodestar-config/default"; +import {ssz} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {config} from "@lodestar/config/default"; import {assembleBody, BlockType} from "../../../../../src/chain/factory/block/body.js"; import {generateCachedState} from "../../../../utils/state.js"; import {generateEmptyAttestation} from "../../../../utils/attestation.js"; diff --git a/packages/lodestar/test/unit/chain/forkChoice/forkChoice.test.ts b/packages/beacon-node/test/unit/chain/forkChoice/forkChoice.test.ts similarity index 97% rename from packages/lodestar/test/unit/chain/forkChoice/forkChoice.test.ts rename to packages/beacon-node/test/unit/chain/forkChoice/forkChoice.test.ts index 1c6aa324e4a9..e845d974aad6 100644 --- a/packages/lodestar/test/unit/chain/forkChoice/forkChoice.test.ts +++ b/packages/beacon-node/test/unit/chain/forkChoice/forkChoice.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {FAR_FUTURE_EPOCH, MAX_EFFECTIVE_BALANCE} from "@chainsafe/lodestar-params"; -import {config} from "@chainsafe/lodestar-config/default"; -import {phase0, Slot, ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {ForkChoice} from "@chainsafe/lodestar-fork-choice"; +import {FAR_FUTURE_EPOCH, MAX_EFFECTIVE_BALANCE} from "@lodestar/params"; +import {config} from "@lodestar/config/default"; +import {phase0, Slot, ssz, ValidatorIndex} from "@lodestar/types"; +import {ForkChoice} from "@lodestar/fork-choice"; import { computeEpochAtSlot, getTemporaryBlockHeader, @@ -10,7 +10,7 @@ import { getEffectiveBalanceIncrementsZeroed, BeaconStateAllForks, processSlots, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import {toHexString} from "@chainsafe/ssz"; import {generateSignedBlock} from "../../../utils/block.js"; import {generateState} from "../../../utils/state.js"; diff --git a/packages/lodestar/test/unit/chain/genesis/genesis.test.ts b/packages/beacon-node/test/unit/chain/genesis/genesis.test.ts similarity index 91% rename from packages/lodestar/test/unit/chain/genesis/genesis.test.ts rename to packages/beacon-node/test/unit/chain/genesis/genesis.test.ts index e54a4e006930..0b90c457c019 100644 --- a/packages/lodestar/test/unit/chain/genesis/genesis.test.ts +++ b/packages/beacon-node/test/unit/chain/genesis/genesis.test.ts @@ -2,16 +2,11 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; import type {SecretKey, PublicKey} from "@chainsafe/bls/types"; -import {DOMAIN_DEPOSIT, MAX_EFFECTIVE_BALANCE} from "@chainsafe/lodestar-params"; -import {config} from "@chainsafe/lodestar-config/default"; -import { - computeDomain, - computeSigningRoot, - interopSecretKey, - ZERO_HASH, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {ValidatorIndex, phase0, ssz} from "@chainsafe/lodestar-types"; -import {ErrorAborted} from "@chainsafe/lodestar-utils"; +import {DOMAIN_DEPOSIT, MAX_EFFECTIVE_BALANCE} from "@lodestar/params"; +import {config} from "@lodestar/config/default"; +import {computeDomain, computeSigningRoot, interopSecretKey, ZERO_HASH} from "@lodestar/state-transition"; +import {ValidatorIndex, phase0, ssz} from "@lodestar/types"; +import {ErrorAborted} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; import {GenesisBuilder} from "../../../../src/chain/genesis/genesis.js"; import {testLogger} from "../../../utils/logger.js"; diff --git a/packages/lodestar/test/unit/chain/lightclient/proof.test.ts b/packages/beacon-node/test/unit/chain/lightclient/proof.test.ts similarity index 91% rename from packages/lodestar/test/unit/chain/lightclient/proof.test.ts rename to packages/beacon-node/test/unit/chain/lightclient/proof.test.ts index 25d0a82a5d24..55b0a04110e0 100644 --- a/packages/lodestar/test/unit/chain/lightclient/proof.test.ts +++ b/packages/beacon-node/test/unit/chain/lightclient/proof.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {BeaconStateAltair} from "@chainsafe/lodestar-beacon-state-transition"; -import {SYNC_COMMITTEE_SIZE} from "@chainsafe/lodestar-params"; -import {altair, ssz} from "@chainsafe/lodestar-types"; -import {verifyMerkleBranch, hash} from "@chainsafe/lodestar-utils"; +import {BeaconStateAltair} from "@lodestar/state-transition"; +import {SYNC_COMMITTEE_SIZE} from "@lodestar/params"; +import {altair, ssz} from "@lodestar/types"; +import {verifyMerkleBranch, hash} from "@lodestar/utils"; import {getNextSyncCommitteeBranch, getSyncCommitteesWitness} from "../../../../src/chain/lightClient/proofs.js"; const currentSyncCommitteeGindex = 54; diff --git a/packages/lodestar/test/unit/chain/opPools/aggregatedAttestationPool.test.ts b/packages/beacon-node/test/unit/chain/opPools/aggregatedAttestationPool.test.ts similarity index 97% rename from packages/lodestar/test/unit/chain/opPools/aggregatedAttestationPool.test.ts rename to packages/beacon-node/test/unit/chain/opPools/aggregatedAttestationPool.test.ts index 53fc0a67741a..9f6beac26e19 100644 --- a/packages/lodestar/test/unit/chain/opPools/aggregatedAttestationPool.test.ts +++ b/packages/beacon-node/test/unit/chain/opPools/aggregatedAttestationPool.test.ts @@ -2,10 +2,10 @@ import {expect} from "chai"; import type {SecretKey} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; import {BitArray, fromHexString} from "@chainsafe/ssz"; -import {createIChainForkConfig, defaultChainConfig} from "@chainsafe/lodestar-config"; -import {CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {ssz, phase0} from "@chainsafe/lodestar-types"; +import {createIChainForkConfig, defaultChainConfig} from "@lodestar/config"; +import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {ssz, phase0} from "@lodestar/types"; import { AggregatedAttestationPool, aggregateInto, diff --git a/packages/lodestar/test/unit/chain/opPools/syncCommittee.test.ts b/packages/beacon-node/test/unit/chain/opPools/syncCommittee.test.ts similarity index 98% rename from packages/lodestar/test/unit/chain/opPools/syncCommittee.test.ts rename to packages/beacon-node/test/unit/chain/opPools/syncCommittee.test.ts index 4813468026d3..d2ea121dd6ad 100644 --- a/packages/lodestar/test/unit/chain/opPools/syncCommittee.test.ts +++ b/packages/beacon-node/test/unit/chain/opPools/syncCommittee.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; import bls from "@chainsafe/bls"; -import {altair} from "@chainsafe/lodestar-types"; +import {altair} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; import {SyncCommitteeMessagePool} from "../../../../src/chain/opPools/index.js"; import {generateSyncCommitteeSignature} from "../../../utils/syncCommittee.js"; diff --git a/packages/lodestar/test/unit/chain/opPools/syncCommitteeContribution.test.ts b/packages/beacon-node/test/unit/chain/opPools/syncCommitteeContribution.test.ts similarity index 97% rename from packages/lodestar/test/unit/chain/opPools/syncCommitteeContribution.test.ts rename to packages/beacon-node/test/unit/chain/opPools/syncCommitteeContribution.test.ts index 3a891b0cddbd..811852be0945 100644 --- a/packages/lodestar/test/unit/chain/opPools/syncCommitteeContribution.test.ts +++ b/packages/beacon-node/test/unit/chain/opPools/syncCommitteeContribution.test.ts @@ -1,10 +1,10 @@ import {expect} from "chai"; -import {altair, ssz} from "@chainsafe/lodestar-types"; -import {newFilledArray} from "@chainsafe/lodestar-beacon-state-transition"; +import {altair, ssz} from "@lodestar/types"; +import {newFilledArray} from "@lodestar/state-transition"; import type {SecretKey} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; import {BitArray} from "@chainsafe/ssz"; -import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; +import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; import { aggregate, replaceIfBetter, diff --git a/packages/lodestar/test/unit/chain/prepareNextSlot.test.ts b/packages/beacon-node/test/unit/chain/prepareNextSlot.test.ts similarity index 96% rename from packages/lodestar/test/unit/chain/prepareNextSlot.test.ts rename to packages/beacon-node/test/unit/chain/prepareNextSlot.test.ts index 3f648373ee76..d5800d03acf9 100644 --- a/packages/lodestar/test/unit/chain/prepareNextSlot.test.ts +++ b/packages/beacon-node/test/unit/chain/prepareNextSlot.test.ts @@ -1,10 +1,10 @@ import {expect} from "chai"; import sinon, {SinonStubbedInstance} from "sinon"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ForkChoice, ProtoBlock} from "@chainsafe/lodestar-fork-choice"; -import {WinstonLogger} from "@chainsafe/lodestar-utils"; -import {ForkSeq, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {config} from "@lodestar/config/default"; +import {ForkChoice, ProtoBlock} from "@lodestar/fork-choice"; +import {WinstonLogger} from "@lodestar/utils"; +import {ForkSeq, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {IChainForkConfig} from "@lodestar/config"; import {BeaconChain, ChainEventEmitter} from "../../../src/chain/index.js"; import {LocalClock} from "../../../src/chain/clock/index.js"; import {PrepareNextSlotScheduler} from "../../../src/chain/prepareNextSlot.js"; diff --git a/packages/lodestar/test/unit/chain/reprocess.test.ts b/packages/beacon-node/test/unit/chain/reprocess.test.ts similarity index 100% rename from packages/lodestar/test/unit/chain/reprocess.test.ts rename to packages/beacon-node/test/unit/chain/reprocess.test.ts diff --git a/packages/lodestar/test/unit/chain/seenCache/aggregateAndProof.test.ts b/packages/beacon-node/test/unit/chain/seenCache/aggregateAndProof.test.ts similarity index 100% rename from packages/lodestar/test/unit/chain/seenCache/aggregateAndProof.test.ts rename to packages/beacon-node/test/unit/chain/seenCache/aggregateAndProof.test.ts diff --git a/packages/lodestar/test/unit/chain/seenCache/syncCommittee.test.ts b/packages/beacon-node/test/unit/chain/seenCache/syncCommittee.test.ts similarity index 100% rename from packages/lodestar/test/unit/chain/seenCache/syncCommittee.test.ts rename to packages/beacon-node/test/unit/chain/seenCache/syncCommittee.test.ts diff --git a/packages/lodestar/test/unit/chain/stateCache/stateContextCache.test.ts b/packages/beacon-node/test/unit/chain/stateCache/stateContextCache.test.ts similarity index 90% rename from packages/lodestar/test/unit/chain/stateCache/stateContextCache.test.ts rename to packages/beacon-node/test/unit/chain/stateCache/stateContextCache.test.ts index c91e34b1eeae..a1ce09e029cb 100644 --- a/packages/lodestar/test/unit/chain/stateCache/stateContextCache.test.ts +++ b/packages/beacon-node/test/unit/chain/stateCache/stateContextCache.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {IEpochShuffling} from "@chainsafe/lodestar-beacon-state-transition"; +import {IEpochShuffling} from "@lodestar/state-transition"; import {toHexString} from "@chainsafe/ssz"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {Root} from "@chainsafe/lodestar-types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {Root} from "@lodestar/types"; import {StateContextCache} from "../../../../src/chain/stateCache/index.js"; import {generateCachedState} from "../../../utils/state.js"; import {ZERO_HASH} from "../../../../src/constants/index.js"; diff --git a/packages/lodestar/test/unit/chain/validation/aggregateAndProof.test.ts b/packages/beacon-node/test/unit/chain/validation/aggregateAndProof.test.ts similarity index 97% rename from packages/lodestar/test/unit/chain/validation/aggregateAndProof.test.ts rename to packages/beacon-node/test/unit/chain/validation/aggregateAndProof.test.ts index 1d9c9509c71e..dce1588dc62e 100644 --- a/packages/lodestar/test/unit/chain/validation/aggregateAndProof.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/aggregateAndProof.test.ts @@ -1,12 +1,12 @@ import {toHexString} from "@chainsafe/ssz"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {phase0, ssz} from "@lodestar/types"; import {IBeaconChain} from "../../../../src/chain/index.js"; import {AttestationErrorCode} from "../../../../src/chain/errors/index.js"; import {validateGossipAggregateAndProof} from "../../../../src/chain/validation/index.js"; import {expectRejectedWithLodestarError} from "../../../utils/errors.js"; // eslint-disable-next-line import/no-relative-packages -import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../beacon-state-transition/test/perf/util.js"; +import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../state-transition/test/perf/util.js"; import {memoOnce} from "../../../utils/cache.js"; import { getAggregateAndProofValidData, diff --git a/packages/lodestar/test/unit/chain/validation/attestation.test.ts b/packages/beacon-node/test/unit/chain/validation/attestation.test.ts similarity index 97% rename from packages/lodestar/test/unit/chain/validation/attestation.test.ts rename to packages/beacon-node/test/unit/chain/validation/attestation.test.ts index 6a15da8eb2ae..b33cffcdf74b 100644 --- a/packages/lodestar/test/unit/chain/validation/attestation.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/attestation.test.ts @@ -1,12 +1,12 @@ -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; import {BitArray} from "@chainsafe/ssz"; import {IBeaconChain} from "../../../../src/chain/index.js"; import {AttestationErrorCode} from "../../../../src/chain/errors/index.js"; import {validateGossipAttestation} from "../../../../src/chain/validation/index.js"; import {expectRejectedWithLodestarError} from "../../../utils/errors.js"; // eslint-disable-next-line import/no-relative-packages -import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../beacon-state-transition/test/perf/util.js"; +import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../state-transition/test/perf/util.js"; import {memoOnce} from "../../../utils/cache.js"; import {getAttestationValidData, AttestationValidDataOpts} from "../../../utils/validationData/attestation.js"; diff --git a/packages/lodestar/test/unit/chain/validation/attesterSlashing.test.ts b/packages/beacon-node/test/unit/chain/validation/attesterSlashing.test.ts similarity index 95% rename from packages/lodestar/test/unit/chain/validation/attesterSlashing.test.ts rename to packages/beacon-node/test/unit/chain/validation/attesterSlashing.test.ts index 6f709042c5ec..bc5e7d27fe5d 100644 --- a/packages/lodestar/test/unit/chain/validation/attesterSlashing.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/attesterSlashing.test.ts @@ -1,7 +1,7 @@ import sinon, {SinonStubbedInstance} from "sinon"; -import {ForkChoice} from "@chainsafe/lodestar-fork-choice"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {ForkChoice} from "@lodestar/fork-choice"; +import {phase0, ssz} from "@lodestar/types"; import {BeaconChain} from "../../../../src/chain/index.js"; import {StubbedChain} from "../../../utils/stub/index.js"; diff --git a/packages/lodestar/test/unit/chain/validation/block.test.ts b/packages/beacon-node/test/unit/chain/validation/block.test.ts similarity index 96% rename from packages/lodestar/test/unit/chain/validation/block.test.ts rename to packages/beacon-node/test/unit/chain/validation/block.test.ts index b5b82acd7344..1c528163aedb 100644 --- a/packages/lodestar/test/unit/chain/validation/block.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/block.test.ts @@ -1,8 +1,8 @@ import sinon, {SinonStubbedInstance} from "sinon"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ForkChoice, ProtoBlock} from "@chainsafe/lodestar-fork-choice"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; -import {ForkName} from "@chainsafe/lodestar-params"; +import {config} from "@lodestar/config/default"; +import {ForkChoice, ProtoBlock} from "@lodestar/fork-choice"; +import {allForks, ssz} from "@lodestar/types"; +import {ForkName} from "@lodestar/params"; import {BeaconChain, IBeaconChain} from "../../../../src/chain/index.js"; import {LocalClock} from "../../../../src/chain/clock/index.js"; import {StateRegenerator} from "../../../../src/chain/regen/index.js"; diff --git a/packages/lodestar/test/unit/chain/validation/contributionAndProof.test.ts b/packages/beacon-node/test/unit/chain/validation/contributionAndProof.test.ts similarity index 96% rename from packages/lodestar/test/unit/chain/validation/contributionAndProof.test.ts rename to packages/beacon-node/test/unit/chain/validation/contributionAndProof.test.ts index bcd05f27c832..7148af31ee33 100644 --- a/packages/lodestar/test/unit/chain/validation/contributionAndProof.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/contributionAndProof.test.ts @@ -1,9 +1,9 @@ import sinon from "sinon"; import {SinonStubbedInstance} from "sinon"; -import {defaultChainConfig} from "@chainsafe/lodestar-config"; +import {defaultChainConfig} from "@lodestar/config"; import {BitArray} from "@chainsafe/ssz"; -import {SLOTS_PER_EPOCH, SYNC_COMMITTEE_SUBNET_SIZE} from "@chainsafe/lodestar-params"; -import {createIChainForkConfig} from "@chainsafe/lodestar-config"; +import {SLOTS_PER_EPOCH, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; +import {createIChainForkConfig} from "@lodestar/config"; import {BeaconChain, IBeaconChain} from "../../../../src/chain/index.js"; import {LocalClock} from "../../../../src/chain/clock/index.js"; import {SyncCommitteeErrorCode} from "../../../../src/chain/errors/syncCommitteeError.js"; @@ -11,7 +11,7 @@ import {expectRejectedWithLodestarError} from "../../../utils/errors.js"; import {generateSignedContributionAndProof} from "../../../utils/contributionAndProof.js"; import {validateSyncCommitteeGossipContributionAndProof} from "../../../../src/chain/validation/syncCommitteeContributionAndProof.js"; // eslint-disable-next-line no-restricted-imports -import * as syncCommitteeUtils from "../../../../../beacon-state-transition/src/util/aggregator.js"; +import * as syncCommitteeUtils from "../../../../../state-transition/src/util/aggregator.js"; import {SinonStubFn} from "../../../utils/types.js"; import {generateCachedStateWithPubkeys} from "../../../utils/state.js"; import {SeenContributionAndProof} from "../../../../src/chain/seenCache/index.js"; diff --git a/packages/lodestar/test/unit/chain/validation/proposerSlashing.test.ts b/packages/beacon-node/test/unit/chain/validation/proposerSlashing.test.ts similarity index 95% rename from packages/lodestar/test/unit/chain/validation/proposerSlashing.test.ts rename to packages/beacon-node/test/unit/chain/validation/proposerSlashing.test.ts index 918c223ba4ed..a89f14cf0c7b 100644 --- a/packages/lodestar/test/unit/chain/validation/proposerSlashing.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/proposerSlashing.test.ts @@ -1,7 +1,7 @@ import sinon, {SinonStubbedInstance} from "sinon"; -import {ForkChoice} from "@chainsafe/lodestar-fork-choice"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {ForkChoice} from "@lodestar/fork-choice"; +import {phase0, ssz} from "@lodestar/types"; import {BeaconChain} from "../../../../src/chain/index.js"; import {StubbedChain} from "../../../utils/stub/index.js"; diff --git a/packages/lodestar/test/unit/chain/validation/syncCommittee.test.ts b/packages/beacon-node/test/unit/chain/validation/syncCommittee.test.ts similarity index 96% rename from packages/lodestar/test/unit/chain/validation/syncCommittee.test.ts rename to packages/beacon-node/test/unit/chain/validation/syncCommittee.test.ts index f871e377787c..8abd79c59f13 100644 --- a/packages/lodestar/test/unit/chain/validation/syncCommittee.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/syncCommittee.test.ts @@ -1,8 +1,8 @@ import sinon from "sinon"; import {SinonStubbedInstance} from "sinon"; -import {Epoch} from "@chainsafe/lodestar-types"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {createIChainForkConfig, defaultChainConfig} from "@chainsafe/lodestar-config"; +import {Epoch} from "@lodestar/types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {createIChainForkConfig, defaultChainConfig} from "@lodestar/config"; import {BeaconChain, IBeaconChain} from "../../../../src/chain/index.js"; import {LocalClock} from "../../../../src/chain/clock/index.js"; import {SyncCommitteeErrorCode} from "../../../../src/chain/errors/syncCommitteeError.js"; diff --git a/packages/lodestar/test/unit/chain/validation/voluntaryExit.test.ts b/packages/beacon-node/test/unit/chain/validation/voluntaryExit.test.ts similarity index 92% rename from packages/lodestar/test/unit/chain/validation/voluntaryExit.test.ts rename to packages/beacon-node/test/unit/chain/validation/voluntaryExit.test.ts index 1f6c43f62c53..1617d992b6a4 100644 --- a/packages/lodestar/test/unit/chain/validation/voluntaryExit.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/voluntaryExit.test.ts @@ -1,19 +1,19 @@ import sinon, {SinonStubbedInstance} from "sinon"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import { CachedBeaconStateAllForks, computeEpochAtSlot, computeDomain, computeSigningRoot, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {ForkChoice} from "@chainsafe/lodestar-fork-choice"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +} from "@lodestar/state-transition"; +import {ForkChoice} from "@lodestar/fork-choice"; +import {phase0, ssz} from "@lodestar/types"; -import {DOMAIN_VOLUNTARY_EXIT, FAR_FUTURE_EPOCH, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {DOMAIN_VOLUNTARY_EXIT, FAR_FUTURE_EPOCH, SLOTS_PER_EPOCH} from "@lodestar/params"; import bls from "@chainsafe/bls"; import {PointFormat} from "@chainsafe/bls/types"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; +import {createIBeaconConfig} from "@lodestar/config"; import {BeaconChain} from "../../../../src/chain/index.js"; import {StubbedChain} from "../../../utils/stub/index.js"; import {generateState} from "../../../utils/state.js"; diff --git a/packages/lodestar/test/unit/db/api/repositories/blockArchive.test.ts b/packages/beacon-node/test/unit/db/api/repositories/blockArchive.test.ts similarity index 96% rename from packages/lodestar/test/unit/db/api/repositories/blockArchive.test.ts rename to packages/beacon-node/test/unit/db/api/repositories/blockArchive.test.ts index 4fb3f6ac70dc..649ba8dfa045 100644 --- a/packages/lodestar/test/unit/db/api/repositories/blockArchive.test.ts +++ b/packages/beacon-node/test/unit/db/api/repositories/blockArchive.test.ts @@ -1,10 +1,10 @@ import {expect} from "chai"; import rimraf from "rimraf"; import sinon from "sinon"; -import {ssz} from "@chainsafe/lodestar-types"; -import {config} from "@chainsafe/lodestar-config/default"; -import {intToBytes} from "@chainsafe/lodestar-utils"; -import {LevelDbController, Bucket, encodeKey} from "@chainsafe/lodestar-db"; +import {ssz} from "@lodestar/types"; +import {config} from "@lodestar/config/default"; +import {intToBytes} from "@lodestar/utils"; +import {LevelDbController, Bucket, encodeKey} from "@lodestar/db"; import {generateEmptySignedBlock} from "../../../../utils/block.js"; import {BlockArchiveRepository} from "../../../../../src/db/repositories/index.js"; diff --git a/packages/lodestar/test/unit/db/api/repository.test.ts b/packages/beacon-node/test/unit/db/api/repository.test.ts similarity index 95% rename from packages/lodestar/test/unit/db/api/repository.test.ts rename to packages/beacon-node/test/unit/db/api/repository.test.ts index 504943b304e6..f532a1d1287b 100644 --- a/packages/lodestar/test/unit/db/api/repository.test.ts +++ b/packages/beacon-node/test/unit/db/api/repository.test.ts @@ -4,9 +4,9 @@ import chaiAsPromised from "chai-as-promised"; import all from "it-all"; import {ContainerType} from "@chainsafe/ssz"; -import {Bytes32, ssz} from "@chainsafe/lodestar-types"; -import {config} from "@chainsafe/lodestar-config/default"; -import {Db, LevelDbController, Repository, Bucket} from "@chainsafe/lodestar-db"; +import {Bytes32, ssz} from "@lodestar/types"; +import {config} from "@lodestar/config/default"; +import {Db, LevelDbController, Repository, Bucket} from "@lodestar/db"; chai.use(chaiAsPromised); diff --git a/packages/lodestar/test/unit/eth1/eth1MergeBlockTracker.test.ts b/packages/beacon-node/test/unit/eth1/eth1MergeBlockTracker.test.ts similarity index 98% rename from packages/lodestar/test/unit/eth1/eth1MergeBlockTracker.test.ts rename to packages/beacon-node/test/unit/eth1/eth1MergeBlockTracker.test.ts index 2e4a4a8574c8..02aa8c3388fc 100644 --- a/packages/lodestar/test/unit/eth1/eth1MergeBlockTracker.test.ts +++ b/packages/beacon-node/test/unit/eth1/eth1MergeBlockTracker.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {sleep} from "@chainsafe/lodestar-utils"; +import {IChainConfig} from "@lodestar/config"; +import {sleep} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; import {IEth1Provider} from "../../../src/index.js"; import {ZERO_HASH} from "../../../src/constants/index.js"; diff --git a/packages/lodestar/test/unit/eth1/hexEncoding.test.ts b/packages/beacon-node/test/unit/eth1/hexEncoding.test.ts similarity index 100% rename from packages/lodestar/test/unit/eth1/hexEncoding.test.ts rename to packages/beacon-node/test/unit/eth1/hexEncoding.test.ts diff --git a/packages/lodestar/test/unit/eth1/jwt.test.ts b/packages/beacon-node/test/unit/eth1/jwt.test.ts similarity index 100% rename from packages/lodestar/test/unit/eth1/jwt.test.ts rename to packages/beacon-node/test/unit/eth1/jwt.test.ts diff --git a/packages/lodestar/test/unit/eth1/utils/depositContract.test.ts b/packages/beacon-node/test/unit/eth1/utils/depositContract.test.ts similarity index 100% rename from packages/lodestar/test/unit/eth1/utils/depositContract.test.ts rename to packages/beacon-node/test/unit/eth1/utils/depositContract.test.ts diff --git a/packages/lodestar/test/unit/eth1/utils/deposits.test.ts b/packages/beacon-node/test/unit/eth1/utils/deposits.test.ts similarity index 96% rename from packages/lodestar/test/unit/eth1/utils/deposits.test.ts rename to packages/beacon-node/test/unit/eth1/utils/deposits.test.ts index 492e42693d28..769a4f881452 100644 --- a/packages/lodestar/test/unit/eth1/utils/deposits.test.ts +++ b/packages/beacon-node/test/unit/eth1/utils/deposits.test.ts @@ -1,8 +1,8 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {MAX_DEPOSITS} from "@chainsafe/lodestar-params"; -import {verifyMerkleBranch} from "@chainsafe/lodestar-utils"; +import {phase0, ssz} from "@lodestar/types"; +import {MAX_DEPOSITS} from "@lodestar/params"; +import {verifyMerkleBranch} from "@lodestar/utils"; import {filterBy} from "../../../utils/db.js"; import {Eth1ErrorCode} from "../../../../src/eth1/errors.js"; import {generateDepositData, generateDepositEvent} from "../../../utils/deposit.js"; diff --git a/packages/lodestar/test/unit/eth1/utils/eth1Data.test.ts b/packages/beacon-node/test/unit/eth1/utils/eth1Data.test.ts similarity index 98% rename from packages/lodestar/test/unit/eth1/utils/eth1Data.test.ts rename to packages/beacon-node/test/unit/eth1/utils/eth1Data.test.ts index 7536def877ee..e4287219d7d1 100644 --- a/packages/lodestar/test/unit/eth1/utils/eth1Data.test.ts +++ b/packages/beacon-node/test/unit/eth1/utils/eth1Data.test.ts @@ -1,8 +1,8 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; import pick from "lodash/pick.js"; -import {Root, phase0, ssz} from "@chainsafe/lodestar-types"; -import {toHex} from "@chainsafe/lodestar-utils"; +import {Root, phase0, ssz} from "@lodestar/types"; +import {toHex} from "@lodestar/utils"; import {iteratorFromArray} from "../../../utils/interator.js"; import { getEth1DataForBlocks, diff --git a/packages/lodestar/test/unit/eth1/utils/eth1DepositEvent.test.ts b/packages/beacon-node/test/unit/eth1/utils/eth1DepositEvent.test.ts similarity index 100% rename from packages/lodestar/test/unit/eth1/utils/eth1DepositEvent.test.ts rename to packages/beacon-node/test/unit/eth1/utils/eth1DepositEvent.test.ts diff --git a/packages/lodestar/test/unit/eth1/utils/eth1Vote.test.ts b/packages/beacon-node/test/unit/eth1/utils/eth1Vote.test.ts similarity index 95% rename from packages/lodestar/test/unit/eth1/utils/eth1Vote.test.ts rename to packages/beacon-node/test/unit/eth1/utils/eth1Vote.test.ts index c90e749b52db..f2b803427ce1 100644 --- a/packages/lodestar/test/unit/eth1/utils/eth1Vote.test.ts +++ b/packages/beacon-node/test/unit/eth1/utils/eth1Vote.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {config} from "@lodestar/config/default"; +import {phase0, ssz} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; import {generateState} from "../../../utils/state.js"; import {filterBy} from "../../../utils/db.js"; import { diff --git a/packages/lodestar/test/unit/eth1/utils/groupDepositEventsByBlock.test.ts b/packages/beacon-node/test/unit/eth1/utils/groupDepositEventsByBlock.test.ts similarity index 96% rename from packages/lodestar/test/unit/eth1/utils/groupDepositEventsByBlock.test.ts rename to packages/beacon-node/test/unit/eth1/utils/groupDepositEventsByBlock.test.ts index 1209ab784a47..a199ad762522 100644 --- a/packages/lodestar/test/unit/eth1/utils/groupDepositEventsByBlock.test.ts +++ b/packages/beacon-node/test/unit/eth1/utils/groupDepositEventsByBlock.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {groupDepositEventsByBlock} from "../../../../src/eth1/utils/groupDepositEventsByBlock.js"; describe("eth1 / util / groupDepositEventsByBlock", function () { diff --git a/packages/lodestar/test/unit/eth1/utils/optimizeNextBlockDiffForGenesis.test.ts b/packages/beacon-node/test/unit/eth1/utils/optimizeNextBlockDiffForGenesis.test.ts similarity index 100% rename from packages/lodestar/test/unit/eth1/utils/optimizeNextBlockDiffForGenesis.test.ts rename to packages/beacon-node/test/unit/eth1/utils/optimizeNextBlockDiffForGenesis.test.ts diff --git a/packages/lodestar/test/unit/executionEngine/http.test.ts b/packages/beacon-node/test/unit/executionEngine/http.test.ts similarity index 100% rename from packages/lodestar/test/unit/executionEngine/http.test.ts rename to packages/beacon-node/test/unit/executionEngine/http.test.ts diff --git a/packages/lodestar/test/unit/metrics/beacon.test.ts b/packages/beacon-node/test/unit/metrics/beacon.test.ts similarity index 100% rename from packages/lodestar/test/unit/metrics/beacon.test.ts rename to packages/beacon-node/test/unit/metrics/beacon.test.ts diff --git a/packages/lodestar/test/unit/metrics/metrics.test.ts b/packages/beacon-node/test/unit/metrics/metrics.test.ts similarity index 100% rename from packages/lodestar/test/unit/metrics/metrics.test.ts rename to packages/beacon-node/test/unit/metrics/metrics.test.ts diff --git a/packages/lodestar/test/unit/metrics/server/http.test.ts b/packages/beacon-node/test/unit/metrics/server/http.test.ts similarity index 100% rename from packages/lodestar/test/unit/metrics/server/http.test.ts rename to packages/beacon-node/test/unit/metrics/server/http.test.ts diff --git a/packages/lodestar/test/unit/metrics/utils.test.ts b/packages/beacon-node/test/unit/metrics/utils.test.ts similarity index 100% rename from packages/lodestar/test/unit/metrics/utils.test.ts rename to packages/beacon-node/test/unit/metrics/utils.test.ts diff --git a/packages/lodestar/test/unit/metrics/utils.ts b/packages/beacon-node/test/unit/metrics/utils.ts similarity index 63% rename from packages/lodestar/test/unit/metrics/utils.ts rename to packages/beacon-node/test/unit/metrics/utils.ts index 35bde974dbce..3064ec007cf6 100644 --- a/packages/lodestar/test/unit/metrics/utils.ts +++ b/packages/beacon-node/test/unit/metrics/utils.ts @@ -1,6 +1,6 @@ -import {config} from "@chainsafe/lodestar-config/default"; -import {ssz} from "@chainsafe/lodestar-types"; -import {WinstonLogger} from "@chainsafe/lodestar-utils"; +import {config} from "@lodestar/config/default"; +import {ssz} from "@lodestar/types"; +import {WinstonLogger} from "@lodestar/utils"; import {createMetrics, IMetrics} from "../../../src/metrics/index.js"; export function createMetricsTest(): IMetrics { diff --git a/packages/lodestar/test/unit/network/attestationService.test.ts b/packages/beacon-node/test/unit/network/attestationService.test.ts similarity index 96% rename from packages/lodestar/test/unit/network/attestationService.test.ts rename to packages/beacon-node/test/unit/network/attestationService.test.ts index 721f50059d6f..dafcf89e8986 100644 --- a/packages/lodestar/test/unit/network/attestationService.test.ts +++ b/packages/beacon-node/test/unit/network/attestationService.test.ts @@ -5,10 +5,10 @@ import { EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION, ForkName, SLOTS_PER_EPOCH, -} from "@chainsafe/lodestar-params"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {BeaconStateAllForks, getCurrentSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import * as mathUtils from "@chainsafe/lodestar-utils"; +} from "@lodestar/params"; +import {createIBeaconConfig} from "@lodestar/config"; +import {BeaconStateAllForks, getCurrentSlot} from "@lodestar/state-transition"; +import * as mathUtils from "@lodestar/utils"; import * as shuffleUtils from "../../../src/util/shuffle.js"; import {MockBeaconChain} from "../../utils/mocks/chain/chain.js"; import {generateState} from "../../utils/state.js"; diff --git a/packages/lodestar/test/unit/network/fork.test.ts b/packages/beacon-node/test/unit/network/fork.test.ts similarity index 97% rename from packages/lodestar/test/unit/network/fork.test.ts rename to packages/beacon-node/test/unit/network/fork.test.ts index 10d75840be7a..3831796a545a 100644 --- a/packages/lodestar/test/unit/network/fork.test.ts +++ b/packages/beacon-node/test/unit/network/fork.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {ForkName, ForkSeq} from "@chainsafe/lodestar-params"; -import {IBeaconConfig, IForkInfo} from "@chainsafe/lodestar-config"; +import {ForkName, ForkSeq} from "@lodestar/params"; +import {IBeaconConfig, IForkInfo} from "@lodestar/config"; import {getCurrentAndNextFork, getActiveForks} from "../../../src/network/forks.js"; function getForkConfig({ diff --git a/packages/lodestar/test/unit/network/gossip/topic.test.ts b/packages/beacon-node/test/unit/network/gossip/topic.test.ts similarity index 98% rename from packages/lodestar/test/unit/network/gossip/topic.test.ts rename to packages/beacon-node/test/unit/network/gossip/topic.test.ts index 97ed5be3756e..fe6723bf3077 100644 --- a/packages/lodestar/test/unit/network/gossip/topic.test.ts +++ b/packages/beacon-node/test/unit/network/gossip/topic.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ForkName} from "@chainsafe/lodestar-params"; +import {ForkName} from "@lodestar/params"; import {GossipType, GossipEncoding, GossipTopicMap} from "../../../../src/network/gossip/index.js"; import {parseGossipTopic, stringifyGossipTopic} from "../../../../src/network/gossip/topic.js"; import {config} from "../../../utils/config.js"; diff --git a/packages/lodestar/test/unit/network/metadata.test.ts b/packages/beacon-node/test/unit/network/metadata.test.ts similarity index 92% rename from packages/lodestar/test/unit/network/metadata.test.ts rename to packages/beacon-node/test/unit/network/metadata.test.ts index 7d8f78dbc4a5..026a3ee996dc 100644 --- a/packages/lodestar/test/unit/network/metadata.test.ts +++ b/packages/beacon-node/test/unit/network/metadata.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {getENRForkID} from "../../../src/network/metadata.js"; import {config} from "../../utils/config.js"; diff --git a/packages/lodestar/test/unit/network/nodejs/libp2p.test.ts b/packages/beacon-node/test/unit/network/nodejs/libp2p.test.ts similarity index 97% rename from packages/lodestar/test/unit/network/nodejs/libp2p.test.ts rename to packages/beacon-node/test/unit/network/nodejs/libp2p.test.ts index 3efb97c09945..4abe146e7d90 100644 --- a/packages/lodestar/test/unit/network/nodejs/libp2p.test.ts +++ b/packages/beacon-node/test/unit/network/nodejs/libp2p.test.ts @@ -1,5 +1,5 @@ import {assert} from "chai"; -import {sleep} from "@chainsafe/lodestar-utils"; +import {sleep} from "@lodestar/utils"; import {NodejsNode} from "../../../../src/network/nodejs/index.js"; import {createNode} from "../../../utils/network.js"; import {Libp2pEvent} from "../../../../src/constants/index.js"; diff --git a/packages/lodestar/test/unit/network/peers/client.test.ts b/packages/beacon-node/test/unit/network/peers/client.test.ts similarity index 100% rename from packages/lodestar/test/unit/network/peers/client.test.ts rename to packages/beacon-node/test/unit/network/peers/client.test.ts diff --git a/packages/lodestar/test/unit/network/peers/datastore.test.ts b/packages/beacon-node/test/unit/network/peers/datastore.test.ts similarity index 100% rename from packages/lodestar/test/unit/network/peers/datastore.test.ts rename to packages/beacon-node/test/unit/network/peers/datastore.test.ts diff --git a/packages/lodestar/test/unit/network/peers/discover.test.ts b/packages/beacon-node/test/unit/network/peers/discover.test.ts similarity index 100% rename from packages/lodestar/test/unit/network/peers/discover.test.ts rename to packages/beacon-node/test/unit/network/peers/discover.test.ts diff --git a/packages/lodestar/test/unit/network/peers/priorization.test.ts b/packages/beacon-node/test/unit/network/peers/priorization.test.ts similarity index 98% rename from packages/lodestar/test/unit/network/peers/priorization.test.ts rename to packages/beacon-node/test/unit/network/peers/priorization.test.ts index 66d6c3c2e03b..9c76fa594cbb 100644 --- a/packages/lodestar/test/unit/network/peers/priorization.test.ts +++ b/packages/beacon-node/test/unit/network/peers/priorization.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; import PeerId from "peer-id"; -import {phase0, altair} from "@chainsafe/lodestar-types"; +import {phase0, altair} from "@lodestar/types"; import {BitArray} from "@chainsafe/ssz"; -import {ATTESTATION_SUBNET_COUNT} from "@chainsafe/lodestar-params"; +import {ATTESTATION_SUBNET_COUNT} from "@lodestar/params"; import {ExcessPeerDisconnectReason, prioritizePeers} from "../../../../src/network/peers/utils/prioritizePeers.js"; import {getAttnets, getSyncnets} from "../../../utils/network.js"; import {RequestedSubnet} from "../../../../src/network/peers/utils/index.js"; diff --git a/packages/lodestar/test/unit/network/peers/score.test.ts b/packages/beacon-node/test/unit/network/peers/score.test.ts similarity index 100% rename from packages/lodestar/test/unit/network/peers/score.test.ts rename to packages/beacon-node/test/unit/network/peers/score.test.ts diff --git a/packages/lodestar/test/unit/network/peers/utils/assertPeerRelevance.test.ts b/packages/beacon-node/test/unit/network/peers/utils/assertPeerRelevance.test.ts similarity index 98% rename from packages/lodestar/test/unit/network/peers/utils/assertPeerRelevance.test.ts rename to packages/beacon-node/test/unit/network/peers/utils/assertPeerRelevance.test.ts index 22fc3edd5cef..89e42482d1f9 100644 --- a/packages/lodestar/test/unit/network/peers/utils/assertPeerRelevance.test.ts +++ b/packages/beacon-node/test/unit/network/peers/utils/assertPeerRelevance.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {MockBeaconChain} from "../../../../utils/mocks/chain/chain.js"; import {assertPeerRelevance, IrrelevantPeerCode} from "../../../../../src/network/peers/utils/assertPeerRelevance.js"; import {IBeaconClock} from "../../../../../src/chain/clock/index.js"; diff --git a/packages/lodestar/test/unit/network/peers/utils/enrSubnets.test.ts b/packages/beacon-node/test/unit/network/peers/utils/enrSubnets.test.ts similarity index 94% rename from packages/lodestar/test/unit/network/peers/utils/enrSubnets.test.ts rename to packages/beacon-node/test/unit/network/peers/utils/enrSubnets.test.ts index 25a1861c64d3..5d3be91a08ef 100644 --- a/packages/lodestar/test/unit/network/peers/utils/enrSubnets.test.ts +++ b/packages/beacon-node/test/unit/network/peers/utils/enrSubnets.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; -import {toHex} from "@chainsafe/lodestar-utils"; +import {SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; +import {toHex} from "@lodestar/utils"; import {BitArray} from "@chainsafe/ssz"; import {deserializeEnrSubnets} from "../../../../../src/network/peers/utils/enrSubnetsDeserialize.js"; diff --git a/packages/lodestar/test/unit/network/reqresp/encoders/request.test.ts b/packages/beacon-node/test/unit/network/reqresp/encoders/request.test.ts similarity index 100% rename from packages/lodestar/test/unit/network/reqresp/encoders/request.test.ts rename to packages/beacon-node/test/unit/network/reqresp/encoders/request.test.ts diff --git a/packages/lodestar/test/unit/network/reqresp/encoders/requestTypes.test.ts b/packages/beacon-node/test/unit/network/reqresp/encoders/requestTypes.test.ts similarity index 97% rename from packages/lodestar/test/unit/network/reqresp/encoders/requestTypes.test.ts rename to packages/beacon-node/test/unit/network/reqresp/encoders/requestTypes.test.ts index ffe6bfeae33a..65bb751b2816 100644 --- a/packages/lodestar/test/unit/network/reqresp/encoders/requestTypes.test.ts +++ b/packages/beacon-node/test/unit/network/reqresp/encoders/requestTypes.test.ts @@ -1,7 +1,7 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; import pipe from "it-pipe"; -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {Method, Encoding, getRequestSzzTypeByMethod, RequestBody} from "../../../../../src/network/reqresp/types.js"; import {requestEncode} from "../../../../../src/network/reqresp/encoders/requestEncode.js"; import {requestDecode} from "../../../../../src/network/reqresp/encoders/requestDecode.js"; diff --git a/packages/lodestar/test/unit/network/reqresp/encoders/response.test.ts b/packages/beacon-node/test/unit/network/reqresp/encoders/response.test.ts similarity index 97% rename from packages/lodestar/test/unit/network/reqresp/encoders/response.test.ts rename to packages/beacon-node/test/unit/network/reqresp/encoders/response.test.ts index 1a4325ca934e..3c99db225712 100644 --- a/packages/lodestar/test/unit/network/reqresp/encoders/response.test.ts +++ b/packages/beacon-node/test/unit/network/reqresp/encoders/response.test.ts @@ -2,11 +2,11 @@ import chai from "chai"; import chaiAsPromised from "chai-as-promised"; import pipe from "it-pipe"; import all from "it-all"; -import {ForkName, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {chainConfig} from "@chainsafe/lodestar-config/default"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {LodestarError} from "@chainsafe/lodestar-utils"; -import {allForks} from "@chainsafe/lodestar-types"; +import {ForkName, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {chainConfig} from "@lodestar/config/default"; +import {createIBeaconConfig} from "@lodestar/config"; +import {LodestarError} from "@lodestar/utils"; +import {allForks} from "@lodestar/types"; import { Method, Version, diff --git a/packages/lodestar/test/unit/network/reqresp/encoders/responseTypes.test.ts b/packages/beacon-node/test/unit/network/reqresp/encoders/responseTypes.test.ts similarity index 96% rename from packages/lodestar/test/unit/network/reqresp/encoders/responseTypes.test.ts rename to packages/beacon-node/test/unit/network/reqresp/encoders/responseTypes.test.ts index df92e3cb9a1b..1fecdfe4401b 100644 --- a/packages/lodestar/test/unit/network/reqresp/encoders/responseTypes.test.ts +++ b/packages/beacon-node/test/unit/network/reqresp/encoders/responseTypes.test.ts @@ -2,8 +2,8 @@ import chai from "chai"; import chaiAsPromised from "chai-as-promised"; import pipe from "it-pipe"; import all from "it-all"; -import {allForks} from "@chainsafe/lodestar-types"; -import {ForkName} from "@chainsafe/lodestar-params"; +import {allForks} from "@lodestar/types"; +import {ForkName} from "@lodestar/params"; import { Method, Version, diff --git a/packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts b/packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts similarity index 98% rename from packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts rename to packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts index 8190c04af5d1..090d03bc2e50 100644 --- a/packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts +++ b/packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/decode.test.ts @@ -1,7 +1,7 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; import varint from "varint"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {RequestOrResponseType} from "../../../../../../src/network/reqresp/types.js"; import {BufferedSource} from "../../../../../../src/network/reqresp/utils/index.js"; import { diff --git a/packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts b/packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts similarity index 95% rename from packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts rename to packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts index 3246c609cb64..32b26eff9ba5 100644 --- a/packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts +++ b/packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/encode.test.ts @@ -1,7 +1,7 @@ import all from "it-all"; import pipe from "it-pipe"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {allForks, ssz} from "@lodestar/types"; +import {LodestarError} from "@lodestar/utils"; import { reqRespBlockResponseSerializer, RequestOrIncomingResponseBody, diff --git a/packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/snappy-frames/uncompress.test.ts b/packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/snappy-frames/uncompress.test.ts similarity index 100% rename from packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/snappy-frames/uncompress.test.ts rename to packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/snappy-frames/uncompress.test.ts diff --git a/packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/testData.ts b/packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/testData.ts similarity index 98% rename from packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/testData.ts rename to packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/testData.ts index 8474ec62f16f..39f0cb41d67c 100644 --- a/packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/testData.ts +++ b/packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/testData.ts @@ -1,5 +1,5 @@ import {fromHexString} from "@chainsafe/ssz"; -import {altair, phase0, ssz} from "@chainsafe/lodestar-types"; +import {altair, phase0, ssz} from "@lodestar/types"; import {RequestOrIncomingResponseBody, RequestOrResponseType} from "../../../../../../src/network/reqresp/types.js"; // This test data generated with code from 'master' at Jan 1st 2021 diff --git a/packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/utils.test.ts b/packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/utils.test.ts similarity index 100% rename from packages/lodestar/test/unit/network/reqresp/encodingStrategies/sszSnappy/utils.test.ts rename to packages/beacon-node/test/unit/network/reqresp/encodingStrategies/sszSnappy/utils.test.ts diff --git a/packages/lodestar/test/unit/network/reqresp/rateTracker.test.ts b/packages/beacon-node/test/unit/network/reqresp/rateTracker.test.ts similarity index 100% rename from packages/lodestar/test/unit/network/reqresp/rateTracker.test.ts rename to packages/beacon-node/test/unit/network/reqresp/rateTracker.test.ts diff --git a/packages/lodestar/test/unit/network/reqresp/request/collectResponses.test.ts b/packages/beacon-node/test/unit/network/reqresp/request/collectResponses.test.ts similarity index 100% rename from packages/lodestar/test/unit/network/reqresp/request/collectResponses.test.ts rename to packages/beacon-node/test/unit/network/reqresp/request/collectResponses.test.ts diff --git a/packages/lodestar/test/unit/network/reqresp/request/responseTimeoutsHandler.test.ts b/packages/beacon-node/test/unit/network/reqresp/request/responseTimeoutsHandler.test.ts similarity index 98% rename from packages/lodestar/test/unit/network/reqresp/request/responseTimeoutsHandler.test.ts rename to packages/beacon-node/test/unit/network/reqresp/request/responseTimeoutsHandler.test.ts index 5fac8ff837a8..d4fed598ab93 100644 --- a/packages/lodestar/test/unit/network/reqresp/request/responseTimeoutsHandler.test.ts +++ b/packages/beacon-node/test/unit/network/reqresp/request/responseTimeoutsHandler.test.ts @@ -1,6 +1,6 @@ import all from "it-all"; import pipe from "it-pipe"; -import {LodestarError, sleep as _sleep} from "@chainsafe/lodestar-utils"; +import {LodestarError, sleep as _sleep} from "@lodestar/utils"; import {timeoutOptions} from "../../../../../src/constants/index.js"; import {responseTimeoutsHandler} from "../../../../../src/network/reqresp/request/responseTimeoutsHandler.js"; import {RequestErrorCode, RequestInternalError} from "../../../../../src/network/reqresp/request/errors.js"; diff --git a/packages/lodestar/test/unit/network/reqresp/response/index.test.ts b/packages/beacon-node/test/unit/network/reqresp/response/index.test.ts similarity index 98% rename from packages/lodestar/test/unit/network/reqresp/response/index.test.ts rename to packages/beacon-node/test/unit/network/reqresp/response/index.test.ts index 7deaf25cbac9..e293e8d3638d 100644 --- a/packages/lodestar/test/unit/network/reqresp/response/index.test.ts +++ b/packages/beacon-node/test/unit/network/reqresp/response/index.test.ts @@ -1,6 +1,6 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {LodestarError} from "@lodestar/utils"; import {RespStatus} from "../../../../../src/constants/index.js"; import {Method, Encoding, Version} from "../../../../../src/network/reqresp/types.js"; import {handleRequest, PerformRequestHandler} from "../../../../../src/network/reqresp/response/index.js"; diff --git a/packages/lodestar/test/unit/network/reqresp/response/rateLimiter.test.ts b/packages/beacon-node/test/unit/network/reqresp/response/rateLimiter.test.ts similarity index 99% rename from packages/lodestar/test/unit/network/reqresp/response/rateLimiter.test.ts rename to packages/beacon-node/test/unit/network/reqresp/response/rateLimiter.test.ts index 7523ed242517..f7084b9f9bee 100644 --- a/packages/lodestar/test/unit/network/reqresp/response/rateLimiter.test.ts +++ b/packages/beacon-node/test/unit/network/reqresp/response/rateLimiter.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; import PeerId from "peer-id"; import sinon, {SinonStubbedInstance} from "sinon"; -import {WinstonLogger} from "@chainsafe/lodestar-utils"; +import {WinstonLogger} from "@lodestar/utils"; import {IPeerRpcScoreStore, PeerAction, PeerRpcScoreStore} from "../../../../../src/network/index.js"; import {defaultNetworkOptions} from "../../../../../src/network/options.js"; import {InboundRateLimiter} from "../../../../../src/network/reqresp/response/rateLimiter.js"; diff --git a/packages/lodestar/test/unit/network/reqresp/utils.ts b/packages/beacon-node/test/unit/network/reqresp/utils.ts similarity index 97% rename from packages/lodestar/test/unit/network/reqresp/utils.ts rename to packages/beacon-node/test/unit/network/reqresp/utils.ts index 3d8fae5b117b..92374a02f0c7 100644 --- a/packages/lodestar/test/unit/network/reqresp/utils.ts +++ b/packages/beacon-node/test/unit/network/reqresp/utils.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {Root, phase0} from "@chainsafe/lodestar-types"; +import {Root, phase0} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; import {Libp2pStream} from "../../../../src/network/index.js"; import {generateEmptySignedBlock} from "../../../utils/block.js"; diff --git a/packages/lodestar/test/unit/network/reqresp/utils/assertSequentialBlocksInRange.test.ts b/packages/beacon-node/test/unit/network/reqresp/utils/assertSequentialBlocksInRange.test.ts similarity index 98% rename from packages/lodestar/test/unit/network/reqresp/utils/assertSequentialBlocksInRange.test.ts rename to packages/beacon-node/test/unit/network/reqresp/utils/assertSequentialBlocksInRange.test.ts index b958a600d296..36b30f678a24 100644 --- a/packages/lodestar/test/unit/network/reqresp/utils/assertSequentialBlocksInRange.test.ts +++ b/packages/beacon-node/test/unit/network/reqresp/utils/assertSequentialBlocksInRange.test.ts @@ -1,4 +1,4 @@ -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import { assertSequentialBlocksInRange, BlocksByRangeError, diff --git a/packages/lodestar/test/unit/network/util.test.ts b/packages/beacon-node/test/unit/network/util.test.ts similarity index 97% rename from packages/lodestar/test/unit/network/util.test.ts rename to packages/beacon-node/test/unit/network/util.test.ts index eb8149925a04..aa7029252661 100644 --- a/packages/lodestar/test/unit/network/util.test.ts +++ b/packages/beacon-node/test/unit/network/util.test.ts @@ -1,8 +1,8 @@ import {Multiaddr} from "multiaddr"; import {expect} from "chai"; import PeerId from "peer-id"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ForkName} from "@chainsafe/lodestar-params"; +import {config} from "@lodestar/config/default"; +import {ForkName} from "@lodestar/params"; import {ENR} from "@chainsafe/discv5"; import {Method, Version, Encoding} from "../../../src/network/reqresp/types.js"; import {defaultNetworkOptions} from "../../../src/network/options.js"; diff --git a/packages/lodestar/test/unit/setupState.test.ts b/packages/beacon-node/test/unit/setupState.test.ts similarity index 100% rename from packages/lodestar/test/unit/setupState.test.ts rename to packages/beacon-node/test/unit/setupState.test.ts diff --git a/packages/lodestar/test/unit/sync/backfill/blocks.json b/packages/beacon-node/test/unit/sync/backfill/blocks.json similarity index 100% rename from packages/lodestar/test/unit/sync/backfill/blocks.json rename to packages/beacon-node/test/unit/sync/backfill/blocks.json diff --git a/packages/lodestar/test/unit/sync/backfill/verify.test.ts b/packages/beacon-node/test/unit/sync/backfill/verify.test.ts similarity index 92% rename from packages/lodestar/test/unit/sync/backfill/verify.test.ts rename to packages/beacon-node/test/unit/sync/backfill/verify.test.ts index 67841a49781a..af6d4f84ecee 100644 --- a/packages/lodestar/test/unit/sync/backfill/verify.test.ts +++ b/packages/beacon-node/test/unit/sync/backfill/verify.test.ts @@ -2,9 +2,9 @@ import {readFileSync} from "node:fs"; import path from "node:path"; import {fileURLToPath} from "node:url"; import {expect} from "chai"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {config} from "@chainsafe/lodestar-config/default"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {createIBeaconConfig} from "@lodestar/config"; +import {config} from "@lodestar/config/default"; +import {phase0, ssz} from "@lodestar/types"; import {verifyBlockSequence} from "../../../../src/sync/backfill/verify.js"; import {BackfillSyncErrorCode, BackfillSyncError} from "./../../../../src/sync/backfill/errors.js"; diff --git a/packages/lodestar/test/unit/sync/range/batch.test.ts b/packages/beacon-node/test/unit/sync/range/batch.test.ts similarity index 97% rename from packages/lodestar/test/unit/sync/range/batch.test.ts rename to packages/beacon-node/test/unit/sync/range/batch.test.ts index 8fa5d7d17bfa..e70932fd6159 100644 --- a/packages/lodestar/test/unit/sync/range/batch.test.ts +++ b/packages/beacon-node/test/unit/sync/range/batch.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; import PeerId from "peer-id"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {config} from "@chainsafe/lodestar-config/default"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {config} from "@lodestar/config/default"; import {generateEmptySignedBlock} from "../../../utils/block.js"; import {expectThrowsLodestarError} from "../../../utils/errors.js"; import {Batch, BatchOpts, BatchStatus, BatchErrorCode, BatchError} from "../../../../src/sync/range/batch.js"; diff --git a/packages/lodestar/test/unit/sync/range/chain.test.ts b/packages/beacon-node/test/unit/sync/range/chain.test.ts similarity index 94% rename from packages/lodestar/test/unit/sync/range/chain.test.ts rename to packages/beacon-node/test/unit/sync/range/chain.test.ts index a82449e3384f..e9e4b1b4ddae 100644 --- a/packages/lodestar/test/unit/sync/range/chain.test.ts +++ b/packages/beacon-node/test/unit/sync/range/chain.test.ts @@ -1,7 +1,7 @@ -import {config} from "@chainsafe/lodestar-config/default"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {Epoch, phase0, Slot} from "@chainsafe/lodestar-types"; -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; +import {config} from "@lodestar/config/default"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {Epoch, phase0, Slot} from "@lodestar/types"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; import {linspace} from "../../../../src/util/numpy.js"; import {generateEmptyBlock, generateEmptySignedBlock} from "../../../utils/block.js"; import {SyncChain, SyncChainFns, ChainTarget} from "../../../../src/sync/range/chain.js"; diff --git a/packages/lodestar/test/unit/sync/range/utils/batches.test.ts b/packages/beacon-node/test/unit/sync/range/utils/batches.test.ts similarity index 98% rename from packages/lodestar/test/unit/sync/range/utils/batches.test.ts rename to packages/beacon-node/test/unit/sync/range/utils/batches.test.ts index 0902e9befdb4..a8f9e23b58f6 100644 --- a/packages/lodestar/test/unit/sync/range/utils/batches.test.ts +++ b/packages/beacon-node/test/unit/sync/range/utils/batches.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; -import {Epoch} from "@chainsafe/lodestar-types"; +import {config} from "@lodestar/config/default"; +import {Epoch} from "@lodestar/types"; import {getValidPeerId} from "../../../../utils/peer.js"; import {Batch, BatchOpts, BatchStatus} from "../../../../../src/sync/range/batch.js"; import { diff --git a/packages/lodestar/test/unit/sync/range/utils/peerBalancer.test.ts b/packages/beacon-node/test/unit/sync/range/utils/peerBalancer.test.ts similarity index 97% rename from packages/lodestar/test/unit/sync/range/utils/peerBalancer.test.ts rename to packages/beacon-node/test/unit/sync/range/utils/peerBalancer.test.ts index 9215e399a1cd..916309aa664a 100644 --- a/packages/lodestar/test/unit/sync/range/utils/peerBalancer.test.ts +++ b/packages/beacon-node/test/unit/sync/range/utils/peerBalancer.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; import PeerId from "peer-id"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import {Batch, BatchOpts} from "../../../../../src/sync/range/batch.js"; import {ChainPeersBalancer} from "../../../../../src/sync/range/utils/peerBalancer.js"; diff --git a/packages/lodestar/test/unit/sync/range/utils/updateChains.test.ts b/packages/beacon-node/test/unit/sync/range/utils/updateChains.test.ts similarity index 100% rename from packages/lodestar/test/unit/sync/range/utils/updateChains.test.ts rename to packages/beacon-node/test/unit/sync/range/utils/updateChains.test.ts diff --git a/packages/lodestar/test/unit/sync/unknownBlock.test.ts b/packages/beacon-node/test/unit/sync/unknownBlock.test.ts similarity index 94% rename from packages/lodestar/test/unit/sync/unknownBlock.test.ts rename to packages/beacon-node/test/unit/sync/unknownBlock.test.ts index 8e156a35f281..218e8f97d4c6 100644 --- a/packages/lodestar/test/unit/sync/unknownBlock.test.ts +++ b/packages/beacon-node/test/unit/sync/unknownBlock.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; -import {IForkChoice, ProtoBlock} from "@chainsafe/lodestar-fork-choice"; -import {ssz} from "@chainsafe/lodestar-types"; -import {notNullish, sleep} from "@chainsafe/lodestar-utils"; +import {config} from "@lodestar/config/default"; +import {IForkChoice, ProtoBlock} from "@lodestar/fork-choice"; +import {ssz} from "@lodestar/types"; +import {notNullish, sleep} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; import {IBeaconChain} from "../../../src/chain/index.js"; import {INetwork, IReqResp, NetworkEvent, NetworkEventBus, PeerAction} from "../../../src/network/index.js"; diff --git a/packages/lodestar/test/unit/sync/utils/pendingBlocksTree.test.ts b/packages/beacon-node/test/unit/sync/utils/pendingBlocksTree.test.ts similarity index 98% rename from packages/lodestar/test/unit/sync/utils/pendingBlocksTree.test.ts rename to packages/beacon-node/test/unit/sync/utils/pendingBlocksTree.test.ts index 99f7043f20bd..99cb5f802954 100644 --- a/packages/lodestar/test/unit/sync/utils/pendingBlocksTree.test.ts +++ b/packages/beacon-node/test/unit/sync/utils/pendingBlocksTree.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {RootHex} from "@chainsafe/lodestar-types"; +import {RootHex} from "@lodestar/types"; import {PendingBlock, PendingBlockStatus} from "../../../../src/sync/index.js"; import { getAllDescendantBlocks, diff --git a/packages/lodestar/test/unit/sync/utils/remoteSyncType.test.ts b/packages/beacon-node/test/unit/sync/utils/remoteSyncType.test.ts similarity index 97% rename from packages/lodestar/test/unit/sync/utils/remoteSyncType.test.ts rename to packages/beacon-node/test/unit/sync/utils/remoteSyncType.test.ts index beaa6644a520..2cdc351c4da5 100644 --- a/packages/lodestar/test/unit/sync/utils/remoteSyncType.test.ts +++ b/packages/beacon-node/test/unit/sync/utils/remoteSyncType.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {IForkChoice} from "@chainsafe/lodestar-fork-choice"; -import {Root, phase0} from "@chainsafe/lodestar-types"; +import {IForkChoice} from "@lodestar/fork-choice"; +import {Root, phase0} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; import {ZERO_HASH} from "../../../../src/constants/index.js"; import { diff --git a/packages/lodestar/test/unit/util/address.test.ts b/packages/beacon-node/test/unit/util/address.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/address.test.ts rename to packages/beacon-node/test/unit/util/address.test.ts diff --git a/packages/lodestar/test/unit/util/array.test.ts b/packages/beacon-node/test/unit/util/array.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/array.test.ts rename to packages/beacon-node/test/unit/util/array.test.ts diff --git a/packages/lodestar/test/unit/util/binarySearch.test.ts b/packages/beacon-node/test/unit/util/binarySearch.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/binarySearch.test.ts rename to packages/beacon-node/test/unit/util/binarySearch.test.ts diff --git a/packages/lodestar/test/unit/util/bitArray.test.ts b/packages/beacon-node/test/unit/util/bitArray.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/bitArray.test.ts rename to packages/beacon-node/test/unit/util/bitArray.test.ts diff --git a/packages/lodestar/test/unit/util/bytes.test.ts b/packages/beacon-node/test/unit/util/bytes.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/bytes.test.ts rename to packages/beacon-node/test/unit/util/bytes.test.ts diff --git a/packages/lodestar/test/unit/util/chunkify.test.ts b/packages/beacon-node/test/unit/util/chunkify.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/chunkify.test.ts rename to packages/beacon-node/test/unit/util/chunkify.test.ts diff --git a/packages/lodestar/test/unit/util/file.test.ts b/packages/beacon-node/test/unit/util/file.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/file.test.ts rename to packages/beacon-node/test/unit/util/file.test.ts diff --git a/packages/lodestar/test/unit/util/graffiti.test.ts b/packages/beacon-node/test/unit/util/graffiti.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/graffiti.test.ts rename to packages/beacon-node/test/unit/util/graffiti.test.ts diff --git a/packages/lodestar/test/unit/util/itTrigger.test.ts b/packages/beacon-node/test/unit/util/itTrigger.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/itTrigger.test.ts rename to packages/beacon-node/test/unit/util/itTrigger.test.ts diff --git a/packages/lodestar/test/unit/util/peerId.test.ts b/packages/beacon-node/test/unit/util/peerId.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/peerId.test.ts rename to packages/beacon-node/test/unit/util/peerId.test.ts diff --git a/packages/lodestar/test/unit/util/peerMap.test.ts b/packages/beacon-node/test/unit/util/peerMap.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/peerMap.test.ts rename to packages/beacon-node/test/unit/util/peerMap.test.ts diff --git a/packages/lodestar/test/unit/util/queue.test.ts b/packages/beacon-node/test/unit/util/queue.test.ts similarity index 98% rename from packages/lodestar/test/unit/util/queue.test.ts rename to packages/beacon-node/test/unit/util/queue.test.ts index ef425513a8be..6bb6698238e8 100644 --- a/packages/lodestar/test/unit/util/queue.test.ts +++ b/packages/beacon-node/test/unit/util/queue.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {sleep} from "@chainsafe/lodestar-utils"; +import {sleep} from "@lodestar/utils"; import {JobFnQueue, QueueError, QueueErrorCode, QueueType} from "../../../src/util/queue/index.js"; import {expectLodestarError, expectRejectedWithLodestarError} from "../../utils/errors.js"; diff --git a/packages/lodestar/test/unit/util/shuffle.test.ts b/packages/beacon-node/test/unit/util/shuffle.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/shuffle.test.ts rename to packages/beacon-node/test/unit/util/shuffle.test.ts diff --git a/packages/lodestar/test/unit/util/sortBy.test.ts b/packages/beacon-node/test/unit/util/sortBy.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/sortBy.test.ts rename to packages/beacon-node/test/unit/util/sortBy.test.ts diff --git a/packages/lodestar/test/unit/util/time.test.ts b/packages/beacon-node/test/unit/util/time.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/time.test.ts rename to packages/beacon-node/test/unit/util/time.test.ts diff --git a/packages/lodestar/test/unit/util/timeSeries.test.ts b/packages/beacon-node/test/unit/util/timeSeries.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/timeSeries.test.ts rename to packages/beacon-node/test/unit/util/timeSeries.test.ts diff --git a/packages/lodestar/test/unit/util/wrapError.test.ts b/packages/beacon-node/test/unit/util/wrapError.test.ts similarity index 100% rename from packages/lodestar/test/unit/util/wrapError.test.ts rename to packages/beacon-node/test/unit/util/wrapError.test.ts diff --git a/packages/lodestar/test/utils/aggregateAndProof.ts b/packages/beacon-node/test/utils/aggregateAndProof.ts similarity index 82% rename from packages/lodestar/test/utils/aggregateAndProof.ts rename to packages/beacon-node/test/utils/aggregateAndProof.ts index 8da8640a60e0..32d17fd04d31 100644 --- a/packages/lodestar/test/utils/aggregateAndProof.ts +++ b/packages/beacon-node/test/utils/aggregateAndProof.ts @@ -1,7 +1,7 @@ import deepmerge from "deepmerge"; -import {phase0} from "@chainsafe/lodestar-types"; -import {isPlainObject} from "@chainsafe/lodestar-utils"; -import {RecursivePartial} from "@chainsafe/lodestar-utils"; +import {phase0} from "@lodestar/types"; +import {isPlainObject} from "@lodestar/utils"; +import {RecursivePartial} from "@lodestar/utils"; import {EMPTY_SIGNATURE} from "../../src/constants/index.js"; import {generateEmptyAttestation} from "./attestation.js"; diff --git a/packages/lodestar/test/utils/attestation.ts b/packages/beacon-node/test/utils/attestation.ts similarity index 91% rename from packages/lodestar/test/utils/attestation.ts rename to packages/beacon-node/test/utils/attestation.ts index 17cb3c31f449..87193a2f28c5 100644 --- a/packages/lodestar/test/utils/attestation.ts +++ b/packages/beacon-node/test/utils/attestation.ts @@ -1,8 +1,8 @@ import crypto from "node:crypto"; import deepmerge from "deepmerge"; -import {CommitteeIndex, Epoch, Slot, phase0} from "@chainsafe/lodestar-types"; -import {isPlainObject} from "@chainsafe/lodestar-utils"; -import {RecursivePartial} from "@chainsafe/lodestar-utils"; +import {CommitteeIndex, Epoch, Slot, phase0} from "@lodestar/types"; +import {isPlainObject} from "@lodestar/utils"; +import {RecursivePartial} from "@lodestar/utils"; import {BitArray} from "@chainsafe/ssz"; /** diff --git a/packages/lodestar/test/utils/block.ts b/packages/beacon-node/test/utils/block.ts similarity index 87% rename from packages/lodestar/test/utils/block.ts rename to packages/beacon-node/test/utils/block.ts index 9134a1731f34..d1dbd3787542 100644 --- a/packages/lodestar/test/utils/block.ts +++ b/packages/beacon-node/test/utils/block.ts @@ -1,11 +1,11 @@ import deepmerge from "deepmerge"; -import {ssz} from "@chainsafe/lodestar-types"; -import {config as defaultConfig} from "@chainsafe/lodestar-config/default"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {allForks, phase0} from "@chainsafe/lodestar-types"; -import {ProtoBlock, ExecutionStatus} from "@chainsafe/lodestar-fork-choice"; -import {isPlainObject} from "@chainsafe/lodestar-utils"; -import {RecursivePartial} from "@chainsafe/lodestar-utils"; +import {ssz} from "@lodestar/types"; +import {config as defaultConfig} from "@lodestar/config/default"; +import {IChainForkConfig} from "@lodestar/config"; +import {allForks, phase0} from "@lodestar/types"; +import {ProtoBlock, ExecutionStatus} from "@lodestar/fork-choice"; +import {isPlainObject} from "@lodestar/utils"; +import {RecursivePartial} from "@lodestar/utils"; import {EMPTY_SIGNATURE, ZERO_HASH} from "../../src/constants/index.js"; import {ReqRespBlockResponse} from "../../src/network/reqresp/types.js"; diff --git a/packages/lodestar/test/utils/cache.ts b/packages/beacon-node/test/utils/cache.ts similarity index 100% rename from packages/lodestar/test/utils/cache.ts rename to packages/beacon-node/test/utils/cache.ts diff --git a/packages/lodestar/test/utils/cachedBeaconState.ts b/packages/beacon-node/test/utils/cachedBeaconState.ts similarity index 76% rename from packages/lodestar/test/utils/cachedBeaconState.ts rename to packages/beacon-node/test/utils/cachedBeaconState.ts index 7cac0c6b5c86..c001f1fd4f0d 100644 --- a/packages/lodestar/test/utils/cachedBeaconState.ts +++ b/packages/beacon-node/test/utils/cachedBeaconState.ts @@ -3,8 +3,8 @@ import { BeaconStateCache, createCachedBeaconState, createEmptyEpochContextImmutableData, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +} from "@lodestar/state-transition"; +import {IChainForkConfig} from "@lodestar/config"; export function createCachedBeaconStateTest( state: T, diff --git a/packages/lodestar/test/utils/clock.ts b/packages/beacon-node/test/utils/clock.ts similarity index 85% rename from packages/lodestar/test/utils/clock.ts rename to packages/beacon-node/test/utils/clock.ts index 5b65d4753c44..09dff41f45b1 100644 --- a/packages/lodestar/test/utils/clock.ts +++ b/packages/beacon-node/test/utils/clock.ts @@ -1,5 +1,5 @@ -import {computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {Slot, Epoch} from "@chainsafe/lodestar-types"; +import {computeEpochAtSlot} from "@lodestar/state-transition"; +import {Slot, Epoch} from "@lodestar/types"; import {IBeaconClock} from "../../src/chain/clock/index.js"; export class ClockStatic implements IBeaconClock { diff --git a/packages/lodestar/test/utils/config.ts b/packages/beacon-node/test/utils/config.ts similarity index 57% rename from packages/lodestar/test/utils/config.ts rename to packages/beacon-node/test/utils/config.ts index 372788a96d7d..9fd0797c47de 100644 --- a/packages/lodestar/test/utils/config.ts +++ b/packages/beacon-node/test/utils/config.ts @@ -1,5 +1,5 @@ -import {config as chainConfig} from "@chainsafe/lodestar-config/default"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; +import {config as chainConfig} from "@lodestar/config/default"; +import {createIBeaconConfig} from "@lodestar/config"; import {ZERO_HASH} from "../../src/constants/index.js"; /** default config with ZERO_HASH as genesisValidatorsRoot */ diff --git a/packages/lodestar/test/utils/contributionAndProof.ts b/packages/beacon-node/test/utils/contributionAndProof.ts similarity index 82% rename from packages/lodestar/test/utils/contributionAndProof.ts rename to packages/beacon-node/test/utils/contributionAndProof.ts index b5e0ef64a1e0..438810b87eba 100644 --- a/packages/lodestar/test/utils/contributionAndProof.ts +++ b/packages/beacon-node/test/utils/contributionAndProof.ts @@ -1,8 +1,8 @@ import deepmerge from "deepmerge"; -import {EMPTY_SIGNATURE} from "@chainsafe/lodestar-beacon-state-transition"; -import {SYNC_COMMITTEE_SUBNET_SIZE} from "@chainsafe/lodestar-params"; -import {altair} from "@chainsafe/lodestar-types"; -import {isPlainObject, RecursivePartial} from "@chainsafe/lodestar-utils"; +import {EMPTY_SIGNATURE} from "@lodestar/state-transition"; +import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; +import {altair} from "@lodestar/types"; +import {isPlainObject, RecursivePartial} from "@lodestar/utils"; import {BitArray, fromHexString} from "@chainsafe/ssz"; export function generateEmptyContribution(): altair.SyncCommitteeContribution { diff --git a/packages/lodestar/test/utils/db.ts b/packages/beacon-node/test/utils/db.ts similarity index 89% rename from packages/lodestar/test/utils/db.ts rename to packages/beacon-node/test/utils/db.ts index 3e90dbd05f7c..c45e278936ce 100644 --- a/packages/lodestar/test/utils/db.ts +++ b/packages/beacon-node/test/utils/db.ts @@ -1,4 +1,4 @@ -import {IFilterOptions} from "@chainsafe/lodestar-db"; +import {IFilterOptions} from "@lodestar/db"; /** * Helper to filter an array with DB IFilterOptions options diff --git a/packages/lodestar/test/utils/deposit.ts b/packages/beacon-node/test/utils/deposit.ts similarity index 93% rename from packages/lodestar/test/utils/deposit.ts rename to packages/beacon-node/test/utils/deposit.ts index 8c89f8d9b4f2..c03f05317ee5 100644 --- a/packages/lodestar/test/utils/deposit.ts +++ b/packages/beacon-node/test/utils/deposit.ts @@ -1,4 +1,4 @@ -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {DEPOSIT_CONTRACT_TREE_DEPTH, EMPTY_SIGNATURE} from "../../src/constants/index.js"; /** diff --git a/packages/lodestar/test/utils/errors.ts b/packages/beacon-node/test/utils/errors.ts similarity index 97% rename from packages/lodestar/test/utils/errors.ts rename to packages/beacon-node/test/utils/errors.ts index 1cff5e683036..b33978058fa8 100644 --- a/packages/lodestar/test/utils/errors.ts +++ b/packages/beacon-node/test/utils/errors.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {LodestarError, mapValues} from "@chainsafe/lodestar-utils"; +import {LodestarError, mapValues} from "@lodestar/utils"; export function expectThrowsLodestarError(fn: () => void, expectedErr: LodestarError | string): void { try { diff --git a/packages/beacon-state-transition/test/utils/eth1Data.ts b/packages/beacon-node/test/utils/eth1Data.ts similarity index 82% rename from packages/beacon-state-transition/test/utils/eth1Data.ts rename to packages/beacon-node/test/utils/eth1Data.ts index 1790c06dffb7..1aa4eac8e4e4 100644 --- a/packages/beacon-state-transition/test/utils/eth1Data.ts +++ b/packages/beacon-node/test/utils/eth1Data.ts @@ -1,4 +1,4 @@ -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {ZERO_HASH} from "../../src/constants/index.js"; export function generateEth1Data(blockHash = ZERO_HASH, depositCount = 0, depositRoot = ZERO_HASH): phase0.Eth1Data { diff --git a/packages/lodestar/test/utils/events/resolver.ts b/packages/beacon-node/test/utils/events/resolver.ts similarity index 89% rename from packages/lodestar/test/utils/events/resolver.ts rename to packages/beacon-node/test/utils/events/resolver.ts index 055a49b4f682..64617fc98369 100644 --- a/packages/lodestar/test/utils/events/resolver.ts +++ b/packages/beacon-node/test/utils/events/resolver.ts @@ -1,5 +1,5 @@ import {EventEmitter} from "events"; -import {TimeoutError} from "@chainsafe/lodestar-utils"; +import {TimeoutError} from "@lodestar/utils"; export function waitForEvent( emitter: EventEmitter, diff --git a/packages/lodestar/test/utils/interator.ts b/packages/beacon-node/test/utils/interator.ts similarity index 100% rename from packages/lodestar/test/utils/interator.ts rename to packages/beacon-node/test/utils/interator.ts diff --git a/packages/lodestar/test/utils/logger.ts b/packages/beacon-node/test/utils/logger.ts similarity index 95% rename from packages/lodestar/test/utils/logger.ts rename to packages/beacon-node/test/utils/logger.ts index ad30906e4987..4e0b17d2c998 100644 --- a/packages/lodestar/test/utils/logger.ts +++ b/packages/beacon-node/test/utils/logger.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */ -import {WinstonLogger, LogLevel, TransportType, TransportOpts, TimestampFormat} from "@chainsafe/lodestar-utils"; +import {WinstonLogger, LogLevel, TransportType, TransportOpts, TimestampFormat} from "@lodestar/utils"; export {LogLevel}; export type TestLoggerOpts = { diff --git a/packages/lodestar/test/utils/map.ts b/packages/beacon-node/test/utils/map.ts similarity index 100% rename from packages/lodestar/test/utils/map.ts rename to packages/beacon-node/test/utils/map.ts diff --git a/packages/lodestar/test/utils/misc.ts b/packages/beacon-node/test/utils/misc.ts similarity index 100% rename from packages/lodestar/test/utils/misc.ts rename to packages/beacon-node/test/utils/misc.ts diff --git a/packages/lodestar/test/utils/mocks/bls.ts b/packages/beacon-node/test/utils/mocks/bls.ts similarity index 100% rename from packages/lodestar/test/utils/mocks/bls.ts rename to packages/beacon-node/test/utils/mocks/bls.ts diff --git a/packages/lodestar/test/utils/mocks/chain/chain.ts b/packages/beacon-node/test/utils/mocks/chain/chain.ts similarity index 95% rename from packages/lodestar/test/utils/mocks/chain/chain.ts rename to packages/beacon-node/test/utils/mocks/chain/chain.ts index a5905281524b..654068c9ed53 100644 --- a/packages/lodestar/test/utils/mocks/chain/chain.ts +++ b/packages/beacon-node/test/utils/mocks/chain/chain.ts @@ -1,11 +1,11 @@ import sinon from "sinon"; import {CompositeTypeAny, toHexString, TreeView} from "@chainsafe/ssz"; -import {phase0, allForks, UintNum64, Root, Slot, ssz, Uint16, UintBn64} from "@chainsafe/lodestar-types"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {BeaconStateAllForks, CachedBeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {CheckpointWithHex, IForkChoice, ProtoBlock, ExecutionStatus} from "@chainsafe/lodestar-fork-choice"; -import {defaultOptions as defaultValidatorOptions} from "@chainsafe/lodestar-validator"; +import {phase0, allForks, UintNum64, Root, Slot, ssz, Uint16, UintBn64} from "@lodestar/types"; +import {IBeaconConfig} from "@lodestar/config"; +import {BeaconStateAllForks, CachedBeaconStateAllForks} from "@lodestar/state-transition"; +import {CheckpointWithHex, IForkChoice, ProtoBlock, ExecutionStatus} from "@lodestar/fork-choice"; +import {defaultOptions as defaultValidatorOptions} from "@lodestar/validator"; import {ChainEventEmitter, IBeaconChain} from "../../../../src/chain/index.js"; import {IBeaconClock} from "../../../../src/chain/clock/interface.js"; @@ -35,7 +35,7 @@ import {ExecutionEngineDisabled} from "../../../../src/execution/engine/index.js import {ReqRespBlockResponse} from "../../../../src/network/reqresp/types.js"; import {testLogger} from "../../logger.js"; import {ReprocessController} from "../../../../src/chain/reprocess.js"; -import {createCachedBeaconStateTest} from "../../../../../beacon-state-transition/test/utils/state.js"; +import {createCachedBeaconStateTest} from "../../../../../state-transition/test/utils/state.js"; import {SeenAggregatedAttestations} from "../../../../src/chain/seenCache/seenAggregateAndProof.js"; import {SeenBlockAttesters} from "../../../../src/chain/seenCache/seenBlockAttesters.js"; import {BeaconProposerCache} from "../../../../src/chain/beaconProposerCache.js"; diff --git a/packages/lodestar/test/utils/network.ts b/packages/beacon-node/test/utils/network.ts similarity index 98% rename from packages/lodestar/test/utils/network.ts rename to packages/beacon-node/test/utils/network.ts index e1d2e24b06cf..7eeea8e37275 100644 --- a/packages/lodestar/test/utils/network.ts +++ b/packages/beacon-node/test/utils/network.ts @@ -1,6 +1,6 @@ import PeerId from "peer-id"; import {Multiaddr} from "multiaddr"; -import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@chainsafe/lodestar-params"; +import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; import {BitArray} from "@chainsafe/ssz"; import {INetwork, Network} from "../../src/network/index.js"; import {NodejsNode} from "../../src/network/nodejs/index.js"; diff --git a/packages/lodestar/test/utils/node/beacon.ts b/packages/beacon-node/test/utils/node/beacon.ts similarity index 88% rename from packages/lodestar/test/utils/node/beacon.ts rename to packages/beacon-node/test/utils/node/beacon.ts index 491f6507b674..034450df93f5 100644 --- a/packages/lodestar/test/utils/node/beacon.ts +++ b/packages/beacon-node/test/utils/node/beacon.ts @@ -1,13 +1,13 @@ import deepmerge from "deepmerge"; import tmp from "tmp"; import PeerId from "peer-id"; -import {config as minimalConfig} from "@chainsafe/lodestar-config/default"; -import {createIBeaconConfig, createIChainForkConfig, IChainConfig} from "@chainsafe/lodestar-config"; -import {ILogger, RecursivePartial} from "@chainsafe/lodestar-utils"; -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {phase0} from "@chainsafe/lodestar-types"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {isPlainObject} from "@chainsafe/lodestar-utils"; +import {config as minimalConfig} from "@lodestar/config/default"; +import {createIBeaconConfig, createIChainForkConfig, IChainConfig} from "@lodestar/config"; +import {ILogger, RecursivePartial} from "@lodestar/utils"; +import {LevelDbController} from "@lodestar/db"; +import {phase0} from "@lodestar/types"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; +import {isPlainObject} from "@lodestar/utils"; import {BeaconNode} from "../../../src/index.js"; import {createEnr} from "../../../../cli/src/config/enr.js"; import {createNodeJsLibp2p} from "../../../src/network/nodejs/index.js"; diff --git a/packages/lodestar/test/utils/node/keymanager.ts b/packages/beacon-node/test/utils/node/keymanager.ts similarity index 100% rename from packages/lodestar/test/utils/node/keymanager.ts rename to packages/beacon-node/test/utils/node/keymanager.ts diff --git a/packages/lodestar/test/utils/node/simTest.ts b/packages/beacon-node/test/utils/node/simTest.ts similarity index 92% rename from packages/lodestar/test/utils/node/simTest.ts rename to packages/beacon-node/test/utils/node/simTest.ts index 6c4a37084e03..a85b780fd587 100644 --- a/packages/lodestar/test/utils/node/simTest.ts +++ b/packages/beacon-node/test/utils/node/simTest.ts @@ -3,13 +3,13 @@ import { computeStartSlotAtEpoch, CachedBeaconStateAllForks, beforeProcessEpoch, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {ProtoBlock} from "@chainsafe/lodestar-fork-choice"; -import {SLOTS_PER_EPOCH, SLOTS_PER_HISTORICAL_ROOT} from "@chainsafe/lodestar-params"; -import {allForks, Epoch, Slot} from "@chainsafe/lodestar-types"; -import {Checkpoint} from "@chainsafe/lodestar-types/phase0"; -import {ILogger, mapValues} from "@chainsafe/lodestar-utils"; +} from "@lodestar/state-transition"; +import {IBeaconConfig} from "@lodestar/config"; +import {ProtoBlock} from "@lodestar/fork-choice"; +import {SLOTS_PER_EPOCH, SLOTS_PER_HISTORICAL_ROOT} from "@lodestar/params"; +import {allForks, Epoch, Slot} from "@lodestar/types"; +import {Checkpoint} from "@lodestar/types/phase0"; +import {ILogger, mapValues} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; import {BeaconNode} from "../../../src/index.js"; import {ChainEvent} from "../../../src/chain/index.js"; diff --git a/packages/lodestar/test/utils/node/validator.ts b/packages/beacon-node/test/utils/node/validator.ts similarity index 94% rename from packages/lodestar/test/utils/node/validator.ts rename to packages/beacon-node/test/utils/node/validator.ts index 665e6e0787ea..a7e278477fd5 100644 --- a/packages/lodestar/test/utils/node/validator.ts +++ b/packages/beacon-node/test/utils/node/validator.ts @@ -1,7 +1,7 @@ import tmp from "tmp"; -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {interopSecretKey} from "@chainsafe/lodestar-beacon-state-transition"; -import {SlashingProtection, Validator, Signer, SignerType} from "@chainsafe/lodestar-validator"; +import {LevelDbController} from "@lodestar/db"; +import {interopSecretKey} from "@lodestar/state-transition"; +import {SlashingProtection, Validator, Signer, SignerType} from "@lodestar/validator"; import type {SecretKey} from "@chainsafe/bls/types"; import {BeaconNode} from "../../../src/index.js"; import {testLogger, TestLoggerOpts} from "../logger.js"; diff --git a/packages/lodestar/test/utils/peer.ts b/packages/beacon-node/test/utils/peer.ts similarity index 100% rename from packages/lodestar/test/utils/peer.ts rename to packages/beacon-node/test/utils/peer.ts diff --git a/packages/lodestar/test/utils/render.ts b/packages/beacon-node/test/utils/render.ts similarity index 100% rename from packages/lodestar/test/utils/render.ts rename to packages/beacon-node/test/utils/render.ts diff --git a/packages/beacon-state-transition/test/utils/rpcCall.ts b/packages/beacon-node/test/utils/rpcCall.ts similarity index 100% rename from packages/beacon-state-transition/test/utils/rpcCall.ts rename to packages/beacon-node/test/utils/rpcCall.ts diff --git a/packages/lodestar/test/utils/sinon/matcher.ts b/packages/beacon-node/test/utils/sinon/matcher.ts similarity index 100% rename from packages/lodestar/test/utils/sinon/matcher.ts rename to packages/beacon-node/test/utils/sinon/matcher.ts diff --git a/packages/lodestar/test/utils/sleep.ts b/packages/beacon-node/test/utils/sleep.ts similarity index 100% rename from packages/lodestar/test/utils/sleep.ts rename to packages/beacon-node/test/utils/sleep.ts diff --git a/packages/lodestar/test/utils/ssz.ts b/packages/beacon-node/test/utils/ssz.ts similarity index 100% rename from packages/lodestar/test/utils/ssz.ts rename to packages/beacon-node/test/utils/ssz.ts diff --git a/packages/lodestar/test/utils/state.ts b/packages/beacon-node/test/utils/state.ts similarity index 93% rename from packages/lodestar/test/utils/state.ts rename to packages/beacon-node/test/utils/state.ts index 96f038a41fbe..209383417c32 100644 --- a/packages/lodestar/test/utils/state.ts +++ b/packages/beacon-node/test/utils/state.ts @@ -1,13 +1,15 @@ -import {config as minimalConfig} from "@chainsafe/lodestar-config/default"; +import {config as minimalConfig} from "@lodestar/config/default"; import { BeaconStateAllForks, CachedBeaconStateAllForks, createCachedBeaconState, PubkeyIndexMap, -} from "@chainsafe/lodestar-beacon-state-transition"; + CachedBeaconStateBellatrix, + BeaconStateBellatrix, +} from "@lodestar/state-transition"; import {BitArray} from "@chainsafe/ssz"; -import {phase0, allForks, altair, ssz} from "@chainsafe/lodestar-types"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; +import {phase0, allForks, altair, ssz} from "@lodestar/types"; +import {createIBeaconConfig} from "@lodestar/config"; import { EPOCHS_PER_HISTORICAL_VECTOR, EPOCHS_PER_SLASHINGS_VECTOR, @@ -16,11 +18,9 @@ import { MAX_EFFECTIVE_BALANCE, SLOTS_PER_HISTORICAL_ROOT, SYNC_COMMITTEE_SIZE, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import bls from "@chainsafe/bls"; -import {CachedBeaconStateBellatrix} from "@chainsafe/lodestar-beacon-state-transition"; -import {BeaconStateBellatrix} from "@chainsafe/lodestar-beacon-state-transition"; import {GENESIS_EPOCH, GENESIS_SLOT, ZERO_HASH} from "../../src/constants/index.js"; import {generateEmptyBlock} from "./block.js"; import {generateValidator, generateValidators} from "./validator.js"; diff --git a/packages/lodestar/test/utils/stub/beaconDb.ts b/packages/beacon-node/test/utils/stub/beaconDb.ts similarity index 94% rename from packages/lodestar/test/utils/stub/beaconDb.ts rename to packages/beacon-node/test/utils/stub/beaconDb.ts index 30840d039859..47ad1dac21c7 100644 --- a/packages/lodestar/test/utils/stub/beaconDb.ts +++ b/packages/beacon-node/test/utils/stub/beaconDb.ts @@ -1,7 +1,7 @@ import {SinonStubbedInstance} from "sinon"; -import {LevelDbController} from "@chainsafe/lodestar-db"; +import {LevelDbController} from "@lodestar/db"; -import {config as minimalConfig} from "@chainsafe/lodestar-config/default"; +import {config as minimalConfig} from "@lodestar/config/default"; import {BeaconDb} from "../../../src/db/index.js"; import { AttesterSlashingRepository, diff --git a/packages/lodestar/test/utils/stub/index.ts b/packages/beacon-node/test/utils/stub/index.ts similarity index 100% rename from packages/lodestar/test/utils/stub/index.ts rename to packages/beacon-node/test/utils/stub/index.ts diff --git a/packages/lodestar/test/utils/syncCommittee.ts b/packages/beacon-node/test/utils/syncCommittee.ts similarity index 78% rename from packages/lodestar/test/utils/syncCommittee.ts rename to packages/beacon-node/test/utils/syncCommittee.ts index 2a5be374d74c..98f865a92b86 100644 --- a/packages/lodestar/test/utils/syncCommittee.ts +++ b/packages/beacon-node/test/utils/syncCommittee.ts @@ -1,6 +1,6 @@ import deepmerge from "deepmerge"; -import {altair} from "@chainsafe/lodestar-types"; -import {isPlainObject, RecursivePartial} from "@chainsafe/lodestar-utils"; +import {altair} from "@lodestar/types"; +import {isPlainObject, RecursivePartial} from "@lodestar/utils"; export function generateSyncCommitteeSignature( override: RecursivePartial diff --git a/packages/lodestar/test/utils/testnet.ts b/packages/beacon-node/test/utils/testnet.ts similarity index 93% rename from packages/lodestar/test/utils/testnet.ts rename to packages/beacon-node/test/utils/testnet.ts index 7eb4a59dedb8..653e3396a077 100644 --- a/packages/lodestar/test/utils/testnet.ts +++ b/packages/beacon-node/test/utils/testnet.ts @@ -1,6 +1,6 @@ -import {phase0} from "@chainsafe/lodestar-types"; -import {createIChainForkConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; -import {chainConfig} from "@chainsafe/lodestar-config/default"; +import {phase0} from "@lodestar/types"; +import {createIChainForkConfig, IChainForkConfig} from "@lodestar/config"; +import {chainConfig} from "@lodestar/config/default"; import {fromHexString} from "@chainsafe/ssz"; /** Generic testnet data taken from the Medalla testnet */ diff --git a/packages/lodestar/test/utils/types.ts b/packages/beacon-node/test/utils/types.ts similarity index 100% rename from packages/lodestar/test/utils/types.ts rename to packages/beacon-node/test/utils/types.ts diff --git a/packages/lodestar/test/utils/validationData/aggregateAndProof.ts b/packages/beacon-node/test/utils/validationData/aggregateAndProof.ts similarity index 87% rename from packages/lodestar/test/utils/validationData/aggregateAndProof.ts rename to packages/beacon-node/test/utils/validationData/aggregateAndProof.ts index 78b6abad11bf..6b7d627d9190 100644 --- a/packages/lodestar/test/utils/validationData/aggregateAndProof.ts +++ b/packages/beacon-node/test/utils/validationData/aggregateAndProof.ts @@ -1,8 +1,8 @@ -import {computeSigningRoot} from "@chainsafe/lodestar-beacon-state-transition"; -import {DOMAIN_AGGREGATE_AND_PROOF, DOMAIN_SELECTION_PROOF} from "@chainsafe/lodestar-params"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {computeSigningRoot} from "@lodestar/state-transition"; +import {DOMAIN_AGGREGATE_AND_PROOF, DOMAIN_SELECTION_PROOF} from "@lodestar/params"; +import {phase0, ssz} from "@lodestar/types"; import {IBeaconChain} from "../../../src/chain/index.js"; -import {getSecretKeyFromIndexCached} from "../../../../beacon-state-transition/test/perf/util.js"; +import {getSecretKeyFromIndexCached} from "../../../../state-transition/test/perf/util.js"; import {SeenAggregators} from "../../../src/chain/seenCache/index.js"; import {signCached} from "../cache.js"; import {getAttestationValidData, AttestationValidDataOpts} from "./attestation.js"; diff --git a/packages/lodestar/test/utils/validationData/attestation.ts b/packages/beacon-node/test/utils/validationData/attestation.ts similarity index 87% rename from packages/lodestar/test/utils/validationData/attestation.ts rename to packages/beacon-node/test/utils/validationData/attestation.ts index f3738372f030..6e775b81d214 100644 --- a/packages/lodestar/test/utils/validationData/attestation.ts +++ b/packages/beacon-node/test/utils/validationData/attestation.ts @@ -1,21 +1,17 @@ -import { - computeEpochAtSlot, - computeSigningRoot, - computeStartSlotAtEpoch, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {ProtoBlock, IForkChoice, ExecutionStatus} from "@chainsafe/lodestar-fork-choice"; -import {DOMAIN_BEACON_ATTESTER} from "@chainsafe/lodestar-params"; -import {phase0, Slot, ssz} from "@chainsafe/lodestar-types"; +import {computeEpochAtSlot, computeSigningRoot, computeStartSlotAtEpoch} from "@lodestar/state-transition"; +import {ProtoBlock, IForkChoice, ExecutionStatus} from "@lodestar/fork-choice"; +import {DOMAIN_BEACON_ATTESTER} from "@lodestar/params"; +import {phase0, Slot, ssz} from "@lodestar/types"; import {BitArray, toHexString} from "@chainsafe/ssz"; -import {config} from "@chainsafe/lodestar-config/default"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +import {config} from "@lodestar/config/default"; +import {IBeaconConfig} from "@lodestar/config"; import {IBeaconChain} from "../../../src/chain/index.js"; import {IStateRegenerator} from "../../../src/chain/regen/index.js"; import {ZERO_HASH, ZERO_HASH_HEX} from "../../../src/constants/index.js"; import { generateTestCachedBeaconStateOnlyValidators, getSecretKeyFromIndexCached, -} from "../../../../beacon-state-transition/test/perf/util.js"; +} from "../../../../state-transition/test/perf/util.js"; import {SeenAttesters} from "../../../src/chain/seenCache/index.js"; import {BlsSingleThreadVerifier} from "../../../src/chain/bls/index.js"; import {signCached} from "../cache.js"; diff --git a/packages/lodestar/test/utils/validator.ts b/packages/beacon-node/test/utils/validator.ts similarity index 96% rename from packages/lodestar/test/utils/validator.ts rename to packages/beacon-node/test/utils/validator.ts index e9c59589cbfe..b5b43805e72b 100644 --- a/packages/lodestar/test/utils/validator.ts +++ b/packages/beacon-node/test/utils/validator.ts @@ -1,5 +1,5 @@ import {fromHexString} from "@chainsafe/ssz"; -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {FAR_FUTURE_EPOCH} from "../../src/constants/index.js"; /** diff --git a/packages/beacon-state-transition/test/utils/voluntaryExits.ts b/packages/beacon-node/test/utils/voluntaryExits.ts similarity index 85% rename from packages/beacon-state-transition/test/utils/voluntaryExits.ts rename to packages/beacon-node/test/utils/voluntaryExits.ts index 6c9a5a109fa8..dbb5d597f20f 100644 --- a/packages/beacon-state-transition/test/utils/voluntaryExits.ts +++ b/packages/beacon-node/test/utils/voluntaryExits.ts @@ -1,4 +1,4 @@ -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; export function generateEmptyVoluntaryExit(): phase0.VoluntaryExit { return { diff --git a/packages/lodestar/tsconfig.build.json b/packages/beacon-node/tsconfig.build.json similarity index 100% rename from packages/lodestar/tsconfig.build.json rename to packages/beacon-node/tsconfig.build.json diff --git a/packages/lodestar/tsconfig.json b/packages/beacon-node/tsconfig.json similarity index 100% rename from packages/lodestar/tsconfig.json rename to packages/beacon-node/tsconfig.json diff --git a/packages/cli/package.json b/packages/cli/package.json index 48350c9413a5..0acf6cf409dd 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { - "name": "@chainsafe/lodestar-cli", + "name": "@chainsafe/lodestar", "version": "0.39.0", - "description": "Command line interface for other packages", + "description": "Command line interface for lodestar", "author": "ChainSafe Systems", "license": "LGPL-3.0", "bugs": { @@ -56,16 +56,16 @@ "@chainsafe/bls-keystore": "^2.0.0", "@chainsafe/blst": "^0.2.4", "@chainsafe/discv5": "^0.7.1", - "@chainsafe/lodestar": "^0.39.0", - "@chainsafe/lodestar-api": "^0.39.0", - "@chainsafe/lodestar-beacon-state-transition": "^0.39.0", - "@chainsafe/lodestar-config": "^0.39.0", - "@chainsafe/lodestar-db": "^0.39.0", - "@chainsafe/lodestar-light-client": "^0.39.0", - "@chainsafe/lodestar-params": "^0.39.0", - "@chainsafe/lodestar-types": "^0.39.0", - "@chainsafe/lodestar-utils": "^0.39.0", - "@chainsafe/lodestar-validator": "^0.39.0", + "@lodestar/api": "^0.39.0", + "@lodestar/beacon-node": "^0.39.0", + "@lodestar/state-transition": "^0.39.0", + "@lodestar/config": "^0.39.0", + "@lodestar/db": "^0.39.0", + "@lodestar/light-client": "^0.39.0", + "@lodestar/params": "^0.39.0", + "@lodestar/types": "^0.39.0", + "@lodestar/utils": "^0.39.0", + "@lodestar/validator": "^0.39.0", "@chainsafe/ssz": "^0.9.2", "@types/lockfile": "^1.0.1", "bip39": "^3.0.2", diff --git a/packages/cli/src/cmds/beacon/handler.ts b/packages/cli/src/cmds/beacon/handler.ts index 0580772b2047..ede340dfcb10 100644 --- a/packages/cli/src/cmds/beacon/handler.ts +++ b/packages/cli/src/cmds/beacon/handler.ts @@ -1,9 +1,9 @@ import {Registry} from "prom-client"; -import {ErrorAborted} from "@chainsafe/lodestar-utils"; -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {BeaconNode, BeaconDb, createNodeJsLibp2p} from "@chainsafe/lodestar"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {ACTIVE_PRESET, PresetName} from "@chainsafe/lodestar-params"; +import {ErrorAborted} from "@lodestar/utils"; +import {LevelDbController} from "@lodestar/db"; +import {BeaconNode, BeaconDb, createNodeJsLibp2p} from "@lodestar/beacon-node"; +import {createIBeaconConfig} from "@lodestar/config"; +import {ACTIVE_PRESET, PresetName} from "@lodestar/params"; import {IGlobalArgs} from "../../options/index.js"; import {parseEnrArgs} from "../../options/enrOptions.js"; import {onGracefulShutdown, getCliLogger} from "../../util/index.js"; diff --git a/packages/cli/src/cmds/beacon/initBeaconState.ts b/packages/cli/src/cmds/beacon/initBeaconState.ts index 644e4b3699f2..a8aa845fbf08 100644 --- a/packages/cli/src/cmds/beacon/initBeaconState.ts +++ b/packages/cli/src/cmds/beacon/initBeaconState.ts @@ -1,20 +1,20 @@ -import {ssz} from "@chainsafe/lodestar-types"; -import {createIBeaconConfig, IBeaconConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ssz} from "@lodestar/types"; +import {createIBeaconConfig, IBeaconConfig, IChainForkConfig} from "@lodestar/config"; +import {ILogger} from "@lodestar/utils"; import { computeEpochAtSlot, getLatestBlockRoot, isWithinWeakSubjectivityPeriod, BeaconStateAllForks, -} from "@chainsafe/lodestar-beacon-state-transition"; +} from "@lodestar/state-transition"; import { IBeaconDb, IBeaconNodeOptions, initStateFromAnchorState, initStateFromEth1, getStateTypeFromBytes, -} from "@chainsafe/lodestar"; -import {Checkpoint} from "@chainsafe/lodestar-types/phase0"; +} from "@lodestar/beacon-node"; +import {Checkpoint} from "@lodestar/types/phase0"; import {downloadOrLoadFile} from "../../util/index.js"; import {defaultNetwork, IGlobalArgs} from "../../options/globalOptions.js"; diff --git a/packages/cli/src/cmds/beacon/options.ts b/packages/cli/src/cmds/beacon/options.ts index 73b1b1111e1a..67ddfb81220f 100644 --- a/packages/cli/src/cmds/beacon/options.ts +++ b/packages/cli/src/cmds/beacon/options.ts @@ -1,5 +1,5 @@ import {Options} from "yargs"; -import {defaultLogLevel, LogLevels} from "@chainsafe/lodestar-utils"; +import {defaultLogLevel, LogLevels} from "@lodestar/utils"; import { beaconNodeOptions, paramsOptions, diff --git a/packages/cli/src/cmds/dev/handler.ts b/packages/cli/src/cmds/dev/handler.ts index e88c6e757dff..38c3b30687a2 100644 --- a/packages/cli/src/cmds/dev/handler.ts +++ b/packages/cli/src/cmds/dev/handler.ts @@ -3,13 +3,13 @@ import {promisify} from "node:util"; import path from "node:path"; import rimraf from "rimraf"; import {fromHexString} from "@chainsafe/ssz"; -import {GENESIS_SLOT} from "@chainsafe/lodestar-params"; -import {BeaconNode, BeaconDb, initStateFromAnchorState, createNodeJsLibp2p, nodeUtils} from "@chainsafe/lodestar"; -import {SlashingProtection, Validator, SignerType} from "@chainsafe/lodestar-validator"; -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {interopSecretKey} from "@chainsafe/lodestar-beacon-state-transition"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {ACTIVE_PRESET, PresetName} from "@chainsafe/lodestar-params"; +import {GENESIS_SLOT} from "@lodestar/params"; +import {BeaconNode, BeaconDb, initStateFromAnchorState, createNodeJsLibp2p, nodeUtils} from "@lodestar/beacon-node"; +import {SlashingProtection, Validator, SignerType} from "@lodestar/validator"; +import {LevelDbController} from "@lodestar/db"; +import {interopSecretKey} from "@lodestar/state-transition"; +import {createIBeaconConfig} from "@lodestar/config"; +import {ACTIVE_PRESET, PresetName} from "@lodestar/params"; import {onGracefulShutdown} from "../../util/process.js"; import {createEnr, createPeerId, overwriteEnrWithCliArgs} from "../../config/index.js"; import {IGlobalArgs, parseEnrArgs} from "../../options/index.js"; diff --git a/packages/cli/src/cmds/init/handler.ts b/packages/cli/src/cmds/init/handler.ts index 3a051a19d9a1..dd071edf3e10 100644 --- a/packages/cli/src/cmds/init/handler.ts +++ b/packages/cli/src/cmds/init/handler.ts @@ -1,5 +1,5 @@ import fs from "node:fs"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import { BeaconNodeOptions, getBeaconConfigFromArgs, diff --git a/packages/cli/src/cmds/lightclient/handler.ts b/packages/cli/src/cmds/lightclient/handler.ts index 42424bd2b9d9..d70cd1870d93 100644 --- a/packages/cli/src/cmds/lightclient/handler.ts +++ b/packages/cli/src/cmds/lightclient/handler.ts @@ -1,5 +1,5 @@ -import {getClient} from "@chainsafe/lodestar-api"; -import {Lightclient} from "@chainsafe/lodestar-light-client"; +import {getClient} from "@lodestar/api"; +import {Lightclient} from "@lodestar/light-client"; import {fromHexString} from "@chainsafe/ssz"; import {getBeaconConfigFromArgs} from "../../config/beaconParams.js"; import {IGlobalArgs} from "../../options/index.js"; diff --git a/packages/cli/src/cmds/validator/handler.ts b/packages/cli/src/cmds/validator/handler.ts index 6cd848686d38..3ec8df16a129 100644 --- a/packages/cli/src/cmds/validator/handler.ts +++ b/packages/cli/src/cmds/validator/handler.ts @@ -1,7 +1,7 @@ -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {ProcessShutdownCallback, SlashingProtection, Validator, defaultOptions} from "@chainsafe/lodestar-validator"; -import {getMetrics, MetricsRegister} from "@chainsafe/lodestar-validator"; -import {RegistryMetricCreator, collectNodeJSMetrics, HttpMetricsServer} from "@chainsafe/lodestar"; +import {LevelDbController} from "@lodestar/db"; +import {ProcessShutdownCallback, SlashingProtection, Validator, defaultOptions} from "@lodestar/validator"; +import {getMetrics, MetricsRegister} from "@lodestar/validator"; +import {RegistryMetricCreator, collectNodeJSMetrics, HttpMetricsServer} from "@lodestar/beacon-node"; import {getBeaconConfigFromArgs} from "../../config/index.js"; import {IGlobalArgs} from "../../options/index.js"; import {YargsError, getDefaultGraffiti, mkdir, getCliLogger} from "../../util/index.js"; diff --git a/packages/cli/src/cmds/validator/keymanager/impl.ts b/packages/cli/src/cmds/validator/keymanager/impl.ts index 24441ee78748..8ebf90b3c532 100644 --- a/packages/cli/src/cmds/validator/keymanager/impl.ts +++ b/packages/cli/src/cmds/validator/keymanager/impl.ts @@ -11,9 +11,9 @@ import { SlashingProtectionData, SignerDefinition, ImportRemoteKeyStatus, -} from "@chainsafe/lodestar-api/keymanager"; +} from "@lodestar/api/keymanager"; import {fromHexString} from "@chainsafe/ssz"; -import {Interchange, SignerType, Validator} from "@chainsafe/lodestar-validator"; +import {Interchange, SignerType, Validator} from "@lodestar/validator"; import {getPubkeyHexFromKeystore, isValidatePubkeyHex, isValidHttpUrl} from "../../../util/format.js"; import {IPersistedKeysBackend} from "./interface.js"; diff --git a/packages/cli/src/cmds/validator/keymanager/interface.ts b/packages/cli/src/cmds/validator/keymanager/interface.ts index ae4c1c864b17..cc4fc2c822af 100644 --- a/packages/cli/src/cmds/validator/keymanager/interface.ts +++ b/packages/cli/src/cmds/validator/keymanager/interface.ts @@ -1,4 +1,4 @@ -import {PubkeyHex, SignerDefinition} from "@chainsafe/lodestar-api/keymanager"; +import {PubkeyHex, SignerDefinition} from "@lodestar/api/keymanager"; export type LocalKeystoreDefinition = { keystorePath: string; diff --git a/packages/cli/src/cmds/validator/keymanager/persistedKeys.ts b/packages/cli/src/cmds/validator/keymanager/persistedKeys.ts index 41b410199821..ae7786880e48 100644 --- a/packages/cli/src/cmds/validator/keymanager/persistedKeys.ts +++ b/packages/cli/src/cmds/validator/keymanager/persistedKeys.ts @@ -2,8 +2,8 @@ import fs from "node:fs"; import path from "node:path"; import bls from "@chainsafe/bls"; import {Keystore} from "@chainsafe/bls-keystore"; -import {Signer, SignerType} from "@chainsafe/lodestar-validator"; -import {DeletionStatus, ImportStatus, PubkeyHex, SignerDefinition} from "@chainsafe/lodestar-api/keymanager"; +import {Signer, SignerType} from "@lodestar/validator"; +import {DeletionStatus, ImportStatus, PubkeyHex, SignerDefinition} from "@lodestar/api/keymanager"; import { getPubkeyHexFromKeystore, readPassphraseFile, diff --git a/packages/cli/src/cmds/validator/keymanager/server.ts b/packages/cli/src/cmds/validator/keymanager/server.ts index af9fcc8841cb..3e1bb8bdaeaf 100644 --- a/packages/cli/src/cmds/validator/keymanager/server.ts +++ b/packages/cli/src/cmds/validator/keymanager/server.ts @@ -1,11 +1,11 @@ import crypto from "node:crypto"; import fs from "node:fs"; import path from "node:path"; -import {RestApiServer, RestApiServerOpts, RestApiServerModules} from "@chainsafe/lodestar"; +import {RestApiServer, RestApiServerOpts, RestApiServerModules} from "@lodestar/beacon-node"; import {toHexString} from "@chainsafe/ssz"; -import {Api} from "@chainsafe/lodestar-api/keymanager"; -import {registerRoutes} from "@chainsafe/lodestar-api/keymanager/server"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {Api} from "@lodestar/api/keymanager"; +import {registerRoutes} from "@lodestar/api/keymanager/server"; +import {IChainForkConfig} from "@lodestar/config"; export type KeymanagerRestApiServerOpts = RestApiServerOpts & { isAuthEnabled: boolean; diff --git a/packages/cli/src/cmds/validator/options.ts b/packages/cli/src/cmds/validator/options.ts index 555ff8b128d0..e70cf6e01b66 100644 --- a/packages/cli/src/cmds/validator/options.ts +++ b/packages/cli/src/cmds/validator/options.ts @@ -1,4 +1,4 @@ -import {defaultOptions} from "@chainsafe/lodestar-validator"; +import {defaultOptions} from "@lodestar/validator"; import {ICliCommandOptions, ILogArgs} from "../../util/index.js"; import {logOptions, beaconPathsOptions} from "../beacon/options.js"; import {IBeaconPaths} from "../beacon/paths.js"; diff --git a/packages/cli/src/cmds/validator/signers/index.ts b/packages/cli/src/cmds/validator/signers/index.ts index 876b54a1789b..0d7464e528fe 100644 --- a/packages/cli/src/cmds/validator/signers/index.ts +++ b/packages/cli/src/cmds/validator/signers/index.ts @@ -1,7 +1,7 @@ import bls from "@chainsafe/bls"; import {deriveEth2ValidatorKeys, deriveKeyFromMnemonic} from "@chainsafe/bls-keygen"; -import {interopSecretKey} from "@chainsafe/lodestar-beacon-state-transition"; -import {externalSignerGetKeys, Signer, SignerType} from "@chainsafe/lodestar-validator"; +import {interopSecretKey} from "@lodestar/state-transition"; +import {externalSignerGetKeys, Signer, SignerType} from "@lodestar/validator"; import {toHexString} from "@chainsafe/ssz"; import {defaultNetwork, IGlobalArgs} from "../../../options/index.js"; import {assertValidPubkeysHex, isValidHttpUrl, parseRange, YargsError} from "../../../util/index.js"; diff --git a/packages/cli/src/cmds/validator/signers/logSigners.ts b/packages/cli/src/cmds/validator/signers/logSigners.ts index e6b02fdabd1b..ecddee13c88c 100644 --- a/packages/cli/src/cmds/validator/signers/logSigners.ts +++ b/packages/cli/src/cmds/validator/signers/logSigners.ts @@ -1,5 +1,5 @@ -import {Signer, SignerLocal, SignerRemote, SignerType} from "@chainsafe/lodestar-validator"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {Signer, SignerLocal, SignerRemote, SignerType} from "@lodestar/validator"; +import {ILogger} from "@lodestar/utils"; /** * Log each pubkeys for auditing out keys are loaded from the logs diff --git a/packages/cli/src/cmds/validator/slashingProtection/export.ts b/packages/cli/src/cmds/validator/slashingProtection/export.ts index 12baa9dacd83..bd8c30a376ba 100644 --- a/packages/cli/src/cmds/validator/slashingProtection/export.ts +++ b/packages/cli/src/cmds/validator/slashingProtection/export.ts @@ -1,4 +1,4 @@ -import {InterchangeFormatVersion} from "@chainsafe/lodestar-validator"; +import {InterchangeFormatVersion} from "@lodestar/validator"; import {ICliCommand, writeFile} from "../../../util/index.js"; import {IGlobalArgs} from "../../../options/index.js"; import {AccountValidatorArgs} from "../options.js"; diff --git a/packages/cli/src/cmds/validator/slashingProtection/import.ts b/packages/cli/src/cmds/validator/slashingProtection/import.ts index 1d951641c788..4eae747250ce 100644 --- a/packages/cli/src/cmds/validator/slashingProtection/import.ts +++ b/packages/cli/src/cmds/validator/slashingProtection/import.ts @@ -1,5 +1,5 @@ import fs from "node:fs"; -import {Interchange} from "@chainsafe/lodestar-validator"; +import {Interchange} from "@lodestar/validator"; import {ICliCommand} from "../../../util/index.js"; import {IGlobalArgs} from "../../../options/index.js"; import {AccountValidatorArgs} from "../options.js"; diff --git a/packages/cli/src/cmds/validator/slashingProtection/utils.ts b/packages/cli/src/cmds/validator/slashingProtection/utils.ts index 9c3eacf4e7de..cfd184093b60 100644 --- a/packages/cli/src/cmds/validator/slashingProtection/utils.ts +++ b/packages/cli/src/cmds/validator/slashingProtection/utils.ts @@ -1,7 +1,7 @@ -import {Root} from "@chainsafe/lodestar-types"; -import {getClient} from "@chainsafe/lodestar-api"; -import {SlashingProtection} from "@chainsafe/lodestar-validator"; -import {LevelDbController} from "@chainsafe/lodestar-db"; +import {Root} from "@lodestar/types"; +import {getClient} from "@lodestar/api"; +import {SlashingProtection} from "@lodestar/validator"; +import {LevelDbController} from "@lodestar/db"; import {YargsError} from "../../../util/index.js"; import {IGlobalArgs} from "../../../options/index.js"; import {getValidatorPaths} from "../paths.js"; diff --git a/packages/cli/src/config/beaconNodeOptions.ts b/packages/cli/src/config/beaconNodeOptions.ts index e10fb3ca1a40..9787637212e8 100644 --- a/packages/cli/src/config/beaconNodeOptions.ts +++ b/packages/cli/src/config/beaconNodeOptions.ts @@ -1,6 +1,6 @@ import deepmerge from "deepmerge"; -import {defaultOptions, IBeaconNodeOptions} from "@chainsafe/lodestar"; -import {isPlainObject, RecursivePartial} from "@chainsafe/lodestar-utils"; +import {defaultOptions, IBeaconNodeOptions} from "@lodestar/beacon-node"; +import {isPlainObject, RecursivePartial} from "@lodestar/utils"; import {writeFile, readFile} from "../util/index.js"; import {getInjectableBootEnrs, getNetworkBeaconNodeOptions, NetworkName} from "../networks/index.js"; diff --git a/packages/cli/src/config/beaconParams.ts b/packages/cli/src/config/beaconParams.ts index c3b6c93d1965..570516415a57 100644 --- a/packages/cli/src/config/beaconParams.ts +++ b/packages/cli/src/config/beaconParams.ts @@ -4,7 +4,7 @@ import { createIChainConfig, IChainForkConfig, chainConfigFromJson, -} from "@chainsafe/lodestar-config"; +} from "@lodestar/config"; import {readFile} from "../util/index.js"; import {getNetworkBeaconParams, NetworkName} from "../networks/index.js"; import {getGlobalPaths, IGlobalPaths} from "../paths/global.js"; diff --git a/packages/cli/src/config/enr.ts b/packages/cli/src/config/enr.ts index 09dec7c87ea6..23e4f8f17b39 100644 --- a/packages/cli/src/config/enr.ts +++ b/packages/cli/src/config/enr.ts @@ -1,6 +1,6 @@ import PeerId from "peer-id"; import {Multiaddr} from "multiaddr"; -import {IBeaconNodeOptions} from "@chainsafe/lodestar"; +import {IBeaconNodeOptions} from "@lodestar/beacon-node"; import {ENR, createKeypairFromPeerId} from "@chainsafe/discv5"; import {writeFile, readFile} from "../util/index.js"; import {FileENR} from "./fileEnr.js"; diff --git a/packages/cli/src/config/types.ts b/packages/cli/src/config/types.ts index 761344f90b74..702ec744bdea 100644 --- a/packages/cli/src/config/types.ts +++ b/packages/cli/src/config/types.ts @@ -1,3 +1,3 @@ -import {IChainConfig} from "@chainsafe/lodestar-config"; +import {IChainConfig} from "@lodestar/config"; export type IBeaconParamsUnparsed = Partial<{[P in keyof IChainConfig]: string | number}>; diff --git a/packages/cli/src/migrations/deleteOldPeerstore.ts b/packages/cli/src/migrations/deleteOldPeerstore.ts index 6e06c2b18484..a2bc07d7c6f0 100644 --- a/packages/cli/src/migrations/deleteOldPeerstore.ts +++ b/packages/cli/src/migrations/deleteOldPeerstore.ts @@ -1,6 +1,6 @@ import * as fs from "node:fs"; -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {LevelDbController} from "@lodestar/db"; +import {ILogger} from "@lodestar/utils"; /** * As of libp2p v0.36.0 (https://github.com/libp2p/js-libp2p/commit/978eb3676fad5d5d50ddb28d1a7868f448cbb20b) diff --git a/packages/cli/src/networks/dev.ts b/packages/cli/src/networks/dev.ts index f8a552d3f220..7f039e5d11a5 100644 --- a/packages/cli/src/networks/dev.ts +++ b/packages/cli/src/networks/dev.ts @@ -1,4 +1,4 @@ -export {minimalChainConfig as chainConfig} from "@chainsafe/lodestar-config/presets"; +export {minimalChainConfig as chainConfig} from "@lodestar/config/presets"; /* eslint-disable max-len */ diff --git a/packages/cli/src/networks/gnosis.ts b/packages/cli/src/networks/gnosis.ts index da6280cd04a2..42f593516685 100644 --- a/packages/cli/src/networks/gnosis.ts +++ b/packages/cli/src/networks/gnosis.ts @@ -1,4 +1,4 @@ -export {gnosisChainConfig as chainConfig} from "@chainsafe/lodestar-config/networks"; +export {gnosisChainConfig as chainConfig} from "@lodestar/config/networks"; /* eslint-disable max-len */ diff --git a/packages/cli/src/networks/index.ts b/packages/cli/src/networks/index.ts index c666ef682f1b..1e939da9cc8e 100644 --- a/packages/cli/src/networks/index.ts +++ b/packages/cli/src/networks/index.ts @@ -1,12 +1,12 @@ import fs from "node:fs"; import got from "got"; -import {SLOTS_PER_EPOCH, ForkName} from "@chainsafe/lodestar-params"; -import {getClient} from "@chainsafe/lodestar-api"; -import {IBeaconNodeOptions, getStateTypeFromBytes} from "@chainsafe/lodestar"; -import {IChainConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Checkpoint} from "@chainsafe/lodestar-types/phase0"; -import {RecursivePartial, fromHex, callFnWhenAwait, ILogger} from "@chainsafe/lodestar-utils"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {SLOTS_PER_EPOCH, ForkName} from "@lodestar/params"; +import {getClient} from "@lodestar/api"; +import {IBeaconNodeOptions, getStateTypeFromBytes} from "@lodestar/beacon-node"; +import {IChainConfig, IChainForkConfig} from "@lodestar/config"; +import {Checkpoint} from "@lodestar/types/phase0"; +import {RecursivePartial, fromHex, callFnWhenAwait, ILogger} from "@lodestar/utils"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; import * as mainnet from "./mainnet.js"; import * as dev from "./dev.js"; import * as gnosis from "./gnosis.js"; diff --git a/packages/cli/src/networks/kiln.ts b/packages/cli/src/networks/kiln.ts index fe7ceb6050b9..1be53b284002 100644 --- a/packages/cli/src/networks/kiln.ts +++ b/packages/cli/src/networks/kiln.ts @@ -1,4 +1,4 @@ -export {kilnChainConfig as chainConfig} from "@chainsafe/lodestar-config/networks"; +export {kilnChainConfig as chainConfig} from "@lodestar/config/networks"; /* eslint-disable max-len */ diff --git a/packages/cli/src/networks/mainnet.ts b/packages/cli/src/networks/mainnet.ts index df2c4ed1d955..8cafbdc68d8a 100644 --- a/packages/cli/src/networks/mainnet.ts +++ b/packages/cli/src/networks/mainnet.ts @@ -1,4 +1,4 @@ -export {mainnetChainConfig as chainConfig} from "@chainsafe/lodestar-config/networks"; +export {mainnetChainConfig as chainConfig} from "@lodestar/config/networks"; /* eslint-disable max-len */ diff --git a/packages/cli/src/networks/prater.ts b/packages/cli/src/networks/prater.ts index 5155dc67b5c8..7737f5a1d82a 100644 --- a/packages/cli/src/networks/prater.ts +++ b/packages/cli/src/networks/prater.ts @@ -1,4 +1,4 @@ -export {praterChainConfig as chainConfig} from "@chainsafe/lodestar-config/networks"; +export {praterChainConfig as chainConfig} from "@lodestar/config/networks"; /* eslint-disable max-len */ diff --git a/packages/cli/src/networks/ropsten.ts b/packages/cli/src/networks/ropsten.ts index 4dc49d3d5f47..7d44f0ed1768 100644 --- a/packages/cli/src/networks/ropsten.ts +++ b/packages/cli/src/networks/ropsten.ts @@ -1,4 +1,4 @@ -export {ropstenChainConfig as chainConfig} from "@chainsafe/lodestar-config/networks"; +export {ropstenChainConfig as chainConfig} from "@lodestar/config/networks"; /* eslint-disable max-len */ diff --git a/packages/cli/src/networks/sepolia.ts b/packages/cli/src/networks/sepolia.ts index 28e527c000f9..73c955aee581 100644 --- a/packages/cli/src/networks/sepolia.ts +++ b/packages/cli/src/networks/sepolia.ts @@ -1,4 +1,4 @@ -export {sepoliaChainConfig as chainConfig} from "@chainsafe/lodestar-config/networks"; +export {sepoliaChainConfig as chainConfig} from "@lodestar/config/networks"; /* eslint-disable max-len */ diff --git a/packages/cli/src/options/beaconNodeOptions/api.ts b/packages/cli/src/options/beaconNodeOptions/api.ts index 09522bc2dbf1..e126ecae7fe7 100644 --- a/packages/cli/src/options/beaconNodeOptions/api.ts +++ b/packages/cli/src/options/beaconNodeOptions/api.ts @@ -1,4 +1,4 @@ -import {defaultOptions, IBeaconNodeOptions, allNamespaces} from "@chainsafe/lodestar"; +import {defaultOptions, IBeaconNodeOptions, allNamespaces} from "@lodestar/beacon-node"; import {ICliCommandOptions} from "../../util/index.js"; const enabledAll = "*"; diff --git a/packages/cli/src/options/beaconNodeOptions/builder.ts b/packages/cli/src/options/beaconNodeOptions/builder.ts index 62ed80471d31..7716e6a80e91 100644 --- a/packages/cli/src/options/beaconNodeOptions/builder.ts +++ b/packages/cli/src/options/beaconNodeOptions/builder.ts @@ -1,4 +1,4 @@ -import {defaultOptions, IBeaconNodeOptions} from "@chainsafe/lodestar"; +import {defaultOptions, IBeaconNodeOptions} from "@lodestar/beacon-node"; import {ICliCommandOptions} from "../../util/index.js"; export type ExecutionBuilderArgs = { diff --git a/packages/cli/src/options/beaconNodeOptions/chain.ts b/packages/cli/src/options/beaconNodeOptions/chain.ts index a900ad7b8448..c44e9aedea87 100644 --- a/packages/cli/src/options/beaconNodeOptions/chain.ts +++ b/packages/cli/src/options/beaconNodeOptions/chain.ts @@ -1,4 +1,4 @@ -import {defaultOptions, IBeaconNodeOptions} from "@chainsafe/lodestar"; +import {defaultOptions, IBeaconNodeOptions} from "@lodestar/beacon-node"; import {ICliCommandOptions} from "../../util/index.js"; export interface IChainArgs { diff --git a/packages/cli/src/options/beaconNodeOptions/eth1.ts b/packages/cli/src/options/beaconNodeOptions/eth1.ts index 523b43bff20a..da164f511d32 100644 --- a/packages/cli/src/options/beaconNodeOptions/eth1.ts +++ b/packages/cli/src/options/beaconNodeOptions/eth1.ts @@ -1,5 +1,5 @@ import fs from "node:fs"; -import {defaultOptions, IBeaconNodeOptions} from "@chainsafe/lodestar"; +import {defaultOptions, IBeaconNodeOptions} from "@lodestar/beacon-node"; import {ICliCommandOptions, extractJwtHexSecret} from "../../util/index.js"; import {ExecutionEngineArgs} from "./execution.js"; diff --git a/packages/cli/src/options/beaconNodeOptions/execution.ts b/packages/cli/src/options/beaconNodeOptions/execution.ts index 7cf50d8a77e6..4aed03650f19 100644 --- a/packages/cli/src/options/beaconNodeOptions/execution.ts +++ b/packages/cli/src/options/beaconNodeOptions/execution.ts @@ -1,5 +1,5 @@ import fs from "node:fs"; -import {defaultOptions, IBeaconNodeOptions} from "@chainsafe/lodestar"; +import {defaultOptions, IBeaconNodeOptions} from "@lodestar/beacon-node"; import {ICliCommandOptions, extractJwtHexSecret} from "../../util/index.js"; export type ExecutionEngineArgs = { diff --git a/packages/cli/src/options/beaconNodeOptions/index.ts b/packages/cli/src/options/beaconNodeOptions/index.ts index dc10b3c98c59..dbfdf9641f7a 100644 --- a/packages/cli/src/options/beaconNodeOptions/index.ts +++ b/packages/cli/src/options/beaconNodeOptions/index.ts @@ -1,5 +1,5 @@ -import {IBeaconNodeOptions} from "@chainsafe/lodestar"; -import {RecursivePartial} from "@chainsafe/lodestar-utils"; +import {IBeaconNodeOptions} from "@lodestar/beacon-node"; +import {RecursivePartial} from "@lodestar/utils"; import {removeUndefinedRecursive} from "../../util/index.js"; import * as api from "./api.js"; import * as builder from "./builder.js"; diff --git a/packages/cli/src/options/beaconNodeOptions/logger.ts b/packages/cli/src/options/beaconNodeOptions/logger.ts index 347a19c173e0..d1ff405d4bba 100644 --- a/packages/cli/src/options/beaconNodeOptions/logger.ts +++ b/packages/cli/src/options/beaconNodeOptions/logger.ts @@ -1,6 +1,6 @@ import {Options} from "yargs"; -import {LogLevel, LogLevels} from "@chainsafe/lodestar-utils"; -import {defaultOptions, IBeaconNodeOptions} from "@chainsafe/lodestar"; +import {LogLevel, LogLevels} from "@lodestar/utils"; +import {defaultOptions, IBeaconNodeOptions} from "@lodestar/beacon-node"; import {ICliCommandOptions, ObjectKeys} from "../../util/index.js"; // No options are statically declared diff --git a/packages/cli/src/options/beaconNodeOptions/metrics.ts b/packages/cli/src/options/beaconNodeOptions/metrics.ts index a7c534ca57e9..546097082036 100644 --- a/packages/cli/src/options/beaconNodeOptions/metrics.ts +++ b/packages/cli/src/options/beaconNodeOptions/metrics.ts @@ -1,4 +1,4 @@ -import {defaultOptions, IBeaconNodeOptions} from "@chainsafe/lodestar"; +import {defaultOptions, IBeaconNodeOptions} from "@lodestar/beacon-node"; import {ICliCommandOptions} from "../../util/index.js"; export interface IMetricsArgs { diff --git a/packages/cli/src/options/beaconNodeOptions/network.ts b/packages/cli/src/options/beaconNodeOptions/network.ts index c477b177eba4..c77ef95116ea 100644 --- a/packages/cli/src/options/beaconNodeOptions/network.ts +++ b/packages/cli/src/options/beaconNodeOptions/network.ts @@ -1,4 +1,4 @@ -import {defaultOptions, IBeaconNodeOptions} from "@chainsafe/lodestar"; +import {defaultOptions, IBeaconNodeOptions} from "@lodestar/beacon-node"; import {ICliCommandOptions} from "../../util/index.js"; export interface INetworkArgs { diff --git a/packages/cli/src/options/beaconNodeOptions/sync.ts b/packages/cli/src/options/beaconNodeOptions/sync.ts index 328cdd462cf3..6961ba537395 100644 --- a/packages/cli/src/options/beaconNodeOptions/sync.ts +++ b/packages/cli/src/options/beaconNodeOptions/sync.ts @@ -1,4 +1,4 @@ -import {defaultOptions, IBeaconNodeOptions} from "@chainsafe/lodestar"; +import {defaultOptions, IBeaconNodeOptions} from "@lodestar/beacon-node"; import {ICliCommandOptions} from "../../util/index.js"; export interface ISyncArgs { diff --git a/packages/cli/src/options/paramsOptions.ts b/packages/cli/src/options/paramsOptions.ts index faf80a73689b..6a323da9d546 100644 --- a/packages/cli/src/options/paramsOptions.ts +++ b/packages/cli/src/options/paramsOptions.ts @@ -1,5 +1,5 @@ import {Options} from "yargs"; -import {IChainConfig, chainConfigTypes} from "@chainsafe/lodestar-config"; +import {IChainConfig, chainConfigTypes} from "@lodestar/config"; import {IBeaconParamsUnparsed} from "../config/types.js"; import {ObjectKeys, ICliCommandOptions} from "../util/index.js"; diff --git a/packages/cli/src/util/logger.ts b/packages/cli/src/util/logger.ts index 56c07a0bc9b9..fd157146882c 100644 --- a/packages/cli/src/util/logger.ts +++ b/packages/cli/src/util/logger.ts @@ -1,5 +1,5 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {IChainForkConfig} from "@lodestar/config"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import { ILogger, LogLevel, @@ -8,7 +8,7 @@ import { WinstonLogger, TimestampFormat, TimestampFormatCode, -} from "@chainsafe/lodestar-utils"; +} from "@lodestar/utils"; export interface ILogArgs { logLevel?: LogLevel; diff --git a/packages/cli/src/util/object.ts b/packages/cli/src/util/object.ts index cb2444865750..d37f41ea6655 100644 --- a/packages/cli/src/util/object.ts +++ b/packages/cli/src/util/object.ts @@ -1,4 +1,4 @@ -import {RecursivePartial} from "@chainsafe/lodestar-utils"; +import {RecursivePartial} from "@lodestar/utils"; /** * Removes (mutates) all properties with a value === undefined, recursively diff --git a/packages/cli/test/e2e/example.test.ts b/packages/cli/test/e2e/example.test.ts index 8002fe2fc977..e464ba5471b6 100644 --- a/packages/cli/test/e2e/example.test.ts +++ b/packages/cli/test/e2e/example.test.ts @@ -3,7 +3,7 @@ import path from "node:path"; import rimraf from "rimraf"; import {expect} from "chai"; import {Keystore} from "@chainsafe/bls-keystore"; -import {fromHex} from "@chainsafe/lodestar-utils"; +import {fromHex} from "@lodestar/utils"; import {ReturnType as ValidatorListReturnType} from "../../src/cmds/validator/list.js"; import {testFilesDir} from "../utils.js"; import {getCliInMemoryRunner} from "../utils/inMemoryRunner.js"; diff --git a/packages/cli/test/e2e/importKeystoresFromApi.test.ts b/packages/cli/test/e2e/importKeystoresFromApi.test.ts index 5fcb2d7fcaaf..faaddc3ee883 100644 --- a/packages/cli/test/e2e/importKeystoresFromApi.test.ts +++ b/packages/cli/test/e2e/importKeystoresFromApi.test.ts @@ -2,9 +2,9 @@ import path from "node:path"; import rimraf from "rimraf"; import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; -import {DeletionStatus, getClient, ImportStatus} from "@chainsafe/lodestar-api/keymanager"; -import {config} from "@chainsafe/lodestar-config/default"; -import {Interchange} from "@chainsafe/lodestar-validator"; +import {DeletionStatus, getClient, ImportStatus} from "@lodestar/api/keymanager"; +import {config} from "@lodestar/config/default"; +import {Interchange} from "@lodestar/validator"; import {testFilesDir} from "../utils.js"; import {bufferStderr, describeCliTest} from "../utils/childprocRunner.js"; import {cachedPubkeysHex, cachedSeckeysHex} from "../utils/cachedKeys.js"; diff --git a/packages/cli/test/e2e/importRemoteKeysFromApi.test.ts b/packages/cli/test/e2e/importRemoteKeysFromApi.test.ts index f877257e0f6f..c97c4b9a7a1e 100644 --- a/packages/cli/test/e2e/importRemoteKeysFromApi.test.ts +++ b/packages/cli/test/e2e/importRemoteKeysFromApi.test.ts @@ -2,8 +2,8 @@ import path from "node:path"; import rimraf from "rimraf"; import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; -import {Api, DeleteRemoteKeyStatus, getClient, ImportRemoteKeyStatus} from "@chainsafe/lodestar-api/keymanager"; -import {config} from "@chainsafe/lodestar-config/default"; +import {Api, DeleteRemoteKeyStatus, getClient, ImportRemoteKeyStatus} from "@lodestar/api/keymanager"; +import {config} from "@lodestar/config/default"; import {testFilesDir} from "../utils.js"; import {describeCliTest} from "../utils/childprocRunner.js"; import {cachedPubkeysHex} from "../utils/cachedKeys.js"; diff --git a/packages/cli/test/unit/config/beaconNodeOptions.test.ts b/packages/cli/test/unit/config/beaconNodeOptions.test.ts index 2b5e38551321..6f90d00943fa 100644 --- a/packages/cli/test/unit/config/beaconNodeOptions.test.ts +++ b/packages/cli/test/unit/config/beaconNodeOptions.test.ts @@ -1,7 +1,7 @@ import fs from "node:fs"; import path from "node:path"; import {expect} from "chai"; -import {defaultOptions} from "@chainsafe/lodestar"; +import {defaultOptions} from "@lodestar/beacon-node"; import {getBeaconPaths} from "../../../src/cmds/beacon/paths.js"; import {BeaconNodeOptions, mergeBeaconNodeOptions} from "../../../src/config/index.js"; import {enrsToNetworkConfig, parseBootnodesFile} from "../../../src/networks/index.js"; diff --git a/packages/cli/test/unit/options/beaconNodeOptions.test.ts b/packages/cli/test/unit/options/beaconNodeOptions.test.ts index 9536cb8d4251..f70eeeccb787 100644 --- a/packages/cli/test/unit/options/beaconNodeOptions.test.ts +++ b/packages/cli/test/unit/options/beaconNodeOptions.test.ts @@ -1,7 +1,7 @@ import fs from "node:fs"; import {expect} from "chai"; -import {IBeaconNodeOptions} from "@chainsafe/lodestar"; -import {LogLevel, RecursivePartial} from "@chainsafe/lodestar-utils"; +import {IBeaconNodeOptions} from "@lodestar/beacon-node"; +import {LogLevel, RecursivePartial} from "@lodestar/utils"; import {parseBeaconNodeArgs, IBeaconNodeArgs} from "../../../src/options/beaconNodeOptions/index.js"; import {getTestdirPath} from "../../utils.js"; diff --git a/packages/cli/test/utils/keymanagerTestRunners.ts b/packages/cli/test/utils/keymanagerTestRunners.ts index 3ce80af53645..17b882b2f6ea 100644 --- a/packages/cli/test/utils/keymanagerTestRunners.ts +++ b/packages/cli/test/utils/keymanagerTestRunners.ts @@ -1,6 +1,6 @@ -import {sleep, retry} from "@chainsafe/lodestar-utils"; -import {Api, getClient} from "@chainsafe/lodestar-api/keymanager"; -import {config} from "@chainsafe/lodestar-config/default"; +import {sleep, retry} from "@lodestar/utils"; +import {Api, getClient} from "@lodestar/api/keymanager"; +import {config} from "@lodestar/config/default"; import {getMockBeaconApiServer} from "./mockBeaconApiServer.js"; import {AfterEachCallback, expectDeepEquals, findApiToken, itDone} from "./runUtils.js"; import {DescribeArgs} from "./childprocRunner.js"; diff --git a/packages/cli/test/utils/keystores.ts b/packages/cli/test/utils/keystores.ts index d54bb0ee4bad..2321fde30bd4 100644 --- a/packages/cli/test/utils/keystores.ts +++ b/packages/cli/test/utils/keystores.ts @@ -1,6 +1,6 @@ import bls from "@chainsafe/bls"; import {Keystore} from "@chainsafe/bls-keystore"; -import {fromHex} from "@chainsafe/lodestar-utils"; +import {fromHex} from "@lodestar/utils"; /** * Compute encrypted keystore from secret keys serialized in hex, with same password diff --git a/packages/cli/test/utils/mockBeaconApiServer.ts b/packages/cli/test/utils/mockBeaconApiServer.ts index b9aca57f0c25..a06d1e4ec5f6 100644 --- a/packages/cli/test/utils/mockBeaconApiServer.ts +++ b/packages/cli/test/utils/mockBeaconApiServer.ts @@ -1,11 +1,11 @@ -import {RestApiServer, RestApiServerOpts, RestApiServerModules} from "@chainsafe/lodestar"; -import {registerRoutes} from "@chainsafe/lodestar-api/beacon/server"; -import {Api, allNamespaces} from "@chainsafe/lodestar-api"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ssz} from "@chainsafe/lodestar-types"; -import {fromHex} from "@chainsafe/lodestar-utils"; -import {testLogger} from "../../../lodestar/test/utils/logger.js"; +import {RestApiServer, RestApiServerOpts, RestApiServerModules} from "@lodestar/beacon-node"; +import {registerRoutes} from "@lodestar/api/beacon/server"; +import {Api, allNamespaces} from "@lodestar/api"; +import {IChainForkConfig} from "@lodestar/config"; +import {config} from "@lodestar/config/default"; +import {ssz} from "@lodestar/types"; +import {fromHex} from "@lodestar/utils"; +import {testLogger} from "../../../beacon-node/test/utils/logger.js"; const ZERO_HASH = Buffer.alloc(32, 0); diff --git a/packages/config/README.md b/packages/config/README.md index 03929779c749..91cf9ad45db7 100644 --- a/packages/config/README.md +++ b/packages/config/README.md @@ -1,6 +1,6 @@ # lodestar-config -[![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-config)](https://www.npmjs.com/package/@chainsafe/lodestar-config) +[![npm](https://img.shields.io/npm/v/@lodestar/config)](https://www.npmjs.com/package/@lodestar/config) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Eth Consensus Spec v1.1.10](https://img.shields.io/badge/ETH%20consensus--spec-1.1.10-blue)](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10) ![ES Version](https://img.shields.io/badge/ES-2020-yellow) @@ -13,7 +13,7 @@ Lodestar defines all [network configuration variables](https://github.com/ethere ## Installation ```sh -npm install @chainsafe/lodestar-config +npm install @lodestar/config ``` ## Usage @@ -31,8 +31,8 @@ The Lodestar config package contains several interfaces used in downstream Lodes The Ethereum consensus spec defines a bunch of variables that may be easily configured per testnet. These include the `GENESIS_TIME`, `SECONDS_PER_SLOT`, and various `*_FORK_EPOCH`s, `*_FORK_VERSION`s, etc. The Lodestar config package exports the `IChainConfig` interface and matching `ChainConfig` SSZ type, which include all of these variables, named verbatim from the spec. ```typescript -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {chainConfig} from "@chainsafe/lodestar-config/default"; +import {IChainConfig} from "@lodestar/config"; +import {chainConfig} from "@lodestar/config/default"; let config: IChainConfig = chainConfig; const x: number = config.SECONDS_PER_SLOT; @@ -41,7 +41,7 @@ const x: number = config.SECONDS_PER_SLOT; Mainnet default values are available as a singleton `IChainConfig` under the `default` import path. ```typescript -import {chainConfig} from "@chainsafe/lodestar-config/default"; +import {chainConfig} from "@lodestar/config/default"; chainConfig.SECONDS_PER_SLOT === 12; ``` @@ -49,7 +49,7 @@ chainConfig.SECONDS_PER_SLOT === 12; There are also utility functions to help create a `IChainConfig` from unknown input and partial configs. ```typescript -import {createIChainConfig, IChainConfig, chainConfigFromJson} from "@chainsafe/lodestar-config"; +import {createIChainConfig, IChainConfig, chainConfigFromJson} from "@lodestar/config"; // example config let chainConfigObj: Record = { @@ -90,9 +90,9 @@ The variables described in the spec can be used to assemble a more structured 'f A `IForkConfig` provides methods to select the fork info, fork name, fork version, or fork ssz types given a slot. ```typescript -import {GENESIS_SLOT} from "@chainsafe/lodestar-params"; -import {createIChainForkConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; -import {config as chainConfig} from "@chainsafe/lodestar-config/default"; +import {GENESIS_SLOT} from "@lodestar/params"; +import {createIChainForkConfig, IChainForkConfig} from "@lodestar/config"; +import {config as chainConfig} from "@lodestar/config/default"; const config: IChainForkConfig = createIChainForkConfig(chainConfig); @@ -104,9 +104,9 @@ const version = config.getForkVersion(GENESIS_SLOT); For signing Ethereum consensus objects, a cryptographic "domain" is computed and mixed into the signed message. This domain separates signatures made for the Ethereum mainnet from testnets or other instances of the chain. The `ICachedGenesis` interface is used to provide a cache for this purpose. Practically, the domain rarely changes, only per-fork, and so the value can be easily cached. Since the genesis validators root is part of the domain, it is required input to instantiate an `ICachedGenesis`. In practice, the `IChainForkConfig` and `ICachedGenesis` are usually combined as a `IBeaconConfig`. This is the 'highest level' object exported by the Lodestar config library. ```typescript -import {DOMAIN_DEPOSIT, GENESIS_SLOT} from "@chainsafe/lodestar-params"; -import {createIBeaconConfig, IBeaconConfig} from "@chainsafe/lodestar-config"; -import {config as chainConfig} from "@chainsafe/lodestar-config/default"; +import {DOMAIN_DEPOSIT, GENESIS_SLOT} from "@lodestar/params"; +import {createIBeaconConfig, IBeaconConfig} from "@lodestar/config"; +import {config as chainConfig} from "@lodestar/config/default"; // dummy test root let genesisValidatorsRoot: Uint8Array = new Uint8Array(); diff --git a/packages/config/package.json b/packages/config/package.json index bf6745c29cfe..7372b3f500e6 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-config", + "name": "@lodestar/config", "version": "0.39.0", "description": "Chain configuration required for lodestar", "author": "ChainSafe Systems", @@ -66,8 +66,8 @@ "blockchain" ], "dependencies": { - "@chainsafe/lodestar-params": "^0.39.0", - "@chainsafe/lodestar-types": "^0.39.0", + "@lodestar/params": "^0.39.0", + "@lodestar/types": "^0.39.0", "@chainsafe/ssz": "^0.9.2" } } diff --git a/packages/config/src/beaconConfig.ts b/packages/config/src/beaconConfig.ts index 762e0b5a7c94..ef789d63180c 100644 --- a/packages/config/src/beaconConfig.ts +++ b/packages/config/src/beaconConfig.ts @@ -1,4 +1,4 @@ -import {Root} from "@chainsafe/lodestar-types"; +import {Root} from "@lodestar/types"; import {createIChainConfig, IChainConfig} from "./chainConfig/index.js"; import {createIForkConfig, IForkConfig} from "./forkConfig/index.js"; import {createICachedGenesis} from "./genesisConfig/index.js"; diff --git a/packages/config/src/chainConfig/default.ts b/packages/config/src/chainConfig/default.ts index aed3e908bfec..4f35b2118172 100644 --- a/packages/config/src/chainConfig/default.ts +++ b/packages/config/src/chainConfig/default.ts @@ -1,4 +1,4 @@ -import {ACTIVE_PRESET, PresetName} from "@chainsafe/lodestar-params"; +import {ACTIVE_PRESET, PresetName} from "@lodestar/params"; import {IChainConfig} from "./types.js"; import {chainConfig as mainnet} from "./presets/mainnet.js"; import {chainConfig as minimal} from "./presets/minimal.js"; diff --git a/packages/config/src/chainConfig/index.ts b/packages/config/src/chainConfig/index.ts index a70566ec18ee..4a6990dde093 100644 --- a/packages/config/src/chainConfig/index.ts +++ b/packages/config/src/chainConfig/index.ts @@ -1,4 +1,4 @@ -import {ACTIVE_PRESET} from "@chainsafe/lodestar-params"; +import {ACTIVE_PRESET} from "@lodestar/params"; import {IChainConfig} from "./types.js"; import {defaultChainConfig} from "./default.js"; diff --git a/packages/config/src/chainConfig/networks/gnosis.ts b/packages/config/src/chainConfig/networks/gnosis.ts index 43c7618cb5da..1d6cbf4fbca3 100644 --- a/packages/config/src/chainConfig/networks/gnosis.ts +++ b/packages/config/src/chainConfig/networks/gnosis.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import {fromHexString as b} from "@chainsafe/ssz"; -import {PresetName} from "@chainsafe/lodestar-params"; +import {PresetName} from "@lodestar/params"; import {IChainConfig} from "../types.js"; import {chainConfig as mainnet} from "../presets/mainnet.js"; diff --git a/packages/config/src/chainConfig/presets/mainnet.ts b/packages/config/src/chainConfig/presets/mainnet.ts index 36b543b9cc65..46c278679e9c 100644 --- a/packages/config/src/chainConfig/presets/mainnet.ts +++ b/packages/config/src/chainConfig/presets/mainnet.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import {fromHexString as b} from "@chainsafe/ssz"; -import {PresetName} from "@chainsafe/lodestar-params"; +import {PresetName} from "@lodestar/params"; import {IChainConfig} from "../types.js"; export const chainConfig: IChainConfig = { diff --git a/packages/config/src/chainConfig/presets/minimal.ts b/packages/config/src/chainConfig/presets/minimal.ts index 74401885346c..684f77f446ac 100644 --- a/packages/config/src/chainConfig/presets/minimal.ts +++ b/packages/config/src/chainConfig/presets/minimal.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import {fromHexString as b} from "@chainsafe/ssz"; -import {PresetName} from "@chainsafe/lodestar-params"; +import {PresetName} from "@lodestar/params"; import {IChainConfig} from "../types.js"; export const chainConfig: IChainConfig = { diff --git a/packages/config/src/chainConfig/types.ts b/packages/config/src/chainConfig/types.ts index b5a03aa5981b..8de86f971dd4 100644 --- a/packages/config/src/chainConfig/types.ts +++ b/packages/config/src/chainConfig/types.ts @@ -1,4 +1,4 @@ -import {PresetName} from "@chainsafe/lodestar-params"; +import {PresetName} from "@lodestar/params"; /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/packages/config/src/forkConfig/index.ts b/packages/config/src/forkConfig/index.ts index b9dd09cc9c9b..8642fab66ff7 100644 --- a/packages/config/src/forkConfig/index.ts +++ b/packages/config/src/forkConfig/index.ts @@ -1,5 +1,5 @@ -import {GENESIS_EPOCH, ForkName, SLOTS_PER_EPOCH, ForkSeq} from "@chainsafe/lodestar-params"; -import {Slot, allForks, Version, ssz} from "@chainsafe/lodestar-types"; +import {GENESIS_EPOCH, ForkName, SLOTS_PER_EPOCH, ForkSeq} from "@lodestar/params"; +import {Slot, allForks, Version, ssz} from "@lodestar/types"; import {IChainConfig} from "../chainConfig/index.js"; import {IForkConfig, IForkInfo} from "./types.js"; diff --git a/packages/config/src/forkConfig/types.ts b/packages/config/src/forkConfig/types.ts index 092a445993df..56167bbccb05 100644 --- a/packages/config/src/forkConfig/types.ts +++ b/packages/config/src/forkConfig/types.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import {ForkName, ForkSeq} from "@chainsafe/lodestar-params"; -import {allForks, Epoch, Slot, Version} from "@chainsafe/lodestar-types"; +import {ForkName, ForkSeq} from "@lodestar/params"; +import {allForks, Epoch, Slot, Version} from "@lodestar/types"; export interface IForkInfo { name: ForkName; diff --git a/packages/config/src/genesisConfig/index.ts b/packages/config/src/genesisConfig/index.ts index 52faf4cac7f8..351d6ff957d7 100644 --- a/packages/config/src/genesisConfig/index.ts +++ b/packages/config/src/genesisConfig/index.ts @@ -1,5 +1,5 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {DomainType, ForkDigest, phase0, Root, Slot, ssz, Version} from "@chainsafe/lodestar-types"; +import {ForkName} from "@lodestar/params"; +import {DomainType, ForkDigest, phase0, Root, Slot, ssz, Version} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; import {IChainForkConfig} from "../beaconConfig.js"; import {ForkDigestHex, ICachedGenesis} from "./types.js"; diff --git a/packages/config/src/genesisConfig/types.ts b/packages/config/src/genesisConfig/types.ts index 584c9e51776a..614d86245e31 100644 --- a/packages/config/src/genesisConfig/types.ts +++ b/packages/config/src/genesisConfig/types.ts @@ -1,5 +1,5 @@ -import {ForkName} from "@chainsafe/lodestar-params"; -import {DomainType, ForkDigest, Slot} from "@chainsafe/lodestar-types"; +import {ForkName} from "@lodestar/params"; +import {DomainType, ForkDigest, Slot} from "@lodestar/types"; export type ForkDigestHex = string; diff --git a/packages/config/test/unit/index.test.ts b/packages/config/test/unit/index.test.ts index fd3835eea9f7..30db0b4bf5e0 100644 --- a/packages/config/test/unit/index.test.ts +++ b/packages/config/test/unit/index.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ForkName} from "@chainsafe/lodestar-params"; +import {ForkName} from "@lodestar/params"; import {config} from "../../src/default.js"; describe("forks", () => { diff --git a/packages/db/README.md b/packages/db/README.md index e83114d50bec..c5b15925eab5 100644 --- a/packages/db/README.md +++ b/packages/db/README.md @@ -1,4 +1,4 @@ -# `@chainsafe/lodestar-db` +# `@lodestar/db` > This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project diff --git a/packages/db/package.json b/packages/db/package.json index ac6ea4588119..c8a66abc3dee 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-db", + "name": "@lodestar/db", "version": "0.39.0", "description": "DB modules of Lodestar", "author": "ChainSafe Systems", @@ -39,8 +39,8 @@ "check-readme": "typescript-docs-verifier" }, "dependencies": { - "@chainsafe/lodestar-config": "^0.39.0", - "@chainsafe/lodestar-utils": "^0.39.0", + "@lodestar/config": "^0.39.0", + "@lodestar/utils": "^0.39.0", "@chainsafe/ssz": "^0.9.2", "@types/levelup": "^4.3.3", "it-all": "^1.0.2", diff --git a/packages/db/src/abstractRepository.ts b/packages/db/src/abstractRepository.ts index 4ea536344210..46cde935632a 100644 --- a/packages/db/src/abstractRepository.ts +++ b/packages/db/src/abstractRepository.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {Type} from "@chainsafe/ssz"; import {BUCKET_LENGTH} from "./const.js"; import {IFilterOptions, IKeyValue} from "./controller/index.js"; diff --git a/packages/db/src/controller/level.ts b/packages/db/src/controller/level.ts index a8009b822ca0..9e8a0d7bc306 100644 --- a/packages/db/src/controller/level.ts +++ b/packages/db/src/controller/level.ts @@ -5,7 +5,7 @@ import {LevelUp} from "levelup"; import level from "level"; import all from "it-all"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ILogger} from "@lodestar/utils"; import {DbReqOpts, IDatabaseController, IDatabaseOptions, IFilterOptions, IKeyValue} from "./interface.js"; import {ILevelDbControllerMetrics} from "./metrics.js"; diff --git a/packages/db/src/databaseService.ts b/packages/db/src/databaseService.ts index 713cf1460f25..f8e0934c2af0 100644 --- a/packages/db/src/databaseService.ts +++ b/packages/db/src/databaseService.ts @@ -1,4 +1,4 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IChainForkConfig} from "@lodestar/config"; import {ILevelDbControllerMetrics} from "./controller/metrics.js"; import {Db} from "./controller/index.js"; diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 12444cb44622..8077849656ab 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -1,7 +1,7 @@ /** * @module db/schema */ -import {intToBytes} from "@chainsafe/lodestar-utils"; +import {intToBytes} from "@lodestar/utils"; import {BUCKET_LENGTH} from "./const.js"; // Buckets are separate database namespaces diff --git a/packages/db/test/unit/controller/level.test.ts b/packages/db/test/unit/controller/level.test.ts index 1b779986cf67..d318fc3cc59f 100644 --- a/packages/db/test/unit/controller/level.test.ts +++ b/packages/db/test/unit/controller/level.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; import leveldown from "leveldown"; import all from "it-all"; -import {WinstonLogger} from "@chainsafe/lodestar-utils"; +import {WinstonLogger} from "@lodestar/utils"; import {LevelDbController} from "../../../src/controller/index.js"; describe("LevelDB controller", () => { diff --git a/packages/db/test/unit/schema.test.ts b/packages/db/test/unit/schema.test.ts index ce530a3f10b7..a5b9f281cbf5 100644 --- a/packages/db/test/unit/schema.test.ts +++ b/packages/db/test/unit/schema.test.ts @@ -1,5 +1,5 @@ import {assert} from "chai"; -import {intToBytes} from "@chainsafe/lodestar-utils"; +import {intToBytes} from "@lodestar/utils"; import {Bucket, encodeKey} from "../../src/schema.js"; import {BUCKET_LENGTH} from "../../src/index.js"; diff --git a/packages/flare/README.md b/packages/flare/README.md index 6f999af6f5d6..017598e16ba6 100644 --- a/packages/flare/README.md +++ b/packages/flare/README.md @@ -1,6 +1,6 @@ # flare -[![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-flare)](https://www.npmjs.com/package/@chainsafe/lodestar-flare) +[![npm](https://img.shields.io/npm/v/@lodestar/flare)](https://www.npmjs.com/package/@lodestar/flare) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Eth Consensus Spec v1.1.10](https://img.shields.io/badge/ETH%20consensus--spec-1.1.10-blue)](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10) ![ES Version](https://img.shields.io/badge/ES-2020-yellow) diff --git a/packages/flare/package.json b/packages/flare/package.json index dcb0f143ca71..6c4d27e49608 100644 --- a/packages/flare/package.json +++ b/packages/flare/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/flare", + "name": "@lodestar/flare", "version": "0.39.0", "description": "Beacon chain debugging tool", "author": "ChainSafe Systems", @@ -60,10 +60,10 @@ "blockchain" ], "dependencies": { - "@chainsafe/lodestar-api": "^0.39.0", - "@chainsafe/lodestar-beacon-state-transition": "^0.39.0", - "@chainsafe/lodestar-config": "^0.39.0", - "@chainsafe/lodestar-types": "^0.39.0", + "@lodestar/api": "^0.39.0", + "@lodestar/state-transition": "^0.39.0", + "@lodestar/config": "^0.39.0", + "@lodestar/types": "^0.39.0", "source-map-support": "^0.5.19", "yargs": "^16.1.0" }, diff --git a/packages/flare/src/cmds/selfSlashAttester.ts b/packages/flare/src/cmds/selfSlashAttester.ts index 72736ae2737c..562a59681664 100644 --- a/packages/flare/src/cmds/selfSlashAttester.ts +++ b/packages/flare/src/cmds/selfSlashAttester.ts @@ -1,12 +1,12 @@ import bls from "@chainsafe/bls"; import type {SecretKey} from "@chainsafe/bls/types"; -import {getClient} from "@chainsafe/lodestar-api"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {config as chainConfig} from "@chainsafe/lodestar-config/default"; -import {createIBeaconConfig, IBeaconConfig} from "@chainsafe/lodestar-config"; -import {DOMAIN_BEACON_ATTESTER, MAX_VALIDATORS_PER_COMMITTEE} from "@chainsafe/lodestar-params"; -import {toHexString} from "@chainsafe/lodestar-utils"; -import {computeSigningRoot} from "@chainsafe/lodestar-beacon-state-transition"; +import {getClient} from "@lodestar/api"; +import {phase0, ssz} from "@lodestar/types"; +import {config as chainConfig} from "@lodestar/config/default"; +import {createIBeaconConfig, IBeaconConfig} from "@lodestar/config"; +import {DOMAIN_BEACON_ATTESTER, MAX_VALIDATORS_PER_COMMITTEE} from "@lodestar/params"; +import {toHexString} from "@lodestar/utils"; +import {computeSigningRoot} from "@lodestar/state-transition"; import {ICliCommand} from "../util/command.js"; import {deriveSecretKeys, SecretKeysArgs, secretKeysOptions} from "../util/deriveSecretKeys.js"; diff --git a/packages/flare/src/cmds/selfSlashProposer.ts b/packages/flare/src/cmds/selfSlashProposer.ts index 84f8c5cea045..94ec12c577f8 100644 --- a/packages/flare/src/cmds/selfSlashProposer.ts +++ b/packages/flare/src/cmds/selfSlashProposer.ts @@ -1,11 +1,11 @@ import type {SecretKey} from "@chainsafe/bls/types"; -import {getClient} from "@chainsafe/lodestar-api"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {config as chainConfig} from "@chainsafe/lodestar-config/default"; -import {createIBeaconConfig, IBeaconConfig} from "@chainsafe/lodestar-config"; -import {DOMAIN_BEACON_PROPOSER} from "@chainsafe/lodestar-params"; -import {toHexString} from "@chainsafe/lodestar-utils"; -import {computeSigningRoot} from "@chainsafe/lodestar-beacon-state-transition"; +import {getClient} from "@lodestar/api"; +import {phase0, ssz} from "@lodestar/types"; +import {config as chainConfig} from "@lodestar/config/default"; +import {createIBeaconConfig, IBeaconConfig} from "@lodestar/config"; +import {DOMAIN_BEACON_PROPOSER} from "@lodestar/params"; +import {toHexString} from "@lodestar/utils"; +import {computeSigningRoot} from "@lodestar/state-transition"; import {ICliCommand} from "../util/command.js"; import {deriveSecretKeys, SecretKeysArgs, secretKeysOptions} from "../util/deriveSecretKeys.js"; diff --git a/packages/flare/src/util/deriveSecretKeys.ts b/packages/flare/src/util/deriveSecretKeys.ts index f34929a4a214..766e8e202760 100644 --- a/packages/flare/src/util/deriveSecretKeys.ts +++ b/packages/flare/src/util/deriveSecretKeys.ts @@ -1,7 +1,7 @@ import bls from "@chainsafe/bls"; import type {SecretKey} from "@chainsafe/bls/types"; import {deriveEth2ValidatorKeys, deriveKeyFromMnemonic} from "@chainsafe/bls-keygen"; -import {interopSecretKey} from "@chainsafe/lodestar-beacon-state-transition"; +import {interopSecretKey} from "@lodestar/state-transition"; import {YargsError} from "./errors.js"; import {parseRange} from "./format.js"; import {ICliCommandOptions} from "./command.js"; diff --git a/packages/fork-choice/package.json b/packages/fork-choice/package.json index a7c0e1a16ed7..9188f785934d 100644 --- a/packages/fork-choice/package.json +++ b/packages/fork-choice/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-fork-choice", + "name": "@lodestar/fork-choice", "description": "A Typescript implementation Ethereum Consensus fork choice", "license": "Apache-2.0", "author": "ChainSafe Systems", @@ -40,11 +40,11 @@ "check-readme": "typescript-docs-verifier" }, "dependencies": { - "@chainsafe/lodestar-beacon-state-transition": "^0.39.0", - "@chainsafe/lodestar-config": "^0.39.0", - "@chainsafe/lodestar-params": "^0.39.0", - "@chainsafe/lodestar-types": "^0.39.0", - "@chainsafe/lodestar-utils": "^0.39.0", + "@lodestar/state-transition": "^0.39.0", + "@lodestar/config": "^0.39.0", + "@lodestar/params": "^0.39.0", + "@lodestar/types": "^0.39.0", + "@lodestar/utils": "^0.39.0", "@chainsafe/ssz": "^0.9.2" }, "keywords": [ diff --git a/packages/fork-choice/src/forkChoice/errors.ts b/packages/fork-choice/src/forkChoice/errors.ts index 751b8ee37caa..ea0c6305ba42 100644 --- a/packages/fork-choice/src/forkChoice/errors.ts +++ b/packages/fork-choice/src/forkChoice/errors.ts @@ -1,5 +1,5 @@ -import {Slot, Epoch, RootHex} from "@chainsafe/lodestar-types"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {Slot, Epoch, RootHex} from "@lodestar/types"; +import {LodestarError} from "@lodestar/utils"; export enum InvalidBlockCode { UNKNOWN_PARENT = "UNKNOWN_PARENT", diff --git a/packages/fork-choice/src/forkChoice/forkChoice.ts b/packages/fork-choice/src/forkChoice/forkChoice.ts index bf3ff3f0c0da..df894662b92b 100644 --- a/packages/fork-choice/src/forkChoice/forkChoice.ts +++ b/packages/fork-choice/src/forkChoice/forkChoice.ts @@ -1,6 +1,6 @@ import {toHexString} from "@chainsafe/ssz"; -import {SAFE_SLOTS_TO_UPDATE_JUSTIFIED, SLOTS_PER_HISTORICAL_ROOT, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {bellatrix, Slot, ValidatorIndex, phase0, allForks, ssz, RootHex, Epoch, Root} from "@chainsafe/lodestar-types"; +import {SAFE_SLOTS_TO_UPDATE_JUSTIFIED, SLOTS_PER_HISTORICAL_ROOT, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {bellatrix, Slot, ValidatorIndex, phase0, allForks, ssz, RootHex, Epoch, Root} from "@lodestar/types"; import { getCurrentInterval, computeSlotsSinceEpochStart, @@ -12,8 +12,8 @@ import { isBellatrixBlockBodyType, isBellatrixStateType, isExecutionEnabled, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {IChainConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; +} from "@lodestar/state-transition"; +import {IChainConfig, IChainForkConfig} from "@lodestar/config"; import {computeDeltas} from "../protoArray/computeDeltas.js"; import {HEX_ZERO_HASH, VoteTracker, ProtoBlock, ExecutionStatus} from "../protoArray/interface.js"; @@ -337,7 +337,7 @@ export class ForkChoice implements IForkChoice { // (https://github.com/ethereum/consensus-specs/blob/dev/specs/bellatrix/fork-choice.md#on_block) // // However this check has been moved to the `verifyBlockStateTransition` in - // `packages/lodestar/src/chain/blocks/verifyBlock.ts` as: + // `packages/beacon-node/src/chain/blocks/verifyBlock.ts` as: // // 1. Its prudent to fail fast and not try importing a block in forkChoice. // 2. Also the data to run such a validation is readily available there. diff --git a/packages/fork-choice/src/forkChoice/interface.ts b/packages/fork-choice/src/forkChoice/interface.ts index 6e6a4d3a4734..499b9f716861 100644 --- a/packages/fork-choice/src/forkChoice/interface.ts +++ b/packages/fork-choice/src/forkChoice/interface.ts @@ -1,6 +1,6 @@ -import {EffectiveBalanceIncrements} from "@chainsafe/lodestar-beacon-state-transition"; -import {BeaconStateAllForks} from "@chainsafe/lodestar-beacon-state-transition"; -import {Epoch, Slot, ValidatorIndex, phase0, allForks, Root, RootHex} from "@chainsafe/lodestar-types"; +import {EffectiveBalanceIncrements} from "@lodestar/state-transition"; +import {BeaconStateAllForks} from "@lodestar/state-transition"; +import {Epoch, Slot, ValidatorIndex, phase0, allForks, Root, RootHex} from "@lodestar/types"; import {ProtoBlock, ExecutionStatus} from "../protoArray/interface.js"; import {CheckpointWithHex} from "./store.js"; diff --git a/packages/fork-choice/src/forkChoice/store.ts b/packages/fork-choice/src/forkChoice/store.ts index 3767015bedec..b80fa3e8ce80 100644 --- a/packages/fork-choice/src/forkChoice/store.ts +++ b/packages/fork-choice/src/forkChoice/store.ts @@ -1,4 +1,4 @@ -import {phase0, Slot, RootHex} from "@chainsafe/lodestar-types"; +import {phase0, Slot, RootHex} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; /** diff --git a/packages/fork-choice/src/protoArray/computeDeltas.ts b/packages/fork-choice/src/protoArray/computeDeltas.ts index 47f129987f33..44c4bcc8345b 100644 --- a/packages/fork-choice/src/protoArray/computeDeltas.ts +++ b/packages/fork-choice/src/protoArray/computeDeltas.ts @@ -1,4 +1,4 @@ -import {EffectiveBalanceIncrements} from "@chainsafe/lodestar-beacon-state-transition"; +import {EffectiveBalanceIncrements} from "@lodestar/state-transition"; import {VoteTracker, HEX_ZERO_HASH} from "./interface.js"; import {ProtoArrayError, ProtoArrayErrorCode} from "./errors.js"; diff --git a/packages/fork-choice/src/protoArray/errors.ts b/packages/fork-choice/src/protoArray/errors.ts index d7834f14cd89..d7d8e7fb5b13 100644 --- a/packages/fork-choice/src/protoArray/errors.ts +++ b/packages/fork-choice/src/protoArray/errors.ts @@ -1,5 +1,5 @@ -import {Epoch, RootHex} from "@chainsafe/lodestar-types"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {Epoch, RootHex} from "@lodestar/types"; +import {LodestarError} from "@lodestar/utils"; export enum ProtoArrayErrorCode { FINALIZED_NODE_UNKNOWN = "PROTO_ARRAY_ERROR_FINALIZED_NODE_UNKNOWN", diff --git a/packages/fork-choice/src/protoArray/interface.ts b/packages/fork-choice/src/protoArray/interface.ts index bd15341b42a7..388ee3516bd7 100644 --- a/packages/fork-choice/src/protoArray/interface.ts +++ b/packages/fork-choice/src/protoArray/interface.ts @@ -1,4 +1,4 @@ -import {Epoch, Slot, RootHex} from "@chainsafe/lodestar-types"; +import {Epoch, Slot, RootHex} from "@lodestar/types"; // RootHex is a root as a hex string // Used for lightweight and easy comparison diff --git a/packages/fork-choice/src/protoArray/protoArray.ts b/packages/fork-choice/src/protoArray/protoArray.ts index 618c5cd05216..e3b5191852c4 100644 --- a/packages/fork-choice/src/protoArray/protoArray.ts +++ b/packages/fork-choice/src/protoArray/protoArray.ts @@ -1,4 +1,4 @@ -import {Epoch, RootHex} from "@chainsafe/lodestar-types"; +import {Epoch, RootHex} from "@lodestar/types"; import {ProtoBlock, ProtoNode, HEX_ZERO_HASH} from "./interface.js"; import {ProtoArrayError, ProtoArrayErrorCode} from "./errors.js"; diff --git a/packages/fork-choice/test/perf/forkChoice/forkChoice.test.ts b/packages/fork-choice/test/perf/forkChoice/forkChoice.test.ts index 307f32c73717..91787730ad4d 100644 --- a/packages/fork-choice/test/perf/forkChoice/forkChoice.test.ts +++ b/packages/fork-choice/test/perf/forkChoice/forkChoice.test.ts @@ -1,9 +1,9 @@ import {itBench} from "@dapplion/benchmark"; -import {config} from "@chainsafe/lodestar-config/default"; -import {AttestationData, IndexedAttestation} from "@chainsafe/lodestar-types/phase0"; -import {ATTESTATION_SUBNET_COUNT} from "@chainsafe/lodestar-params"; -import {getEffectiveBalanceIncrementsZeroed} from "@chainsafe/lodestar-beacon-state-transition"; -import {ssz} from "@chainsafe/lodestar-types"; +import {config} from "@lodestar/config/default"; +import {AttestationData, IndexedAttestation} from "@lodestar/types/phase0"; +import {ATTESTATION_SUBNET_COUNT} from "@lodestar/params"; +import {getEffectiveBalanceIncrementsZeroed} from "@lodestar/state-transition"; +import {ssz} from "@lodestar/types"; import {fromHexString} from "@chainsafe/ssz"; import {ExecutionStatus, ForkChoice, IForkChoiceStore, ProtoBlock, ProtoArray} from "../../../src/index.js"; diff --git a/packages/fork-choice/test/perf/protoArray/computeDeltas.test.ts b/packages/fork-choice/test/perf/protoArray/computeDeltas.test.ts index 033b9331203f..6d779d64afed 100644 --- a/packages/fork-choice/test/perf/protoArray/computeDeltas.test.ts +++ b/packages/fork-choice/test/perf/protoArray/computeDeltas.test.ts @@ -5,9 +5,9 @@ import { computeStartSlotAtEpoch, EffectiveBalanceIncrements, getEffectiveBalanceIncrementsZeroed, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {TIMELY_SOURCE_FLAG_INDEX} from "@chainsafe/lodestar-params"; -import {generatePerfTestCachedStateAltair} from "../../../../beacon-state-transition/test/perf/util.js"; +} from "@lodestar/state-transition"; +import {TIMELY_SOURCE_FLAG_INDEX} from "@lodestar/params"; +import {generatePerfTestCachedStateAltair} from "../../../../state-transition/test/perf/util.js"; import {VoteTracker} from "../../../src/protoArray/interface.js"; import {computeDeltas} from "../../../src/protoArray/computeDeltas.js"; import {computeProposerBoostScoreFromBalances} from "../../../src/forkChoice/forkChoice.js"; diff --git a/packages/fork-choice/test/unit/forkChoice/forkChoice.test.ts b/packages/fork-choice/test/unit/forkChoice/forkChoice.test.ts index 971eb7bcf6fd..53c689d6232f 100644 --- a/packages/fork-choice/test/unit/forkChoice/forkChoice.test.ts +++ b/packages/fork-choice/test/unit/forkChoice/forkChoice.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import {fromHexString} from "@chainsafe/ssz"; -import {getEffectiveBalanceIncrementsZeroed} from "@chainsafe/lodestar-beacon-state-transition"; +import {getEffectiveBalanceIncrementsZeroed} from "@lodestar/state-transition"; import {ForkChoice, IForkChoiceStore, ProtoBlock, ProtoArray, ExecutionStatus} from "../../../src/index.js"; describe("Forkchoice", function () { diff --git a/packages/fork-choice/test/unit/protoArray/computeDeltas.test.ts b/packages/fork-choice/test/unit/protoArray/computeDeltas.test.ts index 18c03110cdbc..b17dff6888bf 100644 --- a/packages/fork-choice/test/unit/protoArray/computeDeltas.test.ts +++ b/packages/fork-choice/test/unit/protoArray/computeDeltas.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {getEffectiveBalanceIncrementsZeroed} from "@chainsafe/lodestar-beacon-state-transition"; +import {getEffectiveBalanceIncrementsZeroed} from "@lodestar/state-transition"; import {computeDeltas} from "../../../src/protoArray/computeDeltas.js"; diff --git a/packages/fork-choice/test/unit/protoArray/protoArray.test.ts b/packages/fork-choice/test/unit/protoArray/protoArray.test.ts index 4f4e7a22872b..3ca08af7a1d3 100644 --- a/packages/fork-choice/test/unit/protoArray/protoArray.test.ts +++ b/packages/fork-choice/test/unit/protoArray/protoArray.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {RootHex} from "@chainsafe/lodestar-types"; +import {RootHex} from "@lodestar/types"; import {ProtoArray, ExecutionStatus} from "../../../src/index.js"; diff --git a/packages/light-client/package.json b/packages/light-client/package.json index b88294652f2f..02d021989d34 100644 --- a/packages/light-client/package.json +++ b/packages/light-client/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-light-client", + "name": "@lodestar/light-client", "description": "A Typescript implementation of the Ethereum Consensus light client", "license": "Apache-2.0", "author": "ChainSafe Systems", @@ -58,11 +58,11 @@ }, "dependencies": { "@chainsafe/bls": "7.1.1", - "@chainsafe/lodestar-api": "^0.39.0", - "@chainsafe/lodestar-config": "^0.39.0", - "@chainsafe/lodestar-params": "^0.39.0", - "@chainsafe/lodestar-types": "^0.39.0", - "@chainsafe/lodestar-utils": "^0.39.0", + "@lodestar/api": "^0.39.0", + "@lodestar/config": "^0.39.0", + "@lodestar/params": "^0.39.0", + "@lodestar/types": "^0.39.0", + "@lodestar/utils": "^0.39.0", "@chainsafe/persistent-merkle-tree": "^0.4.2", "@chainsafe/ssz": "^0.9.2", "cross-fetch": "^3.1.4", diff --git a/packages/light-client/src/events.ts b/packages/light-client/src/events.ts index 8857e13ab789..0bf90eb0ee98 100644 --- a/packages/light-client/src/events.ts +++ b/packages/light-client/src/events.ts @@ -1,4 +1,4 @@ -import {phase0, SyncPeriod} from "@chainsafe/lodestar-types"; +import {phase0, SyncPeriod} from "@lodestar/types"; export enum LightclientEvent { /** diff --git a/packages/light-client/src/index.ts b/packages/light-client/src/index.ts index 32c22e8a1c99..71a13db1b726 100644 --- a/packages/light-client/src/index.ts +++ b/packages/light-client/src/index.ts @@ -1,10 +1,10 @@ import mitt from "mitt"; -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {getClient, Api, routes} from "@chainsafe/lodestar-api"; -import {altair, phase0, RootHex, ssz, SyncPeriod} from "@chainsafe/lodestar-types"; -import {createIBeaconConfig, IBeaconConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {getClient, Api, routes} from "@lodestar/api"; +import {altair, phase0, RootHex, ssz, SyncPeriod} from "@lodestar/types"; +import {createIBeaconConfig, IBeaconConfig, IChainForkConfig} from "@lodestar/config"; import {TreeOffsetProof} from "@chainsafe/persistent-merkle-tree"; -import {isErrorAborted, sleep} from "@chainsafe/lodestar-utils"; +import {isErrorAborted, sleep} from "@lodestar/utils"; import {fromHexString, JsonPath, toHexString} from "@chainsafe/ssz"; import {getCurrentSlot, slotWithFutureTolerance, timeUntilNextEpoch} from "./utils/clock.js"; import {isBetterUpdate, LightclientUpdateStats} from "./utils/update.js"; diff --git a/packages/light-client/src/networks.ts b/packages/light-client/src/networks.ts index f43d88517048..98add3e32046 100644 --- a/packages/light-client/src/networks.ts +++ b/packages/light-client/src/networks.ts @@ -1,4 +1,4 @@ -import {RootHex} from "@chainsafe/lodestar-types"; +import {RootHex} from "@lodestar/types"; enum NetworkName { mainnet = "mainnet", diff --git a/packages/light-client/src/types.ts b/packages/light-client/src/types.ts index 19383fb4b781..622aea31bf9d 100644 --- a/packages/light-client/src/types.ts +++ b/packages/light-client/src/types.ts @@ -1,5 +1,5 @@ import type {PublicKey} from "@chainsafe/bls/types"; -import {altair, phase0, SyncPeriod} from "@chainsafe/lodestar-types"; +import {altair, phase0, SyncPeriod} from "@lodestar/types"; export type LightClientStoreFast = { snapshot: LightClientSnapshotFast; diff --git a/packages/light-client/src/utils/clock.ts b/packages/light-client/src/utils/clock.ts index a942d4d832a8..2ee1674b2fea 100644 --- a/packages/light-client/src/utils/clock.ts +++ b/packages/light-client/src/utils/clock.ts @@ -1,6 +1,6 @@ -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {Epoch, Slot, SyncPeriod} from "@chainsafe/lodestar-types"; +import {IChainConfig} from "@lodestar/config"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {Epoch, Slot, SyncPeriod} from "@lodestar/types"; export function getCurrentSlot(config: IChainConfig, genesisTime: number): Slot { const diffInSeconds = Date.now() / 1000 - genesisTime; diff --git a/packages/light-client/src/utils/domain.ts b/packages/light-client/src/utils/domain.ts index 2450637691ba..ad38a2f714a8 100644 --- a/packages/light-client/src/utils/domain.ts +++ b/packages/light-client/src/utils/domain.ts @@ -1,6 +1,6 @@ // Only used by processDeposit + lightclient -import {Epoch, Version, Root, DomainType, phase0, ssz, Domain} from "@chainsafe/lodestar-types"; +import {Epoch, Version, Root, DomainType, phase0, ssz, Domain} from "@lodestar/types"; import {Type} from "@chainsafe/ssz"; /** diff --git a/packages/light-client/src/utils/update.ts b/packages/light-client/src/utils/update.ts index 52dbe38c7ec3..93a9c262a2e7 100644 --- a/packages/light-client/src/utils/update.ts +++ b/packages/light-client/src/utils/update.ts @@ -1,5 +1,5 @@ -import {SYNC_COMMITTEE_SIZE} from "@chainsafe/lodestar-params"; -import {Slot} from "@chainsafe/lodestar-types"; +import {SYNC_COMMITTEE_SIZE} from "@lodestar/params"; +import {Slot} from "@lodestar/types"; export type LightclientUpdateStats = { isFinalized: boolean; diff --git a/packages/light-client/src/utils/utils.ts b/packages/light-client/src/utils/utils.ts index 5239c038e19d..e523c5396851 100644 --- a/packages/light-client/src/utils/utils.ts +++ b/packages/light-client/src/utils/utils.ts @@ -1,7 +1,7 @@ import bls from "@chainsafe/bls"; import type {PublicKey} from "@chainsafe/bls/types"; -import {altair, Root, ssz} from "@chainsafe/lodestar-types"; -import {BeaconBlockHeader} from "@chainsafe/lodestar-types/phase0"; +import {altair, Root, ssz} from "@lodestar/types"; +import {BeaconBlockHeader} from "@lodestar/types/phase0"; import {BitArray} from "@chainsafe/ssz"; import {SyncCommitteeFast} from "../types.js"; diff --git a/packages/light-client/src/validation.ts b/packages/light-client/src/validation.ts index e5aed31d56df..16fd0d991ddb 100644 --- a/packages/light-client/src/validation.ts +++ b/packages/light-client/src/validation.ts @@ -1,4 +1,4 @@ -import {altair, phase0, Root, Slot, ssz} from "@chainsafe/lodestar-types"; +import {altair, phase0, Root, Slot, ssz} from "@lodestar/types"; import bls from "@chainsafe/bls"; import type {PublicKey, Signature} from "@chainsafe/bls/types"; import { @@ -8,9 +8,9 @@ import { NEXT_SYNC_COMMITTEE_DEPTH, MIN_SYNC_COMMITTEE_PARTICIPANTS, DOMAIN_SYNC_COMMITTEE, -} from "@chainsafe/lodestar-params"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; -import {routes} from "@chainsafe/lodestar-api"; +} from "@lodestar/params"; +import {IBeaconConfig} from "@lodestar/config"; +import {routes} from "@lodestar/api"; import {isValidMerkleBranch} from "./utils/verifyMerkleBranch.js"; import {assertZeroHashes, getParticipantPubkeys, isEmptyHeader} from "./utils/utils.js"; import {SyncCommitteeFast} from "./types.js"; diff --git a/packages/light-client/test/getGenesisData.ts b/packages/light-client/test/getGenesisData.ts index a082ae502b47..019ec2fce11c 100644 --- a/packages/light-client/test/getGenesisData.ts +++ b/packages/light-client/test/getGenesisData.ts @@ -1,6 +1,6 @@ -import {getClient} from "@chainsafe/lodestar-api"; -import {config} from "@chainsafe/lodestar-config/default"; -import {NetworkName} from "@chainsafe/lodestar-config/networks.js"; +import {getClient} from "@lodestar/api"; +import {config} from "@lodestar/config/default"; +import {NetworkName} from "@lodestar/config/networks.js"; // To populate packages/light-client/src/networks.ts // diff --git a/packages/light-client/test/lightclientApiServer.ts b/packages/light-client/test/lightclientApiServer.ts index a52f5d589b7b..1d023708f158 100644 --- a/packages/light-client/test/lightclientApiServer.ts +++ b/packages/light-client/test/lightclientApiServer.ts @@ -1,11 +1,11 @@ import querystring from "querystring"; import fastify, {FastifyInstance} from "fastify"; import fastifyCors from "fastify-cors"; -import {Api, routes} from "@chainsafe/lodestar-api"; -import {registerRoutes} from "@chainsafe/lodestar-api/beacon/server"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {Api, routes} from "@lodestar/api"; +import {registerRoutes} from "@lodestar/api/beacon/server"; +import {IChainForkConfig} from "@lodestar/config"; import {JsonPath} from "@chainsafe/ssz"; -import {altair, RootHex, SyncPeriod} from "@chainsafe/lodestar-types"; +import {altair, RootHex, SyncPeriod} from "@lodestar/types"; import {Proof} from "@chainsafe/persistent-merkle-tree"; import {BeaconStateAltair} from "./types.js"; diff --git a/packages/light-client/test/naive/update.ts b/packages/light-client/test/naive/update.ts index b9f59d58dd2a..30311d3c402d 100644 --- a/packages/light-client/test/naive/update.ts +++ b/packages/light-client/test/naive/update.ts @@ -1,6 +1,6 @@ -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {altair, Slot} from "@chainsafe/lodestar-types"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {altair, Slot} from "@lodestar/types"; +import {IBeaconConfig} from "@lodestar/config"; import {LightClientSnapshotFast, LightClientStoreFast} from "../../src/types.js"; import {assertValidLightClientUpdate} from "../../src/validation.js"; import {deserializeSyncCommittee, isEmptyHeader, sumBits} from "../../src/utils/utils.js"; diff --git a/packages/light-client/test/prepareUpdateNaive.ts b/packages/light-client/test/prepareUpdateNaive.ts index 54c0b8d1db3e..295994ab7b1d 100644 --- a/packages/light-client/test/prepareUpdateNaive.ts +++ b/packages/light-client/test/prepareUpdateNaive.ts @@ -1,6 +1,6 @@ -import {altair, phase0, Root, ssz} from "@chainsafe/lodestar-types"; +import {altair, phase0, Root, ssz} from "@lodestar/types"; import {CompositeViewDU} from "@chainsafe/ssz"; -import {FINALIZED_ROOT_GINDEX, NEXT_SYNC_COMMITTEE_GINDEX, SLOTS_PER_HISTORICAL_ROOT} from "@chainsafe/lodestar-params"; +import {FINALIZED_ROOT_GINDEX, NEXT_SYNC_COMMITTEE_GINDEX, SLOTS_PER_HISTORICAL_ROOT} from "@lodestar/params"; import {Tree} from "@chainsafe/persistent-merkle-tree"; import {computeEpochAtSlot} from "../src/utils/clock.js"; import {getForkVersion} from "../src/utils/domain.js"; diff --git a/packages/light-client/test/types.ts b/packages/light-client/test/types.ts index 3f10cd32b1c4..a445e97f1e2f 100644 --- a/packages/light-client/test/types.ts +++ b/packages/light-client/test/types.ts @@ -1,4 +1,4 @@ import {CompositeViewDU} from "@chainsafe/ssz"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; export type BeaconStateAltair = CompositeViewDU; diff --git a/packages/light-client/test/unit/sync.test.ts b/packages/light-client/test/unit/sync.test.ts index 3f2acbdf53e3..d059a4f37a1d 100644 --- a/packages/light-client/test/unit/sync.test.ts +++ b/packages/light-client/test/unit/sync.test.ts @@ -1,10 +1,10 @@ import {expect} from "chai"; -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {BeaconStateAllForks, BeaconStateAltair} from "@chainsafe/lodestar-beacon-state-transition"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {routes, Api} from "@chainsafe/lodestar-api"; -import {chainConfig as chainConfigDef} from "@chainsafe/lodestar-config/default"; -import {createIBeaconConfig, IChainConfig} from "@chainsafe/lodestar-config"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {BeaconStateAllForks, BeaconStateAltair} from "@lodestar/state-transition"; +import {phase0, ssz} from "@lodestar/types"; +import {routes, Api} from "@lodestar/api"; +import {chainConfig as chainConfigDef} from "@lodestar/config/default"; +import {createIBeaconConfig, IChainConfig} from "@lodestar/config"; import {toHexString} from "@chainsafe/ssz"; import {Lightclient, LightclientEvent} from "../../src/index.js"; import {EventsServerApi, LightclientServerApi, ServerOpts, startServer} from "../lightclientApiServer.js"; diff --git a/packages/light-client/test/unit/syncNaive.test.ts b/packages/light-client/test/unit/syncNaive.test.ts index 6e18a77d62af..5abf2d36ffad 100644 --- a/packages/light-client/test/unit/syncNaive.test.ts +++ b/packages/light-client/test/unit/syncNaive.test.ts @@ -1,11 +1,11 @@ import {expect} from "chai"; import bls from "@chainsafe/bls"; -import {altair, phase0, Root, ssz, SyncPeriod} from "@chainsafe/lodestar-types"; -import {BeaconStateAltair} from "@chainsafe/lodestar-beacon-state-transition"; +import {altair, phase0, Root, ssz, SyncPeriod} from "@lodestar/types"; +import {BeaconStateAltair} from "@lodestar/state-transition"; import {toHexString} from "@chainsafe/ssz"; -import {chainConfig} from "@chainsafe/lodestar-config/default"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {chainConfig} from "@lodestar/config/default"; +import {createIBeaconConfig} from "@lodestar/config"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params"; import {processLightClientUpdate} from "../naive/update.js"; import {prepareUpdateNaive, IBeaconChainLc} from "../prepareUpdateNaive.js"; import {getInteropSyncCommittee, getSyncAggregateSigningRoot, SyncCommitteeKeys} from "../utils.js"; diff --git a/packages/light-client/test/unit/validation.test.ts b/packages/light-client/test/unit/validation.test.ts index 5c9826f2567e..d96e4a63e3c1 100644 --- a/packages/light-client/test/unit/validation.test.ts +++ b/packages/light-client/test/unit/validation.test.ts @@ -1,15 +1,15 @@ import bls from "@chainsafe/bls"; import {Tree} from "@chainsafe/persistent-merkle-tree"; -import {altair, ssz} from "@chainsafe/lodestar-types"; -import {chainConfig} from "@chainsafe/lodestar-config/default"; -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; +import {altair, ssz} from "@lodestar/types"; +import {chainConfig} from "@lodestar/config/default"; +import {createIBeaconConfig} from "@lodestar/config"; import { EPOCHS_PER_SYNC_COMMITTEE_PERIOD, FINALIZED_ROOT_GINDEX, NEXT_SYNC_COMMITTEE_GINDEX, SLOTS_PER_EPOCH, SYNC_COMMITTEE_SIZE, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {assertValidLightClientUpdate} from "../../src/validation.js"; import {LightClientSnapshotFast, SyncCommitteeFast} from "../../src/types.js"; import {defaultBeaconBlockHeader, getSyncAggregateSigningRoot, signAndAggregate} from "../utils.js"; diff --git a/packages/light-client/test/utils.ts b/packages/light-client/test/utils.ts index 02cc9586fc50..d23d4f025b1f 100644 --- a/packages/light-client/test/utils.ts +++ b/packages/light-client/test/utils.ts @@ -1,7 +1,7 @@ import {PointFormat, PublicKey, SecretKey} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; -import {routes} from "@chainsafe/lodestar-api"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +import {routes} from "@lodestar/api"; +import {IBeaconConfig} from "@lodestar/config"; import { DOMAIN_SYNC_COMMITTEE, EPOCHS_PER_SYNC_COMMITTEE_PERIOD, @@ -11,8 +11,8 @@ import { NEXT_SYNC_COMMITTEE_DEPTH, SLOTS_PER_EPOCH, SYNC_COMMITTEE_SIZE, -} from "@chainsafe/lodestar-params"; -import {altair, phase0, Slot, ssz, SyncPeriod} from "@chainsafe/lodestar-types"; +} from "@lodestar/params"; +import {altair, phase0, Slot, ssz, SyncPeriod} from "@lodestar/types"; import {hash} from "@chainsafe/persistent-merkle-tree"; import {BitArray, fromHexString} from "@chainsafe/ssz"; import {SyncCommitteeFast} from "../src/types.js"; diff --git a/packages/params/README.md b/packages/params/README.md index 0ba0b63e1387..feb35ac73b9c 100644 --- a/packages/params/README.md +++ b/packages/params/README.md @@ -1,6 +1,6 @@ # lodestar-params -[![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-types)](https://www.npmjs.com/package/@chainsafe/lodestar-types) +[![npm](https://img.shields.io/npm/v/@lodestar/types)](https://www.npmjs.com/package/@lodestar/types) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Eth Consensus Spec v1.1.10](https://img.shields.io/badge/ETH%20consensus--spec-1.1.10-blue)](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10) ![ES Version](https://img.shields.io/badge/ES-2020-yellow) @@ -14,7 +14,7 @@ Lodestar defines all constants and presets defined in the [Ethereum Consensus sp ## Installation ```sh -npm install @chainsafe/lodestar-params +npm install @lodestar/params ``` ## Usage @@ -30,7 +30,7 @@ The Lodestar params package contains several items used in all downstream Lodest Many downstream components are namespaced on fork names, or otherwise rely on knowing the fork names ahead of time. The Lodestar params package exports an enum `ForkName` the enumerates all known fork names. ```typescript -import {ForkName} from "@chainsafe/lodestar-params"; +import {ForkName} from "@lodestar/params"; // dummy data let forkName = "phase0"; @@ -48,7 +48,7 @@ switch (forkName) { All constants defined in the spec are exported verbatim. ```typescript -import {GENESIS_SLOT} from "@chainsafe/lodestar-params"; +import {GENESIS_SLOT} from "@lodestar/params"; ``` ### Presets @@ -58,7 +58,7 @@ Presets are "constants"-ish defined in the spec that can only be configured at b The active preset is exported under the `ACTIVE_PRESET` named export. ```typescript -import {ACTIVE_PRESET, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {ACTIVE_PRESET, SLOTS_PER_EPOCH} from "@lodestar/params"; ``` The preset may be set in one of two ways: diff --git a/packages/params/package.json b/packages/params/package.json index be99744ab9f5..c0858d8d186c 100644 --- a/packages/params/package.json +++ b/packages/params/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-params", + "name": "@lodestar/params", "version": "0.39.0", "description": "Chain parameters required for lodestar", "author": "ChainSafe Systems", diff --git a/packages/params/src/setPreset.ts b/packages/params/src/setPreset.ts index 71c8b50bf92d..5412dfdb0ffc 100644 --- a/packages/params/src/setPreset.ts +++ b/packages/params/src/setPreset.ts @@ -23,14 +23,14 @@ export let userSelectedPreset: PresetName | null = null; export function setActivePreset(presetName: PresetName): void { if (presetStatus.frozen) { throw Error(`Lodestar preset is already frozen. You must call setActivePreset() at the top of your -application entry point, before importing @chainsafe/lodestar-params, or any library that may import it. +application entry point, before importing @lodestar/params, or any library that may import it. \`\`\` // index.ts -import {setActivePreset, PresetName} from "@chainsafe/lodestar-params/preset" +import {setActivePreset, PresetName} from "@lodestar/params/preset" setActivePreset(PresetName.minimal) // Now you can safely import from other paths and consume params -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params" +import {SLOTS_PER_EPOCH} from "@lodestar/params" console.log({SLOTS_PER_EPOCH}) \`\`\` `); diff --git a/packages/params/test/e2e/setPresetError.ts b/packages/params/test/e2e/setPresetError.ts index 415a2b0f5da1..ec2c12607fca 100644 --- a/packages/params/test/e2e/setPresetError.ts +++ b/packages/params/test/e2e/setPresetError.ts @@ -1,7 +1,7 @@ // This script is should be run in an e2e !! // It demostrates how NOT to change the Lodestar preset -// 1. Import from not only @chainsafe/lodestar-params/setPreset will trigger an error +// 1. Import from not only @lodestar/params/setPreset will trigger an error import {SLOTS_PER_EPOCH} from "../../lib/index.js"; import {setActivePreset, PresetName} from "../../lib/setPreset.js"; // This line should throw diff --git a/packages/params/test/e2e/setPresetOk.ts b/packages/params/test/e2e/setPresetOk.ts index 0d4a72a22ae7..8ab718337022 100644 --- a/packages/params/test/e2e/setPresetOk.ts +++ b/packages/params/test/e2e/setPresetOk.ts @@ -2,11 +2,11 @@ // This script is should be run in an e2e !! // It demostrates how to properly change the Lodestar preset safely -// 1. Import from @chainsafe/lodestar-params/setPreset only +// 1. Import from @lodestar/params/setPreset only import {setActivePreset, PresetName} from "../../src/setPreset.js"; setActivePreset(PresetName.minimal); -// 2. Import from any other @chainsafe/lodestar-params paths +// 2. Import from any other @lodestar/params paths import {expect} from "chai"; const {SLOTS_PER_EPOCH} = await import("../../src/index.js"); diff --git a/packages/spec-test-util/README.md b/packages/spec-test-util/README.md index 5b1dfaf1eba3..6c1d0aae056a 100644 --- a/packages/spec-test-util/README.md +++ b/packages/spec-test-util/README.md @@ -4,7 +4,7 @@ Mocha / Chai utility for interacting with eth2.0 spec tests. -For usage see [spec tests]("https://github.com/ChainSafe/lodestar/tree/unstable/packages/lodestar/test/spec") +For usage see [spec tests]("https://github.com/ChainSafe/lodestar/tree/unstable/packages/beacon-node/test/spec") ## License diff --git a/packages/spec-test-util/package.json b/packages/spec-test-util/package.json index bbd9d5768c54..6f2516039ae2 100644 --- a/packages/spec-test-util/package.json +++ b/packages/spec-test-util/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-spec-test-util", + "name": "@lodestar/spec-test-util", "version": "0.39.0", "description": "Spec test suite generator from yaml test files", "author": "ChainSafe Systems", @@ -47,7 +47,7 @@ "blockchain" ], "dependencies": { - "@chainsafe/lodestar-utils": "^0.39.0", + "@lodestar/utils": "^0.39.0", "async-retry": "^1.3.3", "axios": "^0.21.0", "chai": "^4.2.0", diff --git a/packages/spec-test-util/src/single.ts b/packages/spec-test-util/src/single.ts index 40d4ef8d6f52..25caa50534c1 100644 --- a/packages/spec-test-util/src/single.ts +++ b/packages/spec-test-util/src/single.ts @@ -2,7 +2,7 @@ import fs from "node:fs"; import {basename, join, parse} from "node:path"; import {expect} from "chai"; import {uncompress} from "snappyjs"; -import {loadYaml} from "@chainsafe/lodestar-utils"; +import {loadYaml} from "@lodestar/utils"; /* eslint-disable @typescript-eslint/no-unsafe-assignment, diff --git a/packages/spec-test-util/src/sszGeneric.ts b/packages/spec-test-util/src/sszGeneric.ts index 3f7a2faada28..5e484f08da44 100644 --- a/packages/spec-test-util/src/sszGeneric.ts +++ b/packages/spec-test-util/src/sszGeneric.ts @@ -1,7 +1,7 @@ import path from "node:path"; import fs from "node:fs"; import {uncompress} from "snappyjs"; -import {loadYaml} from "@chainsafe/lodestar-utils"; +import {loadYaml} from "@lodestar/utils"; /* eslint-disable @typescript-eslint/explicit-module-boundary-types, diff --git a/packages/spec-test-util/test/e2e/single/index.test.ts b/packages/spec-test-util/test/e2e/single/index.test.ts index 276ddcbdf486..c783e1b84875 100644 --- a/packages/spec-test-util/test/e2e/single/index.test.ts +++ b/packages/spec-test-util/test/e2e/single/index.test.ts @@ -3,7 +3,7 @@ import {unlinkSync, writeFileSync} from "node:fs"; import path, {join} from "node:path"; import {fileURLToPath} from "node:url"; import {ContainerType, Type} from "@chainsafe/ssz"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {describeDirectorySpecTest, InputType, loadYamlFile} from "../../../src/single.js"; // Global variable __dirname no longer available in ES6 modules. diff --git a/packages/beacon-state-transition/.mocharc.yaml b/packages/state-transition/.mocharc.yaml similarity index 100% rename from packages/beacon-state-transition/.mocharc.yaml rename to packages/state-transition/.mocharc.yaml diff --git a/packages/lodestar/LICENSE b/packages/state-transition/LICENSE similarity index 100% rename from packages/lodestar/LICENSE rename to packages/state-transition/LICENSE diff --git a/packages/beacon-state-transition/README.md b/packages/state-transition/README.md similarity index 78% rename from packages/beacon-state-transition/README.md rename to packages/state-transition/README.md index f135df9ec4d6..297ab12f1107 100644 --- a/packages/beacon-state-transition/README.md +++ b/packages/state-transition/README.md @@ -1,6 +1,6 @@ -# lodestar-beacon-state-transition +# lodestar-state-transition -[![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-beacon-state-transition)](https://www.npmjs.com/package/@chainsafe/lodestar-beacon-state-transition) +[![npm](https://img.shields.io/npm/v/@lodestar/state-transition)](https://www.npmjs.com/package/@lodestar/state-transition) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Eth Consensus Spec v1.1.10](https://img.shields.io/badge/ETH%20consensus--spec-1.1.10-blue)](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10) ![ES Version](https://img.shields.io/badge/ES-2020-yellow) @@ -13,7 +13,7 @@ The beacon state transition and state transition utilities ## Usage ```typescript -import {CachedBeaconStateAllForks, allForks} from "@chainsafe/lodestar-beacon-state-transition"; +import {CachedBeaconStateAllForks, allForks} from "@lodestar/state-transition"; import {generateEmptySignedBlock} from "../test/utils/block"; import {generateState} from "../test/utils/state"; diff --git a/packages/beacon-state-transition/package.json b/packages/state-transition/package.json similarity index 89% rename from packages/beacon-state-transition/package.json rename to packages/state-transition/package.json index 6bbbbb1141de..d690e17c2645 100644 --- a/packages/beacon-state-transition/package.json +++ b/packages/state-transition/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-beacon-state-transition", + "name": "@lodestar/state-transition", "description": "Beacon Chain state transition function and utils", "license": "Apache-2.0", "author": "ChainSafe Systems", @@ -61,10 +61,10 @@ "dependencies": { "@chainsafe/as-sha256": "^0.3.1", "@chainsafe/bls": "7.1.0", - "@chainsafe/lodestar-config": "^0.39.0", - "@chainsafe/lodestar-params": "^0.39.0", - "@chainsafe/lodestar-types": "^0.39.0", - "@chainsafe/lodestar-utils": "^0.39.0", + "@lodestar/config": "^0.39.0", + "@lodestar/params": "^0.39.0", + "@lodestar/types": "^0.39.0", + "@lodestar/utils": "^0.39.0", "@chainsafe/persistent-merkle-tree": "^0.4.2", "@chainsafe/persistent-ts": "^0.19.1", "@chainsafe/ssz": "^0.9.2", diff --git a/packages/beacon-state-transition/src/block/index.ts b/packages/state-transition/src/block/index.ts similarity index 94% rename from packages/beacon-state-transition/src/block/index.ts rename to packages/state-transition/src/block/index.ts index 54f255da5754..1054b704a881 100644 --- a/packages/beacon-state-transition/src/block/index.ts +++ b/packages/state-transition/src/block/index.ts @@ -1,5 +1,5 @@ -import {ForkSeq} from "@chainsafe/lodestar-params"; -import {allForks, altair} from "@chainsafe/lodestar-types"; +import {ForkSeq} from "@lodestar/params"; +import {allForks, altair} from "@lodestar/types"; import {ExecutionEngine} from "../util/executionEngine.js"; import {getFullOrBlindedPayload, isExecutionEnabled} from "../util/bellatrix.js"; import {CachedBeaconStateAllForks, CachedBeaconStateBellatrix} from "../types.js"; diff --git a/packages/beacon-state-transition/src/block/initiateValidatorExit.ts b/packages/state-transition/src/block/initiateValidatorExit.ts similarity index 95% rename from packages/beacon-state-transition/src/block/initiateValidatorExit.ts rename to packages/state-transition/src/block/initiateValidatorExit.ts index 7c4cc5316278..26739d9b83ca 100644 --- a/packages/beacon-state-transition/src/block/initiateValidatorExit.ts +++ b/packages/state-transition/src/block/initiateValidatorExit.ts @@ -1,5 +1,5 @@ -import {FAR_FUTURE_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +import {FAR_FUTURE_EPOCH} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; import {CachedBeaconStateAllForks} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/block/isValidIndexedAttestation.ts b/packages/state-transition/src/block/isValidIndexedAttestation.ts similarity index 94% rename from packages/beacon-state-transition/src/block/isValidIndexedAttestation.ts rename to packages/state-transition/src/block/isValidIndexedAttestation.ts index 49db130f2b41..e3965b97ee73 100644 --- a/packages/beacon-state-transition/src/block/isValidIndexedAttestation.ts +++ b/packages/state-transition/src/block/isValidIndexedAttestation.ts @@ -1,5 +1,5 @@ -import {MAX_VALIDATORS_PER_COMMITTEE} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +import {MAX_VALIDATORS_PER_COMMITTEE} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; import {CachedBeaconStateAllForks} from "../types.js"; import {verifySignatureSet} from "../util/index.js"; import {getIndexedAttestationBigintSignatureSet, getIndexedAttestationSignatureSet} from "../signatureSets/index.js"; diff --git a/packages/beacon-state-transition/src/block/processAttestationPhase0.ts b/packages/state-transition/src/block/processAttestationPhase0.ts similarity index 95% rename from packages/beacon-state-transition/src/block/processAttestationPhase0.ts rename to packages/state-transition/src/block/processAttestationPhase0.ts index 8c796d2d104a..e55d569433de 100644 --- a/packages/beacon-state-transition/src/block/processAttestationPhase0.ts +++ b/packages/state-transition/src/block/processAttestationPhase0.ts @@ -1,6 +1,6 @@ -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {phase0, ssz} from "@lodestar/types"; -import {MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@lodestar/params"; import {toHexString} from "@chainsafe/ssz"; import {computeEpochAtSlot} from "../util/index.js"; import {CachedBeaconStatePhase0, CachedBeaconStateAllForks} from "../types.js"; @@ -11,7 +11,7 @@ import {isValidIndexedAttestation} from "./index.js"; * state.previousEpochAttestations to be processed in bulk at the epoch transition. * * PERF: Work depends on number of Attestation per block. On mainnet the average is 89.7 / block, with 87.8 participant - * true bits on average. See `packages/beacon-state-transition/test/perf/analyzeBlocks.ts` + * true bits on average. See `packages/state-transition/test/perf/analyzeBlocks.ts` */ export function processAttestationPhase0( state: CachedBeaconStatePhase0, diff --git a/packages/beacon-state-transition/src/block/processAttestations.ts b/packages/state-transition/src/block/processAttestations.ts similarity index 87% rename from packages/beacon-state-transition/src/block/processAttestations.ts rename to packages/state-transition/src/block/processAttestations.ts index 79ad519cbdf6..a2976e6491c3 100644 --- a/packages/beacon-state-transition/src/block/processAttestations.ts +++ b/packages/state-transition/src/block/processAttestations.ts @@ -1,5 +1,5 @@ -import {phase0} from "@chainsafe/lodestar-types"; -import {ForkSeq} from "@chainsafe/lodestar-params"; +import {phase0} from "@lodestar/types"; +import {ForkSeq} from "@lodestar/params"; import {CachedBeaconStateAllForks, CachedBeaconStateAltair, CachedBeaconStatePhase0} from "../types.js"; import {processAttestationPhase0} from "./processAttestationPhase0.js"; import {processAttestationsAltair} from "./processAttestationsAltair.js"; diff --git a/packages/beacon-state-transition/src/block/processAttestationsAltair.ts b/packages/state-transition/src/block/processAttestationsAltair.ts similarity index 97% rename from packages/beacon-state-transition/src/block/processAttestationsAltair.ts rename to packages/state-transition/src/block/processAttestationsAltair.ts index 9fd59adcb577..b02ad606534c 100644 --- a/packages/beacon-state-transition/src/block/processAttestationsAltair.ts +++ b/packages/state-transition/src/block/processAttestationsAltair.ts @@ -1,6 +1,6 @@ -import {Epoch, phase0} from "@chainsafe/lodestar-types"; +import {Epoch, phase0} from "@lodestar/types"; import {byteArrayEquals} from "@chainsafe/ssz"; -import {intSqrt} from "@chainsafe/lodestar-utils"; +import {intSqrt} from "@lodestar/utils"; import { MIN_ATTESTATION_INCLUSION_DELAY, @@ -13,7 +13,7 @@ import { TIMELY_TARGET_FLAG_INDEX, TIMELY_TARGET_WEIGHT, WEIGHT_DENOMINATOR, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {increaseBalance, verifySignatureSet} from "../util/index.js"; import {CachedBeaconStateAltair} from "../types.js"; import {RootCache} from "../util/rootCache.js"; diff --git a/packages/beacon-state-transition/src/block/processAttesterSlashing.ts b/packages/state-transition/src/block/processAttesterSlashing.ts similarity index 95% rename from packages/beacon-state-transition/src/block/processAttesterSlashing.ts rename to packages/state-transition/src/block/processAttesterSlashing.ts index 1cdee516878d..a58fd1c6650c 100644 --- a/packages/beacon-state-transition/src/block/processAttesterSlashing.ts +++ b/packages/state-transition/src/block/processAttesterSlashing.ts @@ -1,5 +1,5 @@ -import {phase0} from "@chainsafe/lodestar-types"; -import {ForkSeq} from "@chainsafe/lodestar-params"; +import {phase0} from "@lodestar/types"; +import {ForkSeq} from "@lodestar/params"; import {isSlashableValidator, isSlashableAttestationData, getAttesterSlashableIndices} from "../util/index.js"; import {CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/block/processBlockHeader.ts b/packages/state-transition/src/block/processBlockHeader.ts similarity index 97% rename from packages/beacon-state-transition/src/block/processBlockHeader.ts rename to packages/state-transition/src/block/processBlockHeader.ts index b044f94fe8bc..589a28b459cc 100644 --- a/packages/beacon-state-transition/src/block/processBlockHeader.ts +++ b/packages/state-transition/src/block/processBlockHeader.ts @@ -1,5 +1,5 @@ import {toHexString, byteArrayEquals} from "@chainsafe/ssz"; -import {allForks, ssz, bellatrix} from "@chainsafe/lodestar-types"; +import {allForks, ssz, bellatrix} from "@lodestar/types"; import {CachedBeaconStateAllForks} from "../types.js"; import {ZERO_HASH} from "../constants/index.js"; diff --git a/packages/beacon-state-transition/src/block/processDeposit.ts b/packages/state-transition/src/block/processDeposit.ts similarity index 96% rename from packages/beacon-state-transition/src/block/processDeposit.ts rename to packages/state-transition/src/block/processDeposit.ts index 698ff6c02114..34396a140676 100644 --- a/packages/beacon-state-transition/src/block/processDeposit.ts +++ b/packages/state-transition/src/block/processDeposit.ts @@ -1,7 +1,7 @@ import bls from "@chainsafe/bls"; import {CoordType} from "@chainsafe/bls/types"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {verifyMerkleBranch} from "@chainsafe/lodestar-utils"; +import {phase0, ssz} from "@lodestar/types"; +import {verifyMerkleBranch} from "@lodestar/utils"; import { DEPOSIT_CONTRACT_TREE_DEPTH, DOMAIN_DEPOSIT, @@ -9,7 +9,7 @@ import { FAR_FUTURE_EPOCH, ForkSeq, MAX_EFFECTIVE_BALANCE, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {ZERO_HASH} from "../constants/index.js"; import {computeDomain, computeSigningRoot, increaseBalance} from "../util/index.js"; diff --git a/packages/beacon-state-transition/src/block/processEth1Data.ts b/packages/state-transition/src/block/processEth1Data.ts similarity index 95% rename from packages/beacon-state-transition/src/block/processEth1Data.ts rename to packages/state-transition/src/block/processEth1Data.ts index 76935957315a..12581d148e1a 100644 --- a/packages/beacon-state-transition/src/block/processEth1Data.ts +++ b/packages/state-transition/src/block/processEth1Data.ts @@ -1,5 +1,5 @@ -import {EPOCHS_PER_ETH1_VOTING_PERIOD, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {EPOCHS_PER_ETH1_VOTING_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {phase0, ssz} from "@lodestar/types"; import {Node} from "@chainsafe/persistent-merkle-tree"; import {CompositeViewDU} from "@chainsafe/ssz"; import {BeaconStateAllForks, CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/block/processExecutionPayload.ts b/packages/state-transition/src/block/processExecutionPayload.ts similarity index 98% rename from packages/beacon-state-transition/src/block/processExecutionPayload.ts rename to packages/state-transition/src/block/processExecutionPayload.ts index 7cfd9eb01bb6..b90e8fc78058 100644 --- a/packages/beacon-state-transition/src/block/processExecutionPayload.ts +++ b/packages/state-transition/src/block/processExecutionPayload.ts @@ -1,4 +1,4 @@ -import {ssz, allForks} from "@chainsafe/lodestar-types"; +import {ssz, allForks} from "@lodestar/types"; import {toHexString, byteArrayEquals} from "@chainsafe/ssz"; import {CachedBeaconStateBellatrix} from "../types.js"; import {getRandaoMix} from "../util/index.js"; diff --git a/packages/beacon-state-transition/src/block/processOperations.ts b/packages/state-transition/src/block/processOperations.ts similarity index 93% rename from packages/beacon-state-transition/src/block/processOperations.ts rename to packages/state-transition/src/block/processOperations.ts index a6993cc049f5..a1ab6dc7eff3 100644 --- a/packages/beacon-state-transition/src/block/processOperations.ts +++ b/packages/state-transition/src/block/processOperations.ts @@ -1,5 +1,5 @@ -import {allForks} from "@chainsafe/lodestar-types"; -import {ForkSeq, MAX_DEPOSITS} from "@chainsafe/lodestar-params"; +import {allForks} from "@lodestar/types"; +import {ForkSeq, MAX_DEPOSITS} from "@lodestar/params"; import {CachedBeaconStateAllForks} from "../types.js"; import {processAttestations} from "./processAttestations.js"; diff --git a/packages/beacon-state-transition/src/block/processProposerSlashing.ts b/packages/state-transition/src/block/processProposerSlashing.ts similarity index 95% rename from packages/beacon-state-transition/src/block/processProposerSlashing.ts rename to packages/state-transition/src/block/processProposerSlashing.ts index fd5390b2dd43..991612959df3 100644 --- a/packages/beacon-state-transition/src/block/processProposerSlashing.ts +++ b/packages/state-transition/src/block/processProposerSlashing.ts @@ -1,5 +1,5 @@ -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {ForkSeq} from "@chainsafe/lodestar-params"; +import {phase0, ssz} from "@lodestar/types"; +import {ForkSeq} from "@lodestar/params"; import {isSlashableValidator} from "../util/index.js"; import {verifySignatureSet} from "../util/signatureSets.js"; import {CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/block/processRandao.ts b/packages/state-transition/src/block/processRandao.ts similarity index 89% rename from packages/beacon-state-transition/src/block/processRandao.ts rename to packages/state-transition/src/block/processRandao.ts index daa5443f8f49..cdf659d5f9c4 100644 --- a/packages/beacon-state-transition/src/block/processRandao.ts +++ b/packages/state-transition/src/block/processRandao.ts @@ -1,7 +1,7 @@ import xor from "buffer-xor"; import {digest} from "@chainsafe/as-sha256"; -import {allForks} from "@chainsafe/lodestar-types"; -import {EPOCHS_PER_HISTORICAL_VECTOR} from "@chainsafe/lodestar-params"; +import {allForks} from "@lodestar/types"; +import {EPOCHS_PER_HISTORICAL_VECTOR} from "@lodestar/params"; import {getRandaoMix} from "../util/index.js"; import {verifyRandaoSignature} from "../signatureSets/index.js"; import {CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/block/processSyncCommittee.ts b/packages/state-transition/src/block/processSyncCommittee.ts similarity index 97% rename from packages/beacon-state-transition/src/block/processSyncCommittee.ts rename to packages/state-transition/src/block/processSyncCommittee.ts index 6e391f931f16..0a502abe6e88 100644 --- a/packages/beacon-state-transition/src/block/processSyncCommittee.ts +++ b/packages/state-transition/src/block/processSyncCommittee.ts @@ -1,5 +1,5 @@ -import {altair, ssz} from "@chainsafe/lodestar-types"; -import {DOMAIN_SYNC_COMMITTEE} from "@chainsafe/lodestar-params"; +import {altair, ssz} from "@lodestar/types"; +import {DOMAIN_SYNC_COMMITTEE} from "@lodestar/params"; import {byteArrayEquals} from "@chainsafe/ssz"; import { diff --git a/packages/beacon-state-transition/src/block/processVoluntaryExit.ts b/packages/state-transition/src/block/processVoluntaryExit.ts similarity index 94% rename from packages/beacon-state-transition/src/block/processVoluntaryExit.ts rename to packages/state-transition/src/block/processVoluntaryExit.ts index d96b2c585a25..678da5bec180 100644 --- a/packages/beacon-state-transition/src/block/processVoluntaryExit.ts +++ b/packages/state-transition/src/block/processVoluntaryExit.ts @@ -1,5 +1,5 @@ -import {FAR_FUTURE_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +import {FAR_FUTURE_EPOCH} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; import {isActiveValidator} from "../util/index.js"; import {CachedBeaconStateAllForks} from "../types.js"; import {verifyVoluntaryExitSignature} from "../signatureSets/index.js"; diff --git a/packages/beacon-state-transition/src/block/slashValidator.ts b/packages/state-transition/src/block/slashValidator.ts similarity index 96% rename from packages/beacon-state-transition/src/block/slashValidator.ts rename to packages/state-transition/src/block/slashValidator.ts index 953078e93219..27c6083045f9 100644 --- a/packages/beacon-state-transition/src/block/slashValidator.ts +++ b/packages/state-transition/src/block/slashValidator.ts @@ -1,4 +1,4 @@ -import {ValidatorIndex} from "@chainsafe/lodestar-types"; +import {ValidatorIndex} from "@lodestar/types"; import { EPOCHS_PER_SLASHINGS_VECTOR, ForkSeq, @@ -9,7 +9,7 @@ import { PROPOSER_WEIGHT, WEIGHT_DENOMINATOR, WHISTLEBLOWER_REWARD_QUOTIENT, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {decreaseBalance, increaseBalance} from "../util/index.js"; import {CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/cache/effectiveBalanceIncrements.ts b/packages/state-transition/src/cache/effectiveBalanceIncrements.ts similarity index 96% rename from packages/beacon-state-transition/src/cache/effectiveBalanceIncrements.ts rename to packages/state-transition/src/cache/effectiveBalanceIncrements.ts index 79eeb8951329..a82eb0300432 100644 --- a/packages/beacon-state-transition/src/cache/effectiveBalanceIncrements.ts +++ b/packages/state-transition/src/cache/effectiveBalanceIncrements.ts @@ -1,4 +1,4 @@ -import {EFFECTIVE_BALANCE_INCREMENT} from "@chainsafe/lodestar-params"; +import {EFFECTIVE_BALANCE_INCREMENT} from "@lodestar/params"; import {BeaconStateAllForks} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/cache/epochContext.ts b/packages/state-transition/src/cache/epochContext.ts similarity index 99% rename from packages/beacon-state-transition/src/cache/epochContext.ts rename to packages/state-transition/src/cache/epochContext.ts index dc8a7f85f9c0..85c755eb1e10 100644 --- a/packages/beacon-state-transition/src/cache/epochContext.ts +++ b/packages/state-transition/src/cache/epochContext.ts @@ -1,7 +1,7 @@ import {CoordType} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; -import {BLSSignature, CommitteeIndex, Epoch, Slot, ValidatorIndex, phase0, SyncPeriod} from "@chainsafe/lodestar-types"; -import {createIBeaconConfig, IBeaconConfig, IChainConfig} from "@chainsafe/lodestar-config"; +import {BLSSignature, CommitteeIndex, Epoch, Slot, ValidatorIndex, phase0, SyncPeriod} from "@lodestar/types"; +import {createIBeaconConfig, IBeaconConfig, IChainConfig} from "@lodestar/config"; import { ATTESTATION_SUBNET_COUNT, DOMAIN_BEACON_PROPOSER, @@ -11,8 +11,8 @@ import { PROPOSER_WEIGHT, SLOTS_PER_EPOCH, WEIGHT_DENOMINATOR, -} from "@chainsafe/lodestar-params"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +} from "@lodestar/params"; +import {LodestarError} from "@lodestar/utils"; import { computeActivationExitEpoch, computeEpochAtSlot, diff --git a/packages/beacon-state-transition/src/cache/epochProcess.ts b/packages/state-transition/src/cache/epochProcess.ts similarity index 98% rename from packages/beacon-state-transition/src/cache/epochProcess.ts rename to packages/state-transition/src/cache/epochProcess.ts index f1fc7b6b3c78..e9eb1c2b5ef8 100644 --- a/packages/beacon-state-transition/src/cache/epochProcess.ts +++ b/packages/state-transition/src/cache/epochProcess.ts @@ -1,11 +1,6 @@ -import {Epoch, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {intDiv} from "@chainsafe/lodestar-utils"; -import { - EPOCHS_PER_SLASHINGS_VECTOR, - FAR_FUTURE_EPOCH, - ForkName, - MAX_EFFECTIVE_BALANCE, -} from "@chainsafe/lodestar-params"; +import {Epoch, ValidatorIndex} from "@lodestar/types"; +import {intDiv} from "@lodestar/utils"; +import {EPOCHS_PER_SLASHINGS_VECTOR, FAR_FUTURE_EPOCH, ForkName, MAX_EFFECTIVE_BALANCE} from "@lodestar/params"; import { IAttesterStatus, diff --git a/packages/beacon-state-transition/src/cache/pubkeyCache.ts b/packages/state-transition/src/cache/pubkeyCache.ts similarity index 97% rename from packages/beacon-state-transition/src/cache/pubkeyCache.ts rename to packages/state-transition/src/cache/pubkeyCache.ts index 94b32ce3c518..aca0a4e11727 100644 --- a/packages/beacon-state-transition/src/cache/pubkeyCache.ts +++ b/packages/state-transition/src/cache/pubkeyCache.ts @@ -1,6 +1,6 @@ import {CoordType, PublicKey} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; -import {ValidatorIndex} from "@chainsafe/lodestar-types"; +import {ValidatorIndex} from "@lodestar/types"; import {BeaconStateAllForks} from "./types.js"; export type Index2PubkeyCache = PublicKey[]; diff --git a/packages/beacon-state-transition/src/cache/stateCache.ts b/packages/state-transition/src/cache/stateCache.ts similarity index 99% rename from packages/beacon-state-transition/src/cache/stateCache.ts rename to packages/state-transition/src/cache/stateCache.ts index 452653f013b1..ee00872318e4 100644 --- a/packages/beacon-state-transition/src/cache/stateCache.ts +++ b/packages/state-transition/src/cache/stateCache.ts @@ -1,4 +1,4 @@ -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +import {IBeaconConfig} from "@lodestar/config"; import {EpochContext, EpochContextImmutableData, EpochContextOpts} from "./epochContext.js"; import {BeaconStatePhase0, BeaconStateAltair, BeaconStateBellatrix, BeaconStateAllForks} from "./types.js"; diff --git a/packages/beacon-state-transition/src/cache/syncCommitteeCache.ts b/packages/state-transition/src/cache/syncCommitteeCache.ts similarity index 97% rename from packages/beacon-state-transition/src/cache/syncCommitteeCache.ts rename to packages/state-transition/src/cache/syncCommitteeCache.ts index 88d79403d2c5..88b6f5660daa 100644 --- a/packages/beacon-state-transition/src/cache/syncCommitteeCache.ts +++ b/packages/state-transition/src/cache/syncCommitteeCache.ts @@ -1,4 +1,4 @@ -import {ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {ssz, ValidatorIndex} from "@lodestar/types"; import {CompositeViewDU, toHexString} from "@chainsafe/ssz"; import {PubkeyIndexMap} from "./pubkeyCache.js"; diff --git a/packages/beacon-state-transition/src/cache/types.ts b/packages/state-transition/src/cache/types.ts similarity index 93% rename from packages/beacon-state-transition/src/cache/types.ts rename to packages/state-transition/src/cache/types.ts index 56f91bfd9c9d..ff723f047c49 100644 --- a/packages/beacon-state-transition/src/cache/types.ts +++ b/packages/state-transition/src/cache/types.ts @@ -1,4 +1,4 @@ -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {CompositeViewDU} from "@chainsafe/ssz"; export type BeaconStatePhase0 = CompositeViewDU; diff --git a/packages/beacon-state-transition/src/constants/constants.ts b/packages/state-transition/src/constants/constants.ts similarity index 100% rename from packages/beacon-state-transition/src/constants/constants.ts rename to packages/state-transition/src/constants/constants.ts diff --git a/packages/beacon-state-transition/src/constants/index.ts b/packages/state-transition/src/constants/index.ts similarity index 100% rename from packages/beacon-state-transition/src/constants/index.ts rename to packages/state-transition/src/constants/index.ts diff --git a/packages/beacon-state-transition/src/epoch/getAttestationDeltas.ts b/packages/state-transition/src/epoch/getAttestationDeltas.ts similarity index 98% rename from packages/beacon-state-transition/src/epoch/getAttestationDeltas.ts rename to packages/state-transition/src/epoch/getAttestationDeltas.ts index eeb61fb488df..96e613f0ef13 100644 --- a/packages/beacon-state-transition/src/epoch/getAttestationDeltas.ts +++ b/packages/state-transition/src/epoch/getAttestationDeltas.ts @@ -1,11 +1,11 @@ -import {bigIntSqrt, bnToNum} from "@chainsafe/lodestar-utils"; +import {bigIntSqrt, bnToNum} from "@lodestar/utils"; import { BASE_REWARD_FACTOR, EFFECTIVE_BALANCE_INCREMENT, INACTIVITY_PENALTY_QUOTIENT, MIN_EPOCHS_TO_INACTIVITY_PENALTY, PROPOSER_REWARD_QUOTIENT, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {BASE_REWARDS_PER_EPOCH as BASE_REWARDS_PER_EPOCH_CONST} from "../constants/index.js"; import {newZeroedArray} from "../util/index.js"; import {EpochProcess, CachedBeaconStatePhase0} from "../types.js"; diff --git a/packages/beacon-state-transition/src/epoch/getRewardsAndPenalties.ts b/packages/state-transition/src/epoch/getRewardsAndPenalties.ts similarity index 99% rename from packages/beacon-state-transition/src/epoch/getRewardsAndPenalties.ts rename to packages/state-transition/src/epoch/getRewardsAndPenalties.ts index 1b5da9ed9153..fb92f6939212 100644 --- a/packages/beacon-state-transition/src/epoch/getRewardsAndPenalties.ts +++ b/packages/state-transition/src/epoch/getRewardsAndPenalties.ts @@ -8,7 +8,7 @@ import { TIMELY_TARGET_FLAG_INDEX, WEIGHT_DENOMINATOR, ForkSeq, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {CachedBeaconStateAltair, EpochProcess} from "../types.js"; import { FLAG_ELIGIBLE_ATTESTER, diff --git a/packages/beacon-state-transition/src/epoch/index.ts b/packages/state-transition/src/epoch/index.ts similarity index 97% rename from packages/beacon-state-transition/src/epoch/index.ts rename to packages/state-transition/src/epoch/index.ts index 61d7af97e7f4..33d4aad01438 100644 --- a/packages/beacon-state-transition/src/epoch/index.ts +++ b/packages/state-transition/src/epoch/index.ts @@ -1,4 +1,4 @@ -import {ForkSeq} from "@chainsafe/lodestar-params"; +import {ForkSeq} from "@lodestar/params"; import {CachedBeaconStateAllForks, CachedBeaconStateAltair, CachedBeaconStatePhase0, EpochProcess} from "../types.js"; import {processEffectiveBalanceUpdates} from "./processEffectiveBalanceUpdates.js"; import {processEth1DataReset} from "./processEth1DataReset.js"; diff --git a/packages/beacon-state-transition/src/epoch/processEffectiveBalanceUpdates.ts b/packages/state-transition/src/epoch/processEffectiveBalanceUpdates.ts similarity index 98% rename from packages/beacon-state-transition/src/epoch/processEffectiveBalanceUpdates.ts rename to packages/state-transition/src/epoch/processEffectiveBalanceUpdates.ts index 027cf2d45b8d..563f16f1fdbc 100644 --- a/packages/beacon-state-transition/src/epoch/processEffectiveBalanceUpdates.ts +++ b/packages/state-transition/src/epoch/processEffectiveBalanceUpdates.ts @@ -4,7 +4,7 @@ import { HYSTERESIS_QUOTIENT, HYSTERESIS_UPWARD_MULTIPLIER, MAX_EFFECTIVE_BALANCE, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {EpochProcess, CachedBeaconStateAllForks} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/epoch/processEth1DataReset.ts b/packages/state-transition/src/epoch/processEth1DataReset.ts similarity index 80% rename from packages/beacon-state-transition/src/epoch/processEth1DataReset.ts rename to packages/state-transition/src/epoch/processEth1DataReset.ts index 7ed425ff80f9..c34f1beecdb3 100644 --- a/packages/beacon-state-transition/src/epoch/processEth1DataReset.ts +++ b/packages/state-transition/src/epoch/processEth1DataReset.ts @@ -1,5 +1,5 @@ -import {EPOCHS_PER_ETH1_VOTING_PERIOD} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; +import {EPOCHS_PER_ETH1_VOTING_PERIOD} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; import {EpochProcess, CachedBeaconStateAllForks} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/epoch/processHistoricalRootsUpdate.ts b/packages/state-transition/src/epoch/processHistoricalRootsUpdate.ts similarity index 83% rename from packages/beacon-state-transition/src/epoch/processHistoricalRootsUpdate.ts rename to packages/state-transition/src/epoch/processHistoricalRootsUpdate.ts index 641b4a4b6f16..3bd0aa933036 100644 --- a/packages/beacon-state-transition/src/epoch/processHistoricalRootsUpdate.ts +++ b/packages/state-transition/src/epoch/processHistoricalRootsUpdate.ts @@ -1,6 +1,6 @@ -import {SLOTS_PER_EPOCH, SLOTS_PER_HISTORICAL_ROOT} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; -import {intDiv} from "@chainsafe/lodestar-utils"; +import {SLOTS_PER_EPOCH, SLOTS_PER_HISTORICAL_ROOT} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; +import {intDiv} from "@lodestar/utils"; import {EpochProcess, CachedBeaconStateAllForks} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/epoch/processInactivityUpdates.ts b/packages/state-transition/src/epoch/processInactivityUpdates.ts similarity index 97% rename from packages/beacon-state-transition/src/epoch/processInactivityUpdates.ts rename to packages/state-transition/src/epoch/processInactivityUpdates.ts index 156188855c9d..dd28fd93516d 100644 --- a/packages/beacon-state-transition/src/epoch/processInactivityUpdates.ts +++ b/packages/state-transition/src/epoch/processInactivityUpdates.ts @@ -1,4 +1,4 @@ -import {GENESIS_EPOCH} from "@chainsafe/lodestar-params"; +import {GENESIS_EPOCH} from "@lodestar/params"; import {CachedBeaconStateAltair, EpochProcess} from "../types.js"; import * as attesterStatusUtil from "../util/attesterStatus.js"; import {isInInactivityLeak} from "../util/index.js"; diff --git a/packages/beacon-state-transition/src/epoch/processJustificationAndFinalization.ts b/packages/state-transition/src/epoch/processJustificationAndFinalization.ts similarity index 96% rename from packages/beacon-state-transition/src/epoch/processJustificationAndFinalization.ts rename to packages/state-transition/src/epoch/processJustificationAndFinalization.ts index 002bbd75adca..e99492cba4ea 100644 --- a/packages/beacon-state-transition/src/epoch/processJustificationAndFinalization.ts +++ b/packages/state-transition/src/epoch/processJustificationAndFinalization.ts @@ -1,6 +1,6 @@ -import {GENESIS_EPOCH} from "@chainsafe/lodestar-params"; +import {GENESIS_EPOCH} from "@lodestar/params"; import {BitArray} from "@chainsafe/ssz"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {getBlockRoot} from "../util/index.js"; import {CachedBeaconStateAllForks, EpochProcess} from "../types.js"; diff --git a/packages/beacon-state-transition/src/epoch/processParticipationFlagUpdates.ts b/packages/state-transition/src/epoch/processParticipationFlagUpdates.ts similarity index 96% rename from packages/beacon-state-transition/src/epoch/processParticipationFlagUpdates.ts rename to packages/state-transition/src/epoch/processParticipationFlagUpdates.ts index 0eb9d32166dd..fad5857b3ce6 100644 --- a/packages/beacon-state-transition/src/epoch/processParticipationFlagUpdates.ts +++ b/packages/state-transition/src/epoch/processParticipationFlagUpdates.ts @@ -1,5 +1,5 @@ import {zeroNode} from "@chainsafe/persistent-merkle-tree"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {CachedBeaconStateAltair} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/epoch/processParticipationRecordUpdates.ts b/packages/state-transition/src/epoch/processParticipationRecordUpdates.ts similarity index 91% rename from packages/beacon-state-transition/src/epoch/processParticipationRecordUpdates.ts rename to packages/state-transition/src/epoch/processParticipationRecordUpdates.ts index 56d7e733a6e3..3eb208afd057 100644 --- a/packages/beacon-state-transition/src/epoch/processParticipationRecordUpdates.ts +++ b/packages/state-transition/src/epoch/processParticipationRecordUpdates.ts @@ -1,4 +1,4 @@ -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {CachedBeaconStatePhase0} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/epoch/processPendingAttestations.ts b/packages/state-transition/src/epoch/processPendingAttestations.ts similarity index 97% rename from packages/beacon-state-transition/src/epoch/processPendingAttestations.ts rename to packages/state-transition/src/epoch/processPendingAttestations.ts index 6bbd430591f3..d7690e106049 100644 --- a/packages/beacon-state-transition/src/epoch/processPendingAttestations.ts +++ b/packages/state-transition/src/epoch/processPendingAttestations.ts @@ -1,4 +1,4 @@ -import {Epoch, phase0} from "@chainsafe/lodestar-types"; +import {Epoch, phase0} from "@lodestar/types"; import {byteArrayEquals} from "@chainsafe/ssz"; import {CachedBeaconStatePhase0} from "../types.js"; import {computeStartSlotAtEpoch, getBlockRootAtSlot, IAttesterStatus} from "../util/index.js"; diff --git a/packages/beacon-state-transition/src/epoch/processRandaoMixesReset.ts b/packages/state-transition/src/epoch/processRandaoMixesReset.ts similarity index 87% rename from packages/beacon-state-transition/src/epoch/processRandaoMixesReset.ts rename to packages/state-transition/src/epoch/processRandaoMixesReset.ts index 8d47657e7efd..81cf69f4ea40 100644 --- a/packages/beacon-state-transition/src/epoch/processRandaoMixesReset.ts +++ b/packages/state-transition/src/epoch/processRandaoMixesReset.ts @@ -1,4 +1,4 @@ -import {EPOCHS_PER_HISTORICAL_VECTOR} from "@chainsafe/lodestar-params"; +import {EPOCHS_PER_HISTORICAL_VECTOR} from "@lodestar/params"; import {EpochProcess, CachedBeaconStateAllForks} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/epoch/processRegistryUpdates.ts b/packages/state-transition/src/epoch/processRegistryUpdates.ts similarity index 100% rename from packages/beacon-state-transition/src/epoch/processRegistryUpdates.ts rename to packages/state-transition/src/epoch/processRegistryUpdates.ts diff --git a/packages/beacon-state-transition/src/epoch/processRewardsAndPenalties.ts b/packages/state-transition/src/epoch/processRewardsAndPenalties.ts similarity index 94% rename from packages/beacon-state-transition/src/epoch/processRewardsAndPenalties.ts rename to packages/state-transition/src/epoch/processRewardsAndPenalties.ts index 88db889c02ed..5660516f64e9 100644 --- a/packages/beacon-state-transition/src/epoch/processRewardsAndPenalties.ts +++ b/packages/state-transition/src/epoch/processRewardsAndPenalties.ts @@ -1,5 +1,5 @@ -import {ForkSeq, GENESIS_EPOCH} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ForkSeq, GENESIS_EPOCH} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; import {CachedBeaconStateAllForks, CachedBeaconStateAltair, CachedBeaconStatePhase0, EpochProcess} from "../types.js"; import {getAttestationDeltas} from "./getAttestationDeltas.js"; import {getRewardsAndPenaltiesAltair} from "./getRewardsAndPenalties.js"; diff --git a/packages/beacon-state-transition/src/epoch/processSlashings.ts b/packages/state-transition/src/epoch/processSlashings.ts similarity index 96% rename from packages/beacon-state-transition/src/epoch/processSlashings.ts rename to packages/state-transition/src/epoch/processSlashings.ts index 025c8bcd3a9e..86c88f28eb33 100644 --- a/packages/beacon-state-transition/src/epoch/processSlashings.ts +++ b/packages/state-transition/src/epoch/processSlashings.ts @@ -1,11 +1,11 @@ -import {bigIntMin} from "@chainsafe/lodestar-utils"; +import {bigIntMin} from "@lodestar/utils"; import { EFFECTIVE_BALANCE_INCREMENT, ForkSeq, PROPORTIONAL_SLASHING_MULTIPLIER, PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR, PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {decreaseBalance} from "../util/index.js"; import {CachedBeaconStateAllForks, EpochProcess} from "../types.js"; diff --git a/packages/beacon-state-transition/src/epoch/processSlashingsReset.ts b/packages/state-transition/src/epoch/processSlashingsReset.ts similarity index 85% rename from packages/beacon-state-transition/src/epoch/processSlashingsReset.ts rename to packages/state-transition/src/epoch/processSlashingsReset.ts index 5bf7cd0e5a55..3914b368cbb5 100644 --- a/packages/beacon-state-transition/src/epoch/processSlashingsReset.ts +++ b/packages/state-transition/src/epoch/processSlashingsReset.ts @@ -1,4 +1,4 @@ -import {EPOCHS_PER_SLASHINGS_VECTOR} from "@chainsafe/lodestar-params"; +import {EPOCHS_PER_SLASHINGS_VECTOR} from "@lodestar/params"; import {EpochProcess, CachedBeaconStateAllForks} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/epoch/processSyncCommitteeUpdates.ts b/packages/state-transition/src/epoch/processSyncCommitteeUpdates.ts similarity index 92% rename from packages/beacon-state-transition/src/epoch/processSyncCommitteeUpdates.ts rename to packages/state-transition/src/epoch/processSyncCommitteeUpdates.ts index f52f5d5a0937..81c4a28cefa1 100644 --- a/packages/beacon-state-transition/src/epoch/processSyncCommitteeUpdates.ts +++ b/packages/state-transition/src/epoch/processSyncCommitteeUpdates.ts @@ -1,6 +1,6 @@ import bls from "@chainsafe/bls"; -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; import {getNextSyncCommitteeIndices} from "../util/seed.js"; import {CachedBeaconStateAltair} from "../types.js"; diff --git a/packages/beacon-state-transition/src/index.ts b/packages/state-transition/src/index.ts similarity index 100% rename from packages/beacon-state-transition/src/index.ts rename to packages/state-transition/src/index.ts diff --git a/packages/beacon-state-transition/src/metrics.ts b/packages/state-transition/src/metrics.ts similarity index 87% rename from packages/beacon-state-transition/src/metrics.ts rename to packages/state-transition/src/metrics.ts index 3c0eaf37c4d4..fa8cd8eadb5d 100644 --- a/packages/beacon-state-transition/src/metrics.ts +++ b/packages/state-transition/src/metrics.ts @@ -1,4 +1,4 @@ -import {Epoch} from "@chainsafe/lodestar-types"; +import {Epoch} from "@lodestar/types"; import {IAttesterStatus} from "./util/attesterStatus.js"; export interface IBeaconStateTransitionMetrics { diff --git a/packages/beacon-state-transition/src/signatureSets/attesterSlashings.ts b/packages/state-transition/src/signatureSets/attesterSlashings.ts similarity index 92% rename from packages/beacon-state-transition/src/signatureSets/attesterSlashings.ts rename to packages/state-transition/src/signatureSets/attesterSlashings.ts index a29675d5ab8e..d0bd622dba9d 100644 --- a/packages/beacon-state-transition/src/signatureSets/attesterSlashings.ts +++ b/packages/state-transition/src/signatureSets/attesterSlashings.ts @@ -1,5 +1,5 @@ -import {allForks, phase0, ssz} from "@chainsafe/lodestar-types"; -import {DOMAIN_BEACON_ATTESTER} from "@chainsafe/lodestar-params"; +import {allForks, phase0, ssz} from "@lodestar/types"; +import {DOMAIN_BEACON_ATTESTER} from "@lodestar/params"; import {computeSigningRoot, computeStartSlotAtEpoch, ISignatureSet, SignatureSetType} from "../util/index.js"; import {CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/signatureSets/index.ts b/packages/state-transition/src/signatureSets/index.ts similarity index 97% rename from packages/beacon-state-transition/src/signatureSets/index.ts rename to packages/state-transition/src/signatureSets/index.ts index 5edece490057..7a0c1308f60d 100644 --- a/packages/beacon-state-transition/src/signatureSets/index.ts +++ b/packages/state-transition/src/signatureSets/index.ts @@ -1,4 +1,4 @@ -import {allForks, altair} from "@chainsafe/lodestar-types"; +import {allForks, altair} from "@lodestar/types"; import {computeEpochAtSlot, ISignatureSet} from "../util/index.js"; import {CachedBeaconStateAllForks, CachedBeaconStateAltair} from "../types.js"; import {getSyncCommitteeSignatureSet} from "../block/processSyncCommittee.js"; diff --git a/packages/beacon-state-transition/src/signatureSets/indexedAttestation.ts b/packages/state-transition/src/signatureSets/indexedAttestation.ts similarity index 91% rename from packages/beacon-state-transition/src/signatureSets/indexedAttestation.ts rename to packages/state-transition/src/signatureSets/indexedAttestation.ts index d38f8a0b5766..b555d508c6c4 100644 --- a/packages/beacon-state-transition/src/signatureSets/indexedAttestation.ts +++ b/packages/state-transition/src/signatureSets/indexedAttestation.ts @@ -1,5 +1,5 @@ -import {DOMAIN_BEACON_ATTESTER} from "@chainsafe/lodestar-params"; -import {allForks, phase0, ssz} from "@chainsafe/lodestar-types"; +import {DOMAIN_BEACON_ATTESTER} from "@lodestar/params"; +import {allForks, phase0, ssz} from "@lodestar/types"; import {computeSigningRoot, computeStartSlotAtEpoch, ISignatureSet, SignatureSetType} from "../util/index.js"; import {CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/signatureSets/proposer.ts b/packages/state-transition/src/signatureSets/proposer.ts similarity index 90% rename from packages/beacon-state-transition/src/signatureSets/proposer.ts rename to packages/state-transition/src/signatureSets/proposer.ts index 22ff1eb9932e..9ac39dbc1373 100644 --- a/packages/beacon-state-transition/src/signatureSets/proposer.ts +++ b/packages/state-transition/src/signatureSets/proposer.ts @@ -1,5 +1,5 @@ -import {DOMAIN_BEACON_PROPOSER} from "@chainsafe/lodestar-params"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; +import {DOMAIN_BEACON_PROPOSER} from "@lodestar/params"; +import {allForks, ssz} from "@lodestar/types"; import {computeSigningRoot, isBlindedBeaconBlock} from "../util/index.js"; import {ISignatureSet, SignatureSetType, verifySignatureSet} from "../util/signatureSets.js"; import {CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/signatureSets/proposerSlashings.ts b/packages/state-transition/src/signatureSets/proposerSlashings.ts similarity index 91% rename from packages/beacon-state-transition/src/signatureSets/proposerSlashings.ts rename to packages/state-transition/src/signatureSets/proposerSlashings.ts index 048a2c6b44c2..9bfece61a8a9 100644 --- a/packages/beacon-state-transition/src/signatureSets/proposerSlashings.ts +++ b/packages/state-transition/src/signatureSets/proposerSlashings.ts @@ -1,5 +1,5 @@ -import {DOMAIN_BEACON_PROPOSER} from "@chainsafe/lodestar-params"; -import {allForks, phase0, ssz} from "@chainsafe/lodestar-types"; +import {DOMAIN_BEACON_PROPOSER} from "@lodestar/params"; +import {allForks, phase0, ssz} from "@lodestar/types"; import {computeSigningRoot, ISignatureSet, SignatureSetType} from "../util/index.js"; import {CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/signatureSets/randao.ts b/packages/state-transition/src/signatureSets/randao.ts similarity index 89% rename from packages/beacon-state-transition/src/signatureSets/randao.ts rename to packages/state-transition/src/signatureSets/randao.ts index b039baaf37d2..5af17b4d9eac 100644 --- a/packages/beacon-state-transition/src/signatureSets/randao.ts +++ b/packages/state-transition/src/signatureSets/randao.ts @@ -1,5 +1,5 @@ -import {DOMAIN_RANDAO} from "@chainsafe/lodestar-params"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; +import {DOMAIN_RANDAO} from "@lodestar/params"; +import {allForks, ssz} from "@lodestar/types"; import { computeEpochAtSlot, computeSigningRoot, diff --git a/packages/beacon-state-transition/src/signatureSets/voluntaryExits.ts b/packages/state-transition/src/signatureSets/voluntaryExits.ts similarity index 91% rename from packages/beacon-state-transition/src/signatureSets/voluntaryExits.ts rename to packages/state-transition/src/signatureSets/voluntaryExits.ts index 9270e16b4f53..9c7665575880 100644 --- a/packages/beacon-state-transition/src/signatureSets/voluntaryExits.ts +++ b/packages/state-transition/src/signatureSets/voluntaryExits.ts @@ -1,5 +1,5 @@ -import {DOMAIN_VOLUNTARY_EXIT} from "@chainsafe/lodestar-params"; -import {allForks, phase0, ssz} from "@chainsafe/lodestar-types"; +import {DOMAIN_VOLUNTARY_EXIT} from "@lodestar/params"; +import {allForks, phase0, ssz} from "@lodestar/types"; import { computeSigningRoot, computeStartSlotAtEpoch, diff --git a/packages/beacon-state-transition/src/slot/index.ts b/packages/state-transition/src/slot/index.ts similarity index 93% rename from packages/beacon-state-transition/src/slot/index.ts rename to packages/state-transition/src/slot/index.ts index 1f858340c3a8..a9779e0dec73 100644 --- a/packages/beacon-state-transition/src/slot/index.ts +++ b/packages/state-transition/src/slot/index.ts @@ -1,4 +1,4 @@ -import {SLOTS_PER_HISTORICAL_ROOT} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_HISTORICAL_ROOT} from "@lodestar/params"; import {byteArrayEquals} from "@chainsafe/ssz"; import {CachedBeaconStateAllForks} from "../types.js"; import {ZERO_HASH} from "../constants/index.js"; diff --git a/packages/beacon-state-transition/src/slot/upgradeStateToAltair.ts b/packages/state-transition/src/slot/upgradeStateToAltair.ts similarity index 99% rename from packages/beacon-state-transition/src/slot/upgradeStateToAltair.ts rename to packages/state-transition/src/slot/upgradeStateToAltair.ts index 8d726078740f..f52497420708 100644 --- a/packages/beacon-state-transition/src/slot/upgradeStateToAltair.ts +++ b/packages/state-transition/src/slot/upgradeStateToAltair.ts @@ -1,4 +1,4 @@ -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {CompositeViewDU} from "@chainsafe/ssz"; import {CachedBeaconStatePhase0, CachedBeaconStateAltair} from "../types.js"; import {newZeroedArray, RootCache} from "../util/index.js"; diff --git a/packages/beacon-state-transition/src/slot/upgradeStateToBellatrix.ts b/packages/state-transition/src/slot/upgradeStateToBellatrix.ts similarity index 98% rename from packages/beacon-state-transition/src/slot/upgradeStateToBellatrix.ts rename to packages/state-transition/src/slot/upgradeStateToBellatrix.ts index aec99b7eb494..455bf548939a 100644 --- a/packages/beacon-state-transition/src/slot/upgradeStateToBellatrix.ts +++ b/packages/state-transition/src/slot/upgradeStateToBellatrix.ts @@ -1,4 +1,4 @@ -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {CachedBeaconStateAltair, CachedBeaconStateBellatrix} from "../types.js"; import {getCachedBeaconState} from "../cache/stateCache.js"; diff --git a/packages/beacon-state-transition/src/stateTransition.ts b/packages/state-transition/src/stateTransition.ts similarity index 97% rename from packages/beacon-state-transition/src/stateTransition.ts rename to packages/state-transition/src/stateTransition.ts index 51bbf0ab974d..f91502d20f43 100644 --- a/packages/beacon-state-transition/src/stateTransition.ts +++ b/packages/state-transition/src/stateTransition.ts @@ -1,6 +1,6 @@ /* eslint-disable import/namespace */ -import {allForks, Slot, ssz} from "@chainsafe/lodestar-types"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {allForks, Slot, ssz} from "@lodestar/types"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {toHexString} from "@chainsafe/ssz"; import {IBeaconStateTransitionMetrics} from "./metrics.js"; import {beforeProcessEpoch} from "./cache/epochProcess.js"; diff --git a/packages/beacon-state-transition/src/types.ts b/packages/state-transition/src/types.ts similarity index 100% rename from packages/beacon-state-transition/src/types.ts rename to packages/state-transition/src/types.ts diff --git a/packages/beacon-state-transition/src/util/aggregator.ts b/packages/state-transition/src/util/aggregator.ts similarity index 88% rename from packages/beacon-state-transition/src/util/aggregator.ts rename to packages/state-transition/src/util/aggregator.ts index 2595ea456789..02afda67cc42 100644 --- a/packages/beacon-state-transition/src/util/aggregator.ts +++ b/packages/state-transition/src/util/aggregator.ts @@ -1,12 +1,12 @@ import {digest} from "@chainsafe/as-sha256"; -import {BLSSignature} from "@chainsafe/lodestar-types"; -import {intDiv, bytesToBigInt} from "@chainsafe/lodestar-utils"; +import {BLSSignature} from "@lodestar/types"; +import {intDiv, bytesToBigInt} from "@lodestar/utils"; import { TARGET_AGGREGATORS_PER_COMMITTEE, SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT, TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; const ZERO_BIGINT = BigInt(0); diff --git a/packages/beacon-state-transition/src/util/altair.ts b/packages/state-transition/src/util/altair.ts similarity index 84% rename from packages/beacon-state-transition/src/util/altair.ts rename to packages/state-transition/src/util/altair.ts index 00e716c9d68a..6fa0853c3a13 100644 --- a/packages/beacon-state-transition/src/util/altair.ts +++ b/packages/state-transition/src/util/altair.ts @@ -1,5 +1,5 @@ -import {BASE_REWARD_FACTOR, EFFECTIVE_BALANCE_INCREMENT} from "@chainsafe/lodestar-params"; -import {bigIntSqrt, bnToNum} from "@chainsafe/lodestar-utils"; +import {BASE_REWARD_FACTOR, EFFECTIVE_BALANCE_INCREMENT} from "@lodestar/params"; +import {bigIntSqrt, bnToNum} from "@lodestar/utils"; /** * Before we manage bigIntSqrt(totalActiveStake) as BigInt and return BigInt. diff --git a/packages/beacon-state-transition/src/util/array.ts b/packages/state-transition/src/util/array.ts similarity index 100% rename from packages/beacon-state-transition/src/util/array.ts rename to packages/state-transition/src/util/array.ts diff --git a/packages/beacon-state-transition/src/util/attestation.ts b/packages/state-transition/src/util/attestation.ts similarity index 92% rename from packages/beacon-state-transition/src/util/attestation.ts rename to packages/state-transition/src/util/attestation.ts index e25dd629a9de..87734bace353 100644 --- a/packages/beacon-state-transition/src/util/attestation.ts +++ b/packages/state-transition/src/util/attestation.ts @@ -2,8 +2,8 @@ * @module chain/stateTransition/util */ -import {MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0, Slot, ssz, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {phase0, Slot, ssz, ValidatorIndex} from "@lodestar/types"; /** * Check if [[data1]] and [[data2]] are slashable according to Casper FFG rules. diff --git a/packages/beacon-state-transition/src/util/attesterStatus.ts b/packages/state-transition/src/util/attesterStatus.ts similarity index 100% rename from packages/beacon-state-transition/src/util/attesterStatus.ts rename to packages/state-transition/src/util/attesterStatus.ts diff --git a/packages/beacon-state-transition/src/util/balance.ts b/packages/state-transition/src/util/balance.ts similarity index 93% rename from packages/beacon-state-transition/src/util/balance.ts rename to packages/state-transition/src/util/balance.ts index 263bfccd4826..5fe5ff332966 100644 --- a/packages/beacon-state-transition/src/util/balance.ts +++ b/packages/state-transition/src/util/balance.ts @@ -2,9 +2,9 @@ * @module chain/stateTransition/util */ -import {EFFECTIVE_BALANCE_INCREMENT} from "@chainsafe/lodestar-params"; -import {Gwei, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {bigIntMax} from "@chainsafe/lodestar-utils"; +import {EFFECTIVE_BALANCE_INCREMENT} from "@lodestar/params"; +import {Gwei, ValidatorIndex} from "@lodestar/types"; +import {bigIntMax} from "@lodestar/utils"; import {EffectiveBalanceIncrements} from "../cache/effectiveBalanceIncrements.js"; import {BeaconStateAllForks} from ".."; import {CachedBeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/util/bellatrix.ts b/packages/state-transition/src/util/bellatrix.ts similarity index 98% rename from packages/beacon-state-transition/src/util/bellatrix.ts rename to packages/state-transition/src/util/bellatrix.ts index b9c614af6a82..66072b69b461 100644 --- a/packages/beacon-state-transition/src/util/bellatrix.ts +++ b/packages/state-transition/src/util/bellatrix.ts @@ -1,4 +1,4 @@ -import {allForks, bellatrix, ssz} from "@chainsafe/lodestar-types"; +import {allForks, bellatrix, ssz} from "@lodestar/types"; import { BeaconStateBellatrix, BeaconStateAllForks, diff --git a/packages/beacon-state-transition/src/util/blockRoot.ts b/packages/state-transition/src/util/blockRoot.ts similarity index 89% rename from packages/beacon-state-transition/src/util/blockRoot.ts rename to packages/state-transition/src/util/blockRoot.ts index d70510c5e73f..635374a932c4 100644 --- a/packages/beacon-state-transition/src/util/blockRoot.ts +++ b/packages/state-transition/src/util/blockRoot.ts @@ -2,10 +2,10 @@ * @module chain/stateTransition/util */ -import {Epoch, Slot, Root, phase0, allForks} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {Epoch, Slot, Root, phase0, allForks} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; -import {SLOTS_PER_HISTORICAL_ROOT} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_HISTORICAL_ROOT} from "@lodestar/params"; import {ZERO_HASH} from "../constants/index.js"; import {BeaconStateAllForks} from "../types.js"; import {computeStartSlotAtEpoch} from "./epoch.js"; diff --git a/packages/beacon-state-transition/src/util/domain.ts b/packages/state-transition/src/util/domain.ts similarity index 92% rename from packages/beacon-state-transition/src/util/domain.ts rename to packages/state-transition/src/util/domain.ts index d74a859ad292..b029926c8dcf 100644 --- a/packages/beacon-state-transition/src/util/domain.ts +++ b/packages/state-transition/src/util/domain.ts @@ -1,7 +1,7 @@ /** * @module chain/stateTransition/util */ -import {Epoch, Version, Root, DomainType, phase0, ssz} from "@chainsafe/lodestar-types"; +import {Epoch, Version, Root, DomainType, phase0, ssz} from "@lodestar/types"; // Only used by processDeposit + lightclient /** diff --git a/packages/beacon-state-transition/src/util/epoch.ts b/packages/state-transition/src/util/epoch.ts similarity index 86% rename from packages/beacon-state-transition/src/util/epoch.ts rename to packages/state-transition/src/util/epoch.ts index 7262cd2a605c..fca9eafe1191 100644 --- a/packages/beacon-state-transition/src/util/epoch.ts +++ b/packages/state-transition/src/util/epoch.ts @@ -2,13 +2,8 @@ * @module chain/stateTransition/util */ -import { - EPOCHS_PER_SYNC_COMMITTEE_PERIOD, - GENESIS_EPOCH, - MAX_SEED_LOOKAHEAD, - SLOTS_PER_EPOCH, -} from "@chainsafe/lodestar-params"; -import {allForks, Epoch, Slot, SyncPeriod} from "@chainsafe/lodestar-types"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, GENESIS_EPOCH, MAX_SEED_LOOKAHEAD, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {allForks, Epoch, Slot, SyncPeriod} from "@lodestar/types"; /** * Return the epoch number at the given slot. diff --git a/packages/beacon-state-transition/src/util/epochShuffling.ts b/packages/state-transition/src/util/epochShuffling.ts similarity index 94% rename from packages/beacon-state-transition/src/util/epochShuffling.ts rename to packages/state-transition/src/util/epochShuffling.ts index dbb4fcbb5744..4f3eee2458e4 100644 --- a/packages/beacon-state-transition/src/util/epochShuffling.ts +++ b/packages/state-transition/src/util/epochShuffling.ts @@ -1,11 +1,11 @@ -import {Epoch, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {intDiv} from "@chainsafe/lodestar-utils"; +import {Epoch, ValidatorIndex} from "@lodestar/types"; +import {intDiv} from "@lodestar/utils"; import { DOMAIN_BEACON_ATTESTER, MAX_COMMITTEES_PER_SLOT, SLOTS_PER_EPOCH, TARGET_COMMITTEE_SIZE, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {BeaconStateAllForks} from "../types.js"; import {getSeed} from "./seed.js"; import {unshuffleList} from "./shuffle.js"; diff --git a/packages/beacon-state-transition/src/util/executionEngine.ts b/packages/state-transition/src/util/executionEngine.ts similarity index 91% rename from packages/beacon-state-transition/src/util/executionEngine.ts rename to packages/state-transition/src/util/executionEngine.ts index 707a789630b6..cd4b41bd2d5f 100644 --- a/packages/beacon-state-transition/src/util/executionEngine.ts +++ b/packages/state-transition/src/util/executionEngine.ts @@ -1,4 +1,4 @@ -import {bellatrix} from "@chainsafe/lodestar-types"; +import {bellatrix} from "@lodestar/types"; export type ExecutionEngine = { /** diff --git a/packages/beacon-state-transition/src/util/finality.ts b/packages/state-transition/src/util/finality.ts similarity index 91% rename from packages/beacon-state-transition/src/util/finality.ts rename to packages/state-transition/src/util/finality.ts index a856084c037a..6d045e6e920a 100644 --- a/packages/beacon-state-transition/src/util/finality.ts +++ b/packages/state-transition/src/util/finality.ts @@ -1,4 +1,4 @@ -import {MIN_EPOCHS_TO_INACTIVITY_PENALTY} from "@chainsafe/lodestar-params"; +import {MIN_EPOCHS_TO_INACTIVITY_PENALTY} from "@lodestar/params"; import {CachedBeaconStateAllForks} from "../types.js"; export function getFinalityDelay(state: CachedBeaconStateAllForks): number { diff --git a/packages/beacon-state-transition/src/util/genesis.ts b/packages/state-transition/src/util/genesis.ts similarity index 98% rename from packages/beacon-state-transition/src/util/genesis.ts rename to packages/state-transition/src/util/genesis.ts index 7b874beded7f..a57694df8207 100644 --- a/packages/beacon-state-transition/src/util/genesis.ts +++ b/packages/state-transition/src/util/genesis.ts @@ -1,4 +1,4 @@ -import {IBeaconConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; +import {IBeaconConfig, IChainForkConfig} from "@lodestar/config"; import { EFFECTIVE_BALANCE_INCREMENT, EPOCHS_PER_HISTORICAL_VECTOR, @@ -6,8 +6,8 @@ import { GENESIS_EPOCH, GENESIS_SLOT, MAX_EFFECTIVE_BALANCE, -} from "@chainsafe/lodestar-params"; -import {Bytes32, phase0, Root, ssz, TimeSeconds} from "@chainsafe/lodestar-types"; +} from "@lodestar/params"; +import {Bytes32, phase0, Root, ssz, TimeSeconds} from "@lodestar/types"; import {CompositeViewDU, ListCompositeType} from "@chainsafe/ssz"; import {CachedBeaconStateAllForks, BeaconStateAllForks} from "../types.js"; diff --git a/packages/beacon-state-transition/src/util/index.ts b/packages/state-transition/src/util/index.ts similarity index 100% rename from packages/beacon-state-transition/src/util/index.ts rename to packages/state-transition/src/util/index.ts diff --git a/packages/beacon-state-transition/src/util/interop.ts b/packages/state-transition/src/util/interop.ts similarity index 92% rename from packages/beacon-state-transition/src/util/interop.ts rename to packages/state-transition/src/util/interop.ts index 50beac1f4809..48b9b432d28f 100644 --- a/packages/beacon-state-transition/src/util/interop.ts +++ b/packages/state-transition/src/util/interop.ts @@ -2,7 +2,7 @@ import {toBufferBE} from "bigint-buffer"; import {digest} from "@chainsafe/as-sha256"; import type {SecretKey} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; -import {bytesToBigInt, intToBytes} from "@chainsafe/lodestar-utils"; +import {bytesToBigInt, intToBytes} from "@lodestar/utils"; let curveOrder: bigint; function getCurveOrder(): bigint { diff --git a/packages/beacon-state-transition/src/util/rootCache.ts b/packages/state-transition/src/util/rootCache.ts similarity index 94% rename from packages/beacon-state-transition/src/util/rootCache.ts rename to packages/state-transition/src/util/rootCache.ts index abd726289600..f3fc5b52ff52 100644 --- a/packages/beacon-state-transition/src/util/rootCache.ts +++ b/packages/state-transition/src/util/rootCache.ts @@ -1,4 +1,4 @@ -import {Epoch, phase0, Root, Slot} from "@chainsafe/lodestar-types"; +import {Epoch, phase0, Root, Slot} from "@lodestar/types"; import {CachedBeaconStateAllForks} from "../types.js"; import {getBlockRoot, getBlockRootAtSlot} from "./blockRoot.js"; diff --git a/packages/beacon-state-transition/src/util/seed.ts b/packages/state-transition/src/util/seed.ts similarity index 96% rename from packages/beacon-state-transition/src/util/seed.ts rename to packages/state-transition/src/util/seed.ts index 02efb493d413..9291a0b979d7 100644 --- a/packages/beacon-state-transition/src/util/seed.ts +++ b/packages/state-transition/src/util/seed.ts @@ -3,8 +3,8 @@ */ import {digest} from "@chainsafe/as-sha256"; -import {Epoch, Bytes32, DomainType, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {assert, bytesToBigInt, intToBytes} from "@chainsafe/lodestar-utils"; +import {Epoch, Bytes32, DomainType, ValidatorIndex} from "@lodestar/types"; +import {assert, bytesToBigInt, intToBytes} from "@lodestar/utils"; import { DOMAIN_SYNC_COMMITTEE, EFFECTIVE_BALANCE_INCREMENT, @@ -14,7 +14,7 @@ import { SHUFFLE_ROUND_COUNT, SLOTS_PER_EPOCH, SYNC_COMMITTEE_SIZE, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {BeaconStateAllForks} from "../types.js"; import {EffectiveBalanceIncrements} from "../cache/effectiveBalanceIncrements.js"; import {computeStartSlotAtEpoch} from "./epoch.js"; diff --git a/packages/beacon-state-transition/src/util/shuffle.ts b/packages/state-transition/src/util/shuffle.ts similarity index 97% rename from packages/beacon-state-transition/src/util/shuffle.ts rename to packages/state-transition/src/util/shuffle.ts index 15462a899f94..5e44d485dde5 100644 --- a/packages/beacon-state-transition/src/util/shuffle.ts +++ b/packages/state-transition/src/util/shuffle.ts @@ -2,9 +2,9 @@ * @module util/objects */ import {digest} from "@chainsafe/as-sha256"; -import {SHUFFLE_ROUND_COUNT} from "@chainsafe/lodestar-params"; -import {ValidatorIndex, Bytes32} from "@chainsafe/lodestar-types"; -import {assert, bytesToBigInt} from "@chainsafe/lodestar-utils"; +import {SHUFFLE_ROUND_COUNT} from "@lodestar/params"; +import {ValidatorIndex, Bytes32} from "@lodestar/types"; +import {assert, bytesToBigInt} from "@lodestar/utils"; // ShuffleList shuffles a list, using the given seed for randomness. Mutates the input list. export function shuffleList(input: ValidatorIndex[], seed: Bytes32): void { diff --git a/packages/beacon-state-transition/src/util/shufflingDecisionRoot.ts b/packages/state-transition/src/util/shufflingDecisionRoot.ts similarity index 98% rename from packages/beacon-state-transition/src/util/shufflingDecisionRoot.ts rename to packages/state-transition/src/util/shufflingDecisionRoot.ts index 17e53a6c0593..10af814e9af3 100644 --- a/packages/beacon-state-transition/src/util/shufflingDecisionRoot.ts +++ b/packages/state-transition/src/util/shufflingDecisionRoot.ts @@ -1,4 +1,4 @@ -import {Epoch, Root, Slot} from "@chainsafe/lodestar-types"; +import {Epoch, Root, Slot} from "@lodestar/types"; import {CachedBeaconStateAllForks} from "../types.js"; import {getBlockRootAtSlot} from "./blockRoot.js"; import {computeStartSlotAtEpoch} from "./epoch.js"; diff --git a/packages/beacon-state-transition/src/util/signatureSets.ts b/packages/state-transition/src/util/signatureSets.ts similarity index 95% rename from packages/beacon-state-transition/src/util/signatureSets.ts rename to packages/state-transition/src/util/signatureSets.ts index 2f2c7beafa36..7342efc4b757 100644 --- a/packages/beacon-state-transition/src/util/signatureSets.ts +++ b/packages/state-transition/src/util/signatureSets.ts @@ -1,6 +1,6 @@ import type {PublicKey} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; -import {Root} from "@chainsafe/lodestar-types"; +import {Root} from "@lodestar/types"; export enum SignatureSetType { single = "single", diff --git a/packages/beacon-state-transition/src/util/signingRoot.ts b/packages/state-transition/src/util/signingRoot.ts similarity index 86% rename from packages/beacon-state-transition/src/util/signingRoot.ts rename to packages/state-transition/src/util/signingRoot.ts index 6f02ba969d8e..c5b20917c63f 100644 --- a/packages/beacon-state-transition/src/util/signingRoot.ts +++ b/packages/state-transition/src/util/signingRoot.ts @@ -1,4 +1,4 @@ -import {Domain, phase0, ssz} from "@chainsafe/lodestar-types"; +import {Domain, phase0, ssz} from "@lodestar/types"; import {Type} from "@chainsafe/ssz"; /** diff --git a/packages/beacon-state-transition/src/util/slot.ts b/packages/state-transition/src/util/slot.ts similarity index 83% rename from packages/beacon-state-transition/src/util/slot.ts rename to packages/state-transition/src/util/slot.ts index 1ab4ea2b7cf4..7f840f5fc652 100644 --- a/packages/beacon-state-transition/src/util/slot.ts +++ b/packages/state-transition/src/util/slot.ts @@ -1,6 +1,6 @@ -import {IChainConfig} from "@chainsafe/lodestar-config"; -import {GENESIS_SLOT, INTERVALS_PER_SLOT} from "@chainsafe/lodestar-params"; -import {Slot, Epoch, TimeSeconds} from "@chainsafe/lodestar-types"; +import {IChainConfig} from "@lodestar/config"; +import {GENESIS_SLOT, INTERVALS_PER_SLOT} from "@lodestar/params"; +import {Slot, Epoch, TimeSeconds} from "@lodestar/types"; import {computeStartSlotAtEpoch, computeEpochAtSlot} from "./epoch.js"; export function getSlotsSinceGenesis(config: IChainConfig, genesisTime: TimeSeconds): Slot { diff --git a/packages/beacon-state-transition/src/util/syncCommittee.ts b/packages/state-transition/src/util/syncCommittee.ts similarity index 93% rename from packages/beacon-state-transition/src/util/syncCommittee.ts rename to packages/state-transition/src/util/syncCommittee.ts index d747a7120db8..ccc2365b0fb5 100644 --- a/packages/beacon-state-transition/src/util/syncCommittee.ts +++ b/packages/state-transition/src/util/syncCommittee.ts @@ -6,9 +6,9 @@ import { SYNC_COMMITTEE_SIZE, SYNC_REWARD_WEIGHT, WEIGHT_DENOMINATOR, -} from "@chainsafe/lodestar-params"; -import {altair, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {bigIntSqrt} from "@chainsafe/lodestar-utils"; +} from "@lodestar/params"; +import {altair, ValidatorIndex} from "@lodestar/types"; +import {bigIntSqrt} from "@lodestar/utils"; import {BeaconStateAllForks} from "../types.js"; import {EffectiveBalanceIncrements} from "../cache/effectiveBalanceIncrements.js"; import {getNextSyncCommitteeIndices} from "./seed.js"; diff --git a/packages/beacon-state-transition/src/util/validator.ts b/packages/state-transition/src/util/validator.ts similarity index 87% rename from packages/beacon-state-transition/src/util/validator.ts rename to packages/state-transition/src/util/validator.ts index 1d1059077e68..6408b920bd3a 100644 --- a/packages/beacon-state-transition/src/util/validator.ts +++ b/packages/state-transition/src/util/validator.ts @@ -2,9 +2,9 @@ * @module chain/stateTransition/util */ -import {Epoch, phase0, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {intDiv} from "@chainsafe/lodestar-utils"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; +import {Epoch, phase0, ValidatorIndex} from "@lodestar/types"; +import {intDiv} from "@lodestar/utils"; +import {IChainForkConfig} from "@lodestar/config"; import {BeaconStateAllForks} from "../types.js"; /** diff --git a/packages/beacon-state-transition/src/util/weakSubjectivity.ts b/packages/state-transition/src/util/weakSubjectivity.ts similarity index 93% rename from packages/beacon-state-transition/src/util/weakSubjectivity.ts rename to packages/state-transition/src/util/weakSubjectivity.ts index 82fe1b656b48..505b12697399 100644 --- a/packages/beacon-state-transition/src/util/weakSubjectivity.ts +++ b/packages/state-transition/src/util/weakSubjectivity.ts @@ -1,13 +1,8 @@ -import {IBeaconConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; -import { - EFFECTIVE_BALANCE_INCREMENT, - MAX_DEPOSITS, - MAX_EFFECTIVE_BALANCE, - SLOTS_PER_EPOCH, -} from "@chainsafe/lodestar-params"; -import {Epoch, Root} from "@chainsafe/lodestar-types"; -import {ssz} from "@chainsafe/lodestar-types"; -import {Checkpoint} from "@chainsafe/lodestar-types/phase0"; +import {IBeaconConfig, IChainForkConfig} from "@lodestar/config"; +import {EFFECTIVE_BALANCE_INCREMENT, MAX_DEPOSITS, MAX_EFFECTIVE_BALANCE, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {Epoch, Root} from "@lodestar/types"; +import {ssz} from "@lodestar/types"; +import {Checkpoint} from "@lodestar/types/phase0"; import {toHexString} from "@chainsafe/ssz"; import {ZERO_HASH} from "../constants/constants.js"; import {CachedBeaconStateAllForks, BeaconStateAllForks} from "../types.js"; diff --git a/packages/state-transition/test-cache/interop-pubkeys.json b/packages/state-transition/test-cache/interop-pubkeys.json new file mode 100644 index 000000000000..2a9a57982649 --- /dev/null +++ b/packages/state-transition/test-cache/interop-pubkeys.json @@ -0,0 +1,102 @@ +[ + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "0x88c141df77cd9d8d7a71a75c826c41a9c9f03c6ee1b180f3e7852f6a280099ded351b58d66e653af8e42816a4d8f532e", + "0x81283b7a20e1ca460ebd9bbd77005d557370cabb1f9a44f530c4c4c66230f675f8df8b4c2818851aa7d77a80ca5a4a5e", + "0xab0bdda0f85f842f431beaccf1250bf1fd7ba51b4100fd64364b6401fda85bb0069b3e715b58819684e7fc0b10a72a34", + "0x9977f1c8b731a8d5558146bfb86caea26434f3c5878b589bf280a42c9159e700e9df0e4086296c20b011d2e78c27d373", + "0xa8d4c7c27795a725961317ef5953a7032ed6d83739db8b0e8a72353d1b8b4439427f7efa2c89caa03cc9f28f8cbab8ac", + "0xa6d310dbbfab9a22450f59993f87a4ce5db6223f3b5f1f30d2c4ec718922d400e0b3c7741de8e59960f72411a0ee10a7", + "0x9893413c00283a3f9ed9fd9845dda1cea38228d22567f9541dccc357e54a2d6a6e204103c92564cbc05f4905ac7c493a", + "0x876dd4705157eb66dc71bc2e07fb151ea53e1a62a0bb980a7ce72d15f58944a8a3752d754f52f4a60dbfc7b18169f268", + "0xaec922bd7a9b7b1dc21993133b586b0c3041c1e2e04b513e862227b9d7aecaf9444222f7e78282a449622ffc6278915d", + "0x9314c6de0386635e2799af798884c2ea09c63b9f079e572acc00b06a7faccce501ea4dfc0b1a23b8603680a5e3481327", + "0x903e2989e7442ee0a8958d020507a8bd985d3974f5e8273093be00db3935f0500e141b252bd09e3728892c7a8443863c", + "0x84398f539a64cbe01cfcd8c485ea51cd6657b94df93ee9b5dc61e1f18f69da6ca9d4dba63c956a81c68d5d4d4277a60f", + "0x872c61b4a7f8510ec809e5b023f5fdda2105d024c470ddbbeca4bc74e8280af0d178d749853e8f6a841083ac1b4db98f", + "0x8f467e5723deac7659e1ca273e28410cbaa6d495ab66ae77014f4cd21c64b6b5ab9987c9b5537fe0279bd063fe609be7", + "0x8dde8306920812b32def3b663f7c540b49180345d3bcb8d3770790b7dc80030ebc06497feebd1bcf017d918f00bfa88f", + "0xab8d3a9bcc160e518fac0756d3e192c74789588ed4a2b1debf0c78f78479ca8edb05b12ce21103076df6af4eb8756ff9", + "0x8d5d3672a233db513df7ad1e8beafeae99a9f0199ed4d949bbedbb6f394030c0416bd99b910e14f73c65b6a11fe6b62e", + "0xa1c76af1545d7901214bb6be06be5d9e458f8e989c19373a920f0018327c83982f6a2ac138260b8def732cb366411ddc", + "0x8dd74e1bb5228fc1fca274fda02b971c1003a4f409bbdfbcfec6426bf2f52addcbbebccdbf45eee6ae11eb5b5ee7244d", + "0x954eb88ed1207f891dc3c28fa6cfdf8f53bf0ed3d838f3476c0900a61314d22d4f0a300da3cd010444dd5183e35a593c", + "0xaf344fce60dbd5fb850070e6e76a065e1a32485245ef4f413135a86ae703da88407c5d01c71f6bb06a151ff96cca7191", + "0xae241af60691fda1cf8ca44d49573c55818c53b6141800cca2d488b9a3fba71c0f869179fff50c084657831fbeb42bf4", + "0x96746aaba64dc87835ba709332f4d5d7837ada092b439c49d251aecf92aab5dc132e917bf6f59799bc093f976a7bc021", + "0xb9d1d914df3d4565465c3fd52b5b96e637f9980570cabf5b5d4aadf5a329ac36ad672819d997e735f5052e28b1f0c104", + "0x963528adb5322c2e2c54dc296ffddd2861bb103cbf64646781dfa8a3c2d8a8eda7079d2b3e95600028c44365afbf8879", + "0xb245d63d3f9d8ea1807a629fcb1b328cb4d542f35a3d5bc478be0df389dddd712fc4c816ba3fede9a96320ae6b24a7d8", + "0xa98ed496c2f464226500a6ce04602ff9ef133ed6316f372f6c744aee165149f7e578b12780e0eacec307ae6907351d99", + "0xae00fc3de831b09661a0ac02873c45c84cb2b58cffb6430a3f607e4c3fa1e0932397f11307cd169cdc6f79c463527260", + "0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d", + "0xa9cf360aa15fb1d1d30ee2b578dc5884823c19661886ae8b892775ccb3bd96b7d7345569a2aa0b14e4d015c54a6a0c54", + "0xaef9162ee6f29ee82fbfe387756d84f9ac472eb8709217aaf28f5ef0ea273f6210e531496470b30d2b7747216e3672d5", + "0xb7e6e187ed813d950a9a17d1e70c03e4de2903596c4c5ff326848515c985deee38198efebc265300cd4f1d6bd7b5d264", + "0x81054bd51ce57a8415f0c8e0f2fbf94f5a8464552baa33263c20a4da062e5ed994a4d32c171106d2008cd063f48f6fe2", + "0xaecc56f2b1c4011d450214d3e1254479d583a6a5c2c06fbc049512731f76227d140df9f36a3f76b4ccb4df1342403573", + "0x9243ef5ed3bd28892d1ef4f7aaf29faeb9c0e725673cd38e308bd756f20a9ee09de5cd9822e5e77bd03b734ef8a92695", + "0x925b1fb57c06b5668567bd5aa196531032d6f8918dd4f702017c11b59288e3bdb98e3820ac22780f73580a4119de4bbc", + "0x9648b83a4f09b4ca2021f0c193c5c41df1465715761bca52671ca790a3e92d67686b97b3d54c6110409779df887bd9c6", + "0xa34febc12af07316580b480364f90a76313ccce7927bbe263e27ea270853b02ad4d1428caf55363f3ebebac622cb9fd6", + "0xb8cd1cef89aa1567a6058957442a698cf1b267130606f749451152959a5dfb50d243890d4adc2c3309f7696d54af1260", + "0x92a93728c252a45ef587ca53a037593912599d82e2b8aa1b734b99d500a0ac8c142092ea8b3c2c34a28dc8ddf337a249", + "0xb7ee0ef26144de04d9cc80864b869b7ecafbf1b7c0050403cc3c3b514368713b8bb708c464568a18c837e1fd21d09063", + "0xafc0fa2ed6a270de6122a19d4600380b7f9b5e974d16f095f1702f55792ecab0128b155a69f17ad64a6de0a7063642ec", + "0xa5869ba554d1432b09ee677c117511291b9901f169e870831f457caa6ccfab376cb1fe33813bdb495cf4afec9ea35fdf", + "0x92f43d79d9f488010b310a54f3fc2e7f4be191ca06d93e588c30c8abf59a52190e060b285ac626eb13cd95bbcc3a0a2a", + "0x9698d9519a02b64f230e5a2520401799c2ca7d69ab23a6d9817943147264bf00d409264b928718245efff4f7ee97dd5c", + "0xa852816b8e463178eea5acebb4b86d0acb6d8c6812cf313296bd271ea4d2fd89d281e5fc296df4df49019169bdf96922", + "0x8a298ee1ac0466ecaa04d5798048c6e192409af63217f32fd7e07794cfcdcd8deca055b9782dd1ad45a578a9ec10606c", + "0xae4d49364e4a36760cc74a675500055b9aed99bc19d31abb953ea156bb5a76dcf36769d15341b850114a30ffc8057780", + "0xb397692ccbf442bfe078174c85dbad7fd605e4ff1caf2904b31e4a4c79d6444813ad9b2093ac8fbd4dd59ec7a4c8c006", + "0x87c9f7605d07550b46c79add5ea4e39de5014c03833669257bd6666b7ec838f53800104779940d8cdd884275a0f6a3ef", + "0xb08f7feb86786c37661afb9951a959c9b465fd11ca98fcbc908fcf49144084051f6c363e2eb4459da2c2d03d84175692", + "0xa48cc260df1df875176cb17493a5b53d669c091da74d5075acb8952a641b1b7ef68d01f009c1a365d2fa80937c79dd6b", + "0xac9f4df3f20a16a9fefad08817fcbc9a6ee17f7512db006414b4aa6f234c2313585ef72c5776df55fa6284af4bc3f631", + "0x94f0c8535601596eb2165adb28ebe495891a3e4ea77ef501e7790cccb281827d377a5a8d4c200e3595d3f38f8633b480", + "0xb5bb0162a4f27d1bab4c7dc3d20f5a75d6ee98c56bcd309a1f0f307685ad47ffb8a35bfdf8431b9b954b59662a74c478", + "0x8826e820179fd321819e78ffee16f50ac528db2da71ad8c269f60b878bc4887c79c0545b3d750e86e490d5ba9083cb70", + "0x92977e71396633d442f61e16a0cfcf8ffad0af93c9f1b7fdf4f7ccb816de052925fc192922d6252d325ef9fa2e0595d2", + "0x91ae4686b0d20470409f020eaca826c3efc6c1926ed25d05e6f0f7916391ec89c2341917277c437ac8fffffe94b68111", + "0x8a0d241955104bedacb3b829162f2b457915c2beb9018ede8ef8ea80f401b471c42354358da9e62b51c38d54263a78a9", + "0x80a2be2c7dbce8ddc2eba03522697587c375a5a9e92d4b31ed9e3c34bee047095d93e3c70b1662b3faa301f5b19978e5", + "0x86a73886aa0114bbdbba346cb7c07376c81b549a4802c24d98ebbc54a6a1b5d2ac874ef657cfb27c3644fcb85f97a2b5", + "0xa98c264dfc3bc3ed635df5dbfd54909e77600cd68480ec201d9f5c416580591daaa9735b04743e10e7fc6370a8189775", + "0x8bb7aa61aa8bbd2b7825d28c340da89b625381232dcf2742276b4e3a2e4a0f42ef68794fdf005d94014636732fba2f40", + "0x8bb9e1693eab1496d7583bf22fb1f2a475934c63b4d94118940617aa187bc277f738223e0ec1ce8a5566035d9bcc5470", + "0xafe6eface52fb6de91055a81abf9aa6e42ce2ef36fd8ae0d09aec6e5d8bd40a065dfccda6104af94df3f7a5854559ef4", + "0xaa241b2afbb33f92a5d281aec9c8bac8997c1dddc051455fc0f334de48320f160b5029b552495aed21ed9ce252aab499", + "0x974b2aed17665e51c1c091998ca9649875330947de3d2733a5bd2eda69b0c593cdac2e416993a87f9a17aec1ccdc2368", + "0xa3177a98f653cea646f525f0f13348efb27e0d3d0cd824704c91d8d959096d259c9e577298f444acc629920c9619be50", + "0xa8a18565733e70663c77bc0c80e08f50de908cc048152f1e7dae85d8cc218afbdd337d7d33a44e25400be2f06907c64a", + "0x902ff56a7a4c5b6cc57708ea7b0b72cb54e4b821c95373f503648185f15208f6ca6281677fa0ecc14f911d7b7ca04f4e", + "0x98f011f9a4dff94eb0352ff6e21b7df45e2a112bd5d789b5729111b89b368e7ed554e4d1c16b72f4d105090173cafed2", + "0xabef42538a17a55804b634aac9d211b92b5768c4cc1263342ca287323bb3d5c768080451d1b5d652e9f8646fbb35f57c", + "0xa8e3c2d3ac4e0e3c83380577ff7b7b5b2a98571e0d04ddebc0a6c472ce3bc5cc6a6733be728a0ee17da74b7691d2679d", + "0x98f620aadc4e58392b5b583fed96c452b54c39ba3a9fe8c277f625fae7e1317d034f732995fd88c1461463edd0f2b86d", + "0xa7f5d408af436d71ec7acfe9a4592679649d326c00ac92c6f3332423be30c3601d232f265078f1f2a5d6d6cde08de7d7", + "0xa8be337b3d0e6be415dcb037b246831f9966aacef62b69d6b609e4ff8208bc536c6473bc9fe9e3bec9a8665c8caa05c5", + "0x93bb1c86717fa7303f65cb8c45c9fcc8fecb88428b7cd1dd59967a132109c25ab5c97888e46c5d471ff911c573f45a34", + "0x815042c33c1a43c1ee58a58ee074bc93a13c23a035dedee6879730220379d0c03ff4a3829240b6c34e56feb55cd322df", + "0x8be11e9ead2e1bb5be7e2ec066ff83589558a5d9373666b3fc518a6a6639b3baecb87f8f34895f63e8d09d270d93ce04", + "0x8bf2630491d2a480ec243b00d65d76e69615e67d3df5d8c14ca7506edd8e896a9083e8ee9e4129af0f6d896a3225c08c", + "0x914b56f41c411fbfca9dc9763f44daf253c103b162457d07954fd0af768b5e74692b4639c22455fb81d71f7ed6144514", + "0x8794388915e86e4988363cdd4289ad19182209c873cbbbf5a80ff5c99f93acb839807787a77ad2b603f074405d7ed08b", + "0xa3862121db5914d7272b0b705e6e3c5336b79e316735661873566245207329c30f9a33d4fb5f5857fc6fd0a368186972", + "0x96ef954b331a534199f4f113d993a50ec7a781fc5aa2a181ea0bdbfd4c5c557abfebfcc02604d5aef52ba64afbe0ff18", + "0x96c8d3dd08724624017f178393d176b425dab9dfa1cc3f62c7669337446baa601e0aa261c00c76bde07ba9a1a3582c0a", + "0x92bd81b8e9099b9ca87a2033fdd84475752dc34a0fae0a8e50aabf4d3baff9cd45ed56508c837023944350f53dbc4ac7", + "0x83802cd575a3cea7e3e38fc1a73d94a9e4fdb999b8494e7929309c009d79a23edb1ba091ac02588f130e0585fb106540", + "0xb451eb0ff4990917aba6e3d80c34aee91ea1ce49053f38ae174cef107cb9acc595d0ca3fefcb804c9dd04510c630cabe", + "0xa7f711233af57440e9ea700113fc4dbaef97e7da7741dd2e38ae668a7f2685d4585d54a9e6712ff1b87c69dbb181abf7", + "0xaca5e4979f281b5ab0ea0f549d6dcc34989607c335e94efedeffc7e73b393f42c7b11d76144a750f82600b21d10b6777", + "0x984620db3658a19769475080998db9e7f5bcd4255a89a70b5ecf7db01226f213836d091a3b37eb96e4937966b094a291", + "0x8f1ef3639aea57fef705847e251b785bb608a848f42d9107c494cbc696be35642f6552fb83174ca2e73632568a5667f4", + "0x8967da3c8071ba2bf632cd40ae08fbbf0a203c47c02af1948fc232a7a743c0c0cfbe51606b89f102f2f6de7f039fb155", + "0x8d58f7e2e58471b46d20a66a61f4cde3c78ab6c0505517c615e08d8ef5adf59b65fa2b01ea2395c84584a6f10d6cee2f", + "0x8db9f236d3483af79703244c7034b5267a0546c3c840d4e91fdcdd466373d62d960553982225ca5f7666dd7375a29c19", + "0xb7721412ae5a793f34ac8866698b221c67ef8272eba44d3030512ec3f7ed8ffcb620b58f17809690d5276423e849827f", + "0x99f6e5b80dc52407f0436d3474bd5da5ff23a19cb188b933af6312d9793cbfd54f9e72596c5d481a1ed8d705b81c1f0e" +] \ No newline at end of file diff --git a/packages/beacon-state-transition/test/cache.ts b/packages/state-transition/test/cache.ts similarity index 100% rename from packages/beacon-state-transition/test/cache.ts rename to packages/state-transition/test/cache.ts diff --git a/packages/beacon-state-transition/test/memory/effectiveBalanceIncrements.ts b/packages/state-transition/test/memory/effectiveBalanceIncrements.ts similarity index 95% rename from packages/beacon-state-transition/test/memory/effectiveBalanceIncrements.ts rename to packages/state-transition/test/memory/effectiveBalanceIncrements.ts index 9812f8271a27..f1c603b85657 100644 --- a/packages/beacon-state-transition/test/memory/effectiveBalanceIncrements.ts +++ b/packages/state-transition/test/memory/effectiveBalanceIncrements.ts @@ -1,5 +1,5 @@ import {MutableVector} from "@chainsafe/persistent-ts"; -import {testRunnerMemory} from "@chainsafe/lodestar/test/memory/testRunnerMemory"; +import {testRunnerMemory} from "@lodestar/beacon-node/test/memory/testRunnerMemory"; import {newZeroedArray} from "../../src/index.js"; // Results in Linux Feb 2022 diff --git a/packages/beacon-state-transition/test/perf/analyzeBlocks.ts b/packages/state-transition/test/perf/analyzeBlocks.ts similarity index 96% rename from packages/beacon-state-transition/test/perf/analyzeBlocks.ts rename to packages/state-transition/test/perf/analyzeBlocks.ts index 78e068a04fc0..3b0ab4755b2e 100644 --- a/packages/beacon-state-transition/test/perf/analyzeBlocks.ts +++ b/packages/state-transition/test/perf/analyzeBlocks.ts @@ -1,5 +1,5 @@ -import {getClient} from "@chainsafe/lodestar-api"; -import {config} from "@chainsafe/lodestar-config/default"; +import {getClient} from "@lodestar/api"; +import {config} from "@lodestar/config/default"; import {getInfuraBeaconUrl} from "../utils/infura.js"; // Analyze how Ethereum Consensus blocks are in a target network to prepare accurate performance states and blocks diff --git a/packages/beacon-state-transition/test/perf/analyzeEpochs.ts b/packages/state-transition/test/perf/analyzeEpochs.ts similarity index 95% rename from packages/beacon-state-transition/test/perf/analyzeEpochs.ts rename to packages/state-transition/test/perf/analyzeEpochs.ts index c87410bede5f..7df4df3b4b7d 100644 --- a/packages/beacon-state-transition/test/perf/analyzeEpochs.ts +++ b/packages/state-transition/test/perf/analyzeEpochs.ts @@ -1,8 +1,8 @@ import fs from "node:fs"; -import {getClient} from "@chainsafe/lodestar-api"; -import {config} from "@chainsafe/lodestar-config/default"; -import {NetworkName} from "@chainsafe/lodestar-config/networks.js"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {getClient} from "@lodestar/api"; +import {config} from "@lodestar/config/default"; +import {NetworkName} from "@lodestar/config/networks.js"; +import {phase0, ssz} from "@lodestar/types"; import { computeEpochAtSlot, computeStartSlotAtEpoch, @@ -20,7 +20,7 @@ import {csvAppend, readCsv} from "./csv.js"; // To run do: // // ``` -// NETWORK=mainnet node_modules/.bin/ts-node packages/beacon-state-transition/test/perf/analyzeEpochs.ts +// NETWORK=mainnet node_modules/.bin/ts-node packages/state-transition/test/perf/analyzeEpochs.ts // ``` // // Example of output CSV diff --git a/packages/beacon-state-transition/test/perf/block/processAttestation.test.ts b/packages/state-transition/test/perf/block/processAttestation.test.ts similarity index 98% rename from packages/beacon-state-transition/test/perf/block/processAttestation.test.ts rename to packages/state-transition/test/perf/block/processAttestation.test.ts index 5438739f5f3e..01eda46f9d11 100644 --- a/packages/beacon-state-transition/test/perf/block/processAttestation.test.ts +++ b/packages/state-transition/test/perf/block/processAttestation.test.ts @@ -9,8 +9,8 @@ import { PresetName, SLOTS_PER_EPOCH, SYNC_COMMITTEE_SIZE, -} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; import {CachedBeaconStateAllForks, CachedBeaconStateAltair} from "../../../src/index.js"; import {processAttestationsAltair} from "../../../src/block/processAttestationsAltair.js"; import {generatePerfTestCachedStateAltair, perfStateId} from "../util.js"; diff --git a/packages/beacon-state-transition/test/perf/block/processBlockAltair.test.ts b/packages/state-transition/test/perf/block/processBlockAltair.test.ts similarity index 98% rename from packages/beacon-state-transition/test/perf/block/processBlockAltair.test.ts rename to packages/state-transition/test/perf/block/processBlockAltair.test.ts index 38cf4fe0bd96..9fc9137a140d 100644 --- a/packages/beacon-state-transition/test/perf/block/processBlockAltair.test.ts +++ b/packages/state-transition/test/perf/block/processBlockAltair.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import { ACTIVE_PRESET, MAX_ATTESTATIONS, @@ -9,7 +9,7 @@ import { MAX_VOLUNTARY_EXITS, PresetName, SYNC_COMMITTEE_SIZE, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {CachedBeaconStateAltair, stateTransition} from "../../../src/index.js"; import {cachedStateAltairPopulateCaches, generatePerfTestCachedStateAltair, perfStateId} from "../util.js"; import {StateBlock} from "../types.js"; diff --git a/packages/beacon-state-transition/test/perf/block/processBlockPhase0.test.ts b/packages/state-transition/test/perf/block/processBlockPhase0.test.ts similarity index 99% rename from packages/beacon-state-transition/test/perf/block/processBlockPhase0.test.ts rename to packages/state-transition/test/perf/block/processBlockPhase0.test.ts index 862cfec41651..1b8a45fea801 100644 --- a/packages/beacon-state-transition/test/perf/block/processBlockPhase0.test.ts +++ b/packages/state-transition/test/perf/block/processBlockPhase0.test.ts @@ -7,7 +7,7 @@ import { MAX_PROPOSER_SLASHINGS, MAX_VOLUNTARY_EXITS, PresetName, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {stateTransition} from "../../../src/index.js"; import {generatePerfTestCachedStatePhase0, perfStateId} from "../util.js"; import {StateBlock} from "../types.js"; diff --git a/packages/beacon-state-transition/test/perf/block/processEth1Data.test.ts b/packages/state-transition/test/perf/block/processEth1Data.test.ts similarity index 93% rename from packages/beacon-state-transition/test/perf/block/processEth1Data.test.ts rename to packages/state-transition/test/perf/block/processEth1Data.test.ts index 2e17779a8591..3085fa535782 100644 --- a/packages/beacon-state-transition/test/perf/block/processEth1Data.test.ts +++ b/packages/state-transition/test/perf/block/processEth1Data.test.ts @@ -1,6 +1,6 @@ import {itBench} from "@dapplion/benchmark"; -import {ACTIVE_PRESET, PresetName, SYNC_COMMITTEE_SIZE} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +import {ACTIVE_PRESET, PresetName, SYNC_COMMITTEE_SIZE} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; import {CachedBeaconStateAllForks, CachedBeaconStateAltair} from "../../../src/index.js"; import {processEth1Data} from "../../../src/block/processEth1Data.js"; import {generatePerfTestCachedStateAltair, perfStateId} from "../util.js"; diff --git a/packages/beacon-state-transition/test/perf/block/util.ts b/packages/state-transition/test/perf/block/util.ts similarity index 97% rename from packages/beacon-state-transition/test/perf/block/util.ts rename to packages/state-transition/test/perf/block/util.ts index 80c7b1ee8e21..86056ba5c5c7 100644 --- a/packages/beacon-state-transition/test/perf/block/util.ts +++ b/packages/state-transition/test/perf/block/util.ts @@ -1,9 +1,9 @@ -import {altair, phase0, ssz} from "@chainsafe/lodestar-types"; +import {altair, phase0, ssz} from "@lodestar/types"; import bls from "@chainsafe/bls"; import {toGindex, Tree} from "@chainsafe/persistent-merkle-tree"; import {BitArray} from "@chainsafe/ssz"; -import {DOMAIN_DEPOSIT, SYNC_COMMITTEE_SIZE} from "@chainsafe/lodestar-params"; -import {config} from "@chainsafe/lodestar-config/default"; +import {DOMAIN_DEPOSIT, SYNC_COMMITTEE_SIZE} from "@lodestar/params"; +import {config} from "@lodestar/config/default"; import { computeDomain, computeEpochAtSlot, diff --git a/packages/beacon-state-transition/test/perf/csv.ts b/packages/state-transition/test/perf/csv.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/csv.ts rename to packages/state-transition/test/perf/csv.ts diff --git a/packages/beacon-state-transition/test/perf/dataStructures/arrayish.memory.ts b/packages/state-transition/test/perf/dataStructures/arrayish.memory.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/dataStructures/arrayish.memory.ts rename to packages/state-transition/test/perf/dataStructures/arrayish.memory.ts diff --git a/packages/beacon-state-transition/test/perf/dataStructures/arrayish.test.ts b/packages/state-transition/test/perf/dataStructures/arrayish.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/dataStructures/arrayish.test.ts rename to packages/state-transition/test/perf/dataStructures/arrayish.test.ts diff --git a/packages/beacon-state-transition/test/perf/dataStructures/effectiveBalanceIncrements.test.ts b/packages/state-transition/test/perf/dataStructures/effectiveBalanceIncrements.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/dataStructures/effectiveBalanceIncrements.test.ts rename to packages/state-transition/test/perf/dataStructures/effectiveBalanceIncrements.test.ts diff --git a/packages/beacon-state-transition/test/perf/epoch/afterProcessEpoch.test.ts b/packages/state-transition/test/perf/epoch/afterProcessEpoch.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/epoch/afterProcessEpoch.test.ts rename to packages/state-transition/test/perf/epoch/afterProcessEpoch.test.ts diff --git a/packages/beacon-state-transition/test/perf/epoch/beforeProcessEpoch.test.ts b/packages/state-transition/test/perf/epoch/beforeProcessEpoch.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/epoch/beforeProcessEpoch.test.ts rename to packages/state-transition/test/perf/epoch/beforeProcessEpoch.test.ts diff --git a/packages/beacon-state-transition/test/perf/epoch/epochAltair.test.ts b/packages/state-transition/test/perf/epoch/epochAltair.test.ts similarity index 99% rename from packages/beacon-state-transition/test/perf/epoch/epochAltair.test.ts rename to packages/state-transition/test/perf/epoch/epochAltair.test.ts index 9cc9f31afc5e..9493f66dc0f3 100644 --- a/packages/beacon-state-transition/test/perf/epoch/epochAltair.test.ts +++ b/packages/state-transition/test/perf/epoch/epochAltair.test.ts @@ -1,5 +1,5 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import {ForkSeq} from "@chainsafe/lodestar-params"; +import {ForkSeq} from "@lodestar/params"; import { computeStartSlotAtEpoch, CachedBeaconStateAllForks, diff --git a/packages/beacon-state-transition/test/perf/epoch/epochPhase0.test.ts b/packages/state-transition/test/perf/epoch/epochPhase0.test.ts similarity index 99% rename from packages/beacon-state-transition/test/perf/epoch/epochPhase0.test.ts rename to packages/state-transition/test/perf/epoch/epochPhase0.test.ts index 4e55cc4fe38b..6b0044ca90c2 100644 --- a/packages/beacon-state-transition/test/perf/epoch/epochPhase0.test.ts +++ b/packages/state-transition/test/perf/epoch/epochPhase0.test.ts @@ -1,5 +1,5 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import {ForkSeq} from "@chainsafe/lodestar-params"; +import {ForkSeq} from "@lodestar/params"; import { computeStartSlotAtEpoch, CachedBeaconStateAllForks, diff --git a/packages/beacon-state-transition/test/perf/epoch/processEffectiveBalanceUpdates.test.ts b/packages/state-transition/test/perf/epoch/processEffectiveBalanceUpdates.test.ts similarity index 96% rename from packages/beacon-state-transition/test/perf/epoch/processEffectiveBalanceUpdates.test.ts rename to packages/state-transition/test/perf/epoch/processEffectiveBalanceUpdates.test.ts index b05984528fcb..0ad637d94e17 100644 --- a/packages/beacon-state-transition/test/perf/epoch/processEffectiveBalanceUpdates.test.ts +++ b/packages/state-transition/test/perf/epoch/processEffectiveBalanceUpdates.test.ts @@ -1,6 +1,6 @@ import {itBench} from "@dapplion/benchmark"; -import {ssz} from "@chainsafe/lodestar-types"; -import {config} from "@chainsafe/lodestar-config/default"; +import {ssz} from "@lodestar/types"; +import {config} from "@lodestar/config/default"; import {beforeProcessEpoch, CachedBeaconStateAllForks, EpochProcess} from "../../../src/index.js"; import {processEffectiveBalanceUpdates} from "../../../src/epoch/processEffectiveBalanceUpdates.js"; import {numValidators} from "../util.js"; diff --git a/packages/beacon-state-transition/test/perf/epoch/processInactivityUpdates.test.ts b/packages/state-transition/test/perf/epoch/processInactivityUpdates.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/epoch/processInactivityUpdates.test.ts rename to packages/state-transition/test/perf/epoch/processInactivityUpdates.test.ts diff --git a/packages/beacon-state-transition/test/perf/epoch/processRegistryUpdates.test.ts b/packages/state-transition/test/perf/epoch/processRegistryUpdates.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/epoch/processRegistryUpdates.test.ts rename to packages/state-transition/test/perf/epoch/processRegistryUpdates.test.ts diff --git a/packages/beacon-state-transition/test/perf/epoch/processRewardsAndPenalties.test.ts b/packages/state-transition/test/perf/epoch/processRewardsAndPenalties.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/epoch/processRewardsAndPenalties.test.ts rename to packages/state-transition/test/perf/epoch/processRewardsAndPenalties.test.ts diff --git a/packages/beacon-state-transition/test/perf/epoch/processRewardsAndPenaltiesPhase0.test.ts b/packages/state-transition/test/perf/epoch/processRewardsAndPenaltiesPhase0.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/epoch/processRewardsAndPenaltiesPhase0.test.ts rename to packages/state-transition/test/perf/epoch/processRewardsAndPenaltiesPhase0.test.ts diff --git a/packages/beacon-state-transition/test/perf/epoch/processSlashingsAllForks.test.ts b/packages/state-transition/test/perf/epoch/processSlashingsAllForks.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/epoch/processSlashingsAllForks.test.ts rename to packages/state-transition/test/perf/epoch/processSlashingsAllForks.test.ts diff --git a/packages/beacon-state-transition/test/perf/epoch/processSyncCommitteeUpdates.test.ts b/packages/state-transition/test/perf/epoch/processSyncCommitteeUpdates.test.ts similarity index 94% rename from packages/beacon-state-transition/test/perf/epoch/processSyncCommitteeUpdates.test.ts rename to packages/state-transition/test/perf/epoch/processSyncCommitteeUpdates.test.ts index 477c02436004..ffde30e1302c 100644 --- a/packages/beacon-state-transition/test/perf/epoch/processSyncCommitteeUpdates.test.ts +++ b/packages/state-transition/test/perf/epoch/processSyncCommitteeUpdates.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD} from "@chainsafe/lodestar-params"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD} from "@lodestar/params"; import {processSyncCommitteeUpdates} from "../../../src/epoch/processSyncCommitteeUpdates.js"; import {StateAltair} from "../types.js"; import {generatePerfTestCachedStateAltair, numValidators} from "../util.js"; diff --git a/packages/beacon-state-transition/test/perf/epoch/util.ts b/packages/state-transition/test/perf/epoch/util.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/epoch/util.ts rename to packages/state-transition/test/perf/epoch/util.ts diff --git a/packages/beacon-state-transition/test/perf/epoch/utilPhase0.ts b/packages/state-transition/test/perf/epoch/utilPhase0.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/epoch/utilPhase0.ts rename to packages/state-transition/test/perf/epoch/utilPhase0.ts diff --git a/packages/beacon-state-transition/test/perf/hashing.test.ts b/packages/state-transition/test/perf/hashing.test.ts similarity index 97% rename from packages/beacon-state-transition/test/perf/hashing.test.ts rename to packages/state-transition/test/perf/hashing.test.ts index 6fafa15b57dc..b7afc59717bc 100644 --- a/packages/beacon-state-transition/test/perf/hashing.test.ts +++ b/packages/state-transition/test/perf/hashing.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {unshuffleList} from "../../src/index.js"; import {generatePerfTestCachedStatePhase0, numValidators} from "./util.js"; diff --git a/packages/beacon-state-transition/test/perf/misc/aggregationBits.test.ts b/packages/state-transition/test/perf/misc/aggregationBits.test.ts similarity index 88% rename from packages/beacon-state-transition/test/perf/misc/aggregationBits.test.ts rename to packages/state-transition/test/perf/misc/aggregationBits.test.ts index 46327e6dc76f..19446239a82b 100644 --- a/packages/beacon-state-transition/test/perf/misc/aggregationBits.test.ts +++ b/packages/state-transition/test/perf/misc/aggregationBits.test.ts @@ -1,6 +1,6 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import {MAX_VALIDATORS_PER_COMMITTEE} from "@chainsafe/lodestar-params"; -import {ssz} from "@chainsafe/lodestar-types"; +import {MAX_VALIDATORS_PER_COMMITTEE} from "@lodestar/params"; +import {ssz} from "@lodestar/types"; import {BitArray} from "@chainsafe/ssz"; describe("aggregationBits", () => { diff --git a/packages/beacon-state-transition/test/perf/misc/arrayCreation.test.ts b/packages/state-transition/test/perf/misc/arrayCreation.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/misc/arrayCreation.test.ts rename to packages/state-transition/test/perf/misc/arrayCreation.test.ts diff --git a/packages/beacon-state-transition/test/perf/misc/bitopts.test.ts b/packages/state-transition/test/perf/misc/bitopts.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/misc/bitopts.test.ts rename to packages/state-transition/test/perf/misc/bitopts.test.ts diff --git a/packages/beacon-state-transition/test/perf/misc/proxy.test.ts b/packages/state-transition/test/perf/misc/proxy.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/misc/proxy.test.ts rename to packages/state-transition/test/perf/misc/proxy.test.ts diff --git a/packages/beacon-state-transition/test/perf/misc/rootEquals.test.ts b/packages/state-transition/test/perf/misc/rootEquals.test.ts similarity index 96% rename from packages/beacon-state-transition/test/perf/misc/rootEquals.test.ts rename to packages/state-transition/test/perf/misc/rootEquals.test.ts index 0a63f4fd9830..cfbe046ad5dd 100644 --- a/packages/beacon-state-transition/test/perf/misc/rootEquals.test.ts +++ b/packages/state-transition/test/perf/misc/rootEquals.test.ts @@ -1,5 +1,5 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import {ssz} from "@chainsafe/lodestar-types"; +import {ssz} from "@lodestar/types"; import {byteArrayEquals, fromHexString} from "@chainsafe/ssz"; // As of Jun 17 2021 diff --git a/packages/beacon-state-transition/test/perf/params.ts b/packages/state-transition/test/perf/params.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/params.ts rename to packages/state-transition/test/perf/params.ts diff --git a/packages/beacon-state-transition/test/perf/sanityCheck.test.ts b/packages/state-transition/test/perf/sanityCheck.test.ts similarity index 98% rename from packages/beacon-state-transition/test/perf/sanityCheck.test.ts rename to packages/state-transition/test/perf/sanityCheck.test.ts index a8a40cb781be..b7a75d639165 100644 --- a/packages/beacon-state-transition/test/perf/sanityCheck.test.ts +++ b/packages/state-transition/test/perf/sanityCheck.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ACTIVE_PRESET, EFFECTIVE_BALANCE_INCREMENT, PresetName} from "@chainsafe/lodestar-params"; +import {ACTIVE_PRESET, EFFECTIVE_BALANCE_INCREMENT, PresetName} from "@lodestar/params"; import {beforeProcessEpoch} from "../../src/index.js"; import {generatePerfTestCachedStateAltair, generatePerfTestCachedStatePhase0, perfStateId} from "./util.js"; diff --git a/packages/beacon-state-transition/test/perf/shuffle/numberMath.test.ts b/packages/state-transition/test/perf/shuffle/numberMath.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/shuffle/numberMath.test.ts rename to packages/state-transition/test/perf/shuffle/numberMath.test.ts diff --git a/packages/beacon-state-transition/test/perf/shuffle/shuffle.test.ts b/packages/state-transition/test/perf/shuffle/shuffle.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/shuffle/shuffle.test.ts rename to packages/state-transition/test/perf/shuffle/shuffle.test.ts diff --git a/packages/beacon-state-transition/test/perf/slot/slots.test.ts b/packages/state-transition/test/perf/slot/slots.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/slot/slots.test.ts rename to packages/state-transition/test/perf/slot/slots.test.ts diff --git a/packages/beacon-state-transition/test/perf/types.ts b/packages/state-transition/test/perf/types.ts similarity index 92% rename from packages/beacon-state-transition/test/perf/types.ts rename to packages/state-transition/test/perf/types.ts index a4e39fdf715a..74d25dd1f8db 100644 --- a/packages/beacon-state-transition/test/perf/types.ts +++ b/packages/state-transition/test/perf/types.ts @@ -1,4 +1,4 @@ -import {allForks} from "@chainsafe/lodestar-types"; +import {allForks} from "@lodestar/types"; import {CachedBeaconStateAllForks, CachedBeaconStatePhase0, CachedBeaconStateAltair} from "../../src/index.js"; import {EpochProcess} from "../../src/types.js"; diff --git a/packages/beacon-state-transition/test/perf/util.ts b/packages/state-transition/test/perf/util.ts similarity index 98% rename from packages/beacon-state-transition/test/perf/util.ts rename to packages/state-transition/test/perf/util.ts index 828fc6cf8488..a8ccfa7519c0 100644 --- a/packages/beacon-state-transition/test/perf/util.ts +++ b/packages/state-transition/test/perf/util.ts @@ -1,9 +1,9 @@ -import {config} from "@chainsafe/lodestar-config/default"; -import {allForks, phase0, ssz, Slot, altair} from "@chainsafe/lodestar-types"; +import {config} from "@lodestar/config/default"; +import {allForks, phase0, ssz, Slot, altair} from "@lodestar/types"; import {CoordType, PublicKey, SecretKey} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; import {BitArray, fromHexString} from "@chainsafe/ssz"; -import {createIBeaconConfig, createIChainForkConfig} from "@chainsafe/lodestar-config"; +import {createIBeaconConfig, createIChainForkConfig} from "@lodestar/config"; import { EPOCHS_PER_ETH1_VOTING_PERIOD, EPOCHS_PER_HISTORICAL_VECTOR, @@ -11,7 +11,7 @@ import { MAX_EFFECTIVE_BALANCE, SLOTS_PER_EPOCH, SLOTS_PER_HISTORICAL_ROOT, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import { interopSecretKey, computeEpochAtSlot, diff --git a/packages/beacon-state-transition/test/perf/util/balance.test.ts b/packages/state-transition/test/perf/util/balance.test.ts similarity index 100% rename from packages/beacon-state-transition/test/perf/util/balance.test.ts rename to packages/state-transition/test/perf/util/balance.test.ts diff --git a/packages/beacon-state-transition/test/perf/util/epochContext.test.ts b/packages/state-transition/test/perf/util/epochContext.test.ts similarity index 97% rename from packages/beacon-state-transition/test/perf/util/epochContext.test.ts rename to packages/state-transition/test/perf/util/epochContext.test.ts index d66065dbf21a..9ae478d4161b 100644 --- a/packages/beacon-state-transition/test/perf/util/epochContext.test.ts +++ b/packages/state-transition/test/perf/util/epochContext.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {Epoch} from "@chainsafe/lodestar-types"; +import {Epoch} from "@lodestar/types"; import {computeEpochAtSlot, CachedBeaconStateAllForks} from "../../../src/index.js"; import {generatePerfTestCachedStatePhase0, numValidators} from "../util.js"; diff --git a/packages/beacon-state-transition/test/perf/util/shufflings.test.ts b/packages/state-transition/test/perf/util/shufflings.test.ts similarity index 92% rename from packages/beacon-state-transition/test/perf/util/shufflings.test.ts rename to packages/state-transition/test/perf/util/shufflings.test.ts index 63f07808020c..e04dd405d960 100644 --- a/packages/beacon-state-transition/test/perf/util/shufflings.test.ts +++ b/packages/state-transition/test/perf/util/shufflings.test.ts @@ -1,6 +1,6 @@ import {itBench} from "@dapplion/benchmark"; -import {Epoch} from "@chainsafe/lodestar-types"; -import {DOMAIN_BEACON_PROPOSER} from "@chainsafe/lodestar-params"; +import {Epoch} from "@lodestar/types"; +import {DOMAIN_BEACON_PROPOSER} from "@lodestar/params"; import { computeEpochAtSlot, CachedBeaconStateAllForks, diff --git a/packages/beacon-state-transition/test/unit/block/isValidIndexedAttestation.test.ts b/packages/state-transition/test/unit/block/isValidIndexedAttestation.test.ts similarity index 88% rename from packages/beacon-state-transition/test/unit/block/isValidIndexedAttestation.test.ts rename to packages/state-transition/test/unit/block/isValidIndexedAttestation.test.ts index 275b766244b6..523a2156a518 100644 --- a/packages/beacon-state-transition/test/unit/block/isValidIndexedAttestation.test.ts +++ b/packages/state-transition/test/unit/block/isValidIndexedAttestation.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; -import {FAR_FUTURE_EPOCH, MAX_EFFECTIVE_BALANCE} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +import {config} from "@lodestar/config/default"; +import {FAR_FUTURE_EPOCH, MAX_EFFECTIVE_BALANCE} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; import {generateAttestationData} from "../../utils/attestation.js"; import {EMPTY_SIGNATURE} from "../../../src/index.js"; import {generateCachedState} from "../../utils/state.js"; diff --git a/packages/beacon-state-transition/test/unit/cachedBeaconState.test.ts b/packages/state-transition/test/unit/cachedBeaconState.test.ts similarity index 94% rename from packages/beacon-state-transition/test/unit/cachedBeaconState.test.ts rename to packages/state-transition/test/unit/cachedBeaconState.test.ts index 29ad45ba30ad..0367fd636e78 100644 --- a/packages/beacon-state-transition/test/unit/cachedBeaconState.test.ts +++ b/packages/state-transition/test/unit/cachedBeaconState.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {ssz} from "@chainsafe/lodestar-types"; -import {toHexString} from "@chainsafe/lodestar-utils"; +import {ssz} from "@lodestar/types"; +import {toHexString} from "@lodestar/utils"; import {createCachedBeaconStateTest} from "../utils/state.js"; describe("CachedBeaconState", () => { diff --git a/packages/beacon-state-transition/test/unit/constants.test.ts b/packages/state-transition/test/unit/constants.test.ts similarity index 100% rename from packages/beacon-state-transition/test/unit/constants.test.ts rename to packages/state-transition/test/unit/constants.test.ts diff --git a/packages/beacon-state-transition/test/unit/signatureSets/signatureSets.test.ts b/packages/state-transition/test/unit/signatureSets/signatureSets.test.ts similarity index 95% rename from packages/beacon-state-transition/test/unit/signatureSets/signatureSets.test.ts rename to packages/state-transition/test/unit/signatureSets/signatureSets.test.ts index 8e5f76a96d68..b04072aa04d4 100644 --- a/packages/beacon-state-transition/test/unit/signatureSets/signatureSets.test.ts +++ b/packages/state-transition/test/unit/signatureSets/signatureSets.test.ts @@ -1,9 +1,9 @@ import crypto from "node:crypto"; import {expect} from "chai"; import bls from "@chainsafe/bls"; -import {config} from "@chainsafe/lodestar-config/default"; -import {phase0, ValidatorIndex, BLSSignature} from "@chainsafe/lodestar-types"; -import {FAR_FUTURE_EPOCH, MAX_EFFECTIVE_BALANCE} from "@chainsafe/lodestar-params"; +import {config} from "@lodestar/config/default"; +import {phase0, ValidatorIndex, BLSSignature} from "@lodestar/types"; +import {FAR_FUTURE_EPOCH, MAX_EFFECTIVE_BALANCE} from "@lodestar/params"; import {BitArray} from "@chainsafe/ssz"; import {ZERO_HASH} from "../../../src/constants/index.js"; import {getAllBlockSignatureSets} from "../../../src/signatureSets/index.js"; diff --git a/packages/beacon-state-transition/test/unit/util/aggregator.test.ts b/packages/state-transition/test/unit/util/aggregator.test.ts similarity index 98% rename from packages/beacon-state-transition/test/unit/util/aggregator.test.ts rename to packages/state-transition/test/unit/util/aggregator.test.ts index 9aa124765ea1..f6e7bbd4a6ed 100644 --- a/packages/beacon-state-transition/test/unit/util/aggregator.test.ts +++ b/packages/state-transition/test/unit/util/aggregator.test.ts @@ -5,7 +5,7 @@ import { SYNC_COMMITTEE_SUBNET_COUNT, TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE, TARGET_AGGREGATORS_PER_COMMITTEE, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {isAggregatorFromCommitteeLength, isSyncCommitteeAggregator} from "../../../src/util/aggregator.js"; /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/packages/beacon-state-transition/test/unit/util/balance.test.ts b/packages/state-transition/test/unit/util/balance.test.ts similarity index 94% rename from packages/beacon-state-transition/test/unit/util/balance.test.ts rename to packages/state-transition/test/unit/util/balance.test.ts index 8dcc20efff29..7106d81fdce2 100644 --- a/packages/beacon-state-transition/test/unit/util/balance.test.ts +++ b/packages/state-transition/test/unit/util/balance.test.ts @@ -1,8 +1,8 @@ import {assert, expect} from "chai"; -import {config as minimalConfig} from "@chainsafe/lodestar-config/default"; +import {config as minimalConfig} from "@lodestar/config/default"; -import {EFFECTIVE_BALANCE_INCREMENT} from "@chainsafe/lodestar-params"; -import {ValidatorIndex} from "@chainsafe/lodestar-types"; +import {EFFECTIVE_BALANCE_INCREMENT} from "@lodestar/params"; +import {ValidatorIndex} from "@lodestar/types"; import {increaseBalance, decreaseBalance, getTotalBalance, isActiveValidator} from "../../../src/util/index.js"; import {getEffectiveBalanceIncrementsZeroed, getEffectiveBalanceIncrementsZeroInactive} from "../../../src/index.js"; diff --git a/packages/beacon-state-transition/test/unit/util/cachedBeaconState.test.ts b/packages/state-transition/test/unit/util/cachedBeaconState.test.ts similarity index 71% rename from packages/beacon-state-transition/test/unit/util/cachedBeaconState.test.ts rename to packages/state-transition/test/unit/util/cachedBeaconState.test.ts index ce815b6f6543..43b51ab5cba9 100644 --- a/packages/beacon-state-transition/test/unit/util/cachedBeaconState.test.ts +++ b/packages/state-transition/test/unit/util/cachedBeaconState.test.ts @@ -1,6 +1,6 @@ -import {createIBeaconConfig} from "@chainsafe/lodestar-config"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ssz} from "@chainsafe/lodestar-types"; +import {createIBeaconConfig} from "@lodestar/config"; +import {config} from "@lodestar/config/default"; +import {ssz} from "@lodestar/types"; import {createCachedBeaconState, PubkeyIndexMap} from "../../../src/index.js"; describe("CachedBeaconState", () => { diff --git a/packages/beacon-state-transition/test/unit/util/epoch.test.ts b/packages/state-transition/test/unit/util/epoch.test.ts similarity index 94% rename from packages/beacon-state-transition/test/unit/util/epoch.test.ts rename to packages/state-transition/test/unit/util/epoch.test.ts index ee25877c43d9..fe404f93f852 100644 --- a/packages/beacon-state-transition/test/unit/util/epoch.test.ts +++ b/packages/state-transition/test/unit/util/epoch.test.ts @@ -1,7 +1,7 @@ import {assert} from "chai"; -import {GENESIS_SLOT, MAX_SEED_LOOKAHEAD} from "@chainsafe/lodestar-params"; -import {Epoch, Slot} from "@chainsafe/lodestar-types"; +import {GENESIS_SLOT, MAX_SEED_LOOKAHEAD} from "@lodestar/params"; +import {Epoch, Slot} from "@lodestar/types"; import { computeStartSlotAtEpoch, getPreviousEpoch, diff --git a/packages/beacon-state-transition/test/unit/util/flags.test.ts b/packages/state-transition/test/unit/util/flags.test.ts similarity index 100% rename from packages/beacon-state-transition/test/unit/util/flags.test.ts rename to packages/state-transition/test/unit/util/flags.test.ts diff --git a/packages/beacon-state-transition/test/unit/util/misc.test.ts b/packages/state-transition/test/unit/util/misc.test.ts similarity index 92% rename from packages/beacon-state-transition/test/unit/util/misc.test.ts rename to packages/state-transition/test/unit/util/misc.test.ts index da71ba94e92b..adc0dd43b084 100644 --- a/packages/beacon-state-transition/test/unit/util/misc.test.ts +++ b/packages/state-transition/test/unit/util/misc.test.ts @@ -1,7 +1,7 @@ import {assert} from "chai"; import {toBigIntLE} from "bigint-buffer"; -import {GENESIS_SLOT, SLOTS_PER_HISTORICAL_ROOT} from "@chainsafe/lodestar-params"; +import {GENESIS_SLOT, SLOTS_PER_HISTORICAL_ROOT} from "@lodestar/params"; import {getBlockRoot} from "../../../src/util/index.js"; import {generateState} from "../../utils/state.js"; diff --git a/packages/beacon-state-transition/test/unit/util/seed.test.ts b/packages/state-transition/test/unit/util/seed.test.ts similarity index 92% rename from packages/beacon-state-transition/test/unit/util/seed.test.ts rename to packages/state-transition/test/unit/util/seed.test.ts index c83b23651227..1b4b28835557 100644 --- a/packages/beacon-state-transition/test/unit/util/seed.test.ts +++ b/packages/state-transition/test/unit/util/seed.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {GENESIS_EPOCH, GENESIS_SLOT, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {GENESIS_EPOCH, GENESIS_SLOT, SLOTS_PER_EPOCH} from "@lodestar/params"; import {toHexString} from "@chainsafe/ssz"; import {getRandaoMix} from "../../../src/util/index.js"; diff --git a/packages/beacon-state-transition/test/unit/util/shuffle.test.ts b/packages/state-transition/test/unit/util/shuffle.test.ts similarity index 100% rename from packages/beacon-state-transition/test/unit/util/shuffle.test.ts rename to packages/state-transition/test/unit/util/shuffle.test.ts diff --git a/packages/beacon-state-transition/test/unit/util/slashing.test.ts b/packages/state-transition/test/unit/util/slashing.test.ts similarity index 97% rename from packages/beacon-state-transition/test/unit/util/slashing.test.ts rename to packages/state-transition/test/unit/util/slashing.test.ts index 10b93ecd9f56..da45b55c7f92 100644 --- a/packages/beacon-state-transition/test/unit/util/slashing.test.ts +++ b/packages/state-transition/test/unit/util/slashing.test.ts @@ -1,6 +1,6 @@ import {assert} from "chai"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {isSlashableAttestationData} from "../../../src/util/index.js"; import {randBetween} from "../../utils/misc.js"; import {generateAttestationDataBigint} from "../../utils/attestation.js"; diff --git a/packages/beacon-state-transition/test/unit/util/slot.test.ts b/packages/state-transition/test/unit/util/slot.test.ts similarity index 94% rename from packages/beacon-state-transition/test/unit/util/slot.test.ts rename to packages/state-transition/test/unit/util/slot.test.ts index a344a92366d9..f25a1f7b9fe9 100644 --- a/packages/beacon-state-transition/test/unit/util/slot.test.ts +++ b/packages/state-transition/test/unit/util/slot.test.ts @@ -1,6 +1,6 @@ import {assert} from "chai"; -import {Slot} from "@chainsafe/lodestar-types"; +import {Slot} from "@lodestar/types"; import {computeSlotsSinceEpochStart} from "../../../src/util/index.js"; describe("computeSlotsSinceEpochStart", () => { diff --git a/packages/beacon-state-transition/test/unit/util/validator.test.ts b/packages/state-transition/test/unit/util/validator.test.ts similarity index 98% rename from packages/beacon-state-transition/test/unit/util/validator.test.ts rename to packages/state-transition/test/unit/util/validator.test.ts index dd8ba9bbb391..7a79ce8474f7 100644 --- a/packages/beacon-state-transition/test/unit/util/validator.test.ts +++ b/packages/state-transition/test/unit/util/validator.test.ts @@ -1,6 +1,6 @@ import {assert, expect} from "chai"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; +import {phase0, ssz} from "@lodestar/types"; import {getActiveValidatorIndices, isActiveValidator, isSlashableValidator} from "../../../src/util/index.js"; diff --git a/packages/beacon-state-transition/test/unit/util/weakSubjectivity.test.ts b/packages/state-transition/test/unit/util/weakSubjectivity.test.ts similarity index 96% rename from packages/beacon-state-transition/test/unit/util/weakSubjectivity.test.ts rename to packages/state-transition/test/unit/util/weakSubjectivity.test.ts index a50853285218..a421caed64ed 100644 --- a/packages/beacon-state-transition/test/unit/util/weakSubjectivity.test.ts +++ b/packages/state-transition/test/unit/util/weakSubjectivity.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; +import {config} from "@lodestar/config/default"; import {computeWeakSubjectivityPeriodFromConstituents} from "../../../src/util/weakSubjectivity.js"; import {getChurnLimit} from "../../../src/util/validator.js"; diff --git a/packages/beacon-state-transition/test/utils/attestation.ts b/packages/state-transition/test/utils/attestation.ts similarity index 95% rename from packages/beacon-state-transition/test/utils/attestation.ts rename to packages/state-transition/test/utils/attestation.ts index 87635139c2c2..17de9b1f2a5f 100644 --- a/packages/beacon-state-transition/test/utils/attestation.ts +++ b/packages/state-transition/test/utils/attestation.ts @@ -1,4 +1,4 @@ -import {phase0, Epoch, Slot} from "@chainsafe/lodestar-types"; +import {phase0, Epoch, Slot} from "@lodestar/types"; import {BitArray} from "@chainsafe/ssz"; /** diff --git a/packages/beacon-state-transition/test/utils/beforeValue.ts b/packages/state-transition/test/utils/beforeValue.ts similarity index 100% rename from packages/beacon-state-transition/test/utils/beforeValue.ts rename to packages/state-transition/test/utils/beforeValue.ts diff --git a/packages/beacon-state-transition/test/utils/block.ts b/packages/state-transition/test/utils/block.ts similarity index 94% rename from packages/beacon-state-transition/test/utils/block.ts rename to packages/state-transition/test/utils/block.ts index 56e79fc63cc1..f5cf30bfe724 100644 --- a/packages/beacon-state-transition/test/utils/block.ts +++ b/packages/state-transition/test/utils/block.ts @@ -1,5 +1,5 @@ import crypto from "node:crypto"; -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {ZERO_HASH} from "../../src/constants/index.js"; export function generateEmptyBlock(): phase0.BeaconBlock { diff --git a/packages/beacon-state-transition/test/utils/deposit.ts b/packages/state-transition/test/utils/deposit.ts similarity index 79% rename from packages/beacon-state-transition/test/utils/deposit.ts rename to packages/state-transition/test/utils/deposit.ts index ad8db61df67d..15675ce2395b 100644 --- a/packages/beacon-state-transition/test/utils/deposit.ts +++ b/packages/state-transition/test/utils/deposit.ts @@ -1,5 +1,5 @@ -import {DEPOSIT_CONTRACT_TREE_DEPTH} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +import {DEPOSIT_CONTRACT_TREE_DEPTH} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; import {EMPTY_SIGNATURE} from "../../src/constants/index.js"; /** diff --git a/packages/lodestar/test/utils/eth1Data.ts b/packages/state-transition/test/utils/eth1Data.ts similarity index 82% rename from packages/lodestar/test/utils/eth1Data.ts rename to packages/state-transition/test/utils/eth1Data.ts index 1790c06dffb7..1aa4eac8e4e4 100644 --- a/packages/lodestar/test/utils/eth1Data.ts +++ b/packages/state-transition/test/utils/eth1Data.ts @@ -1,4 +1,4 @@ -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; import {ZERO_HASH} from "../../src/constants/index.js"; export function generateEth1Data(blockHash = ZERO_HASH, depositCount = 0, depositRoot = ZERO_HASH): phase0.Eth1Data { diff --git a/packages/beacon-state-transition/test/utils/index.ts b/packages/state-transition/test/utils/index.ts similarity index 100% rename from packages/beacon-state-transition/test/utils/index.ts rename to packages/state-transition/test/utils/index.ts diff --git a/packages/beacon-state-transition/test/utils/infura.ts b/packages/state-transition/test/utils/infura.ts similarity index 82% rename from packages/beacon-state-transition/test/utils/infura.ts rename to packages/state-transition/test/utils/infura.ts index b5b0a10d7d3c..823488ccfbe4 100644 --- a/packages/beacon-state-transition/test/utils/infura.ts +++ b/packages/state-transition/test/utils/infura.ts @@ -1,4 +1,4 @@ -import {NetworkName} from "@chainsafe/lodestar-config/networks.js"; +import {NetworkName} from "@lodestar/config/networks.js"; export function getInfuraBeaconUrl(network: NetworkName): string { const INFURA_ETH2_CREDENTIALS = process.env.INFURA_ETH2_CREDENTIALS; diff --git a/packages/beacon-state-transition/test/utils/interop.ts b/packages/state-transition/test/utils/interop.ts similarity index 100% rename from packages/beacon-state-transition/test/utils/interop.ts rename to packages/state-transition/test/utils/interop.ts diff --git a/packages/beacon-state-transition/test/utils/logger.ts b/packages/state-transition/test/utils/logger.ts similarity index 53% rename from packages/beacon-state-transition/test/utils/logger.ts rename to packages/state-transition/test/utils/logger.ts index 239f4a17b92c..564cadb737e1 100644 --- a/packages/beacon-state-transition/test/utils/logger.ts +++ b/packages/state-transition/test/utils/logger.ts @@ -1,4 +1,4 @@ -import {WinstonLogger, ILogger} from "@chainsafe/lodestar-utils"; +import {WinstonLogger, ILogger} from "@lodestar/utils"; export function profilerLogger(): ILogger { return new WinstonLogger(); diff --git a/packages/beacon-state-transition/test/utils/misc.ts b/packages/state-transition/test/utils/misc.ts similarity index 100% rename from packages/beacon-state-transition/test/utils/misc.ts rename to packages/state-transition/test/utils/misc.ts diff --git a/packages/lodestar/test/utils/rpcCall.ts b/packages/state-transition/test/utils/rpcCall.ts similarity index 100% rename from packages/lodestar/test/utils/rpcCall.ts rename to packages/state-transition/test/utils/rpcCall.ts diff --git a/packages/beacon-state-transition/test/utils/sleep.ts b/packages/state-transition/test/utils/sleep.ts similarity index 100% rename from packages/beacon-state-transition/test/utils/sleep.ts rename to packages/state-transition/test/utils/sleep.ts diff --git a/packages/beacon-state-transition/test/utils/specTestCases.ts b/packages/state-transition/test/utils/specTestCases.ts similarity index 100% rename from packages/beacon-state-transition/test/utils/specTestCases.ts rename to packages/state-transition/test/utils/specTestCases.ts diff --git a/packages/beacon-state-transition/test/utils/state.ts b/packages/state-transition/test/utils/state.ts similarity index 91% rename from packages/beacon-state-transition/test/utils/state.ts rename to packages/state-transition/test/utils/state.ts index ba37943a43bb..20d6cc05d8af 100644 --- a/packages/beacon-state-transition/test/utils/state.ts +++ b/packages/state-transition/test/utils/state.ts @@ -1,15 +1,15 @@ -import {config as minimalConfig} from "@chainsafe/lodestar-config/default"; +import {config as minimalConfig} from "@lodestar/config/default"; import { EPOCHS_PER_HISTORICAL_VECTOR, EPOCHS_PER_SLASHINGS_VECTOR, GENESIS_EPOCH, GENESIS_SLOT, SLOTS_PER_HISTORICAL_ROOT, -} from "@chainsafe/lodestar-params"; -import {phase0, ssz} from "@chainsafe/lodestar-types"; -import {config} from "@chainsafe/lodestar-config/default"; +} from "@lodestar/params"; +import {phase0, ssz} from "@lodestar/types"; +import {config} from "@lodestar/config/default"; -import {createIBeaconConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; +import {createIBeaconConfig, IChainForkConfig} from "@lodestar/config"; import {ZERO_HASH} from "../../src/constants/index.js"; import {newZeroedBigIntArray} from "../../src/util/index.js"; diff --git a/packages/beacon-state-transition/test/utils/testFileCache.ts b/packages/state-transition/test/utils/testFileCache.ts similarity index 93% rename from packages/beacon-state-transition/test/utils/testFileCache.ts rename to packages/state-transition/test/utils/testFileCache.ts index 7ef12a9dcb8f..cc30dfc8922d 100644 --- a/packages/beacon-state-transition/test/utils/testFileCache.ts +++ b/packages/state-transition/test/utils/testFileCache.ts @@ -1,10 +1,10 @@ import fs from "node:fs"; import path from "node:path"; import got from "got"; -import {getClient} from "@chainsafe/lodestar-api"; -import {NetworkName, networksChainConfig} from "@chainsafe/lodestar-config/networks"; -import {createIChainForkConfig, IChainForkConfig} from "@chainsafe/lodestar-config"; -import {allForks} from "@chainsafe/lodestar-types"; +import {getClient} from "@lodestar/api"; +import {NetworkName, networksChainConfig} from "@lodestar/config/networks"; +import {createIChainForkConfig, IChainForkConfig} from "@lodestar/config"; +import {allForks} from "@lodestar/types"; import {CachedBeaconStateAllForks, computeEpochAtSlot} from "../../src/index.js"; import {testCachePath} from "../cache.js"; import {createCachedBeaconStateTest} from "../utils/state.js"; diff --git a/packages/beacon-state-transition/test/utils/types.ts b/packages/state-transition/test/utils/types.ts similarity index 100% rename from packages/beacon-state-transition/test/utils/types.ts rename to packages/state-transition/test/utils/types.ts diff --git a/packages/beacon-state-transition/test/utils/validator.ts b/packages/state-transition/test/utils/validator.ts similarity index 92% rename from packages/beacon-state-transition/test/utils/validator.ts rename to packages/state-transition/test/utils/validator.ts index ff63e94ba7d8..75a54da1ccfd 100644 --- a/packages/beacon-state-transition/test/utils/validator.ts +++ b/packages/state-transition/test/utils/validator.ts @@ -1,6 +1,6 @@ import {fromHexString} from "@chainsafe/ssz"; -import {FAR_FUTURE_EPOCH} from "@chainsafe/lodestar-params"; -import {phase0} from "@chainsafe/lodestar-types"; +import {FAR_FUTURE_EPOCH} from "@lodestar/params"; +import {phase0} from "@lodestar/types"; export interface IValidatorGeneratorOpts { activation?: number; diff --git a/packages/lodestar/test/utils/voluntaryExits.ts b/packages/state-transition/test/utils/voluntaryExits.ts similarity index 85% rename from packages/lodestar/test/utils/voluntaryExits.ts rename to packages/state-transition/test/utils/voluntaryExits.ts index 6c9a5a109fa8..dbb5d597f20f 100644 --- a/packages/lodestar/test/utils/voluntaryExits.ts +++ b/packages/state-transition/test/utils/voluntaryExits.ts @@ -1,4 +1,4 @@ -import {phase0} from "@chainsafe/lodestar-types"; +import {phase0} from "@lodestar/types"; export function generateEmptyVoluntaryExit(): phase0.VoluntaryExit { return { diff --git a/packages/beacon-state-transition/tsconfig.build.json b/packages/state-transition/tsconfig.build.json similarity index 100% rename from packages/beacon-state-transition/tsconfig.build.json rename to packages/state-transition/tsconfig.build.json diff --git a/packages/beacon-state-transition/tsconfig.json b/packages/state-transition/tsconfig.json similarity index 100% rename from packages/beacon-state-transition/tsconfig.json rename to packages/state-transition/tsconfig.json diff --git a/packages/types/README.md b/packages/types/README.md index 870090a8beca..eb59f2c3300d 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -1,6 +1,6 @@ # lodestar-types -[![npm](https://img.shields.io/npm/v/@chainsafe/lodestar-types)](https://www.npmjs.com/package/@chainsafe/lodestar-types) +[![npm](https://img.shields.io/npm/v/@lodestar/types)](https://www.npmjs.com/package/@lodestar/types) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Eth Consensus Spec v1.1.10](https://img.shields.io/badge/ETH%20consensus--spec-1.1.10-blue)](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10) ![ES Version](https://img.shields.io/badge/ES-2020-yellow) @@ -13,7 +13,7 @@ Lodestar defines all datatypes defined in the [Ethereum Consensus spec](https:// ## Installation ```sh -npm install @chainsafe/lodestar-types +npm install @lodestar/types ``` ## Usage @@ -30,7 +30,7 @@ Lodestar types are all defined as typescript interfaces. These interfaces can be These interfaces are accessible via named exports. ```typescript -import {Epoch} from "@chainsafe/lodestar-types"; +import {Epoch} from "@lodestar/types"; const x: Epoch = 5; ``` @@ -41,7 +41,7 @@ Lodestar types are also defined as SSZ objects. These "Type" objects provide con ```typescript import {Type} from "@chainsafe/ssz"; -import {ssz, Epoch} from "@chainsafe/lodestar-types"; +import {ssz, Epoch} from "@lodestar/types"; const EpochType: Type = ssz.Epoch; @@ -53,7 +53,7 @@ const e = EpochType.defaultValue(); Lodestar types support multiple different consensus forks. In order to easily differentiate types that may change across forks, types are organized in namespaces according to the fork in which they're introduced. Types introduced in phase 0 are available under the `phase0` namespace. Types introduced in altair are available under the `altair` namespace. ```typescript -import {altair, phase0, ssz} from "@chainsafe/lodestar-types"; +import {altair, phase0, ssz} from "@lodestar/types"; const phase0State: phase0.BeaconState = ssz.phase0.BeaconState.defaultValue(); const altairState: altair.BeaconState = ssz.altair.BeaconState.defaultValue(); @@ -62,7 +62,7 @@ const altairState: altair.BeaconState = ssz.altair.BeaconState.defaultValue(); Primitive types are directly available without a namespace. ```typescript -import {Epoch, ssz} from "@chainsafe/lodestar-types"; +import {Epoch, ssz} from "@lodestar/types"; const epoch: Epoch = ssz.Epoch.defaultValue(); ``` @@ -70,8 +70,8 @@ const epoch: Epoch = ssz.Epoch.defaultValue(); In some cases, we need interfaces that accept types across all forks, eg: when the fork is not known ahead of time. Typescript interfaces for this purpose are exported under the `allForks` namespace. SSZ Types typed to these interfaces are also provided under an `allForks` namespace, but keyed by `ForkName`. ```typescript -import {ForkName} from "@chainsafe/lodestar-params"; -import {allForks, ssz} from "@chainsafe/lodestar-types"; +import {ForkName} from "@lodestar/params"; +import {allForks, ssz} from "@lodestar/types"; const state: allForks.BeaconState = ssz.allForks[ForkName.phase0].BeaconState.defaultValue(); ``` diff --git a/packages/types/package.json b/packages/types/package.json index 8beb17dd20c9..8425df05074c 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-types", + "name": "@lodestar/types", "description": "Typescript types required for lodestar", "license": "Apache-2.0", "author": "ChainSafe Systems", @@ -62,7 +62,7 @@ }, "types": "lib/index.d.ts", "dependencies": { - "@chainsafe/lodestar-params": "^0.39.0", + "@lodestar/params": "^0.39.0", "@chainsafe/ssz": "^0.9.2" }, "keywords": [ diff --git a/packages/types/src/altair/sszTypes.ts b/packages/types/src/altair/sszTypes.ts index 8c21e736cdca..9c4fc6dc19a4 100644 --- a/packages/types/src/altair/sszTypes.ts +++ b/packages/types/src/altair/sszTypes.ts @@ -9,7 +9,7 @@ import { VALIDATOR_REGISTRY_LIMIT, EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import * as phase0Ssz from "../phase0/sszTypes.js"; import * as primitiveSsz from "../primitive/sszTypes.js"; diff --git a/packages/types/src/bellatrix/sszTypes.ts b/packages/types/src/bellatrix/sszTypes.ts index 0ca6dc663966..6186886f7abf 100644 --- a/packages/types/src/bellatrix/sszTypes.ts +++ b/packages/types/src/bellatrix/sszTypes.ts @@ -6,7 +6,7 @@ import { MAX_BYTES_PER_TRANSACTION, MAX_EXTRA_DATA_BYTES, SLOTS_PER_HISTORICAL_ROOT, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import {ssz as primitiveSsz} from "../primitive/index.js"; import {ssz as phase0Ssz} from "../phase0/index.js"; import {ssz as altairSsz} from "../altair/index.js"; diff --git a/packages/types/src/phase0/sszTypes.ts b/packages/types/src/phase0/sszTypes.ts index 817bac6e1f62..ea06be588849 100644 --- a/packages/types/src/phase0/sszTypes.ts +++ b/packages/types/src/phase0/sszTypes.ts @@ -26,7 +26,7 @@ import { SLOTS_PER_EPOCH, SLOTS_PER_HISTORICAL_ROOT, VALIDATOR_REGISTRY_LIMIT, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import * as primitiveSsz from "../primitive/sszTypes.js"; const { diff --git a/packages/types/test/unit/constants.test.ts b/packages/types/test/unit/constants.test.ts index 2892ac9f07e2..48051c36f566 100644 --- a/packages/types/test/unit/constants.test.ts +++ b/packages/types/test/unit/constants.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import * as constants from "@chainsafe/lodestar-params"; +import * as constants from "@lodestar/params"; import {ssz} from "../../src/index.js"; /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/packages/utils/package.json b/packages/utils/package.json index eec261f30d53..143e764d3efa 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-utils", + "name": "@lodestar/utils", "description": "Utilities required across multiple lodestar packages", "license": "Apache-2.0", "author": "ChainSafe Systems", diff --git a/packages/validator/package.json b/packages/validator/package.json index c5b823464297..4b38afdff693 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -1,5 +1,5 @@ { - "name": "@chainsafe/lodestar-validator", + "name": "@lodestar/validator", "version": "0.39.0", "description": "A Typescript implementation of the validator client", "author": "ChainSafe Systems", @@ -49,13 +49,13 @@ ], "dependencies": { "@chainsafe/bls": "7.1.1", - "@chainsafe/lodestar-api": "^0.39.0", - "@chainsafe/lodestar-beacon-state-transition": "^0.39.0", - "@chainsafe/lodestar-config": "^0.39.0", - "@chainsafe/lodestar-db": "^0.39.0", - "@chainsafe/lodestar-params": "^0.39.0", - "@chainsafe/lodestar-types": "^0.39.0", - "@chainsafe/lodestar-utils": "^0.39.0", + "@lodestar/api": "^0.39.0", + "@lodestar/state-transition": "^0.39.0", + "@lodestar/config": "^0.39.0", + "@lodestar/db": "^0.39.0", + "@lodestar/params": "^0.39.0", + "@lodestar/types": "^0.39.0", + "@lodestar/utils": "^0.39.0", "@chainsafe/ssz": "^0.9.2", "bigint-buffer": "^1.1.5", "cross-fetch": "^3.1.4", diff --git a/packages/validator/src/genesis.ts b/packages/validator/src/genesis.ts index 6d161a7b630c..f45d5d1bec4a 100644 --- a/packages/validator/src/genesis.ts +++ b/packages/validator/src/genesis.ts @@ -1,6 +1,6 @@ -import {Genesis} from "@chainsafe/lodestar-types/phase0"; -import {ILogger, sleep} from "@chainsafe/lodestar-utils"; -import {Api} from "@chainsafe/lodestar-api"; +import {Genesis} from "@lodestar/types/phase0"; +import {ILogger, sleep} from "@lodestar/utils"; +import {Api} from "@lodestar/api"; /** The time between polls when waiting for genesis */ const WAITING_FOR_GENESIS_POLL_MS = 12 * 1000; diff --git a/packages/validator/src/repositories/metaDataRepository.ts b/packages/validator/src/repositories/metaDataRepository.ts index 9522c49db0fa..64a8cf5a4f81 100644 --- a/packages/validator/src/repositories/metaDataRepository.ts +++ b/packages/validator/src/repositories/metaDataRepository.ts @@ -1,6 +1,6 @@ -import {Bucket, encodeKey, IDatabaseApiOptions} from "@chainsafe/lodestar-db"; -import {Root, UintNum64} from "@chainsafe/lodestar-types"; -import {ssz} from "@chainsafe/lodestar-types"; +import {Bucket, encodeKey, IDatabaseApiOptions} from "@lodestar/db"; +import {Root, UintNum64} from "@lodestar/types"; +import {ssz} from "@lodestar/types"; import {LodestarValidatorDatabaseController} from "../types.js"; const GENESIS_VALIDATORS_ROOT = Buffer.from("GENESIS_VALIDATORS_ROOT"); diff --git a/packages/validator/src/services/attestation.ts b/packages/validator/src/services/attestation.ts index 3cc62724cbc4..f3a2300df239 100644 --- a/packages/validator/src/services/attestation.ts +++ b/packages/validator/src/services/attestation.ts @@ -1,7 +1,7 @@ -import {phase0, Slot, ssz} from "@chainsafe/lodestar-types"; -import {computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {extendError, sleep} from "@chainsafe/lodestar-utils"; -import {Api} from "@chainsafe/lodestar-api"; +import {phase0, Slot, ssz} from "@lodestar/types"; +import {computeEpochAtSlot} from "@lodestar/state-transition"; +import {extendError, sleep} from "@lodestar/utils"; +import {Api} from "@lodestar/api"; import {toHexString} from "@chainsafe/ssz"; import {IClock, ILoggerVc} from "../util/index.js"; import {PubkeyHex} from "../types.js"; diff --git a/packages/validator/src/services/attestationDuties.ts b/packages/validator/src/services/attestationDuties.ts index 2cac06ee111d..4910693f1aba 100644 --- a/packages/validator/src/services/attestationDuties.ts +++ b/packages/validator/src/services/attestationDuties.ts @@ -1,8 +1,8 @@ -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {extendError, sleep} from "@chainsafe/lodestar-utils"; -import {computeEpochAtSlot, isAggregatorFromCommitteeLength} from "@chainsafe/lodestar-beacon-state-transition"; -import {BLSSignature, Epoch, Slot, ValidatorIndex, RootHex} from "@chainsafe/lodestar-types"; -import {Api, routes} from "@chainsafe/lodestar-api"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {extendError, sleep} from "@lodestar/utils"; +import {computeEpochAtSlot, isAggregatorFromCommitteeLength} from "@lodestar/state-transition"; +import {BLSSignature, Epoch, Slot, ValidatorIndex, RootHex} from "@lodestar/types"; +import {Api, routes} from "@lodestar/api"; import {toHexString} from "@chainsafe/ssz"; import {IClock, ILoggerVc} from "../util/index.js"; import {PubkeyHex} from "../types.js"; diff --git a/packages/validator/src/services/block.ts b/packages/validator/src/services/block.ts index 025c7c8c293e..e720818da656 100644 --- a/packages/validator/src/services/block.ts +++ b/packages/validator/src/services/block.ts @@ -1,9 +1,9 @@ -import {BLSPubkey, Slot, BLSSignature, allForks, bellatrix} from "@chainsafe/lodestar-types"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {ForkName} from "@chainsafe/lodestar-params"; -import {extendError, prettyBytes} from "@chainsafe/lodestar-utils"; +import {BLSPubkey, Slot, BLSSignature, allForks, bellatrix} from "@lodestar/types"; +import {IChainForkConfig} from "@lodestar/config"; +import {ForkName} from "@lodestar/params"; +import {extendError, prettyBytes} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; -import {Api} from "@chainsafe/lodestar-api"; +import {Api} from "@lodestar/api"; import {IClock, ILoggerVc} from "../util/index.js"; import {PubkeyHex} from "../types.js"; import {Metrics} from "../metrics.js"; diff --git a/packages/validator/src/services/blockDuties.ts b/packages/validator/src/services/blockDuties.ts index 9848e4b00908..9995ad25e90f 100644 --- a/packages/validator/src/services/blockDuties.ts +++ b/packages/validator/src/services/blockDuties.ts @@ -1,8 +1,8 @@ -import {computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {BLSPubkey, Epoch, Root, Slot, ssz} from "@chainsafe/lodestar-types"; +import {computeEpochAtSlot} from "@lodestar/state-transition"; +import {BLSPubkey, Epoch, Root, Slot, ssz} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; -import {Api, routes} from "@chainsafe/lodestar-api"; -import {extendError} from "@chainsafe/lodestar-utils"; +import {Api, routes} from "@lodestar/api"; +import {extendError} from "@lodestar/utils"; import {IClock, differenceHex, ILoggerVc} from "../util/index.js"; import {PubkeyHex} from "../types.js"; import {Metrics} from "../metrics.js"; diff --git a/packages/validator/src/services/chainHeaderTracker.ts b/packages/validator/src/services/chainHeaderTracker.ts index 1cfde51960d8..ab1ad5da2252 100644 --- a/packages/validator/src/services/chainHeaderTracker.ts +++ b/packages/validator/src/services/chainHeaderTracker.ts @@ -1,7 +1,7 @@ -import {Api, routes} from "@chainsafe/lodestar-api"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {Slot, Root, RootHex} from "@chainsafe/lodestar-types"; -import {GENESIS_SLOT} from "@chainsafe/lodestar-params"; +import {Api, routes} from "@lodestar/api"; +import {ILogger} from "@lodestar/utils"; +import {Slot, Root, RootHex} from "@lodestar/types"; +import {GENESIS_SLOT} from "@lodestar/params"; import {fromHexString} from "@chainsafe/ssz"; import {ValidatorEvent, ValidatorEventEmitter} from "./emitter.js"; diff --git a/packages/validator/src/services/doppelgangerService.ts b/packages/validator/src/services/doppelgangerService.ts index bf671d331afb..6df0b27fcebf 100644 --- a/packages/validator/src/services/doppelgangerService.ts +++ b/packages/validator/src/services/doppelgangerService.ts @@ -1,7 +1,7 @@ -import {Epoch, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {Api} from "@chainsafe/lodestar-api"; -import {ILogger, sleep} from "@chainsafe/lodestar-utils"; -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; +import {Epoch, ValidatorIndex} from "@lodestar/types"; +import {Api} from "@lodestar/api"; +import {ILogger, sleep} from "@lodestar/utils"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; import {ProcessShutdownCallback, PubkeyHex} from "../types.js"; import {IClock} from "../util/index.js"; import {Metrics} from "../metrics.js"; diff --git a/packages/validator/src/services/indices.ts b/packages/validator/src/services/indices.ts index 15384de57738..e7e8dbb77a5b 100644 --- a/packages/validator/src/services/indices.ts +++ b/packages/validator/src/services/indices.ts @@ -1,7 +1,7 @@ -import {ValidatorIndex} from "@chainsafe/lodestar-types"; -import {ILogger} from "@chainsafe/lodestar-utils"; +import {ValidatorIndex} from "@lodestar/types"; +import {ILogger} from "@lodestar/utils"; import {toHexString} from "@chainsafe/ssz"; -import {Api} from "@chainsafe/lodestar-api"; +import {Api} from "@lodestar/api"; import {batchItems} from "../util/index.js"; import {Metrics} from "../metrics.js"; diff --git a/packages/validator/src/services/prepareBeaconProposer.ts b/packages/validator/src/services/prepareBeaconProposer.ts index 99d4695c9a89..91f2a3eb8fa0 100644 --- a/packages/validator/src/services/prepareBeaconProposer.ts +++ b/packages/validator/src/services/prepareBeaconProposer.ts @@ -1,8 +1,8 @@ -import {Epoch, bellatrix} from "@chainsafe/lodestar-types"; -import {Api, routes} from "@chainsafe/lodestar-api"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +import {Epoch, bellatrix} from "@lodestar/types"; +import {Api, routes} from "@lodestar/api"; +import {IBeaconConfig} from "@lodestar/config"; import {fromHexString} from "@chainsafe/ssz"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; import {IClock, ILoggerVc, batchItems} from "../util/index.js"; import {Metrics} from "../metrics.js"; diff --git a/packages/validator/src/services/syncCommittee.ts b/packages/validator/src/services/syncCommittee.ts index d255e64e8dd1..8d4de71f19b9 100644 --- a/packages/validator/src/services/syncCommittee.ts +++ b/packages/validator/src/services/syncCommittee.ts @@ -1,8 +1,8 @@ -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Slot, CommitteeIndex, altair, Root} from "@chainsafe/lodestar-types"; -import {extendError, sleep} from "@chainsafe/lodestar-utils"; -import {computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; -import {Api} from "@chainsafe/lodestar-api"; +import {IChainForkConfig} from "@lodestar/config"; +import {Slot, CommitteeIndex, altair, Root} from "@lodestar/types"; +import {extendError, sleep} from "@lodestar/utils"; +import {computeEpochAtSlot} from "@lodestar/state-transition"; +import {Api} from "@lodestar/api"; import {IClock, ILoggerVc} from "../util/index.js"; import {PubkeyHex} from "../types.js"; import {Metrics} from "../metrics.js"; diff --git a/packages/validator/src/services/syncCommitteeDuties.ts b/packages/validator/src/services/syncCommitteeDuties.ts index ca163f62d737..a8d6290d033d 100644 --- a/packages/validator/src/services/syncCommitteeDuties.ts +++ b/packages/validator/src/services/syncCommitteeDuties.ts @@ -1,14 +1,10 @@ -import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SYNC_COMMITTEE_SUBNET_SIZE} from "@chainsafe/lodestar-params"; -import { - computeSyncPeriodAtEpoch, - computeSyncPeriodAtSlot, - isSyncCommitteeAggregator, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {BLSSignature, Epoch, RootHex, Slot, SyncPeriod, ValidatorIndex} from "@chainsafe/lodestar-types"; +import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; +import {computeSyncPeriodAtEpoch, computeSyncPeriodAtSlot, isSyncCommitteeAggregator} from "@lodestar/state-transition"; +import {IChainForkConfig} from "@lodestar/config"; +import {BLSSignature, Epoch, RootHex, Slot, SyncPeriod, ValidatorIndex} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; -import {Api, routes} from "@chainsafe/lodestar-api"; -import {extendError} from "@chainsafe/lodestar-utils"; +import {Api, routes} from "@lodestar/api"; +import {extendError} from "@lodestar/utils"; import {IClock, ILoggerVc} from "../util/index.js"; import {PubkeyHex} from "../types.js"; import {Metrics} from "../metrics.js"; diff --git a/packages/validator/src/services/utils.ts b/packages/validator/src/services/utils.ts index da0459bb5616..0957b8a3cb79 100644 --- a/packages/validator/src/services/utils.ts +++ b/packages/validator/src/services/utils.ts @@ -1,5 +1,5 @@ -import {SYNC_COMMITTEE_SUBNET_SIZE} from "@chainsafe/lodestar-params"; -import {CommitteeIndex, SubcommitteeIndex} from "@chainsafe/lodestar-types"; +import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; +import {CommitteeIndex, SubcommitteeIndex} from "@lodestar/types"; import {AttDutyAndProof} from "./attestationDuties.js"; import {SyncDutyAndProofs, SyncDutySubnet, SyncSelectionProof} from "./syncCommitteeDuties.js"; diff --git a/packages/validator/src/services/validatorStore.ts b/packages/validator/src/services/validatorStore.ts index 6f3d5e65708a..15873c9c61ac 100644 --- a/packages/validator/src/services/validatorStore.ts +++ b/packages/validator/src/services/validatorStore.ts @@ -4,8 +4,8 @@ import { computeStartSlotAtEpoch, computeDomain, ZERO_HASH, -} from "@chainsafe/lodestar-beacon-state-transition"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +} from "@lodestar/state-transition"; +import {IBeaconConfig} from "@lodestar/config"; import { DOMAIN_AGGREGATE_AND_PROOF, DOMAIN_BEACON_ATTESTER, @@ -17,7 +17,7 @@ import { DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF, DOMAIN_VOLUNTARY_EXIT, DOMAIN_APPLICATION_BUILDER, -} from "@chainsafe/lodestar-params"; +} from "@lodestar/params"; import type {SecretKey} from "@chainsafe/bls/types"; import { allForks, @@ -32,9 +32,9 @@ import { ssz, ValidatorIndex, ExecutionAddress, -} from "@chainsafe/lodestar-types"; +} from "@lodestar/types"; import {BitArray, fromHexString, toHexString} from "@chainsafe/ssz"; -import {routes} from "@chainsafe/lodestar-api"; +import {routes} from "@lodestar/api"; import {ISlashingProtection} from "../slashingProtection/index.js"; import {PubkeyHex} from "../types.js"; import {externalSignerPostSignature} from "../util/externalSignerClient.js"; diff --git a/packages/validator/src/slashingProtection/attestation/attestationByTargetRepository.ts b/packages/validator/src/slashingProtection/attestation/attestationByTargetRepository.ts index 7fb8e9aa808e..f99d00f6656d 100644 --- a/packages/validator/src/slashingProtection/attestation/attestationByTargetRepository.ts +++ b/packages/validator/src/slashingProtection/attestation/attestationByTargetRepository.ts @@ -1,6 +1,6 @@ -import {BLSPubkey, Epoch, ssz} from "@chainsafe/lodestar-types"; -import {intToBytes, bytesToInt} from "@chainsafe/lodestar-utils"; -import {Bucket, DB_PREFIX_LENGTH, encodeKey, IDatabaseApiOptions, uintLen} from "@chainsafe/lodestar-db"; +import {BLSPubkey, Epoch, ssz} from "@lodestar/types"; +import {intToBytes, bytesToInt} from "@lodestar/utils"; +import {Bucket, DB_PREFIX_LENGTH, encodeKey, IDatabaseApiOptions, uintLen} from "@lodestar/db"; import {ContainerType, Type} from "@chainsafe/ssz"; import {LodestarValidatorDatabaseController} from "../../types.js"; import {SlashingProtectionAttestation} from "../types.js"; diff --git a/packages/validator/src/slashingProtection/attestation/attestationLowerBoundRepository.ts b/packages/validator/src/slashingProtection/attestation/attestationLowerBoundRepository.ts index 499af2161355..1b89f76036b3 100644 --- a/packages/validator/src/slashingProtection/attestation/attestationLowerBoundRepository.ts +++ b/packages/validator/src/slashingProtection/attestation/attestationLowerBoundRepository.ts @@ -1,5 +1,5 @@ -import {BLSPubkey, Epoch, ssz} from "@chainsafe/lodestar-types"; -import {Bucket, encodeKey, IDatabaseApiOptions} from "@chainsafe/lodestar-db"; +import {BLSPubkey, Epoch, ssz} from "@lodestar/types"; +import {Bucket, encodeKey, IDatabaseApiOptions} from "@lodestar/db"; import {ContainerType, Type} from "@chainsafe/ssz"; import {LodestarValidatorDatabaseController} from "../../types.js"; diff --git a/packages/validator/src/slashingProtection/attestation/errors.ts b/packages/validator/src/slashingProtection/attestation/errors.ts index 6af8ec588eb5..7d4b0978d097 100644 --- a/packages/validator/src/slashingProtection/attestation/errors.ts +++ b/packages/validator/src/slashingProtection/attestation/errors.ts @@ -1,5 +1,5 @@ -import {Epoch} from "@chainsafe/lodestar-types"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {Epoch} from "@lodestar/types"; +import {LodestarError} from "@lodestar/utils"; import {SlashingProtectionAttestation} from "../types.js"; export enum InvalidAttestationErrorCode { diff --git a/packages/validator/src/slashingProtection/attestation/index.ts b/packages/validator/src/slashingProtection/attestation/index.ts index d8d006594ef7..0dba7c3bd486 100644 --- a/packages/validator/src/slashingProtection/attestation/index.ts +++ b/packages/validator/src/slashingProtection/attestation/index.ts @@ -1,4 +1,4 @@ -import {BLSPubkey} from "@chainsafe/lodestar-types"; +import {BLSPubkey} from "@lodestar/types"; import {isEqualNonZeroRoot, minEpoch} from "../utils.js"; import {MinMaxSurround, SurroundAttestationError, SurroundAttestationErrorCode} from "../minMaxSurround/index.js"; import {SlashingProtectionAttestation} from "../types.js"; diff --git a/packages/validator/src/slashingProtection/block/blockBySlotRepository.ts b/packages/validator/src/slashingProtection/block/blockBySlotRepository.ts index 06cb983f0510..17e744991b3f 100644 --- a/packages/validator/src/slashingProtection/block/blockBySlotRepository.ts +++ b/packages/validator/src/slashingProtection/block/blockBySlotRepository.ts @@ -1,6 +1,6 @@ -import {BLSPubkey, Slot, ssz} from "@chainsafe/lodestar-types"; -import {intToBytes, bytesToInt} from "@chainsafe/lodestar-utils"; -import {Bucket, DB_PREFIX_LENGTH, encodeKey, IDatabaseApiOptions, uintLen} from "@chainsafe/lodestar-db"; +import {BLSPubkey, Slot, ssz} from "@lodestar/types"; +import {intToBytes, bytesToInt} from "@lodestar/utils"; +import {Bucket, DB_PREFIX_LENGTH, encodeKey, IDatabaseApiOptions, uintLen} from "@lodestar/db"; import {ContainerType, Type} from "@chainsafe/ssz"; import {LodestarValidatorDatabaseController} from "../../types.js"; import {SlashingProtectionBlock} from "../types.js"; diff --git a/packages/validator/src/slashingProtection/block/errors.ts b/packages/validator/src/slashingProtection/block/errors.ts index 80b94cc51637..be3696bba700 100644 --- a/packages/validator/src/slashingProtection/block/errors.ts +++ b/packages/validator/src/slashingProtection/block/errors.ts @@ -1,5 +1,5 @@ -import {Slot} from "@chainsafe/lodestar-types"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {Slot} from "@lodestar/types"; +import {LodestarError} from "@lodestar/utils"; import {SlashingProtectionBlock} from "../types.js"; export enum InvalidBlockErrorCode { diff --git a/packages/validator/src/slashingProtection/block/index.ts b/packages/validator/src/slashingProtection/block/index.ts index 0f0aef9959e9..c5351baacbc9 100644 --- a/packages/validator/src/slashingProtection/block/index.ts +++ b/packages/validator/src/slashingProtection/block/index.ts @@ -1,4 +1,4 @@ -import {BLSPubkey} from "@chainsafe/lodestar-types"; +import {BLSPubkey} from "@lodestar/types"; import {isEqualNonZeroRoot} from "../utils.js"; import {SlashingProtectionBlock} from "../types.js"; import {InvalidBlockError, InvalidBlockErrorCode} from "./errors.js"; diff --git a/packages/validator/src/slashingProtection/index.ts b/packages/validator/src/slashingProtection/index.ts index 30bd2ff0e121..3ec19419b427 100644 --- a/packages/validator/src/slashingProtection/index.ts +++ b/packages/validator/src/slashingProtection/index.ts @@ -1,5 +1,5 @@ -import {BLSPubkey, Root} from "@chainsafe/lodestar-types"; -import {DatabaseService, IDatabaseApiOptions} from "@chainsafe/lodestar-db"; +import {BLSPubkey, Root} from "@lodestar/types"; +import {DatabaseService, IDatabaseApiOptions} from "@lodestar/db"; import {uniqueVectorArr} from "../slashingProtection/utils.js"; import {BlockBySlotRepository, SlashingProtectionBlockService} from "./block/index.js"; import { diff --git a/packages/validator/src/slashingProtection/interchange/errors.ts b/packages/validator/src/slashingProtection/interchange/errors.ts index d7dd751ca1bf..893068fcd69e 100644 --- a/packages/validator/src/slashingProtection/interchange/errors.ts +++ b/packages/validator/src/slashingProtection/interchange/errors.ts @@ -1,5 +1,5 @@ -import {Root} from "@chainsafe/lodestar-types"; -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {Root} from "@lodestar/types"; +import {LodestarError} from "@lodestar/utils"; export enum InterchangeErrorErrorCode { UNSUPPORTED_FORMAT = "ERR_INTERCHANGE_UNSUPPORTED_FORMAT", diff --git a/packages/validator/src/slashingProtection/interchange/parseInterchange.ts b/packages/validator/src/slashingProtection/interchange/parseInterchange.ts index 3b55346a5e0f..8a1158894b0e 100644 --- a/packages/validator/src/slashingProtection/interchange/parseInterchange.ts +++ b/packages/validator/src/slashingProtection/interchange/parseInterchange.ts @@ -1,4 +1,4 @@ -import {Root} from "@chainsafe/lodestar-types"; +import {Root} from "@lodestar/types"; import {isEqualRoot} from "../utils.js"; import {InterchangeError, InterchangeErrorErrorCode} from "./errors.js"; import {Interchange, IInterchangeLodestar} from "./types.js"; diff --git a/packages/validator/src/slashingProtection/interchange/types.ts b/packages/validator/src/slashingProtection/interchange/types.ts index 2fbe9cff3696..01a07a1b8611 100644 --- a/packages/validator/src/slashingProtection/interchange/types.ts +++ b/packages/validator/src/slashingProtection/interchange/types.ts @@ -1,4 +1,4 @@ -import {BLSPubkey, Root} from "@chainsafe/lodestar-types"; +import {BLSPubkey, Root} from "@lodestar/types"; import {SlashingProtectionAttestation, SlashingProtectionBlock} from "../types.js"; import {IInterchangeCompleteV4} from "./formats/completeV4.js"; import {IInterchangeV5} from "./formats/v5.js"; diff --git a/packages/validator/src/slashingProtection/interface.ts b/packages/validator/src/slashingProtection/interface.ts index 1285633215c4..3e67aafac026 100644 --- a/packages/validator/src/slashingProtection/interface.ts +++ b/packages/validator/src/slashingProtection/interface.ts @@ -1,4 +1,4 @@ -import {BLSPubkey, Root} from "@chainsafe/lodestar-types"; +import {BLSPubkey, Root} from "@lodestar/types"; import {Interchange, InterchangeFormatVersion} from "./interchange/types.js"; import {SlashingProtectionBlock, SlashingProtectionAttestation} from "./types.js"; diff --git a/packages/validator/src/slashingProtection/minMaxSurround/distanceStoreRepository.ts b/packages/validator/src/slashingProtection/minMaxSurround/distanceStoreRepository.ts index 5de9e4374ae8..43aeb18b6acb 100644 --- a/packages/validator/src/slashingProtection/minMaxSurround/distanceStoreRepository.ts +++ b/packages/validator/src/slashingProtection/minMaxSurround/distanceStoreRepository.ts @@ -1,6 +1,6 @@ -import {Bucket, encodeKey, IDatabaseApiOptions} from "@chainsafe/lodestar-db"; -import {BLSPubkey, Epoch, ssz} from "@chainsafe/lodestar-types"; -import {intToBytes} from "@chainsafe/lodestar-utils"; +import {Bucket, encodeKey, IDatabaseApiOptions} from "@lodestar/db"; +import {BLSPubkey, Epoch, ssz} from "@lodestar/types"; +import {intToBytes} from "@lodestar/utils"; import {Type} from "@chainsafe/ssz"; import {LodestarValidatorDatabaseController} from "../../types.js"; import {IDistanceEntry, IDistanceStore} from "./interface.js"; diff --git a/packages/validator/src/slashingProtection/minMaxSurround/errors.ts b/packages/validator/src/slashingProtection/minMaxSurround/errors.ts index c8152372c316..fd094df54db3 100644 --- a/packages/validator/src/slashingProtection/minMaxSurround/errors.ts +++ b/packages/validator/src/slashingProtection/minMaxSurround/errors.ts @@ -1,4 +1,4 @@ -import {LodestarError} from "@chainsafe/lodestar-utils"; +import {LodestarError} from "@lodestar/utils"; import {MinMaxSurroundAttestation} from "./interface.js"; export enum SurroundAttestationErrorCode { diff --git a/packages/validator/src/slashingProtection/minMaxSurround/interface.ts b/packages/validator/src/slashingProtection/minMaxSurround/interface.ts index 117da03e7bdd..8d3c20c8d74a 100644 --- a/packages/validator/src/slashingProtection/minMaxSurround/interface.ts +++ b/packages/validator/src/slashingProtection/minMaxSurround/interface.ts @@ -1,4 +1,4 @@ -import {BLSPubkey, Epoch} from "@chainsafe/lodestar-types"; +import {BLSPubkey, Epoch} from "@lodestar/types"; export type MinMaxSurroundAttestation = { targetEpoch: number; diff --git a/packages/validator/src/slashingProtection/minMaxSurround/minMaxSurround.ts b/packages/validator/src/slashingProtection/minMaxSurround/minMaxSurround.ts index 9ca263cb2869..a7c64401cbb7 100644 --- a/packages/validator/src/slashingProtection/minMaxSurround/minMaxSurround.ts +++ b/packages/validator/src/slashingProtection/minMaxSurround/minMaxSurround.ts @@ -1,4 +1,4 @@ -import {BLSPubkey} from "@chainsafe/lodestar-types"; +import {BLSPubkey} from "@lodestar/types"; import {IMinMaxSurround, IDistanceEntry, IDistanceStore, MinMaxSurroundAttestation} from "./interface.js"; import {SurroundAttestationError, SurroundAttestationErrorCode} from "./errors.js"; diff --git a/packages/validator/src/slashingProtection/types.ts b/packages/validator/src/slashingProtection/types.ts index 58954cc85d93..584c66e665d4 100644 --- a/packages/validator/src/slashingProtection/types.ts +++ b/packages/validator/src/slashingProtection/types.ts @@ -1,4 +1,4 @@ -import {Epoch, Root, Slot} from "@chainsafe/lodestar-types"; +import {Epoch, Root, Slot} from "@lodestar/types"; /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/packages/validator/src/slashingProtection/utils.ts b/packages/validator/src/slashingProtection/utils.ts index b34812987e28..916f0eca9279 100644 --- a/packages/validator/src/slashingProtection/utils.ts +++ b/packages/validator/src/slashingProtection/utils.ts @@ -1,4 +1,4 @@ -import {Epoch, Root, ssz} from "@chainsafe/lodestar-types"; +import {Epoch, Root, ssz} from "@lodestar/types"; import {fromHexString, toHexString} from "@chainsafe/ssz"; export const blsPubkeyLen = 48; diff --git a/packages/validator/src/types.ts b/packages/validator/src/types.ts index 20eb55693a5e..1119b56f274f 100644 --- a/packages/validator/src/types.ts +++ b/packages/validator/src/types.ts @@ -2,8 +2,8 @@ * @module validator */ import type {SecretKey} from "@chainsafe/bls/types"; -import {BLSPubkey} from "@chainsafe/lodestar-types"; -import {IDatabaseController} from "@chainsafe/lodestar-db"; +import {BLSPubkey} from "@lodestar/types"; +import {IDatabaseController} from "@lodestar/db"; export type GenesisInfo = { startTime: number; diff --git a/packages/validator/src/util/clock.ts b/packages/validator/src/util/clock.ts index 9648b5f1105d..7ac4597689f7 100644 --- a/packages/validator/src/util/clock.ts +++ b/packages/validator/src/util/clock.ts @@ -1,8 +1,8 @@ -import {ErrorAborted, ILogger, isErrorAborted, sleep} from "@chainsafe/lodestar-utils"; -import {GENESIS_SLOT, SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {IChainForkConfig} from "@chainsafe/lodestar-config"; -import {Epoch, Slot, TimeSeconds} from "@chainsafe/lodestar-types"; -import {computeEpochAtSlot, getCurrentSlot} from "@chainsafe/lodestar-beacon-state-transition"; +import {ErrorAborted, ILogger, isErrorAborted, sleep} from "@lodestar/utils"; +import {GENESIS_SLOT, SLOTS_PER_EPOCH} from "@lodestar/params"; +import {IChainForkConfig} from "@lodestar/config"; +import {Epoch, Slot, TimeSeconds} from "@lodestar/types"; +import {computeEpochAtSlot, getCurrentSlot} from "@lodestar/state-transition"; type RunEveryFn = (slot: Slot, signal: AbortSignal) => Promise; diff --git a/packages/validator/src/util/difference.ts b/packages/validator/src/util/difference.ts index 65f752b12550..811ac7adf35e 100644 --- a/packages/validator/src/util/difference.ts +++ b/packages/validator/src/util/difference.ts @@ -1,4 +1,4 @@ -import {Root} from "@chainsafe/lodestar-types"; +import {Root} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; /** diff --git a/packages/validator/src/util/logger.ts b/packages/validator/src/util/logger.ts index 0f162ba1f155..c556a0a5ab93 100644 --- a/packages/validator/src/util/logger.ts +++ b/packages/validator/src/util/logger.ts @@ -1,5 +1,5 @@ -import {HttpError} from "@chainsafe/lodestar-api"; -import {LogData, ILogger, isErrorAborted} from "@chainsafe/lodestar-utils"; +import {HttpError} from "@lodestar/api"; +import {LogData, ILogger, isErrorAborted} from "@lodestar/utils"; import {IClock} from "./clock.js"; export type ILoggerVc = Pick & { diff --git a/packages/validator/src/util/params.ts b/packages/validator/src/util/params.ts index e5ced9f21f65..cfcb7103a42d 100644 --- a/packages/validator/src/util/params.ts +++ b/packages/validator/src/util/params.ts @@ -1,5 +1,5 @@ -import {IChainConfig, chainConfigToJson} from "@chainsafe/lodestar-config"; -import {activePreset, BeaconPreset, presetToJson} from "@chainsafe/lodestar-params"; +import {IChainConfig, chainConfigToJson} from "@lodestar/config"; +import {activePreset, BeaconPreset, presetToJson} from "@lodestar/params"; export class NotEqualParamsError extends Error {} diff --git a/packages/validator/src/validator.ts b/packages/validator/src/validator.ts index e0ac767a0f66..3712c2fc838a 100644 --- a/packages/validator/src/validator.ts +++ b/packages/validator/src/validator.ts @@ -1,11 +1,11 @@ -import {IDatabaseApiOptions} from "@chainsafe/lodestar-db"; -import {BLSPubkey, ssz} from "@chainsafe/lodestar-types"; -import {createIBeaconConfig, IBeaconConfig} from "@chainsafe/lodestar-config"; -import {Genesis} from "@chainsafe/lodestar-types/phase0"; -import {ILogger} from "@chainsafe/lodestar-utils"; -import {getClient, Api} from "@chainsafe/lodestar-api"; +import {IDatabaseApiOptions} from "@lodestar/db"; +import {BLSPubkey, ssz} from "@lodestar/types"; +import {createIBeaconConfig, IBeaconConfig} from "@lodestar/config"; +import {Genesis} from "@lodestar/types/phase0"; +import {ILogger} from "@lodestar/utils"; +import {getClient, Api} from "@lodestar/api"; import {toHexString} from "@chainsafe/ssz"; -import {computeEpochAtSlot, getCurrentSlot} from "@chainsafe/lodestar-beacon-state-transition"; +import {computeEpochAtSlot, getCurrentSlot} from "@lodestar/state-transition"; import {Clock, IClock} from "./util/clock.js"; import {waitForGenesis} from "./genesis.js"; import {BlockProposingService} from "./services/block.js"; diff --git a/packages/validator/test/spec/downloadTests.ts b/packages/validator/test/spec/downloadTests.ts index f1954a98aa60..4666f0d4a826 100644 --- a/packages/validator/test/spec/downloadTests.ts +++ b/packages/validator/test/spec/downloadTests.ts @@ -1,4 +1,4 @@ -import {downloadGenericSpecTests} from "@chainsafe/lodestar-spec-test-util"; +import {downloadGenericSpecTests} from "@lodestar/spec-test-util"; import {SPEC_TEST_LOCATION, SPEC_TEST_VERSION, SPEC_TEST_REPO_URL, TESTS_TO_DOWNLOAD} from "./params.js"; /* eslint-disable no-console */ diff --git a/packages/validator/test/spec/index.test.ts b/packages/validator/test/spec/index.test.ts index ba80708fe7a5..d32fb280e147 100644 --- a/packages/validator/test/spec/index.test.ts +++ b/packages/validator/test/spec/index.test.ts @@ -1,9 +1,9 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; import rimraf from "rimraf"; -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {LogLevel, WinstonLogger} from "@chainsafe/lodestar-utils"; -import {config} from "@chainsafe/lodestar-config/default"; +import {LevelDbController} from "@lodestar/db"; +import {LogLevel, WinstonLogger} from "@lodestar/utils"; +import {config} from "@lodestar/config/default"; import { SlashingProtection, SlashingProtectionBlock, diff --git a/packages/validator/test/spec/spec.test.ts b/packages/validator/test/spec/spec.test.ts index 9020f8036ed1..e00a33576424 100644 --- a/packages/validator/test/spec/spec.test.ts +++ b/packages/validator/test/spec/spec.test.ts @@ -4,10 +4,10 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; import rimraf from "rimraf"; import {fromHexString} from "@chainsafe/ssz"; -import {LevelDbController} from "@chainsafe/lodestar-db"; -import {LogLevel, WinstonLogger} from "@chainsafe/lodestar-utils"; -import {config} from "@chainsafe/lodestar-config/default"; -import {ZERO_HASH} from "@chainsafe/lodestar-beacon-state-transition"; +import {LevelDbController} from "@lodestar/db"; +import {LogLevel, WinstonLogger} from "@lodestar/utils"; +import {config} from "@lodestar/config/default"; +import {ZERO_HASH} from "@lodestar/state-transition"; import { SlashingProtection, InterchangeError, diff --git a/packages/validator/test/unit/externalSigner/index.test.ts b/packages/validator/test/unit/externalSigner/index.test.ts index 5f4b01293769..e752df890e99 100644 --- a/packages/validator/test/unit/externalSigner/index.test.ts +++ b/packages/validator/test/unit/externalSigner/index.test.ts @@ -1,6 +1,6 @@ import chai, {expect} from "chai"; import chaiAsPromised from "chai-as-promised"; -import {interopSecretKeys} from "@chainsafe/lodestar-beacon-state-transition"; +import {interopSecretKeys} from "@lodestar/state-transition"; import {toHexString} from "@chainsafe/ssz"; import type {PublicKey} from "@chainsafe/bls/types"; import bls from "@chainsafe/bls"; diff --git a/packages/validator/test/unit/services/attestation.test.ts b/packages/validator/test/unit/services/attestation.test.ts index 44e456a11ce4..d297184dee85 100644 --- a/packages/validator/test/unit/services/attestation.test.ts +++ b/packages/validator/test/unit/services/attestation.test.ts @@ -5,7 +5,7 @@ import {toHexString} from "@chainsafe/ssz"; import { generateEmptyAttestation, generateEmptySignedAggregateAndProof, -} from "../../../../lodestar/test/utils/attestation.js"; +} from "../../../../beacon-node/test/utils/attestation.js"; import {AttestationService} from "../../../src/services/attestation.js"; import {AttDutyAndProof} from "../../../src/services/attestationDuties.js"; import {ValidatorStore} from "../../../src/services/validatorStore.js"; diff --git a/packages/validator/test/unit/services/attestationDuties.test.ts b/packages/validator/test/unit/services/attestationDuties.test.ts index 3482a852c853..bcee0eb57ba9 100644 --- a/packages/validator/test/unit/services/attestationDuties.test.ts +++ b/packages/validator/test/unit/services/attestationDuties.test.ts @@ -1,12 +1,12 @@ import {toBufferBE} from "bigint-buffer"; import {expect} from "chai"; import sinon from "sinon"; -import {chainConfig} from "@chainsafe/lodestar-config/default"; +import {chainConfig} from "@lodestar/config/default"; import bls from "@chainsafe/bls"; import {toHexString} from "@chainsafe/ssz"; -import {routes} from "@chainsafe/lodestar-api"; -import {ssz} from "@chainsafe/lodestar-types"; -import {computeEpochAtSlot} from "@chainsafe/lodestar-beacon-state-transition"; +import {routes} from "@lodestar/api"; +import {ssz} from "@lodestar/types"; +import {computeEpochAtSlot} from "@lodestar/state-transition"; import {AttestationDutiesService} from "../../../src/services/attestationDuties.js"; import {ValidatorStore} from "../../../src/services/validatorStore.js"; import {getApiClientStub} from "../../utils/apiStub.js"; diff --git a/packages/validator/test/unit/services/block.test.ts b/packages/validator/test/unit/services/block.test.ts index 34b5c62d0875..b2f84d605401 100644 --- a/packages/validator/test/unit/services/block.test.ts +++ b/packages/validator/test/unit/services/block.test.ts @@ -2,12 +2,12 @@ import {expect} from "chai"; import sinon from "sinon"; import bls from "@chainsafe/bls"; import {toHexString} from "@chainsafe/ssz"; -import {createIChainForkConfig} from "@chainsafe/lodestar-config"; -import {config as mainnetConfig} from "@chainsafe/lodestar-config/default"; -import {Root} from "@chainsafe/lodestar-types"; -import {sleep} from "@chainsafe/lodestar-utils"; -import {routes} from "@chainsafe/lodestar-api"; -import {generateEmptySignedBlock} from "../../../../lodestar/test/utils/block.js"; +import {createIChainForkConfig} from "@lodestar/config"; +import {config as mainnetConfig} from "@lodestar/config/default"; +import {Root} from "@lodestar/types"; +import {sleep} from "@lodestar/utils"; +import {routes} from "@lodestar/api"; +import {generateEmptySignedBlock} from "../../../../beacon-node/test/utils/block.js"; import {BlockProposingService} from "../../../src/services/block.js"; import {ValidatorStore} from "../../../src/services/validatorStore.js"; import {getApiClientStub} from "../../utils/apiStub.js"; diff --git a/packages/validator/test/unit/services/blockDuties.test.ts b/packages/validator/test/unit/services/blockDuties.test.ts index ecc8c0dd3df1..9cb891a6f13a 100644 --- a/packages/validator/test/unit/services/blockDuties.test.ts +++ b/packages/validator/test/unit/services/blockDuties.test.ts @@ -3,8 +3,8 @@ import sinon from "sinon"; import {toBufferBE} from "bigint-buffer"; import bls from "@chainsafe/bls"; import {toHexString} from "@chainsafe/ssz"; -import {Root} from "@chainsafe/lodestar-types"; -import {routes} from "@chainsafe/lodestar-api"; +import {Root} from "@lodestar/types"; +import {routes} from "@lodestar/api"; import {BlockDutiesService} from "../../../src/services/blockDuties.js"; import {ValidatorStore} from "../../../src/services/validatorStore.js"; import {getApiClientStub} from "../../utils/apiStub.js"; diff --git a/packages/validator/test/unit/services/doppleganger.test.ts b/packages/validator/test/unit/services/doppleganger.test.ts index ac845829d102..fc9dffb05124 100644 --- a/packages/validator/test/unit/services/doppleganger.test.ts +++ b/packages/validator/test/unit/services/doppleganger.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {Epoch, Slot, ValidatorIndex} from "@chainsafe/lodestar-types"; -import {sleep} from "@chainsafe/lodestar-utils"; -import {computeStartSlotAtEpoch} from "@chainsafe/lodestar-beacon-state-transition"; -import {Api} from "@chainsafe/lodestar-api"; +import {Epoch, Slot, ValidatorIndex} from "@lodestar/types"; +import {sleep} from "@lodestar/utils"; +import {computeStartSlotAtEpoch} from "@lodestar/state-transition"; +import {Api} from "@lodestar/api"; import {DoppelgangerService, DoppelgangerStatus} from "../../../src/services/doppelgangerService.js"; import {IndicesService} from "../../../src/services/indices.js"; import {testLogger} from "../../utils/logger.js"; diff --git a/packages/validator/test/unit/services/syncCommitteDuties.test.ts b/packages/validator/test/unit/services/syncCommitteDuties.test.ts index 8a9cbe78fed0..78ab372c507a 100644 --- a/packages/validator/test/unit/services/syncCommitteDuties.test.ts +++ b/packages/validator/test/unit/services/syncCommitteDuties.test.ts @@ -3,10 +3,10 @@ import {expect} from "chai"; import sinon from "sinon"; import bls from "@chainsafe/bls"; import {toHexString} from "@chainsafe/ssz"; -import {createIChainForkConfig} from "@chainsafe/lodestar-config"; -import {config as mainnetConfig} from "@chainsafe/lodestar-config/default"; -import {routes} from "@chainsafe/lodestar-api"; -import {ssz} from "@chainsafe/lodestar-types"; +import {createIChainForkConfig} from "@lodestar/config"; +import {config as mainnetConfig} from "@lodestar/config/default"; +import {routes} from "@lodestar/api"; +import {ssz} from "@lodestar/types"; import { SyncCommitteeDutiesService, SyncDutyAndProofs, diff --git a/packages/validator/test/unit/services/syncCommittee.test.ts b/packages/validator/test/unit/services/syncCommittee.test.ts index 4ea9ab9ce760..b813353464f3 100644 --- a/packages/validator/test/unit/services/syncCommittee.test.ts +++ b/packages/validator/test/unit/services/syncCommittee.test.ts @@ -2,9 +2,9 @@ import {expect} from "chai"; import sinon from "sinon"; import bls from "@chainsafe/bls"; import {toHexString} from "@chainsafe/ssz"; -import {createIChainForkConfig} from "@chainsafe/lodestar-config"; -import {config as mainnetConfig} from "@chainsafe/lodestar-config/default"; -import {ssz} from "@chainsafe/lodestar-types"; +import {createIChainForkConfig} from "@lodestar/config"; +import {config as mainnetConfig} from "@lodestar/config/default"; +import {ssz} from "@lodestar/types"; import {SyncCommitteeService} from "../../../src/services/syncCommittee.js"; import {SyncDutyAndProofs} from "../../../src/services/syncCommitteeDuties.js"; import {ValidatorStore} from "../../../src/services/validatorStore.js"; diff --git a/packages/validator/test/unit/services/utils.test.ts b/packages/validator/test/unit/services/utils.test.ts index 5c18932c2725..43f160ab226d 100644 --- a/packages/validator/test/unit/services/utils.test.ts +++ b/packages/validator/test/unit/services/utils.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {SYNC_COMMITTEE_SUBNET_SIZE} from "@chainsafe/lodestar-params"; +import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; import {syncCommitteeIndicesToSubnets} from "../../../src/services/utils.js"; describe("services / utils / syncCommitteeIndicesToSubnets", () => { diff --git a/packages/validator/test/unit/slashingProtection/interchange/index.test.ts b/packages/validator/test/unit/slashingProtection/interchange/index.test.ts index d4dcda149dbc..e7e2a5c0bb9b 100644 --- a/packages/validator/test/unit/slashingProtection/interchange/index.test.ts +++ b/packages/validator/test/unit/slashingProtection/interchange/index.test.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import {expect} from "chai"; -import {Root, ssz} from "@chainsafe/lodestar-types"; +import {Root, ssz} from "@lodestar/types"; import {toHexString} from "@chainsafe/ssz"; import { Interchange, diff --git a/packages/validator/test/unit/slashingProtection/minMaxSurround/utils.ts b/packages/validator/test/unit/slashingProtection/minMaxSurround/utils.ts index ebeabee04d34..36cf313ec37b 100644 --- a/packages/validator/test/unit/slashingProtection/minMaxSurround/utils.ts +++ b/packages/validator/test/unit/slashingProtection/minMaxSurround/utils.ts @@ -1,4 +1,4 @@ -import {BLSPubkey, ssz} from "@chainsafe/lodestar-types"; +import {BLSPubkey, ssz} from "@lodestar/types"; import {IDistanceStore, IDistanceEntry} from "../../../../src/slashingProtection/minMaxSurround/index.js"; export const emptyPubkey = ssz.BLSPubkey.defaultValue(); diff --git a/packages/validator/test/unit/utils/clock.test.ts b/packages/validator/test/unit/utils/clock.test.ts index cb39c8b379c4..27d5afd5943d 100644 --- a/packages/validator/test/unit/utils/clock.test.ts +++ b/packages/validator/test/unit/utils/clock.test.ts @@ -1,8 +1,8 @@ import sinon from "sinon"; import {expect} from "chai"; -import {config} from "@chainsafe/lodestar-config/default"; -import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params"; -import {IBeaconConfig} from "@chainsafe/lodestar-config"; +import {config} from "@lodestar/config/default"; +import {SLOTS_PER_EPOCH} from "@lodestar/params"; +import {IBeaconConfig} from "@lodestar/config"; import {Clock, getCurrentSlotAround} from "../../../src/util/clock.js"; import {testLogger} from "../../utils/logger.js"; diff --git a/packages/validator/test/unit/utils/params.test.ts b/packages/validator/test/unit/utils/params.test.ts index 7d1bdd587a9f..c16e14fb9250 100644 --- a/packages/validator/test/unit/utils/params.test.ts +++ b/packages/validator/test/unit/utils/params.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {chainConfigToJson} from "@chainsafe/lodestar-config"; -import {chainConfig} from "@chainsafe/lodestar-config/default"; +import {chainConfigToJson} from "@lodestar/config"; +import {chainConfig} from "@lodestar/config/default"; import {assertEqualParams, NotEqualParamsError} from "../../../src/util/params.js"; describe("utils / params / assertEqualParams", () => { diff --git a/packages/validator/test/utils/apiStub.ts b/packages/validator/test/utils/apiStub.ts index 40eb6b493f88..0e89373f3198 100644 --- a/packages/validator/test/utils/apiStub.ts +++ b/packages/validator/test/utils/apiStub.ts @@ -1,6 +1,6 @@ import sinon, {SinonSandbox} from "sinon"; -import {getClient, Api} from "@chainsafe/lodestar-api"; -import {config} from "@chainsafe/lodestar-config/default"; +import {getClient, Api} from "@lodestar/api"; +import {config} from "@lodestar/config/default"; export function getApiClientStub( sandbox: SinonSandbox = sinon diff --git a/packages/validator/test/utils/clock.ts b/packages/validator/test/utils/clock.ts index 1b868ab8dee2..b5a161e7efea 100644 --- a/packages/validator/test/utils/clock.ts +++ b/packages/validator/test/utils/clock.ts @@ -1,4 +1,4 @@ -import {Epoch, Slot} from "@chainsafe/lodestar-types"; +import {Epoch, Slot} from "@lodestar/types"; import {IClock} from "../../src/util/index.js"; type RunEveryFn = (slot: Slot, signal: AbortSignal) => Promise; diff --git a/packages/validator/test/utils/fork.ts b/packages/validator/test/utils/fork.ts index c88b8cdaa135..5cc791e36bce 100644 --- a/packages/validator/test/utils/fork.ts +++ b/packages/validator/test/utils/fork.ts @@ -1,5 +1,5 @@ -import {phase0} from "@chainsafe/lodestar-types"; -import {intToBytes} from "@chainsafe/lodestar-utils"; +import {phase0} from "@lodestar/types"; +import {intToBytes} from "@lodestar/utils"; /** * Generates a fake fork data test purposes. diff --git a/packages/validator/test/utils/logger.ts b/packages/validator/test/utils/logger.ts index cec7c206a432..4bf8ad50438e 100644 --- a/packages/validator/test/utils/logger.ts +++ b/packages/validator/test/utils/logger.ts @@ -1,4 +1,4 @@ -import {WinstonLogger, LogLevel} from "@chainsafe/lodestar-utils"; +import {WinstonLogger, LogLevel} from "@lodestar/utils"; import {getLoggerVc} from "../../src/util/index.js"; import {ClockMock} from "./clock.js"; diff --git a/packages/validator/test/utils/validatorStore.ts b/packages/validator/test/utils/validatorStore.ts index fd40b92840db..9a6f7b6de79c 100644 --- a/packages/validator/test/utils/validatorStore.ts +++ b/packages/validator/test/utils/validatorStore.ts @@ -1,7 +1,7 @@ import {SecretKey} from "@chainsafe/bls/types"; -import {Api} from "@chainsafe/lodestar-api"; -import {chainConfig} from "@chainsafe/lodestar-config/default"; -import {createIBeaconConfig, IChainConfig} from "@chainsafe/lodestar-config"; +import {Api} from "@lodestar/api"; +import {chainConfig} from "@lodestar/config/default"; +import {createIBeaconConfig, IChainConfig} from "@lodestar/config"; import {Signer, SignerType, ValidatorStore} from "../../src/index.js"; import {IndicesService} from "../../src/services/indices.js"; import {testLogger} from "./logger.js"; diff --git a/scripts/await-release.sh b/scripts/await-release.sh index 42a260822fd5..c742d09b6d4d 100755 --- a/scripts/await-release.sh +++ b/scripts/await-release.sh @@ -4,7 +4,7 @@ sudo apt install jq # sudo without password on ubuntu-latest # Using the lodestar-cli packacke to reference against -declare PACKAGE="@chainsafe/lodestar-cli" +declare PACKAGE="@chainsafe/lodestar" # Using `npm view -j` to get all available versions as JSON declare CMD_NPM="npm view -j $PACKAGE"