mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-10 08:08:16 -05:00
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:
2
.github/workflows/benchmark.yml
vendored
2
.github/workflows/benchmark.yml
vendored
@@ -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")"
|
||||
|
||||
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@@ -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")"
|
||||
|
||||
2
.github/workflows/publish-dev.yml
vendored
2
.github/workflows/publish-dev.yml
vendored
@@ -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
|
||||
|
||||
2
.github/workflows/publish-rc.yml
vendored
2
.github/workflows/publish-rc.yml
vendored
@@ -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")"
|
||||
|
||||
2
.github/workflows/publish-stable.yml
vendored
2
.github/workflows/publish-stable.yml
vendored
@@ -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")"
|
||||
|
||||
2
.github/workflows/test-browser.yml
vendored
2
.github/workflows/test-browser.yml
vendored
@@ -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
|
||||
|
||||
2
.github/workflows/test-e2e.yml
vendored
2
.github/workflows/test-e2e.yml
vendored
@@ -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
|
||||
|
||||
2
.github/workflows/test-sim-merge.yml
vendored
2
.github/workflows/test-sim-merge.yml
vendored
@@ -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")"
|
||||
|
||||
2
.github/workflows/test-sim.yml
vendored
2
.github/workflows/test-sim.yml
vendored
@@ -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")"
|
||||
|
||||
2
.github/workflows/test-spec.yml
vendored
2
.github/workflows/test-spec.yml
vendored
@@ -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")"
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 .
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||
[](https://codecov.io/gh/ChainSafe/lodestar)
|
||||

|
||||

|
||||

|
||||
[](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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user