Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YoGhurt111 committed Oct 11, 2024
1 parent 11190cc commit 928363e
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions packages/taiko-client/prover/proof_producer/zkvm_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ import (
)

const (
ZKProofTypeR0 = "risc0"
ZKProofTypeSP1 = "sp1"
ZKProofTypeR0 = "risc0"
ZKProofTypeSP1 = "sp1"
RecursionPlonk = "plonk"
RecursionCompressed = "compressed"
)

var (
Expand Down Expand Up @@ -203,7 +205,15 @@ func (s *ZKvmProofProducer) requestProof(
ctx context.Context,
opts *ProofRequestOptions,
) (*RaikoRequestProofBodyResponseV2, error) {
var reqBody RaikoRequestProofBody
var (
reqBody RaikoRequestProofBody
recursion string
)
if opts.Compressed {
recursion = RecursionCompressed
} else {
recursion = RecursionPlonk
}
switch s.ZKProofType {
case ZKProofTypeSP1:
reqBody = RaikoRequestProofBody{
Expand All @@ -212,7 +222,7 @@ func (s *ZKvmProofProducer) requestProof(
Prover: opts.ProverAddress.Hex()[2:],
Graffiti: opts.Graffiti,
SP1: &SP1RequestProofBodyParam{
Recursion: "compressed",
Recursion: recursion,
Prover: "network",
Verify: true,
},
Expand Down Expand Up @@ -285,7 +295,15 @@ func (s *ZKvmProofProducer) requestCancel(
ctx context.Context,
opts *ProofRequestOptions,
) error {
var reqBody RaikoRequestProofBody
var (
reqBody RaikoRequestProofBody
recursion string
)
if opts.Compressed {
recursion = RecursionCompressed
} else {
recursion = RecursionPlonk
}
switch s.ZKProofType {
case ZKProofTypeSP1:
reqBody = RaikoRequestProofBody{
Expand All @@ -294,7 +312,7 @@ func (s *ZKvmProofProducer) requestCancel(
Prover: opts.ProverAddress.Hex()[2:],
Graffiti: opts.Graffiti,
SP1: &SP1RequestProofBodyParam{
Recursion: "compressed",
Recursion: recursion,
Prover: "network",
Verify: true,
},
Expand Down

0 comments on commit 928363e

Please sign in to comment.