feat: make l1 funding amount configurable #611
Workflow file for this run
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
--- | |
name: deploy | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
concurrency: | |
group: deploy-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
CHECK_VERIFIED_BATCHES_TIMEOUT_MINUTES: 10 | |
GO_VERSION: "1.21" | |
jobs: | |
# Deploy the CDK environment in one step, with the gas token feature enabled. | |
monolithic_cdk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache-dependency-path: scripts/zkevm-config-diff/go.sum | |
# Install tools. | |
- name: Install kurtosis | |
run: | | |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list | |
sudo apt update | |
sudo apt install kurtosis-cli | |
kurtosis analytics disable | |
- name: Install yq | |
run: pip3 install yq | |
- name: Install foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
# Deploy components. | |
- name: Enable gas token feature | |
run: yq -Y --in-place '.args.zkevm_use_gas_token_contract = true' params.yml | |
- name: Deploy Kurtosis CDK package | |
run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . | |
- name: Check that batches are being verified | |
run: | | |
timeout_minutes="${CHECK_VERIFIED_BATCHES_TIMEOUT_MINUTES}" | |
start_time=$(date +%s) | |
end_time=$((start_time + timeout_minutes*60)) | |
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" | |
while true; do | |
current_time=$(date +%s) | |
if (( current_time > end_time )); then | |
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." | |
exit 1 | |
fi | |
verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) | |
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" | |
if (( verified_batches > 5 )); then | |
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... At least five batches were verified." | |
exit 0 | |
fi | |
sleep 10 | |
done | |
# Compare configs. | |
- name: Dump configs | |
working-directory: ./scripts/zkevm-config-diff | |
run: | | |
mkdir -p default-configs kurtosis-cdk-configs | |
sh zkevm_config.sh dump default ./default-configs | |
echo | |
sh zkevm_config.sh dump kurtosis-cdk ./kurtosis-cdk-configs | |
- name: Compare configs | |
working-directory: ./scripts/zkevm-config-diff | |
run: sh zkevm_config.sh compare configs ./default-configs ./kurtosis-cdk-configs | |
- name: Diff configs | |
working-directory: ./scripts/zkevm-config-diff | |
run: diff -r ./default-configs ./kurtosis-cdk-configs || true | |
# Deploy the CDK environment incrementally, stage by stage. | |
incremental_cdk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache-dependency-path: scripts/zkevm-config-diff/go.sum | |
# Install tools. | |
- name: Install kurtosis | |
run: | | |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list | |
sudo apt update | |
sudo apt install kurtosis-cli | |
kurtosis analytics disable | |
- name: Install yq | |
run: pip3 install yq | |
- name: Install foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
# Deploy components. | |
- name: Disable All Deployment Steps | |
run: | | |
yq -Y --in-place '.deploy_l1 = false' params.yml | |
yq -Y --in-place '.deploy_zkevm_contracts_on_l1 = false' params.yml | |
yq -Y --in-place '.deploy_databases = false' params.yml | |
yq -Y --in-place '.deploy_cdk_central_environment = false' params.yml | |
yq -Y --in-place '.deploy_cdk_bridge_infra = false' params.yml | |
yq -Y --in-place '.deploy_zkevm_permissionless_node = false' params.yml | |
yq -Y --in-place '.deploy_observability = false' params.yml | |
- name: Deploy L1 | |
run: | | |
yq -Y --in-place '.deploy_l1 = true' params.yml | |
kurtosis run --enclave cdk-v1 --args-file params.yml . | |
yq -Y --in-place '.deploy_l1 = false' params.yml # reset | |
- name: Deploy ZkEVM Contracts on L1 | |
run: | | |
yq -Y --in-place '.deploy_zkevm_contracts_on_l1 = true' params.yml | |
kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . | |
yq -Y --in-place '.deploy_zkevm_contracts_on_l1 = false' params.yml # reset | |
- name: Deploy ZkEVM Node and CDK Peripheral Databases | |
run: | | |
yq -Y --in-place '.deploy_databases = true' params.yml | |
kurtosis run --enclave cdk-v1 --args-file params.yml . | |
yq -Y --in-place '.deploy_databases = false' params.yml # reset | |
- name: Deploy CDK Central Environment | |
run: | | |
yq -Y --in-place '.deploy_cdk_central_environment = true' params.yml | |
kurtosis run --enclave cdk-v1 --args-file params.yml . | |
yq -Y --in-place '.deploy_cdk_central_environment = false' params.yml # reset | |
- name: Deploy CDK Bridge Infrastructure | |
run: | | |
yq -Y --in-place '.deploy_cdk_bridge_infra = true' params.yml | |
kurtosis run --enclave cdk-v1 --args-file params.yml . | |
yq -Y --in-place '.deploy_cdk_bridge_infra = false' params.yml # reset | |
- name: Deploy ZkEVM Permissionless Node | |
run: | | |
yq -Y --in-place '.deploy_zkevm_permissionless_node = true' params.yml | |
kurtosis run --enclave cdk-v1 --args-file params.yml . | |
yq -Y --in-place '.deploy_zkevm_permissionless_node = false' params.yml # reset | |
- name: Deploy Observability Stack | |
run: | | |
yq -Y --in-place '.deploy_observability = true' params.yml | |
kurtosis run --enclave cdk-v1 --args-file params.yml . | |
yq -Y --in-place '.deploy_observability = false' params.yml # reset | |
- name: Check that batches are being verified | |
run: | | |
timeout_minutes="${CHECK_VERIFIED_BATCHES_TIMEOUT_MINUTES}" | |
start_time=$(date +%s) | |
end_time=$((start_time + timeout_minutes*60)) | |
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" | |
while true; do | |
current_time=$(date +%s) | |
if (( current_time > end_time )); then | |
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." | |
exit 1 | |
fi | |
verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) | |
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" | |
if (( verified_batches > 5 )); then | |
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... At least five batches were verified." | |
exit 0 | |
fi | |
sleep 10 | |
done | |
# Compare configs. | |
- name: Dump configs | |
working-directory: scripts/zkevm-config-diff | |
run: | | |
mkdir default-configs kurtosis-cdk-configs | |
sh zkevm_config.sh dump default ./default-configs | |
echo | |
sh zkevm_config.sh dump kurtosis-cdk ./kurtosis-cdk-configs | |
- name: Compare configs | |
working-directory: scripts/zkevm-config-diff | |
run: sh zkevm_config.sh compare configs ./default-configs ./kurtosis-cdk-configs | |
- name: Diff configs | |
working-directory: scripts/zkevm-config-diff | |
run: diff -r ./default-configs ./kurtosis-cdk-configs || true |