Additional set of CU optimizations - #13
Merged
Merged
Conversation
samkim-crypto
marked this pull request as ready for review
September 9, 2026 01:36
Collaborator
zz-sol
approved these changes
Sep 17, 2026
| figure above is the addition syscall charge in the benchmark runtime; the total | ||
| check also includes the surrounding SBF instructions. | ||
|
|
||
| Canonical `S` (`S < L`) has no knob. Every profile worth targeting requires it — |
Collaborator
There was a problem hiding this comment.
nit: this still says “before paying for the cofactor multiplication.” This branch replaces multiplication with lookup.
Contributor
Author
|
Thanks for taking a look! I addressed the wording comments and will merge! |
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.
Summary of Changes
I worked through a series of optimizations and kept the changes that reduced compute units.
I first made a bunch of harness and test improvements:
curve25519-dalekwith boundary values and deterministic random inputsThe optimizations I kept are listed below. Each saving compares the change with the preceding retained change.
Overall, we started with ~30k CU for a single ZIP-215 signature verification to ~3.8k CU, which is good.
I do need one additional follow-up to bump the versions of some crates like mollusk and also use sbf arch v3, but I am satisfied with all the optimizations, so once this PR is in, I think we can kick-off the audit.