Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
temaniarpit27 committed Nov 11, 2024
1 parent 00ae12e commit 2ebe02c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/cron_jerigon_zero_testing.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Jerigon Zero Testing

Check warning on line 1 in .github/workflows/cron_jerigon_zero_testing.yml

View workflow job for this annotation

GitHub Actions / yamllint-check

1:1 [document-start] missing document start "---"

on:
# Uncomment when ready to run on a schedule
# TODO - Change this before merge
# # Uncomment when ready to run on a schedule
# schedule:
# # Run every Sunday at 12:00 AM (UTC)
# - cron: "0 0 * * 0"
Expand All @@ -21,7 +22,7 @@ env:
jobs:
jerigon_zero_testing:
name: Jerigon Zero Testing - Integration and Benchmarking
runs-on: zero-ci
runs-on: zero-reg
steps:
- name: Checkout zk_evm code
uses: actions/checkout@v4
Expand Down Expand Up @@ -52,8 +53,9 @@ jobs:
- name: Run Erigon Network
run: |
cd ..
tar xf "$(pwd)/zk_evm/test_data/erigon-data.tar.gz" || {
echo "Failed to extract erigon-data.tar.gz"; exit 1;
# TODO - Download from IPFS
tar xf "$(pwd)/zk_evm/test_data/erigon-test-data.tar.gz" || {
echo "Failed to extract erigon-test-data.tar.gz"; exit 1;
}
docker pull ghcr.io/0xpolygonzero/erigon:feat-zero
docker run -d --name erigon \
Expand All @@ -73,11 +75,8 @@ jobs:
run: |
export ETH_RPC_URL="http://localhost:8545"
rm -rf proofs/* circuits/* ./proofs.json test.out verify.out leader.out
random_numbers=($(shuf -i 1-500 -n 5))
for number in "${random_numbers[@]}"; do
hex_number="0x$(echo "obase=16; $number" | bc)"
OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./scripts/prove_rpc.sh $hex_number $hex_number $ETH_RPC_URL jerigon true 3000 100
done
# TODO - Change this before merge
OUTPUT_TO_TERMINAL=true ./scripts/prove_rpc.sh 1000 1002 $ETH_RPC_URL jerigon 0 3000 100 test_only
- name: Download Previous Results
uses: dawidd6/action-download-artifact@v6
Expand Down
16 changes: 8 additions & 8 deletions scripts/jerigon_zero_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ BLOCK_BATCH_SIZE="${BLOCK_BATCH_SIZE:-8}"
# Logging setup
OUTPUT_LOG="jerigon_zero_output.log"
BLOCK_OUTPUT_LOG="jerigon_zero_block_output.log"
ERROR_LOG="jerigon_zero_error.log"
PROOFS_FILE_LIST="${PROOF_OUTPUT_DIR}/proof_files.json"

# Ensure necessary directories exist
Expand All @@ -42,20 +43,18 @@ blocks=(100 200 300 400 500)
process_block() {
local block=$1

echo "Processing block: $block" &>> "$OUTPUT_LOG"

# Fetch block data
if ! ./target/release/rpc --rpc-url "$ETH_RPC_URL" fetch --start-block "$block" --end-block "$block" > "output_${block}.json"; then
echo "Failed to fetch block data for block: $block" &>> "$OUTPUT_LOG"
if ! ./target/release/rpc --rpc-url "$ETH_RPC_URL" fetch --start-block "$block" --end-block "$block" > "witness_${block}.json"; then
echo "Failed to fetch block data for block: $block" &>> "$ERROR_LOG"
exit 1
fi

local start_time=$(date +%s%N)

# Run performance stats
if ! perf stat -e cycles ./target/release/leader --runtime in-memory --load-strategy monolithic --block-batch-size "$BLOCK_BATCH_SIZE" --proof-output-dir "$PROOF_OUTPUT_DIR" stdio < "output_${block}.json" &> "$BLOCK_OUTPUT_LOG"; then
if ! perf stat -e cycles ./target/release/leader --runtime in-memory --use-test-config --load-strategy on-demand --block-batch-size "$BLOCK_BATCH_SIZE" --proof-output-dir "$PROOF_OUTPUT_DIR" stdio < "witness_${block}.json" &> "$BLOCK_OUTPUT_LOG"; then
echo "Performance command failed for block: $block" &>> "$OUTPUT_LOG"
cat "$BLOCK_OUTPUT_LOG" &>> "$OUTPUT_LOG"
cat "$BLOCK_OUTPUT_LOG" &>> "$ERROR_LOG"
exit 1
fi

Expand All @@ -64,7 +63,7 @@ process_block() {
set +o pipefail
if ! cat "$BLOCK_OUTPUT_LOG" | grep "Successfully wrote to disk proof file " | awk '{print $NF}' | tee "$PROOFS_FILE_LIST"; then
echo "Proof list not generated for block: $block. Check the log for details." &>> "$OUTPUT_LOG"
cat "$BLOCK_OUTPUT_LOG" &>> "$OUTPUT_LOG"
cat "$BLOCK_OUTPUT_LOG" &>> "$ERROR_LOG"
exit 1
fi

Expand All @@ -80,7 +79,8 @@ process_block() {
}

# Process each block
for block in "${blocks[@]}"; do
# TODO - Change this before merge
for i in $(seq 800 802); do
process_block "$block"
done

Expand Down
File renamed without changes.

0 comments on commit 2ebe02c

Please sign in to comment.