-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c4309e
commit 97addb4
Showing
4 changed files
with
60 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
name: monitor-cdk-verified-batches | ||
description: Check that batches are being verified in a CDK environment | ||
|
||
inputs: | ||
verified_batches_target: | ||
description: The minimum number of batches to be verified | ||
required: false | ||
default: '30' | ||
timeout: | ||
description: The script timeout in seconds | ||
required: false | ||
default: '600' # 10 minutes | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check that batches are being verified | ||
working-directory: .github/actions/monitor-cdk-verified-batches | ||
shell: bash | ||
run: ./batch_verification_monitor.sh ${{ inputs.verified_batches_target }} ${{ inputs.timeout }} |
32 changes: 32 additions & 0 deletions
32
.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh
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,32 @@ | ||
#!/bin/bash | ||
|
||
# This script monitors the verification progress of zkEVM batches. | ||
# Usage: ./batch_verification_monitor <verified_batches_target> <timeout> | ||
|
||
# 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" | ||
|
||
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 |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ dist | |
|
||
test/gethData | ||
test/coverage.out | ||
coverage.out |