-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: skip squashing of revertible nullifier and non-revertible note h…
…ash (#7624) #5212 When a revertible nullifier is nullifying a non-revertible note hash in a tx that contains public functions, they can't be squashed. Because if the tx reverts, we will have to keep the note hash, and discard the nullifier. ### Reset Circuit It takes a `split_counter` from the private inputs, and uses this counter to check that the revertible nullifiers being squashed do not link to non-revertible note hashes. It's provided from the private inputs instead of being fetched from the previous kernel's public inputs because a reset circuit can be run before processing the call that sets the `min_revertible_side_effect_counter` to the public inputs. The `split_counter` will be propagated to the `validation_requests` in the public inputs. This value must be the same as the one in the previous kernel, if it's already set in an earlier reset circuit. ### Private Tail(_to_Public) Circuit It checks that each nullifier either has zero note hash, or is linked to a note hash that has a smaller counter and the exact siloed note hash. Making sure that no transient data remains in the final public inputs. The `split_counter` in the `validation_requests` is verified: - In `tail_to_public`, it must match the `min_revertible_side_effect_counter`. - In `tail`, it must be zero to allow all the transient pairs to be squashed. ### PXE PXE will assign nonces to all the pending note hashes when the `end_setup` is called and `min_revertible_side_effect_counter` is set. At this point, we know that all the pending note hashes that haven't been squashed can't be squashed anymore, because the nullifiers emitted afterwards will be revertible and won't be able to squash non-revertible note hashes. So we can compute their nonces with the correct indexes. Those notes will be returned to the `getNotes` oracle call with non-zero nonces. Utils in aztec.nr will compute the siloed note hash as the `note_hash_for_consumption`, emitted it along with the nullifier. Currently only the non-revertible note hashes have non-zero nonces so they can't be squashed. But if needs to, an oracle can assign nonces to all the pending note hashes, keeping all of them from being squashed, to have a complete record of everything happening in a tx.
- Loading branch information
Showing
85 changed files
with
1,411 additions
and
668 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.