Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use node 18 #4779

Merged
merged 9 commits into from Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "lts/gallium"
node-version: 18
- name: Node.js version
id: node
run: echo "::set-output name=v8CppApiVersion::$(node --print "process.versions.modules")"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "lts/gallium"
node-version: 18
- name: Node.js version
id: node
run: echo "::set-output name=v8CppApiVersion::$(node --print "process.versions.modules")"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-dev.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: "lts/gallium"
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: Node.js version
id: node
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-rc.yml
Expand Up @@ -54,7 +54,7 @@ jobs:
fetch-depth: 0 # Needs full depth for changelog generation
- uses: actions/setup-node@v2
with:
node-version: "lts/gallium"
node-version: 18
- name: Node.js version
id: node
run: echo "::set-output name=v8CppApiVersion::$(node --print "process.versions.modules")"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-stable.yml
Expand Up @@ -60,7 +60,7 @@ jobs:
fetch-depth: 0 # Needs full depth for changelog generation
- uses: actions/setup-node@v2
with:
node-version: "lts/gallium"
node-version: 18
- name: Node.js version
id: node
run: echo "::set-output name=v8CppApiVersion::$(node --print "process.versions.modules")"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-browser.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [16]
node: [18]
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [16]
node: [18]
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-sim-merge.yml
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "lts/gallium"
node-version: 18
- name: Node.js version
id: node
run: echo "::set-output name=v8CppApiVersion::$(node --print "process.versions.modules")"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-sim.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "lts/gallium"
node-version: 18
- name: Node.js version
id: node
run: echo "::set-output name=v8CppApiVersion::$(node --print "process.versions.modules")"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-spec.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "lts/gallium"
node-version: 18
- name: Node.js version
id: node
run: echo "::set-output name=v8CppApiVersion::$(node --print "process.versions.modules")"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [16]
node: [18]
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -4,7 +4,7 @@ Thanks for your contribution to Lodestar. It's people like you that push the Eth

## Prerequisites

- :gear: [NodeJS](https://nodejs.org/) (LTS/Gallium)
- :gear: [NodeJS](https://nodejs.org/) (LTS)
- :toolbox: [Yarn](https://yarnpkg.com/)/[Lerna](https://lerna.js.org/)

## Getting Started
Expand Down
6 changes: 3 additions & 3 deletions 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:16-alpine as build_src
FROM --platform=${BUILDPLATFORM:-amd64} node:18-alpine as build_src
ARG COMMIT
WORKDIR /usr/app
RUN apk update && apk add --no-cache g++ make python3 && rm -rf /var/cache/apk/*
Expand All @@ -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:16-alpine as build_deps
FROM node:18-alpine as build_deps
WORKDIR /usr/app
RUN apk update && apk add --no-cache g++ make python3 && rm -rf /var/cache/apk/*

Expand All @@ -34,7 +34,7 @@ RUN yarn install --non-interactive --frozen-lockfile --production --force

# 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:16-alpine
FROM node:18-alpine
WORKDIR /usr/app
COPY --from=build_deps /usr/app .

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -8,7 +8,7 @@
[![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)
![ES Version](https://img.shields.io/badge/ES-2020-yellow)
![Node Version](https://img.shields.io/badge/node-16.x-green)
![Node Version](https://img.shields.io/badge/node-18.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).
Expand All @@ -29,7 +29,7 @@

## Prerequisites

- :gear: [NodeJS](https://nodejs.org/) (LTS/Gallium)
- :gear: [NodeJS](https://nodejs.org/) (LTS)
- :toolbox: [Yarn](https://yarnpkg.com/)/[Lerna](https://lerna.js.org/)

###### Developer Quickstart:
Expand Down
4 changes: 2 additions & 2 deletions docs/install/source.md
@@ -1,10 +1,10 @@
# Install from source

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 v16 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 v18 of [NodeJS](https://nodejs.org/en/).

<!-- prettier-ignore-start -->
!!! info
NodeJS versions < 16.x are not supported by Lodestar. We currently recommend running NodeJS 16.x.
NodeJS versions < 16.x are not supported by Lodestar. We currently recommend running NodeJS 18.x.
<!-- prettier-ignore-end -->

Clone the repo locally.
Expand Down
17 changes: 16 additions & 1 deletion packages/beacon-node/test/perf/util/bytes.test.ts
Expand Up @@ -17,6 +17,21 @@ describe("bytes utils", function () {
fn: () => {
Buffer.concat(buffers);
},
runsFactor: 1000,
});

itBench({
id: `Uint8Array.set ${count} items`,
fn: () => {
let size = 0;
for (const b of buffers) {
size += b.length;
}
const arr = new Uint8Array(size);
let offset = 0;
for (const b of buffers) {
arr.set(b, offset);
offset += b.length;
}
},
});
});
4 changes: 3 additions & 1 deletion packages/cli/test/e2e/runDevCmd.test.ts
Expand Up @@ -5,14 +5,16 @@ import {describeCliTest} from "../utils/childprocRunner.js";
import {itDone} from "../utils/runUtils.js";

describeCliTest("Run dev command", function ({spawnCli}) {
this.timeout(120_000);
itDone("Run dev command with no --dataDir until beacon api is listening", async function (done) {
const beaconPort = 39011;

const devProc = spawnCli({pipeStdToParent: false, printOnlyOnError: true, logPrefix: "dev"}, [
const devProc = spawnCli({pipeStdToParent: true, printOnlyOnError: true, logPrefix: "dev"}, [
wemeetagain marked this conversation as resolved.
Show resolved Hide resolved
// ⏎
"dev",
"--reset",
"--startValidators=0..7",
"--logLevel=debug",
`--rest.port=${beaconPort}`,
]);

Expand Down
9 changes: 5 additions & 4 deletions packages/cli/test/e2e/voluntaryExit.test.ts
Expand Up @@ -8,18 +8,19 @@ import {describeCliTest, execCli} from "../utils/childprocRunner.js";
import {itDone} from "../utils/runUtils.js";

describeCliTest("voluntaryExit cmd", function ({spawnCli}) {
this.timeout("60s");
this.timeout("120s");

itDone("Perform a voluntary exit", async function (done) {
const restPort = 9596;

const devBnProc = spawnCli({pipeStdToParent: false, logPrefix: "dev"}, [
const devBnProc = spawnCli({pipeStdToParent: true, logPrefix: "dev"}, [
// ⏎
"dev",
`--dataDir=${path.join(testFilesDir, "dev-voluntary-exit")}`,
"--genesisValidators=8",
"--startValidators=0..7",
"--rest",
"--logLevel=debug",
`--rest.port=${restPort}`,
// Speed up test to make genesis happen faster
"--params.SECONDS_PER_SLOT=2",
Expand All @@ -42,7 +43,7 @@ describeCliTest("voluntaryExit cmd", function ({spawnCli}) {
const head = await client.beacon.getBlockHeader("head");
if (head.data.header.message.slot < 1) throw Error("pre-genesis");
},
{retryDelay: 1000, retries: 20}
{retryDelay: 2000, retries: 40}
);

const indexesToExit = [0, 1];
Expand Down Expand Up @@ -76,7 +77,7 @@ describeCliTest("voluntaryExit cmd", function ({spawnCli}) {
console.log(`Confirmed validator ${pubkey} = ${data.status}`);
}
},
{retryDelay: 1000, retries: 20}
{retryDelay: 2000, retries: 40}
);
}
});
Expand Down