Skip to content

Commit 43b85a1

Browse files
JulianGCalderonfmolettaFrancoGiachetta
authored
Improve documentation (#2006)
* Add comment on proof-mode extra step * Add comment on temporary segments * Update vm/src/vm/vm_memory/memory.rs Co-authored-by: fmoletta <[email protected]> * Update vm/src/vm/vm_memory/memory.rs Co-authored-by: fmoletta <[email protected]> * Update vm/src/vm/vm_memory/memory.rs Co-authored-by: Franco Giachetta <[email protected]> --------- Co-authored-by: fmoletta <[email protected]> Co-authored-by: Franco Giachetta <[email protected]>
1 parent 5de9a24 commit 43b85a1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

vm/src/cairo_run.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ pub fn cairo_run_program_with_initial_scope(
9595
.map_err(|err| VmException::from_vm_error(&cairo_runner, err))?;
9696

9797
if cairo_run_config.proof_mode {
98+
// we run an additional step to ensure that `end` is the last step execute,
99+
// rather than the one after it.
98100
cairo_runner.run_for_steps(1, hint_processor)?;
99101
}
100102
cairo_runner.end_run(

vm/src/vm/vm_memory/memory.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ impl AddressSet {
158158

159159
pub struct Memory {
160160
pub(crate) data: Vec<Vec<MemoryCell>>,
161+
/// Temporary segments are used when it's necessary to write data, but we
162+
/// don't know yet where it will be located. These segments will eventually
163+
/// be relocated to the main memory according to the `relocation_rules`. For
164+
/// example, dictionaries are required to be contiguous, so each is stored in a
165+
/// temporary segment and eventually relocated to a single segment.
161166
pub(crate) temp_data: Vec<Vec<MemoryCell>>,
162167
// relocation_rules's keys map to temp_data's indices and therefore begin at
163168
// zero; that is, segment_index = -1 maps to key 0, -2 to key 1...

0 commit comments

Comments
 (0)