-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: rework nonces (#1210) #1331
Conversation
Just planting a flag that I've begun reviewing this, to save duplicated efforts from anyone else :) |
circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp
Outdated
Show resolved
Hide resolved
yarn-project/acir-simulator/src/client/private_execution.test.ts
Outdated
Show resolved
Hide resolved
yarn-project/noir-contracts/src/contracts/ecdsa_account_contract/src/ecdsa_public_key_note.nr
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! It's clear you've been very meticulous and methodical, which is fantastic for such a fiddly part of the protocol. Only a few minor change requests. Most of my comments can be addressed in later PRs, or are asking questions.
circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael Connor <[email protected]>
…c-packages into db/1210-rework-nonces
Description
The way nonces work now, there can be inconsistencies in nonce assignment in the simulator vs the private kernel. Furthermore, you cannot know during function execution what the full set of commitments will be for the whole TX as some new commitments may be nullified and squashed. But we still want the ability to determine nonces and therefore uniqueNoteHashes from L1 calldata alone. I am sure I am not explaining all of the issues well enough, but it was determined that the current nonce paradigm will not work and therefore we must rework it.
Rework nonces so that siloing by contract address happens first and uniqueness comes later. For now, nonces are injeced by the private ordering circuit (vs suggestion which was base rollup circuit). Pending notes and their reads have no nonces when processed in kernel. The public kernel (and therefore all commitments created in public functions) does not use nonces.
Here was Mike's proposal for the rework:
Why not just use leaf index as nonce?
Followup tasks
getCommitment
should be able to work with pending commitments #1029read_request_membership_witnesses
via public inputs #1407note_header.nonce = 0
for apre-existing note
#1410Checklist: