privacy-scaling-explorations / zk-kit

A monorepo of reusable libraries for zero-knowledge technologies.
https://zkkit.pse.dev
MIT License
281 stars 68 forks source link

Gas optimizations #27

Closed 0xbok closed 2 years ago

0xbok commented 2 years ago

I think the following will give gas savings in the decreasing order of savings:

I tried verifying that these steps actually give savings, but didn't find a way to generate gas report since it uses jest, which I'm not familiar with.

cedoor commented 2 years ago

Hey @0xbok, thank you very much! The ZK-kit solidity packages don't use Jest, they uses Mocha. You can run yarn test:report-gas to generate a report and check your performance improvements, from the packages/incremental-merkle-tree.sol folder. Let me know if it works!

0xbok commented 2 years ago

Thanks @cedoor, I checked locally and there were significant gas savings, created the PR.