Skip to content

Commit dfa0565

Browse files
authored
Change ARCHIVE and MINIMAL to NODE_TYPE (#2401)
1 parent ed63ba3 commit dfa0565

37 files changed

+438
-306
lines changed

.github/workflows/test-client-combos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
- "CL_MAX_PEER_COUNT=100 CL_MIN_PEER_COUNT=20 EL_MAX_PEER_COUNT=10"
152152
- IPV6=true
153153
- IPV6=false
154-
- EL_MINIMAL_NODE=false
154+
- EL_NODE_TYPE=full
155155
- CHECKPOINT_SYNC_URL=
156156
steps:
157157
- name: Checkout

besu.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ services:
2525
- JAVA_OPTS=${BESU_HEAP:--Xmx5g}
2626
- JWT_SECRET=${JWT_SECRET:-}
2727
- EL_EXTRAS=${EL_EXTRAS:-}
28-
- ARCHIVE_NODE=${EL_ARCHIVE_NODE:-}
29-
- MINIMAL_NODE=${EL_MINIMAL_NODE:-}
28+
- NODE_TYPE=${EL_NODE_TYPE:-pre-merge-expiry}
3029
- NETWORK=${NETWORK}
3130
- IPV6=${IPV6:-false}
3231
volumes:

besu/docker-entrypoint.sh

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -63,38 +63,47 @@ else
6363
__network="--network ${NETWORK}"
6464
fi
6565

66-
if [[ "${ARCHIVE_NODE}" = "true" ]]; then
67-
echo "Besu archive node without pruning"
68-
__prune="--data-storage-format=FOREST --sync-mode=FULL"
69-
elif [[ "${MINIMAL_NODE}" = "true" ]]; then
70-
case "${NETWORK}" in
71-
mainnet | sepolia )
72-
echo "Besu minimal node with pre-merge history expiry"
73-
__prune="--snapsync-server-enabled"
74-
timestamp_file="/var/lib/besu/prune-history-timestamp.txt"
75-
if [[ -f "${timestamp_file}" ]]; then
76-
saved_ts=$(<"${timestamp_file}")
77-
current_ts=$(date +%s)
78-
diff=$((current_ts - saved_ts))
66+
case "${NODE_TYPE}" in
67+
archive)
68+
echo "Besu archive node without pruning"
69+
__prune="--data-storage-format=FOREST --sync-mode=FULL"
70+
;;
71+
full)
72+
echo "Besu full node without history expiry"
73+
__prune="--snapsync-synchronizer-pre-checkpoint-headers-only-enabled=false --snapsync-server-enabled"
74+
;;
75+
pre-merge-expiry)
76+
case "${NETWORK}" in
77+
mainnet|sepolia)
78+
echo "Besu minimal node with pre-merge history expiry"
79+
__prune="--snapsync-server-enabled"
80+
timestamp_file="/var/lib/besu/prune-history-timestamp.txt"
81+
if [[ -f "${timestamp_file}" ]]; then
82+
saved_ts=$(<"${timestamp_file}")
83+
current_ts=$(date +%s)
84+
diff=$((current_ts - saved_ts))
7985

80-
if (( diff >= 172800 )); then # 48 * 60 * 60 - 48 hours have passed
81-
rm -f "${timestamp_file}"
82-
else
83-
echo "Enabling RocksDB garbage collection after history prune. You should see Besu DB space usage go down."
84-
echo "This may take 6-12 hours. Eth Docker will keep RocksDB garbage collection on for 48 hours."
85-
__prune+=" --history-expiry-prune"
86+
if (( diff >= 172800 )); then # 48 * 60 * 60 - 48 hours have passed
87+
rm -f "${timestamp_file}"
88+
else
89+
echo "Enabling RocksDB garbage collection after history prune. You should see Besu DB space usage go down."
90+
echo "This may take 6-12 hours. Eth Docker will keep RocksDB garbage collection on for 48 hours."
91+
__prune+=" --history-expiry-prune"
92+
fi
8693
fi
87-
fi
88-
;;
89-
* )
90-
echo "There is no pre-merge history for ${NETWORK} network, EL_MINIMAL_NODE has no effect."
91-
__prune=""
92-
;;
93-
esac
94-
else
95-
echo "Besu full node without history expiry"
96-
__prune="--snapsync-synchronizer-pre-checkpoint-headers-only-enabled=false --snapsync-server-enabled"
97-
fi
94+
;;
95+
*)
96+
echo "There is no pre-merge history for ${NETWORK} network, \"pre-merge-expiry\" has no effect."
97+
__prune=""
98+
;;
99+
esac
100+
;;
101+
*)
102+
echo "ERROR: The node type ${NODE_TYPE} is not known to Eth Docker's Besu implementation."
103+
sleep 30
104+
exit 1
105+
;;
106+
esac
98107

99108
# New or old datadir
100109
if [[ -d /var/lib/besu-og/database ]]; then
@@ -116,7 +125,7 @@ set -- "${__args[@]}"
116125

117126
if [[ -f /var/lib/besu/prune-history-marker ]]; then
118127
rm -f /var/lib/besu/prune-history-marker
119-
if [[ "${ARCHIVE_NODE}" = "true" ]]; then
128+
if [[ "${NODE_TYPE}" = "archive" ]]; then
120129
echo "Besu is an archive node. Not attempting to prune history: Aborting."
121130
exit 1
122131
fi
@@ -127,7 +136,7 @@ if [[ -f /var/lib/besu/prune-history-marker ]]; then
127136
exec /opt/besu/bin/besu ${__datadir} ${__network} storage prune-pre-merge-blocks
128137
elif [[ -f /var/lib/besu/prune-marker ]]; then
129138
rm -f /var/lib/besu/prune-marker
130-
if [[ "${ARCHIVE_NODE}" = "true" ]]; then
139+
if [[ "${NODE_TYPE}" = "archive" ]]; then
131140
echo "Besu is an archive node. Not attempting to prune trie-logs: Aborting."
132141
exit 1
133142
fi

default.env

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -195,26 +195,22 @@ W3S_HEAP=
195195
# If left empty, the default in lodestar.yml will be used.
196196
LODESTAR_HEAP=
197197

198-
# Set this to true to sync an execution layer archive node instead of pruned
199-
# Caution that this may a) require a fresh sync and b) will
200-
# use a lot of disk - in the case of Geth >12TB, for example.
201-
EL_ARCHIVE_NODE=false
202-
# Set this to true to sync a consensus layer archive node instead of pruned
203-
# This may also keep all blobs, depending on client
204-
# For a more granular way to handle it, please use CL_EXTRAS instead
205-
CL_ARCHIVE_NODE=false
206-
# Set this to true to sync a minimal CL node - in use with Grandine and Teku, for example
207-
# CL_ARCHIVE_NODE must be false for this to take effect
208-
CL_MINIMAL_NODE=true
209-
# Set this to true to sync a node that does not carry all historical data, see EIP-4444
210-
# Only meaningful for mainnet and sepolia, may fail on hoodi
211-
# This expires pre-merge blocks and receipts as of June 2025, see https://hackmd.io/@hBXHLw_9Qq2va4pRtI4bIA/ryzBaf7fJx
198+
# CL_NODE_TYPE can be "archive", "full", "pruned" or "pruned-with-zkproofs"
199+
# "archive" may also keep all blobs, depending on client
200+
# Switching node type typically requires a resync
201+
# "pruned-with-zkproofs" is experimental and will not work with the standard client builds
202+
# For a more granular way to handle it, please use CL_EXTRAS in combination with "full"
203+
CL_NODE_TYPE=pruned
204+
# EL_NODE_TYPE can be "archive", "full", "pre-merge-expiry", "aggressive-expiry" or "rolling-expiry"
205+
# "pre-merge-expiry" is only meaningful for mainnet and sepolia, may fail on hoodi
206+
# Switching node type typically requires a resync
212207
# Consider using `./ethd prune-history`, which guides you as to whether to prune in-place
213208
# or resync, depending on client
214-
# Erigon also has an \"aggressive\" mode that prunes even more
215-
# EL_ARCHIVE_NODE must be false for this to take effect
216-
EL_MINIMAL_NODE=true
209+
# "aggressive-expiry" is supported with Erigon
210+
# "rolling-expiry" is a Nethermind feature, waiting for PR 2263 to do anything
211+
EL_NODE_TYPE=pre-merge-expiry
217212
# Era URLs, see https://eth-clients.github.io/history-endpoints/
213+
# Note that this will be replaced with EraE sometime 2026, possibly still Q1 2026
218214
# Era1 is for pre-merge data, Era for post-merge. If these URLs are
219215
# not empty, an EL that supports Era import will use them when fresh syncing
220216
# A network with pre-merge history can import Era1 and optionally also Era; one without
@@ -452,4 +448,4 @@ NODE_EXPORTER_IGNORE_MOUNT_REGEX='^/(dev|proc|sys|run|var/snap/.+|var/lib/docker
452448
DOCKER_ROOT=/var/lib/docker
453449

454450
# Used by ethd update - please do not adjust
455-
ENV_VERSION=47
451+
ENV_VERSION=48

erigon.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ services:
2424
environment:
2525
- JWT_SECRET=${JWT_SECRET}
2626
- EL_EXTRAS=${EL_EXTRAS:-}
27-
- ARCHIVE_NODE=${EL_ARCHIVE_NODE:-}
28-
- MINIMAL_NODE=${EL_MINIMAL_NODE:-}
27+
- NODE_TYPE=${EL_NODE_TYPE:-pre-merge-expiry}
28+
- CL_NODE_TYPE=${CL_NODE_TYPE:-pruned}
2929
- NETWORK=${NETWORK}
3030
- IPV6=${IPV6:-false}
3131
- COMPOSE_FILE=${COMPOSE_FILE}

erigon/docker-entrypoint.sh

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,37 @@ else
6767
__network="--chain ${NETWORK}"
6868
fi
6969

70-
if [[ "${ARCHIVE_NODE}" = "true" ]]; then
71-
echo "Erigon archive node without pruning"
72-
__prune="--prune.mode=archive --prune.distance=0"
73-
elif [[ "${MINIMAL_NODE}" = "aggressive" ]]; then
74-
echo "Erigon minimal node with aggressive expiry"
75-
__prune="--prune.mode=minimal --persist.receipts=false"
76-
elif [[ "${MINIMAL_NODE}" = "true" ]]; then
77-
case "${NETWORK}" in
78-
mainnet | sepolia )
79-
echo "Erigon minimal node with pre-merge history expiry"
80-
__prune="--prune.mode=full --persist.receipts=false"
81-
;;
82-
* )
83-
echo "There is no pre-merge history for ${NETWORK} network, Erigon will use \"full\" pruning."
84-
__prune="--prune.mode=full --persist.receipts=false"
85-
;;
86-
esac
87-
else
88-
echo "Erigon full node without history expiry"
89-
__prune="--prune.mode=blocks"
90-
fi
70+
case "${NODE_TYPE}" in
71+
archive)
72+
echo "Erigon archive node without pruning"
73+
__prune="--prune.mode=archive --prune.distance=0"
74+
;;
75+
full)
76+
echo "Erigon full node without history expiry"
77+
__prune="--prune.mode=blocks --prune.include-commitment-history"
78+
;;
79+
pre-merge-expiry)
80+
case "${NETWORK}" in
81+
mainnet|sepolia)
82+
echo "Erigon minimal node with pre-merge history expiry"
83+
__prune="--prune.mode=full --persist.receipts=false"
84+
;;
85+
*)
86+
echo "There is no pre-merge history for ${NETWORK} network, Erigon will use \"full\" pruning."
87+
__prune="--prune.mode=full --persist.receipts=false"
88+
;;
89+
esac
90+
;;
91+
aggressive-expiry)
92+
echo "Erigon minimal node with aggressive expiry"
93+
__prune="--prune.mode=minimal --persist.receipts=false"
94+
;;
95+
*)
96+
echo "ERROR: The node type ${NODE_TYPE} is not known to Eth Docker's Erigon implementation."
97+
sleep 30
98+
exit 1
99+
;;
100+
esac
91101

92102
__caplin=""
93103
# shellcheck disable=SC2076
@@ -104,7 +114,8 @@ else
104114
__caplin+=" --caplin.mev-relay-url=${MEV_NODE}"
105115
echo "MEV Boost enabled"
106116
fi
107-
if [[ "${ARCHIVE_NODE}" = "true" ]]; then
117+
if [[ "${CL_NODE_TYPE}" = "archive" ]]; then
118+
echo "Running Caplin archive node"
108119
__caplin+=" --caplin.states-archive=true --caplin.blobs-archive=true --caplin.blobs-no-pruning=true --caplin.blocks-archive=true"
109120
fi
110121
if [[ -n "${CHECKPOINT_SYNC_URL}" ]]; then

0 commit comments

Comments
 (0)