Skip to content

Commit

Permalink
Lint 1
Browse files Browse the repository at this point in the history
  • Loading branch information
xavier-romero committed Jan 17, 2025
1 parent 6d36f7f commit af0ec62
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/upgrade_forkid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"

Expand Down

0 comments on commit af0ec62

Please sign in to comment.