Skip to content

Releases: lambdaclass/cairo-vm

v2.0.0-rc1

12 Dec 14:44
388a4e5

Choose a tag to compare

v2.0.0-rc1 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v2.0.0-rc0...v2.0.0-rc1

v2.0.0-rc-0

23 Oct 15:14
d2257d6

Choose a tag to compare

v2.0.0-rc-0 Pre-release
Pre-release
  • chore: bump cairo-lang- dependencies to 2.9.0-dev.0 #1858

  • chore: update Rust required version to 1.81.0 #1857

  • feat(BREAKING): #1824#1838:

    • Add support for dynamic layout
    • CLI change(BREAKING): The flag cairo_layout_params_file must be specified when using dynamic layout.
    • Signature change(BREAKING): Both CairoRunner::new and CairoRunner::new_v2 now receive an Option<CairoLayoutParams>, used only with dynamic layout.
  • fix: #1841:

    • Fix modulo builtin to comply with prover constraints
  • chore: bump pip cairo-lang 0.13.2 #1827

  • chore: bump cairo-lang- dependencies to 2.8.0 #1833

    • chore: update Rust required version to 1.80.0
  • fix: Added the following VM fixes: #1820

    • Fix zero segment location.
    • Fix has_zero_segment naming.
    • Fix prover input.
    • Fix version reading when no version is supplied.
  • chore: bump cairo-lang- dependencies to 2.7.1 #1823

v1.0.1

12 Aug 17:55
93f1f54

Choose a tag to compare

  • fix(BREAKING): #1818:

    • Fix MemorySegmentManager::add_zero_segment function when resizing a segment
    • Signature change(BREAKING): MemorySegmentManager::get_memory_holes now receives builtin_segment_indexes: HashSet<usize>
  • fix(BREAKING): Replace CairoRunner method initialize_all_builtins with initialize_program_builtins. Now it only initializes program builtins instead of all of them

v1.0.0

01 Aug 16:49
4147633

Choose a tag to compare

  • chore: bump cairo-lang- dependencies to 2.7.0 #1813

  • fix(BREAKING): Don't assume output builtin is first when counting memory holes

    • Logic change: Memory hole counting no longer asumes that the output builtin ocuppies the first builtin segment if present
    • Signature change: MemorySegmentManager method get_memory_holes now receives the index of the output builtin (as an Option<usize>) instead of the boolean argument has_output_builtin#1811
  • fix: ambiguous keccak module name use on external contexts #1809

v1.0.0-rc6

01 Aug 16:48
24c2349

Choose a tag to compare

v1.0.0-rc6 Pre-release
Pre-release
  • chore: bump cairo-lang- dependencies to 2.7.0-rc.3 #1807
    • chore: update Rust required version to 1.76.0

v1.0.0-rc5

13 Jul 00:17
309c8a7

Choose a tag to compare

v1.0.0-rc5 Pre-release
Pre-release
  • fix: Fixed deserialization of negative numbers in scientific notation #1804

v1.0.0-rc4

06 Jul 12:29
bb491f2

Choose a tag to compare

v1.0.0-rc4 Pre-release
Pre-release
  • chore: bump cairo-lang- dependencies to 2.6.4 #1799

    • fix: revert breaking change on public input serialization
  • fix: Remove validation of CairoPie memory values #1783

  • fix: Handle GasBuiltin in cairo1-run crate #1789

    • Load initial_gas into vm instead of creating it via instructions.
    • Fix bug affecting programs with input arguments and gas builtin.
  • fix: Change (de)serialization of CairoPie's OutputBuiltinAdditionalData's PublicMemoryPage to vectors of length 2. #1781

  • fix: Fixed deserialization issue when signature additional data is empty, and the name of the builtin range_check96 #1785

  • refactor + bugfix: Improve arg handling for cairo1-run #1782

    • Now uses ascii whitespace as separator, preventing errors when using newlines in args file
    • No longer gets stuck on improperly-formatted arrays
    • Returns an informative clap error upon invalid felt strings instead of unwrapping
  • fix: Ignore memory order when comparing instances of CairoPieMemory #1780

  • feat: Add EXCESS_BALANCE hint #1777

  • feat(BREAKING): Use a cheatcode to relocate all dicts + Make temporary segment usage configurable #1776

    • Add the flags segment_arena_validation & use_temporary_segments to the Cairo1HintProcessor & DictManagerExecScope respectively. These flags will determine if real segments or temporary segments will be used when creating dictionaries.
    • DictManagerExecScope::finalize_segment no longer performs relocation and is ignored if use_temporary_segments is set to false.
    • Add method DictManagerExecScope::relocate_all_dictionaries that adds relocation rules for all tracked dictionaries, relocating them one next to the other in a new segment.
    • Add cheatcode RelocateAllDictionaries to the Cairo1HintProcessor, which calls the aforementioned method.
    • Add casm instruction to call the aforementioned cheatcode in create_entry_code if either proof_mode or append_return_values are set to true, and segment arena is present.
  • Bump starknet-types-core version + Use the lib's pedersen hash #1734

  • refactor: Add boolean method Cairo1RunConfig::copy_to_output + Update Doc #1778

  • feat: Filter implicit arguments from return value in cairo1-run crate #1775

  • feat(BREAKING): Serialize inputs into output segment in cairo1-run crate:

    • Checks that only Array<Felt252> can be received by the program main function when running with with either --proof_mode or --append_return_values.

    • Copies the input value to the output segment right after the output in the format [array_len, arr[0], arr[1],.., arr[n]].

                * feat: specify initial value for `exec_scopes` in `cairo_run_program` [1772](https://github.com/lambdaclass/cairo-vm/pull/1772)
      
  • fix: make MemorySegmentManager.finalize() public #1771

  • feat: load Cairo PIE from bytes #1773

  • feat(BREAKING): Serialize Array<Felt252> return value into output segment in cairo1-run crate:

    • Checks that only PanicResult<Array<Felt252>> or Array<Felt252> can be returned by the program when running with either --proof_mode or --append_return_values.
    • Serializes return values into the output segment under the previous conditions following the format:
      • PanicResult<Array<Felt252>> -> [panic_flag, array_len, arr[0], arr[1],.., arr[n]]
      • <Array<Felt252> -> [array_len, arr[0], arr[1],.., arr[n]]
  • feat: Handle BoundedInt variant in serialize_output, cairo1-run crate #1768

  • fix: make OutputBuiltinState public #1769

  • feat: Load arguments into VM instead of creating them via instructions in cairo1-run #1759

v0.9.3

07 Jun 18:23
e3a244e

Choose a tag to compare

  • feat: Add EXCESS_BALANCE hint #1777

v1.0.0-rc3

14 May 21:46
aecbb3f

Choose a tag to compare

v1.0.0-rc3 Pre-release
Pre-release
  • bugfix: Fix handling of return values wrapped in PanicResult in cairo1-run crate #1763

  • refactor(BREAKING): Move the VM back to the CairoRunner #1743

    • CairoRunner has a new public field vm: VirtualMachine
    • CairoRunner no longer derives Debug
    • CairoRunner methods new_v2 & new take an extra boolean argument trace_enabled.
    • Functions cairo_run , cairo_run_program & cairo_run_fuzzed_program from vm crate and cairo_run_program from cairo1-run crate now retun only CairoRunner instead of (CairoRunner, VirtualMachine)
    • CairoRunner methods no longer take a reference to VirtualMachine. Methods that took an immutable reference to self and a mutable reference to the VM now take a mutable reference to self. Affected methods:
      • initialize
      • initialize_builtins
      • initialize_all_builtins
      • initialize_segments
      • initialize_state
      • initialize_function_entrypoint
      • initialize_state
      • initialize_main_entrypoint
      • initialize_vm
      • run_until_pc
      • run_for_steps
      • run_until_steps
      • run_until_power_of_2
      • get_perm_range_check_limits
      • check_range_check_usage
      • get_memory_holes
      • check_diluted_check_usage
      • end_run
      • relocate_trace
      • relocate_memory
      • relocate
      • get_builtin_segments_info
      • get_builtin_segments_info_for_pie
      • get_execution_resources
      • finalize_segments
      • run_from_entrypoint
      • check_used_cells
      • check_memory_usage
      • initialize_function_runner_cairo_1
      • initialize_function_runner
      • read_return_values
      • get_builtins_final_stack
      • get_cairo_pie
      • get_air_public_input
      • get_air_private_input
      • get_memory_segment_addresses
    • Functions & methods taking a reference to CairoRunner & VirtualMachine now only take a reference to CairoRunner:
      • start_tracer
      • VmException::from_vm_error
      • get_error_attr_value
      • get_traceback
      • verify_secure_runner
    • [hooks feature] BeforeFirstStepHookFunc dyn Fn no longer takes a mutable reference to CairoRunner, along with VirtualMachine::execute_before_first_step.
  • fix: add support for arrays shorter than 2 as arguments for cairo1-run #1737

  • bugfix: Fix BuiltinRunner::final_stack for SegmentArena#1747

  • feat: unify arbitrary, hooks, print and skip_next_instruction_hint features as a single test_utils feature #1755

    • BREAKING: removed the above features
  • bugfix: cairo1-run CLI: Set finalize_builtins to true when using --air_public_input flag #1744

  • feat: Add hint U256InvModN to Cairo1HintProcessor #1744

  • perf: use a more compact representation for MemoryCell #1672

    • BREAKING: Memory::get_value will now always return Cow::Owned variants, code that relied on Cow::Borrowed may break

v1.0.0-rc2

03 May 19:08
f3161e3

Choose a tag to compare

v1.0.0-rc2 Pre-release
Pre-release
  • cairo1-run CLI: Allow loading arguments from file#1739

  • BREAKING: Remove unused CairoRunner field original_steps#1742

  • feat: Add --run_from_cairo_pie to cairo-vm-cli + workflow #1730

  • Serialize directly into writer in CairoPie::write_zip_file#1736

  • feat: Add support for cairo1 run with segements arena validation.

    • Refactored the runner CASM code generation to user a more high level builder.
    • Added segment merging of the dictionary segments.
    • Added validation of the generated segment arena in cairo1 run.
  • refactor: Add lib.rs to cairo1-run#1714

  • feat: Implement CairoPie::read_zip_file#1729

  • feat: Bump to 2.6.3 + Remove gas checks#1709

    • Bump cairo_lang crates & corelib to v2.6.3
    • Disable gas checks when compiling to sierra & casm
    • Add Known bugs & issues segment to README, poining out issues derived from the removal of gas checks and cairo v2.6.3
  • feat: Implement running from CairoPie#1720

    • Add function cairo_run_pie
    • Add CairoPie methods run_validity_checks & check_pie_compatibility
    • Add Program method from_stripped_program
  • bugfix: Don't assume outer deref when fetching integer values from references#1732

  • feat: Implement extend_additional_data for BuiltinRunner#1726

  • BREAKING: Set dynamic params as null by default on air public input #1716

    • PublicInput field layout_params renamed to dynamic_params & type changed from&'a CairoLayout to ().
  • feat: cairo1-run accepts Sierra programs #1719

  • refactor(BREAKING): Use BuiltinName enum instead of string representation #1722

    • BuiltinName moved from crate::serde::deserialize_program module to crate::types::builtin_name.
      • Implement BuiltinName methods to_str, to_str_with_suffix, from_str & from_str_with_suffix.
    • Remove BuiltinName method name.
    • All builtin-related error variants now store BuiltinName instead of &'static str or String.
    • Remove constants: OUTPUT_BUILTIN_NAME, HASH_BUILTIN_NAME, RANGE_CHECK_BUILTIN_NAME,RANGE_CHECK_96_BUILTIN_NAME, SIGNATURE_BUILTIN_NAME, BITWISE_BUILTIN_NAME, EC_OP_BUILTIN_NAME, KECCAK_BUILTIN_NAME, POSEIDON_BUILTIN_NAME, SEGMENT_ARENA_BUILTIN_NAME, ADD_MOD_BUILTIN_NAME &
      MUL_MOD_BUILTIN_NAME.
    • Remove BuiltinRunner & ModBuiltinRunner method identifier
    • Structs containing string representation of builtin names now use BuiltinName instead:
      • AirPrivateInput(pub HashMap<&'static str, Vec<PrivateInput>>) -> AirPrivateInput(pub HashMap<BuiltinName, Vec<PrivateInput>>).
      • CairoPieMetadata field additional_data: HashMap<String, BuiltinAdditionalData>, -> CairoPieAdditionalData with CairoPieAdditionalData(pub HashMap<BuiltinName, BuiltinAdditionalData>)
      • CairoPieMetadata field builtin_segments: HashMap<String, SegmentInfo> -> HashMap<BuiltinName, SegmentInfo>.
      • ExecutiobResources field builtin_instance_counter: HashMap<String, usize> -> HashMap<BuiltinName, usize>
    • Methods returning string representation of builtin names now use BuiltinName instead:
      • BuiltinRunner, ModBuiltinRunner & RangeCheckBuiltinRunner method name: &'static str -> BuiltinName.
      • CairoRunner method get_builtin_segment_info_for_pie: Result<HashMap<String, cairo_pie::SegmentInfo>, RunnerError> -> Result<HashMap<BuiltinName, cairo_pie::SegmentInfo>, RunnerError>

    Notes: Serialization of vm outputs that now contain BuiltinName & Display implementation of BuiltinName have not been affected by this PR

  • feat: Add recursive_with_poseidon layout#1724

  • refactor(BREAKING): Use an enum to represent layout name#1715

    • Add enum LayoutName to represent cairo layout names.
    • CairoRunConfig, Cairo1RunConfig & CairoRunner field layout type changed from String to LayoutName.
    • CairoLayout field name type changed from String to LayoutName.
  • fix(BREAKING): Remove unsafe impl of Add<usize> for &'a Relocatable#1718

  • fix(BREAKING): Handle triple dereference references#1708

    • Replace ValueAddress boolean field dereference with boolean fields outer_dereference & inner_dereference
    • Replace HintReference boolean field dereference with boolean fields outer_dereference & inner_dereference
    • Reference parsing now handles the case of dereferences inside the cast. Aka references of type cast([A + B], type) such as cast([[fp + 2] + 2], felt).
  • Bump starknet-types-core version + Use the lib's pedersen hash #1692

  • refactor: Remove unused code & use constants whenever possible for builtin instance definitions#1707

  • feat: missing EC hints for Starknet OS 0.13.1 #1706

  • fix(BREAKING): Use program builtins in initialize_main_entrypoint & read_return_values#1703

    • initialize_main_entrypoint now iterates over the program builtins when building the stack & inserts 0 for any missing builtin
    • read_return_values now only computes the final stack of the builtins in the program
    • BREAKING: read_return_values now takes a boolean argument allow_missing_builtins
    • Added method BuiltinRunner::identifier to get the BuiltinName of each builtin
    • BREAKING: OutputBuiltinRunner::get_public_memory now takes a reference to MemorySegmentManager
    • BREAKING: method VirtualMachine::get_memory_segment_addresses moved to CairoRunner::get_memory_segment_addresses
  • feat(BREAKING): Add range_check96 builtin#1698

    • Add the new range_check96 builtin to the all_cairo layout.
    • RangeCheckBuiltinRunner changes:
      • Remove field n_parts, replacing it with const generic N_PARTS.
      • Remome n_parts argument form method new.
      • Remove field _bound, replacing it with public method bound.
      • Add public methods name & n_parts.
  • feat(BREAKING): Add mod builtin #1673

    Main Changes:

    • Add the new ModBuiltinRunner, implementing the builtins add_mod & mul_mod
    • Adds add_mod & mul_mod to the all_cairo & dynamic layouts under the mod_builtin feature flag. This will be added to the main code in a future update.
    • Add method VirtualMachine::fill_memory in order to perform the new builtin's main logic from within hints
    • Add hints to run arithmetic circuits using add_mod and/or mul_mod builtins

    Other Changes:

    • BREAKING: BuiltinRunner method signature change from
      air_private_input(&self, memory: &Memory) -> Vec<PrivateInput> to pub fn air_private_input(&self, segments: &MemorySegmentManager) -> Vec<PrivateInput>
    • Add MayleRelocatable::sub_usize
    • Implement Add<u32> for Relocatable
    • Add Memory::get_usize
    • BREAKING: Clean up unused/duplicated code from builtins module:
      • Remove unused method get_memory_segment_addresses from all builtin runners & the enum
      • Remove empty implementations of deduce_memory_cell & add_validation_rules from all builtin runners
      • Remove duplicated implementation of final_stack from all builtin runners except output and move it to the enum implementation
  • bugfix(BREAKING): Handle off2 immediate case in get_integer_from_reference#1701

    • get_integer_from_reference & get_integer_from_var_name output changed from Result<Cow<'a, Felt252>, HintError> to Result<Felt252, HintError>
  • feat: Reorganized builtins to be in the top of stack at the end of a run (Cairo1).

  • BREAKING: Remove CairoRunner::add_additional_hash_builtin & VirtualMachine::disable_trace#1658

  • feat: output builtin add_attribute method #1691

  • feat: add a method to retrieve the output builtin from the VM #1690

  • feat: Add zero segment #1668

  • feat: Bump cairo_lang to 0.13.1 in testing env #1687

  • feat(BREAKING): Use return type info from sierra when serializing return values in cairo1-run crate #1665

    • Removed public function serialize_output.
    • Add field serialize_output to Cairo1RunConfig.
    • Function cairo_run_program now returns an extra Option<String> value with the serialized output if serialize_output is enabled in the config.
    • Output serialization improved as it now uses the sierra program data to identify return value's types.
  • feat: Create hyper_threading crate to benchmark the cairo-vm in a hyper-threaded environment [#1679](ht...

Read more