diff --git a/scripts/upgrade_forkid.sh b/scripts/upgrade_forkid.sh index 1ff0effa2..9563d3890 100755 --- a/scripts/upgrade_forkid.sh +++ b/scripts/upgrade_forkid.sh @@ -50,7 +50,7 @@ sed -ni '/cdk_erigon_node_image/!p' "$KURTOSIS_CONFIG" echo " cdk_erigon_node_image: $ERIGON_IMAGE" >> "$KURTOSIS_CONFIG" # DEPLOY STACK -kurtosis run --enclave "$STACK_NAME" --args-file $KURTOSIS_CONFIG . +kurtosis run --enclave "$STACK_NAME" --args-file "$KURTOSIS_CONFIG" . # SERVICE NAMES SVC_SEQUENCER=cdk-erigon-sequencer-001 @@ -176,7 +176,7 @@ kurtosis service exec "$STACK_NAME" $SVC_CONTRACTS \ # Verify forkid on chain echo "Checking on chain forkid..." FORKID_ON_CHAIN=$(kurtosis service exec "$STACK_NAME" $SVC_CONTRACTS ". /opt/commands.sh && cast call \$ROLLUP_MAN \"rollupIDToRollupData(uint32)(address,uint64,address,uint64,bytes32,uint64,uint64,uint64,uint64,uint64,uint64,uint8)\" 1 | head -4 | tail -1" | tail -2 | head -1) -if [ "$FORKID_ON_CHAIN" -ne $TARGET_FORKID ]; then +if [ "$FORKID_ON_CHAIN" -ne "$TARGET_FORKID" ]; then echo "KO: Forkid not updated on chain!" exit 1 else @@ -194,7 +194,7 @@ kurtosis service start "$STACK_NAME" $SVC_SEQUENCER # Wait for sequencer to become responsive echo "Waiting for Sequencer's rpc port to become available" -until cast rpc --json --rpc-url $(kurtosis port print "$STACK_NAME" $SVC_SEQUENCER rpc) zkevm_getForkId &> /dev/null; do +until cast rpc --json --rpc-url $(kurtosis port print "$STACK_NAME" "$SVC_SEQUENCER" rpc) zkevm_getForkId &> /dev/null; do printf '.' sleep 3 done @@ -203,7 +203,7 @@ echo # Check forkid on Sequencer FORKID=$SOURCE_FORKID while [ "$FORKID" -ne "$TARGET_FORKID" ]; do - FORKID=$(printf "%d" $(cast rpc --json --rpc-url $(kurtosis port print "$STACK_NAME" $SVC_SEQUENCER rpc) zkevm_getForkId | jq -r)) + FORKID=$(printf "%d" $(cast rpc --json --rpc-url $(kurtosis port print "$STACK_NAME" "$SVC_SEQUENCER" rpc) zkevm_getForkId | jq -r)) echo "Current Sequencer forkid: $FORKID" sleep 3 done @@ -214,7 +214,7 @@ kurtosis service start "$STACK_NAME" $SVC_RPC # Wait for rpc to become responsive echo "Waiting for RPC's rpc port to become available" -until cast rpc --json --rpc-url $(kurtosis port print "$STACK_NAME" $SVC_RPC rpc) zkevm_getForkId &> /dev/null; do +until cast rpc --json --rpc-url $(kurtosis port print "$STACK_NAME" "$SVC_RPC" rpc) zkevm_getForkId &> /dev/null; do printf '.' sleep 3 done @@ -226,7 +226,7 @@ COUNTER=0 MAX_RETRIES=25 while [ "$FORKID" -ne "$TARGET_FORKID" ]; do ((COUNTER++)) - FORKID=$(printf "%d" $(cast rpc --json --rpc-url $(kurtosis port print "$STACK_NAME" $SVC_RPC rpc) zkevm_getForkId | jq -r)) + FORKID=$(printf "%d" $(cast rpc --json --rpc-url $(kurtosis port print "$STACK_NAME" "$SVC_RPC" rpc) zkevm_getForkId | jq -r)) echo "Current RPC forkid: $FORKID" if [[ $COUNTER -ge $MAX_RETRIES ]]; then FORKID=$TARGET_FORKID # To break the loop @@ -243,7 +243,7 @@ fi # clean up echo "Cleaning up deployed enclave..." -rm $KURTOSIS_CONFIG +rm "$KURTOSIS_CONFIG" kurtosis enclave stop "$STACK_NAME" kurtosis enclave rm "$STACK_NAME"