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

Cairo1 proof mode #1517

Merged
merged 21 commits into from
Dec 20, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove unused comments
MauroToscano committed Dec 15, 2023
commit f8877d1684c72b40c1a57e5c6fd6ffb53ddd985c
8 changes: 3 additions & 5 deletions cairo1-run/src/main.rs
Original file line number Diff line number Diff line change
@@ -468,7 +468,7 @@ fn create_code_footer() -> Vec<Instruction> {
/// function, as well as the builtins required to execute the program.
fn create_entry_code(
sierra_program_registry: &ProgramRegistry<CoreType, CoreLibfunc>,
casm_program: &CairoProgram,
_casm_program: &CairoProgram,
type_sizes: &UnorderedHashMap<ConcreteTypeId, i16>,
func: &Function,
initial_gas: usize,
@@ -549,14 +549,12 @@ fn create_entry_code(
// actual: args.len(),
// });
// }
/*
let _before_final_call = ctx.current_code_offset;
let final_call_size = 3;
let offset = final_call_size
+ casm_program.debug_info.sierra_statement_info[func.entry_point.0].code_offset;

println!("Offset: {}", offset);
println!("Ins: {}", ctx.instructions.len());

*/
// Original header code is not needed, it's going to be replaced by proof mode instructions
/*
casm_extend! {ctx,
10 changes: 1 addition & 9 deletions vm/src/vm/runners/cairo_runner.rs
Original file line number Diff line number Diff line change
@@ -439,7 +439,7 @@ impl CairoRunner {
vm: &mut VirtualMachine,
) -> Result<Relocatable, RunnerError> {
let mut stack = Vec::new();
println!("Runners {}", vm.builtin_runners.len());

for builtin_runner in vm.builtin_runners.iter() {
stack.append(&mut builtin_runner.initial_stack());
}
@@ -470,8 +470,6 @@ impl CairoRunner {
MaybeRelocatable::RelocatableValue(end),
]);

let stack_len_minus_one = stack_prefix.len() - 1;
println!("Stack len minus one: {}", stack_len_minus_one);
self.execution_public_memory = Some(Vec::from_iter(0..stack_prefix.len()));

self.initialize_state(
@@ -566,12 +564,6 @@ impl CairoRunner {
vm: &mut VirtualMachine,
hint_processor: &mut dyn HintProcessor,
) -> Result<(), VirtualMachineError> {
println!(
"PC, FP, AP: {} {} {} ",
vm.get_pc(),
vm.get_fp(),
vm.get_ap()
);
let references = &self.program.shared_program_data.reference_manager;
let hint_data = self.get_hint_data(references, hint_processor)?;
#[cfg(feature = "hooks")]