-
Notifications
You must be signed in to change notification settings - Fork 190
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
[Do not merge until Git dependencies removed] Uncompressed Encoding for Affine Points #179
Conversation
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.
[on MinRoot] deserialization time reduces from 2.7s to 100ms. Downstream in lurk-rs, where the circuit is much bigger [...] deserialization time on the sha256 benchmark reduces from 120s to 7s.
Nice work!
@microsoft-github-policy-service agree company="lurk-lab" |
@microsoft-github-policy-service agree company="Lurk Lab" |
This will probably be superset by #198 Also, if we plan to move to |
Hi @winston-h-zhang is this PR still being worked on? I've heard interest in this from several others. |
This is blocked on zcash/pasta_curves#73 |
Hi @CPerezz
What is the best way to use SerdeObject trait to get fast deserialization of field elements? Are there examples of this somewhere to compose this automatically with serde's methods? |
@srinathsetty some answers to these questions might reside in privacy-scaling-explorations/halo2curves#39 |
@srinathsetty this is a trait we have for raw/unchecked(and therefore fast) serde. It's not integrated with the regular |
It seems like this may be a stale PR. Please reopen this if we want to pursue it. |
This PR implements a feature (
uncompressed_serde
) that optimizes the speed of serializing public parameters by using an uncompressed encoding that removes the overhead of computing the second coordinate of points. Note: this PR depends on PRs inpasta_curves
andneptune
, here: zcash/pasta_curves#73 and argumentcomputer/neptune#192. For now, we point at branches onlurk-lab
maintained forks.I compared the performance on the
minroot
public parameters. Based on some eyeballing benchmarks run on my local machine, deserialization time reduces from 2.7s to 100ms. Downstream inlurk-rs
, where the circuit is much bigger -- andserde
has become a significant time factor in initializing proving times -- deserialization time on thesha256
example reduces from 120s to 7s. Note, the uncompressed encoding for pasta points are[u8; 64]
, so this does have the downside of eating twice as much memory compared to the normal/compressed encoding.The significant improvement in deserialization time makes caching public parameters viable. This would short circuit the need to regenerate costly public parameters each run, improving the develop/iterate experience. This infrastructure currently exists in
lurk-rs
, and this PR mainly wants to improve its efficiency. Although hopefully, this clarifies a growing need for systematic approach to deal with public parameters in Nova, and leaves future work open to discussion.As for the feature itself, it is implemented via the
UncompressedEncoding
trait ingroup
. We only apply the uncompressed serde toCommitmentKey
, since the structure stores 90% of the data.