Skip to content

Commit

Permalink
Merge branch 'main' into decode-with-str-radix
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan-M-V authored Jan 16, 2023
2 parents 75291d3 + ef1923d commit de00980
Show file tree
Hide file tree
Showing 68 changed files with 1,393 additions and 546 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Install Rust 1.62.1
- name: Install Rust 1.66.1
uses: actions-rs/toolchain@v1
with:
toolchain: 1.62.1
toolchain: 1.66.1
override: true
components: rustfmt, clippy
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bench_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Install Rust 1.62.1
- name: Install Rust 1.66.1
uses: actions-rs/toolchain@v1
with:
toolchain: 1.62.1
toolchain: 1.66.1
override: true
components: rustfmt, clippy
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iai_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.61.0
toolchain: 1.66.1
override: true
profile: minimal
- name: Python3 Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/iai_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.61.0
toolchain: 1.66.1
override: true
profile: minimal
- name: Python3 Build
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.61.0
toolchain: 1.66.1
override: true
profile: minimal
- name: Python3 Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Install Rust 1.61.0
- name: Install Rust 1.66.1
uses: actions-rs/toolchain@v1
with:
toolchain: 1.61.0
toolchain: 1.66.1
override: true
components: rustfmt, clippy
- name: Python3 Build
Expand Down
39 changes: 28 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
* Add traceback to VmException [#657](https://github.com/lambdaclass/cairo-rs/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`
* `pub fn get_location(pc: &usize, runner: &CairoRunner) -> Option<Location>` is now `pub fn get_location(pc: usize, runner: &CairoRunner) -> Option<Location>`
* `pub fn decode_instruction(encoded_instr: i64, mut imm: Option<BigInt>) -> Result<instruction::Instruction, VirtualMachineError>` is now `pub fn decode_instruction(encoded_instr: i64, mut imm: Option<&BigInt>) -> Result<instruction::Instruction, VirtualMachineError>`
* `VmExcepion` field's string format now mirror their cairo-lang conterparts.
## Cairo-VM Changelog

#### Upcoming Changes

#### [0.1.1] - 2023-01-11

* Add input file contents to traceback [#666](https://github.com/lambdaclass/cairo-rs/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)
* Public Api changes:
* `hints` field added to `InstructionLocation`
* `Program.instruction_locations` type changed from `Option<HashMap<usize, Location>>` to `Option<HashMap<usize, InstructionLocation>>`
* `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)
* 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)
* 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`
* 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)
* 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)
* 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

#### [0.1.0] - 2022-12-30
* Add traceback to VmException [#657](https://github.com/lambdaclass/cairo-rs/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`
* `pub fn get_location(pc: &usize, runner: &CairoRunner) -> Option<Location>` is now `pub fn get_location(pc: usize, runner: &CairoRunner) -> Option<Location>`
* `pub fn decode_instruction(encoded_instr: i64, mut imm: Option<BigInt>) -> Result<instruction::Instruction, VirtualMachineError>` is now `pub fn decode_instruction(encoded_instr: i64, mut imm: Option<&BigInt>) -> Result<instruction::Instruction, VirtualMachineError>`
* `VmExcepion` field's string format now mirror their cairo-lang conterparts.
Loading

1 comment on commit de00980

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: de00980 Previous: ef1923d Ratio
cairo_run(cairo_programs/benchmarks/secp_integration_benchmark.json 1890982823 ns/iter (± 35023647) 1409686395 ns/iter (± 5538410) 1.34
cairo_run(cairo_programs/benchmarks/blake2s_integration_benchmark.json 1494769085 ns/iter (± 19691473) 1115624223 ns/iter (± 7224468) 1.34
cairo_run(cairo_programs/benchmarks/operations_with_data_structures_benchmarks.json 2269517999 ns/iter (± 109089277) 1694858011 ns/iter (± 25946957) 1.34
cairo_run(cairo_programs/benchmarks/uint256_integration_benchmark.json 1573864233 ns/iter (± 65866885) 1141206098 ns/iter (± 6641417) 1.38

This comment was automatically generated by workflow using github-action-benchmark.

CC: @unbalancedparentheses

Please sign in to comment.