Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
make vm_memory_queue_states local
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed Jan 25, 2024
1 parent d8c2deb commit a8e3b26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/witness/full_block_artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ pub struct FullBlockArtifacts<F: SmallField> {

// all the RAM (without accumulation into the queue)
pub vm_memory_queries_accumulated: Vec<(u32, MemoryQuery)>,
pub vm_memory_queue_states: Vec<(u32, bool, MemoryQueueState<F>)>,
//
pub all_memory_queries_accumulated: Vec<MemoryQuery>,
// all the RAM queue states
Expand Down
10 changes: 4 additions & 6 deletions src/witness/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ pub fn create_artifacts_from_tracer<

let storage_application_circuits;
let storage_application_compact_forms;
let mut vm_memory_queue_states = vec![];

let artifacts = {
let mut artifacts = FullBlockArtifacts::default();
Expand Down Expand Up @@ -1010,8 +1011,7 @@ pub fn create_artifacts_from_tracer<
.memory_queue_simulator
.push_and_output_intermediate_data(*query, round_function);

this.vm_memory_queue_states
.push((*cycle, false, intermediate_info));
vm_memory_queue_states.push((*cycle, false, intermediate_info));
this.all_memory_queue_states.push(intermediate_info);
}

Expand Down Expand Up @@ -1312,8 +1312,7 @@ pub fn create_artifacts_from_tracer<
// first find the memory witness by scanning all the known states
// and finding the latest one with cycle index < current

let memory_queue_state_for_entry = artifacts
.vm_memory_queue_states
let memory_queue_state_for_entry = vm_memory_queue_states
.iter()
.take_while(|el| el.0 < initial_state.at_cycle)
.last()
Expand Down Expand Up @@ -1497,8 +1496,7 @@ pub fn create_artifacts_from_tracer<
.clone(),
);

let final_memory_queue_state = artifacts
.vm_memory_queue_states
let final_memory_queue_state = vm_memory_queue_states
.last()
.map(|el| transform_sponge_like_queue_state(el.2))
.unwrap_or(QueueState::placeholder_witness());
Expand Down

0 comments on commit a8e3b26

Please sign in to comment.