kroma-network / tachyon

Modular ZK(Zero Knowledge) backend accelerated by GPU
MIT License
7.78k stars 226 forks source link

perf: prepare to skip zkey parsing #425

Closed chokobole closed 1 month ago

chokobole commented 2 months ago

Description

Rapidsnark uses a pointer instead of real parsing. Since the AffinePoint of Rapidsnark only contains x and y, we can't adopt this approach. Unlike Rapidsnark and Halo2, which don't include an infinity value, our implementation derived from Arkworks does have an infinity value. This necessitates parsing the ZKey. Additionally, when (de)serializing a zero AffinePoint, it's easy to forget to consider the infinity flag, so this PR mainly removes this flag.

However, this PR is preparatory because there is an issue when performing operations on the AffinePoint from the memory read from the file, causing a segmentation fault. This issue must be addressed to create proofs as quickly as Rapidsnark.

chokobole commented 1 month ago

I think the commit message of 32f8c31 should be chore. Else, LGTM

If I read the type definition from https://github.com/kroma-network/.github/blob/main/CONTRIBUTING.md

style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc). Other examples include sorting build targets or headers.

style is more proper type! Thanks for pointing out it