chore: begin nr constant cleanup - #25014
Merged
Merged
Conversation
nchamo
approved these changes
Jul 27, 2026
Remove 22 unused constants from the noir-protocol-circuits types crate (and their generated mirror in constants.gen.ts). None are referenced by any circuit, contract, TypeScript, C++, PIL, or Solidity code. 13 are directly unreferenced. The other 9 are only used to build the removed ones, so they become dead in the same pass -- e.g. PRIVATE_ACCUMULATED_DATA_LENGTH and PRIVATE_VALIDATION_REQUESTS_LENGTH fed only PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH. Also drop the two ContractClassRegistry function-broadcast magic values along with their assertions in constants_tests.nr, shrinking the HashedValueTester capacity from 78 to 76.
Seven of the domain separators moved into aztec-nr are only used within the aztec crate (and its test), so they don't belong on the external API. Downgrade them from pub to pub(crate). PARTIAL_NOTE_COMMITMENT and NOTE_COMPLETION_LOG_TAG stay pub, since the uint-note crate and nft_contract import them.
This is a node-level DoS-mitigation default (max AVM debug-log memory reads during public tx simulation), not a protocol constant, and it is consumed only by TypeScript. Define it in stdlib's avm.ts next to CollectionLimitsConfig and drop it from constants.nr and the generated C++/TS copies.
…tants Document the relocation of nine DOM_SEP__* domain separators from the protocol constants module into the aztec crate: two stay public under aztec::note::partial_note, the other seven become pub(crate).
nventuro
force-pushed
the
nv/constant-cleanup
branch
from
July 29, 2026 21:00
2aa0f55 to
f51fbcb
Compare
nventuro
enabled auto-merge (squash)
July 29, 2026 21:43
rangozd
pushed a commit
to rangozd/aztec-packages
that referenced
this pull request
Aug 5, 2026
BEGIN_COMMIT_OVERRIDE fix(pxe): validate a BoundedVec against its storage array on deserialization (AztecProtocol#25035) chore: add disclaimers on poc contracts (AztecProtocol#24975) chore: begin nr constant cleanup (AztecProtocol#25014) fix(txe): authorize sync_state utility calls in inlined contexts (AztecProtocol#25034) refactor(stdlib): a function's return type is a single optional AbiType (AztecProtocol#25066) feat(pxe): hash-pinned node read cache (AztecProtocol#24969) feat(noir-projects): publish compiled protocol artifacts to npm (AztecProtocol#25075) fix(ci): trim GitHub commit API response in upload_benchmarks to avoid E2BIG on large merge commits (AztecProtocol#25077) END_COMMIT_OVERRIDE
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.
This deletes some old unused constants, moves some from the protocol into aztec-nr, and creates the aztec-nr infra required for testing that we're not colliding with the protocol's (e.g. not colliding with any domain separator). This is not complete - some aztecnr constants (and app constants) remain in protocol, specifically those that are also used in TS, as that'd require also changing transpilation.