Skip to content

Commit

Permalink
Remove Block Timestamp Test
Browse files Browse the repository at this point in the history
- responses are coming from several nodes in different time zones and it is not predictable which we will receive
  • Loading branch information
twoshark committed Nov 15, 2023
1 parent 23828b9 commit d92f4b7
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions ops/verify-geth-endpoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,4 @@ if [ "$syncing" != "false" ]; then
exit 1
fi

## Check block timestamp
data='{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}'
response=$(curl -s -X POST -H "Content-Type: application/json" --data "$data" $URL)
echo "$response"
timestamp_hex=$(echo $response | jq -r '.result.timestamp' | sed 's/0x//')
timestamp=$((16#$timestamp_hex))
current_time=$(date +%s)

# Calculate the difference
current_time=$(date +%s)
echo "Current time: $current_time"
echo "Block timestamp: $timestamp"
difference=$(($current_time - $timestamp))
echo "Difference: $difference"

if [ $difference -gt $TIME_DIFF_THRESHOLD ]; then
echo "Block timestamp at $URL is not within $TIME_DIFF_THRESHOLD seconds of the wall clock time."
exit 1
fi

echo "RPC endpoint at $URL is healthy."

0 comments on commit d92f4b7

Please sign in to comment.