chore: Introduce Native IO mechanism#15820
Conversation
…lement`, `bb::fq`, and `bb::fr` (#15774) We make public input reconstruction in native land more idiomatic by introducing `reconstruct_from_public` method for `fq`, `fr`, and `affine_element`. --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com> Co-authored-by: ludamad <adam.domurad@gmail.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> Co-authored-by: ludamad <domuradical@gmail.com> Co-authored-by: maramihali <mara@aztecprotocol.com> Co-authored-by: Sarkoxed <75146596+Sarkoxed@users.noreply.github.com>
69a47e5 to
f96e42c
Compare
…b/native_io_mechanism
| * | ||
| */ | ||
| static OpeningClaim<Curve> reconstruct_from_public(const std::span<bb::fr, IPA_CLAIM_SIZE>& ipa_claim_limbs) | ||
| static OpeningClaim<Curve> reconstruct_from_public(const std::span<const bb::fr, IPA_CLAIM_SIZE>& ipa_claim_limbs) |
There was a problem hiding this comment.
General comment about why these changes happened: to reconstruct_from_public we pass a const std::vector<FF>, when that is passed down to other reconstruct_from_public as a span, the span wants it to be std::span<const FF>, that is why I had to make this change
ledwards2225
left a comment
There was a problem hiding this comment.
Looks great! My only request is that you move the native IO logic to its own file/classes outside of the stdlib. AFAICT the classes are not using anything from their stdlib counterparts and this would avoid the awkwardness of needing to include stdlib types into the native verifier.
| // two field element coordinates (x, y). Thus, four base field elements | ||
| // Four limbs are used when simulating a non-native field using the bigfield class, so 16 total field elements. | ||
| static constexpr uint32_t PAIRING_POINTS_SIZE = 16; | ||
| // PairingPointAccumulatorIndices represents an array of 16 witness indices pointing to the nested aggregation object. |
There was a problem hiding this comment.
Removed as it is unused
There was a problem hiding this comment.
@ledwards2225 Tagging you to let you know of this change
| public: | ||
| using FF = curve::BN254::ScalarField; | ||
|
|
||
| // TODO(https://github.com/AztecProtocol/barretenberg/issues/1478): Can we define this constant as part of |
There was a problem hiding this comment.
Added this todo as I noticed there is still some ad-hoc public input handling @ledwards2225
See [merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md). BEGIN_COMMIT_OVERRIDE chore!: Remove circuit_size from all VKs (#15747) chore: Introduce data structures to hold inputs/outputs of the Merge verification (#15735) chore: replace asserts with runtime errors. (#15671) chore: kernels start with eq and reset (#15734) chore: Introduce Native IO mechanism (#15820) fix: Update Cargo.lock in avm-transpiler (#15837) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com> Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com> Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com> Co-authored-by: ludamad <adam.domurad@gmail.com> Co-authored-by: Suyash Bagad <suyash@aztecprotocol.com> Co-authored-by: Jonathan Hao <jonathan@aztec-labs.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> Co-authored-by: ludamad <domuradical@gmail.com> Co-authored-by: maramihali <mara@aztecprotocol.com> Co-authored-by: Sarkoxed <75146596+Sarkoxed@users.noreply.github.com>
We introduce native counterparts for our IO mechanism so that the reconstruction of public inputs in from native field elements is similar to that in-circuit