Skip to content

Commit

Permalink
Merge branch 'main' into chore/risc_zero_ci_test
Browse files Browse the repository at this point in the history
  • Loading branch information
PatStiles authored Jun 3, 2024
2 parents 6f52174 + bca9534 commit 70953dc
Show file tree
Hide file tree
Showing 72 changed files with 6,740 additions and 3,273 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
run: make build_sp1_linux
- name: Build Risc Zero go bindings
run: make build_risc_zero_linux
- name: Build Halo2-KZG bindings
run: make build_halo2_kzg_linux
- name: Build Halo2-IPA bindings
run: make build_halo2_ipa_linux
- name: Build operator
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/test-halo2-kzg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: test-halo2-kzg

on:
merge_group:
push:
branches: [main]
pull_request:
branches: ["*"]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Clear device space
run: |
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false

- name: Test Halo2-KZG go bindings
run: make test_halo2_kzg_go_bindings_linux
12 changes: 2 additions & 10 deletions .github/workflows/test-sp1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,12 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Clear device space
run: |
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false

- name: Test SP1 Rust
run: make test_sp1_rust_ffi
- name: Test SP1 go bindings
run: make test_sp1_go_bindings_linux
92 changes: 90 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,25 @@ batcher_send_halo2_ipa_task_burst_5: batcher/client/target/release/batcher-clien
--vk test_files/halo2_ipa/params.bin \
--repetitions 5

batcher_send_halo2_kzg_task: batcher/client/target/release/batcher-client
@echo "Sending Halo2 KZG 1!=0 task to Batcher..."
@cd batcher/client/ && cargo run --release -- \
--proving_system Halo2KZG \
--proof test_files/halo2_kzg/proof.bin \
--public_input test_files/halo2_kzg/pub_input.bin \
--vk test_files/halo2_kzg/params.bin \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657

batcher_send_halo2_kzg_task_burst_5: batcher/client/target/release/batcher-client
@echo "Sending Halo2 KZG 1!=0 task to Batcher..."
@cd batcher/client/ && cargo run --release -- \
--proving_system Halo2KZG \
--proof test_files/halo2_kzg/proof.bin \
--public_input test_files/halo2_kzg/pub_input.bin \
--vk test_files/halo2_kzg/params.bin \
--repetitions 5 \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657

__TASK_SENDERS__:
# TODO add a default proving system

Expand Down Expand Up @@ -331,6 +350,27 @@ send_halo2_ipa_proof_loop: ## Send a Halo2 IPA proof using the task sender every
--interval 10 \
2>&1 | zap-pretty

send_halo2_kzg_proof: ## Send a Halo2 KZG proof using the task sender
@echo "Sending Halo2 KZG proof..."
@go run task_sender/cmd/main.go send-task \
--proving-system halo2_kzg \
--proof task_sender/test_examples/halo2_kzg/proof.bin \
--public-input task_sender/test_examples/halo2_kzg/pub_input.bin \
--verification-key task_sender/test_examples/halo2_kzg/params.bin \
--config config-files/config.yaml \
2>&1 | zap-pretty

send_halo2_kzg_proof_loop: ## Send a Halo2 KZG proof using the task sender every 10 seconds
@echo "Sending Halo2 KZG proof in a loop every 10 seconds..."
@go run task_sender/cmd/main.go loop-tasks \
--proving-system halo2_kzg \
--proof task_sender/test_examples/halo2_kzg/proof.bin \
--public-input task_sender/test_examples/halo2_kzg/pub_input.bin \
--verification-key task_sender/test_examples/halo2_kzg/params.bin \
--config config-files/config.yaml \
--interval 10 \
2>&1 | zap-pretty

__METRICS__:
run_metrics: ## Run metrics using metrics-docker-compose.yaml
@echo "Running metrics..."
Expand Down Expand Up @@ -363,12 +403,10 @@ __SP1_FFI__: ##
build_sp1_macos:
@cd operator/sp1/lib && cargo build --release
@cp operator/sp1/lib/target/release/libsp1_verifier_ffi.dylib operator/sp1/lib/libsp1_verifier.dylib
@cp operator/sp1/lib/target/release/libsp1_verifier_ffi.a operator/sp1/lib/libsp1_verifier.a

build_sp1_linux:
@cd operator/sp1/lib && cargo build --release
@cp operator/sp1/lib/target/release/libsp1_verifier_ffi.so operator/sp1/lib/libsp1_verifier.so
@cp operator/sp1/lib/target/release/libsp1_verifier_ffi.a operator/sp1/lib/libsp1_verifier.a

test_sp1_rust_ffi:
@echo "Testing SP1 Rust FFI source code..."
Expand Down Expand Up @@ -443,6 +481,37 @@ test_merkle_tree_go_bindings_linux: build_merkle_tree_linux
@echo "Testing Merkle Tree Go bindings..."
go test ./operator/merkle_tree/... -v

__HALO2_KZG_FFI__: ##
build_halo2_kzg_macos:
@cd operator/halo2kzg/lib && cargo build --release
@cp operator/halo2kzg/lib/target/release/libhalo2kzg_verifier_ffi.dylib operator/halo2kzg/lib/libhalo2kzg_verifier.dylib
@cp operator/halo2kzg/lib/target/release/libhalo2kzg_verifier_ffi.a operator/halo2kzg/lib/libhalo2kzg_verifier.a

build_halo2_kzg_linux:
@cd operator/halo2kzg/lib && cargo build --release
@cp operator/halo2kzg/lib/target/release/libhalo2kzg_verifier_ffi.so operator/halo2kzg/lib/libhalo2kzg_verifier.so
@cp operator/halo2kzg/lib/target/release/libhalo2kzg_verifier_ffi.a operator/halo2kzg/lib/libhalo2kzg_verifier.a

test_halo2_kzg_rust_ffi:
@echo "Testing Halo2-KZG Rust FFI source code..."
@cd operator/halo2kzg/lib && cargo t --release

test_halo2_kzg_go_bindings_macos: build_halo2_kzg_macos
@echo "Testing Halo2-KZG Go bindings..."
go test ./operator/halo2kzg/... -v

test_halo2_kzg_go_bindings_linux: build_halo2_kzg_linux
@echo "Testing Halo2-KZG Go bindings..."
go test ./operator/halo2kzg/... -v

generate_halo2_kzg_proof:
@cd task_sender/test_examples/halo2_kzg && \
cargo clean && \
rm params.bin proof.bin pub_input.bin && \
RUST_LOG=info cargo run --release && \
echo "Generating halo2 plonk proof..." && \
echo "Generated halo2 plonk proof!"

__HALO2_IPA_FFI__: ##
build_halo2_ipa_macos:
@cd operator/halo2ipa/lib && cargo build --release
Expand Down Expand Up @@ -474,6 +543,25 @@ generate_halo2_ipa_proof:
echo "Generating halo2 plonk proof..." && \
echo "Generated halo2 plonk proof!"


__BUILD_ALL_FFI__:
build_all_ffis_macos: ## Build all FFIs for macOS
@echo "Building all FFIs for macOS..."
@$(MAKE) build_sp1_macos
@$(MAKE) build_risc_zero_macos
# @$(MAKE) build_merkle_tree_macos
@$(MAKE) build_halo2_ipa_macos
@$(MAKE) build_halo2_kzg_macos
@echo "All macOS FFIs built successfully."

build_all_ffis_linux: ## Build all FFIs for Linux
@echo "Building all FFIs for Linux..."
@$(MAKE) build_sp1_linux
@$(MAKE) build_risc_zero_linux
# @$(MAKE) build_merkle_tree_linux
@$(MAKE) build_halo2_ipa_linux
@echo "All Linux FFIs built successfully."

__EXPLORER__:
run_devnet_explorer:
@cd explorer/ && \
Expand Down
Loading

0 comments on commit 70953dc

Please sign in to comment.