This circuit takes a queue of decommit requests for DecommitSorter circuit. For each decommit request, it checks that the linear hash of all opcodes will be equal to this hash that is stored in the decommit request. Also, it writes code to the corresponding memory page. Briefly, it unpacks the queue from the opcode and updates the memory queue and check correctness.
We chose what memory_queue state and decommitments_queue state to continue to work with.
let requests_queue_state =QueueState::conditionally_select( cs, structured_input.start_flag,&structured_input.observable_input.sorted_requests_queue_initial_state,&structured_input.hidden_fsm_input.decommittment_requests_queue_state,);let memory_queue_state =QueueState::conditionally_select( cs, structured_input.start_flag,&structured_input.observable_input.memory_queue_initial_state,&structured_input.hidden_fsm_input.memory_queue_state,);
We do the same with inner FSM part.
let initial_state =CodeDecommittmentFSM::conditionally_select( cs, structured_input.start_flag,&starting_fsm_state,&structured_input.hidden_fsm_input.internal_fsm,);
for (part_of_first, part_of_second) in hash.inner.iter().zip(state.hash_to_compare_against.inner.iter()){Num::conditionally_enforce_equal( cs, finalize,&part_of_first.into_num(),&part_of_second.into_num(), );}