From cb30cf80acd1a3b1db4246d2f3360ecfbf24f780 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Wed, 13 Nov 2024 14:06:13 +0400 Subject: [PATCH 1/9] feat: add simple kurtosis test for OP stack --- .../assets/kurtosis_op_network_params.yaml | 14 ++ .github/workflows/kurtosis-op.yml | 120 ++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 .github/assets/kurtosis_op_network_params.yaml create mode 100644 .github/workflows/kurtosis-op.yml diff --git a/.github/assets/kurtosis_op_network_params.yaml b/.github/assets/kurtosis_op_network_params.yaml new file mode 100644 index 000000000000..54e07f1d247f --- /dev/null +++ b/.github/assets/kurtosis_op_network_params.yaml @@ -0,0 +1,14 @@ +ethereum_package: + participants: + - el_type: reth + cl_type: lighthouse +optimism_package: + chains: + - participants: + - el_type: op-reth + cl_type: op-node + - el_type: op-geth + cl_type: op-node + batcher_params: + extra_params: + - "--throttle-interval=0" diff --git a/.github/workflows/kurtosis-op.yml b/.github/workflows/kurtosis-op.yml new file mode 100644 index 000000000000..cb9993e37c57 --- /dev/null +++ b/.github/workflows/kurtosis-op.yml @@ -0,0 +1,120 @@ +# Runs simple OP stack setup in Kurtosis + +name: kurtosis-op + +on: + workflow_dispatch: + merge_group: + schedule: + # every day + - cron: "0 1 * * *" + +env: + CARGO_TERM_COLOR: always + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + prepare-reth: + if: github.repository == 'paradigmxyz/reth' + timeout-minutes: 45 + runs-on: + group: Reth + steps: + - uses: actions/checkout@v4 + - run: mkdir artifacts + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - name: Build reth + run: | + cargo build --features optimism,asm-keccak --profile hivetests --bin op-reth --locked + mkdir dist && cp ./target/hivetests/op-reth ./dist/reth + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and export reth image + uses: docker/build-push-action@v6 + with: + context: . + file: .github/assets/hive/Dockerfile + tags: ghcr.io/paradigmxyz/op-reth:kurtosis-ci + outputs: type=docker,dest=./artifacts/reth_image.tar + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Upload reth image + uses: actions/upload-artifact@v4 + with: + name: artifacts + path: ./artifacts + + test: + timeout-minutes: 60 + strategy: + fail-fast: false + name: run kurtosis + runs-on: + group: Reth + needs: + - prepare-reth + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download reth image + uses: actions/download-artifact@v4 + with: + name: artifacts + path: /tmp + + - name: Load Docker image + run: | + docker load -i /tmp/reth_image.tar & + wait + docker image ls -a + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Run 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 engine start + kurtosis run --enclave op-devnet github.com/ethpandaops/optimism-package --args-file .github/assets/kurtosis_op_network_params.yaml + ENCLAVE_ID=$(curl http://127.0.0.1:9779/api/enclaves | jq --raw-output 'keys[0]') + RETH_RPC=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-1-op-reth-op-node-op-kurtosis".public_ports.rpc.number') + GETH_RPC=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-2-op-geth-op-node-op-kurtosis".public_ports.rpc.number') + echo "SEQUENCER_RPC=http://127.0.0.1:$SEQUENCER_EL_PORT" >> $GITHUB_ENV + echo "REPLICA_RPC=http://127.0.0.1:$REPLICA_EL_PORT" >> $GITHUB_ENV + + - name: Assert that clients advance + run: | + for i in {1..100}; do + sleep 5 + BLOCK_RETH=$(cast bn --rpc-url $RETH_RPC) + BLOCK_GETH=$(cast bn --rpc-url $GETH_RPC) + + if [ $BLOCK_GETH -ge 100 ] && [ $BLOCK_RETH -ge 100 ] ; then exit 0; fi + echo "Waiting for clients to advance..., Reth: $BLOCK_RETH Geth: $BLOCK_GETH" + done + exit 1 + + + # notify-on-error: + # needs: test + # if: failure() + # runs-on: + # group: Reth + # steps: + # - name: Slack Webhook Action + # uses: rtCamp/action-slack-notify@v2 + # env: + # SLACK_COLOR: ${{ job.status }} + # SLACK_MESSAGE: "Failed run: https://github.com/paradigmxyz/reth/actions/runs/${{ github.run_id }}" + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} From a794177da808a03f9f585312a2cd237340194725 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Wed, 13 Nov 2024 14:11:39 +0400 Subject: [PATCH 2/9] on pull_request --- .github/workflows/kurtosis-op.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kurtosis-op.yml b/.github/workflows/kurtosis-op.yml index cb9993e37c57..2fe7d0af5bc6 100644 --- a/.github/workflows/kurtosis-op.yml +++ b/.github/workflows/kurtosis-op.yml @@ -4,7 +4,7 @@ name: kurtosis-op on: workflow_dispatch: - merge_group: + pull_request: schedule: # every day - cron: "0 1 * * *" From 063ea284705cce00948485463361ceb10e140c5f Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Wed, 13 Nov 2024 14:14:57 +0400 Subject: [PATCH 3/9] fix build --- .github/workflows/kurtosis-op.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kurtosis-op.yml b/.github/workflows/kurtosis-op.yml index 2fe7d0af5bc6..b8e55b1a3bfc 100644 --- a/.github/workflows/kurtosis-op.yml +++ b/.github/workflows/kurtosis-op.yml @@ -31,7 +31,7 @@ jobs: cache-on-failure: true - name: Build reth run: | - cargo build --features optimism,asm-keccak --profile hivetests --bin op-reth --locked + cargo build --features optimism,asm-keccak --profile hivetests --bin op-reth --manifest-path crates/optimism/bin/Cargo.toml --locked mkdir dist && cp ./target/hivetests/op-reth ./dist/reth - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 285cd2c0ae98ff0ce3e37adf937c01f24054983c Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Wed, 13 Nov 2024 14:17:19 +0400 Subject: [PATCH 4/9] fix image --- .github/assets/kurtosis_op_network_params.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/assets/kurtosis_op_network_params.yaml b/.github/assets/kurtosis_op_network_params.yaml index 54e07f1d247f..a4d554cc7f5e 100644 --- a/.github/assets/kurtosis_op_network_params.yaml +++ b/.github/assets/kurtosis_op_network_params.yaml @@ -6,6 +6,7 @@ optimism_package: chains: - participants: - el_type: op-reth + el_image: "ghcr.io/paradigmxyz/op-reth:kurtosis-ci" cl_type: op-node - el_type: op-geth cl_type: op-node From 3fd1be65edd4f20239d08abeac7b96a8080a2ebf Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Wed, 13 Nov 2024 14:38:27 +0400 Subject: [PATCH 5/9] fix --- .github/assets/kurtosis_op_network_params.yaml | 4 ++-- .github/workflows/kurtosis-op.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/assets/kurtosis_op_network_params.yaml b/.github/assets/kurtosis_op_network_params.yaml index a4d554cc7f5e..0e1516cc8890 100644 --- a/.github/assets/kurtosis_op_network_params.yaml +++ b/.github/assets/kurtosis_op_network_params.yaml @@ -5,11 +5,11 @@ ethereum_package: optimism_package: chains: - participants: + - el_type: op-geth + cl_type: op-node - el_type: op-reth el_image: "ghcr.io/paradigmxyz/op-reth:kurtosis-ci" cl_type: op-node - - el_type: op-geth - cl_type: op-node batcher_params: extra_params: - "--throttle-interval=0" diff --git a/.github/workflows/kurtosis-op.yml b/.github/workflows/kurtosis-op.yml index b8e55b1a3bfc..980c7d535dee 100644 --- a/.github/workflows/kurtosis-op.yml +++ b/.github/workflows/kurtosis-op.yml @@ -88,10 +88,10 @@ jobs: kurtosis engine start kurtosis run --enclave op-devnet github.com/ethpandaops/optimism-package --args-file .github/assets/kurtosis_op_network_params.yaml ENCLAVE_ID=$(curl http://127.0.0.1:9779/api/enclaves | jq --raw-output 'keys[0]') - RETH_RPC=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-1-op-reth-op-node-op-kurtosis".public_ports.rpc.number') - GETH_RPC=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-2-op-geth-op-node-op-kurtosis".public_ports.rpc.number') - echo "SEQUENCER_RPC=http://127.0.0.1:$SEQUENCER_EL_PORT" >> $GITHUB_ENV - echo "REPLICA_RPC=http://127.0.0.1:$REPLICA_EL_PORT" >> $GITHUB_ENV + RETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-1-op-reth-op-node-op-kurtosis".public_ports.rpc.number') + GETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-2-op-geth-op-node-op-kurtosis".public_ports.rpc.number') + echo "RETH_RPC=http://127.0.0.1:$RETH_PORT" >> $GITHUB_ENV + echo "GETH_RPC=http://127.0.0.1:$GETH_PORT" >> $GITHUB_ENV - name: Assert that clients advance run: | From 0954e75a77c00f9c61779935d61c6c958cedfc68 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Wed, 13 Nov 2024 14:59:26 +0400 Subject: [PATCH 6/9] fix --- .github/workflows/kurtosis-op.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/kurtosis-op.yml b/.github/workflows/kurtosis-op.yml index 980c7d535dee..110b66a8bded 100644 --- a/.github/workflows/kurtosis-op.yml +++ b/.github/workflows/kurtosis-op.yml @@ -88,17 +88,17 @@ jobs: kurtosis engine start kurtosis run --enclave op-devnet github.com/ethpandaops/optimism-package --args-file .github/assets/kurtosis_op_network_params.yaml ENCLAVE_ID=$(curl http://127.0.0.1:9779/api/enclaves | jq --raw-output 'keys[0]') - RETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-1-op-reth-op-node-op-kurtosis".public_ports.rpc.number') - GETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-2-op-geth-op-node-op-kurtosis".public_ports.rpc.number') - echo "RETH_RPC=http://127.0.0.1:$RETH_PORT" >> $GITHUB_ENV - echo "GETH_RPC=http://127.0.0.1:$GETH_PORT" >> $GITHUB_ENV + GETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-1-op-geth-op-node-op-kurtosis".public_ports.rpc.number') + RETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-2-op-reth-op-node-op-kurtosis".public_ports.rpc.number') + echo "RETH_RPC=http://127.0.0.1:$GETH_PORT" >> $GITHUB_ENV + echo "GETH_RPC=http://127.0.0.1:$RETH_PORT" >> $GITHUB_ENV - name: Assert that clients advance run: | for i in {1..100}; do sleep 5 - BLOCK_RETH=$(cast bn --rpc-url $RETH_RPC) - BLOCK_GETH=$(cast bn --rpc-url $GETH_RPC) + BLOCK_GETH=$(cast bn --rpc-url $RETH_RPC) + BLOCK_RETH=$(cast bn --rpc-url $GETH_RPC) if [ $BLOCK_GETH -ge 100 ] && [ $BLOCK_RETH -ge 100 ] ; then exit 0; fi echo "Waiting for clients to advance..., Reth: $BLOCK_RETH Geth: $BLOCK_GETH" From 8677514bc2ed70499b315b14104ac1c9e39b549b Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Wed, 13 Nov 2024 14:59:47 +0400 Subject: [PATCH 7/9] fix --- .github/workflows/kurtosis-op.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kurtosis-op.yml b/.github/workflows/kurtosis-op.yml index 110b66a8bded..e9b3f1fc2bd2 100644 --- a/.github/workflows/kurtosis-op.yml +++ b/.github/workflows/kurtosis-op.yml @@ -97,8 +97,8 @@ jobs: run: | for i in {1..100}; do sleep 5 - BLOCK_GETH=$(cast bn --rpc-url $RETH_RPC) - BLOCK_RETH=$(cast bn --rpc-url $GETH_RPC) + BLOCK_GETH=$(cast bn --rpc-url $GETH_RPC) + BLOCK_RETH=$(cast bn --rpc-url $RETH_RPC) if [ $BLOCK_GETH -ge 100 ] && [ $BLOCK_RETH -ge 100 ] ; then exit 0; fi echo "Waiting for clients to advance..., Reth: $BLOCK_RETH Geth: $BLOCK_GETH" From 4dabde9847f0ad570460941082054c25d02e1351 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Wed, 13 Nov 2024 18:07:07 +0400 Subject: [PATCH 8/9] fix --- .github/workflows/kurtosis-op.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kurtosis-op.yml b/.github/workflows/kurtosis-op.yml index e9b3f1fc2bd2..27fbaf89e630 100644 --- a/.github/workflows/kurtosis-op.yml +++ b/.github/workflows/kurtosis-op.yml @@ -90,8 +90,8 @@ jobs: ENCLAVE_ID=$(curl http://127.0.0.1:9779/api/enclaves | jq --raw-output 'keys[0]') GETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-1-op-geth-op-node-op-kurtosis".public_ports.rpc.number') RETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-2-op-reth-op-node-op-kurtosis".public_ports.rpc.number') - echo "RETH_RPC=http://127.0.0.1:$GETH_PORT" >> $GITHUB_ENV - echo "GETH_RPC=http://127.0.0.1:$RETH_PORT" >> $GITHUB_ENV + echo "GETH_RPC=http://127.0.0.1:$GETH_PORT" >> $GITHUB_ENV + echo "RETH_RPC=http://127.0.0.1:$RETH_PORT" >> $GITHUB_ENV - name: Assert that clients advance run: | From 25422d7e5b7fca1f414ae144884934882e1a7030 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Wed, 13 Nov 2024 21:21:37 +0400 Subject: [PATCH 9/9] fix --- .github/workflows/kurtosis-op.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/kurtosis-op.yml b/.github/workflows/kurtosis-op.yml index 27fbaf89e630..2652992fca92 100644 --- a/.github/workflows/kurtosis-op.yml +++ b/.github/workflows/kurtosis-op.yml @@ -4,7 +4,6 @@ name: kurtosis-op on: workflow_dispatch: - pull_request: schedule: # every day - cron: "0 1 * * *" @@ -106,15 +105,15 @@ jobs: exit 1 - # notify-on-error: - # needs: test - # if: failure() - # runs-on: - # group: Reth - # steps: - # - name: Slack Webhook Action - # uses: rtCamp/action-slack-notify@v2 - # env: - # SLACK_COLOR: ${{ job.status }} - # SLACK_MESSAGE: "Failed run: https://github.com/paradigmxyz/reth/actions/runs/${{ github.run_id }}" - # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + notify-on-error: + needs: test + if: failure() + runs-on: + group: Reth + steps: + - name: Slack Webhook Action + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: ${{ job.status }} + SLACK_MESSAGE: "Failed run: https://github.com/paradigmxyz/reth/actions/runs/${{ github.run_id }}" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}