Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add div by zero error #1433

Merged
merged 13 commits into from
Sep 7, 2023
Merged

Add div by zero error #1433

merged 13 commits into from
Sep 7, 2023

Conversation

Juan-M-V
Copy link
Contributor

@Juan-M-V Juan-M-V commented Sep 1, 2023

Raise error when dividing by zero

Description

ec_recover and uint512_unsigned_div_rem now raises errors when trying to divide by zero. Fixes #1431

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #1433 (73356ce) into main (2b11e1d) will decrease coverage by 0.01%.
The diff coverage is 95.69%.

@@            Coverage Diff             @@
##             main    #1433      +/-   ##
==========================================
- Coverage   96.99%   96.98%   -0.01%     
==========================================
  Files          93       93              
  Lines       38544    38637      +93     
==========================================
+ Hits        37385    37474      +89     
- Misses       1159     1163       +4     
Files Changed Coverage Δ
...rc/hint_processor/builtin_hint_processor/vrf/fq.rs 96.29% <94.73%> (-0.34%) ⬇️
...int_processor/builtin_hint_processor/ec_recover.rs 98.75% <95.94%> (-1.25%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 4.195 ± 0.016 4.167 4.223 1.01 ± 0.01
head big_factorial 4.160 ± 0.018 4.146 4.205 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 3.550 ± 0.011 3.535 3.571 1.00 ± 0.00
head big_fibonacci 3.541 ± 0.012 3.525 3.570 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 9.809 ± 0.031 9.782 9.894 1.00
head blake2s_integration_benchmark 9.851 ± 0.053 9.816 9.995 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 3.644 ± 0.013 3.624 3.661 1.00 ± 0.00
head compare_arrays_200000 3.636 ± 0.010 3.618 3.650 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.405 ± 0.006 2.396 2.417 1.00 ± 0.00
head dict_integration_benchmark 2.400 ± 0.009 2.388 2.419 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.754 ± 0.003 1.751 1.759 1.00 ± 0.00
head field_arithmetic_get_square_benchmark 1.750 ± 0.003 1.745 1.754 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 9.930 ± 0.531 9.632 11.023 1.03 ± 0.06
head integration_builtins 9.661 ± 0.026 9.624 9.715 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 10.043 ± 0.119 9.975 10.372 1.01 ± 0.01
head keccak_integration_benchmark 9.981 ± 0.020 9.946 10.015 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 3.635 ± 0.017 3.618 3.676 1.00 ± 0.01
head linear_search 3.623 ± 0.009 3.614 3.641 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 2.664 ± 0.006 2.654 2.675 1.00 ± 0.00
head math_cmp_and_pow_integration_benchmark 2.653 ± 0.005 2.646 2.661 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.373 ± 0.006 2.367 2.383 1.01 ± 0.00
head math_integration_benchmark 2.359 ± 0.008 2.349 2.374 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.089 ± 0.005 2.082 2.098 1.00 ± 0.00
head memory_integration_benchmark 2.084 ± 0.006 2.079 2.096 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.308 ± 0.005 2.301 2.318 1.00
head operations_with_data_structures_benchmarks 2.313 ± 0.023 2.300 2.378 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 809.7 ± 1.4 808.3 812.8 1.00
head pedersen 810.3 ± 6.8 806.1 829.2 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.502 ± 0.003 1.498 1.508 1.00 ± 0.00
head poseidon_integration_benchmark 1.499 ± 0.003 1.496 1.504 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.906 ± 0.012 2.894 2.936 1.00 ± 0.00
head secp_integration_benchmark 2.902 ± 0.006 2.893 2.910 1.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.660 ± 0.009 1.640 1.674 1.00
head set_integration_benchmark 1.713 ± 0.003 1.710 1.718 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 6.440 ± 0.019 6.422 6.491 1.00 ± 0.00
head uint256_integration_benchmark 6.423 ± 0.015 6.399 6.454 1.00

@Juan-M-V Juan-M-V marked this pull request as ready for review September 1, 2023 17:58
@Juan-M-V
Copy link
Contributor Author

Juan-M-V commented Sep 5, 2023

For anyone reviewing:
Currently the codecov/patch check fails because it's detecting the assert_matches! macro inside some tests as uncovered lines. This currently has a fix in nightly

@pefontana pefontana added this pull request to the merge queue Sep 7, 2023
Merged via the queue into main with commit 1b8e5c0 Sep 7, 2023
@pefontana pefontana deleted the fix-div-zero-ec-hint branch September 7, 2023 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Division by zero bug
3 participants