Skip to content

Commit

Permalink
Fix checkpoint sync query in ethd config (#1668)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Dec 13, 2023
1 parent 985cf12 commit 0e6b218
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Eth Docker uses a "semver-ish" scheme.
large.
- Second through fourth digit, [semver](https://semver.org/).

This is Eth Docker v2.3.12.0
This is Eth Docker v2.4.0.0
27 changes: 20 additions & 7 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -2247,6 +2247,8 @@ terminate() {


query_network() {
var="NETWORK"
__prev_network=$(sed -n -e "s/^${var}=\(.*\)/\1/p" "${ENV_FILE}" || true)
NETWORK=$(whiptail --notags --title "Select Network" --menu \
"Which network do you want to run on?" 13 65 6 \
"holesky" "Holešovice Testnet" \
Expand Down Expand Up @@ -2280,6 +2282,11 @@ screen.\n\nCustom testnets only work with a URL to fetch their configuration fro
done
;;
esac
if [ ! "${NETWORK}" = "${__prev_network}" ]; then
__network_change=1
else
__network_change=0
fi
}


Expand Down Expand Up @@ -2524,8 +2531,12 @@ consensus client? (right-click to paste)" 10 60 "${REMOTE_BEACON}" 3>&1 1>&2 2>&


query_checkpoint_beacon() {
var="RAPID_SYNC_URL"
RAPID_SYNC_URL=$(sed -n -e "s/^${var}=\(.*\)/\1/p" "${ENV_FILE}" || true)
if [ "${__minty_fresh}" -eq 1 ] || [ "${__network_change}" -eq 1 ]; then
RAPID_SYNC_URL=""
else
var="RAPID_SYNC_URL"
RAPID_SYNC_URL=$(sed -n -e "s/^${var}=\(.*\)/\1/p" "${ENV_FILE}" || true)
fi
if [ -z "${RAPID_SYNC_URL}" ]; then
case "${NETWORK}" in
"sepolia")
Expand All @@ -2549,10 +2560,10 @@ query_checkpoint_beacon() {
esac
fi

RAPID_SYNC_URL=$(whiptail --title "Configure checkpoint URL" --inputbox "What is the URL for your checkpoint \
provider? (right-click to paste)" 10 65 "${RAPID_SYNC_URL}" 3>&1 1>&2 2>&3)
RAPID_SYNC_URL=$(whiptail --title "Configure CL checkpoint sync URL" --inputbox "What is the URL for your CL \
checkpoint sync provider? (right-click to paste)" 10 65 "${RAPID_SYNC_URL}" 3>&1 1>&2 2>&3)

echo "Your checkpoint URL is:" "${RAPID_SYNC_URL}"
echo "Your checkpoint sync URL is:" "${RAPID_SYNC_URL}"
}


Expand All @@ -2568,9 +2579,11 @@ query_graffiti() {


query_rapid_sync() {
if (whiptail --title "Checkpoint Sync" --yesno "Do you want to use CL rapid sync with remote checkpoint?" 10 65) then
query_checkpoint_beacon
if [[ "${NETWORK}" =~ ^https?:// ]]; then
RAPID_SYNC_URL=""
return
fi
query_checkpoint_beacon
}


Expand Down
3 changes: 0 additions & 3 deletions nimbus-el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ services:
- --engine-api
- --engine-api-port=${EE_PORT:-8551}
- --engine-api-address=0.0.0.0
- --engine-api-ws
- --engine-api-ws-port=8552
- --engine-api-ws-address=0.0.0.0
- --max-peers=${EL_MAX_PEER_COUNT:-25}
- --log-level=${LOG_LEVEL}
labels:
Expand Down
8 changes: 3 additions & 5 deletions teku/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ fi
if [ -n "${RAPID_SYNC_URL:+x}" ]; then
if [ "${ARCHIVE_NODE}" = "true" ]; then
echo "Teku archive node cannot use checkpoint sync: Syncing from genesis."
__rapid_sync=""
__rapid_sync="--ignore-weak-subjectivity-period-enabled=true"
else
__rapid_sync="--checkpoint-sync-url=${RAPID_SYNC_URL}"
echo "Checkpoint sync enabled"
fi
else
__rapid_sync=""
__rapid_sync="--ignore-weak-subjectivity-period-enabled=true"
fi

if [[ "${NETWORK}" =~ ^https?:// ]]; then
Expand All @@ -69,9 +69,7 @@ if [[ "${NETWORK}" =~ ^https?:// ]]; then
fi
bootnodes="$(paste -s -d, "/var/lib/teku/testnet/${config_dir}/bootstrap_nodes.txt")"
set +e
if [ -z "${__rapid_sync}" ]; then
__rapid_sync="--initial-state=/var/lib/teku/testnet/${config_dir}/genesis.ssz"
fi
__rapid_sync="--initial-state=/var/lib/teku/testnet/${config_dir}/genesis.ssz --ignore-weak-subjectivity-period-enabled=true"
__network="--network=/var/lib/teku/testnet/${config_dir}/config.yaml --p2p-discovery-bootnodes=${bootnodes} \
--data-storage-non-canonical-blocks-enabled=true --Xlog-include-p2p-warnings-enabled \
--metrics-block-timing-tracking-enabled --Xmetrics-blob-sidecars-storage-enabled=true --Xtrusted-setup=/var/lib/teku/testnet/${config_dir}/trusted_setup.txt \
Expand Down

0 comments on commit 0e6b218

Please sign in to comment.