diff --git a/default.env b/default.env index 5d97fe4c..7529ec3e 100644 --- a/default.env +++ b/default.env @@ -204,12 +204,12 @@ LODESTAR_HEAP= CL_NODE_TYPE=pruned # EL_NODE_TYPE can be "archive", "full", "pre-merge-expiry", "pre-cancun-expiry", # "aggressive-expiry" or "rolling-expiry" -# "pre-merge-expiry" is only meaningful for mainnet and sepolia +# "pre-merge-expiry" and "pre-cancun-expiry" are only meaningful for mainnet and sepolia # Switching node type typically requires a resync # Consider using `./ethd prune-history`, which guides you as to whether to prune in-place # or resync, depending on client -# "aggressive-expiry" is supported with Erigon -# "rolling-expiry" and "pre-cancun-expiry" are Nethermind features, for now +# "aggressive-expiry" is supported with Reth and Erigon +# "rolling-expiry" and "pre-cancun-expiry" are supported with Reth and Nethermind # "rolling-expiry" remains experimental in Nethermind as of Dec 29th 2025 EL_NODE_TYPE=pre-merge-expiry # Era URLs, see https://eth-clients.github.io/history-endpoints/ diff --git a/reth.yml b/reth.yml index 711b82e6..c91d8e71 100644 --- a/reth.yml +++ b/reth.yml @@ -85,7 +85,7 @@ services: - ${EE_PORT:-8551} - --authrpc.jwtsecret - /var/lib/reth/ee-secret/jwtsecret - - ${EL_MAX_PEER_COUNT:+--max-outbound-peers} + - ${EL_MAX_PEER_COUNT:+--max-peers} - ${EL_MAX_PEER_COUNT:+${EL_MAX_PEER_COUNT}} labels: - metrics.scrape=true diff --git a/reth/docker-entrypoint.sh b/reth/docker-entrypoint.sh index 5f155561..e2f549be 100755 --- a/reth/docker-entrypoint.sh +++ b/reth/docker-entrypoint.sh @@ -93,6 +93,7 @@ if [[ -n "${STATIC_DIR}" && ! "${STATIC_DIR}" = ".nada" ]]; then __static="--datadir.static-files /var/lib/static" fi +__prune="--block-interval 5 --prune.senderrecovery.full --prune.accounthistory.distance 10064 --prune.storagehistory.distance 10064" case "${NODE_TYPE}" in archive) echo "Reth archive node without pruning" @@ -100,11 +101,10 @@ case "${NODE_TYPE}" in ;; full) echo "Reth full node without history expiry" - __prune="--block-interval 5 --prune.receipts.before 0 --prune.senderrecovery.full --prune.accounthistory.distance 10064 --prune.storagehistory.distance 10064" - echo "Pruning parameters: ${__prune}" + prune+=" --prune.receipts.before 0" ;; pre-merge-expiry) - __prune="--block-interval 5 --prune.senderrecovery.full --prune.accounthistory.distance 10064 --prune.storagehistory.distance 10064 --prune.transactionlookup.distance 10064" + prune+=" --prune.transactionlookup.distance 10064" case ${NETWORK} in mainnet|sepolia) echo "Reth minimal node with pre-merge history expiry" @@ -115,7 +115,32 @@ case "${NODE_TYPE}" in __prune+=" --prune.receipts.before 0" ;; esac - echo "Pruning parameters: ${__prune}" + ;; + pre-cancun-expiry) + prune+=" --prune.transactionlookup.distance 10064" + case "${NETWORK}" in + mainnet) + echo "Reth minimal node with pre-Cancun history expiry" + __prune+=" --prune.bodies.before 19426587 --prune.receipts.before 19426587" + ;; + sepolia) + echo "Reth minimal node with pre-Cancun history expiry" + __prune+=" --prune.bodies.before 5187023 --prune.receipts.before 5187023" + ;; + *) + echo "There is no pre-Cancun history for ${NETWORK} network, \"pre-cancun-expiry\" has no effect." + __prune+=" --prune.receipts.before 0" + ;; + esac + ;; + rolling-expiry) + echo "Reth minimal node with rolling history expiry, keeps 1 year." + # 365 days = 82125 epochs = 2628000 slots / blocks + __prune+=" --prune.transactionlookup.distance 10064 --prune.bodies.distance 2628000 --prune.receipts.distance 2628000" + ;; + aggressive-expiry) + echo "Reth minimal node with aggressive expiry" + __prune="--minimal" ;; *) echo "ERROR: The node type ${NODE_TYPE} is not known to Eth Docker's Reth implementation." @@ -124,6 +149,10 @@ case "${NODE_TYPE}" in ;; esac +if [[ -n "${__prune}" ]]; then + echo "Pruning parameters: ${__prune}" +fi + if [[ -f /var/lib/reth/repair-trie ]]; then if [[ "${NETWORK}" =~ ^https?:// ]]; then echo "Can't repair database on custom network"