Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator: Bump SP1 and Risc0 version + Retro-Compatible Operator #1208

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
14880e3
bump risc0 and sp1 version
PatStiles Oct 9, 2024
20e01ed
add Cargo.lock files
PatStiles Oct 9, 2024
cd59a5e
add newly generated proofs + scripts
PatStiles Oct 9, 2024
2f62be4
remove cp command in make
PatStiles Oct 9, 2024
8471712
merge
PatStiles Oct 16, 2024
6b5d93f
add retro-compat in operator
PatStiles Oct 16, 2024
08f85a0
fix test file path
PatStiles Oct 16, 2024
71b3e54
Merge branch 'staging' into 1205-bump-sp1-and-risc0-version
PatStiles Oct 16, 2024
3b2d05a
rm duplicated make command
PatStiles Oct 16, 2024
9c01378
update ci
PatStiles Oct 16, 2024
5373956
update test paths + proof regen
PatStiles Oct 16, 2024
0622b17
change names of *.so files
PatStiles Oct 16, 2024
71409c0
fix make paths
PatStiles Oct 16, 2024
9512522
fix test function calls + regenerate proofs
PatStiles Oct 16, 2024
b7c6c0b
fix make + gitignore
PatStiles Oct 16, 2024
3d7eb58
missing fn in test
PatStiles Oct 16, 2024
b17e4bc
fix path in makefile
PatStiles Oct 16, 2024
1f094a1
add lib
PatStiles Oct 16, 2024
de2853b
add lib for sp1 old
PatStiles Oct 16, 2024
4a050cb
fix ci paths
PatStiles Oct 16, 2024
be72625
add library path definition to make build on linus
PatStiles Oct 16, 2024
beb873e
change make
PatStiles Oct 16, 2024
919c11c
fix make
PatStiles Oct 16, 2024
eb9eb27
makefile
PatStiles Oct 16, 2024
5e52e2b
make
PatStiles Oct 16, 2024
06eb2c7
fix dynamic library + naming issues
PatStiles Oct 17, 2024
3ffce71
update make commands
PatStiles Oct 17, 2024
89f5c3a
update sp1 version + change prompt library in `zkquiz` example to acc…
PatStiles Oct 17, 2024
912efa1
remove old proof generators
PatStiles Oct 17, 2024
4ba0bef
add old proofs for ci tests + rm binaries and ignore
PatStiles Oct 18, 2024
2bd4916
rm dynamic libs
PatStiles Oct 18, 2024
67eb895
fix linux build issues
MarcosNicolau Oct 18, 2024
0ec222d
move proofs to fibonacci folder
PatStiles Oct 18, 2024
cd538f3
remove unsent case from operator verifiers
PatStiles Oct 18, 2024
7209d11
delete risc_zero dylib
PatStiles Oct 22, 2024
1b25c91
fix make file
PatStiles Oct 22, 2024
9e7b438
ignore .so files in sp1
PatStiles Oct 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ jobs:
cache: false
- name: Build SP1 bindings
run: make build_sp1_linux
- name: Build Old SP1 bindings
run: make build_sp1_linux_old
- name: Build Risc Zero go bindings
run: make build_risc_zero_linux
- name: Build Old Risc Zero go bindings
run: make build_risc_zero_linux_old
- name: Build Merkle Tree bindings
run: make build_merkle_tree_linux
- name: Build operator
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/test-risc-zero-old.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: test-risc-zero-old

on:
merge_group:
push:
branches: [main]
pull_request:
branches: ["*"]
paths:
- "operator/risc_zero_old/**"
- ".github/workflows/test-risc-zero-old.yml"

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
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Test Old Risc Zero Rust
run: make test_risc_zero_rust_ffi_old
- name: Test Old Risc Zero go bindings
run: make test_risc_zero_go_bindings_linux_old
28 changes: 28 additions & 0 deletions .github/workflows/test-sp1-old.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: test-sp1-old

on:
merge_group:
push:
branches: [main]
pull_request:
branches: ["*"]
paths:
- 'operator/sp1_old/**'
- '.github/workflows/test-sp1-old.yml'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Test Old SP1 Rust
run: make test_sp1_rust_ffi_old
- name: Test Old SP1 go bindings
run: make test_sp1_go_bindings_linux_old
51 changes: 47 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ifeq ($(OS),Darwin)
endif

ifeq ($(OS),Linux)
export LD_LIBRARY_PATH += $(CURDIR)/operator/risc_zero/lib
export LD_LIBRARY_PATH:=$(CURDIR)/operator/risc_zero_old/lib:$(CURDIR)/operator/risc_zero/lib
PatStiles marked this conversation as resolved.
Show resolved Hide resolved
endif

ifeq ($(OS),Linux)
Expand Down Expand Up @@ -508,22 +508,40 @@ test_sp1_go_bindings_linux: build_sp1_linux
# @cp -r scripts/test_files/sp1/fibonacci_proof_generator/script/sp1_fibonacci.elf scripts/test_files/sp1/
generate_sp1_fibonacci_proof:
@cd scripts/test_files/sp1/fibonacci_proof_generator/script && RUST_LOG=info cargo run --release
@mv scripts/test_files/sp1/fibonacci_proof_generator/program/elf/riscv32im-succinct-zkvm-elf scripts/test_files/sp1/sp1_fibonacci.elf
@mv scripts/test_files/sp1/fibonacci_proof_generator/script/sp1_fibonacci.proof scripts/test_files/sp1/
Comment on lines -511 to -512
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

@echo "Fibonacci proof and ELF generated in scripts/test_files/sp1 folder"

generate_risc_zero_empty_journal_proof:
@cd scripts/test_files/risc_zero/no_public_inputs && RUST_LOG=info cargo run --release
@echo "Fibonacci proof and ELF with empty journal generated in scripts/test_files/risc_zero/no_public_inputs folder"

build_sp1_macos_old:
@cd operator/sp1_old/lib && cargo build $(RELEASE_FLAG)
@cp operator/sp1_old/lib/target/$(TARGET_REL_PATH)/libsp1_verifier_old_ffi.dylib operator/sp1_old/lib/libsp1_verifier_old.dylib

build_sp1_linux_old:
@cd operator/sp1_old/lib && cargo build $(RELEASE_FLAG)
@cp operator/sp1_old/lib/target/$(TARGET_REL_PATH)/libsp1_verifier_old_ffi.so operator/sp1_old/lib/libsp1_verifier_old.so

test_sp1_rust_ffi_old:
@echo "Testing SP1 Rust FFI source code..."
@cd operator/sp1_old/lib && RUST_MIN_STACK=83886080 cargo t --release

test_sp1_go_bindings_macos_old: build_sp1_macos_old
@echo "Testing SP1 Go bindings..."
go test ./operator/sp1_old/... -v

test_sp1_go_bindings_linux_old: build_sp1_linux_old
@echo "Testing SP1 Go bindings..."
go test ./operator/sp1_old/... -v

__RISC_ZERO_FFI__: ##
build_risc_zero_macos:
@cd operator/risc_zero/lib && cargo build $(RELEASE_FLAG)
@cp operator/risc_zero/lib/target/$(TARGET_REL_PATH)/librisc_zero_verifier_ffi.dylib operator/risc_zero/lib/librisc_zero_verifier_ffi.dylib
PatStiles marked this conversation as resolved.
Show resolved Hide resolved
@cp operator/risc_zero/lib/target/$(TARGET_REL_PATH)/librisc_zero_verifier_ffi.dylib operator/risc_zero/lib/librisc_zero_verifier.dylib

build_risc_zero_linux:
@cd operator/risc_zero/lib && cargo build $(RELEASE_FLAG)
echo $(LD_LIBRARY_PATH)
PatStiles marked this conversation as resolved.
Show resolved Hide resolved
@cp operator/risc_zero/lib/target/$(TARGET_REL_PATH)/librisc_zero_verifier_ffi.so operator/risc_zero/lib/librisc_zero_verifier_ffi.so

test_risc_zero_rust_ffi:
Expand All @@ -543,6 +561,27 @@ generate_risc_zero_fibonacci_proof:
RUST_LOG=info cargo run --release && \
echo "Fibonacci proof, pub input and image ID generated in scripts/test_files/risc_zero folder"

build_risc_zero_macos_old:
@cd operator/risc_zero_old/lib && cargo build $(RELEASE_FLAG)
@cp operator/risc_zero_old/lib/target/$(TARGET_REL_PATH)/librisc_zero_verifier_old_ffi.dylib operator/risc_zero_old/lib/librisc_zero_verifier_old.dylib

build_risc_zero_linux_old:
@cd operator/risc_zero_old/lib && cargo build $(RELEASE_FLAG)
echo $(LD_LIBRARY_PATH)
@cp operator/risc_zero_old/lib/target/$(TARGET_REL_PATH)/librisc_zero_verifier_old_ffi.so operator/risc_zero_old/lib/librisc_zero_verifier_old_ffi.so

test_risc_zero_rust_ffi_old:
PatStiles marked this conversation as resolved.
Show resolved Hide resolved
@echo "Testing RISC Zero Rust FFI source code..."
@cd operator/risc_zero_old/lib && cargo test --release

test_risc_zero_go_bindings_macos_old: build_risc_zero_macos_old
@echo "Testing RISC Zero Go bindings..."
go test ./operator/risc_zero_old/... -v

test_risc_zero_go_bindings_linux_old: build_risc_zero_linux_old
@echo "Testing RISC Zero Go bindings..."
go test ./operator/risc_zero_old/... -v

__MERKLE_TREE_FFI__: ##
build_merkle_tree_macos:
@cd operator/merkle_tree/lib && cargo build $(RELEASE_FLAG)
Expand Down Expand Up @@ -581,13 +620,17 @@ build_all_ffi_macos: ## Build all FFIs for macOS
@echo "Building all FFIs for macOS..."
@$(MAKE) build_sp1_macos
@$(MAKE) build_risc_zero_macos
@$(MAKE) build_sp1_macos_old
@$(MAKE) build_risc_zero_macos_old
@$(MAKE) build_merkle_tree_macos
@echo "All macOS FFIs built successfully."

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

Expand Down
Loading
Loading