-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: do not depend on external testing scripts
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
# This script monitors the verification progress of zkEVM batches. | ||
|
||
# Check if the required arguments are provided. | ||
if [ "$#" -lt 2 ]; then | ||
echo "Usage: $0 <verified_batches_target> <timeout>" | ||
exit 1 | ||
fi | ||
|
||
# The number of batches to be verified. | ||
verified_batches_target="$1" | ||
|
||
# The script timeout (in seconds). | ||
timeout="$2" | ||
|
||
start_time=$(date +%s) | ||
end_time=$((start_time + timeout)) | ||
|
||
rpc_url="$(kurtosis port print cdk-v1 cdk-erigon-node-001 http-rpc)" | ||
|
||
while true; do | ||
verified_batches="$(cast to-dec "$(cast rpc --rpc-url "$rpc_url" zkevm_verifiedBatchNumber | sed 's/"//g')")" | ||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" | ||
|
||
# The aim is to take up some space in the batch, so that the number of batches actually increases during the test. | ||
cast send \ | ||
--legacy \ | ||
--rpc-url "$rpc_url" \ | ||
--private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" \ | ||
--gas-limit 100_000 \ | ||
--create 0x600160015B810190630000000456 \ | ||
>/dev/null 2>&1 | ||
|
||
current_time=$(date +%s) | ||
if ((current_time > end_time)); then | ||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached!" | ||
exit 1 | ||
fi | ||
|
||
if ((verified_batches > verified_batches_target)); then | ||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... $verified_batches batches were verified!" | ||
exit 0 | ||
fi | ||
|
||
sleep 10 | ||
done |