Skip to content

Commit

Permalink
stav: extract information for the prover from the runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Stavbe committed Mar 5, 2025
1 parent 3f3df3e commit 1801cf6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions vm/src/vm/runners/cairo_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,28 @@ impl CairoRunner {
})
.collect()
}

pub fn get_info_for_prover_input(&self) -> Result<ProverInfo, RunnerError> {
Ok(ProverInfo {
relocatble_trace: self
.vm
.trace.clone()
.ok_or(RunnerError::Trace(TraceError::TraceNotEnabled))?,
relocatble_memory: self.vm.segments.memory.data.clone(),
public_memory_addresses: self.vm.segments.public_memory_offsets.clone(),
builtins_segments: self.get_builtin_segment_info_for_pie()?
})
}
}

//* ----------------------
//* ProverInfo
//* ----------------------
pub struct ProverInfo {
pub relocatble_trace: Vec<TraceEntry>,
pub relocatble_memory: Vec<Vec<MemoryCell>>,
pub public_memory_addresses: HashMap<usize, Vec<(usize, usize)>>,
pub builtins_segments: HashMap<BuiltinName, cairo_pie::SegmentInfo>,
}

#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down

0 comments on commit 1801cf6

Please sign in to comment.