From 5cfa7757b36e81f9886989b238acfc43b61f1cb9 Mon Sep 17 00:00:00 2001 From: Erhnysr Date: Fri, 15 May 2026 00:16:31 +0300 Subject: [PATCH] feat: make max-outbound-peers configurable via MAX_OUTBOUND_PEERS env var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The --max-outbound-peers flag in reth-entrypoint was hardcoded to 100 with no way to override it without modifying the entrypoint directly. Operators experiencing 'Send Queue full' gossipsub warnings (see #1063) need to increase this value to improve peer connectivity, but had no documented way to do so. This change: - Adds MAX_OUTBOUND_PEERS variable to reth-entrypoint (default: 100, preserving existing behaviour) - Documents the variable in .env.mainnet and .env.sepolia with a reference to the related issue Fixes #1063 (partially — the configurable peer limit addresses the root cause for operators with port access issues) --- .env.mainnet | 7 +++++++ .env.sepolia | 7 +++++++ reth/reth-entrypoint | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.env.mainnet b/.env.mainnet index c5bd040b5..e306e97c2 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -120,3 +120,10 @@ STATSD_ADDRESS="172.17.0.1" # NOTE: The node type that was chosen when first running a node cannot be changed after the initial sync. Turning Archive into Pruned, or Pruned into Full is not supported [source](https://reth.rs/run/faq/pruning/). # NOTE: The pruned snapshots provided are set with a distance of 1_339_200 (~31 days). # RETH_PRUNING_ARGS="--prune.senderrecovery.distance=50000 --prune.transactionlookup.distance=50000 --prune.receipts.distance=50000 --prune.accounthistory.distance=50000 --prune.storagehistory.distance=50000 --prune.bodies.distance=50000" + +# MAX OUTBOUND PEERS (OPTIONAL - OVERRIDE TO CHANGE DEFAULT) +# ---------------------------------------------------------- +# Maximum number of outbound peers for the Reth execution client. +# Increase this if you experience "Send Queue full" warnings with low peer count. +# See: https://github.com/base/node/issues/1063 +# MAX_OUTBOUND_PEERS=100 diff --git a/.env.sepolia b/.env.sepolia index cb9a8b545..092fa03d5 100644 --- a/.env.sepolia +++ b/.env.sepolia @@ -120,3 +120,10 @@ STATSD_ADDRESS="172.17.0.1" # NOTE: The node type that was chosen when first running a node cannot be changed after the initial sync. Turning Archive into Pruned, or Pruned into Full is not supported [source](https://reth.rs/run/faq/pruning/). # NOTE: The pruned snapshots provided are set with a distance of 1_339_200 (~31 days). # RETH_PRUNING_ARGS="--prune.senderrecovery.distance=50000 --prune.transactionlookup.distance=50000 --prune.receipts.distance=50000 --prune.accounthistory.distance=50000 --prune.storagehistory.distance=50000 --prune.bodies.distance=50000" + +# MAX OUTBOUND PEERS (OPTIONAL - OVERRIDE TO CHANGE DEFAULT) +# ---------------------------------------------------------- +# Maximum number of outbound peers for the Reth execution client. +# Increase this if you experience "Send Queue full" warnings with low peer count. +# See: https://github.com/base/node/issues/1063 +# MAX_OUTBOUND_PEERS=100 diff --git a/reth/reth-entrypoint b/reth/reth-entrypoint index cea226016..6d692d22c 100755 --- a/reth/reth-entrypoint +++ b/reth/reth-entrypoint @@ -10,6 +10,7 @@ METRICS_PORT="${METRICS_PORT:-6060}" DISCOVERY_PORT="${DISCOVERY_PORT:-30303}" V5_DISCOVERY_PORT="${V5_DISCOVERY_PORT:-9200}" P2P_PORT="${P2P_PORT:-30303}" +MAX_OUTBOUND_PEERS="${MAX_OUTBOUND_PEERS:-100}" ADDITIONAL_ARGS="" BINARY="./base-reth-node" RETH_HISTORICAL_PROOFS="${RETH_HISTORICAL_PROOFS:-false}" @@ -150,7 +151,7 @@ exec "$BINARY" node \ --authrpc.port="$AUTHRPC_PORT" \ --authrpc.jwtsecret="$BASE_NODE_L2_ENGINE_AUTH" \ --metrics=0.0.0.0:"$METRICS_PORT" \ - --max-outbound-peers=100 \ + --max-outbound-peers="$MAX_OUTBOUND_PEERS" \ --chain "$RETH_CHAIN" \ --rollup.sequencer-http="$RETH_SEQUENCER_HTTP" \ --rollup.disable-tx-pool-gossip \