-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: test integration of the op stack into our package * fix: typo * chore: nit * chore: nit * fix: typo * test * test: more progress (wip) * feat: enable to deploy op stack rollup * fix: make sure the op rollup is not deployed by default * ci: test op rollup deployment in ci * ci: run op rollup test * feat: customize op rollup and pin versions * feta: enable to customize op rollup args * ci: add debug verbosity in tests * chore: clean up * fix: typo * fix: typo * chore: print args * fix: typo * fix: typos * doc: nit * chore: pin version of op-batcher * ci: monitor op rollup block finalization * docs: nit * chore: rename script * fix: lint * fix: lint * ci: fix typo * feat: deploy deterministic proxy by default * fix: typo * chore: spin up a sequencer node and an rpc node for the op rollup stack * fix: lint * chore: switch back to the original op package * fix: typo (lol!!!)
- Loading branch information
Showing
12 changed files
with
278 additions
and
55 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
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,113 @@ | ||
#!/bin/bash | ||
|
||
# This script monitors the finality of OP rollup blocks. | ||
# TODO: Once we migrate the OP rollup into a type 1 zkEVM rollup, we'll be able to monitor the | ||
# verification of those blocks. | ||
|
||
# Function to display usage information. | ||
usage() { | ||
echo "Usage: $0 --enclave <ENCLAVE> --rpc-url <URL> --target <TARGET> --timeout <TIMEOUT>" | ||
echo " --enclave: The name of the Kurtosis enclave." | ||
echo " --cl-rpc-url: The consensus layer RPC URL to query." | ||
echo " --target: The target number of finalized blocks." | ||
echo " --timeout: The script timeout in seconds." | ||
exit 1 | ||
} | ||
|
||
# Initialize variables. | ||
enclave="" | ||
cl_rpc_url="" | ||
target="50" | ||
timeout="900" # 15 minutes. | ||
|
||
# Parse command line arguments | ||
while [[ $# -gt 0 ]]; do | ||
key="$1" | ||
case $key in | ||
--enclave) | ||
enclave="$2" | ||
shift 2 | ||
;; | ||
--cl-rpc-url) | ||
cl_rpc_url="$2" | ||
shift 2 | ||
;; | ||
--target) | ||
target="$2" | ||
shift 2 | ||
;; | ||
--timeout) | ||
timeout="$2" | ||
shift 2 | ||
;; | ||
*) | ||
echo "Error: unknown argument: $key" | ||
usage | ||
;; | ||
esac | ||
done | ||
|
||
# Check if the required argument is provided. | ||
if [ -z "$enclave" ]; then | ||
echo "Error: enclave name is required." | ||
usage | ||
fi | ||
|
||
if [ -z "$cl_rpc_url" ]; then | ||
echo "Error: cl rpc url is required." | ||
usage | ||
fi | ||
|
||
# Print script parameters for debug purposes. | ||
echo "Running script with values:" | ||
echo "- Enclave: $enclave" | ||
echo "- CL RPC URL: $cl_rpc_url" | ||
echo "- Target: $target" | ||
echo "- Timeout: $timeout" | ||
echo | ||
|
||
# Calculate the end time based on the current time and the specified timeout. | ||
start_time=$(date +%s) | ||
end_time=$((start_time + timeout)) | ||
|
||
# Main loop to monitor block finalization. | ||
while true; do | ||
# Check if there are any stopped services. | ||
stopped_services="$(kurtosis enclave inspect "$enclave" | grep STOPPED)" | ||
if [[ -n "$stopped_services" ]]; then | ||
echo "It looks like there is at least one stopped service in the enclave... Something must have halted..." | ||
echo "$stopped_services" | ||
echo | ||
|
||
kurtosis enclave inspect "$enclave" --full-uuids | grep STOPPED | awk '{print $2 "--" $1}' | | ||
while read -r container; do | ||
echo "Printing logs for $container" | ||
docker logs --tail 50 "$container" | ||
done | ||
exit 1 | ||
fi | ||
|
||
# Query the number of finalized blocks from the CL RPC URL. | ||
op_rollup_sync_status="$(cast rpc --rpc-url "$cl_rpc_url" optimism_syncStatus)" | ||
unsafe_l2_block_number="$(jq '.unsafe_l2.number' <<<"$op_rollup_sync_status")" | ||
safe_l2_block_number="$(jq '.safe_l2.number' <<<"$op_rollup_sync_status")" | ||
finalized_l2_block_number="$(jq '.finalized_l2.number' <<<"$op_rollup_sync_status")" | ||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Unsafe: $unsafe_l2_block_number, Safe: $safe_l2_block_number, Finalized: $finalized_l2_block_number" | ||
|
||
# Check if the finalized block target has been reached. | ||
if ((finalized_l2_block_number > target)); then | ||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... More than $target L2 blocks were finalized!" | ||
exit 0 | ||
fi | ||
|
||
# Check if the timeout has been reached. | ||
current_time=$(date +%s) | ||
if ((current_time > end_time)); then | ||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached!" | ||
exit 1 | ||
fi | ||
|
||
echo "Waiting a few seconds before the next iteration..." | ||
echo | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
deployment_stages: | ||
deploy_optimism_rollup: true | ||
|
||
optimism_package: | ||
chains: | ||
- participants: | ||
- el_type: op-geth | ||
cl_type: op-node | ||
- el_type: op-reth | ||
- el_type: op-erigon | ||
- el_type: op-nethermind | ||
|
||
args: | ||
verbosity: debug |
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,5 @@ | ||
deployment_stages: | ||
deploy_optimism_rollup: true | ||
|
||
args: | ||
verbosity: debug |
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
Oops, something went wrong.