-
Notifications
You must be signed in to change notification settings - Fork 132
chore(l2): use SP1 patched crate for ecmul precompile #5133
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ec0601e
implement ecmul with substrate for sp1
xqft be9dc69
fixes
xqft 2e394b3
use slicing
xqft effb630
use offset
xqft 4d6c045
Merge branch 'main' into l2/ecmul_sp1
xqft 718e183
Update crates/vm/levm/src/precompiles.rs
xqft e406e46
use safer add and slicing
xqft a9aba91
change name
xqft cd4b392
clippy
xqft 7e011e1
Merge branch 'main' into l2/ecmul_sp1
xqft a6df6f9
fix slicing
xqft 63c0a65
Update cfg attributes for bn254_g1_mul function
xqft f1fe328
Merge branch 'main' into l2/ecmul_sp1
xqft af37b76
Merge branch 'main' into l2/ecmul_sp1
ilitteri 38f3aaf
Fix RISC0's compilation
54c8f2a
Merge branch 'main' into l2/ecmul_sp1
xqft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
Why do we remove this
unsafe? We should double-check with @edg-l, @azteca1998, or @Oppen if this is not counterproductive.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.
Can't we keep this behaviour when neither
sp1norrisc0features are enabled?Uh oh!
There was an error while loading. Please reload this page.
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 function to parse bn254 points was changed to take a slice instead of a reference to a fixed size array (so it can be reused for precompiles whose input have different sizes), so this unsafe is not necessary anymore.
The branching on the error case (which should never happen) could signify a perf. hit, I could change this to an
unreachable_unchecked!()and it should be equivalent to before the change, but I'm not sure how impactful that can be (consider that we have other, more evident optimization opportunities, like not cloning and slicing bytes many times while parsing and converting to the crypto primitive types)