Skip to content

Forward QUIC UDP port and set --enr-quic-port for both mainnet and hoodi variants #9

@shane-moore

Description

@shane-moore

ports:
- "9100:9100/tcp"
- "9100:9100/udp"

Anchor uses two UDP ports for P2P (discovery + QUIC). The current docker compose only forwards discovery; QUIC is unreachable.

Without this, peers attempting QUIC connections fail and fall back to TCP. Reduced peer count / connectivity, especially during churn — relevant for SSV operators where QBFT round timers are tight.

Anchor's QUIC port should be P2P_PORT + 1 per https://github.com/sigp/anchor/blob/8f4839625e9791d31c9159930cc00af2bd7ce2d5/anchor/client/src/cli.rs#L175-L218.

Mainnet (package_variants/mainnet/docker-compose.yml)

services:
  operator:
    build:
      args:
        NETWORK: mainnet
        P2P_PORT: 9100
        QUIC_PORT: 9101    # new
    ports:
      - "9100:9100/tcp"
      - "9100:9100/udp"
      - "9101:9101/udp"    # new

Hoodi (package_variants/hoodi/docker-compose.yml)

Same shape: add QUIC_PORT: 9103 to build args and "9103:9103/udp" to ports.

Dockerfile (operator/Dockerfile)

Declare the new build arg and re-export it as a runtime env var:

ARG NETWORK
ARG P2P_PORT
ARG QUIC_PORT          # new
ARG STAKER_SCRIPTS_VERSION

ENV P2P_PORT=${P2P_PORT} \
    QUIC_PORT=${QUIC_PORT} \    # new
    HTTP_PORT=5062 \
    STAKER_SCRIPTS_URL=https://github.com/dappnode/staker-package-scripts/releases/download/${STAKER_SCRIPTS_VERSION}

Entrypoint (operator/entrypoint.sh:54-69)

Append --quic-port=${QUIC_PORT} to FLAGS next to --port=${P2P_PORT}.

Also: ENR advertisement

Forwarding the QUIC UDP port without setting --enr-quic-port is half a fix: the port is reachable, but the ENR doesn't advertise it, so peers don't know to dial it. From Anchor's advanced_networking docs:

"Anchor does not yet support ENR auto-update — we therefore recommend manually setting publicly reachable ports via the --enr*-port CLI parameters to advertise your node as reachable on the network."

Recommendation: also set the matching ENR-port flags in entrypoint.sh:

--enr-udp-port=${P2P_PORT} \
--enr-tcp-port=${P2P_PORT} \
--enr-quic-port=${QUIC_PORT} \

@chong-he 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions