Use node 18 (#4779)

* Use node 18

* Add bigger timeouts

* Add uint8array concat benchmark

* increase timeouts

* Debug e2e tests

* Fix e2e tests, remove debug logs

* "fix" types

* "fix" types
This commit is contained in:
Cayman
2022-12-12 10:05:55 -05:00
committed by GitHub
parent 0a5bf0e20d
commit 7d662d7951
20 changed files with 39 additions and 24 deletions

View File

@@ -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")"

View File

@@ -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")"

View File

@@ -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

View File

@@ -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")"

View File

@@ -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")"

View File

@@ -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

View File

@@ -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

View File

@@ -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")"

View File

@@ -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")"

View File

@@ -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")"

View File

@@ -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

View File

@@ -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

View File

@@ -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/*
@@ -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/*
@@ -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 .

View File

@@ -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).
@@ -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:

View File

@@ -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.

View File

@@ -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);

View File

@@ -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 {

View File

@@ -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;
}
},
});
});

View File

@@ -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

View File

@@ -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