speedup with less errors

This commit is contained in:
Sebastian
2025-03-21 06:32:25 +01:00
parent d9c65cb01a
commit 003bcc7e7b
2 changed files with 26 additions and 9 deletions

View File

@@ -17,21 +17,23 @@ check_sync_status() {
local part=$1
result=$("$BASEPATH/sync-status.sh" "${part%.yml}")
code=0
if [ $? -ne 0 ]; then
if [[ "$result" == *"syncing"* ]]; then
# Allow exit status 1 if result contains "syncing"
return 0
code=0
elif [[ "$result" == *"lagging"* ]]; then
# Allow exit status 1 if result contains "lagging"
return 0
code=0
else
any_failure=true
return 1
code=1
fi
fi
echo "${part%.yml}: $result"
return 0
return "$code"
}
@@ -71,4 +73,4 @@ done
# If any invocation failed, return a failure exit code
if $any_failure; then
exit 1
fii
fi

View File

@@ -33,9 +33,24 @@ for path in $pathlist; do
if [ -n "$2" ]; then
ref="$2"
else
chain_id=$(curl --ipv4 -m 1 -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' $RPC_URL | jq -r '.result')
chain_id_decimal=$((16#${chain_id#0x}))
ref=$($BASEPATH/reference-rpc-endpoint.sh $chain_id_decimal)
chain_id_response=$(curl --ipv4 -m 1 -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' $RPC_URL)
if [ $? -eq 0 ]; then
chain_id=$(echo "$chain_id_response" | jq -r '.result' 2>/dev/null)
# echo "$RPC_URL: $chain_id"
if [[ "$chain_id" =~ ^0x[0-9a-fA-F]+$ ]]; then
chain_id_decimal=$((16#${chain_id#0x}))
ref=$($BASEPATH/reference-rpc-endpoint.sh $chain_id_decimal)
else
echo "error"
exit 1
fi
else
echo "error"
exit 1
fi
fi
# Call the health check script with RPC_URL and ref
@@ -44,5 +59,5 @@ for path in $pathlist; do
fi
done
echo "not found"
echo "unverified"
exit 1