From 6e014217f9df78c0916299d357588a5bbab05d88 Mon Sep 17 00:00:00 2001 From: Cayman Date: Sun, 16 Jul 2023 08:17:27 -0400 Subject: [PATCH] chore!: use node v20 throughout monorepo (#5730) * chore!: use node 20 throughout monorepo * Add yarn.lock * Revert @types/node change * Fix ts-node usage * Add missed files * Remove more ts-node-esm * Update cross-fetch dependency * Update @types/node to 20.4.2 * Use node version 20.4 in CI * Revert "Use node version 20.4 in CI" * skip tests that break in CI * Update Dockerfile Co-authored-by: Nico Flaig * Check code ECONNRESET in Lighthouse health response * Revert "Check code ECONNRESET in Lighthouse health response" * Revert "Update Dockerfile" This reverts commit e1f07be309449069312c46b696c17c8f8b9e18cb. * Revert CI from using node 20 * Revert "skip tests that break in CI" This reverts commit d296b2f1a280189761bb6175343a43362010f881. * Fix the loader for few sim tests * Update CI node version to 20 * Fix e2e test * Remove try/catch from e2e test * Consistently use node 20 in CI * Fix missed 18.x reference in types readme * Set node 20.x in readme * Use node 18 in sim tests --------- Co-authored-by: Nico Flaig Co-authored-by: Nazar Hussain --- .github/workflows/benchmark.yml | 2 +- .github/workflows/docs-check.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/publish-dev.yml | 2 +- .github/workflows/publish-rc.yml | 2 +- .github/workflows/publish-stable.yml | 2 +- .github/workflows/test-browser.yml | 2 +- .github/workflows/test-e2e.yml | 2 +- .github/workflows/test-sim-merge.yml | 2 +- .github/workflows/test-spec.yml | 2 +- .github/workflows/test.yml | 2 +- Dockerfile | 6 +-- README.md | 2 +- docs/install/source.md | 2 +- package.json | 2 +- packages/api/README.md | 2 +- packages/api/package.json | 2 +- packages/beacon-node/README.md | 2 +- packages/beacon-node/package.json | 2 +- .../test/e2e/eth1/jsonRpcHttpClient.test.ts | 23 +++++++-- packages/cli/package.json | 10 ++-- packages/light-client/package.json | 2 +- packages/params/README.md | 2 +- .../params/test/e2e/overridePreset.test.ts | 5 +- packages/params/test/e2e/setPreset.test.ts | 5 +- packages/prover/README.md | 2 +- packages/prover/package.json | 2 +- packages/reqresp/README.md | 2 +- packages/types/README.md | 2 +- packages/validator/README.md | 2 +- packages/validator/package.json | 2 +- scripts/run_e2e_env.sh | 2 +- yarn.lock | 49 +++++++++++++------ 33 files changed, 91 insertions(+), 61 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index d1de888472cf..98842a38b026 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 check-latest: true - name: Node.js version id: node diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index bad86bd201b9..1556cd191b55 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 - name: Node.js version id: node run: echo "v8CppApiVersion=$(node --print "process.versions.modules")" >> $GITHUB_OUTPUT diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 98b4ba2b56ee..cdceb49d808a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 check-latest: true - name: Node.js version id: node diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index 673b2ec6af92..a656f8562bf3 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 registry-url: "https://registry.npmjs.org" check-latest: true - name: Node.js version diff --git a/.github/workflows/publish-rc.yml b/.github/workflows/publish-rc.yml index 07106e1945f7..005d2738b1c6 100644 --- a/.github/workflows/publish-rc.yml +++ b/.github/workflows/publish-rc.yml @@ -54,7 +54,7 @@ jobs: fetch-depth: 0 # Needs full depth for changelog generation - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 check-latest: true - name: Node.js version id: node diff --git a/.github/workflows/publish-stable.yml b/.github/workflows/publish-stable.yml index 40f0cba82f78..01e222d48e72 100644 --- a/.github/workflows/publish-stable.yml +++ b/.github/workflows/publish-stable.yml @@ -60,7 +60,7 @@ jobs: fetch-depth: 0 # Needs full depth for changelog generation - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 check-latest: true - name: Node.js version id: node diff --git a/.github/workflows/test-browser.yml b/.github/workflows/test-browser.yml index c8854c1896aa..c4c478b53a07 100644 --- a/.github/workflows/test-browser.yml +++ b/.github/workflows/test-browser.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - node: [18] + node: [20] steps: # - Uses YAML anchors in the future - uses: actions/checkout@v3 diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index d76910185489..25d49c64ad01 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - node: [18] + node: [20] steps: # - Uses YAML anchors in the future - uses: actions/checkout@v3 diff --git a/.github/workflows/test-sim-merge.yml b/.github/workflows/test-sim-merge.yml index 60cf84560766..a47a2a07a5a1 100644 --- a/.github/workflows/test-sim-merge.yml +++ b/.github/workflows/test-sim-merge.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 check-latest: true - name: Node.js version id: node diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index 58a80543303f..eb17c2e2babf 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 check-latest: true - name: Node.js version id: node diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b95fb6a44794..22bef8d6c10a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - node: [18] + node: [20] steps: # - Uses YAML anchors in the future - uses: actions/checkout@v3 diff --git a/Dockerfile b/Dockerfile index 346fffd117dc..5a9541e06f1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # --platform=$BUILDPLATFORM is used build javascript source with host arch # Otherwise TS builds on emulated archs and can be extremely slow (+1h) -FROM --platform=${BUILDPLATFORM:-amd64} node:18-alpine as build_src +FROM --platform=${BUILDPLATFORM:-amd64} node:20-alpine as build_src ARG COMMIT WORKDIR /usr/app RUN apk update && apk add --no-cache g++ make python3 && rm -rf /var/cache/apk/* @@ -21,7 +21,7 @@ RUN cd packages/cli && GIT_COMMIT=${COMMIT} yarn write-git-data # Copy built src + node_modules to build native packages for archs different than host. # Note: This step is redundant for the host arch -FROM node:18-alpine as build_deps +FROM node:20-alpine as build_deps WORKDIR /usr/app RUN apk update && apk add --no-cache g++ make python3 && rm -rf /var/cache/apk/* @@ -35,7 +35,7 @@ RUN cd node_modules/classic-level && yarn rebuild # Copy built src + node_modules to a new layer to prune unnecessary fs # Previous layer weights 7.25GB, while this final 488MB (as of Oct 2020) -FROM node:18-alpine +FROM node:20-alpine WORKDIR /usr/app COPY --from=build_deps /usr/app . diff --git a/README.md b/README.md index abfcb754e26d..9eeeb12ef43e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Ethereum 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) ![ES Version](https://img.shields.io/badge/ES-2020-yellow) -![Node Version](https://img.shields.io/badge/node-18.15.x-green) +![Node Version](https://img.shields.io/badge/node-20.x-green) [![gitpoap badge](https://public-api.gitpoap.io/v1/repo/ChainSafe/lodestar/badge)](https://www.gitpoap.io/gh/ChainSafe/lodestar) [Lodestar](https://lodestar.chainsafe.io) is a TypeScript implementation of the [Ethereum Consensus specification](https://github.com/ethereum/consensus-specs) developed by [ChainSafe Systems](https://chainsafe.io). diff --git a/docs/install/source.md b/docs/install/source.md index 6068c5189093..4fba0a625111 100644 --- a/docs/install/source.md +++ b/docs/install/source.md @@ -2,7 +2,7 @@ ## Prerequisites -Make sure to have [Yarn installed](https://classic.yarnpkg.com/en/docs/install). It is also recommended to [install NVM (Node Version Manager)](https://github.com/nvm-sh/nvm) and use the LTS version (currently v18) of [NodeJS](https://nodejs.org/en/). +Make sure to have [Yarn installed](https://classic.yarnpkg.com/en/docs/install). It is also recommended to [install NVM (Node Version Manager)](https://github.com/nvm-sh/nvm) and use the LTS version (currently v20) of [NodeJS](https://nodejs.org/en/). !!! info diff --git a/package.json b/package.json index b4f7611a33c5..4b7d0fc5268f 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@types/chai": "^4.3.4", "@types/chai-as-promised": "^7.1.5", "@types/mocha": "^10.0.1", - "@types/node": "^18.15.11", + "@types/node": "^20.4.2", "@types/sinon": "^10.0.13", "@types/sinon-chai": "^3.2.9", "@typescript-eslint/eslint-plugin": "6.0.0", diff --git a/packages/api/README.md b/packages/api/README.md index c8a1ebf3a31a..877e04384ee4 100644 --- a/packages/api/README.md +++ b/packages/api/README.md @@ -3,7 +3,7 @@ [![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord)](https://discord.gg/aMxzVcr) [![ETH Beacon APIs Spec v2.1.0](https://img.shields.io/badge/ETH%20beacon--APIs-2.1.0-blue)](https://github.com/ethereum/beacon-APIs/releases/tag/v2.1.0) ![ES Version](https://img.shields.io/badge/ES-2020-yellow) -![Node Version](https://img.shields.io/badge/node-18.x-green) +![Node Version](https://img.shields.io/badge/node-20.x-green) > This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project diff --git a/packages/api/package.json b/packages/api/package.json index 28cb5dc1f6c9..b925953770f1 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -75,7 +75,7 @@ "@lodestar/params": "^1.9.1", "@lodestar/types": "^1.9.1", "@lodestar/utils": "^1.9.1", - "cross-fetch": "^3.1.4", + "cross-fetch": "^4.0.0", "eventsource": "^2.0.2", "qs": "^6.11.1" }, diff --git a/packages/beacon-node/README.md b/packages/beacon-node/README.md index 67e26c73a9ff..955cfdb0e9b6 100644 --- a/packages/beacon-node/README.md +++ b/packages/beacon-node/README.md @@ -3,7 +3,7 @@ [![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord)](https://discord.gg/aMxzVcr) [![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) -![Node Version](https://img.shields.io/badge/node-18.x-green) +![Node Version](https://img.shields.io/badge/node-20.x-green) > This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project diff --git a/packages/beacon-node/package.json b/packages/beacon-node/package.json index 73b37098d887..7b738005c1cc 100644 --- a/packages/beacon-node/package.json +++ b/packages/beacon-node/package.json @@ -136,7 +136,7 @@ "@types/datastore-level": "^3.0.0", "buffer-xor": "^2.0.2", "c-kzg": "^2.1.0", - "cross-fetch": "^3.1.4", + "cross-fetch": "^4.0.0", "datastore-core": "^9.1.1", "datastore-level": "^10.1.1", "deepmerge": "^4.3.1", diff --git a/packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts b/packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts index 9ab0068c06a0..6de1cebf6fc8 100644 --- a/packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts +++ b/packages/beacon-node/test/e2e/eth1/jsonRpcHttpClient.test.ts @@ -6,6 +6,10 @@ import {JsonRpcHttpClient} from "../../../src/eth1/provider/jsonRpcHttpClient.js import {getGoerliRpcUrl} from "../../testParams.js"; import {RpcPayload} from "../../../src/eth1/interface.js"; +type FetchError = { + code: string; +}; + describe("eth1 / jsonRpcHttpClient", function () { this.timeout("10 seconds"); @@ -22,6 +26,7 @@ describe("eth1 / jsonRpcHttpClient", function () { abort?: true; timeout?: number; error: any; + errorCode?: string; }[] = [ // // NOTE: This DNS query is very expensive, all cache miss. So it can timeout the tests and cause false positives // { @@ -39,7 +44,8 @@ describe("eth1 / jsonRpcHttpClient", function () { id: "Bad port", url: `http://localhost:${port + 1}`, requestListener: (req, res) => res.end(), - error: "connect ECONNREFUSED", + error: "", + errorCode: "ECONNREFUSED", }, { id: "Not a JSON RPC endpoint", @@ -122,7 +128,6 @@ describe("eth1 / jsonRpcHttpClient", function () { for (const testCase of testCases) { const {id, requestListener, abort, timeout} = testCase; - const error = testCase.error as Error; let {url, payload} = testCase; it(id, async function () { @@ -148,7 +153,13 @@ describe("eth1 / jsonRpcHttpClient", function () { const controller = new AbortController(); if (abort) setTimeout(() => controller.abort(), 50); const eth1JsonRpcClient = new JsonRpcHttpClient([url], {signal: controller.signal}); - await expect(eth1JsonRpcClient.fetch(payload, {timeout})).to.be.rejectedWith(error); + await expect(eth1JsonRpcClient.fetch(payload, {timeout})).to.be.rejected.then((error) => { + if (testCase.errorCode) { + expect((error as FetchError).code).to.be.equal(testCase.errorCode); + } else { + expect((error as Error).message).to.include(testCase.error); + } + }); }); } }); @@ -210,8 +221,10 @@ describe("eth1 / jsonRpcHttpClient - with retries", function () { return true; }, }) - ).to.be.rejectedWith("connect ECONNREFUSED"); - expect(retryCount).to.be.equal(retryAttempts, "connect ECONNREFUSED should be retried before failing"); + ).to.be.rejected.then((error) => { + expect((error as FetchError).code).to.be.equal("ECONNREFUSED"); + }); + expect(retryCount).to.be.equal(retryAttempts, "code ECONNREFUSED should be retried before failing"); }); it("should retry 404", async function () { diff --git a/packages/cli/package.json b/packages/cli/package.json index af6e9e0434da..53404de0890c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -24,7 +24,7 @@ "build": "tsc -p tsconfig.build.json && yarn write-git-data", "build:release": "yarn clean && yarn run build", "build:watch": "tsc -p tsconfig.build.json --watch", - "build:refdocs": "ts-node --esm ./docsgen/index.ts docs/cli.md", + "build:refdocs": "node --loader ts-node/esm ./docsgen/index.ts docs/cli.md", "write-git-data": "node lib/util/gitData/writeGitData.js", "check-build": "node -e \"(async function() { await import('./lib/index.js') })()\" lodestar --help", "check-types": "tsc", @@ -33,10 +33,10 @@ "pretest": "yarn run check-types", "test:unit": "nyc --cache-dir .nyc_output/.cache -e .ts mocha 'test/unit/**/*.test.ts'", "test:e2e": "mocha --timeout 30000 'test/e2e/**/*.test.ts'", - "test:sim:multifork": "LODESTAR_PRESET=minimal ts-node --esm test/sim/multi_fork.test.ts", - "test:sim:endpoints": "LODESTAR_PRESET=minimal ts-node --esm test/sim/endpoints.test.ts", - "test:sim:deneb": "LODESTAR_PRESET=minimal ts-node --esm test/sim/deneb.test.ts", - "test:sim:backup_eth_provider": "LODESTAR_PRESET=minimal ts-node --esm test/sim/backup_eth_provider.test.ts", + "test:sim:multifork": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/multi_fork.test.ts", + "test:sim:endpoints": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/endpoints.test.ts", + "test:sim:deneb": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/deneb.test.ts", + "test:sim:backup_eth_provider": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/backup_eth_provider.test.ts", "test": "yarn test:unit && yarn test:e2e", "coverage": "codecov -F lodestar", "check-readme": "typescript-docs-verifier" diff --git a/packages/light-client/package.json b/packages/light-client/package.json index 61c685517e6c..2b3779df81f4 100644 --- a/packages/light-client/package.json +++ b/packages/light-client/package.json @@ -73,7 +73,7 @@ "@lodestar/state-transition": "^1.9.1", "@lodestar/types": "^1.9.1", "@lodestar/utils": "^1.9.1", - "cross-fetch": "^3.1.4", + "cross-fetch": "^4.0.0", "mitt": "^3.0.0", "strict-event-emitter-types": "^2.0.0" }, diff --git a/packages/params/README.md b/packages/params/README.md index ebce8bda5b1b..bf4457146fbd 100644 --- a/packages/params/README.md +++ b/packages/params/README.md @@ -4,7 +4,7 @@ [![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) -![Node Version](https://img.shields.io/badge/node-18.x-green) +![Node Version](https://img.shields.io/badge/node-20.x-green) > This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project diff --git a/packages/params/test/e2e/overridePreset.test.ts b/packages/params/test/e2e/overridePreset.test.ts index 61483e2cee91..e16dd97a08ef 100644 --- a/packages/params/test/e2e/overridePreset.test.ts +++ b/packages/params/test/e2e/overridePreset.test.ts @@ -18,18 +18,17 @@ const exec = util.promisify(child.exec); // Solutions: https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules // eslint-disable-next-line @typescript-eslint/naming-convention const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const tsNodeBinary = path.join(__dirname, "../../../../node_modules/.bin/ts-node-esm"); describe("Override preset", function () { // Allow time for ts-node to compile Typescript source this.timeout(30_000); it("Should correctly override preset", async () => { - await exec(`${tsNodeBinary} ${path.join(__dirname, scriptNames.ok)}`); + await exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.ok)}`); }); it("Should throw trying to override preset in the wrong order", async () => { - await expect(exec(`${tsNodeBinary} ${path.join(__dirname, scriptNames.error)}`)).to.be.rejectedWith( + await expect(exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.error)}`)).to.be.rejectedWith( "Lodestar preset is already frozen" ); }); diff --git a/packages/params/test/e2e/setPreset.test.ts b/packages/params/test/e2e/setPreset.test.ts index d2268d32fe51..2b7ff271cd94 100644 --- a/packages/params/test/e2e/setPreset.test.ts +++ b/packages/params/test/e2e/setPreset.test.ts @@ -18,18 +18,17 @@ const exec = util.promisify(child.exec); // Solutions: https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules // eslint-disable-next-line @typescript-eslint/naming-convention const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const tsNodeBinary = path.join(__dirname, "../../../../node_modules/.bin/ts-node-esm"); describe("setPreset", function () { // Allow time for ts-node to compile Typescript source this.timeout(30_000); it("Should correctly set preset", async () => { - await exec(`${tsNodeBinary} ${path.join(__dirname, scriptNames.ok)}`); + await exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.ok)}`); }); it("Should throw trying to set preset in the wrong order", async () => { - await expect(exec(`${tsNodeBinary} ${path.join(__dirname, scriptNames.error)}`)).to.be.rejectedWith( + await expect(exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.error)}`)).to.be.rejectedWith( "Lodestar preset is already frozen" ); }); diff --git a/packages/prover/README.md b/packages/prover/README.md index c4df66751e51..46c733c9715d 100644 --- a/packages/prover/README.md +++ b/packages/prover/README.md @@ -3,7 +3,7 @@ [![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord)](https://discord.gg/aMxzVcr) [![ETH Beacon APIs Spec v2.1.0](https://img.shields.io/badge/ETH%20beacon--APIs-2.1.0-blue)](https://github.com/ethereum/beacon-APIs/releases/tag/v2.1.0) ![ES Version](https://img.shields.io/badge/ES-2020-yellow) -![Node Version](https://img.shields.io/badge/node-18.x-green) +![Node Version](https://img.shields.io/badge/node-20.x-green) > This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project diff --git a/packages/prover/package.json b/packages/prover/package.json index 490984014d4c..e6a9844097c2 100644 --- a/packages/prover/package.json +++ b/packages/prover/package.json @@ -55,7 +55,7 @@ "test:browsers": "yarn karma start karma.config.cjs", "test:e2e": "LODESTAR_PRESET=minimal mocha 'test/e2e/**/*.test.ts'", "check-readme": "typescript-docs-verifier", - "generate-fixtures": "npx ts-node --esm scripts/generate_fixtures.ts" + "generate-fixtures": "node --loader ts-node/esm scripts/generate_fixtures.ts" }, "dependencies": { "@ethereumjs/block": "^4.2.2", diff --git a/packages/reqresp/README.md b/packages/reqresp/README.md index ecb29a7ff2ad..a363dfc65388 100644 --- a/packages/reqresp/README.md +++ b/packages/reqresp/README.md @@ -3,7 +3,7 @@ [![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord)](https://discord.gg/aMxzVcr) [![ETH Beacon APIs Spec v2.1.0](https://img.shields.io/badge/ETH%20beacon--APIs-2.1.0-blue)](https://github.com/ethereum/beacon-APIs/releases/tag/v2.1.0) ![ES Version](https://img.shields.io/badge/ES-2020-yellow) -![Node Version](https://img.shields.io/badge/node-18.x-green) +![Node Version](https://img.shields.io/badge/node-20.x-green) > This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project diff --git a/packages/types/README.md b/packages/types/README.md index 0c668490bb18..9cd1f020a44d 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -4,7 +4,7 @@ [![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) -![Node Version](https://img.shields.io/badge/node-18.x-green) +![Node Version](https://img.shields.io/badge/node-20.x-green) > This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project diff --git a/packages/validator/README.md b/packages/validator/README.md index 84301ca7efa5..d9ae22a01f04 100644 --- a/packages/validator/README.md +++ b/packages/validator/README.md @@ -3,7 +3,7 @@ [![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord)](https://discord.gg/aMxzVcr) [![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) -![Node Version](https://img.shields.io/badge/node-18.x-green) +![Node Version](https://img.shields.io/badge/node-20.x-green) > This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project diff --git a/packages/validator/package.json b/packages/validator/package.json index 1b20eb5db607..4a749792a2f0 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -58,7 +58,7 @@ "@lodestar/types": "^1.9.1", "@lodestar/utils": "^1.9.1", "bigint-buffer": "^1.1.5", - "cross-fetch": "^3.1.4", + "cross-fetch": "^4.0.0", "strict-event-emitter-types": "^2.0.0" }, "devDependencies": { diff --git a/scripts/run_e2e_env.sh b/scripts/run_e2e_env.sh index 180cda203d94..08f1680b30c6 100755 --- a/scripts/run_e2e_env.sh +++ b/scripts/run_e2e_env.sh @@ -3,7 +3,7 @@ function start_app() { mkdir -p test-logs/e2e-test-env export LODESTAR_PRESET=minimal - nohup npx ts-node --esm packages/cli/test/scripts/e2e_test_env.ts > test-logs/e2e-test-env/simulation.out 2>&1 & + nohup node --loader ts-node/esm packages/cli/test/scripts/e2e_test_env.ts > test-logs/e2e-test-env/simulation.out 2>&1 & echo $! > test-logs/e2e-test-env/simulation.pid echo "Wait for the node to be ready" npx wait-port -t 60000 0.0.0.0:5001 diff --git a/yarn.lock b/yarn.lock index 4897b2e77319..d5317b94ddb2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3696,10 +3696,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.45.tgz#155b13a33c665ef2b136f7f245fa525da419e810" integrity sha512-3rKg/L5x0rofKuuUt5zlXzOnKyIHXmIu5R8A0TuNDMF2062/AOIDBciFIjToLEJ/9F9DzkHNot+BpNsMI1OLdQ== -"@types/node@^18.15.11": - version "18.15.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" - integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== +"@types/node@^20.4.2": + version "20.4.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" + integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -6128,6 +6128,13 @@ cross-fetch@^3.1.4: dependencies: node-fetch "2.6.7" +cross-fetch@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-4.0.0.tgz#f037aef1580bb3a1a35164ea2a848ba81b445983" + integrity sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g== + dependencies: + node-fetch "^2.6.12" + cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz" @@ -10558,11 +10565,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lru-cache@^7.14.1: - version "7.18.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" - integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== - lru-cache@^7.4.4, lru-cache@^7.5.1: version "7.14.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.14.0.tgz#21be64954a4680e303a09e9468f880b98a0b3c7f" @@ -10573,6 +10575,11 @@ lru-cache@^7.7.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.10.1.tgz#db577f42a94c168f676b638d15da8fb073448cab" integrity sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A== +"lru-cache@^9.1.1 || ^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.0.tgz#b9e2a6a72a129d81ab317202d93c7691df727e61" + integrity sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw== + make-dir@3.1.0, make-dir@^3.0.0, make-dir@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -11020,11 +11027,16 @@ minipass@^3.1.6: dependencies: yallist "^4.0.0" -minipass@^4.0.0, minipass@^4.0.2, minipass@^4.2.4: +minipass@^4.0.0, minipass@^4.2.4: version "4.2.5" resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.5.tgz#9e0e5256f1e3513f8c34691dd68549e85b2c8ceb" integrity sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": + version "7.0.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.2.tgz#58a82b7d81c7010da5bd4b2c0c85ac4b4ec5131e" + integrity sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA== + minizlib@^1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz" @@ -11354,6 +11366,13 @@ node-fetch@2.6.7, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7: resolved "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz" integrity sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g== +node-fetch@^2.6.12: + version "2.6.12" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" + integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== + dependencies: + whatwg-url "^5.0.0" + node-fetch@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6" @@ -12439,12 +12458,12 @@ path-parse@^1.0.5, path-parse@^1.0.6, path-parse@^1.0.7: integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-scurry@^1.6.1: - version "1.6.3" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.6.3.tgz#4eba7183d64ef88b63c7d330bddc3ba279dc6c40" - integrity sha512-RAmB+n30SlN+HnNx6EbcpoDy9nwdpcGPnEKrJnu6GZoDWBdIjo1UQMVtW2ybtC7LC2oKLcMq8y5g8WnKLiod9g== + version "1.10.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" + integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== dependencies: - lru-cache "^7.14.1" - minipass "^4.0.2" + lru-cache "^9.1.1 || ^10.0.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-to-regexp@0.1.7: version "0.1.7"