Skip to content
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

Split SemaphoreVerifier key points into a separate library #875

Merged
merged 7 commits into from
Oct 17, 2024

Conversation

jimmychu0807
Copy link
Contributor

@jimmychu0807 jimmychu0807 commented Oct 16, 2024

Split SemaphoreVerifier key points into a separate library and transform all verification key points into one big bytes constant.

Also added a small script that convert decimal bigint to hex string.

Related Issue(s)

Closes #330

Related: #345

Other information

gas cost collected from yarn test:report-gas:

Original:

  • Semaphore.validateProof: 315474
  • Deployment SemaphoreVerifier: 10580752

With this PR:

  • Semaphore.validateProof: 295635
  • Deployment SemaphoreVerifier: 390597
  • Deployment SemaphoreVerifierKeyPts: 3256579

@cedoor should I make a PR to semaphore main branch, or some other branch?

cc @saleel

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run yarn format and yarn lint without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link

openzeppelin-code bot commented Oct 16, 2024

Split SemaphoreVerifier key points into a separate library

Generated at commit: 0d544cd563cadd78e4f910891eed5cea69f7f3d3

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
0
0
0
3
15
18
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Copy link
Member

@cedoor cedoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jimmychu0807! Pointing to the main branch is ok 👍🏽

Copy link
Member

@cedoor cedoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏽

Copy link
Contributor

@saleel saleel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@cedoor cedoor merged commit 79976f3 into semaphore-protocol:main Oct 17, 2024
5 checks passed
Copy link

gitpoap-bot bot commented Oct 17, 2024

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2024 Semaphore Contributor:

GitPOAP: 2024 Semaphore Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change verification key points in contract to constant
4 participants