Skip to content

Commit

Permalink
More resilient checkpoint sync for Lodestar and Nimbus; configurable …
Browse files Browse the repository at this point in the history
…mev-boost target
  • Loading branch information
yorickdowne committed Sep 2, 2022
1 parent 68a0898 commit 5f4aa18
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 14 deletions.
2 changes: 2 additions & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ EL_NODE=http://execution:8551
# Consensus client address. This could be comma-separated for Lighthouse or Teku VC clients, with failover,
# or could just be a remote consensus client URL for "validator only" setups. Not in use for Nimbus.
CL_NODE=http://consensus:5052
# MEV-boost address. This would only be changed for Vouch setups
MEV_NODE=http://mev-boost:18550

# You can set specific version targets and choose binary or compiled from source builds below,
# via "Dockerfile.binary" or "Dockerfile.source"
Expand Down
1 change: 1 addition & 0 deletions lighthouse-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
- BEACON_STATS_API=${BEACON_STATS_API}
- BEACON_STATS_MACHINE=${BEACON_STATS_MACHINE}
- MALLOC_ARENA_MAX=4
Expand Down
1 change: 1 addition & 0 deletions lighthouse-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
- BEACON_STATS_API=${BEACON_STATS_API}
- BEACON_STATS_MACHINE=${BEACON_STATS_MACHINE}
- MALLOC_ARENA_MAX=4
Expand Down
2 changes: 1 addition & 1 deletion lighthouse/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi

# Check whether we should use MEV Boost
if [ "${MEV_BOOST}" = "true" ]; then
__mev_boost="--builder http://mev-boost:18550"
__mev_boost="--builder ${MEV_NODE:-http://mev-boost:18550}"
echo "MEV Boost enabled"
else
__mev_boost=""
Expand Down
1 change: 1 addition & 0 deletions lodestar-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
Expand Down
1 change: 1 addition & 0 deletions lodestar-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
Expand Down
16 changes: 9 additions & 7 deletions lodestar/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,26 @@ fi

# Check whether we should override TTD
if [ -n "${OVERRIDE_TTD}" ]; then
__override_ttd="--terminal-total-difficulty-override ${OVERRIDE_TTD}"
__override_ttd="--terminal-total-difficulty-override=${OVERRIDE_TTD}"
echo "Overriding TTD to ${OVERRIDE_TTD}"
else
__override_ttd=""
fi

# Check whether we should use MEV Boost
if [ "${MEV_BOOST}" = "true" ]; then
__mev_boost="--builder --builder.urls http://mev-boost:18550"
__mev_boost="--builder --builder.urls=${MEV_NODE:-http://mev-boost:18550}"
echo "MEV Boost enabled"
else
__mev_boost=""
fi

if [ -n "${RAPID_SYNC_URL:+x}" -a ! -f "/var/lib/lodestar/consensus/setupdone" ]; then
touch /var/lib/lodestar/consensus/setupdone
echo "Checkpoint sync enabled"
exec "$@" --checkpointSyncUrl=${RAPID_SYNC_URL} ${__mev_boost} ${__override_ttd}
# Check whether we should rapid sync
if [ -n "${RAPID_SYNC_URL}" ]; then
__rapid_sync="--checkpointSyncUrl=${RAPID_SYNC_URL}"
echo "Checkpoint sync enabled"
else
__rapid_sync=""
fi

exec "$@" ${__mev_boost} ${__override_ttd}
exec "$@" ${__mev_boost} ${__rapid_sync} ${__override_ttd}
1 change: 1 addition & 0 deletions nimbus-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
- DOPPELGANGER=${DOPPELGANGER}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
Expand Down
1 change: 1 addition & 0 deletions nimbus-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
Expand Down
6 changes: 3 additions & 3 deletions nimbus/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ else
fi

if [ -n "${RAPID_SYNC_URL:+x}" -a ! -f "/var/lib/nimbus/setupdone" ]; then
touch /var/lib/nimbus/setupdone
echo "Starting checkpoint sync. Nimbus will restart when done."
exec /usr/local/bin/nimbus_beacon_node trustedNodeSync --backfill=false --network=${NETWORK} --data-dir=/var/lib/nimbus --trusted-node-url=${RAPID_SYNC_URL} ${__override_ttd}
/usr/local/bin/nimbus_beacon_node trustedNodeSync --backfill=false --network=${NETWORK} --data-dir=/var/lib/nimbus --trusted-node-url=${RAPID_SYNC_URL} ${__override_ttd}
touch /var/lib/nimbus/setupdone
fi

# Check whether we should use MEV Boost
if [ "${MEV_BOOST}" = "true" ]; then
__mev_boost="--payload-builder=true --payload-builder-url=http://mev-boost:18550"
__mev_boost="--payload-builder=true --payload-builder-url=${MEV_NODE:-http://mev-boost:18550}"
echo "MEV Boost enabled"
else
__mev_boost=""
Expand Down
1 change: 1 addition & 0 deletions prysm-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
ports:
- ${HOST_IP:-0.0.0.0}:${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
Expand Down
1 change: 1 addition & 0 deletions prysm-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
ports:
- ${HOST_IP:-0.0.0.0}:${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
Expand Down
2 changes: 1 addition & 1 deletion prysm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi

# Check whether we should use MEV Boost
if [ "${MEV_BOOST}" = "true" ]; then
__mev_boost="--http-mev-relay=http://mev-boost:18550"
__mev_boost="--http-mev-relay=${MEV_NODE:-http://mev-boost:18550}"
echo "MEV Boost enabled"
else
__mev_boost=""
Expand Down
1 change: 1 addition & 0 deletions teku-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
- BEACON_STATS_API=${BEACON_STATS_API}
- BEACON_STATS_MACHINE=${BEACON_STATS_MACHINE}
ports:
Expand Down
1 change: 1 addition & 0 deletions teku-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- JWT_SECRET=${JWT_SECRET}
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
- MEV_NODE=${MEV_NODE}
- BEACON_STATS_API=${BEACON_STATS_API}
- BEACON_STATS_MACHINE=${BEACON_STATS_MACHINE}
ports:
Expand Down
4 changes: 2 additions & 2 deletions teku/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

# Check whether we should rapid sync
if [ -n "${RAPID_SYNC_URL:+x}" ]; then
__rapid_sync="--initial-state=${RAPID_SYNC_URL}/eth/v2/debug/beacon/states/finalized"
__rapid_sync="--initial-state=${RAPID_SYNC_URL}"
echo "Checkpoint sync enabled"
else
__rapid_sync=""
Expand All @@ -43,7 +43,7 @@ fi

# Check whether we should use MEV Boost
if [ "${MEV_BOOST}" = "true" ]; then
__mev_boost="--validators-builder-registration-default-enabled --builder-endpoint=http://mev-boost:18550"
__mev_boost="--validators-builder-registration-default-enabled --builder-endpoint=${MEV_NODE:-http://mev-boost:18550}"
echo "MEV Boost enabled"
else
__mev_boost=""
Expand Down

0 comments on commit 5f4aa18

Please sign in to comment.