From 612b6be676053b83345e840ff753b81176469a7c Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Fri, 14 Apr 2023 15:04:51 +0530 Subject: [PATCH] Avoid resetting genesis time in a lighthouse node on restart --- .../cerc-fixturenet-eth-lighthouse/run-cl.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/data/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh b/app/data/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh index 25b2268c..13e137fb 100755 --- a/app/data/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh +++ b/app/data/container-build/cerc-fixturenet-eth-lighthouse/run-cl.sh @@ -25,8 +25,12 @@ else cd /opt/testnet/cl if [ -z "$LIGHTHOUSE_GENESIS_STATE_URL" ]; then - # TODO Avoid on a restart - ./reset_genesis_time.sh + # Check if beacon node data exists to avoid resetting genesis time on a restart + if [ -d /opt/testnet/build/cl/node_"$NODE_NUMBER"/beacon ]; then + echo "Skipping genesis time reset" + else + ./reset_genesis_time.sh + fi else while [ 1 -eq 1 ]; do echo "Waiting on Genesis time ..."