Skip to content

feat: merge-train/barretenberg#16173

Merged
AztecBot merged 14 commits into
nextfrom
merge-train/barretenberg
Aug 4, 2025
Merged

feat: merge-train/barretenberg#16173
AztecBot merged 14 commits into
nextfrom
merge-train/barretenberg

Conversation

@AztecBot

@AztecBot AztecBot commented Aug 1, 2025

Copy link
Copy Markdown
Collaborator

See merge-train-readme.md.

BEGIN_COMMIT_OVERRIDE
chore: remove uint (#16062)
chore: remove decompose_into_bits() function from field_t class (#15795)
chore: Standardise native public input handling (#16050)
END_COMMIT_OVERRIDE

AztecBot and others added 11 commits August 1, 2025 20:40
Removed `uint` module from `stdlib`. Had to change two modules that used
`uint`:
1. `edcsa`: an ecdsa signature contains a byte `v` and we were using
`uint8` to represent it in circuits. Replaced that with `byte_array` (of
size 1).
2. `keccak`: variable length keccak (i.e., the number of bytes being
hashed is a circuit-variable) was using `uint32` to represent
`num_bytes`. We are not using this version of keccak anywhere so its
better to get rid of than to maintain/audit.
…15795)

Since we're removing the merkle membership circuit implementation from
cpp code, we no longer use the function `decompose_into_bits()` in the
`field_t` class. Best to remove it instead of maintaining.
Public inputs in `stdlib` are handled via the special public input
mechanisms: we have classes (`KernelIO`, `DefaultIO`, `HidingKernelIO`,
`RollupIO`) that set public inputs, reconstruct them, create defaults,
etc. Native public inputs have a similar mechanism, but the mechanism
has many hacks built-in as native structures are used in more
extensively than their `stdlib` counterparts (e.g., we use `field` also
to construct the base/scalar field of `secp256k1`, which we never need
to deserialise from public inputs).

This PR standardises usage of native public inputs by creating a
structure similar to the one used in `stdlib`: we define a
`PublicInputComponent` class that works as a wrapper around classes that
can be deserialised from the public inputs, and we use this wrapper
class to reconstruct special public inputs (pairing points, IPA claims,
etc.).

To use the class, we make choices about how elements that are not
currently used in circuit should be serialised. This pertains to
base/scalar fields of `secp256k1` and `secp256r1` (and therefore to
affine points on these curves). For consistency with the base field of
`BN254`, we set `PUBLIC_INPUTS_SIZE = 4` for an element in each of these
fields.

This PR also cleans up the usage of the constants `PAIRING_POINTS_SIZE`
and `IPA_CLAIM_SIZE`, as they can now be extracted from the respective
classes `PairingPoints` and `OpeningClaim<Curve>` where `Curve` is
`Grumpkin` (either native or `stdlib`)

Closes AztecProtocol/barretenberg#1478

---------

Co-authored-by: AztecBot <tech@aztecprotocol.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: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com>
Co-authored-by: ludamad <adam.domurad@gmail.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>

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-approved

@AztecBot AztecBot enabled auto-merge August 4, 2025 17:05
@AztecBot

AztecBot commented Aug 4, 2025

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

@AztecBot AztecBot added this pull request to the merge queue Aug 4, 2025
Merged via the queue into next with commit 41b2565 Aug 4, 2025
5 checks passed
@AztecBot AztecBot deleted the merge-train/barretenberg branch August 4, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants