Skip to content

Commit

Permalink
feat(sdk): make scenario_end returns proof
Browse files Browse the repository at this point in the history
  • Loading branch information
dongchangYoo committed Aug 16, 2024
1 parent 6814964 commit 4582ea2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion sdk/src/multi_prover/scenario/compress_prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn scenario_end<T: Serialize + DeserializeOwned>(
args: &ProveArgs<T>,
core_proof: &Vec<u8>,
compress_proof: &Vec<u8>,
) {
) -> Result<SP1ProofWithPublicValues> {
let compress_proof_obj: SP1ReduceProof<BabyBearPoseidon2> =
bincode::deserialize(compress_proof).unwrap();

Expand All @@ -114,4 +114,6 @@ pub fn scenario_end<T: Serialize + DeserializeOwned>(

client.verify(&proof, &vk).unwrap();
tracing::info!("Successfully verified compress proof");

Ok(proof)
}
6 changes: 4 additions & 2 deletions sdk/src/multi_prover/scenario/plonk_prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::multi_prover::{
operator::{operator_prove_plonk, operator_prove_shrink},
};
use crate::{PlonkBn254Proof, SP1Proof, SP1ProofWithPublicValues};
use anyhow::Result;
use anyhow::{Ok, Result};
use serde::{de::DeserializeOwned, Serialize};
use sp1_prover::SP1CoreProof;
use tracing::info_span;
Expand Down Expand Up @@ -34,7 +34,7 @@ pub fn scenario_end<T: Serialize + DeserializeOwned>(
args: &ProveArgs<T>,
core_proof: &Vec<u8>,
plonk_proof: &Vec<u8>,
) {
) -> Result<SP1ProofWithPublicValues> {
let plonk_proof: PlonkBn254Proof = bincode::deserialize(plonk_proof).unwrap();

let (client, _, _, vk) = common::init_client(args);
Expand All @@ -49,4 +49,6 @@ pub fn scenario_end<T: Serialize + DeserializeOwned>(

client.verify(&proof, &vk).unwrap();
tracing::info!("Successfully verified compress proof");

Ok(proof)
}

0 comments on commit 4582ea2

Please sign in to comment.