-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shell wrappers for checking prover and rollup benchmark thresholds (
#1296) * rollup bench ci * change env vars * shell wrappers for benchmark checks * fix tps threshold * switch error codes. condition is correct * fix comparison * modify proof_block_jump
- Loading branch information
1 parent
a8a234c
commit c9f56b4
Showing
5 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: [email protected] | ||
- 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters