Skip to content

Commit b281543

Browse files
MauroToscanoJuArce
andauthored
Delete old verifiers for Risc0 and SP1 (#1815)
Co-authored-by: JuArce <[email protected]>
1 parent 7038413 commit b281543

22 files changed

+9
-8300
lines changed

.github/workflows/build-and-test-go.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,26 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23+
2324
- uses: actions/setup-go@v5
2425
with:
2526
go-version: "1.23"
2627
cache: false
28+
2729
- name: foundry-toolchain
2830
uses: foundry-rs/[email protected]
31+
2932
- name: Build SP1 bindings
3033
run: make build_sp1_linux
31-
- name: Build Old SP1 bindings
32-
run: make build_sp1_linux_old
34+
3335
- name: Build Risc Zero go bindings
3436
run: make build_risc_zero_linux
35-
- name: Build Old Risc Zero go bindings
36-
run: make build_risc_zero_linux_old
37+
3738
- name: Build Merkle Tree bindings
3839
run: make build_merkle_tree_linux
40+
3941
- name: Build operator
4042
run: go build operator/cmd/main.go
43+
4144
- name: Build aggregator
4245
run: go build aggregator/cmd/main.go

.github/workflows/test-risc-zero-old.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/test-sp1-old.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ ifeq ($(OS),Darwin)
2020
endif
2121

2222
ifeq ($(OS),Linux)
23-
export LD_LIBRARY_PATH+=$(CURDIR)/operator/risc_zero_old/lib:$(CURDIR)/operator/risc_zero/lib
24-
OPERATOR_FFIS=$(CURDIR)/operator/risc_zero_old/lib:$(CURDIR)/operator/risc_zero/lib
23+
export LD_LIBRARY_PATH+=$(CURDIR)/operator/risc_zero/lib
24+
OPERATOR_FFIS=$(CURDIR)/operator/risc_zero/lib
2525
endif
2626

2727
ifeq ($(OS),Linux)
@@ -738,25 +738,6 @@ generate_risc_zero_empty_journal_proof:
738738
@cd scripts/test_files/risc_zero/no_public_inputs && RUST_LOG=info cargo run --release
739739
@echo "Fibonacci proof and ELF with empty journal generated in scripts/test_files/risc_zero/no_public_inputs folder"
740740

741-
build_sp1_macos_old:
742-
@cd operator/sp1_old/lib && cargo build $(RELEASE_FLAG)
743-
@cp operator/sp1_old/lib/target/$(TARGET_REL_PATH)/libsp1_verifier_old_ffi.dylib operator/sp1_old/lib/libsp1_verifier_old_ffi.dylib
744-
745-
build_sp1_linux_old:
746-
@cd operator/sp1_old/lib && cargo build $(RELEASE_FLAG)
747-
@cp operator/sp1_old/lib/target/$(TARGET_REL_PATH)/libsp1_verifier_old_ffi.so operator/sp1_old/lib/libsp1_verifier_old_ffi.so
748-
749-
test_sp1_rust_ffi_old:
750-
@echo "Testing SP1 Rust FFI source code..."
751-
@cd operator/sp1_old/lib && RUST_MIN_STACK=83886080 cargo t --release
752-
753-
test_sp1_go_bindings_macos_old: build_sp1_macos_old
754-
@echo "Testing SP1 Go bindings..."
755-
go test ./operator/sp1_old/... -v
756-
757-
test_sp1_go_bindings_linux_old: build_sp1_linux_old
758-
@echo "Testing SP1 Go bindings..."
759-
go test ./operator/sp1_old/... -v
760741

761742
__RISC_ZERO_FFI__: ##
762743
build_risc_zero_macos:
@@ -784,26 +765,6 @@ generate_risc_zero_fibonacci_proof:
784765
RUST_LOG=info cargo run --release && \
785766
echo "Fibonacci proof, pub input and image ID generated in scripts/test_files/risc_zero folder"
786767

787-
build_risc_zero_macos_old:
788-
@cd operator/risc_zero_old/lib && cargo build $(RELEASE_FLAG)
789-
@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_ffi.dylib
790-
791-
build_risc_zero_linux_old:
792-
@cd operator/risc_zero_old/lib && cargo build $(RELEASE_FLAG)
793-
@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
794-
795-
test_risc_zero_rust_ffi_old:
796-
@echo "Testing RISC Zero Rust FFI source code..."
797-
@cd operator/risc_zero_old/lib && cargo test --release
798-
799-
test_risc_zero_go_bindings_macos_old: build_risc_zero_macos_old
800-
@echo "Testing RISC Zero Go bindings..."
801-
go test ./operator/risc_zero_old/... -v
802-
803-
test_risc_zero_go_bindings_linux_old: build_risc_zero_linux_old
804-
@echo "Testing RISC Zero Go bindings..."
805-
go test ./operator/risc_zero_old/... -v
806-
807768

808769
__MERKLE_TREE_FFI__: ##
809770
build_merkle_tree_macos:
@@ -828,11 +789,6 @@ test_merkle_tree_go_bindings_linux: build_merkle_tree_linux
828789
@echo "Testing Merkle Tree Go bindings..."
829790
go test ./operator/merkle_tree/... -v
830791

831-
test_merkle_tree_old_go_bindings_macos: build_merkle_tree_macos_old
832-
@echo "Testing Old Merkle Tree Go bindings..."
833-
go test ./operator/merkle_tree_old/... -v
834-
835-
836792
__BUILD_ALL_FFI__:
837793

838794
build_all_ffi: ## Build all FFIs
@@ -843,17 +799,13 @@ build_all_ffi_macos: ## Build all FFIs for macOS
843799
@echo "Building all FFIs for macOS..."
844800
@$(MAKE) build_sp1_macos
845801
@$(MAKE) build_risc_zero_macos
846-
@$(MAKE) build_sp1_macos_old
847-
@$(MAKE) build_risc_zero_macos_old
848802
@$(MAKE) build_merkle_tree_macos
849803
@echo "All macOS FFIs built successfully."
850804

851805
build_all_ffi_linux: ## Build all FFIs for Linux
852806
@echo "Building all FFIs for Linux..."
853807
@$(MAKE) build_sp1_linux
854808
@$(MAKE) build_risc_zero_linux
855-
@$(MAKE) build_sp1_linux_old
856-
@$(MAKE) build_risc_zero_linux_old
857809
@$(MAKE) build_merkle_tree_linux
858810
@echo "All Linux FFIs built successfully."
859811

docker/aligned_base.Dockerfile

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,6 @@ COPY operator/risc_zero/lib/src/ /aligned_layer/operator/risc_zero/lib/src/
5353
WORKDIR /aligned_layer/operator/risc_zero/lib
5454
RUN cargo chef prepare --recipe-path /aligned_layer/operator/risc_zero/lib/recipe.json
5555

56-
# build_sp1_linux_old
57-
COPY operator/sp1_old/lib/Cargo.toml /aligned_layer/operator/sp1_old/lib/Cargo.toml
58-
COPY operator/sp1_old/lib/src/ /aligned_layer/operator/sp1_old/lib/src/
59-
WORKDIR /aligned_layer/operator/sp1_old/lib/src/
60-
RUN cargo chef prepare --recipe-path /aligned_layer/operator/sp1_old/lib/recipe.json
61-
62-
# build_risc_zero_linux_old
63-
COPY operator/risc_zero_old/lib/Cargo.toml /aligned_layer/operator/risc_zero_old/lib/Cargo.toml
64-
COPY operator/risc_zero_old/lib/src/ /aligned_layer/operator/risc_zero_old/lib/src/
65-
WORKDIR /aligned_layer/operator/risc_zero_old/lib/src/
66-
RUN cargo chef prepare --recipe-path /aligned_layer/operator/risc_zero_old/lib/recipe.json
67-
6856
# build_merkle_tree_linux
6957
COPY operator/merkle_tree/lib/Cargo.toml /aligned_layer/operator/merkle_tree/lib/Cargo.toml
7058
COPY operator/merkle_tree/lib/src/ /aligned_layer/operator/merkle_tree/lib/src/
@@ -87,18 +75,6 @@ COPY --from=planner /aligned_layer/operator/risc_zero/lib/recipe.json /aligned_l
8775
WORKDIR /aligned_layer/operator/risc_zero/lib/
8876
RUN cargo chef cook --release --recipe-path /aligned_layer/operator/risc_zero/lib/recipe.json
8977

90-
# build_sp1_linux_old
91-
COPY operator/sp1_old/ /aligned_layer/operator/sp1_old/
92-
COPY --from=planner /aligned_layer/operator/sp1_old/lib/recipe.json /aligned_layer/operator/sp1_old/lib/recipe.json
93-
WORKDIR /aligned_layer/operator/sp1_old/lib/
94-
RUN cargo chef cook --release --recipe-path /aligned_layer/operator/sp1_old/lib/recipe.json
95-
96-
# build_risc_zero_linux_old
97-
COPY operator/risc_zero_old/ /aligned_layer/operator/risc_zero_old/
98-
COPY --from=planner /aligned_layer/operator/risc_zero_old/lib/recipe.json /aligned_layer/operator/risc_zero_old/lib/recipe.json
99-
WORKDIR /aligned_layer/operator/risc_zero_old/lib/
100-
RUN cargo chef cook --release --recipe-path /aligned_layer/operator/risc_zero_old/lib/recipe.json
101-
10278
# build_merkle_tree_linux
10379
COPY operator/merkle_tree/ /aligned_layer/operator/merkle_tree/
10480
COPY --from=planner /aligned_layer/operator/merkle_tree/lib/recipe.json /aligned_layer/operator/merkle_tree/lib/recipe.json
@@ -127,19 +103,6 @@ WORKDIR /aligned_layer/operator/risc_zero/lib
127103
RUN cargo build ${RELEASE_FLAG}
128104
RUN cp /aligned_layer/operator/risc_zero/lib/target/${TARGET_REL_PATH}/librisc_zero_verifier_ffi.so /aligned_layer/operator/risc_zero/lib/librisc_zero_verifier_ffi.so
129105

130-
# build_sp1_linux_old
131-
COPY --from=chef_builder /aligned_layer/operator/sp1_old/lib/target/ /aligned_layer/operator/sp1_old/lib/target/
132-
WORKDIR /aligned_layer/operator/sp1_old/lib
133-
RUN cargo build ${RELEASE_FLAG}
134-
RUN cp /aligned_layer/operator/sp1_old/lib/target/${TARGET_REL_PATH}/libsp1_verifier_old_ffi.so /aligned_layer/operator/sp1_old/lib/libsp1_verifier_old_ffi.so
135-
136-
# build_risc_zero_linux_old
137-
COPY --from=chef_builder /aligned_layer/operator/risc_zero_old/lib/target/ /aligned_layer/operator/risc_zero_old/lib/target/
138-
WORKDIR /aligned_layer/operator/risc_zero_old/lib
139-
RUN cargo build ${RELEASE_FLAG}
140-
RUN cp /aligned_layer/operator/risc_zero_old/lib/target/${TARGET_REL_PATH}/librisc_zero_verifier_old_ffi.so /aligned_layer/operator/risc_zero_old/lib/librisc_zero_verifier_old_ffi.so
141-
142-
143106
# build_merkle_tree_linux
144107
COPY --from=chef_builder /aligned_layer/operator/merkle_tree/lib/target/ /aligned_layer/operator/merkle_tree/lib/target/
145108
WORKDIR /aligned_layer/operator/merkle_tree/lib

operator/pkg/operator.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ import (
1717
"github.com/ethereum/go-ethereum/crypto"
1818
"github.com/urfave/cli/v2"
1919
"github.com/yetanotherco/aligned_layer/operator/risc_zero"
20-
"github.com/yetanotherco/aligned_layer/operator/risc_zero_old"
2120
"golang.org/x/crypto/sha3"
2221

2322
"github.com/prometheus/client_golang/prometheus"
2423
"github.com/yetanotherco/aligned_layer/metrics"
2524

2625
"github.com/yetanotherco/aligned_layer/operator/sp1"
27-
"github.com/yetanotherco/aligned_layer/operator/sp1_old"
2826

2927
"github.com/Layr-Labs/eigensdk-go/crypto/bls"
3028
"github.com/Layr-Labs/eigensdk-go/logging"
@@ -505,26 +503,12 @@ func (o *Operator) verify(verificationData VerificationData, disabledVerifiersBi
505503

506504
case common.SP1:
507505
verificationResult, err := sp1.VerifySp1Proof(verificationData.Proof, verificationData.VmProgramCode)
508-
if !verificationResult {
509-
o.Logger.Infof("SP1 proof verification failed. Trying old SP1 version...")
510-
verificationResult, err = sp1_old.VerifySp1ProofOld(verificationData.Proof, verificationData.VmProgramCode)
511-
if !verificationResult {
512-
o.Logger.Errorf("Old SP1 proof verification failed")
513-
}
514-
}
515506
o.Logger.Infof("SP1 proof verification result: %t", verificationResult)
516507
o.handleVerificationResult(results, verificationResult, err, "SP1 proof verification")
517508

518509
case common.Risc0:
519510
verificationResult, err := risc_zero.VerifyRiscZeroReceipt(verificationData.Proof,
520511
verificationData.VmProgramCode, verificationData.PubInput)
521-
if !verificationResult {
522-
o.Logger.Infof("Risc0 proof verification failed. Trying old Risc0 version...")
523-
verificationResult, err = risc_zero_old.VerifyRiscZeroReceiptOld(verificationData.Proof, verificationData.VmProgramCode, verificationData.PubInput)
524-
if !verificationResult {
525-
o.Logger.Errorf("Old Risc0 proof verification failed")
526-
}
527-
}
528512
o.Logger.Infof("Risc0 proof verification result: %t", verificationResult)
529513
o.handleVerificationResult(results, verificationResult, err, "Risc0 proof verification")
530514
default:

operator/risc_zero_old/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)