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

Implement a performant bucketing MSM #68

Merged
merged 3 commits into from
Mar 17, 2024
Merged

Implement a performant bucketing MSM #68

merged 3 commits into from
Mar 17, 2024

Conversation

winston-h-zhang
Copy link
Contributor

@winston-h-zhang winston-h-zhang commented Mar 13, 2024

Works towards #65. This PR implements a serial version of a bucketing MSM algorithm, and reduces gas costs for large MSMs. We have the following tests on N=8,16, where improvement can already be seen:

Running 5 tests for test/multiscalar-mul-tests.t.sol:MultiscalarMulTest
[PASS] testGetAt() (gas: 3832)
[PASS] testGrumpkin3Serial() (gas: 22090653)
[PASS] testGrumpkin3Unoptimized() (gas: 22876388)
[PASS] testGrumpkin4Serial() (gas: 29651565)
[PASS] testGrumpkin4Unoptimized() (gas: 46444653)

Todo:

  • Signed-digit optimizations
  • Look into optimizing ff/ec routines

@winston-h-zhang
Copy link
Contributor Author

I'm just now reading the comments in #60.

@storojs72 what would you think is the best way forward? I can continue working on some more optimizations, if that's something we need. We can also merge this as a somewhat self-contained proof-of-concept, and come back to it

Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

@winston-h-zhang see also #65 (comment): I think we can merge this for now and iterate afterwards.

@winston-h-zhang winston-h-zhang added this pull request to the merge queue Mar 17, 2024
Merged via the queue into main with commit b5ebce6 Mar 17, 2024
1 check passed
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.

2 participants