aztec-packages icon indicating copy to clipboard operation
aztec-packages copied to clipboard

refactor: partial notes optimization with nullifier

Open benesjan opened this issue 7 months ago • 2 comments

Fixes #14365

Instead of storing partial note validity commitment in public storage we store it in the nullifier tree. This yields the following savings:

  1. One less public function call since we can insert the nullifier directly from private (as opposed to us enqueueing a public call to write the info to pub storage),
  2. only 1 fields sent to DA instead of 2 since nullifier tree write does not need an index (unlike pub tree write).

What tests did I decide to write

  • I decided to not write any new single tx tests because that is already tested in the token contract in the transfer_to_private.nr::transfer_to_private_internal_orchestration test case.
  • I decided to not write any new multi tx tests because that is already tested in the token contract in the transfer_to_private.nr::transfer_to_private_external_orchestration test case.

Seems to be that it's all sufficiently covered already and hence no new test was needed.

benesjan avatar May 21 '25 09:05 benesjan

This stack of pull requests is managed by Graphite. Learn more about stacking.

benesjan avatar May 21 '25 09:05 benesjan

Docs Preview

You can check your preview here.

github-actions[bot] avatar May 21 '25 10:05 github-actions[bot]