-
Notifications
You must be signed in to change notification settings - Fork 482
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
feat: efficient merkleprooflib saves 100s gas #624
feat: efficient merkleprooflib saves 100s gas #624
Conversation
okay whoops the function should still be internal, I made it public for testing. |
accidentally pushed with public scope for testing, should be internal as orginally written.
similar to OpenZeppelin/openzeppelin-contracts#3039 |
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please sign the linked documents below to get yourself added. https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=b15c81cc-b5ea-42a6-9107-3992526f2898&env=na3&acct=6e152afc-6284-44af-a4c1-d8ef291db402&v=2 |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
Codecov Report
@@ Coverage Diff @@
## master #624 +/- ##
==========================================
- Coverage 52.04% 47.63% -4.42%
==========================================
Files 225 213 -12
Lines 26375 22199 -4176
Branches 493 486 -7
==========================================
- Hits 13727 10574 -3153
+ Misses 11257 10254 -1003
+ Partials 1391 1371 -20 |
@cla-bot check |
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please sign the linked documents below to get yourself added. https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=b15c81cc-b5ea-42a6-9107-3992526f2898&env=na3&acct=6e152afc-6284-44af-a4c1-d8ef291db402&v=2 |
The cla-bot has been summoned, and re-checked this pull request! |
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please sign the linked documents below to get yourself added. https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=b15c81cc-b5ea-42a6-9107-3992526f2898&env=na3&acct=6e152afc-6284-44af-a4c1-d8ef291db402&v=2 |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
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.
LGTM
…b-simple-shotaro feat: efficient merkleprooflib saves 100s gas
Solidity reserves a 32-byte slots, with specific byte range: 0x00 - 0x3f (64 bytes): scratch space for hashing methods.
Using this scratch space and using in-line assembly for keccak256 hashing saves~ 100s of gas, maybe even ~1000s of gas for a proof length > 10.