-
Notifications
You must be signed in to change notification settings - Fork 624
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
Precompiles for BLS12-381 curve operations #9317
Conversation
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.
Approving to unblock merging.
@Ekleog-NEAR Thank you for your review! I have resolved all the comments. Let me know if you have any further comments. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9317 +/- ##
========================================
Coverage 71.75% 71.76%
========================================
Files 791 792 +1
Lines 161943 162366 +423
Branches 161943 162366 +423
========================================
+ Hits 116202 116517 +315
- Misses 40703 40801 +98
- Partials 5038 5048 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…1818) Stabilize NEP-488: Host Functions for BLS12-381 Curve Operations * NEP-488: near/NEPs#488 * Implementation: #9317
Implementation for NEP-488: near/NEPs#488
Gas Estimation
The test vectors for gas estimation were taken from EIP-2537 and adopted for our input format: https://eips.ethereum.org/assets/eip-2537/bench_vectors
bls12381_p1_sum_0_100
— the empty inputbls12381_p1_sum_50_100
— two points fromG1 addition example input
form EIP-2537(https://eips.ethereum.org/assets/eip-2537/bench_vectors) duplicated 25 times.bls12381_p2_sum_0_100
— the empty inputbls12381_p2_sum_50_100
— two points fromG2 addition example input
form EIP-2537(https://eips.ethereum.org/assets/eip-2537/bench_vectors) duplicated 25 times.bls12381_p1_multiexp_0_100
— the empty inputbls12381_p1_multiexp_50_100
— the data fromG1 mul double and add worst case
from EIP-2537(https://eips.ethereum.org/assets/eip-2537/bench_vectors) duplicated 50 times.bls12381_p2_multiexp_0_100
— the empty inputbls12381_p2_multiexp_50_100
— the data fromG2 mul double and add worst case
from EIP-2537(https://eips.ethereum.org/assets/eip-2537/bench_vectors) duplicated 50 times.bls12381_map_fp_to_g1_0_100
— the empty inputbls12381_map_fp_to_g1_50_100
— https://github.com/matter-labs/eip1962/blob/master/src/test/test_vectors/eip2537/fp_to_g1.csv — the first test input duplicate 50 timesbls12381_map_fp2_to_g2_0_100
— the empty inputbls12381_map_fp2_to_g2_10_100
— https://github.com/matter-labs/eip1962/blob/master/src/test/test_vectors/eip2537/fp2_to_g2.csv — the first input duplicate 10 timesbls12381_pairing_0_100
— the empty inputbls12381_pairing_5_100
— the first pair fromPairing case for 2 pairs
from EIP-2537(https://eips.ethereum.org/assets/eip-2537/bench_vectors) duplicated 5 times.bls12381_p1_decompress_0_100
— the empty inputbls12381_p1_decompress_50_100
— some random point duplicated 50 timesbls12381_p2_decompress_0_100
— the empty inputbls12381_p2_decompress_50_100
— some random point duplicated 50 timesCommand for gas estimation (from
runtime/runtime-params-estimator/emu-cost
folder):Gas Estimation results: