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

feat(hints): add NewHint#34 #1091

Merged
merged 8 commits into from
Apr 28, 2023
Merged

Conversation

MegaRedHand
Copy link
Contributor

@MegaRedHand MegaRedHand commented Apr 27, 2023

Closes: #974

Description

This PR adds the missing hint NewHint#34, now known as SHA256_MAIN_ARBITRARY_INPUT_LENGTH. Also renames SHA256_MAIN to SHA256_MAIN_CONSTANT_INPUT_LENGTH. As part of the changes, extract helper function get_constant_from_var_name used for retrieving a constant from constants HashMap.

MegaRedHand and others added 2 commits April 27, 2023 17:47
Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
@MegaRedHand MegaRedHand added the whitelisted-hint Implementation of hint on whitelist directory label Apr 27, 2023
@MegaRedHand MegaRedHand self-assigned this Apr 27, 2023
@github-actions
Copy link

github-actions bot commented Apr 27, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 3.475 ± 0.042 3.422 3.552 1.00 ± 0.02
head blake2s_integration_benchmark 3.471 ± 0.046 3.411 3.559 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.121 ± 0.053 4.063 4.245 1.01 ± 0.02
head compare_arrays_200000 4.096 ± 0.047 4.027 4.193 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 3.148 ± 0.021 3.115 3.183 1.00
head dict_integration_benchmark 3.151 ± 0.038 3.110 3.233 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 5.075 ± 0.059 4.996 5.222 1.00 ± 0.02
head factorial_multirun 5.062 ± 0.072 4.989 5.173 1.00
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 4.068 ± 0.111 3.993 4.372 1.02 ± 0.03
head fibonacci_1000_multirun 4.002 ± 0.047 3.944 4.122 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 150.6 ± 5.6 143.6 163.5 1.01 ± 0.05
head field_arithmetic_get_square_benchmark 149.4 ± 5.7 142.1 160.4 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 4.025 ± 0.046 3.983 4.126 1.00 ± 0.01
head integration_builtins 4.005 ± 0.028 3.963 4.049 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 3.773 ± 0.042 3.732 3.851 1.00 ± 0.02
head keccak_integration_benchmark 3.767 ± 0.064 3.699 3.930 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.233 ± 0.041 4.190 4.342 1.00
head linear_search 4.241 ± 0.037 4.193 4.316 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.478 ± 0.026 3.442 3.515 1.00
head math_cmp_and_pow_integration_benchmark 3.507 ± 0.051 3.408 3.586 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 3.217 ± 0.034 3.163 3.290 1.00
head math_integration_benchmark 3.234 ± 0.045 3.164 3.293 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.873 ± 0.045 2.827 2.992 1.00 ± 0.02
head memory_integration_benchmark 2.868 ± 0.030 2.826 2.927 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.791 ± 0.036 2.723 2.863 1.02 ± 0.02
head operations_with_data_structures_benchmarks 2.734 ± 0.036 2.670 2.790 1.00
Command Mean [s] Min [s] Max [s] Relative
base pedersen 1.001 ± 0.009 0.982 1.014 1.00 ± 0.01
head pedersen 0.999 ± 0.011 0.983 1.018 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.790 ± 0.044 1.736 1.847 1.00
head poseidon_integration_benchmark 1.797 ± 0.040 1.746 1.895 1.00 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.231 ± 0.042 3.195 3.318 1.00
head secp_integration_benchmark 3.261 ± 0.050 3.213 3.377 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.529 ± 0.031 2.493 2.581 1.00
head set_integration_benchmark 2.562 ± 0.082 2.512 2.786 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.602 ± 0.089 4.478 4.736 1.00
head uint256_integration_benchmark 4.607 ± 0.061 4.518 4.708 1.00 ± 0.02

@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Merging #1091 (3f911e3) into main (a733298) will increase coverage by 0.00%.
The diff coverage is 99.00%.

@@           Coverage Diff            @@
##             main    #1091    +/-   ##
========================================
  Coverage   98.11%   98.11%            
========================================
  Files          84       84            
  Lines       34231    34419   +188     
========================================
+ Hits        33585    33771   +186     
- Misses        646      648     +2     
Impacted Files Coverage Δ
...t_processor/builtin_hint_processor/sha256_utils.rs 99.32% <98.88%> (-0.68%) ⬇️
...int_processor/builtin_hint_processor_definition.rs 99.05% <100.00%> (+0.01%) ⬆️
...int_processor/builtin_hint_processor/hint_utils.rs 94.87% <100.00%> (+0.27%) ⬆️
...c/hint_processor/builtin_hint_processor/uint384.rs 97.80% <100.00%> (-0.02%) ⬇️

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

MegaRedHand and others added 3 commits April 27, 2023 18:50
@MegaRedHand MegaRedHand added this pull request to the merge queue Apr 28, 2023
Merged via the queue into main with commit 4d97173 Apr 28, 2023
30 checks passed
@MegaRedHand MegaRedHand deleted the newhint34-cairo_sha256_arbitrary_length branch April 28, 2023 16:44
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* Add NewHint#34

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>

* Update changelog

* Change `let` + `assert` for `assert`

Co-authored-by: fmoletta <99273364+fmoletta@users.noreply.github.com>

* Change AssertionFailed messages

* Change let + assert for simple assert

---------

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
Co-authored-by: fmoletta <99273364+fmoletta@users.noreply.github.com>
Co-authored-by: Pedro Fontana <fontana.pedro93@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whitelisted-hint Implementation of hint on whitelist directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Hints] cairo_sha256_arbitrary_input_length.json
3 participants