-
Notifications
You must be signed in to change notification settings - Fork 239
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
[solana-program] Move bn254 logic from solana-program
into a separate crate
#1495
Conversation
007e749
to
e8e727a
Compare
81bfa4c
to
dd7d418
Compare
I think this check should be removed. It’s not useful because we don’t have a mechanism to keep the redundancy to a minimum. |
Hm, okay, then since PR is a couple weeks old now, let me bump the threshold this time to satisfy the CI 🙏 . Let's discuss whether we want to remove the redundancy build check on a follow-up. |
52d4900
to
b4f6824
Compare
@@ -471,7 +471,6 @@ extern crate self as solana_program; | |||
|
|||
pub mod account_info; | |||
pub mod address_lookup_table; | |||
pub mod alt_bn128; |
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.
Um, what about gentle deprecation?
Maybe an alias to the new crate?
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.
Oh right, good idea 😅
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.
Actually, it seems difficult to import the new crate in solana-program
due to circular dependency. It seems best to just leave the original logic in solana-program
and add deprecation warnings pointing to the new crate. Wdyt?
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.
When #1827 lands, the circular dependency can be avoided by just moving the required syscall definitions from solana-program to solana-bn254
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.
79c1597
to
c90ab5c
Compare
Problem
The bn128 logic in
solana-program
is quite independent of the rest of the crate. Currently, the downstream projects that depend on onlysolana-program
, but not bn128, will need to build with unnecessary bn128 logic, which is quite heavy.Summary of Changes
Move bn128 logic into its separate crate.
Note: I named the crate to be solana-bn254. Bn254 is a more modern and descriptive name for bn128, which does not provide 128 bits of security any more. I will limit this PR to just the restructuring of the crate; I will update the contents inside the crate to use bn254 in a follow-up PR.
This is part of #983.
Fixes #