diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c9c8bccd1..e757105b9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -188,7 +188,7 @@ jobs: BLOCKS: 1 TXNS_PER_BLOCK: 10 NUM_PUB_KEYS: 100 - run: cargo bench --bench prover_bench --features bench + run: sh ci_prover_count_check.sh bench_check: name: bench_check @@ -228,6 +228,44 @@ jobs: NUM_PUB_KEYS: 100 run: cargo bench + rollup_bench_check: + name: rollup_bench_check + needs: check + runs-on: buildjet-8vcpu-ubuntu-2204 + timeout-minutes: 120 + steps: + - uses: actions/checkout@v3 + - uses: rui314/setup-mold@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v2 + with: + version: "23.2" + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Install Rust + run: rustup show && rustup install nightly && rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu + - name: Install cargo-risczero + uses: taiki-e/install-action@v2 + with: + tool: cargo-risczero@0.19 + - name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain + run: cargo risczero install + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: Swatinem/rust-cache@v2 + with: + cache-provider: "buildjet" + shared-key: cargo-check-cache + save-if: ${{ github.ref == 'refs/heads/nightly' }} + workspaces: | + . + fuzz + - name: rollup bench check + env: + BLOCKS: 10 + TXNS_PER_BLOCK: 10000 + NUM_PUB_KEYS: 100 + run: sh ci_rollup_count_check.sh + # Check that every combination of features is working properly. hack: name: features diff --git a/ci_prover_count_check.sh b/ci_prover_count_check.sh new file mode 100755 index 000000000..7d6b6baf6 --- /dev/null +++ b/ci_prover_count_check.sh @@ -0,0 +1,29 @@ +#!/bin/bash +export BLOCKS=1 +export TXNS_PER_BLOCK=10 +export NUM_PUB_KEYS=100 +export CYCLE_COUNT=1000000 +cargo bench --bench prover_bench --features bench 2>&1 | tee output.log + +output_file="output.log" + +verify_line=$(grep -w "verify" $output_file) + +if [ -z "$verify_line" ]; then + echo "The line containing 'verify' was not found." + exit 1 +else + average_cycles=$(echo $verify_line | awk '{print $4}' | sed 's/,//g') # Remove commas if present + + if [ -n "$average_cycles" ] && [ "$average_cycles" -lt $CYCLE_COUNT ]; then + echo "The value for 'verify' is less than $CYCLE_COUNT. Passing the check. Value: $average_cycles" + exit 0 + elif [ -n "$average_cycles" ]; then + echo "The value for 'verify' is greater than $CYCLE_COUNT. Failing the check. Value: $average_cycles" + exit 0 + else + echo "Unable to extract the 'Average Cycles' value." + exit 1 + fi +fi +exit 1 \ No newline at end of file diff --git a/ci_rollup_count_check.sh b/ci_rollup_count_check.sh new file mode 100755 index 000000000..078e906e1 --- /dev/null +++ b/ci_rollup_count_check.sh @@ -0,0 +1,25 @@ +#!/bin/bash +export BLOCKS=10 +export TXNS_PER_BLOCK=10000 +export TPS=1000 +(cd examples/demo-rollup/benches/node && make basic 2>&1) | tee output.log + +output_file="output.log" + +verify_line=$(grep -w "Transactions per sec (TPS)" $output_file) + +if [ -z "$verify_line" ]; then + echo "The line containing 'verify' was not found." + exit 1 +else + tps_count=$(echo $verify_line | awk -F '|' '{print $3}' | sed 's/,//g') + result=$(awk -v val="$tps_count" -v threshold="$TPS" 'BEGIN {print (val < threshold) ? "FAIL" : "PASS"}') + if [ "$result" = "FAIL" ]; then + echo "The value for TPS is less than $TPS. Failing the check. Value: $tps_count" + exit 1 + else + echo "The value for TPS is greater than $TPS. Passing the check. Value: $tps_count" + exit 0 + fi +fi +exit 1 \ No newline at end of file diff --git a/examples/demo-rollup/benches/node/rollup_coarse_measure.rs b/examples/demo-rollup/benches/node/rollup_coarse_measure.rs index 8138429e0..46d951ec4 100644 --- a/examples/demo-rollup/benches/node/rollup_coarse_measure.rs +++ b/examples/demo-rollup/benches/node/rollup_coarse_measure.rs @@ -125,7 +125,7 @@ async fn main() -> Result<(), anyhow::Error> { >::new(); let demo_genesis_config = { - let integ_test_conf_dir: &Path = "../../test-data/genesis/integration-tests".as_ref(); + let integ_test_conf_dir: &Path = "../test-data/genesis/integration-tests".as_ref(); let rt_params = get_genesis_config::(&GenesisPaths::from_dir(integ_test_conf_dir)) .unwrap(); diff --git a/examples/demo-rollup/benches/node/rollup_config.toml b/examples/demo-rollup/benches/node/rollup_config.toml index 1f8e74250..77de9d3c9 100644 --- a/examples/demo-rollup/benches/node/rollup_config.toml +++ b/examples/demo-rollup/benches/node/rollup_config.toml @@ -21,3 +21,6 @@ start_height = 1 # the host and port to bind the rpc server for bind_host = "127.0.0.1" bind_port = 12345 + +[prover_service] +aggregated_proof_block_jump = 1