diff --git a/cairo1-run/src/cairo_run.rs b/cairo1-run/src/cairo_run.rs index bf654e9724..f22a6edd9a 100644 --- a/cairo1-run/src/cairo_run.rs +++ b/cairo1-run/src/cairo_run.rs @@ -366,6 +366,8 @@ fn build_hints_vec<'b>( (hints, program_hints) } +// Function derived from the cairo-lang-runner crate. +// https://github.com/starkware-libs/cairo/blob/40a7b60687682238f7f71ef7c59c986cc5733915/crates/cairo-lang-runner/src/lib.rs#L551-L552 /// Finds first function ending with `name_suffix`. fn find_function<'a>( sierra_program: &'a SierraProgram, @@ -384,6 +386,8 @@ fn find_function<'a>( .ok_or_else(|| RunnerError::MissingMain) } +// Function derived from the cairo-lang-runner crate. +// https://github.com/starkware-libs/cairo/blob/40a7b60687682238f7f71ef7c59c986cc5733915/crates/cairo-lang-runner/src/lib.rs#L750 /// Creates a list of instructions that will be appended to the program's bytecode. fn create_code_footer() -> Vec { casm! { @@ -527,6 +531,8 @@ fn load_arguments( Ok(()) } +// Function derived from the cairo-lang-runner crate. +// https://github.com/starkware-libs/cairo/blob/40a7b60687682238f7f71ef7c59c986cc5733915/crates/cairo-lang-runner/src/lib.rs#L703 /// Returns the instructions to add to the beginning of the code to successfully call the main /// function, as well as the builtins required to execute the program. fn create_entry_code( @@ -869,6 +875,8 @@ fn create_entry_code( )) } +// Function derived from the cairo-lang-runner crate. +// https://github.com/starkware-libs/cairo/blob/40a7b60687682238f7f71ef7c59c986cc5733915/crates/cairo-lang-runner/src/lib.rs#L577 fn get_info<'a>( sierra_program_registry: &'a ProgramRegistry, ty: &'a cairo_lang_sierra::ids::ConcreteTypeId, diff --git a/vm/src/hint_processor/cairo_1_hint_processor/dict_manager.rs b/vm/src/hint_processor/cairo_1_hint_processor/dict_manager.rs index b95c0b5232..a82a4fa2db 100644 --- a/vm/src/hint_processor/cairo_1_hint_processor/dict_manager.rs +++ b/vm/src/hint_processor/cairo_1_hint_processor/dict_manager.rs @@ -1,3 +1,6 @@ +// Most of the structs and implementations of these Dictionaries are based on the `cairo-lang-runner` crate. +// Reference: https://github.com/starkware-libs/cairo/blob/main/crates/cairo-lang-runner/src/casm_run/dict_manager.rs + use num_traits::One; use crate::stdlib::collections::HashMap; diff --git a/vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs b/vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs index 98bb0a1547..0caf9c4e9c 100644 --- a/vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs +++ b/vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs @@ -71,7 +71,9 @@ impl Cairo1HintProcessor { segment_arena_validations, } } - // Runs a single Hint + // Most of the Hints implementations are derived from the `cairo-lang-runner` crate. + // https://github.com/starkware-libs/cairo/blob/40a7b60687682238f7f71ef7c59c986cc5733915/crates/cairo-lang-runner/src/casm_run/mod.rs#L1681 + /// Runs a single Hint pub fn execute( &self, vm: &mut VirtualMachine,