lambdaclass / cairo-vm

cairo-vm is a Rust implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
https://lambdaclass.github.io/cairo-vm
Apache License 2.0
488 stars 133 forks source link

Fix error handling in `initialize_state` #1657

Closed fmoletta closed 4 months ago

fmoletta commented 4 months ago

initialize_state now returns the correct errors when either program_base or execution_base are None Also closes #1638

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.70%. Comparing base (105ca3a) to head (880ba3c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1657 +/- ## ========================================== - Coverage 96.70% 96.70% -0.01% ========================================== Files 95 95 Lines 38154 38151 -3 ========================================== - Hits 36897 36894 -3 Misses 1257 1257 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 4 months ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.261 ± 0.024 2.239 2.307 1.00
head big_factorial 2.263 ± 0.022 2.235 2.294 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.266 ± 0.022 2.245 2.313 1.00
head big_fibonacci 2.282 ± 0.050 2.249 2.386 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.485 ± 0.124 8.265 8.665 1.01 ± 0.02
head blake2s_integration_benchmark 8.399 ± 0.131 8.248 8.575 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.308 ± 0.010 2.298 2.322 1.00
head compare_arrays_200000 2.310 ± 0.006 2.299 2.320 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.444 ± 0.010 1.431 1.460 1.01 ± 0.01
head dict_integration_benchmark 1.435 ± 0.013 1.420 1.454 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.294 ± 0.010 1.283 1.311 1.00
head field_arithmetic_get_square_benchmark 1.309 ± 0.023 1.288 1.367 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.533 ± 0.326 8.287 9.384 1.02 ± 0.04
head integration_builtins 8.392 ± 0.146 8.257 8.575 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.641 ± 0.140 8.512 8.827 1.00
head keccak_integration_benchmark 8.714 ± 0.148 8.496 8.840 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.311 ± 0.011 2.300 2.336 1.00
head linear_search 2.330 ± 0.019 2.314 2.378 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.552 ± 0.010 1.542 1.570 1.00 ± 0.01
head math_cmp_and_pow_integration_benchmark 1.549 ± 0.010 1.537 1.565 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.431 ± 0.032 1.406 1.500 1.00
head math_integration_benchmark 1.442 ± 0.035 1.413 1.508 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.252 ± 0.012 1.231 1.270 1.00 ± 0.01
head memory_integration_benchmark 1.249 ± 0.012 1.230 1.267 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.600 ± 0.006 1.590 1.609 1.00
head operations_with_data_structures_benchmarks 1.600 ± 0.006 1.592 1.608 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 593.0 ± 3.1 588.2 600.0 1.00
head pedersen 593.2 ± 6.3 589.9 610.9 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 979.3 ± 10.5 960.2 998.8 1.00
head poseidon_integration_benchmark 984.5 ± 7.2 975.4 994.6 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.878 ± 0.013 1.864 1.911 1.01 ± 0.01
head secp_integration_benchmark 1.861 ± 0.008 1.850 1.880 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 724.1 ± 3.0 720.5 729.3 1.00 ± 0.01
head set_integration_benchmark 723.6 ± 3.8 719.0 731.9 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.643 ± 0.054 4.560 4.753 1.00 ± 0.04
head uint256_integration_benchmark 4.637 ± 0.164 4.552 5.098 1.00