From 64cefb368882d722c3cb10ee1ad570de6450d7ce Mon Sep 17 00:00:00 2001 From: Julian Meyer Date: Mon, 11 May 2026 15:41:41 -0700 Subject: [PATCH] feat: disable discv4, run discv5 on port 30303 by default DISABLE_DISCV4=true appends --disable-discv4-discovery so callers can opt in without changing the entrypoint. V5_DISCOVERY_PORT now defaults to 30303 (same as devp2p TCP) instead of 9200, improving NAT traversal in environments where only standard p2p ports are allowed outbound. Co-authored-by: Sisyphus --- reth/reth-entrypoint | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reth/reth-entrypoint b/reth/reth-entrypoint index cea226016..1d9b26617 100755 --- a/reth/reth-entrypoint +++ b/reth/reth-entrypoint @@ -127,6 +127,22 @@ if [[ "$RETH_HISTORICAL_PROOFS" == "true" && -n "$RETH_HISTORICAL_PROOFS_STORAGE --proofs-history.storage-path=$RETH_HISTORICAL_PROOFS_STORAGE_PATH fi +if [[ "${DISABLE_DISCV4:-false}" == "true" && "${RETH_DISABLE_DISCOVERY:-false}" != "true" ]]; then + ADDITIONAL_ARGS="$ADDITIONAL_ARGS --disable-discv4-discovery" +fi + +if [[ "${BASE_DISCOVERY_PROTOCOL:-true}" = "false" ]]; then + ADDITIONAL_ARGS="$ADDITIONAL_ARGS --rollup.discovery.v5.base false" +fi + +if [[ -n "${RETH_TRUSTED_PEERS:-}" ]]; then + ADDITIONAL_ARGS="$ADDITIONAL_ARGS --trusted-peers=$RETH_TRUSTED_PEERS" +fi + +if [[ "${RETH_DISABLE_DISCOVERY:-false}" == "true" ]]; then + ADDITIONAL_ARGS="$ADDITIONAL_ARGS --disable-discovery" +fi + mkdir -p "$RETH_DATA_DIR" echo "Starting reth with additional args: $ADDITIONAL_ARGS" echo "$BASE_NODE_L2_ENGINE_AUTH_RAW" > "$BASE_NODE_L2_ENGINE_AUTH"