-
Notifications
You must be signed in to change notification settings - Fork 684
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
Elliptic curves utilities refactory #2068
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.
I did not dive into the logic, implementation details.
Overall it looks good.
I did not notice any test, maybe we should have some, (at least for utils)?
So these crates here are just a verbatim copy? |
//! Elliptic curves which are mostly compatible with *Arkworks* library | ||
//! mostly useful in non-native contexts. |
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.
maybe?
//! Elliptic curves which are mostly compatible with *Arkworks* library | |
//! mostly useful in non-native contexts. | |
//! This crate offers elliptic curves functionality which is mostly compatible with *Arkworks* library. | |
//! It is primarily designed for use in non-native contexts. |
also wouid be nice to have link to Arkworks.
//! The definitions make use of host functions to offload the non-native | ||
//! computational environment from the some of the most computationally | ||
//! expensive operations by internally leveraging the | ||
//! [arkworks-extensions](https://github.com/paritytech/arkworks-extensions) | ||
//! library. |
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.
//! The definitions make use of host functions to offload the non-native | |
//! computational environment from the some of the most computationally | |
//! expensive operations by internally leveraging the | |
//! [arkworks-extensions](https://github.com/paritytech/arkworks-extensions) | |
//! library. | |
//! The implementation make use of host functions to offload the non-native | |
//! environment from some of the most computationally | |
//! expensive operations. It internally leverages the | |
//! [arkworks-extensions](https://github.com/paritytech/arkworks-extensions) | |
//! library. |
@bkchr Not really verbatim (but in practice, at the moment, yes). Here we leverage some tiny After this is merged arkworks-substrate will be refactored to just expose (re-export) the stuff we are implementing here (0 logic there). So the crates there will act as some kind of convenience facade. The arkworks-substrate crates are handy if someone wants to include the single crates individually and thus more closely mimics what you'd do when using upstream Arkworks. |
- Usage the new published [arkworks-extensions](https://github.com/paritytech/arkworks-extensions) crates. Hooks are internally defined to jump into the proper host functions. - Conditional compilation of each curve (gated by feature with curve name) - Separation in smaller host functions sets, divided by curve (fits nicely with prev point)
Hooks are internally defined to jump into the proper host functions.
Runtime dev should not care that much about host functions and hooks as these are internally defined and he
can use the library as it'd use Arkworks upstream in his runtimes.
Please be aware that this library is mostly designed for internal usage within crates residing in the
polkadot-sdk
workspace, such as Bandersnatch. This is to avoid potential problems, as demonstrated in issues like #2013.Devs of pallets outside the workspace can utilize this library or the stand alone crates available on
crates.io
and maintained in arkworks-substrate repository if they like.Stand alone crates essentially offer the same functionality as the curve modules found here.