-
Notifications
You must be signed in to change notification settings - Fork 686
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: Extend tests for BLS12-381 with json tests from EIP-2537 #12929
base: master
Are you sure you want to change the base?
Conversation
Thank you for finding the bug and for the additional tests! I will add all these tests in another PR, in a slightly different format, along with the bug fix from #12928. |
@olga24912 should we close the PR? Or could you assign someone from @near/contract-runtime for review? |
Hello @olga24912 , @Longarithm |
Alright, let's continue with this PR if you think it's the better approach. I'll make my changes after this PR is merged to avoid conflicts. |
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.
I'm left wondering if there's a strong reason to use JSON here. Why not put the test cases in some global const
array in Rust code? Especially if we're skipping some of the test cases based on input string in the macro…
I guess there is value in using exactly what's in that other repository: it makes keeping up with upstream changes ever-so-slightly easier, for instance. At the same time to take advantage of all those benefits we'd still need a README explaining where these JSONs are coming from and how to update them. And that the license for these test files belongs to a different party and is just MIT (not MIT OR APACHE-2.0.)
Regardless additional test coverage is much appreciated and I don't see any issues with the implementation other than the easily addressable nitpick inline.
|
||
impl PrecompileStandalone { | ||
fn new(path: &str) -> Self { | ||
let data = fs::read_to_string(path).expect("Unable to read file"); |
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.
I'd say lets include_str!()
the json file instead of loading it at runtime. I wouldn't want to bet on any particular working directory for the tests being run.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12929 +/- ##
=======================================
Coverage 70.54% 70.54%
=======================================
Files 851 851
Lines 174983 174983
Branches 174983 174983
=======================================
+ Hits 123433 123445 +12
+ Misses 46419 46406 -13
- Partials 5131 5132 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
the reason was the same as used in that test Also it's possible to move Also if you're prefering |
Description
Extended tests for BLS12-381 with json tests from EIP-2537: https://github.com/ethereum/execution-spec-tests
for
NEP-488
implementation➡️ It's related to bug: #12928
➡️ Successfull tests pass: aurora-is-near/aurora-engine#990
This PR added
json
cases that were prepared: aurora-is-near/sputnikvm#78In the tests added special restrictions, to avoid bug from: #12928