From e523be04e67afad59d941d94d3be9440d20f7431 Mon Sep 17 00:00:00 2001 From: Yorick Downe Date: Fri, 4 Aug 2023 02:08:38 +0000 Subject: [PATCH] Handle archive/pruning and PBSS --- geth/docker-entrypoint.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/geth/docker-entrypoint.sh b/geth/docker-entrypoint.sh index c4406d8f..ad0a702f 100755 --- a/geth/docker-entrypoint.sh +++ b/geth/docker-entrypoint.sh @@ -60,8 +60,14 @@ fi if [ -d "/var/lib/goethereum/geth/chaindata/" ]; then __pbss="" else - echo "Choosing PBSS for fresh sync" - __pbss="--state.scheme path" + if [ "${ARCHIVE_NODE}" = "true" ]; then + echo "Geth is an archive node. Syncing without PBSS." + _pbss="" + else + echo "Choosing PBSS for fresh sync" + __pbss="--state.scheme path" + touch /var/lib/goethereum/is-pbss + fi fi if [ -f /var/lib/goethereum/prune-marker ]; then @@ -70,6 +76,10 @@ if [ -f /var/lib/goethereum/prune-marker ]; then echo "Geth is an archive node. Not attempting to prune: Aborting." exit 1 fi + if [ -f /var/lib/goethereum/is-pbss ]; then + echo "Geth is using PBSS. Pruning is neither needed nor supported. Aborting." + exit 1 + fi # Word splitting is desired for the command line parameters # shellcheck disable=SC2086 exec "$@" ${EL_EXTRAS} snapshot prune-state