Skip to content

feat: merge-train/fairies#21230

Open
AztecBot wants to merge 5 commits intonextfrom
merge-train/fairies
Open

feat: merge-train/fairies#21230
AztecBot wants to merge 5 commits intonextfrom
merge-train/fairies

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 6, 2026

BEGIN_COMMIT_OVERRIDE
feat: add note hash and nullifier helper functions with domain separation (#21189)
feat(cli): auto-recompiling when aztec test is run (#20729)
docs: small delayedpubmut update (#21229)
END_COMMIT_OVERRIDE

…tion (#21189)

This is the first part of my review of domain separator usage and
hashing. I created two standard functions for computing note hashes and
note nullifiers in aztecnr, and added some comments to the separators
themselves. In a future PR we'll move them to aztec-nr (not now as it'd
be api breakage).

I also fixed `SingleUseClaim` by having it use a new dedicated domain
separator, as should've always been the case given that it is not a note
nullifier - it is its own thing.

I added comments to the protocol contracts explaining why the lack of
separators there is ok, and found an issue in our Orderbook contract in
which we miss domain separation, which is wrong - left a todo.

Finally, there's also a todo to fix how partial notes compute both of
their note hashes, as they dont' follow the current domain separation.
Given we're about to rework them I chose not to mess with it at this
time.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: benesjan <benesjan@users.noreply.github.com>
Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
benesjan and others added 3 commits March 6, 2026 20:38
In this PR I ensure that contracts get automatically recompiled when
`aztec test` is run. To avoid unnecessary compilations I use `make`
command inspired approach of checking timestamp of source files (*.toml
and *.nr files) against the timestamp of the oldest artifact in the
`/target` dir (as artifact I consider any `*.json` file).

**Note:** By using the oldest timestamp we would get constant
recompilation on each run in case the dev placed there some random
`*.json` file.

**Question**: Does the reviewer think this ^ is fine? Alternatively I
could nuke the `target` dir whenever a recompilation is being run. This
feels a bit dangerous though. Another approach would be to predict the
artifact name of individual crates and just check against those. This
would be the most efficient but it introduces complexity and brittleness
in case `nargo` artifact names change. I think I would keep it as it is
for now and come up with solution if someone complains about constant
recompilations.

I initially thought I will implement this in the `aztec test` command
but that command is fully implemented in bash. When I had AI implement
this the resulting bash was impossible to comprehend so I told it to
rewrite in typescript. Given that the `aztec test` command is calling
`aztec compile` that is implemented in typescript it made sense for this
PR to modify only that command. This has the added advantage that it
will make bugs in this code way more visible because when a dev runs
`aztec compile` they will either see that the code is getting
re-compiled or they will get "No source changes detected, skipping
compilation." log. If they modify a contract, run `aztec compile` and
see that nothing got compiled it will be obvious that the thing is
broken.

Closes
https://linear.app/aztec-labs/issue/F-197/auto-recompile-contracts-on-tests

---------

Co-authored-by: benesjan <benesjan@users.noreply.github.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Copy link
Collaborator

@ludamad ludamad left a comment

Choose a reason for hiding this comment

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

🤖 Auto-approved

@AztecBot AztecBot added this pull request to the merge queue Mar 7, 2026
@AztecBot
Copy link
Collaborator Author

AztecBot commented Mar 7, 2026

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

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 7, 2026
Just a small clarification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants