From cd1b80478eedeeadf2c2c40182a3bf68d16e6eda Mon Sep 17 00:00:00 2001 From: Marko Atanasievski Date: Sat, 27 Jul 2024 00:59:24 +0200 Subject: [PATCH] feat: test native tracer (#423) * feat: test native tracer * fix: test step names * fix: workaround jerigon block 1 eth_getProof issue * fix: review * fix: workaround jerigon eth_getProof missing storage proof issue --- .github/workflows/jerigon-native.yml | 98 +++++++++++++++++++ .../{jerigon.yml => jerigon-zero.yml} | 8 +- 2 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/jerigon-native.yml rename .github/workflows/{jerigon.yml => jerigon-zero.yml} (93%) diff --git a/.github/workflows/jerigon-native.yml b/.github/workflows/jerigon-native.yml new file mode 100644 index 000000000..8755c3187 --- /dev/null +++ b/.github/workflows/jerigon-native.yml @@ -0,0 +1,98 @@ +name: Jerigon Integration + +on: + push: + branches: [develop, main] + pull_request: + branches: + - "**" + workflow_dispatch: + branches: + - "**" + + +env: + CARGO_TERM_COLOR: always + REGISTRY: ghcr.io + +jobs: + test_jerigon_native_tracer_proving: + name: Native tracer proof generation + runs-on: zero-ci + timeout-minutes: 40 + if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Checkout test-jerigon-network sources + uses: actions/checkout@v4 + with: + repository: 0xPolygonZero/jerigon-test-network + ref: 'feat/kurtosis-network' + path: jerigon-test-network + + - name: Install nightly toolchain + uses: dtolnay/rust-toolchain@nightly + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + + - 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 + + #It is much easier to use cast tool in scripts so install foundry + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Run cancun test network + run: | + docker pull ghcr.io/0xpolygonzero/erigon:feat-zero + kurtosis run --enclave cancun-testnet github.com/ethpandaops/ethereum-package@4.0.0 --args-file jerigon-test-network/network_params.yml + + - name: Generate blocks with transactions + run: | + ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)" + cast rpc eth_blockNumber --rpc-url $ETH_RPC_URL + cd jerigon-test-network && set -a && source .env && set +a + bash ./tests/generate_transactions.sh + + - name: Run prove blocks with native tracer in test_only mode + run: | + ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)" + cd zero_bin/tools + ulimit -n 8192 + OUTPUT_TO_TERMINAL=true ./prove_rpc.sh 0x5 0xf $ETH_RPC_URL native true 3000 100 test_only + echo "Proving blocks in test_only mode finished" + + + - name: Run prove blocks with native tracer in real mode + run: | + ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)" + cd zero_bin/tools + rm -rf proofs/* circuits/* ./proofs.json test.out verify.out leader.out + OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./prove_rpc.sh 0x5 0x7 $ETH_RPC_URL native true 3000 100 + echo "Proving blocks in real mode finished" + + - name: Shut down network + run: | + kurtosis enclave rm -f cancun-testnet + kurtosis engine stop + + + diff --git a/.github/workflows/jerigon.yml b/.github/workflows/jerigon-zero.yml similarity index 93% rename from .github/workflows/jerigon.yml rename to .github/workflows/jerigon-zero.yml index e60d34330..d25453541 100644 --- a/.github/workflows/jerigon.yml +++ b/.github/workflows/jerigon-zero.yml @@ -16,8 +16,8 @@ env: REGISTRY: ghcr.io jobs: - test_jerigon_input_proving: - name: Test proof generation with jerigon input + test_jerigon_zero_tracer_proving: + name: Zero tracer proof generation runs-on: zero-ci timeout-minutes: 40 if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" @@ -72,7 +72,7 @@ jobs: cd jerigon-test-network && set -a && source .env && set +a bash ./tests/generate_transactions.sh - - name: Run prove blocks in test_only mode + - name: Run prove blocks with zero tracer in test_only mode run: | ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)" cd zero_bin/tools @@ -81,7 +81,7 @@ jobs: echo "Proving blocks in test_only mode finished" - - name: Run prove blocks in real mode + - name: Run prove blocks with zero tracer in real mode run: | ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)" cd zero_bin/tools