Skip to content

Commit

Permalink
Support Prysm QUIC (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Jun 23, 2024
1 parent 50bd12d commit 1555fba
Show file tree
Hide file tree
Showing 23 changed files with 47 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Eth Docker uses a "semver-ish" scheme.
large.
- Second through fourth digit, [semver](https://semver.org/).

This is Eth Docker v2.9.2.0
This is Eth Docker v2.10.0.0
2 changes: 1 addition & 1 deletion besu/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Besu in a stock Ubuntu container
FROM eclipse-temurin:21-jdk-jammy as builder
FROM eclipse-temurin:21-jdk-jammy AS builder

# This is here to avoid build-time complaints
ARG DOCKER_TAG
Expand Down
2 changes: 1 addition & 1 deletion erigon/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Erigon in a stock Go build container
FROM golang:1.22-alpine as builder
FROM golang:1.22-alpine AS builder

# Unused, this is here to avoid build time complaints
ARG DOCKER_TAG
Expand Down
5 changes: 5 additions & 0 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,11 @@ envmigrate() {
value=$((value + 1))
echo "Adjusted CL_QUIC_PORT to ${value} so it does not conflict with CL_P2P_PORT"
fi
__prysm_port=$(sed -n -e "s/^PRYSM_UDP_PORT=\(.*\)/\1/p" "${ENV_FILE}.source" || true)
if [ -n "${__prysm_port}" ] && [ "${__prysm_port}" = "${value}" ]; then # just in case this is one ahead
value=$((value + 1))
echo "Adjusted CL_QUIC_PORT to ${value} so it does not conflict with PRYSM_UDP_PORT"
fi
fi
# Literal match intended
# shellcheck disable=SC2076
Expand Down
2 changes: 1 addition & 1 deletion flashbots/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build in a stock Go build container
FROM golang:1.22-alpine as builder
FROM golang:1.22-alpine AS builder

# Unused, this is here to avoid build time complaints
ARG DOCKER_TAG
Expand Down
2 changes: 1 addition & 1 deletion geth/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Geth in a stock Go build container
FROM golang:1.22-alpine as builder
FROM golang:1.22-alpine AS builder

# Unused, this is here to avoid build time complaints
ARG DOCKER_TAG
Expand Down
2 changes: 1 addition & 1 deletion grandine/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Grandine in a stock Rust build container
FROM rust:bookworm as builder
FROM rust:bookworm AS builder

# Unused, this is here to avoid build time complaints
ARG DOCKER_TAG
Expand Down
2 changes: 1 addition & 1 deletion lighthouse/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Lighthouse in a stock Rust build container
FROM rust:bookworm as builder
FROM rust:bookworm AS builder

# Unused, this is here to avoid build time complaints
ARG DOCKER_TAG
Expand Down
4 changes: 2 additions & 2 deletions lodestar/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22-alpine as build
FROM node:22-alpine AS builder

# Here only to avoid build-time errors
ARG DOCKER_TAG
Expand Down Expand Up @@ -36,7 +36,7 @@ RUN adduser \
RUN mkdir -p /var/lib/lodestar/consensus/ee-secret && chown -R ${USER}:${USER} /var/lib/lodestar/consensus && chmod -R 700 /var/lib/lodestar/consensus && chmod 777 /var/lib/lodestar/consensus/ee-secret

WORKDIR /usr/app
COPY --from=build --chown=${USER}:${USER} /usr/app .
COPY --from=builder --chown=${USER}:${USER} /usr/app .
RUN ln -s ../../packages/cli/lib/index.js node_modules/.bin/lodestar

# Cannot assume buildkit, hence no chmod
Expand Down
4 changes: 2 additions & 2 deletions nethermind/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Partially from Nethermind github
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder
# Unused, this is here to avoid build time complaints
ARG DOCKER_TAG
ARG DOCKER_REPO
Expand Down Expand Up @@ -46,7 +46,7 @@ RUN adduser \
WORKDIR /nethermind

# Cannot assume buildkit, hence no chmod
COPY --from=build --chown=${USER}:${USER} /nethermind/out .
COPY --from=builder --chown=${USER}:${USER} /nethermind/out .

RUN chown -R ${USER}:${USER} /nethermind
RUN mkdir -p /var/lib/nethermind/ee-secret && chown -R ${USER}:${USER} /var/lib/nethermind \
Expand Down
2 changes: 1 addition & 1 deletion nimbus-el/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Nimbus in a stock debian container
FROM debian:bookworm-slim as builder
FROM debian:bookworm-slim AS builder

# Included here to avoid build-time complaints
ARG DOCKER_TAG
Expand Down
4 changes: 2 additions & 2 deletions nimbus/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG DOCKER_VC_TAG
ARG DOCKER_REPO
ARG DOCKER_VC_REPO

FROM ${DOCKER_REPO}:${DOCKER_TAG} as consensus
FROM ${DOCKER_REPO}:${DOCKER_TAG} AS consensus

# Included here to avoid build-time complaints
ARG BUILD_TARGET
Expand Down Expand Up @@ -38,7 +38,7 @@ USER ${USER}

ENTRYPOINT ["nimbus_beacon_node"]

FROM ${DOCKER_VC_REPO}:${DOCKER_VC_TAG} as validator
FROM ${DOCKER_VC_REPO}:${DOCKER_VC_TAG} AS validator

# Included here to avoid build-time complaints
ARG BUILD_TARGET
Expand Down
6 changes: 3 additions & 3 deletions nimbus/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Nimbus in a stock debian container
FROM debian:bookworm-slim as builder
FROM debian:bookworm-slim AS builder

# Included here to avoid build-time complaints
ARG DOCKER_TAG
Expand All @@ -16,7 +16,7 @@ WORKDIR /usr/src
RUN bash -c "git clone --recurse-submodules -j8 ${SRC_REPO} nimbus-eth2 && cd nimbus-eth2 && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:nim-pr; git checkout nim-pr; else git checkout ${BUILD_TARGET}; fi && make -j$(nproc) update && make -j$(nproc) nimbus_beacon_node nimbus_validator_client"

# Pull all binaries into a second stage deploy debian container
FROM debian:bookworm-slim as consensus
FROM debian:bookworm-slim AS consensus

ARG USER=user
ARG UID=10002
Expand Down Expand Up @@ -56,7 +56,7 @@ USER ${USER}

ENTRYPOINT ["nimbus_beacon_node"]

FROM debian:bookworm-slim as validator
FROM debian:bookworm-slim AS validator

ARG USER=user
ARG UID=10000
Expand Down
6 changes: 3 additions & 3 deletions nimbus/Dockerfile.sourcegnosis
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Nimbus in a stock debian container
FROM debian:bookworm-slim as builder
FROM debian:bookworm-slim AS builder

# Included here to avoid build-time complaints
ARG DOCKER_TAG
Expand All @@ -16,7 +16,7 @@ WORKDIR /usr/src
RUN bash -c "git clone --recurse-submodules -j8 ${SRC_REPO} nimbus-eth2 && cd nimbus-eth2 && git config advice.detachedHead false && git fetch --all --tags && if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TARGET} | cut -d '-' -f 2)/head:nim-pr; git checkout nim-pr; else git checkout ${BUILD_TARGET}; fi && make -j$(nproc) update && make -j$(nproc) gnosis-build nimbus_validator_client"

# Pull all binaries into a second stage deploy debian container
FROM debian:bookworm-slim as consensus
FROM debian:bookworm-slim AS consensus

ARG USER=user
ARG UID=10002
Expand Down Expand Up @@ -55,7 +55,7 @@ USER ${USER}

ENTRYPOINT ["nimbus_beacon_node"]

FROM debian:bookworm-slim as validator
FROM debian:bookworm-slim AS validator

ARG USER=user
ARG UID=10000
Expand Down
2 changes: 1 addition & 1 deletion nimbus/Dockerfile.sourceslottime
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Nimbus in a stock debian container
FROM debian:bookworm-slim as builder
FROM debian:bookworm-slim AS builder

# Included here to avoid build-time complaints
ARG DOCKER_TAG
Expand Down
4 changes: 4 additions & 0 deletions prysm-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ services:
ports:
- ${HOST_IP:-}:${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-}:${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
- ${HOST_IP:-}:${CL_QUIC_PORT:-9001}:${CL_QUIC_PORT:-9001}/udp
networks:
default:
aliases:
Expand Down Expand Up @@ -72,6 +73,9 @@ services:
- ${PRYSM_PORT}
- --p2p-udp-port
- ${PRYSM_UDP_PORT}
- --p2p-quic-port
- ${CL_QUIC_PORT}
- --enable-quic
- --p2p-max-peers
- ${CL_MAX_PEER_COUNT:-70}
- --verbosity
Expand Down
4 changes: 4 additions & 0 deletions prysm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ services:
ports:
- ${HOST_IP:-}:${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-}:${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
- ${HOST_IP:-}:${CL_QUIC_PORT:-9001}:${CL_QUIC_PORT:-9001}/udp
networks:
default:
aliases:
Expand Down Expand Up @@ -74,6 +75,9 @@ services:
- ${PRYSM_PORT}
- --p2p-udp-port
- ${PRYSM_UDP_PORT}
- --p2p-quic-port
- ${CL_QUIC_PORT}
- --enable-quic
- --p2p-max-peers
- ${CL_MAX_PEER_COUNT:-70}
- --verbosity
Expand Down
8 changes: 4 additions & 4 deletions prysm/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ ARG DOCKER_VC_TAG
ARG DOCKER_REPO
ARG DOCKER_VC_REPO

FROM ${DOCKER_REPO}:${DOCKER_TAG} as clsource
FROM ${DOCKER_REPO}:${DOCKER_TAG} AS clsource

FROM debian:bookworm-slim as consensus
FROM debian:bookworm-slim AS consensus

#Included here to avoid build-time complaints
ARG BUILD_TARGET
Expand Down Expand Up @@ -53,9 +53,9 @@ USER ${USER}

ENTRYPOINT ["beacon-chain"]

FROM ${DOCKER_VC_REPO}:${DOCKER_VC_TAG} as vcsource
FROM ${DOCKER_VC_REPO}:${DOCKER_VC_TAG} AS vcsource

FROM consensus as validator
FROM consensus AS validator

ARG USER=prysmvalidator
ARG UID=10000
Expand Down
6 changes: 3 additions & 3 deletions prysm/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Prysm in a stock Go build container
FROM golang:1.22-bookworm as builder
FROM golang:1.22-bookworm AS builder

# Here only to avoid build-time errors
ARG DOCKER_TAG
Expand All @@ -19,7 +19,7 @@ if [[ ${BUILD_TARGET} =~ pr-.+ ]]; then git fetch origin pull/$(echo ${BUILD_TAR
&& bazel build --config=release //cmd/client-stats:client-stats"

# Pull all binaries into a second stage deploy debian container
FROM debian:bookworm-slim as consensus
FROM debian:bookworm-slim AS consensus

ARG USER=prysmconsensus
ARG UID=10002
Expand Down Expand Up @@ -65,7 +65,7 @@ USER ${USER}

ENTRYPOINT ["beacon-chain"]

FROM consensus as validator
FROM consensus AS validator

ARG USER=prysmvalidator
ARG UID=10000
Expand Down
16 changes: 3 additions & 13 deletions prysm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,11 @@ else
__prune=""
fi

# Fetch genesis file as needed
if [[ "${NETWORK}" = "goerli" || "${NETWORK}" = "prater" ]]; then
GENESIS=/var/lib/prysm/genesis.ssz
if [ ! -f "$GENESIS" ]; then
echo "Fetching genesis file for Görli testnet"
curl -fsSL -o "$GENESIS" https://github.com/eth-clients/goerli/raw/main/prater/genesis.ssz
fi
# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
exec "$@" "--genesis-state=$GENESIS" ${__network} ${__rapid_sync} ${__prune} ${__mev_boost} ${CL_EXTRAS}
elif [[ "${NETWORK}" = "sepolia" ]]; then
if [[ "${NETWORK}" = "sepolia" ]]; then
GENESIS=/var/lib/prysm/genesis.ssz
if [ ! -f "$GENESIS" ]; then
echo "Fetching genesis file for Sepolia testnet"
curl -fsSL -o "$GENESIS" https://github.com/eth-clients/sepolia/raw/main/bepolia/genesis.ssz
curl -fsSL -o "$GENESIS" https://github.com/eth-clients/sepolia/raw/main/metadata/genesis.ssz
fi
# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
Expand All @@ -101,7 +91,7 @@ elif [[ "${NETWORK}" = "holesky" ]]; then
GENESIS=/var/lib/prysm/genesis.ssz
if [ ! -f "$GENESIS" ]; then
echo "Fetching genesis file for Holešky testnet"
curl -fsSL -o "$GENESIS" https://github.com/eth-clients/holesky/raw/main/custom_config_data/genesis.ssz
curl -fsSL -o "$GENESIS" https://github.com/eth-clients/holesky/raw/main/metadata/genesis.ssz
fi
# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
Expand Down
2 changes: 1 addition & 1 deletion reth/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build reth in a stock rust container
FROM rust:bookworm as builder
FROM rust:bookworm AS builder

# Unused, this is here to avoid build time complaints
ARG DOCKER_TAG
Expand Down
2 changes: 1 addition & 1 deletion teku/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Teku in a stock Ubuntu container
FROM eclipse-temurin:21-jdk-jammy as builder
FROM eclipse-temurin:21-jdk-jammy AS builder

# This is here to avoid build-time complaints
ARG DOCKER_TAG
Expand Down
2 changes: 1 addition & 1 deletion web3signer/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG DOCKER_TAG
ARG DOCKER_REPO

FROM flyway/flyway:latest as flyway
FROM flyway/flyway:latest AS flyway

FROM ${DOCKER_REPO}:${DOCKER_TAG}

Expand Down

0 comments on commit 1555fba

Please sign in to comment.