Open
Conversation
15acf40 to
4b88b76
Compare
JohnWick2ETH
reviewed
Sep 8, 2022
halo2_proofs/src/dev/cost_model.rs
Outdated
Comment on lines
170
to
173
| let params: Params<E::G1Affine> = Params::<E::G1Affine>::unsafe_setup::<E>(15_u32); | ||
| let vk = keygen_vk(¶ms, &circuit).expect("keygen_vk should not fail"); | ||
| let pk = keygen_pk(¶ms, vk, &circuit).expect("keygen_pk should not fail"); | ||
|
|
There was a problem hiding this comment.
it seems that we only need the ConstraintSystem object which can be generated by calling create_domain.
Member
Author
There was a problem hiding this comment.
vk needs to be generated because the circuit needs to be synthesized here to convert simple selectors to fixed columns.
halo2_proofs/src/dev/cost_model.rs
Outdated
Comment on lines
179
to
194
| let generate_fake_params = |k| { | ||
| let s = E::Scalar::random(OsRng); | ||
| let rand_c1 = <E::G1Affine as PrimeCurveAffine>::generator() * s; | ||
| let rand_c2 = <E::G2Affine as PrimeCurveAffine>::generator() * s; | ||
| let rand_c1: E::G1Affine = rand_c1.into(); | ||
| let n = 1 << k; | ||
| Params { | ||
| k: k as u32, | ||
| n: n as u64, | ||
| g: (0..n).map(|_| rand_c1).collect(), | ||
| g_lagrange: (0..n).map(|_| rand_c1).collect(), | ||
| additional_data: Vec::from(rand_c2.to_bytes().as_ref()), | ||
| } | ||
| }; | ||
|
|
||
| let params = generate_fake_params(k); |
There was a problem hiding this comment.
By applying the above comment, this fake_params is not needed anymore.
Member
Author
There was a problem hiding this comment.
The previous params is the one with fixed smaller k, while fake_params is to generate one with larger k.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.