Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove migrations #1897

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion erigon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ services:
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
- NETWORK=${NETWORK}
- IPV6=${IPV6:-false}
- DOCKER_TAG=${ERIGON_DOCKER_TAG:-latest}
- COMPOSE_FILE=${COMPOSE_FILE}
- CL_P2P_PORT=${CL_P2P_PORT:-9000}
- CL_REST_PORT=${CL_REST_PORT:-5052}
Expand Down
88 changes: 26 additions & 62 deletions erigon/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,73 +54,37 @@ else
__network="--chain ${NETWORK} --http.api web3,eth,net,engine"
fi

if [ "${ARCHIVE_NODE}" = "true" ]; then
echo "Erigon archive node without pruning"
__prune="--prune.mode=archive"
else
echo "Erigon full node with pruning"
__prune="--prune.mode=full"
fi

__caplin=""
__db_params=""
# Literal match intended
# shellcheck disable=SC2076
if [[ "${DOCKER_TAG}" =~ "2." || "${DOCKER_TAG}" = "latest" ]]; then
# Check for network, and set prune accordingly
if [ "${ARCHIVE_NODE}" = "true" ]; then
echo "Erigon archive node without pruning"
__prune=""
else
if [[ "${NETWORK}" = "mainnet" ]]; then
echo "mainnet: Running with prune.r.before=11052984 for eth deposit contract"
__prune="--prune=htc --prune.r.before=11052984"
elif [[ "${NETWORK}" = "goerli" ]]; then
echo "goerli: Running with prune.r.before=4367322 for eth deposit contract"
__prune="--prune=htc --prune.r.before=4367322"
elif [[ "${NETWORK}" = "sepolia" ]]; then
echo "sepolia: Running with prune.r.before=1273020 for eth deposit contract"
__prune="--prune=htc --prune.r.before=1273020"
elif [[ "${NETWORK}" = "gnosis" ]]; then
echo "gnosis: Running with prune.r.before=19469077 for gno deposit contract"
__prune="--prune=htc --prune.r.before=19469077"
elif [[ "${NETWORK}" = "holesky" ]]; then
echo "holesky: Running without prune.r for eth deposit contract"
__prune="--prune=htc"
elif [[ "${NETWORK}" =~ ^https?:// ]]; then
echo "Custom testnet: Running without prune.r for eth deposit contract"
__prune="--prune=htc"
else
echo "Unable to determine eth deposit contract, running without prune.r"
__prune="--prune=htc"
fi
if [[ "${COMPOSE_FILE}" =~ (prysm\.yml|prysm-cl-only\.yml|lighthouse\.yml|lighthouse-cl-only\.yml|lodestar\.yml| \
lodestar-cl-only\.yml|nimbus\.yml|nimbus-cl-only\.yml|nimbus-allin1\.yml|teku\.yml|teku-cl-only\.yml| \
teku-allin1\.yml|grandine\.yml|grandine-cl-only\.yml|grandine-allin1\.yml) ]]; then
__caplin="--externalcl=true"
else
echo "Running Erigon with internal Caplin consensus layer client"
__caplin="--caplin.discovery.addr=0.0.0.0 --caplin.discovery.port=${CL_P2P_PORT} --caplin.backfilling.blob=true"
__caplin+=" --caplin.discovery.tcpport=${CL_P2P_PORT} --caplin.backfilling=true --caplin.validator-monitor=true"
__caplin+=" --beacon.api=beacon,builder,config,debug,events,node,validator,lighthouse"
__caplin+=" --beacon.api.addr=0.0.0.0 --beacon.api.port=${CL_REST_PORT} --beacon.api.cors.allow-origins=*"
if [ "${MEV_BOOST}" = "true" ]; then
__caplin+=" --caplin.mev-relay-url=${MEV_NODE}"
fi
__db_params="--db.pagesize 16K --db.size.limit 8TB"
else # Erigon v3
if [ "${ARCHIVE_NODE}" = "true" ]; then
echo "Erigon archive node without pruning"
__prune="--prune.mode=archive"
else
echo "Erigon full node with pruning"
__prune="--prune.mode=full"
__caplin+=" --caplin.archive=true"
fi
if [[ "${COMPOSE_FILE}" =~ (prysm\.yml|prysm-cl-only\.yml|lighthouse\.yml|lighthouse-cl-only\.yml|lodestar\.yml| \
lodestar-cl-only\.yml|nimbus\.yml|nimbus-cl-only\.yml|nimbus-allin1\.yml|teku\.yml|teku-cl-only\.yml| \
teku-allin1\.yml|grandine\.yml|grandine-cl-only\.yml|grandine-allin1\.yml) ]]; then
__caplin="--externalcl=true"
if [ -n "${RAPID_SYNC_URL}" ]; then
__caplin+=" --caplin.checkpoint-sync-url=${RAPID_SYNC_URL}"
else
echo "Running Erigon with internal Caplin consensus layer client"
__caplin="--caplin.discovery.addr=0.0.0.0 --caplin.discovery.port=${CL_P2P_PORT} --caplin.backfilling.blob=true"
__caplin+=" --caplin.discovery.tcpport=${CL_P2P_PORT} --caplin.backfilling=true --caplin.validator-monitor=true"
__caplin+=" --beacon.api=beacon,builder,config,debug,events,node,validator,lighthouse"
__caplin+=" --beacon.api.addr=0.0.0.0 --beacon.api.port=${CL_REST_PORT} --beacon.api.cors.allow-origins=*"
if [ "${MEV_BOOST}" = "true" ]; then
__caplin+=" --caplin.mev-relay-url=${MEV_NODE}"
echo "MEV Boost enabled"
fi
if [ "${ARCHIVE_NODE}" = "true" ]; then
__caplin+=" --caplin.archive=true"
fi
if [ -n "${RAPID_SYNC_URL}" ]; then
__caplin+=" --caplin.checkpoint-sync-url=${RAPID_SYNC_URL}"
echo "Checkpoint sync enabled"
else
__caplin+=" --caplin.checkpoint-sync.disable=true"
fi
echo "Caplin parameters: ${__caplin}"
__caplin+=" --caplin.checkpoint-sync.disable=true"
fi
echo "Caplin parameters: ${__caplin}"
fi

if [ "${IPV6}" = "true" ]; then
Expand All @@ -132,4 +96,4 @@ fi

# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
exec "$@" ${__ipv6} ${__network} ${__prune} ${__db_params} ${__caplin} ${EL_EXTRAS}
exec "$@" ${__ipv6} ${__network} ${__prune} ${__caplin} ${EL_EXTRAS}
Loading
Loading