From 0511f62240daed40c2f9fc2c1fb8357e6102b1b3 Mon Sep 17 00:00:00 2001 From: Yorick Date: Sun, 23 Jun 2024 15:52:06 +0000 Subject: [PATCH] Support Prysm QUIC --- README.md | 2 +- besu/Dockerfile.source | 2 +- erigon/Dockerfile.source | 2 +- ethd | 5 +++++ flashbots/Dockerfile.source | 2 +- geth/Dockerfile.source | 2 +- grandine/Dockerfile.source | 2 +- lighthouse/Dockerfile.source | 2 +- lodestar/Dockerfile.source | 4 ++-- nethermind/Dockerfile.source | 4 ++-- nimbus-el/Dockerfile.source | 2 +- nimbus/Dockerfile.binary | 4 ++-- nimbus/Dockerfile.source | 6 +++--- nimbus/Dockerfile.sourcegnosis | 6 +++--- nimbus/Dockerfile.sourceslottime | 2 +- prysm-cl-only.yml | 4 ++++ prysm.yml | 4 ++++ prysm/Dockerfile.binary | 8 ++++---- prysm/Dockerfile.source | 6 +++--- prysm/docker-entrypoint.sh | 16 +++------------- reth/Dockerfile.source | 2 +- teku/Dockerfile.source | 2 +- web3signer/Dockerfile.binary | 2 +- 23 files changed, 47 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index d612522e..ffa89d10 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/besu/Dockerfile.source b/besu/Dockerfile.source index 6f79bb3f..054236d3 100644 --- a/besu/Dockerfile.source +++ b/besu/Dockerfile.source @@ -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 diff --git a/erigon/Dockerfile.source b/erigon/Dockerfile.source index 13047ca0..87fbd92b 100644 --- a/erigon/Dockerfile.source +++ b/erigon/Dockerfile.source @@ -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 diff --git a/ethd b/ethd index c53e36be..b22d0b1a 100755 --- a/ethd +++ b/ethd @@ -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 diff --git a/flashbots/Dockerfile.source b/flashbots/Dockerfile.source index 31da8bdf..5bce47be 100644 --- a/flashbots/Dockerfile.source +++ b/flashbots/Dockerfile.source @@ -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 diff --git a/geth/Dockerfile.source b/geth/Dockerfile.source index 73055e39..a9ead3c3 100644 --- a/geth/Dockerfile.source +++ b/geth/Dockerfile.source @@ -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 diff --git a/grandine/Dockerfile.source b/grandine/Dockerfile.source index a67f6e2f..ee98df78 100644 --- a/grandine/Dockerfile.source +++ b/grandine/Dockerfile.source @@ -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 diff --git a/lighthouse/Dockerfile.source b/lighthouse/Dockerfile.source index ad28f33a..4beaca8d 100644 --- a/lighthouse/Dockerfile.source +++ b/lighthouse/Dockerfile.source @@ -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 diff --git a/lodestar/Dockerfile.source b/lodestar/Dockerfile.source index 4b8009c2..513a8a0e 100644 --- a/lodestar/Dockerfile.source +++ b/lodestar/Dockerfile.source @@ -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 @@ -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 diff --git a/nethermind/Dockerfile.source b/nethermind/Dockerfile.source index 11e064e0..d86f92be 100644 --- a/nethermind/Dockerfile.source +++ b/nethermind/Dockerfile.source @@ -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 @@ -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 \ diff --git a/nimbus-el/Dockerfile.source b/nimbus-el/Dockerfile.source index 5d9d0351..d99351cd 100644 --- a/nimbus-el/Dockerfile.source +++ b/nimbus-el/Dockerfile.source @@ -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 diff --git a/nimbus/Dockerfile.binary b/nimbus/Dockerfile.binary index 6489f5d0..1b062212 100644 --- a/nimbus/Dockerfile.binary +++ b/nimbus/Dockerfile.binary @@ -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 @@ -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 diff --git a/nimbus/Dockerfile.source b/nimbus/Dockerfile.source index f61a907c..524c8c67 100644 --- a/nimbus/Dockerfile.source +++ b/nimbus/Dockerfile.source @@ -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 @@ -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 @@ -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 diff --git a/nimbus/Dockerfile.sourcegnosis b/nimbus/Dockerfile.sourcegnosis index 92b2cec4..28db9057 100644 --- a/nimbus/Dockerfile.sourcegnosis +++ b/nimbus/Dockerfile.sourcegnosis @@ -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 @@ -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 @@ -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 diff --git a/nimbus/Dockerfile.sourceslottime b/nimbus/Dockerfile.sourceslottime index 6cadbac2..09064f4e 100644 --- a/nimbus/Dockerfile.sourceslottime +++ b/nimbus/Dockerfile.sourceslottime @@ -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 diff --git a/prysm-cl-only.yml b/prysm-cl-only.yml index de5d12fb..1d12996a 100644 --- a/prysm-cl-only.yml +++ b/prysm-cl-only.yml @@ -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: @@ -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 diff --git a/prysm.yml b/prysm.yml index 48e9a900..f56ec700 100644 --- a/prysm.yml +++ b/prysm.yml @@ -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: @@ -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 diff --git a/prysm/Dockerfile.binary b/prysm/Dockerfile.binary index 44200217..60e86a9e 100644 --- a/prysm/Dockerfile.binary +++ b/prysm/Dockerfile.binary @@ -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 @@ -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 diff --git a/prysm/Dockerfile.source b/prysm/Dockerfile.source index 7b7ae0f2..41c05663 100644 --- a/prysm/Dockerfile.source +++ b/prysm/Dockerfile.source @@ -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 @@ -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 @@ -65,7 +65,7 @@ USER ${USER} ENTRYPOINT ["beacon-chain"] -FROM consensus as validator +FROM consensus AS validator ARG USER=prysmvalidator ARG UID=10000 diff --git a/prysm/docker-entrypoint.sh b/prysm/docker-entrypoint.sh index 47c6cbc5..2d3dffcf 100755 --- a/prysm/docker-entrypoint.sh +++ b/prysm/docker-entrypoint.sh @@ -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 @@ -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 diff --git a/reth/Dockerfile.source b/reth/Dockerfile.source index 11ed7a48..78dd723f 100644 --- a/reth/Dockerfile.source +++ b/reth/Dockerfile.source @@ -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 diff --git a/teku/Dockerfile.source b/teku/Dockerfile.source index 67428306..073105b3 100644 --- a/teku/Dockerfile.source +++ b/teku/Dockerfile.source @@ -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 diff --git a/web3signer/Dockerfile.binary b/web3signer/Dockerfile.binary index 15610965..4548d143 100644 --- a/web3signer/Dockerfile.binary +++ b/web3signer/Dockerfile.binary @@ -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}