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 version check for cached AOT contracts. #981

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

azteca1998
Copy link
Collaborator

For now it'll panic with an assert. It is the user's responsibility to clear the contract cache when upgrading.

Checklist

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

Copy link

Benchmark results Main vs HEAD.

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 4.042 ± 0.028 3.990 4.078 1.00
base factorial_2M.cairo (AOT) 4.275 ± 0.048 4.179 4.334 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head factorial_2M.cairo (JIT) 4.091 ± 0.048 4.027 4.175 1.00
head factorial_2M.cairo (AOT) 4.252 ± 0.025 4.202 4.283 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 3.595 ± 0.021 3.563 3.625 1.00
base fib_2M.cairo (AOT) 3.802 ± 0.029 3.751 3.837 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head fib_2M.cairo (JIT) 3.602 ± 0.029 3.548 3.639 1.00
head fib_2M.cairo (AOT) 3.805 ± 0.019 3.776 3.833 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 3.793 ± 0.023 3.753 3.825 1.00
base linear_search.cairo (AOT) 3.939 ± 0.058 3.873 4.050 1.04 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head linear_search.cairo (JIT) 3.802 ± 0.013 3.787 3.828 1.00
head linear_search.cairo (AOT) 3.918 ± 0.034 3.881 3.968 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 3.928 ± 0.035 3.869 3.988 1.00
base logistic_map.cairo (AOT) 3.977 ± 0.046 3.933 4.071 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head logistic_map.cairo (JIT) 3.908 ± 0.017 3.883 3.938 1.00
head logistic_map.cairo (AOT) 3.971 ± 0.013 3.945 3.990 1.02 ± 0.01

Copy link

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 14.134 ± 0.088 13.980 14.274 10.46 ± 0.08
cairo-native (embedded AOT) 4.263 ± 0.028 4.231 4.320 3.15 ± 0.02
cairo-native (embedded JIT using LLVM's ORC Engine) 4.263 ± 0.072 4.134 4.370 3.15 ± 0.06
cairo-native (standalone AOT with -march=native) 1.352 ± 0.006 1.347 1.369 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 14.720 ± 0.195 14.387 15.012 188.33 ± 2.52
cairo-native (embedded AOT) 4.015 ± 0.081 3.901 4.133 51.37 ± 1.04
cairo-native (embedded JIT using LLVM's ORC Engine) 3.810 ± 0.039 3.745 3.857 48.74 ± 0.51
cairo-native (standalone AOT with -march=native) 0.078 ± 0.000 0.078 0.079 1.00

Benchmark for program linear_search

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.683 ± 0.040 5.616 5.757 2857.57 ± 63.35
cairo-native (embedded AOT) 3.921 ± 0.036 3.883 3.996 1971.53 ± 45.12
cairo-native (embedded JIT using LLVM's ORC Engine) 3.802 ± 0.016 3.780 3.832 1911.62 ± 40.95
cairo-native (standalone AOT with -march=native) 0.002 ± 0.000 0.002 0.002 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.633 ± 0.038 5.576 5.704 23.25 ± 0.16
cairo-native (embedded AOT) 4.048 ± 0.066 3.951 4.170 16.70 ± 0.27
cairo-native (embedded JIT using LLVM's ORC Engine) 3.999 ± 0.042 3.920 4.045 16.50 ± 0.18
cairo-native (standalone AOT with -march=native) 0.242 ± 0.001 0.242 0.243 1.00

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 4.34783% with 22 lines in your changes missing coverage. Please review.

Project coverage is 80.72%. Comparing base (e47a42e) to head (b9ab62c).

Files with missing lines Patch % Lines
src/executor/contract.rs 7.69% 12 Missing ⚠️
runtime/src/lib.rs 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #981      +/-   ##
==========================================
- Coverage   80.76%   80.72%   -0.05%     
==========================================
  Files         107      107              
  Lines       29256    29267      +11     
==========================================
- Hits        23628    23625       -3     
- Misses       5628     5642      +14     

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

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.

3 participants