Skip to content

Commit

Permalink
better prints to the end user
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoalt committed Oct 25, 2024
1 parent d0a14c6 commit f4b1e2a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions powdr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ impl Session {
let vkey = Path::new(&self.out_path).join(DEFAULT_VKEY);

if generate_artifacts {
println!("Creating program ZK setup. This has to be done only once per program.");
self.pipeline.compute_fixed_cols().unwrap();
self.pipeline.setup_backend().unwrap();
self.export_setup();
self.pipeline.set_pkey_file(pkey.clone());
self.pipeline.set_vkey_file(vkey.clone());
} else {
println!("Loading program ZK setup.");
if self
.pipeline
.read_constants_mut(Path::new(&self.out_path))
Expand Down Expand Up @@ -191,7 +193,7 @@ pub fn pipeline_from_guest(
min_degree_log: u32,
max_degree_log: u32,
) -> Pipeline<GoldilocksField> {
log::info!("Compiling guest program...");
println!("Compiling guest program...");

let (asm_file_path, asm_contents) =
build_guest(guest_path, out_path, min_degree_log, max_degree_log);
Expand All @@ -203,7 +205,7 @@ pub fn pipeline_from_guest(
}

pub fn run(pipeline: &mut Pipeline<GoldilocksField>) {
log::info!("Running powdr-riscv executor in fast mode...");
println!("Running powdr-riscv executor in fast mode...");
let start = Instant::now();

let program = pipeline.compute_analyzed_asm().unwrap().clone();
Expand All @@ -219,8 +221,8 @@ pub fn run(pipeline: &mut Pipeline<GoldilocksField>) {
);

let duration = start.elapsed();
log::info!("Fast executor took: {:?}", duration);
log::info!("Trace length: {}", trace.len);
println!("Fast executor took: {duration:?}");
println!("Trace length: {}", trace.len);
}

pub fn prove(pipeline: &mut Pipeline<GoldilocksField>) {
Expand All @@ -243,20 +245,20 @@ pub fn prove(pipeline: &mut Pipeline<GoldilocksField>) {
let duration = start.elapsed();
log::info!("Generating witness took: {duration:?}");

log::info!("Generating proof...");
println!("Generating proof...");
let start = Instant::now();

pipeline.compute_proof().unwrap();

let duration = start.elapsed();
log::info!("Proof generation took: {:?}", duration);
println!("Proof generation took: {duration:?}");

Ok(())
};

pipeline.rollback_from_witness();

log::info!("Running witness and proof generation for all chunks...");
println!("Running witness and proof generation for all chunks...");
let start = Instant::now();
riscv::continuations::rust_continuations(pipeline, generate_proof, bootloader_inputs).unwrap();
let duration = start.elapsed();
Expand Down

0 comments on commit f4b1e2a

Please sign in to comment.