Skip to content

Commit

Permalink
ci: update ci checks
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Jun 6, 2024
1 parent 92447c1 commit fab0fae
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 10 deletions.
7 changes: 5 additions & 2 deletions .github/actions/monitor-cdk-verified-batches/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: monitor-cdk-verified-batches
description: Check that batches are being verified in a CDK environment

inputs:
verified_batches_target:
rpc-url:
description: The RPC URL
required: true
verified-batches-target:
description: The minimum number of batches to be verified
required: false
default: '30'
Expand All @@ -18,4 +21,4 @@ runs:
- 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 }}
run: ./batch_verification_monitor.sh ${{ inputs.rpc-url }} ${{ inputs.verified-batches-target }} ${{ inputs.timeout }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
# This script monitors the verification progress of zkEVM batches.
# Usage: ./batch_verification_monitor <verified_batches_target> <timeout>

# The RPC URL
rpc_url="$1"

# The number of batches to be verified.
verified_batches_target="$1"
verified_batches_target="$2"

# The script timeout (in seconds).
timeout="$2"
timeout="$3"

start_time=$(date +%s)
end_time=$((start_time + timeout))

rpc_url="$(kurtosis port print cdk-v1 zkevm-node-rpc-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"
Expand Down
64 changes: 59 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ jobs:
- name: Deploy Kurtosis CDK package
run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .

- name: Get zkevm node rpc url
id: rpc-url
run: echo "::set-output name=url::$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"

- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc-url: ${{ steps.rpc-url.outputs.url }}

# Compare configs.
- name: Dump configs
Expand Down Expand Up @@ -146,8 +152,14 @@ jobs:
kurtosis run --enclave cdk-v1 --args-file params.yml .
yq -Y --in-place '.apply_workload = false' params.yml # reset
- name: Get zkevm node rpc url
id: rpc-url
run: echo "::set-output name=url::$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"

- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc-url: ${{ steps.rpc-url.outputs.url }}


# Deploy the CDK environment without specifying any parameter file.
Expand All @@ -160,12 +172,17 @@ jobs:
- name: Install Kurtosis CDK tools
uses: ./.github/actions/setup-kurtosis-cdk

# Deploy components.
- name: Deploy Kurtosis CDK package
run: kurtosis run --enclave cdk-v1 --image-download always .

- name: Get zkevm node rpc url
id: rpc-url
run: echo "::set-output name=url::$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"

- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc-url: ${{ steps.rpc-url.outputs.url }}

# Deploy the CDK environment with the gas token feature enabled.
gas-token:
Expand All @@ -183,8 +200,14 @@ jobs:
- name: Deploy Kurtosis CDK package
run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .

- name: Get zkevm node rpc url
id: rpc-url
run: echo "::set-output name=url::$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"

- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc-url: ${{ steps.rpc-url.outputs.url }}

# Deploy the CDK environment against a local l1 chain with pre-deployed zkevm contracts.
pre-deployed-contracts:
Expand Down Expand Up @@ -225,8 +248,14 @@ jobs:
yq -Y --in-place '(.deploy_l1 = false) | (.deploy_zkevm_contracts_on_l1 = false) | (.deploy_databases = true) | (.deploy_cdk_central_environment = true) | (.deploy_cdk_bridge_infra = true)' params.yml
kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .
- name: Get zkevm node rpc url
id: rpc-url
run: echo "::set-output name=url::$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"

- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc-url: ${{ steps.rpc-url.outputs.url }}

# Deploy a standalone permisionless node against Sepolia.
permisionless-node:
Expand Down Expand Up @@ -260,10 +289,14 @@ jobs:
kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .
- name: Monitor the state of the RPC
run: |
cast rpc eth_syncing --rpc-url $(kurtosis port print cdk-v1 zkevm-node-rpc-pless-001 http-rpc)
cast block-number --rpc-url $(kurtosis port print cdk-v1 zkevm-node-rpc-pless-001 http-rpc)
- name: Get zkevm permissionless node rpc url
id: rpc-url
run: echo "::set-output name=url::$(kurtosis port print cdk-v1 zkevm-node-rpc-pless-rpc-001 rpc)"

- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc-url: ${{ steps.rpc-url.outputs.url }}

# Deploy a standalone cdk-erigon rpc node against Sepolia.
cdk-erigon-rpc:
Expand Down Expand Up @@ -301,6 +334,15 @@ jobs:
cast rpc eth_syncing --rpc-url $(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc) | jq
cast block-number --rpc-url $(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc)
- name: Get cdk-erigon rpc url
id: rpc-url
run: echo "::set-output name=url::$(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc)"

- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc-url: ${{ steps.rpc-url.outputs.url }}

# Deploy the CDK environment in rollup mode (data availability).
rollup-da-mode:
needs: authorize
Expand All @@ -317,8 +359,14 @@ jobs:
- name: Deploy Kurtosis CDK package
run: kurtosis run --enclave cdk-v1 --image-download always .

- name: Get zkevm node rpc url
id: rpc-url
run: echo "::set-output name=url::$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"

- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc-url: ${{ steps.rpc-url.outputs.url }}

# Deploy the CDK environment in cdk-validium mode (data availability).
cdk-validium-da-mode:
Expand All @@ -336,5 +384,11 @@ jobs:
- name: Deploy Kurtosis CDK package
run: kurtosis run --enclave cdk-v1 --image-download always .

- name: Get zkevm node rpc url
id: rpc-url
run: echo "::set-output name=url::$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"

- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc-url: ${{ steps.rpc-url.outputs.url }}

0 comments on commit fab0fae

Please sign in to comment.