From dee517a57f3ca2a19bc6e24d63fedfc71139bdda Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 24 Jul 2024 14:58:57 +1000 Subject: [PATCH 1/3] Update progress.sh Misc tweaks from banging my head. --- progress.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/progress.sh b/progress.sh index a89d209..f9c31ac 100755 --- a/progress.sh +++ b/progress.sh @@ -1,14 +1,18 @@ #!/bin/bash +set -eu + # Load Environment Variables if [ -f .env ]; then export $(cat .env | grep -v '#' | sed 's/\r$//' | awk '/=/ {print $1}' ) fi export ETH_RPC_URL=http://localhost:${PORT__OP_GETH_HTTP:-9993} +# Cast is provided by Foundry: https://getfoundry.sh/. +# Run `pnpm install:foundry` in the optimism repo root. CHAIN_ID=`cast chain-id` echo Chain ID: $CHAIN_ID -echo Please wait +echo Sampling, please wait if [ $CHAIN_ID -eq 10 ]; then L2_URL=https://mainnet.optimism.io @@ -31,7 +35,7 @@ echo Blocks per minute: $PER_MIN if [ $PER_MIN -eq 0 ]; then - echo Not synching + echo Not syncing exit; fi From ef8e00bc28ca71bd95776b81ff6e2277db06aa5d Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 24 Jul 2024 14:57:34 +1000 Subject: [PATCH 2/3] Fix zero progress being treated as failure --- progress.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/progress.sh b/progress.sh index f9c31ac..78fdc63 100755 --- a/progress.sh +++ b/progress.sh @@ -29,8 +29,8 @@ if [ $CHAIN_ID -eq 11155420 ]; then fi T0=`cast block-number --rpc-url $ETH_RPC_URL` ; sleep 10 ; T1=`cast block-number --rpc-url $ETH_RPC_URL` -PER_MIN=`expr $T1 - $T0` -PER_MIN=`expr $PER_MIN \* 6` +PER_MIN=$(($T1 - $T0)) +PER_MIN=$(($PER_MIN * 6)) echo Blocks per minute: $PER_MIN From 615485dae55ad230f575a77f3e719f3818c5e7e6 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 24 Jul 2024 14:58:12 +1000 Subject: [PATCH 3/3] Remove shutdown chain --- progress.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/progress.sh b/progress.sh index 78fdc63..1e33b23 100755 --- a/progress.sh +++ b/progress.sh @@ -18,12 +18,6 @@ if [ $CHAIN_ID -eq 10 ]; then L2_URL=https://mainnet.optimism.io fi - -if [ $CHAIN_ID -eq 420 ]; then - L2_URL=https://goerli.optimism.io -fi - - if [ $CHAIN_ID -eq 11155420 ]; then L2_URL=https://sepolia.optimism.io fi