From f8707401218ed4524382810bf8fe419b7a8376f6 Mon Sep 17 00:00:00 2001 From: Pedro Fontana Date: Tue, 27 Jun 2023 17:22:33 -0300 Subject: [PATCH 1/5] Rename cairo-rs to cairo-vm --- .github/workflows/rust.yml | 6 +- .github/workflows/test_install.yml | 2 +- CHANGELOG.md | 356 +++++++++--------- CONTRIBUTING.md | 12 +- Makefile | 30 +- README.md | 40 +- bench/run_benchmarks.sh | 2 +- .../builtin_hint_processor/README.md | 12 +- docs/hint_processor/hint_design.md | 24 +- docs/python_rust_integration_specs.md | 12 +- vm/Cargo.toml | 2 +- vm/src/tests/memory_comparator.py | 4 +- 12 files changed, 251 insertions(+), 251 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c7b9870c02..eae117ce73 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -330,7 +330,7 @@ jobs: - program-target: cairo_test_programs programs-dir: cairo_programs extra-args: '' - name: Compute memory and execution traces with cairo-rs + name: Compute memory and execution traces with cairo-vm needs: [ build-programs, build-release ] runs-on: ubuntu-22.04 steps: @@ -401,7 +401,7 @@ jobs: strategy: matrix: program-target: [ cairo_proof_programs, cairo_test_programs ] - name: Compare memory and execution traces from cairo-lang and cairo-rs + name: Compare memory and execution traces from cairo-lang and cairo-vm needs: [ run-cairo-reference, run-cairo-release ] runs-on: ubuntu-22.04 steps: @@ -417,7 +417,7 @@ jobs: key: ${{ matrix.program-target }}-reference-trace-cache-${{ hashFiles( 'cairo_programs/**/*.cairo' ) }} fail-on-cache-miss: true - - name: Fetch traces for cairo-rs + - name: Fetch traces for cairo-vm uses: actions/cache/restore@v3 with: path: | diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 0e1639ba7b..c1ffd74958 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -1,4 +1,4 @@ -name: Test dependencies and cairo-rs install +name: Test dependencies and cairo-vm install on: merge_group: diff --git a/CHANGELOG.md b/CHANGELOG.md index da82885c10..a2c14961f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ #### [0.8.0] - 2023-6-26 -* feat: Add feature `lambdaworks-felt` to `felt` & `cairo-vm` crates [#1218](https://github.com/lambdaclass/cairo-rs/pull/1281) +* feat: Add feature `lambdaworks-felt` to `felt` & `cairo-vm` crates [#1218](https://github.com/lambdaclass/cairo-vm/pull/1281) Changes under this feature: * `Felt252` now uses _lambdaworks_' `FieldElement` internally @@ -12,7 +12,7 @@ #### [0.7.0] - 2023-6-26 -* BREAKING: Integrate `RunResources` logic into `HintProcessor` trait [#1274](https://github.com/lambdaclass/cairo-rs/pull/1274) +* BREAKING: Integrate `RunResources` logic into `HintProcessor` trait [#1274](https://github.com/lambdaclass/cairo-vm/pull/1274) * Rename trait `HintProcessor` to `HintProcessorLogic` * Add trait `ResourceTracker` * Trait `HintProcessor` is now `HintProcessor: HintProcessorLogic + ResourceTracker` @@ -20,23 +20,23 @@ * `HintProcessorLogic::execute_hint` no longer receives `run_resources: &mut RunResources` * Remove argument `run_resources: &mut RunResources` from `CairoRunner::run_until_pc` & `CairoRunner::run_from_entrypoint` -* build: remove unused implicit features from cairo-vm [#1266](https://github.com/lambdaclass/cairo-rs/pull/1266) +* build: remove unused implicit features from cairo-vm [#1266](https://github.com/lambdaclass/cairo-vm/pull/1266) #### [0.6.1] - 2023-6-23 -* fix: updated the `custom_hint_example` and added it to the workspace [#1258](https://github.com/lambdaclass/cairo-rs/pull/1258) +* fix: updated the `custom_hint_example` and added it to the workspace [#1258](https://github.com/lambdaclass/cairo-vm/pull/1258) -* Add path to cairo-vm README.md [#1276](https://github.com/lambdaclass/cairo-rs/pull/1276) +* Add path to cairo-vm README.md [#1276](https://github.com/lambdaclass/cairo-vm/pull/1276) -* fix: change error returned when subtracting two `MaybeRelocatable`s to better reflect the cause [#1271](https://github.com/lambdaclass/cairo-rs/pull/1271) +* fix: change error returned when subtracting two `MaybeRelocatable`s to better reflect the cause [#1271](https://github.com/lambdaclass/cairo-vm/pull/1271) -* fix: CLI error message when using --help [#1270](https://github.com/lambdaclass/cairo-rs/pull/1270) +* fix: CLI error message when using --help [#1270](https://github.com/lambdaclass/cairo-vm/pull/1270) #### [0.6.0] - 2023-6-18 -* fix: `dibit` hint no longer fails when called with an `m` of zero [#1247](https://github.com/lambdaclass/cairo-rs/pull/1247) +* fix: `dibit` hint no longer fails when called with an `m` of zero [#1247](https://github.com/lambdaclass/cairo-vm/pull/1247) -* fix(security): avoid denial of service on malicious input exploiting the scientific notation parser [#1239](https://github.com/lambdaclass/cairo-rs/pull/1239) +* fix(security): avoid denial of service on malicious input exploiting the scientific notation parser [#1239](https://github.com/lambdaclass/cairo-vm/pull/1239) * BREAKING: Change `RunResources` usage: * Modify field type `RunResources.n_steps: Option,` @@ -47,83 +47,83 @@ * VirtualMachine::Step: Add `&mut RunResources` as input * Trait HintProcessor::execute_hint: Add `&mut RunResources` as an input -* perf: accumulate `min` and `max` instruction offsets during run to speed up range check [#1080](https://github.com/lambdaclass/cairo-rs/pull/) +* perf: accumulate `min` and `max` instruction offsets during run to speed up range check [#1080](https://github.com/lambdaclass/cairo-vm/pull/) BREAKING: `Cairo_runner::get_perm_range_check_limits` no longer returns an error when called without trace enabled, as it no longer depends on it -* perf: process reference list on `Program` creation only [#1214](https://github.com/lambdaclass/cairo-rs/pull/1214) +* perf: process reference list on `Program` creation only [#1214](https://github.com/lambdaclass/cairo-vm/pull/1214) Also keep them in a `Vec<_>` instead of a `HashMap<_, _>` since it will be continuous anyway. BREAKING: * `HintProcessor::compile_hint` now receies a `&[HintReference]` rather than `&HashMap` * Public `CairoRunner::get_reference_list` has been removed * BREAKING: Add no_std compatibility to cairo-vm (cairo-1-hints feature still not supported) - * Move the vm to its own directory and crate, different from the workspace [#1215](https://github.com/lambdaclass/cairo-rs/pull/1215) + * Move the vm to its own directory and crate, different from the workspace [#1215](https://github.com/lambdaclass/cairo-vm/pull/1215) - * Add an `ensure_no_std` crate that the CI will use to check that new changes don't revert `no_std` support [#1215](https://github.com/lambdaclass/cairo-rs/pull/1215) [#1232](https://github.com/lambdaclass/cairo-rs/pull/1232) + * Add an `ensure_no_std` crate that the CI will use to check that new changes don't revert `no_std` support [#1215](https://github.com/lambdaclass/cairo-vm/pull/1215) [#1232](https://github.com/lambdaclass/cairo-vm/pull/1232) - * replace the use of `num-prime::is_prime` by a custom implementation, therefore restoring `no_std` compatibility [#1238](https://github.com/lambdaclass/cairo-rs/pull/1238) + * replace the use of `num-prime::is_prime` by a custom implementation, therefore restoring `no_std` compatibility [#1238](https://github.com/lambdaclass/cairo-vm/pull/1238) #### [0.5.2] - 2023-6-12 -* BREAKING: Compute `ExecutionResources.n_steps` without requiring trace [#1222](https://github.com/lambdaclass/cairo-rs/pull/1222) +* BREAKING: Compute `ExecutionResources.n_steps` without requiring trace [#1222](https://github.com/lambdaclass/cairo-vm/pull/1222) * `CairoRunner::get_execution_resources` return's `n_steps` field value is now set to `vm.current_step` instead of `0` if both `original_steps` and `trace` are set to `None` -* Add `RunResources::get_n_steps` method [#1225](https://github.com/lambdaclass/cairo-rs/pull/1225) +* Add `RunResources::get_n_steps` method [#1225](https://github.com/lambdaclass/cairo-vm/pull/1225) * refactor: simplify `mem_eq` -* fix: pin Cairo compiler version [#1220](https://github.com/lambdaclass/cairo-rs/pull/1220) +* fix: pin Cairo compiler version [#1220](https://github.com/lambdaclass/cairo-vm/pull/1220) * perf: make `inner_rc_bound` a constant, improving performance of the range-check builtin -* fix: substraction of `MaybeRelocatable` always behaves as signed [#1218](https://github.com/lambdaclass/cairo-rs/pull/1218) +* fix: substraction of `MaybeRelocatable` always behaves as signed [#1218](https://github.com/lambdaclass/cairo-vm/pull/1218) #### [0.5.1] - 2023-6-7 -* fix: fix overflow for `QUAD_BIT` and `DI_BIT` hints [#1209](https://github.com/lambdaclass/cairo-rs/pull/1209) - Fixes [#1205](https://github.com/lambdaclass/cairo-rs/issue/1205) +* fix: fix overflow for `QUAD_BIT` and `DI_BIT` hints [#1209](https://github.com/lambdaclass/cairo-vm/pull/1209) + Fixes [#1205](https://github.com/lambdaclass/cairo-vm/issue/1205) -* fix: fix hints `UINT256_UNSIGNED_DIV_REM` && `UINT256_EXPANDED_UNSIGNED_DIV_REM` [#1203](https://github.com/lambdaclass/cairo-rs/pull/1203) +* fix: fix hints `UINT256_UNSIGNED_DIV_REM` && `UINT256_EXPANDED_UNSIGNED_DIV_REM` [#1203](https://github.com/lambdaclass/cairo-vm/pull/1203) -* bugfix: fix deserialization of scientific notation with fractional values [#1202](https://github.com/lambdaclass/cairo-rs/pull/1202) +* bugfix: fix deserialization of scientific notation with fractional values [#1202](https://github.com/lambdaclass/cairo-vm/pull/1202) -* feat: implement `mem_eq` function to test for equality of two ranges in memory [#1198](https://github.com/lambdaclass/cairo-rs/pull/1198) +* feat: implement `mem_eq` function to test for equality of two ranges in memory [#1198](https://github.com/lambdaclass/cairo-vm/pull/1198) -* perf: use `mem_eq` in `set_add` [#1198](https://github.com/lambdaclass/cairo-rs/pull/1198) +* perf: use `mem_eq` in `set_add` [#1198](https://github.com/lambdaclass/cairo-vm/pull/1198) -* feat: wrap big variants of `HintError`, `VirtualMachineError`, `RunnerError`, `MemoryError`, `MathError`, `InsufficientAllocatedCellsError` in `Box` [#1193](https://github.com/lambdaclass/cairo-rs/pull/1193) +* feat: wrap big variants of `HintError`, `VirtualMachineError`, `RunnerError`, `MemoryError`, `MathError`, `InsufficientAllocatedCellsError` in `Box` [#1193](https://github.com/lambdaclass/cairo-vm/pull/1193) * BREAKING: all tuple variants of `HintError` with a single `Felt252` or multiple elements now receive a single `Box` -* Add `Program::builtins_len method` [#1194](https://github.com/lambdaclass/cairo-rs/pull/1194) +* Add `Program::builtins_len method` [#1194](https://github.com/lambdaclass/cairo-vm/pull/1194) -* fix: Handle the deserialization of serde_json::Number with scientific notation (e.g.: Number(1e27)) in felt_from_number function [#1188](https://github.com/lambdaclass/cairo-rs/pull/1188) +* fix: Handle the deserialization of serde_json::Number with scientific notation (e.g.: Number(1e27)) in felt_from_number function [#1188](https://github.com/lambdaclass/cairo-vm/pull/1188) -* feat: Add RunResources Struct [#1175](https://github.com/lambdaclass/cairo-rs/pull/1175) +* feat: Add RunResources Struct [#1175](https://github.com/lambdaclass/cairo-vm/pull/1175) * BREAKING: Modify `CairoRunner::run_until_pc` arity. Add `run_resources: &mut Option` input * BREAKING: Modify `CairoRunner::run_from_entrypoint` arity. Add `run_resources: &mut Option` input -* fix: Fix 'as_int' conversion usage in hints `ASSERT_250_BIT` & `SIGNED_DIV_REM` [#1191](https://github.com/lambdaclass/cairo-rs/pull/1191) +* fix: Fix 'as_int' conversion usage in hints `ASSERT_250_BIT` & `SIGNED_DIV_REM` [#1191](https://github.com/lambdaclass/cairo-vm/pull/1191) -* bugfix: Use cairo constants in `ASSERT_250_BIT` hint [#1187](https://github.com/lambdaclass/cairo-rs/pull/1187) +* bugfix: Use cairo constants in `ASSERT_250_BIT` hint [#1187](https://github.com/lambdaclass/cairo-vm/pull/1187) -* bugfix: Fix `EC_DOUBLE_ASSIGN_NEW_X_V2` hint not taking `SECP_P` value from the current execution scope [#1186](https://github.com/lambdaclass/cairo-rs/pull/1186) +* bugfix: Fix `EC_DOUBLE_ASSIGN_NEW_X_V2` hint not taking `SECP_P` value from the current execution scope [#1186](https://github.com/lambdaclass/cairo-vm/pull/1186) -* fix: Fix hint `BIGINT_PACK_DIV_MOD` [#1189](https://github.com/lambdaclass/cairo-rs/pull/1189) +* fix: Fix hint `BIGINT_PACK_DIV_MOD` [#1189](https://github.com/lambdaclass/cairo-vm/pull/1189) -* fix: Fix possible subtraction overflow in `QUAD_BIT` & `DI_BIT` hints [#1185](https://github.com/lambdaclass/cairo-rs/pull/1185) +* fix: Fix possible subtraction overflow in `QUAD_BIT` & `DI_BIT` hints [#1185](https://github.com/lambdaclass/cairo-vm/pull/1185) * These hints now return an error when ids.m equals zero -* fix: felt_from_number not properly returning parse errors [#1012](https://github.com/lambdaclass/cairo-rs/pull/1012) +* fix: felt_from_number not properly returning parse errors [#1012](https://github.com/lambdaclass/cairo-vm/pull/1012) -* fix: Fix felt sqrt and Signed impl [#1150](https://github.com/lambdaclass/cairo-rs/pull/1150) +* fix: Fix felt sqrt and Signed impl [#1150](https://github.com/lambdaclass/cairo-vm/pull/1150) * BREAKING: Fix `Felt252` methods `abs`, `signum`, `is_positive`, `is_negative` and `sqrt` * BREAKING: Remove function `math_utils::sqrt`(Now moved to `Felt252::sqrt`) -* feat: Add method `CairoRunner::initialize_function_runner_cairo_1` [#1151](https://github.com/lambdaclass/cairo-rs/pull/1151) +* feat: Add method `CairoRunner::initialize_function_runner_cairo_1` [#1151](https://github.com/lambdaclass/cairo-vm/pull/1151) * Add method `pub fn initialize_function_runner_cairo_1( &mut self, @@ -137,8 +137,8 @@ * Fix implementation of `InitSquashData` and `ShouldSkipSquashLoop` -* Add more hints to `Cairo1HintProcessor` [#1171](https://github.com/lambdaclass/cairo-rs/pull/1171) - [#1143](https://github.com/lambdaclass/cairo-rs/pull/1143) +* Add more hints to `Cairo1HintProcessor` [#1171](https://github.com/lambdaclass/cairo-vm/pull/1171) + [#1143](https://github.com/lambdaclass/cairo-vm/pull/1143) * `Cairo1HintProcessor` can now run the following hints: * Felt252DictEntryInit @@ -151,12 +151,12 @@ * FieldSqrt * Uint512DivMod -* Add some small considerations regarding Cairo 1 programs [#1144](https://github.com/lambdaclass/cairo-rs/pull/1144): +* Add some small considerations regarding Cairo 1 programs [#1144](https://github.com/lambdaclass/cairo-vm/pull/1144): * Ignore Casm and Sierra files * Add special flag to compile Cairo 1 programs -* Make the VM able to run `CasmContractClass` files under `cairo-1-hints` feature [#1098](https://github.com/lambdaclass/cairo-rs/pull/1098) +* Make the VM able to run `CasmContractClass` files under `cairo-1-hints` feature [#1098](https://github.com/lambdaclass/cairo-vm/pull/1098) * Implement `TryFrom for Program` * Add `Cairo1HintProcessor` @@ -166,13 +166,13 @@ #### [0.4.0] - 2023-05-12 -* perf: insert elements from the tail in `load_data` so reallocation happens only once [#1117](https://github.com/lambdaclass/cairo-rs/pull/1117) +* perf: insert elements from the tail in `load_data` so reallocation happens only once [#1117](https://github.com/lambdaclass/cairo-vm/pull/1117) -* Add `CairoRunner::get_program method` [#1123](https://github.com/lambdaclass/cairo-rs/pull/1123) +* Add `CairoRunner::get_program method` [#1123](https://github.com/lambdaclass/cairo-vm/pull/1123) -* Use to_signed_felt as function for felt252 as BigInt within [-P/2, P/2] range and use to_bigint as function for representation as BigInt. [#1100](https://github.com/lambdaclass/cairo-rs/pull/1100) +* Use to_signed_felt as function for felt252 as BigInt within [-P/2, P/2] range and use to_bigint as function for representation as BigInt. [#1100](https://github.com/lambdaclass/cairo-vm/pull/1100) -* Implement hint on field_arithmetic lib [#1090](https://github.com/lambdaclass/cairo-rs/pull/1090) +* Implement hint on field_arithmetic lib [#1090](https://github.com/lambdaclass/cairo-vm/pull/1090) `BuiltinHintProcessor` now supports the following hints: @@ -204,7 +204,7 @@ %} ``` -* Add missing hint on cairo_secp lib [#1089](https://github.com/lambdaclass/cairo-rs/pull/1089): +* Add missing hint on cairo_secp lib [#1089](https://github.com/lambdaclass/cairo-vm/pull/1089): `BuiltinHintProcessor` now supports the following hint: ```python @@ -219,7 +219,7 @@ value = new_x = (pow(slope, 2, SECP_P) - x0 - x1) % SECP_P ``` -* Add missing hint on vrf.json whitelist [#1055](https://github.com/lambdaclass/cairo-rs/pull/1055): +* Add missing hint on vrf.json whitelist [#1055](https://github.com/lambdaclass/cairo-vm/pull/1055): `BuiltinHintProcessor` now supports the following hint: @@ -239,7 +239,7 @@ %} ``` -* Implement hint variant for finalize_blake2s[#1072](https://github.com/lambdaclass/cairo-rs/pull/1072) +* Implement hint variant for finalize_blake2s[#1072](https://github.com/lambdaclass/cairo-vm/pull/1072) `BuiltinHintProcessor` now supports the following hint: @@ -268,7 +268,7 @@ %} ``` -* Implement fast_ec_add hint variant [#1087](https://github.com/lambdaclass/cairo-rs/pull/1087) +* Implement fast_ec_add hint variant [#1087](https://github.com/lambdaclass/cairo-vm/pull/1087) `BuiltinHintProcessor` now supports the following hint: @@ -285,7 +285,7 @@ %} ``` -* feat(hints): Add alternative string for hint IS_ZERO_PACK_EXTERNAL_SECP [#1082](https://github.com/lambdaclass/cairo-rs/pull/1082) +* feat(hints): Add alternative string for hint IS_ZERO_PACK_EXTERNAL_SECP [#1082](https://github.com/lambdaclass/cairo-vm/pull/1082) `BuiltinHintProcessor` now supports the following hint: @@ -296,7 +296,7 @@ %} ``` -* Add alternative hint code for ec_double hint [#1083](https://github.com/lambdaclass/cairo-rs/pull/1083) +* Add alternative hint code for ec_double hint [#1083](https://github.com/lambdaclass/cairo-vm/pull/1083) `BuiltinHintProcessor` now supports the following hint: @@ -312,21 +312,21 @@ %} ``` -* fix(security)!: avoid DoS on malicious insertion to memory [#1099](https://github.com/lambdaclass/cairo-rs/pull/1099) +* fix(security)!: avoid DoS on malicious insertion to memory [#1099](https://github.com/lambdaclass/cairo-vm/pull/1099) * A program could crash the library by attempting to insert a value at an address with a big offset; fixed by trying to reserve to check for allocation failure * A program could crash the program by exploiting an integer overflow when attempting to insert a value at an address with offset `usize::MAX` BREAKING: added a new error variant `MemoryError::VecCapacityExceeded` -* perf: specialize addition for `u64` and `Felt252` [#932](https://github.com/lambdaclass/cairo-rs/pull/932) +* perf: specialize addition for `u64` and `Felt252` [#932](https://github.com/lambdaclass/cairo-vm/pull/932) * Avoids the creation of a new `Felt252` instance for additions with a very restricted valid range * This impacts specially the addition of `Relocatable` with `Felt252` values in `update_pc`, which take a significant amount of time in some benchmarks -* fix(starknet-crypto): bump version to `0.5.0` [#1088](https://github.com/lambdaclass/cairo-rs/pull/1088) +* fix(starknet-crypto): bump version to `0.5.0` [#1088](https://github.com/lambdaclass/cairo-vm/pull/1088) * This includes the fix for a `panic!` in `ecdsa::verify`. See: [#365](https://github.com/xJonathanLEI/starknet-rs/issues/365) and [#366](https://github.com/xJonathanLEI/starknet-rs/pulls/366) -* feat(hints): Add alternative string for hint IS_ZERO_PACK [#1081](https://github.com/lambdaclass/cairo-rs/pull/1081) +* feat(hints): Add alternative string for hint IS_ZERO_PACK [#1081](https://github.com/lambdaclass/cairo-vm/pull/1081) `BuiltinHintProcessor` now supports the following hint: @@ -336,7 +336,7 @@ x = pack(ids.x, PRIME) % SECP_P %} -* Add missing hints `NewHint#55`, `NewHint#56`, and `NewHint#57` [#1077](https://github.com/lambdaclass/cairo-rs/issues/1077) +* Add missing hints `NewHint#55`, `NewHint#56`, and `NewHint#57` [#1077](https://github.com/lambdaclass/cairo-vm/issues/1077) `BuiltinHintProcessor` now supports the following hints: @@ -361,7 +361,7 @@ value = x_inv = div_mod(1, x, SECP_P) ``` -* Implement hint for `starkware.cairo.common.cairo_keccak.keccak._copy_inputs` as described by whitelist `starknet/security/whitelists/cairo_keccak.json` [#1058](https://github.com/lambdaclass/cairo-rs/pull/1058) +* Implement hint for `starkware.cairo.common.cairo_keccak.keccak._copy_inputs` as described by whitelist `starknet/security/whitelists/cairo_keccak.json` [#1058](https://github.com/lambdaclass/cairo-vm/pull/1058) `BuiltinHintProcessor` now supports the following hint: @@ -369,10 +369,10 @@ %{ ids.full_word = int(ids.n_bytes >= 8) %} ``` -* perf: cache decoded instructions [#944](https://github.com/lambdaclass/cairo-rs/pull/944) +* perf: cache decoded instructions [#944](https://github.com/lambdaclass/cairo-vm/pull/944) * Creates a new cache field in `VirtualMachine` that stores the `Instruction` instances as they get decoded from memory, significantly reducing decoding overhead, with gains up to 9% in runtime according to benchmarks in the performance server -* Add alternative hint code for nondet_bigint3 hint [#1071](https://github.com/lambdaclass/cairo-rs/pull/1071) +* Add alternative hint code for nondet_bigint3 hint [#1071](https://github.com/lambdaclass/cairo-vm/pull/1071) `BuiltinHintProcessor` now supports the following hint: @@ -383,7 +383,7 @@ %} ``` -* Add missing hint on vrf.json lib [#1052](https://github.com/lambdaclass/cairo-rs/pull/1052): +* Add missing hint on vrf.json lib [#1052](https://github.com/lambdaclass/cairo-vm/pull/1052): `BuiltinHintProcessor` now supports the following hint: @@ -401,7 +401,7 @@ %} ``` -* Implement hint for cairo_sha256_arbitrary_input_length whitelist [#1091](https://github.com/lambdaclass/cairo-rs/pull/1091) +* Implement hint for cairo_sha256_arbitrary_input_length whitelist [#1091](https://github.com/lambdaclass/cairo-vm/pull/1091) `BuiltinHintProcessor` now supports the following hint: @@ -421,7 +421,7 @@ %} ``` -* Add missing hint on vrf.json lib [#1053](https://github.com/lambdaclass/cairo-rs/pull/1053): +* Add missing hint on vrf.json lib [#1053](https://github.com/lambdaclass/cairo-vm/pull/1053): `BuiltinHintProcessor` now supports the following hint: @@ -438,7 +438,7 @@ %} ``` -* Implement hint on 0.6.0.json whitelist [#1044](https://github.com/lambdaclass/cairo-rs/pull/1044): +* Implement hint on 0.6.0.json whitelist [#1044](https://github.com/lambdaclass/cairo-vm/pull/1044): `BuiltinHintProcessor` now supports the following hints: @@ -449,7 +449,7 @@ %} ``` -* Implement hint for `starkware.cairo.common.cairo_keccak.keccak._block_permutation` as described by whitelist `starknet/security/whitelists/cairo_keccak.json` [#1046](https://github.com/lambdaclass/cairo-rs/pull/1046) +* Implement hint for `starkware.cairo.common.cairo_keccak.keccak._block_permutation` as described by whitelist `starknet/security/whitelists/cairo_keccak.json` [#1046](https://github.com/lambdaclass/cairo-vm/pull/1046) `BuiltinHintProcessor` now supports the following hint: @@ -464,7 +464,7 @@ %} ``` -* Implement hint on cairo_blake2s whitelist [#1040](https://github.com/lambdaclass/cairo-rs/pull/1040) +* Implement hint on cairo_blake2s whitelist [#1040](https://github.com/lambdaclass/cairo-vm/pull/1040) `BuiltinHintProcessor` now supports the following hint: @@ -488,7 +488,7 @@ %} ``` -* Implement hint on cairo_blake2s whitelist [#1039](https://github.com/lambdaclass/cairo-rs/pull/1039) +* Implement hint on cairo_blake2s whitelist [#1039](https://github.com/lambdaclass/cairo-vm/pull/1039) `BuiltinHintProcessor` now supports the following hint: @@ -517,9 +517,9 @@ segments.write_arg(ids.blake2s_ptr_end, padding) %} -* Add `Program::iter_identifiers(&self) -> Iterator` to get an iterator over the program's identifiers [#1079](https://github.com/lambdaclass/cairo-rs/pull/1079) +* Add `Program::iter_identifiers(&self) -> Iterator` to get an iterator over the program's identifiers [#1079](https://github.com/lambdaclass/cairo-vm/pull/1079) -* Implement hint on `assert_le_felt` for versions 0.6.0 and 0.8.2 [#1047](https://github.com/lambdaclass/cairo-rs/pull/1047): +* Implement hint on `assert_le_felt` for versions 0.6.0 and 0.8.2 [#1047](https://github.com/lambdaclass/cairo-vm/pull/1047): `BuiltinHintProcessor` now supports the following hints: @@ -551,7 +551,7 @@ ``` -* Add missing hints on whitelist [#1073](https://github.com/lambdaclass/cairo-rs/pull/1073): +* Add missing hints on whitelist [#1073](https://github.com/lambdaclass/cairo-vm/pull/1073): `BuiltinHintProcessor` now supports the following hints: @@ -568,7 +568,7 @@ ids.is_small = 1 if ids.addr < ADDR_BOUND else 0 ``` -* Implement hint on ec_recover.json whitelist [#1038](https://github.com/lambdaclass/cairo-rs/pull/1038): +* Implement hint on ec_recover.json whitelist [#1038](https://github.com/lambdaclass/cairo-vm/pull/1038): `BuiltinHintProcessor` now supports the following hint: @@ -578,7 +578,7 @@ %} ``` -* Implement hint on ec_recover.json whitelist [#1037](https://github.com/lambdaclass/cairo-rs/pull/1037): +* Implement hint on ec_recover.json whitelist [#1037](https://github.com/lambdaclass/cairo-vm/pull/1037): `BuiltinHintProcessor` now supports the following hint: @@ -597,7 +597,7 @@ %} ``` -* Implement hint for `starkware.cairo.common.cairo_keccak.keccak.finalize_keccak` as described by whitelist `starknet/security/whitelists/cairo_keccak.json` [#1041](https://github.com/lambdaclass/cairo-rs/pull/1041) +* Implement hint for `starkware.cairo.common.cairo_keccak.keccak.finalize_keccak` as described by whitelist `starknet/security/whitelists/cairo_keccak.json` [#1041](https://github.com/lambdaclass/cairo-vm/pull/1041) `BuiltinHintProcessor` now supports the following hint: @@ -614,7 +614,7 @@ %} ``` -* Implement hint on ec_recover.json whitelist [#1036](https://github.com/lambdaclass/cairo-rs/pull/1036): +* Implement hint on ec_recover.json whitelist [#1036](https://github.com/lambdaclass/cairo-vm/pull/1036): `BuiltinHintProcessor` now supports the following hint: @@ -632,7 +632,7 @@ ``` -* Add missing hint on vrf.json lib [#1054](https://github.com/lambdaclass/cairo-rs/pull/1054): +* Add missing hint on vrf.json lib [#1054](https://github.com/lambdaclass/cairo-vm/pull/1054): `BuiltinHintProcessor` now supports the following hint: @@ -645,7 +645,7 @@ value = (-y) % SECP_P ``` -* Implement hint on ec_recover.json whitelist [#1032](https://github.com/lambdaclass/cairo-rs/pull/1032): +* Implement hint on ec_recover.json whitelist [#1032](https://github.com/lambdaclass/cairo-vm/pull/1032): `BuiltinHintProcessor` now supports the following hint: @@ -661,7 +661,7 @@ %} ``` -* Implement hints on field_arithmetic lib (Part 2) [#1004](https://github.com/lambdaclass/cairo-rs/pull/1004) +* Implement hints on field_arithmetic lib (Part 2) [#1004](https://github.com/lambdaclass/cairo-vm/pull/1004) `BuiltinHintProcessor` now supports the following hint: @@ -697,10 +697,10 @@ %} ``` -* Optimizations for hash builtin [#1029](https://github.com/lambdaclass/cairo-rs/pull/1029): +* Optimizations for hash builtin [#1029](https://github.com/lambdaclass/cairo-vm/pull/1029): * Track the verified addresses by offset in a `Vec` rather than storing the address in a `Vec` -* Add missing hint on vrf.json whitelist [#1056](https://github.com/lambdaclass/cairo-rs/pull/1056): +* Add missing hint on vrf.json whitelist [#1056](https://github.com/lambdaclass/cairo-vm/pull/1056): `BuiltinHintProcessor` now supports the following hint: @@ -717,7 +717,7 @@ %} ``` -* Add missing hint on vrf.json whitelist [#1035](https://github.com/lambdaclass/cairo-rs/pull/1035): +* Add missing hint on vrf.json whitelist [#1035](https://github.com/lambdaclass/cairo-vm/pull/1035): `BuiltinHintProcessor` now supports the following hint: @@ -735,7 +735,7 @@ %} ``` -* Add missing hint on vrf.json whitelist [#1035](https://github.com/lambdaclass/cairo-rs/pull/1035): +* Add missing hint on vrf.json whitelist [#1035](https://github.com/lambdaclass/cairo-vm/pull/1035): `BuiltinHintProcessor` now supports the following hint: @@ -750,7 +750,7 @@ %} ``` -* Add missing hint on vrf.json whitelist [#1000](https://github.com/lambdaclass/cairo-rs/pull/1000): +* Add missing hint on vrf.json whitelist [#1000](https://github.com/lambdaclass/cairo-vm/pull/1000): `BuiltinHintProcessor` now supports the following hint: @@ -769,14 +769,14 @@ ids.x_inverse_mod_p.high = x_inverse_mod_p_split[1] ``` -* BREAKING CHANGE: Fix `CairoRunner::get_memory_holes` [#1027](https://github.com/lambdaclass/cairo-rs/pull/1027): +* BREAKING CHANGE: Fix `CairoRunner::get_memory_holes` [#1027](https://github.com/lambdaclass/cairo-vm/pull/1027): * Skip builtin segements when counting memory holes * Check amount of memory holes for all tests in cairo_run_test * Remove duplicated tests in cairo_run_test * BREAKING CHANGE: `MemorySegmentManager.get_memory_holes` now also receives the amount of builtins in the vm. Signature is now `pub fn get_memory_holes(&self, builtin_count: usize) -> Result` -* Add missing hints on cairo_secp lib [#1026](https://github.com/lambdaclass/cairo-rs/pull/1026): +* Add missing hints on cairo_secp lib [#1026](https://github.com/lambdaclass/cairo-vm/pull/1026): `BuiltinHintProcessor` now supports the following hints: @@ -789,7 +789,7 @@ from starkware.cairo.common.cairo_secp.secp256r1_utils import SECP256R1_N as N ``` -* Add missing hint on vrf.json lib [#1043](https://github.com/lambdaclass/cairo-rs/pull/1043): +* Add missing hint on vrf.json lib [#1043](https://github.com/lambdaclass/cairo-vm/pull/1043): `BuiltinHintProcessor` now supports the following hint: @@ -817,7 +817,7 @@ ids.b_inverse_mod_p.high = b_inverse_mod_p_split[1] ``` -* Add missing hints `NewHint#35` and `NewHint#36` [#975](https://github.com/lambdaclass/cairo-rs/issues/975) +* Add missing hints `NewHint#35` and `NewHint#36` [#975](https://github.com/lambdaclass/cairo-vm/issues/975) `BuiltinHintProcessor` now supports the following hint: @@ -839,7 +839,7 @@ ids.flag = 1 if k > 0 else 0 ``` -* Add missing hint on cairo_secp lib [#1057](https://github.com/lambdaclass/cairo-rs/pull/1057): +* Add missing hint on cairo_secp lib [#1057](https://github.com/lambdaclass/cairo-vm/pull/1057): `BuiltinHintProcessor` now supports the following hint: @@ -853,7 +853,7 @@ value = slope = ec_double_slope(point=(x, y), alpha=ALPHA, p=SECP_P) ``` -* Add missing hint on uint256_improvements lib [#1025](https://github.com/lambdaclass/cairo-rs/pull/1025): +* Add missing hint on uint256_improvements lib [#1025](https://github.com/lambdaclass/cairo-vm/pull/1025): `BuiltinHintProcessor` now supports the following hint: @@ -865,7 +865,7 @@ ids.root = root ``` -* Add missing hint on vrf.json lib [#1045](https://github.com/lambdaclass/cairo-rs/pull/1045): +* Add missing hint on vrf.json lib [#1045](https://github.com/lambdaclass/cairo-vm/pull/1045): `BuiltinHintProcessor` now supports the following hint: @@ -907,7 +907,7 @@ ids.sqrt_gx.high = split_root_gx[1] ``` -* Add missing hint on uint256_improvements lib [#1024](https://github.com/lambdaclass/cairo-rs/pull/1024): +* Add missing hint on uint256_improvements lib [#1024](https://github.com/lambdaclass/cairo-vm/pull/1024): `BuiltinHintProcessor` now supports the following hint: @@ -916,12 +916,12 @@ ids.carry = 1 if res >= ids.SHIFT else 0 ``` -* BREAKING CHANGE: move `Program::identifiers` to `SharedProgramData::identifiers` [#1023](https://github.com/lambdaclass/cairo-rs/pull/1023) +* BREAKING CHANGE: move `Program::identifiers` to `SharedProgramData::identifiers` [#1023](https://github.com/lambdaclass/cairo-vm/pull/1023) * Optimizes `CairoRunner::new`, needed for sequencers and other workflows reusing the same `Program` instance across `CairoRunner`s * Breaking change: make all fields in `Program` and `SharedProgramData` `pub(crate)`, since we break by moving the field let's make it the last break for this struct * Add `Program::get_identifier(&self, id: &str) -> &Identifier` to get a single identifier by name -* Implement hints on field_arithmetic lib[#985](https://github.com/lambdaclass/cairo-rs/pull/983) +* Implement hints on field_arithmetic lib[#985](https://github.com/lambdaclass/cairo-vm/pull/983) `BuiltinHintProcessor` now supports the following hint: @@ -973,7 +973,7 @@ %} ``` -* Add missing hint on vrf.json lib [#1050](https://github.com/lambdaclass/cairo-rs/pull/1050): +* Add missing hint on vrf.json lib [#1050](https://github.com/lambdaclass/cairo-vm/pull/1050): `BuiltinHintProcessor` now supports the following hint: @@ -982,7 +982,7 @@ ids.carry_low = 1 if sum_low >= ids.SHIFT else 0 ``` -* Add missing hint on uint256_improvements lib [#1016](https://github.com/lambdaclass/cairo-rs/pull/1016): +* Add missing hint on uint256_improvements lib [#1016](https://github.com/lambdaclass/cairo-vm/pull/1016): `BuiltinHintProcessor` now supports the following hint: @@ -1006,7 +1006,7 @@ ids.res.high = res_split[1] ``` -* Implement hint on vrf.json lib [#1049](https://github.com/lambdaclass/cairo-rs/pull/1049) +* Implement hint on vrf.json lib [#1049](https://github.com/lambdaclass/cairo-vm/pull/1049) `BuiltinHintProcessor` now supports the following hint: @@ -1048,7 +1048,7 @@ _Note: this hint is similar to the one in #983, but with some trailing whitespace removed_ -* Add missing hint on vrf.json whitelist [#1030](https://github.com/lambdaclass/cairo-rs/pull/1030): +* Add missing hint on vrf.json whitelist [#1030](https://github.com/lambdaclass/cairo-vm/pull/1030): `BuiltinHintProcessor` now supports the following hint: @@ -1085,9 +1085,9 @@ ids.remainder.high = remainder_split[1] ``` -* Add method `Program::data_len(&self) -> usize` to get the number of data cells in a given program [#1022](https://github.com/lambdaclass/cairo-rs/pull/1022) +* Add method `Program::data_len(&self) -> usize` to get the number of data cells in a given program [#1022](https://github.com/lambdaclass/cairo-vm/pull/1022) -* Add missing hint on uint256_improvements lib [#1013](https://github.com/lambdaclass/cairo-rs/pull/1013): +* Add missing hint on uint256_improvements lib [#1013](https://github.com/lambdaclass/cairo-vm/pull/1013): `BuiltinHintProcessor` now supports the following hint: @@ -1102,7 +1102,7 @@ ids.remainder.high = remainder >> 128 ``` -* Add missing hint on cairo_secp lib [#1010](https://github.com/lambdaclass/cairo-rs/pull/1010): +* Add missing hint on cairo_secp lib [#1010](https://github.com/lambdaclass/cairo-vm/pull/1010): `BuiltinHintProcessor` now supports the following hint: @@ -1110,7 +1110,7 @@ memory[ap] = int(x == 0) ``` -* Implement hint on `get_felt_bitlength` [#993](https://github.com/lambdaclass/cairo-rs/pull/993) +* Implement hint on `get_felt_bitlength` [#993](https://github.com/lambdaclass/cairo-vm/pull/993) `BuiltinHintProcessor` now supports the following hint: ```python @@ -1119,7 +1119,7 @@ ``` Used by the [`Garaga` library function `get_felt_bitlength`](https://github.com/keep-starknet-strange/garaga/blob/249f8a372126b3a839f9c1e1080ea8c6f9374c0c/src/utils.cairo#L54) -* Add missing hint on cairo_secp lib [#1009](https://github.com/lambdaclass/cairo-rs/pull/1009): +* Add missing hint on cairo_secp lib [#1009](https://github.com/lambdaclass/cairo-vm/pull/1009): `BuiltinHintProcessor` now supports the following hint: @@ -1127,12 +1127,12 @@ ids.dibit = ((ids.scalar_u >> ids.m) & 1) + 2 * ((ids.scalar_v >> ids.m) & 1) ``` -* Add getters to read properties of a `Program` [#1017](https://github.com/lambdaclass/cairo-rs/pull/1017): +* Add getters to read properties of a `Program` [#1017](https://github.com/lambdaclass/cairo-vm/pull/1017): * `prime(&self) -> &str`: get the prime associated to data in hex representation * `iter_data(&self) -> Iterator`: get an iterator over all elements in the program data * `iter_builtins(&self) -> Iterator`: get an iterator over the names of required builtins -* Add missing hint on cairo_secp lib [#1008](https://github.com/lambdaclass/cairo-rs/pull/1008): +* Add missing hint on cairo_secp lib [#1008](https://github.com/lambdaclass/cairo-vm/pull/1008): `BuiltinHintProcessor` now supports the following hint: @@ -1140,16 +1140,16 @@ ids.len_hi = max(ids.scalar_u.d2.bit_length(), ids.scalar_v.d2.bit_length())-1 ``` -* Update `starknet-crypto` to version `0.4.3` [#1011](https://github.com/lambdaclass/cairo-rs/pull/1011) +* Update `starknet-crypto` to version `0.4.3` [#1011](https://github.com/lambdaclass/cairo-vm/pull/1011) * The new version carries an 85% reduction in execution time for ECDSA signature verification -* BREAKING CHANGE: refactor `Program` to optimize `Program::clone` [#999](https://github.com/lambdaclass/cairo-rs/pull/999) +* BREAKING CHANGE: refactor `Program` to optimize `Program::clone` [#999](https://github.com/lambdaclass/cairo-vm/pull/999) * Breaking change: many fields that were (unnecessarily) public become hidden by the refactor. -* BREAKING CHANGE: Add _builtin suffix to builtin names e.g.: output -> output_builtin [#1005](https://github.com/lambdaclass/cairo-rs/pull/1005) +* BREAKING CHANGE: Add _builtin suffix to builtin names e.g.: output -> output_builtin [#1005](https://github.com/lambdaclass/cairo-vm/pull/1005) -* Implement hint on uint384_extension lib [#983](https://github.com/lambdaclass/cairo-rs/pull/983) +* Implement hint on uint384_extension lib [#983](https://github.com/lambdaclass/cairo-vm/pull/983) `BuiltinHintProcessor` now supports the following hint: @@ -1189,15 +1189,15 @@ ids.remainder.d2 = remainder_split[2] ``` -* BREAKING CHANGE: optimization for instruction decoding [#942](https://github.com/lambdaclass/cairo-rs/pull/942): +* BREAKING CHANGE: optimization for instruction decoding [#942](https://github.com/lambdaclass/cairo-vm/pull/942): * Avoids copying immediate arguments to the `Instruction` structure, as they get inferred from the offset anyway * Breaking: removal of the field `Instruction::imm` -* Add missing `\n` character in traceback string [#997](https://github.com/lambdaclass/cairo-rs/pull/997) +* Add missing `\n` character in traceback string [#997](https://github.com/lambdaclass/cairo-vm/pull/997) * BugFix: Add missing `\n` character after traceback lines when the filename is missing ("Unknown Location") * 0.11 Support - * Add missing hints [#1014](https://github.com/lambdaclass/cairo-rs/pull/1014): + * Add missing hints [#1014](https://github.com/lambdaclass/cairo-vm/pull/1014): `BuiltinHintProcessor` now supports the following hints: ```python from starkware.cairo.common.cairo_secp.secp256r1_utils import SECP256R1_P as SECP_P @@ -1214,7 +1214,7 @@ y1 = pack(ids.point1.y, PRIME) value = slope = line_slope(point1=(x0, y0), point2=(x1, y1), p=SECP_P) ``` - * Add missing hints on cairo_secp lib [#991](https://github.com/lambdaclass/cairo-rs/pull/991): + * Add missing hints on cairo_secp lib [#991](https://github.com/lambdaclass/cairo-vm/pull/991): `BuiltinHintProcessor` now supports the following hints: ```python from starkware.cairo.common.cairo_secp.secp_utils import pack @@ -1229,17 +1229,17 @@ ```python value = k = safe_div(res * s - x, N) ``` - * Layouts update [#874](https://github.com/lambdaclass/cairo-rs/pull/874) - * Keccak builtin updated [#873](https://github.com/lambdaclass/cairo-rs/pull/873), [#883](https://github.com/lambdaclass/cairo-rs/pull/883) - * Changes to `ec_op` [#876](https://github.com/lambdaclass/cairo-rs/pull/876) - * Poseidon builtin [#875](https://github.com/lambdaclass/cairo-rs/pull/875) - * Renamed Felt to Felt252 [#899](https://github.com/lambdaclass/cairo-rs/pull/899) - * Added SegmentArenaBuiltinRunner [#913](https://github.com/lambdaclass/cairo-rs/pull/913) - * Added `program_segment_size` argument to `verify_secure_runner` & `run_from_entrypoint` [#928](https://github.com/lambdaclass/cairo-rs/pull/928) - * Added dynamic layout [#879](https://github.com/lambdaclass/cairo-rs/pull/879) - * `get_segment_size` was exposed [#934](https://github.com/lambdaclass/cairo-rs/pull/934) - -* Add missing hint on cairo_secp lib [#1006](https://github.com/lambdaclass/cairo-rs/pull/1006): + * Layouts update [#874](https://github.com/lambdaclass/cairo-vm/pull/874) + * Keccak builtin updated [#873](https://github.com/lambdaclass/cairo-vm/pull/873), [#883](https://github.com/lambdaclass/cairo-vm/pull/883) + * Changes to `ec_op` [#876](https://github.com/lambdaclass/cairo-vm/pull/876) + * Poseidon builtin [#875](https://github.com/lambdaclass/cairo-vm/pull/875) + * Renamed Felt to Felt252 [#899](https://github.com/lambdaclass/cairo-vm/pull/899) + * Added SegmentArenaBuiltinRunner [#913](https://github.com/lambdaclass/cairo-vm/pull/913) + * Added `program_segment_size` argument to `verify_secure_runner` & `run_from_entrypoint` [#928](https://github.com/lambdaclass/cairo-vm/pull/928) + * Added dynamic layout [#879](https://github.com/lambdaclass/cairo-vm/pull/879) + * `get_segment_size` was exposed [#934](https://github.com/lambdaclass/cairo-vm/pull/934) + +* Add missing hint on cairo_secp lib [#1006](https://github.com/lambdaclass/cairo-vm/pull/1006): `BuiltinHintProcessor` now supports the following hint: @@ -1252,7 +1252,7 @@ ) ``` -* Add missing hint on cairo_secp lib [#1003](https://github.com/lambdaclass/cairo-rs/pull/1003): +* Add missing hint on cairo_secp lib [#1003](https://github.com/lambdaclass/cairo-vm/pull/1003): `BuiltinHintProcessor` now supports the following hint: @@ -1262,7 +1262,7 @@ x = pack(ids.x, PRIME) % SECP_P ``` -* Add missing hint on cairo_secp lib [#996](https://github.com/lambdaclass/cairo-rs/pull/996): +* Add missing hint on cairo_secp lib [#996](https://github.com/lambdaclass/cairo-vm/pull/996): `BuiltinHintProcessor` now supports the following hint: @@ -1271,7 +1271,7 @@ value = x_inv = div_mod(1, x, SECP_P) ``` -* Add missing hints on cairo_secp lib [#994](https://github.com/lambdaclass/cairo-rs/pull/994): +* Add missing hints on cairo_secp lib [#994](https://github.com/lambdaclass/cairo-vm/pull/994): `BuiltinHintProcessor` now supports the following hints: @@ -1288,7 +1288,7 @@ value = k_plus_one = safe_div(res * b - a, N) + 1 ``` -* Add missing hint on cairo_secp lib [#992](https://github.com/lambdaclass/cairo-rs/pull/992): +* Add missing hint on cairo_secp lib [#992](https://github.com/lambdaclass/cairo-vm/pull/992): `BuiltinHintProcessor` now supports the following hint: @@ -1300,7 +1300,7 @@ ids.q = q % PRIME ``` -* Add missing hint on cairo_secp lib [#990](https://github.com/lambdaclass/cairo-rs/pull/990): +* Add missing hint on cairo_secp lib [#990](https://github.com/lambdaclass/cairo-vm/pull/990): `BuiltinHintProcessor` now supports the following hint: @@ -1314,7 +1314,7 @@ value = new_x = (pow(slope, 2, SECP_P) - 2 * x) % SECP_P ``` -* Add missing hint on cairo_secp lib [#989](https://github.com/lambdaclass/cairo-rs/pull/989): +* Add missing hint on cairo_secp lib [#989](https://github.com/lambdaclass/cairo-vm/pull/989): `BuiltinHintProcessor` now supports the following hint: @@ -1325,7 +1325,7 @@ ids.q = q % PRIME ``` -* Add missing hint on cairo_secp lib [#986](https://github.com/lambdaclass/cairo-rs/pull/986): +* Add missing hint on cairo_secp lib [#986](https://github.com/lambdaclass/cairo-vm/pull/986): `BuiltinHintProcessor` now supports the following hint: @@ -1339,7 +1339,7 @@ value = slope = div_mod(3 * x ** 2, 2 * y, SECP_P) ``` -* Add missing hint on cairo_secp lib [#984](https://github.com/lambdaclass/cairo-rs/pull/984): +* Add missing hint on cairo_secp lib [#984](https://github.com/lambdaclass/cairo-vm/pull/984): `BuiltinHintProcessor` now supports the following hint: @@ -1355,7 +1355,7 @@ value = slope = div_mod(y0 - y1, x0 - x1, SECP_P) ``` -* Implement hints on uint384 lib (Part 2) [#971](https://github.com/lambdaclass/cairo-rs/pull/971) +* Implement hints on uint384 lib (Part 2) [#971](https://github.com/lambdaclass/cairo-vm/pull/971) `BuiltinHintProcessor` now supports the following hint: @@ -1363,7 +1363,7 @@ memory[ap] = 1 if 0 <= (ids.a.d2 % PRIME) < 2 ** 127 else 0 ``` - * Add alternative hint code for hint on _block_permutation used by 0.10.3 whitelist [#958](https://github.com/lambdaclass/cairo-rs/pull/958) + * Add alternative hint code for hint on _block_permutation used by 0.10.3 whitelist [#958](https://github.com/lambdaclass/cairo-vm/pull/958) `BuiltinHintProcessor` now supports the following hint: @@ -1377,9 +1377,9 @@ segments.write_arg(ids.keccak_ptr, output_values) ``` -* Make hints code `src/hint_processor/builtin_hint_processor/hint_code.rs` public [#988](https://github.com/lambdaclass/cairo-rs/pull/988) +* Make hints code `src/hint_processor/builtin_hint_processor/hint_code.rs` public [#988](https://github.com/lambdaclass/cairo-vm/pull/988) -* Implement hints on uint384 lib (Part 1) [#960](https://github.com/lambdaclass/cairo-rs/pull/960) +* Implement hints on uint384 lib (Part 1) [#960](https://github.com/lambdaclass/cairo-vm/pull/960) `BuiltinHintProcessor` now supports the following hints: @@ -1449,11 +1449,11 @@ ids.root.d2 = root_split[2] ``` -* Re-export the `cairo-felt` crate as `cairo_vm::felt` [#981](https://github.com/lambdaclass/cairo-rs/pull/981) +* Re-export the `cairo-felt` crate as `cairo_vm::felt` [#981](https://github.com/lambdaclass/cairo-vm/pull/981) * Removes the need of explicitly importing `cairo-felt` in downstream projects and helps ensure there is no version mismatch caused by that -* Implement hint on `uint256_mul_div_mod`[#957](https://github.com/lambdaclass/cairo-rs/pull/957) +* Implement hint on `uint256_mul_div_mod`[#957](https://github.com/lambdaclass/cairo-vm/pull/957) `BuiltinHintProcessor` now supports the following hint: @@ -1474,51 +1474,51 @@ Used by the common library function `uint256_mul_div_mod` #### [0.3.0-rc1] - 2023-04-13 -* Derive Deserialize for ExecutionResources [#922](https://github.com/lambdaclass/cairo-rs/pull/922) -* Remove builtin names from VirtualMachine.builtin_runners [#921](https://github.com/lambdaclass/cairo-rs/pull/921) -* Implemented hints on common/ec.cairo [#888](https://github.com/lambdaclass/cairo-rs/pull/888) -* Changed `Memory.insert` argument types [#902](https://github.com/lambdaclass/cairo-rs/pull/902) -* feat: implemented `Deserialize` on Program by changing builtins field type to enum [#896](https://github.com/lambdaclass/cairo-rs/pull/896) -* Effective size computation from the VM exposed [#887](https://github.com/lambdaclass/cairo-rs/pull/887) -* Wasm32 Support! [#828](https://github.com/lambdaclass/cairo-rs/pull/828), [#893](https://github.com/lambdaclass/cairo-rs/pull/893) -* `MathError` added for math operation [#855](https://github.com/lambdaclass/cairo-rs/pull/855) -* Check for overflows in relocatable operations [#859](https://github.com/lambdaclass/cairo-rs/pull/859) -* Use `Relocatable` instead of `&MaybeRelocatable` in `load_data` and `get_range`[#860](https://github.com/lambdaclass/cairo-rs/pull/860) [#867](https://github.com/lambdaclass/cairo-rs/pull/867) -* Memory-related errors moved to `MemoryError` [#854](https://github.com/lambdaclass/cairo-rs/pull/854) +* Derive Deserialize for ExecutionResources [#922](https://github.com/lambdaclass/cairo-vm/pull/922) +* Remove builtin names from VirtualMachine.builtin_runners [#921](https://github.com/lambdaclass/cairo-vm/pull/921) +* Implemented hints on common/ec.cairo [#888](https://github.com/lambdaclass/cairo-vm/pull/888) +* Changed `Memory.insert` argument types [#902](https://github.com/lambdaclass/cairo-vm/pull/902) +* feat: implemented `Deserialize` on Program by changing builtins field type to enum [#896](https://github.com/lambdaclass/cairo-vm/pull/896) +* Effective size computation from the VM exposed [#887](https://github.com/lambdaclass/cairo-vm/pull/887) +* Wasm32 Support! [#828](https://github.com/lambdaclass/cairo-vm/pull/828), [#893](https://github.com/lambdaclass/cairo-vm/pull/893) +* `MathError` added for math operation [#855](https://github.com/lambdaclass/cairo-vm/pull/855) +* Check for overflows in relocatable operations [#859](https://github.com/lambdaclass/cairo-vm/pull/859) +* Use `Relocatable` instead of `&MaybeRelocatable` in `load_data` and `get_range`[#860](https://github.com/lambdaclass/cairo-vm/pull/860) [#867](https://github.com/lambdaclass/cairo-vm/pull/867) +* Memory-related errors moved to `MemoryError` [#854](https://github.com/lambdaclass/cairo-vm/pull/854) * Removed unused error variants * Moved memory-related error variants to `MemoryError` * Changed memory getters to return `MemoryError` instead of `VirtualMachineError` * Changed all memory-related errors in hint from `HintError::Internal(VmError::...` to `HintError::Memory(MemoryError::...` -* feat: Builder pattern for `VirtualMachine` [#820](https://github.com/lambdaclass/cairo-rs/pull/820) -* Simplified `Memory::get` return type to `Option` [#852](https://github.com/lambdaclass/cairo-rs/pull/852) -* Improved idenitifier variable error handling [#851](https://github.com/lambdaclass/cairo-rs/pull/851) -* `CairoRunner::write_output` now prints missing and relocatable values [#853](https://github.com/lambdaclass/cairo-rs/pull/853) -* `VirtualMachineError::FailedToComputeOperands` error message expanded [#848](https://github.com/lambdaclass/cairo-rs/pull/848) -* Builtin names made public [#849](https://github.com/lambdaclass/cairo-rs/pull/849) -* `secure_run` flag moved to `CairoRunConfig` struct [#832](https://github.com/lambdaclass/cairo-rs/pull/832) -* `vm_core` error types revised and iimplemented `AddAssign` for `Relocatable` [#837](https://github.com/lambdaclass/cairo-rs/pull/837) -* `to_bigint` and `to_biguint` deprecated [#757](https://github.com/lambdaclass/cairo-rs/pull/757) -* `Memory` moved into `MemorySegmentManager` [#830](https://github.com/lambdaclass/cairo-rs/pull/830) +* feat: Builder pattern for `VirtualMachine` [#820](https://github.com/lambdaclass/cairo-vm/pull/820) +* Simplified `Memory::get` return type to `Option` [#852](https://github.com/lambdaclass/cairo-vm/pull/852) +* Improved idenitifier variable error handling [#851](https://github.com/lambdaclass/cairo-vm/pull/851) +* `CairoRunner::write_output` now prints missing and relocatable values [#853](https://github.com/lambdaclass/cairo-vm/pull/853) +* `VirtualMachineError::FailedToComputeOperands` error message expanded [#848](https://github.com/lambdaclass/cairo-vm/pull/848) +* Builtin names made public [#849](https://github.com/lambdaclass/cairo-vm/pull/849) +* `secure_run` flag moved to `CairoRunConfig` struct [#832](https://github.com/lambdaclass/cairo-vm/pull/832) +* `vm_core` error types revised and iimplemented `AddAssign` for `Relocatable` [#837](https://github.com/lambdaclass/cairo-vm/pull/837) +* `to_bigint` and `to_biguint` deprecated [#757](https://github.com/lambdaclass/cairo-vm/pull/757) +* `Memory` moved into `MemorySegmentManager` [#830](https://github.com/lambdaclass/cairo-vm/pull/830) * To reduce the complexity of the VM's memory and enforce proper usage (as the memory and its segment manager are now a "unified" entity) * Removed `memory` field from `VirtualMachine` * Added `memory` field to `MemorySegmentManager` * Removed `Memory` argument from methods where `MemorySegmentManager` is also an argument * Added test macro `segments` (an extension of the `memory` macro) -* `Display` trait added to Memory struct [#812](https://github.com/lambdaclass/cairo-rs/pull/812) -* feat: Extensible VirtualMachineError and removed PartialEq trait [#783](https://github.com/lambdaclass/cairo-rs/pull/783) - * `VirtualMachineError::Other(anyhow::Error)` was added to allow to returning custom errors when using `cairo-rs` +* `Display` trait added to Memory struct [#812](https://github.com/lambdaclass/cairo-vm/pull/812) +* feat: Extensible VirtualMachineError and removed PartialEq trait [#783](https://github.com/lambdaclass/cairo-vm/pull/783) + * `VirtualMachineError::Other(anyhow::Error)` was added to allow to returning custom errors when using `cairo-vm` * The `PartialEq` trait was removed from the `VirtualMachineError` enum -* VM hooks added as a conditional feature [#761](https://github.com/lambdaclass/cairo-rs/pull/761) - * Cairo-rs based testing tools such as cairo-foundry or those built by FuzzingLabs need access to the state of the VM at specific points during the execution. - * This PR adds the possibility for users of the cairo-rs lib to execute their custom additional code during the program execution. +* VM hooks added as a conditional feature [#761](https://github.com/lambdaclass/cairo-vm/pull/761) + * Cairo-vm based testing tools such as cairo-foundry or those built by FuzzingLabs need access to the state of the VM at specific points during the execution. + * This PR adds the possibility for users of the cairo-vm lib to execute their custom additional code during the program execution. * The Rust "feature" mechanism was used in order to guarantee that this ability is only available when the lib user needs it, and is not compiled when it's not required. * Three hooks were created: * before the first step * before each step * after each step -* ExecutionResource operations: add and substract [#774](https://github.com/lambdaclass/cairo-rs/pull/774), multiplication [#908](https://github.com/lambdaclass/cairo-rs/pull/908) , and `AddAssign` [#914](https://github.com/lambdaclass/cairo-rs/pull/914) +* ExecutionResource operations: add and substract [#774](https://github.com/lambdaclass/cairo-vm/pull/774), multiplication [#908](https://github.com/lambdaclass/cairo-vm/pull/908) , and `AddAssign` [#914](https://github.com/lambdaclass/cairo-vm/pull/914) -* Move `Memory` into `MemorySegmentManager` [#830](https://github.com/lambdaclass/cairo-rs/pull/830) +* Move `Memory` into `MemorySegmentManager` [#830](https://github.com/lambdaclass/cairo-vm/pull/830) * Structural changes: * Remove `memory: Memory` field from `VirtualMachine` * Add `memory: Memory` field to `MemorySegmentManager` @@ -1535,25 +1535,25 @@ * `gen_cairo_arg(&mut self, arg: &CairoArg, memory: &mut Memory) -> Result` -> `gen_cairo_arg(&mut self, arg: &CairoArg) -> Result` * `write_arg(&mut self, memory: &mut Memory, ptr: &Relocatable, arg: &dyn Any) -> Result` -> `write_arg(&mut self, ptr: &Relocatable, arg: &dyn Any) -> Result` -* Refactor `Memory::relocate memory` [#784](https://github.com/lambdaclass/cairo-rs/pull/784) +* Refactor `Memory::relocate memory` [#784](https://github.com/lambdaclass/cairo-vm/pull/784) * Bugfixes: * `Memory::relocate_memory` now moves data in the temporary memory relocated by a relocation rule to the real memory * Aditional Notes: * When relocating temporary memory produces clashes with pre-existing values in the real memory, an InconsistentMemory error is returned instead of keeping the last inserted value. This differs from the original implementation. -* Restrict addresses to Relocatable + fix some error variants used in signature.rs [#792](https://github.com/lambdaclass/cairo-rs/pull/792) +* Restrict addresses to Relocatable + fix some error variants used in signature.rs [#792](https://github.com/lambdaclass/cairo-vm/pull/792) * Public Api Changes: * Change `ValidationRule` inner type to `Box Result, MemoryError>>`. * Change `validated_addresses` field of `Memory` to `HashSet`. * Change `validate_memory_cell(&mut self, address: &MaybeRelocatable) -> Result<(), MemoryError>` to `validate_memory_cell(&mut self, addr: &Relocatable) -> Result<(), MemoryError>`. -* Add `VmException` to `CairoRunner::run_from_entrypoint`[#775](https://github.com/lambdaclass/cairo-rs/pull/775) +* Add `VmException` to `CairoRunner::run_from_entrypoint`[#775](https://github.com/lambdaclass/cairo-vm/pull/775) * Public Api Changes: * Change error return type of `CairoRunner::run_from_entrypoint` to `CairoRunError`. * Convert `VirtualMachineError`s outputed during the vm run to `VmException` in `CairoRunner::run_from_entrypoint`. * Make `VmException` fields public -* Fix `BuiltinRunner::final_stack` and remove quick fix [#778](https://github.com/lambdaclass/cairo-rs/pull/778) +* Fix `BuiltinRunner::final_stack` and remove quick fix [#778](https://github.com/lambdaclass/cairo-vm/pull/778) * Public Api changes: * Various changes to public `BuiltinRunner` method's signatures: * `final_stack(&self, vm: &VirtualMachine, pointer: Relocatable) -> Result<(Relocatable, usize), RunnerError>` to `final_stack(&mut self, segments: &MemorySegmentManager, memory: &Memory, pointer: Relocatable) -> Result`. @@ -1563,7 +1563,7 @@ * `BuiltinRunner::final_stack` now updates the builtin's stop_ptr instead of returning it. This replaces the bugfix on PR #768. #### [0.1.3] - 2023-01-26 -* Add secure_run flag + integrate verify_secure_runner into cairo-run [#771](https://github.com/lambdaclass/cairo-rs/pull/777) +* Add secure_run flag + integrate verify_secure_runner into cairo-run [#771](https://github.com/lambdaclass/cairo-vm/pull/777) * Public Api changes: * Add command_line argument `secure_run` * Add argument `secure_run: Option` to `cairo_run` @@ -1572,7 +1572,7 @@ * `EcOpBuiltinRunner::deduce_memory_cell` now checks that both points are on the curve instead of only the first one * `EcOpBuiltinRunner::deduce_memory_cell` now returns the values of the point coordinates instead of the indices when a `PointNotOnCurve` error is returned -* Refactor `Refactor verify_secure_runner` [#768](https://github.com/lambdaclass/cairo-rs/pull/768) +* Refactor `Refactor verify_secure_runner` [#768](https://github.com/lambdaclass/cairo-vm/pull/768) * Public Api changes: * Remove builtin name from the return value of `BuiltinRunner::get_memory_segment_addresses` * Simplify the return value of `CairoRunner::get_builtin_segments_info` to `Vec<(usize, usize)>` @@ -1580,7 +1580,7 @@ * Bugfixes: * CairoRunner::read_return_values now updates the `stop_ptr` of each builtin after calling `BuiltinRunner::final_stack` -* Use CairoArg enum instead of Any in CairoRunner::run_from_entrypoint [#686](https://github.com/lambdaclass/cairo-rs/pull/686) +* Use CairoArg enum instead of Any in CairoRunner::run_from_entrypoint [#686](https://github.com/lambdaclass/cairo-vm/pull/686) * Public Api changes: * Remove `Result` from `MaybeRelocatable::mod_floor`, it now returns a `MaybeRelocatable` * Add struct `CairoArg` @@ -1591,39 +1591,39 @@ #### [0.1.1] - 2023-01-11 -* Add input file contents to traceback [#666](https://github.com/lambdaclass/cairo-rs/pull/666/files) +* Add input file contents to traceback [#666](https://github.com/lambdaclass/cairo-vm/pull/666/files) * Public Api changes: * `VirtualMachineError` enum variants containing `MaybeRelocatable` and/or `Relocatable` values now use the `Display` format instead of `Debug` in their `Display` implementation * `get_traceback` now adds the source code line to each traceback entry -* Use hint location instead of instruction location when building VmExceptions from hint failure [#673](https://github.com/lambdaclass/cairo-rs/pull/673/files) +* Use hint location instead of instruction location when building VmExceptions from hint failure [#673](https://github.com/lambdaclass/cairo-vm/pull/673/files) * Public Api changes: * `hints` field added to `InstructionLocation` * `Program.instruction_locations` type changed from `Option>` to `Option>` * `VirtualMachineError`s produced by `HintProcessor::execute_hint()` will be wrapped in a `VirtualMachineError::Hint` error containing their hint_index * `get_location()` now receives an an optional usize value `hint_index`, used to obtain hint locations -* Default implementation of compile_hint [#680](https://github.com/lambdaclass/cairo-rs/pull/680) +* Default implementation of compile_hint [#680](https://github.com/lambdaclass/cairo-vm/pull/680) * Internal changes: * Make the `compile_hint` implementation which was in the `BuiltinHintProcessor` the default implementation in the trait. -* Add new error type `HintError` [#676](https://github.com/lambdaclass/cairo-rs/pull/676) +* Add new error type `HintError` [#676](https://github.com/lambdaclass/cairo-vm/pull/676) * Public Api changes: * `HintProcessor::execute_hint()` now returns a `HintError` instead of a `VirtualMachineError` * Helper functions on `hint_processor_utils.rs` now return a `HintError` -* Change the Dictionary used in dict hints to store MaybeRelocatable instead of BigInt [#687](https://github.com/lambdaclass/cairo-rs/pull/687) +* Change the Dictionary used in dict hints to store MaybeRelocatable instead of BigInt [#687](https://github.com/lambdaclass/cairo-vm/pull/687) * Public Api changes: * `DictManager`, its dictionaries, and all dict module hints implemented in rust now use `MaybeRelocatable` for keys and values instead of `BigInt` * Add helper functions that allow extracting ids variables as `MaybeRelocatable`: `get_maybe_relocatable_from_var_name` & `get_maybe_relocatable_from_reference` * Change inner value type of dict-related `HintError` variants to `MaybeRelocatable` -* Implement `substitute_error_message_attribute_references` [#689] (https://github.com/lambdaclass/cairo-rs/pull/689) +* Implement `substitute_error_message_attribute_references` [#689] (https://github.com/lambdaclass/cairo-vm/pull/689) * Public Api changes: * Remove `error_message_attributes` field from `VirtualMachine`, and `VirtualMachine::new` * Add `flow_tracking_data` field to `Attribute` * `get_error_attr_value` now replaces the references in the error message with the corresponding cairo values. * Remove duplicated handling of error attribute messages leading to duplicated into in the final error display. -* Fix multiplicative inverse bug [#697](https://github.com/lambdaclass/cairo-rs/pull/697) [#698](https://github.com/lambdaclass/cairo-rs/pull/698). The VM was using integer division rather than prime field inverse when deducing `op0` or `op1` for the multiplication opcode +* Fix multiplicative inverse bug [#697](https://github.com/lambdaclass/cairo-vm/pull/697) [#698](https://github.com/lambdaclass/cairo-vm/pull/698). The VM was using integer division rather than prime field inverse when deducing `op0` or `op1` for the multiplication opcode #### [0.1.0] - 2022-12-30 -* Add traceback to VmException [#657](https://github.com/lambdaclass/cairo-rs/pull/657) +* Add traceback to VmException [#657](https://github.com/lambdaclass/cairo-vm/pull/657) * Public API changes: * `traceback` field added to `VmException` struct * `pub fn from_vm_error(runner: &CairoRunner, error: VirtualMachineError, pc: usize) -> Self` is now `pub fn from_vm_error(runner: &CairoRunner, vm: &VirtualMachine, error: VirtualMachineError) -> Self` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index deaccfb0bc..1cfcb32af3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,11 +29,11 @@ All types of contributions are encouraged and valued. See the [Table of Contents > If you want to ask a question, we assume that you have read the available [Documentation](docs/). -Before you ask a question, it is best to search for existing [Issues](https://github.com/lambdaclass/cairo-rs/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. +Before you ask a question, it is best to search for existing [Issues](https://github.com/lambdaclass/cairo-vm/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. If you then still feel the need to ask a question and need clarification, we recommend the following: -- Open an [Issue](https://github.com/lambdaclass/cairo-rs/issues/new). +- Open an [Issue](https://github.com/lambdaclass/cairo-vm/issues/new). - Provide as much context as you can about what you're running into. - Provide project and platform versions (cairo language, rust compiler, Python, etc), depending on what seems relevant. @@ -73,7 +73,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform We use GitHub issues to track bugs and errors. If you run into an issue with the project: -- Open an [Issue](https://github.com/lambdaclass/cairo-rs/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) +- Open an [Issue](https://github.com/lambdaclass/cairo-vm/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) - Explain the behavior you would expect and the actual behavior. - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. - Provide the information you collected in the previous section. @@ -96,19 +96,19 @@ This section guides you through submitting an enhancement suggestion for CONTRIB - Make sure that you are using the latest version. - Read the [documentation](docs/) carefully and find out if the functionality is already covered, maybe by an individual configuration. -- Perform a [search](https://github.com/lambdaclass/cairo-rs/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +- Perform a [search](https://github.com/lambdaclass/cairo-vm/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. #### How Do I Submit a Good Enhancement Suggestion? -Enhancement suggestions are tracked as [GitHub issues](https://github.com/lambdaclass/cairo-rs/issues). +Enhancement suggestions are tracked as [GitHub issues](https://github.com/lambdaclass/cairo-vm/issues). - Use a **clear and descriptive title** for the issue to identify the suggestion. - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. -- **Explain why this enhancement would be useful** to most cairo-rs users. You may also want to point out the other projects that solved it better and which could serve as inspiration. +- **Explain why this enhancement would be useful** to most cairo-vm users. You may also want to point out the other projects that solved it better and which could serve as inspiration.