Skip to content
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: info spans for prover execute instances #893

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions core/src/utils/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ where
let mut checkpoints = Vec::new();
let (public_values_stream, public_values) = loop {
// Execute the runtime until we reach a checkpoint.
let (checkpoint, done) = runtime
.execute_state()
let (checkpoint, done) = tracing::info_span!("collect_checkpoints")
.in_scope(|| runtime.execute_state())
.map_err(SP1CoreProverError::ExecutionError)?;

// Save the checkpoint to a temp file.
Expand Down Expand Up @@ -162,8 +162,9 @@ where
let mut shard_main_datas = Vec::new();
let mut challenger = machine.config().challenger();
vk.observe_into(&mut challenger);
for checkpoint_file in checkpoints.iter_mut() {
let mut record = trace_checkpoint(program.clone(), checkpoint_file, opts);
for (num, checkpoint_file) in checkpoints.iter_mut().enumerate() {
let mut record = tracing::info_span!("commit_checkpoint", num)
.in_scope(|| trace_checkpoint(program.clone(), checkpoint_file, opts));
record.public_values = public_values;
reset_seek(&mut *checkpoint_file);

Expand All @@ -185,9 +186,10 @@ where

// For each checkpoint, generate events and shard again, then prove the shards.
let mut shard_proofs = Vec::<ShardProof<SC>>::new();
for mut checkpoint_file in checkpoints.into_iter() {
for (num, mut checkpoint_file) in checkpoints.into_iter().enumerate() {
let checkpoint_shards = {
let mut events = trace_checkpoint(program.clone(), &checkpoint_file, opts);
let mut events = tracing::info_span!("prove_checkpoint", num)
.in_scope(|| trace_checkpoint(program.clone(), &checkpoint_file, opts));
events.public_values = public_values;
reset_seek(&mut checkpoint_file);
tracing::debug_span!("shard").in_scope(|| machine.shard(events, &sharding_config))
Expand Down Expand Up @@ -215,6 +217,7 @@ where
.collect::<Vec<_>>();
shard_proofs.append(&mut checkpoint_proofs);
}

let proof = MachineProof::<SC> { shard_proofs };

// Print the summary.
Expand Down
Loading