-
Notifications
You must be signed in to change notification settings - Fork 44
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 test for Bravos transfer #721
base: main
Are you sure you want to change the base?
Conversation
Benchmark results Main vs HEAD.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can you link the issue to the PR, like we do here #720
.multicall_compiled.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this?
@@ -176,6 +176,23 @@ fn test_program_cases(program_path: &str) { | |||
#[test_case("tests/cases/cairo_vm/contracts/field_sqrt.cairo", &[])] | |||
#[test_case("tests/cases/cairo_vm/contracts/random_ec_point.cairo", &[])] | |||
#[test_case("tests/cases/cairo_vm/contracts/alloc_constant_size.cairo", &[10, 10, 10])] | |||
#[test_case("tests/cases/cairo_vm/contracts/multicall.cairo", &[ | |||
// n_calls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add in the commented lines what these numbers are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further, maybe using the serialized bytes and include!
results in something readable?
@@ -0,0 +1,35 @@ | |||
#[starknet::contract] | |||
mod MultiCall { | |||
// use starknet::account::Call; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check in the issue,
In the multicall.cairo, there are some commented lines. If you change the type of calldata to Span, uncomment those lines and comment out the ones above so that it compiles.
Can we add the two cases of this contract with the two different data types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pefontana which is the other calldata's type you are refering to? Because its type was Span when I first saw it.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #721 +/- ##
==========================================
+ Coverage 87.98% 88.15% +0.16%
==========================================
Files 122 122
Lines 34289 34289
==========================================
+ Hits 30169 30226 +57
+ Misses 4120 4063 -57 ☔ View full report in Codecov by Sentry. |
tests/tests/cases.rs
Outdated
@@ -9,7 +9,7 @@ use test_case::test_case; | |||
|
|||
// Test cases for programs without input, it checks the outputs are correct automatically. | |||
|
|||
// felt tests | |||
// // felt tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// // felt tests | |
// felt tests |
Benchmarking resultsBenchmark for program
|
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
10.634 ± 0.240 | 10.430 | 11.152 | 23.68 ± 0.55 |
cairo-native (embedded AOT) |
3.135 ± 0.046 | 3.095 | 3.251 | 6.98 ± 0.11 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
3.171 ± 0.018 | 3.150 | 3.204 | 7.06 ± 0.05 |
cairo-native (standalone AOT) |
0.674 ± 0.001 | 0.672 | 0.676 | 1.50 ± 0.01 |
cairo-native (standalone AOT with -march=native) |
0.449 ± 0.002 | 0.448 | 0.455 | 1.00 |
Benchmark for program fib_2M
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
10.759 ± 0.325 | 10.312 | 11.111 | 1292.03 ± 40.20 |
cairo-native (embedded AOT) |
2.655 ± 0.017 | 2.633 | 2.681 | 318.78 ± 3.15 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.673 ± 0.013 | 2.649 | 2.693 | 321.04 ± 2.88 |
cairo-native (standalone AOT) |
0.008 ± 0.000 | 0.008 | 0.009 | 1.00 |
cairo-native (standalone AOT with -march=native) |
0.008 ± 0.002 | 0.008 | 0.027 | 1.01 ± 0.24 |
Benchmark for program logistic_map
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
4.257 ± 0.036 | 4.209 | 4.318 | 59.66 ± 2.88 |
cairo-native (embedded AOT) |
2.810 ± 0.017 | 2.781 | 2.829 | 39.37 ± 1.89 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
2.977 ± 0.018 | 2.946 | 3.006 | 41.72 ± 2.00 |
cairo-native (standalone AOT) |
0.115 ± 0.000 | 0.114 | 0.115 | 1.60 ± 0.08 |
cairo-native (standalone AOT with -march=native) |
0.071 ± 0.003 | 0.070 | 0.092 | 1.00 |
Refers to #717
The purpose of the PR is to add tests which reproduce similar cases of the tx.
Checklist