Releases: lambdaclass/cairo-vm
v2.0.0-rc1
What's Changed
- Update docs, cairo-lang-runner references by @pefontana in #1854
- Skip_pedersen_comparison_when_checking_pie_compatibility by @YairVaknin-starkware in #1855
- Runner: include data from constants segment to the bytecode when assembling program by @m-kus in #1864
- Add_missing_builtins_to_pie_metadata_serialization by @YairVaknin-starkware in #1868
- serde: add
sizefield toIdentifierby @tcoratger in #1861 - Sort_ecdsa_and_mod_builtins_private_inputs_by_idx by @YairVaknin-starkware in #1851
- Fix broken num-prime crate by @edg-l in #1873
- Fix scientific notation test by @FrancoGiachetta in #1878
- Implement TestLessThanOrEqualAddress y EvalCircuit Hints by @FrancoGiachetta in #1843
- Release v2.0.0-rc1 by @edg-l in #1876
New Contributors
- @m-kus made their first contribution in #1864
- @tcoratger made their first contribution in #1861
Full Changelog: v2.0.0-rc0...v2.0.0-rc1
v2.0.0-rc-0
-
chore: bump
cairo-lang-dependencies to 2.9.0-dev.0 #1858 -
chore: update Rust required version to 1.81.0 #1857
-
- Add support for dynamic layout
- CLI change(BREAKING): The flag
cairo_layout_params_filemust be specified when using dynamic layout. - Signature change(BREAKING): Both
CairoRunner::newandCairoRunner::new_v2now receive anOption<CairoLayoutParams>, used only with dynamic layout.
-
fix: #1841:
- Fix modulo builtin to comply with prover constraints
-
chore: bump pip
cairo-lang0.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
-
fix(BREAKING): #1818:
- Fix
MemorySegmentManager::add_zero_segmentfunction when resizing a segment - Signature change(BREAKING):
MemorySegmentManager::get_memory_holesnow receivesbuiltin_segment_indexes: HashSet<usize>
- Fix
-
fix(BREAKING): Replace
CairoRunnermethodinitialize_all_builtinswithinitialize_program_builtins. Now it only initializes program builtins instead of all of them
v1.0.0
-
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:
MemorySegmentManagermethodget_memory_holesnow receives the index of the output builtin (as anOption<usize>) instead of the boolean argumenthas_output_builtin#1811
-
fix: ambiguous keccak module name use on external contexts #1809
v1.0.0-rc6
- 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
- fix: Fixed deserialization of negative numbers in scientific notation #1804
v1.0.0-rc4
-
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
GasBuiltinin cairo1-run crate #1789- Load
initial_gasinto vm instead of creating it via instructions. - Fix bug affecting programs with input arguments and gas builtin.
- Load
-
fix: Change (de)serialization of CairoPie's
OutputBuiltinAdditionalData'sPublicMemoryPageto 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_BALANCEhint #1777 -
feat(BREAKING): Use a cheatcode to relocate all dicts + Make temporary segment usage configurable #1776
- Add the flags
segment_arena_validation&use_temporary_segmentsto theCairo1HintProcessor&DictManagerExecScoperespectively. These flags will determine if real segments or temporary segments will be used when creating dictionaries. DictManagerExecScope::finalize_segmentno longer performs relocation and is ignored ifuse_temporary_segmentsis set to false.- Add method
DictManagerExecScope::relocate_all_dictionariesthat adds relocation rules for all tracked dictionaries, relocating them one next to the other in a new segment. - Add cheatcode
RelocateAllDictionariesto theCairo1HintProcessor, which calls the aforementioned method. - Add casm instruction to call the aforementioned cheatcode in
create_entry_codeif eitherproof_modeorappend_return_valuesare set to true, and segment arena is present.
- Add the flags
-
Bump
starknet-types-coreversion + 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_modeor--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>>orArray<Felt252>can be returned by the program when running with either--proof_modeor--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]]
- Checks that only
-
feat: Handle
BoundedIntvariant inserialize_output,cairo1-runcrate #1768 -
fix: make
OutputBuiltinStatepublic #1769 -
feat: Load arguments into VM instead of creating them via instructions in cairo1-run #1759
v0.9.3
v1.0.0-rc3
-
bugfix: Fix handling of return values wrapped in
PanicResultin cairo1-run crate #1763 -
refactor(BREAKING): Move the VM back to the CairoRunner #1743
CairoRunnerhas a new public fieldvm: VirtualMachineCairoRunnerno longer derivesDebugCairoRunnermethodsnew_v2&newtake an extra boolean argumenttrace_enabled.- Functions
cairo_run,cairo_run_program&cairo_run_fuzzed_programfromvmcrate andcairo_run_programfromcairo1-runcrate now retun onlyCairoRunnerinstead of(CairoRunner, VirtualMachine) CairoRunnermethods no longer take a reference toVirtualMachine. Methods that took an immutable reference to self and a mutable reference to the VM now take a mutable reference to self. Affected methods:initializeinitialize_builtinsinitialize_all_builtinsinitialize_segmentsinitialize_stateinitialize_function_entrypointinitialize_stateinitialize_main_entrypointinitialize_vmrun_until_pcrun_for_stepsrun_until_stepsrun_until_power_of_2get_perm_range_check_limitscheck_range_check_usageget_memory_holescheck_diluted_check_usageend_runrelocate_tracerelocate_memoryrelocateget_builtin_segments_infoget_builtin_segments_info_for_pieget_execution_resourcesfinalize_segmentsrun_from_entrypointcheck_used_cellscheck_memory_usageinitialize_function_runner_cairo_1initialize_function_runnerread_return_valuesget_builtins_final_stackget_cairo_pieget_air_public_inputget_air_private_inputget_memory_segment_addresses
- Functions & methods taking a reference to
CairoRunner&VirtualMachinenow only take a reference toCairoRunner:start_tracerVmException::from_vm_errorget_error_attr_valueget_tracebackverify_secure_runner
- [hooks feature]
BeforeFirstStepHookFuncdyn Fn no longer takes a mutable reference toCairoRunner, along withVirtualMachine::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,printandskip_next_instruction_hintfeatures as a singletest_utilsfeature #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
U256InvModNtoCairo1HintProcessor#1744 -
perf: use a more compact representation for
MemoryCell#1672- BREAKING:
Memory::get_valuewill now always returnCow::Ownedvariants, code that relied onCow::Borrowedmay break
- BREAKING:
v1.0.0-rc2
-
cairo1-runCLI: Allow loading arguments from file#1739 -
BREAKING: Remove unused
CairoRunnerfieldoriginal_steps#1742 -
feat: Add
--run_from_cairo_pietocairo-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.rsto 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 & issuessegment 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
CairoPiemethodsrun_validity_checks&check_pie_compatibility - Add
Programmethodfrom_stripped_program
- Add function
-
bugfix: Don't assume outer deref when fetching integer values from references#1732
-
feat: Implement
extend_additional_dataforBuiltinRunner#1726 -
BREAKING: Set dynamic params as null by default on air public input #1716
PublicInputfieldlayout_paramsrenamed todynamic_params& type changed from&'a CairoLayoutto().
-
feat:
cairo1-runaccepts Sierra programs #1719 -
refactor(BREAKING): Use
BuiltinNameenum instead of string representation #1722BuiltinNamemoved fromcrate::serde::deserialize_programmodule tocrate::types::builtin_name.- Implement
BuiltinNamemethodsto_str,to_str_with_suffix,from_str&from_str_with_suffix.
- Implement
- Remove
BuiltinNamemethodname. - All builtin-related error variants now store
BuiltinNameinstead of&'static strorString. - 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&ModBuiltinRunnermethodidentifier - Structs containing string representation of builtin names now use
BuiltinNameinstead:AirPrivateInput(pub HashMap<&'static str, Vec<PrivateInput>>)->AirPrivateInput(pub HashMap<BuiltinName, Vec<PrivateInput>>).CairoPieMetadatafieldadditional_data:HashMap<String, BuiltinAdditionalData>,->CairoPieAdditionalDatawithCairoPieAdditionalData(pub HashMap<BuiltinName, BuiltinAdditionalData>)CairoPieMetadatafieldbuiltin_segments:HashMap<String, SegmentInfo>->HashMap<BuiltinName, SegmentInfo>.ExecutiobResourcesfieldbuiltin_instance_counter:HashMap<String, usize>->HashMap<BuiltinName, usize>
- Methods returning string representation of builtin names now use
BuiltinNameinstead:BuiltinRunner,ModBuiltinRunner&RangeCheckBuiltinRunnermethodname:&'static str->BuiltinName.CairoRunnermethodget_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&Displayimplementation ofBuiltinNamehave not been affected by this PR -
feat: Add
recursive_with_poseidonlayout#1724 -
refactor(BREAKING): Use an enum to represent layout name#1715
- Add enum
LayoutNameto represent cairo layout names. CairoRunConfig,Cairo1RunConfig&CairoRunnerfieldlayouttype changed fromStringtoLayoutName.CairoLayoutfieldnametype changed fromStringtoLayoutName.
- Add enum
-
fix(BREAKING): Remove unsafe impl of
Add<usize> for &'a Relocatable#1718 -
fix(BREAKING): Handle triple dereference references#1708
- Replace
ValueAddressboolean fielddereferencewith boolean fieldsouter_dereference&inner_dereference - Replace
HintReferenceboolean fielddereferencewith boolean fieldsouter_dereference&inner_dereference - Reference parsing now handles the case of dereferences inside the cast. Aka references of type
cast([A + B], type)such ascast([[fp + 2] + 2], felt).
- Replace
-
Bump
starknet-types-coreversion + 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#1703initialize_main_entrypointnow iterates over the program builtins when building the stack & inserts 0 for any missing builtinread_return_valuesnow only computes the final stack of the builtins in the program- BREAKING:
read_return_valuesnow takes a boolean argumentallow_missing_builtins - Added method
BuiltinRunner::identifierto get theBuiltinNameof each builtin - BREAKING:
OutputBuiltinRunner::get_public_memorynow takes a reference toMemorySegmentManager - BREAKING: method
VirtualMachine::get_memory_segment_addressesmoved toCairoRunner::get_memory_segment_addresses
-
feat(BREAKING): Add range_check96 builtin#1698
- Add the new
range_check96builtin to theall_cairolayout. RangeCheckBuiltinRunnerchanges:- Remove field
n_parts, replacing it with const genericN_PARTS. - Remome
n_partsargument form methodnew. - Remove field
_bound, replacing it with public methodbound. - Add public methods
name&n_parts.
- Remove field
- Add the new
-
feat(BREAKING): Add mod builtin #1673
Main Changes:
- Add the new
ModBuiltinRunner, implementing the builtinsadd_mod&mul_mod - Adds
add_mod&mul_modto theall_cairo&dynamiclayouts under themod_builtinfeature flag. This will be added to the main code in a future update. - Add method
VirtualMachine::fill_memoryin order to perform the new builtin's main logic from within hints - Add hints to run arithmetic circuits using
add_modand/ormul_modbuiltins
Other Changes:
- BREAKING: BuiltinRunner method signature change from
air_private_input(&self, memory: &Memory) -> Vec<PrivateInput>topub 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_addressesfrom all builtin runners & the enum - Remove empty implementations of
deduce_memory_cell&add_validation_rulesfrom all builtin runners - Remove duplicated implementation of
final_stackfrom all builtin runners except output and move it to the enum implementation
- Remove unused method
- Add the new
-
bugfix(BREAKING): Handle off2 immediate case in
get_integer_from_reference#1701get_integer_from_reference&get_integer_from_var_nameoutput changed fromResult<Cow<'a, Felt252>, HintError>toResult<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_outputtoCairo1RunConfig. - Function
cairo_run_programnow returns an extraOption<String>value with the serialized output ifserialize_outputis enabled in the config. - Output serialization improved as it now uses the sierra program data to identify return value's types.
- Removed public function
-
feat: Create hyper_threading crate to benchmark the
cairo-vmin a hyper-threaded environment [#1679](ht...