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

feat: implement peerDAS on electra #6353

Draft
wants to merge 15 commits into
base: electra-fork
Choose a base branch
from
Draft
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: 2 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// Upgrade the container to Node 22
// https://github.com/ChainSafe/lodestar/issues/6742
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
"features": {
"ghcr.io/devcontainers/features/python:1": {}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
check-latest: true
cache: yarn
- name: Node.js version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
sudo apt-get install -y build-essential
- uses: "./.github/actions/setup-and-build"
with:
node: 20
node: 22
- run: |
mkdir -p dist
yarn global add caxa@3.0.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: yarn
- name: Node.js version
id: node
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
check-latest: true
cache: yarn

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
registry-url: "https://registry.npmjs.org"
check-latest: true
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

- uses: "./.github/actions/setup-and-build"
with:
node: 20
node: 22

- name: Generate changelog
run: node scripts/generate_changelog.mjs ${{ needs.tag.outputs.prev_tag }} ${{ needs.tag.outputs.tag }} CHANGELOG.md
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:

- uses: "./.github/actions/setup-and-build"
with:
node: 20
node: 22

- name: Generate changelog
run: node scripts/generate_changelog.mjs ${{ needs.tag.outputs.prev_tag }} ${{ needs.tag.outputs.tag }} CHANGELOG.md
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-sim-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
check-latest: true
cache: yarn
- name: Node.js version
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
with:
node: 20
node: 22

sim-test-multifork:
name: Multifork sim test
Expand All @@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
with:
node: 20
node: 22
- name: Load env variables
uses: ./.github/actions/dotenv
- name: Download required docker images before running tests
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
with:
node: 20
node: 22
- name: Load env variables
uses: ./.github/actions/dotenv
- name: Download required docker images before running tests
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
with:
node: 20
node: 22
- name: Load env variables
uses: ./.github/actions/dotenv
- name: Download required docker images before running tests
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
with:
node: 20
node: 22
- name: Load env variables
uses: ./.github/actions/dotenv
- name: Download required docker images before running tests
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
with:
node: 20
node: 22
- name: Load env variables
uses: ./.github/actions/dotenv
- name: Download required docker images before running tests
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [20]
node: [22]
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v4
Expand All @@ -42,7 +42,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [20]
node: [22]
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [20]
node: [22]
steps:
- uses: actions/checkout@v4

Expand All @@ -95,7 +95,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [20]
node: [22]
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [20]
node: [22]
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v4
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [20]
node: [22]
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v4
Expand All @@ -195,7 +195,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [20]
node: [22]
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup-and-build"
Expand Down
2 changes: 2 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Lerna
MEV
MacOS
Metamask
ModuleNotFoundError
Monorepo
NPM
NVM
Expand Down Expand Up @@ -125,6 +126,7 @@ devcontainer
devnet
devnets
devtools
distutils
eg
enodes
enum
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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:20-alpine as build_src
FROM --platform=${BUILDPLATFORM:-amd64} node:22-alpine as build_src
ARG COMMIT
WORKDIR /usr/app
RUN apk update && apk add --no-cache g++ make python3 py3-setuptools && 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:20-alpine as build_deps
FROM node:22-alpine as build_deps
WORKDIR /usr/app
RUN apk update && apk add --no-cache g++ make python3 && rm -rf /var/cache/apk/*

Expand All @@ -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:20-alpine
FROM node:22-alpine
WORKDIR /usr/app
COPY --from=build_deps /usr/app .

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/chainsafe/lodestar?color=blue&label=Docker&sort=semver)](https://hub.docker.com/r/chainsafe/lodestar)
[![Eth Consensus Spec v1.4.0](https://img.shields.io/badge/ETH%20consensus--spec-1.4.0-blue)](https://github.com/ethereum/consensus-specs/releases/tag/v1.4.0)
![ES Version](https://img.shields.io/badge/ES-2021-yellow)
![Node Version](https://img.shields.io/badge/node-20.x-green)
![Node Version](https://img.shields.io/badge/node-22.x-green)
[![codecov](https://codecov.io/gh/ChainSafe/lodestar/graph/badge.svg)](https://codecov.io/gh/ChainSafe/lodestar)
[![gitpoap badge](https://public-api.gitpoap.io/v1/repo/ChainSafe/lodestar/badge)](https://www.gitpoap.io/gh/ChainSafe/lodestar)

Expand Down
20 changes: 11 additions & 9 deletions docker/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,30 @@ services:
build:
context: prometheus
environment:
# Linux: http://localhost:8008
# MacOSX: http://host.docker.internal:8008
BEACON_URL: localhost:8008
VC_URL: localhost:5064
BEACON_URL: host.docker.internal:8008
VC_URL: host.docker.internal:5064
restart: always
network_mode: host
volumes:
- "prometheus:/prometheus"
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "127.0.0.1:9090:9090"

grafana:
build:
context: ..
dockerfile: docker/grafana
restart: always
network_mode: host
volumes:
- "grafana:/var/lib/grafana"
- "grafana-dashboards:/dashboards"
environment:
# Linux: http://localhost:9090
# MacOSX: http://host.docker.internal:9090
PROMETHEUS_URL: http://localhost:9090
PROMETHEUS_URL: http://host.docker.internal:9090
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "127.0.0.1:3000:3000"

volumes:
prometheus:
Expand Down
20 changes: 11 additions & 9 deletions docker/docker-compose.local_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,28 @@ services:
build:
context: prometheus
environment:
# Linux: http://localhost:8008
# MacOSX: http://host.docker.internal:8008
BEACON_URL: localhost:8008
VC_URL: localhost:5064
BEACON_URL: host.docker.internal:8008
VC_URL: host.docker.internal:5064
restart: always
network_mode: host
volumes:
- "prometheus:/prometheus"
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "127.0.0.1:9090:9090"

grafana:
build: grafana_dev
restart: always
network_mode: host
volumes:
- "grafana:/var/lib/grafana"
- "grafana-dashboards:/dashboards"
environment:
# Linux: http://localhost:9090
# MacOSX: http://host.docker.internal:9090
PROMETHEUS_URL: http://localhost:9090
PROMETHEUS_URL: http://host.docker.internal:9090
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "127.0.0.1:3000:3000"

volumes:
prometheus:
Expand Down
12 changes: 11 additions & 1 deletion docs/pages/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Docker is the recommended setup for Lodestar. Use our [Lodestar Quickstart scrip

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

:::info
NodeJS versions older than the current LTS are not supported by Lodestar. We recommend running the latest Node LTS.
Expand Down Expand Up @@ -83,6 +83,16 @@ Lodestar should now be ready for use.

See [Command Line Reference](./../reference/cli.md) for further information.

### Known Issues

**ModuleNotFoundError: No module named 'distutils'**

If you stump upon this issue while running Yarn, it's because Python 3.12 had removed `distutils` package. That package is required for node build tool. You can install it with following command.

```bash
pip3 install setuptools --force-reinstall --user
```

## Install from NPM [not recommended]

:::danger
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tools/core-dumps.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ which llvm-config
/opt/homebrew/opt/llvm/bin/llvm-config # if this is not what comes up restart the shell
$ npm install -g llnode
$ llnode
(lldb) plugin load '/Users/ninja_user/.nvm/versions/node/v20.5.1/lib/node_modules/llnode/llnode.dylib'
(lldb) plugin load '/Users/ninja_user/.nvm/versions/node/v22.1.0/lib/node_modules/llnode/llnode.dylib'
(lldb) settings set prompt '(llnode) '
(llnode)
```
Expand Down Expand Up @@ -58,7 +58,7 @@ Once you collect the core dump you can load it into `llnode` for debugging.
$ llnode -f /path/to/node_debug -c /Users/ninja_user/coredumps/node.coredump
(lldb) target create "node_debug" --core "node.coredump"
Core file '/Users/ninja_user/coredumps/node.coredump' (x86_64) was loaded.
(lldb) plugin load '/Users/ninja_user/.nvm/versions/node/v20.5.1/lib/node_modules/llnode/llnode.dylib'
(lldb) plugin load '/Users/ninja_user/.nvm/versions/node/v22.1.0/lib/node_modules/llnode/llnode.dylib'
(lldb) settings set prompt '(llnode) '
(llnode)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tools/heap-dumps.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ $ git clone https://github.com/nodejs/node.git
$ cd node

# Use whichever version of node you prefer
$ git checkout v20.10.0
$ git checkout v22.1.0
$ ./configure --debug

# This command only builds the debug version of node and assumes
Expand Down