chore: no PK#15386
Conversation
…tered (#15313) We make the folding of Apps share a transcript until a kernel is encountered.
Bigfield internal audit related cleanup/fixes. - Simplified data structs: `non_native_multiplication_witnesses` and `non_native_partial_multiplication_witnesses` - Reduced code duplication with new functions like `get_binary_basis_limb_witness_indices` - Resolved/removed some of the TODOs resolves #14662 #14660 resolves AztecProtocol/barretenberg#999 resolves #14658
| } | ||
| } | ||
|
|
||
| template <class Flavor> |
There was a problem hiding this comment.
This didn't belong here - moved to the DPK
There was a problem hiding this comment.
Should we consider a bigger change in the AVM to remove ProvingKey or at least rename it? (our team, I mean).
There was a problem hiding this comment.
My understanding is that ProverPolynomials are equivalent to ProvingKey without the shifted entities in the AVM. Therefore, I am wondering if we really need ProvingKey to be defined.
I would say a rename might not really be worth it. If we can easily remove it then let us do it (could be a task once AVM is fully constrained though.)
There was a problem hiding this comment.
It would likely be quite a simple change to get rid of it but the AVM usage of the PK has already diverged from the rest of the proving systems so I didn't want to mess around there
| std::shared_ptr<ClientIVC::DeciderProvingKey> proving_key = get_acir_program_decider_proving_key(program); | ||
| auto verification_key = std::make_shared<ClientIVC::MegaVerificationKey>(proving_key->proving_key); | ||
| auto verification_key = | ||
| std::make_shared<ClientIVC::MegaVerificationKey>(proving_key->polynomials, proving_key->metadata); |
There was a problem hiding this comment.
maybe we should rename all of these to be decider_proving_key?
There was a problem hiding this comment.
although maybe thats a bad name too
There was a problem hiding this comment.
would like to rename but I'll leave that for a follow on. I think maybe instance should come back
6e073a5 to
1829e9a
Compare
141bfcd to
74bac59
Compare
| @@ -169,9 +143,9 @@ template <typename FF, typename CommitmentKey_> class ProvingKey_ { | |||
| template <typename PrecomputedCommitments> class NativeVerificationKey_ : public PrecomputedCommitments { | |||
There was a problem hiding this comment.
why not use Metadata in this class?
There was a problem hiding this comment.
I briefly went down that path but its a bit messy because of all the different pub input keys. Once those go away I'll reconsider
lucasxia01
left a comment
There was a problem hiding this comment.
Looks good in general, just left a bunch of comments
| commitment = ck.commit(polynomial); | ||
| set_metadata(metadata); | ||
|
|
||
| CommitmentKey commitment_key{ metadata.circuit_size }; |
There was a problem hiding this comment.
now, we always create a new commitment key, but maybe we should maintain the previous logic of only creating a new one if necessary, although that logic seems icky.
There was a problem hiding this comment.
we now just have a persistent srs so constructing a new one is cheap and free as long as the one in the PK is still around so this is basically the same logic that existed before
There was a problem hiding this comment.
what happens if the new one requires more points? I guess it just allocates the extra points?
| this->num_public_inputs = metadata.num_public_inputs; | ||
| this->pub_inputs_offset = metadata.pub_inputs_offset; | ||
| this->pairing_inputs_public_input_key = metadata.pairing_inputs_public_input_key; | ||
| this->ipa_claim_public_input_key = metadata.ipa_claim_public_input_key; |
| this->num_public_inputs = metadata.num_public_inputs; | ||
| this->pub_inputs_offset = metadata.pub_inputs_offset; | ||
| this->pairing_inputs_public_input_key = metadata.pairing_inputs_public_input_key; | ||
| this->ipa_claim_public_input_key = metadata.ipa_claim_public_input_key; |
There was a problem hiding this comment.
actually, I'm also confused why they weren't there before
913ed6b to
4bc2037
Compare
| VerificationKey(const VerificationKey& vk) = default; | ||
|
|
||
| void set_metadata(const ProvingKey& proving_key) | ||
| void set_metadata(const MetaData& metadata) |
There was a problem hiding this comment.
interesting that this doesn't exist for other flavors
| if (incoming->get_overflow_size() > accumulator->get_overflow_size()) { | ||
| std::swap(accumulator->polynomials, incoming->polynomials); // swap the polys | ||
| std::swap(lagranges[0], lagranges[1]); // swap the lagrange coefficients so the sum is unchanged | ||
| accumulator->set_dyadic_size(incoming->dyadic_size()); // update dyadic size of accumulator |
There was a problem hiding this comment.
there's no swapping here anymore?
See [merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md). BEGIN_COMMIT_OVERRIDE chore: stdlib bool internal audit (#15070) feat: improve Shplonk api (#15422) fix(merge-train): don't queue merge if merge-train failed queue, pass on rebase logic (#15508) chore: nuke bit array (#15522) chore: remove template parameters (#15530) chore: no PK (#15386) chore!: Correct public inputs propagation in the tube (#15547) chore: use `batch_invert` in native IPA verifier (#15557) chore: Move `stdlib::uint_plookup` to `stdlib::uint` (#15460) chore: use const ref commitment keys (#15584) fix: hiding circuit vk computed only once (#15589) feat: transcript can hash objects independently (#15510) chore: readme for benchmarking remotely (#15512) chore: fix avm test (#15592) chore: hash more stuff for IPA. (#15519) chore: fix avm build in merge-train/bb (#15594) feat!: structured public inputs via kernel io (#15383) fix!: aggregate correct nested pairing points in the hiding circuit (#15598) fix: bb merge-train conflicts (#15617) chore: Refactor shplonk verifier api (#15618) chore!: databus consistency checks in the hiding circuit (#15599) feat!: VK hash consistency check (#15591) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com> Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com> Co-authored-by: Suyash Bagad <suyash@aztecprotocol.com> Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com> Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com> Co-authored-by: Raju Krishnamoorthy <krishnamoorthy@gmail.com> Co-authored-by: notnotraju <raju@aztec-labs.com> Co-authored-by: Lucas Xia <lucasxia01@gmail.com> Co-authored-by: Khashayar Barooti <khashayar@aztecprotocol.com> Co-authored-by: Jean M <132435771+jeanmon@users.noreply.github.com> Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com> Co-authored-by: Santiago Palladino <spalladino@users.noreply.github.com> Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
Removes the
ProvingKeyaltogether from the Ultra/Mega proving systems.TLDR: "proving key" used to mean "the precomputable data used by the prover." The Honk PK hasn't been that for a long time since it stores the
ProverPolynomialswhich contains all polynomials used by the prover, including witnesses. This meant there was no clear logic behind what was stored in theDeciderProvingKeyvs theProvingKey. Since we don't have much use for the traditional notion of a proving key in Honk (unlike in Plonk), I've opted to remove it entirely and place its data directly in theDeciderProvingKey.Most lines in this PR relate to one of these changes:
dyadic_size()vk(pk->get_precomputed())(instead ofvk(pk->proving_key))proving_key->proving_key.foohave been reduced toproving_key->fooMetaDatastruct. (Note: I'm open to a better name..)