-
Notifications
You must be signed in to change notification settings - Fork 330
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
feat: better reduce api #1486
feat: better reduce api #1486
Conversation
crates/core/executor/src/reduce.rs
Outdated
@@ -0,0 +1,23 @@ | |||
use serde::{de::DeserializeOwned, Deserialize, Serialize}; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove empty line
crates/core/executor/src/io.rs
Outdated
use sp1_stark::{baby_bear_poseidon2::BabyBearPoseidon2, ShardProof, StarkVerifyingKey}; | ||
use sp1_stark::{baby_bear_poseidon2::BabyBearPoseidon2, StarkVerifyingKey}; | ||
|
||
use crate::SP1ReduceProof; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove empty line
crates/core/executor/src/subproof.rs
Outdated
@@ -3,9 +3,11 @@ | |||
use std::sync::atomic::AtomicBool; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove emtpy line
crates/prover/src/utils.rs
Outdated
pub fn sp1_vkey_digest_babybear(proof: &SP1ReduceProof<BabyBearPoseidon2Outer>) -> [BabyBear; 8] { | ||
let proof = &proof.proof; | ||
let pv: &RecursionPublicValues<BabyBear> = proof.public_values.as_slice().borrow(); | ||
pv.sp1_vk_digest | ||
} | ||
|
||
pub fn sp1_vkey_digest_bn254(proof: &SP1ReduceProof<BabyBearPoseidon2Outer>) -> Bn254Fr { | ||
babybears_to_bn254(&sp1_vkey_digest_babybear(proof)) | ||
} | ||
|
||
pub fn sp1_commited_values_digest_bn254(proof: &SP1ReduceProof<BabyBearPoseidon2Outer>) -> Bn254Fr { | ||
let proof = &proof.proof; | ||
let pv: &RecursionPublicValues<BabyBear> = proof.public_values.as_slice().borrow(); | ||
let committed_values_digest_bytes: [BabyBear; 32] = | ||
words_to_bytes(&pv.committed_value_digest).try_into().unwrap(); | ||
babybear_bytes_to_bn254(&committed_values_digest_bytes) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add doc comments for these functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits and missing docs for some functions, otherwise LGTM.
SP1 Performance Test Results Branch: tamir/better-reduce-api
|
No description provided.