Skip to content

Commit

Permalink
Merge pull request #193 from 0xPolygon/vcastellm/use-cdk
Browse files Browse the repository at this point in the history
feat: use cdk repo for erigon sequencer
  • Loading branch information
leovct committed Aug 6, 2024
2 parents 49c5c53 + cee1712 commit 6d3b4fe
Show file tree
Hide file tree
Showing 21 changed files with 357 additions and 298 deletions.
6 changes: 5 additions & 1 deletion .github/actions/monitor-cdk-verified-batches/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ inputs:
description: The script timeout in seconds
required: false
default: '600' # 10 minutes
rpc_service:
description: The RPC service to use
required: false
default: 'cdk-erigon-node-001'

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 }}
run: ./batch_verification_monitor.sh ${{ inputs.verified_batches_target }} ${{ inputs.timeout }} ${{ inputs.rpc_service }}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ while true; do
--legacy \
--rpc-url "$rpc_url" \
--private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" \
--gas-limit 643528 \
--gas-limit 100_000 \
--create 0x600160015B810190630000000456 \
>/dev/null 2>&1

Expand Down
9 changes: 8 additions & 1 deletion .github/actions/setup-kurtosis-cdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ inputs:
kurtosis-version:
description: The version of kurtosis
required: false
default: '0.90.1' # https://github.com/kurtosis-tech/kurtosis/releases
default: '1.0.0' # https://github.com/kurtosis-tech/kurtosis/releases

runs:
using: "composite"
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Install kurtosis
shell: bash
run: |
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
jobs:
# Basic deployment workflow.
# Note that more advanced use cases are tested in the nightly workflow.
deploy:
deploy-cdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -22,7 +22,25 @@ jobs:
uses: ./.github/actions/setup-kurtosis-cdk

- name: Deploy Kurtosis CDK package
run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .
run: |
kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{apply_workload: true}'
- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches

deploy-zkevm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Kurtosis CDK tools
uses: ./.github/actions/setup-kurtosis-cdk

- name: Deploy Kurtosis CDK package
run: |
kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{deploy_zkevm_permissionless_node: true, args: {sequencer_type: "zkevm"}, deploy_cdk_erigon_node: false, apply_workload: true}'
- name: Monitor verified batches
uses: ./.github/actions/monitor-cdk-verified-batches
with:
rpc_service: zkevm-node-rpc-001
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ kurtosis clean --all
kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .
```

The command above deploys a CDK stack using [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) as the sequencer. Alternatively, to launch a CDK stack using [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) as a sequencer, you can run the following command.

```bash
kurtosis run --enclave cdk-v1 --args-file cdk-erigon-sequencer-params.yml --image-download always .
```
The command above deploys a CDK stack using [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) as a sequencer.

Let's do a simple L2 RPC test call.

Expand All @@ -40,11 +36,7 @@ kurtosis enclave inspect cdk-v1
That output, while quite useful, might also be a little overwhelming. If you want to simply see the port mapping within the `cdk-v1` enclave for the `zkevm-node-rpc` service and the `trusted-rpc` port, you can use the following command. For this test, let's store the RPC URL in an environment variable:

```bash
# if zkevm-node is the sequencer
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"

# if cdk-erigon is the sequencer
export ETH_RPC_URL="$(kurtosis port print cdk-v1 cdk-erigon-sequencer-001 rpc)"
export ETH_RPC_URL="$(kurtosis port print cdk-v1 cdk-erigon-node-001 http-rpc)"
```

That is the same environment variable that `cast` uses, so you should now be able to run this command. Note that the steps below will assume you have the [Foundry toolchain](https://book.getfoundry.sh/getting-started/installation) installed.
Expand Down
184 changes: 0 additions & 184 deletions cdk-erigon-sequencer-params.yml

This file was deleted.

Loading

0 comments on commit 6d3b4fe

Please sign in to comment.