[solana-program] Move bn254 logic from solana-program into a separate crate#1495
Merged
samkim-crypto merged 16 commits intoanza-xyz:masterfrom Jul 18, 2024
Merged
[solana-program] Move bn254 logic from solana-program into a separate crate#1495samkim-crypto merged 16 commits intoanza-xyz:masterfrom
solana-program into a separate crate#1495samkim-crypto merged 16 commits intoanza-xyz:masterfrom
Conversation
007e749 to
e8e727a
Compare
81bfa4c to
dd7d418
Compare
Author
|
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
Lichtso
reviewed
Jun 26, 2024
|
|
||
| pub mod account_info; | ||
| pub mod address_lookup_table; | ||
| pub mod alt_bn128; |
There was a problem hiding this comment.
Um, what about gentle deprecation?
Maybe an alias to the new crate?
Author
There was a problem hiding this comment.
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.
When #1827 lands, the circular dependency can be avoided by just moving the required syscall definitions from solana-program to solana-bn254
79c1597 to
c90ab5c
Compare
Lichtso
previously approved these changes
Jul 17, 2024
Lichtso
approved these changes
Jul 18, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The bn128 logic in
solana-programis 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 #