Skip to content

Commit 7216d32

Browse files
committed
feat: fmt
1 parent c6ad463 commit 7216d32

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

crates/prover/src/lib.rs

+38-40
Original file line numberDiff line numberDiff line change
@@ -997,13 +997,11 @@ impl<C: SP1ProverComponents> SP1Prover<C> {
997997
#[cfg(any(test, feature = "export-tests"))]
998998
pub mod tests {
999999

1000-
use std::{
1001-
fs::File,
1002-
io::{Read, Write},
1003-
};
1000+
use std::{fs::File, io::Read, io::Write};
10041001

10051002
use super::*;
10061003

1004+
use crate::build::try_build_plonk_bn254_artifacts_dev;
10071005
use anyhow::Result;
10081006
use build::try_build_groth16_bn254_artifacts_dev;
10091007
use p3_field::PrimeField32;
@@ -1041,42 +1039,42 @@ pub mod tests {
10411039
let core_proof = prover.prove_core(&pk, &stdin, opts, context)?;
10421040
let public_values = core_proof.public_values.clone();
10431041

1044-
// tracing::info!("verify core");
1045-
// prover.verify(&core_proof.proof, &vk)?;
1042+
tracing::info!("verify core");
1043+
prover.verify(&core_proof.proof, &vk)?;
10461044

1047-
// if test_kind == Test::Core {
1048-
// return Ok(());
1049-
// }
1045+
if test_kind == Test::Core {
1046+
return Ok(());
1047+
}
10501048

1051-
// tracing::info!("compress");
1052-
// let compress_span = tracing::debug_span!("compress").entered();
1053-
// let compressed_proof = prover.compress(&vk, core_proof, vec![], opts)?;
1054-
// compress_span.exit();
1049+
tracing::info!("compress");
1050+
let compress_span = tracing::debug_span!("compress").entered();
1051+
let compressed_proof = prover.compress(&vk, core_proof, vec![], opts)?;
1052+
compress_span.exit();
10551053

1056-
// tracing::info!("verify compressed");
1057-
// prover.verify_compressed(&compressed_proof, &vk)?;
1054+
tracing::info!("verify compressed");
1055+
prover.verify_compressed(&compressed_proof, &vk)?;
10581056

1059-
// if test_kind == Test::Compress {
1060-
// return Ok(());
1061-
// }
1057+
if test_kind == Test::Compress {
1058+
return Ok(());
1059+
}
10621060

1063-
// tracing::info!("shrink");
1064-
// let shrink_proof = prover.shrink(compressed_proof, opts)?;
1061+
tracing::info!("shrink");
1062+
let shrink_proof = prover.shrink(compressed_proof, opts)?;
10651063

1066-
// tracing::info!("verify shrink");
1067-
// prover.verify_shrink(&shrink_proof, &vk)?;
1064+
tracing::info!("verify shrink");
1065+
prover.verify_shrink(&shrink_proof, &vk)?;
10681066

1069-
// if test_kind == Test::Shrink {
1070-
// return Ok(());
1071-
// }
1067+
if test_kind == Test::Shrink {
1068+
return Ok(());
1069+
}
10721070

1073-
// tracing::info!("wrap bn254");
1074-
// let wrapped_bn254_proof = prover.wrap_bn254(shrink_proof, opts)?;
1075-
// let bytes = bincode::serialize(&wrapped_bn254_proof).unwrap();
1071+
tracing::info!("wrap bn254");
1072+
let wrapped_bn254_proof = prover.wrap_bn254(shrink_proof, opts)?;
1073+
let bytes = bincode::serialize(&wrapped_bn254_proof).unwrap();
10761074

1077-
// // Save the proof.
1078-
// let mut file = File::create("proof-with-pis.bin").unwrap();
1079-
// file.write_all(bytes.as_slice()).unwrap();
1075+
// Save the proof.
1076+
let mut file = File::create("proof-with-pis.bin").unwrap();
1077+
file.write_all(bytes.as_slice()).unwrap();
10801078

10811079
// Load the proof.
10821080
let mut file = File::open("proof-with-pis.bin").unwrap();
@@ -1100,16 +1098,16 @@ pub mod tests {
11001098
let vk_digest_bn254 = wrapped_bn254_proof.sp1_vkey_digest_bn254();
11011099
assert_eq!(vk_digest_bn254, vk.hash_bn254());
11021100

1103-
// tracing::info!("generate plonk bn254 proof");
1104-
// let artifacts_dir = try_build_plonk_bn254_artifacts_dev(
1105-
// &wrapped_bn254_proof.vk,
1106-
// &wrapped_bn254_proof.proof,
1107-
// );
1108-
// let plonk_bn254_proof =
1109-
// prover.wrap_plonk_bn254(wrapped_bn254_proof.clone(), &artifacts_dir);
1110-
// println!("{:?}", plonk_bn254_proof);
1101+
tracing::info!("generate plonk bn254 proof");
1102+
let artifacts_dir = try_build_plonk_bn254_artifacts_dev(
1103+
&wrapped_bn254_proof.vk,
1104+
&wrapped_bn254_proof.proof,
1105+
);
1106+
let plonk_bn254_proof =
1107+
prover.wrap_plonk_bn254(wrapped_bn254_proof.clone(), &artifacts_dir);
1108+
println!("{:?}", plonk_bn254_proof);
11111109

1112-
// prover.verify_plonk_bn254(&plonk_bn254_proof, &vk, &public_values, &artifacts_dir)?;
1110+
prover.verify_plonk_bn254(&plonk_bn254_proof, &vk, &public_values, &artifacts_dir)?;
11131111

11141112
tracing::info!("generate groth16 bn254 proof");
11151113
let artifacts_dir = try_build_groth16_bn254_artifacts_dev(

crates/recursion/circuit-v2/src/utils.rs

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pub fn felts_to_bn254_var<C: Config>(
6666
result
6767
}
6868

69+
#[allow(dead_code)]
6970
pub fn felt_bytes_to_bn254_var<C: Config>(
7071
builder: &mut Builder<C>,
7172
bytes: &[Felt<C::F>; 32],
@@ -91,6 +92,7 @@ pub fn felt_bytes_to_bn254_var<C: Config>(
9192
result
9293
}
9394

95+
#[allow(dead_code)]
9496
pub fn words_to_bytes<T: Copy>(words: &[Word<T>]) -> Vec<T> {
9597
words.iter().flat_map(|w| w.0).collect::<Vec<_>>()
9698
}

0 commit comments

Comments
 (0)