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 all 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
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/network.ts
Expand Up @@ -142,7 +142,7 @@ export class Network implements INetwork {
await this.libp2p.start();
// Stop latency monitor since we handle disconnects here and don't want additional load on the event loop
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
(this.libp2p.connectionManager as DefaultConnectionManager)["latencyMonitor"].stop();
((this.libp2p.connectionManager as unknown) as DefaultConnectionManager)["latencyMonitor"].stop();

// Network spec decides version changes based on clock fork, not head fork
const forkCurrentSlot = this.config.getForkName(this.clock.currentSlot);
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/util.ts
Expand Up @@ -70,7 +70,7 @@ export function prettyPrintPeerId(peerId: PeerId): string {
*/
// Compat function for type mismatch reasons
export function getConnectionsMap(connectionManager: ConnectionManager): Map<string, Connection[]> {
return (connectionManager as DefaultConnectionManager)["connections"] as Map<string, Connection[]>;
return ((connectionManager as unknown) as DefaultConnectionManager)["connections"] as Map<string, Connection[]>;
}

export function getConnection(connectionManager: ConnectionManager, peerIdStr: string): Connection | undefined {
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;
}
},
});
});
2 changes: 1 addition & 1 deletion packages/cli/test/e2e/runDevCmd.test.ts
Expand Up @@ -23,7 +23,7 @@ describeCliTest("Run dev command", function ({spawnCli}) {
}
});

const beaconUrl = `http://localhost:${beaconPort}`;
const beaconUrl = `http://127.0.0.1:${beaconPort}`;
const client = getClient({baseUrl: beaconUrl}, {config});

// Wrap in retry since the API may not be listening yet
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/e2e/voluntaryExit.test.ts
Expand Up @@ -33,7 +33,7 @@ describeCliTest("voluntaryExit cmd", function ({spawnCli}) {
}
});

const baseUrl = `http://localhost:${restPort}`;
const baseUrl = `http://127.0.0.1:${restPort}`;
const client = getClient({baseUrl}, {config});

// Wait for beacon node API to be available + genesis
Expand Down