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 EXCESS_BALANCE hint & Bump Rust to 1.74 (base 0.9.x) #1786

Merged
merged 11 commits into from
Jun 7, 2024

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Jun 6, 2024

Includes changes from #1777 but based on latest 0.9 release
Also bumps rust to 1.74

* WIP

* Add MarginParams

* Impl imf

* Start excess_balance fn

* Add TODO comment

* refactor + handle errors

* Remove unused error

* Finish implementing hint

* Handle error

* Fix var names

* Setup hint test

* Fix test

* Fix test

* Fix test

* Fix test values

* Fix

* Update

* Fix

* Use constants

* Remove unwrap

* Remove allow

* Remove unused feature

* Add failure test case

* Fix test values

* Add no-std imports

* Add no-std imports

* Add hint code

* Add changelog entry

* Use checked arithmetic operations
@fmoletta fmoletta marked this pull request as ready for review June 6, 2024 19:53
Copy link

github-actions bot commented Jun 6, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.649 ± 0.023 2.623 2.700 1.11 ± 0.02
head big_factorial 2.391 ± 0.026 2.361 2.438 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.216 ± 0.008 2.205 2.232 1.11 ± 0.01
head big_fibonacci 1.999 ± 0.013 1.981 2.020 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 6.256 ± 0.037 6.213 6.325 1.08 ± 0.01
head blake2s_integration_benchmark 5.767 ± 0.046 5.692 5.833 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.320 ± 0.021 2.306 2.376 1.11 ± 0.01
head compare_arrays_200000 2.088 ± 0.012 2.071 2.110 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.624 ± 0.015 1.610 1.656 1.08 ± 0.01
head dict_integration_benchmark 1.508 ± 0.012 1.491 1.533 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.080 ± 0.004 1.074 1.085 1.07 ± 0.01
head field_arithmetic_get_square_benchmark 1.013 ± 0.009 0.995 1.029 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 6.261 ± 0.043 6.211 6.352 1.09 ± 0.01
head integration_builtins 5.729 ± 0.060 5.658 5.818 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 6.371 ± 0.041 6.324 6.456 1.09 ± 0.01
head keccak_integration_benchmark 5.862 ± 0.048 5.803 5.964 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.351 ± 0.017 2.322 2.389 1.13 ± 0.01
head linear_search 2.076 ± 0.010 2.065 2.090 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.594 ± 0.007 1.577 1.600 1.11 ± 0.02
head math_cmp_and_pow_integration_benchmark 1.442 ± 0.024 1.421 1.503 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.504 ± 0.006 1.493 1.512 1.09 ± 0.01
head math_integration_benchmark 1.382 ± 0.007 1.375 1.398 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.332 ± 0.006 1.320 1.341 1.08 ± 0.01
head memory_integration_benchmark 1.234 ± 0.011 1.223 1.262 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.468 ± 0.012 1.458 1.500 1.08 ± 0.02
head operations_with_data_structures_benchmarks 1.363 ± 0.016 1.346 1.404 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 590.6 ± 1.4 589.0 593.7 1.09 ± 0.01
head pedersen 543.5 ± 2.4 540.0 548.2 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.165 ± 0.009 1.157 1.188 1.10 ± 0.01
head poseidon_integration_benchmark 1.063 ± 0.011 1.054 1.090 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.054 ± 0.018 2.031 2.094 1.10 ± 0.01
head secp_integration_benchmark 1.865 ± 0.016 1.846 1.887 1.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.166 ± 0.013 1.155 1.197 1.03 ± 0.01
head set_integration_benchmark 1.135 ± 0.008 1.125 1.149 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 3.987 ± 0.043 3.954 4.093 1.10 ± 0.02
head uint256_integration_benchmark 3.609 ± 0.031 3.572 3.680 1.00

pefontana
pefontana previously approved these changes Jun 6, 2024
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 97.60956% with 24 lines in your changes missing coverage. Please review.

Please upload report for BASE (releases/0.9.X@8ab4471). Learn more about missing BASE report.

Files Patch % Lines
...processor/builtin_hint_processor/excess_balance.rs 98.68% 13 Missing ⚠️
...int_processor/builtin_hint_processor_definition.rs 14.28% 6 Missing ⚠️
...t_processor/builtin_hint_processor/dict_manager.rs 57.14% 3 Missing ⚠️
vm/src/serde/deserialize_program.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             releases/0.9.X    #1786   +/-   ##
=================================================
  Coverage                  ?   97.39%           
=================================================
  Files                     ?       95           
  Lines                     ?    40367           
  Branches                  ?        0           
=================================================
  Hits                      ?    39316           
  Misses                    ?     1051           
  Partials                  ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* Update rust version to 1.74.1

* cargo fmt -all

* Update Makefile

* cargo clippy --fix

* fix cargo clippy

* restore fuzzer/Cargo.lock

---------

Co-authored-by: Pedro Fontana <peter@Pedros-MacBook-Pro.local>
@fmoletta fmoletta changed the title Add EXCESS_BALANCE hint (base 0.9.x) Add EXCESS_BALANCE hint & Bump Rust to 1.74 (base 0.9.x) Jun 7, 2024
juanbono
juanbono previously approved these changes Jun 7, 2024
This reverts commit ef5d214.
Oppen
Oppen previously approved these changes Jun 7, 2024
@fmoletta fmoletta merged commit 3d00941 into releases/0.9.X Jun 7, 2024
51 checks passed
@fmoletta fmoletta deleted the excess-balance-hint-0.9.X branch June 7, 2024 17:39
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.

4 participants