From 3b7755cfd6c40507f50fa8cd567b50580acbc800 Mon Sep 17 00:00:00 2001 From: Marko Atanasievski Date: Tue, 9 Jul 2024 14:04:45 +0200 Subject: [PATCH 1/2] fix: failed to send proof --- zero_bin/prover/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zero_bin/prover/src/lib.rs b/zero_bin/prover/src/lib.rs index da787ede2..bd48cdf36 100644 --- a/zero_bin/prover/src/lib.rs +++ b/zero_bin/prover/src/lib.rs @@ -91,7 +91,7 @@ impl BlockProverInput { pub async fn prove( self, runtime: &Runtime, - _previous: Option>>, + previous: Option>>, save_inputs_on_error: bool, ) -> Result { let block_number = self.get_block_number(); @@ -112,6 +112,12 @@ impl BlockProverInput { .try_collect::>() .await?; + // Wait for previous block proof + let _prev = match previous { + Some(it) => Some(it.await?), + None => None, + }; + // Dummy proof to match expected output type. Ok(GeneratedBlockProof { b_height: block_number From 63e5dbadb725cd1e47b8a4f392c02329439e8345 Mon Sep 17 00:00:00 2001 From: Marko Atanasievski Date: Tue, 9 Jul 2024 15:10:15 +0200 Subject: [PATCH 2/2] feat: cancun jerigon test network (#367) * fix: add cancun jerigon test network * fix: test execution * fix: whitespace --- .github/workflows/jerigon.yml | 43 +++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/jerigon.yml b/.github/workflows/jerigon.yml index 273eff91e..279a4e722 100644 --- a/.github/workflows/jerigon.yml +++ b/.github/workflows/jerigon.yml @@ -29,7 +29,8 @@ jobs: uses: actions/checkout@v4 with: repository: 0xPolygonZero/jerigon-test-network - path: test-jerigon-network + ref: 'feat/kurtosis-network' + path: jerigon-test-network - name: Install nightly toolchain uses: dtolnay/rust-toolchain@nightly @@ -49,37 +50,49 @@ jobs: with: cache-on-failure: true - - name: Run jerigon test network with docker compose + - name: Install kurtosis run: | - cd test-jerigon-network - docker-compose -f docker-compose.yml up -d - docker logs -f smart-contracts - echo "Jerigon network is up and running, ready for testing" + 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 - - name: Rpc test with curl + #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: | - curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id":83}' localhost:8545 - env: - RUST_LOG: info - + 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 in test_only mode run: | + ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)" cd zero_bin/tools - OUTPUT_TO_TERMINAL=true ./prove_rpc.sh 0x2 0x3 http://localhost:8546 jerigon true 0 0 test_only + ulimit -n 8192 + OUTPUT_TO_TERMINAL=true ./prove_rpc.sh 0x1 0xf $ETH_RPC_URL jerigon true 3000 100 test_only echo "Proving blocks in test_only mode finished" - name: Run prove blocks 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 0x4 0x5 http://localhost:8546 jerigon true + OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./prove_rpc.sh 0x2 0x8 $ETH_RPC_URL jerigon true 3000 100 echo "Proving blocks in real mode finished" - name: Shut down network run: | - cd test-jerigon-network - docker-compose -f docker-compose.yml down -v + kurtosis enclave rm -f cancun-testnet + kurtosis engine stop