Skip to content
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

Master #2

Merged
merged 465 commits into from
Dec 2, 2023
Merged

Master #2

merged 465 commits into from
Dec 2, 2023

Conversation

Okm165
Copy link
Member

@Okm165 Okm165 commented Dec 2, 2023

Please provide a paragraph or two giving a summary of the change, including relevant motivation and context.

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

AztecBot and others added 30 commits October 29, 2023 02:13
subrepo:
  subdir:   "yarn-project/aztec-nr"
  merged:   "18bc6ad4e"
upstream:
  origin:   "https://github.com/AztecProtocol/aztec-nr"
  branch:   "master"
  commit:   "18bc6ad4e"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???" [skip ci]
This PR dockerizes aztec-cli. It requires AztecProtocol#2737 to be merged in first.

Fix AztecProtocol#2875 

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
…Protocol#3097)

Closes AztecProtocol#3012 

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
No longer deemed useful, extra repo was confusing
I've seen some jobs failing silently around starting spot instances.
I've seen some network errors around manifest stuff.

This may not fix the first issue. But it does introduce a little extra
logging that might give an idea of whats failing. It will retry the
spinning up of the instance if it fails, but im not convinced that was
what was failing.

This adds retries to the manifest stuff.
In AztecProtocol#3031 I forgot to push the CLI docker image to dockerhub. This fixes
that and also updates the name of the expected docker image in the bash
wrapper script to match.

Related AztecProtocol#2875 

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
`getDataTreePath` --> `getNoteHashTreePath`
\+ run yarn format in yarn-project
Fixes AztecProtocol#2908 
Fixes
[AztecProtocol#2909](AztecProtocol#2909)
Fixes
[AztecProtocol#2910](AztecProtocol#2910)
Fixes AztecProtocol#3061 

**Note 1**: This PR became huge because it made sense to refactor
`PXE.addNotes` here as well since I now use the ExtendedNote type there.
**Note 2**: Since this PR is already too big I decided to finish
renaming preimage as serialized_note in Noir in a separate PR.
**Note 3**: Note processor now stores a `CompleteAddress` instead of
just a public key because I need the address from `CompleteAddress` to
construct the `ExtendedNote`.
**Note 4**: This is a breaking change because of the `PXE.getNotes`
change and the `PXE.getPrivateStorageAt` removal.
…ol#3115)

Resolves AztecProtocol#2608 

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [x] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
…otocol#3134)

renaming since it will contain more stuff, such as thepublic kernel in noir next!
subrepo:
  subdir:   "build-system"
  merged:   "41f033ded"
upstream:
  origin:   "https://github.com/AztecProtocol/build-system"
  branch:   "master"
  commit:   "41f033ded"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???" [skip ci]
subrepo:
  subdir:   "barretenberg"
  merged:   "340a25673"
upstream:
  origin:   "https://github.com/AztecProtocol/barretenberg"
  branch:   "master"
  commit:   "340a25673"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???" [skip ci]
subrepo:
  subdir:   "yarn-project/aztec-nr"
  merged:   "210e148ff"
upstream:
  origin:   "https://github.com/AztecProtocol/aztec-nr"
  branch:   "master"
  commit:   "210e148ff"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???" [skip ci]
Adding structuring feature to transcript based on the flavor and
resolves AztecProtocol/barretenberg#656.

The main two functions added are `deserialize_full_transcript()` and
`serialize_full_transcript()`, which are defined for each flavored
transcript derived class. These classes are defined in the flavor
classes, and primarily declare all of the transcript objects as member
variables.

`deserialize_full_transcript()` will take a full proof generated by the
flavored prover, and put all those bytes into the member variables.
Then, one can now view and modify the objects by just using the member
variables. In order to actually push the modification, one has to call
`serialize_full_transcript()` in order to regenerate the proof from the
(modified) member variables. The tests in `(flavor)_transcript.test.cpp`
illustrate how to use these functions in more depth. I also modified the
tests in `stdlib/recursion/honk/verifier/goblin_verifier.test.cpp` and
in `stdlib/recursion/honk/verifier/verifier.test.cpp`.

Got rid of the ProverTranscript and VerifierTranscript and merging them
into the BaseTranscript. This was done to avoid having to create these
for every flavor derived class and because they did not provide much on
top of the BaseTranscript.

Created transcript tests for flavors besides Ultra.

Transcript breakdown for all flavors:
https://docs.google.com/spreadsheets/d/1TpkkPj9o5ZXr_kWT7WsquXSEZY10C1Lt3BWeCA7Qe9U/edit#gid=0.

Some design considerations:
https://hackmd.io/o8HbTiujTGa4sLccAHQaxw?both.
1. Fixes AztecProtocol#2948
2. Removed redundant dependency from `TokenContract`.
3. No camel case in `TestContract`
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-packages: 0.13.0</summary>

##
[0.13.0](AztecProtocol/aztec-packages@aztec-packages-v0.12.0...aztec-packages-v0.13.0)
(2023-10-31)


### ⚠ BREAKING CHANGES

* PXE.getNotes(...) + refactor of note types
([AztecProtocol#3051](AztecProtocol#3051))

### Features

* `FieldNote`
([AztecProtocol#3037](AztecProtocol#3037))
([3d1ffd0](AztecProtocol@3d1ffd0))
* Add Aztec Boxes page to docs
([AztecProtocol#2569](AztecProtocol#2569))
([997c15c](AztecProtocol@997c15c))
* Adding structure to Transcript
([AztecProtocol#2937](AztecProtocol#2937))
([db67aa1](AztecProtocol@db67aa1))
* Compile noir contracts with noir_wasm
([AztecProtocol#2737](AztecProtocol#2737))
([524cecf](AztecProtocol@524cecf))
* Dockerize aztec-cli
([AztecProtocol#3031](AztecProtocol#3031))
([ec2e3c2](AztecProtocol@ec2e3c2))
* Efficient ZM quotient computation
([AztecProtocol#3016](AztecProtocol#3016))
([ebda5fc](AztecProtocol@ebda5fc))
* **feature_branch:** Private Kernel Circuit
([AztecProtocol#2740](AztecProtocol#2740))
([f800a36](AztecProtocol@f800a36))
* Measure plonk rounds
([AztecProtocol#3065](AztecProtocol#3065))
([c8e1d8b](AztecProtocol@c8e1d8b))
* Migrate the init kernel CPP tests to noir
([AztecProtocol#3091](AztecProtocol#3091))
([906429f](AztecProtocol@906429f))
* New script to output table of benchmarks for README pasting.
([AztecProtocol#2780](AztecProtocol#2780))
([6c20b45](AztecProtocol@6c20b45))
* Pedersen in typescript.
([AztecProtocol#3111](AztecProtocol#3111))
([933f1b2](AztecProtocol@933f1b2))
* Protogalaxy folding of challenges
([AztecProtocol#2935](AztecProtocol#2935))
([7ed30e8](AztecProtocol@7ed30e8))
* PXE.getNotes(...) + refactor of note types
([AztecProtocol#3051](AztecProtocol#3051))
([16abb5a](AztecProtocol@16abb5a))
* Zeromorph with concatenation (Goblin Translator part 10)
([AztecProtocol#3006](AztecProtocol#3006))
([70b0f17](AztecProtocol@70b0f17))


### Bug Fixes

* Bad contract txs publishing contract data
([AztecProtocol#2673](AztecProtocol#2673))
([ccd4611](AztecProtocol@ccd4611))
* Better error message for compute_note_hash_and_nullifier.
([AztecProtocol#3097](AztecProtocol#3097))
([57bec53](AztecProtocol@57bec53))
* Broken `FieldNote` test
([AztecProtocol#3135](AztecProtocol#3135))
([fe78ecf](AztecProtocol@fe78ecf))
* Docker-compose up, rather than run.
([AztecProtocol#3081](AztecProtocol#3081))
([242f780](AztecProtocol@242f780))
* Formatting
([AztecProtocol#3070](AztecProtocol#3070))
([e1633d3](AztecProtocol@e1633d3))
* Minor stale naming fix
([AztecProtocol#3117](AztecProtocol#3117))
([a6786ae](AztecProtocol@a6786ae))
* Push cli docker image to docker hub
([AztecProtocol#3120](AztecProtocol#3120))
([ccad50f](AztecProtocol@ccad50f))
* Remove duplicate terraform resource definition
([AztecProtocol#3066](AztecProtocol#3066))
([d5abadb](AztecProtocol@d5abadb))
* Retry request spot
([AztecProtocol#3116](AztecProtocol#3116))
([82de5f1](AztecProtocol@82de5f1))


### Miscellaneous

* Add stdlib tests for pedersen commitment
([AztecProtocol#3075](AztecProtocol#3075))
([87fa621](AztecProtocol@87fa621))
* Automatic c_binds for commit should return a point instead of an Fr
element
([AztecProtocol#3072](AztecProtocol#3072))
([2e289a5](AztecProtocol@2e289a5))
* Cleanup remaining mentions of `compress` with pedersen in cpp and ts
([AztecProtocol#3074](AztecProtocol#3074))
([52cf383](AztecProtocol@52cf383))
* E2e on spots [ci rebuild]
([AztecProtocol#3068](AztecProtocol#3068))
([15db6bf](AztecProtocol@15db6bf))
* Fix dapp_testing e2e race condition
([AztecProtocol#3094](AztecProtocol#3094))
([89e7c21](AztecProtocol@89e7c21))
* Remove docs mirror
([AztecProtocol#3122](AztecProtocol#3122))
([3fa51e2](AztecProtocol@3fa51e2))
* Remove endomorphism coefficient from ecc_add_gate
([AztecProtocol#3115](AztecProtocol#3115))
([d294987](AztecProtocol@d294987))
* Remove unecessary calls to `pedersen__init`
([AztecProtocol#3079](AztecProtocol#3079))
([84f8db2](AztecProtocol@84f8db2))
* Remove unused pedersen c_binds
([AztecProtocol#3058](AztecProtocol#3058))
([e71e5f9](AztecProtocol@e71e5f9))
* Removes pedersen commit native pairs method
([AztecProtocol#3073](AztecProtocol#3073))
([69a34c7](AztecProtocol@69a34c7))
* Rename private-kernel subpackage to protocol-circuits
([AztecProtocol#3134](AztecProtocol#3134))
([3e07104](AztecProtocol@3e07104))


### Documentation

* Initial keys spec
([AztecProtocol#3035](AztecProtocol#3035))
([4b24c58](AztecProtocol@4b24c58))
</details>

<details><summary>barretenberg.js: 0.13.0</summary>

##
[0.13.0](AztecProtocol/aztec-packages@barretenberg.js-v0.12.0...barretenberg.js-v0.13.0)
(2023-10-31)


### Features

* New script to output table of benchmarks for README pasting.
([AztecProtocol#2780](AztecProtocol#2780))
([6c20b45](AztecProtocol@6c20b45))


### Miscellaneous

* Automatic c_binds for commit should return a point instead of an Fr
element
([AztecProtocol#3072](AztecProtocol#3072))
([2e289a5](AztecProtocol@2e289a5))
* Remove unecessary calls to `pedersen__init`
([AztecProtocol#3079](AztecProtocol#3079))
([84f8db2](AztecProtocol@84f8db2))
* Remove unused pedersen c_binds
([AztecProtocol#3058](AztecProtocol#3058))
([e71e5f9](AztecProtocol@e71e5f9))
</details>

<details><summary>barretenberg: 0.13.0</summary>

##
[0.13.0](AztecProtocol/aztec-packages@barretenberg-v0.12.0...barretenberg-v0.13.0)
(2023-10-31)


### Features

* Adding structure to Transcript
([AztecProtocol#2937](AztecProtocol#2937))
([db67aa1](AztecProtocol@db67aa1))
* Efficient ZM quotient computation
([AztecProtocol#3016](AztecProtocol#3016))
([ebda5fc](AztecProtocol@ebda5fc))
* Measure plonk rounds
([AztecProtocol#3065](AztecProtocol#3065))
([c8e1d8b](AztecProtocol@c8e1d8b))
* New script to output table of benchmarks for README pasting.
([AztecProtocol#2780](AztecProtocol#2780))
([6c20b45](AztecProtocol@6c20b45))
* Pedersen in typescript.
([AztecProtocol#3111](AztecProtocol#3111))
([933f1b2](AztecProtocol@933f1b2))
* Protogalaxy folding of challenges
([AztecProtocol#2935](AztecProtocol#2935))
([7ed30e8](AztecProtocol@7ed30e8))
* Zeromorph with concatenation (Goblin Translator part 10)
([AztecProtocol#3006](AztecProtocol#3006))
([70b0f17](AztecProtocol@70b0f17))


### Miscellaneous

* Add stdlib tests for pedersen commitment
([AztecProtocol#3075](AztecProtocol#3075))
([87fa621](AztecProtocol@87fa621))
* Automatic c_binds for commit should return a point instead of an Fr
element
([AztecProtocol#3072](AztecProtocol#3072))
([2e289a5](AztecProtocol@2e289a5))
* Cleanup remaining mentions of `compress` with pedersen in cpp and ts
([AztecProtocol#3074](AztecProtocol#3074))
([52cf383](AztecProtocol@52cf383))
* Remove endomorphism coefficient from ecc_add_gate
([AztecProtocol#3115](AztecProtocol#3115))
([d294987](AztecProtocol@d294987))
* Remove unecessary calls to `pedersen__init`
([AztecProtocol#3079](AztecProtocol#3079))
([84f8db2](AztecProtocol@84f8db2))
* Remove unused pedersen c_binds
([AztecProtocol#3058](AztecProtocol#3058))
([e71e5f9](AztecProtocol@e71e5f9))
* Removes pedersen commit native pairs method
([AztecProtocol#3073](AztecProtocol#3073))
([69a34c7](AztecProtocol@69a34c7))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
…`aztec.js` (AztecProtocol#3139)

A few fixes of issues which were stumbled upon by a grantee
@harshnambiar.

Issues:
1. `getBlock` method was not exposed on `PXE` even though it's
implemented in `PXEService`,
2. `createAztecNodeRpcClient` naming is not consistent with
`createPXEClient` (`createAztecNodeRpcClient` -->
`createAztecNodeClient`),
3. `createAztecNodeClient` method is not exposed in `aztec.js`.
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-packages: 0.13.1</summary>

##
[0.13.1](AztecProtocol/aztec-packages@aztec-packages-v0.13.0...aztec-packages-v0.13.1)
(2023-10-31)


### Bug Fixes

* Exposing `PXE.getBlock`, exporting `createAztecNodeClient` from
`aztec.js`
([AztecProtocol#3139](AztecProtocol#3139))
([7af345e](AztecProtocol@7af345e))
* Revert push cli docker image to docker hub
([AztecProtocol#3142](AztecProtocol#3142))
([7119382](AztecProtocol@7119382))
</details>

<details><summary>barretenberg.js: 0.13.1</summary>

##
[0.13.1](AztecProtocol/aztec-packages@barretenberg.js-v0.13.0...barretenberg.js-v0.13.1)
(2023-10-31)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg: 0.13.1</summary>

##
[0.13.1](AztecProtocol/aztec-packages@barretenberg-v0.13.0...barretenberg-v0.13.1)
(2023-10-31)


### Miscellaneous

* **barretenberg:** Synchronize aztec-packages versions
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
This PR adds the CircleCI jobs to build the CLI image for x86 and arm.
In AztecProtocol#3120 we push the images, but they weren't getting built
:face_exhaling:

AztecProtocol#3120 got reverted to unblock release of 0.13.1. This PR restores the
changes from AztecProtocol#3120 and also builds the image to be published

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
[PR 3051](AztecProtocol#3051) was
getting too big so I decided to do the naming changes in noir contracts
in a separate PR. This is the PR.
Credit to @skeletor-spaceman for the find

Co-authored-by: Skeletor Spaceman <skeletorspaceman@gmail.com>
I've noticed that the tree section of docs was stale and contained
inaccuracies. This PR fixes it.
\+ less British spelling and somer random TSDoc fixes.
Simplify and consolidate Arithmetization classes and move
Arithmetization templating from `CircuitBuilderBase` to
`UltraCircuitBuilder_`. This will facilitate reuse of Ultra builder
functionality for expanded arithmetizations (e.g. Ultra + DataBus) via
inheritance from `UltraCircuitBuilder_<ExpandedArithmetization>`
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

---------

Co-authored-by: sirasistant <sirasistant@gmail.com>
…AztecProtocol#3178)

This adds the initial skeleton code for the root/merge and base rollup
in Noir.

Theres a bug in Noir with double re-exports which is why it looks quite
janky.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
LHerskind and others added 29 commits December 1, 2023 12:04
Adding mermaid diagram support for the yellow-paper. 

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
This PR fixes a typo in the CCI config file

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
)

Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
This PR adds two different algorithms to create snapshots of merkle
trees.

## Notation

N - number of non-zero nodes
H - height of tree
M - number of snapshots

## ~Incremental~ Full snapshots

This algorithm stores the trees in a database instance in the same way
they would be stored using pointers in memory. Each node has two
key-value entries in the database: one for its left child and one for
its right child.

Taking a snapshot means just walking the tree (BF order), storing any
new nodes. If we hit a node that already exists in the database, that
means the subtree rooted at that node has not changed and so we can skip
checking it.

Building a sibling path is just a traversal of the tree from historic
root to historic leaf.

Pros:
1. its generic enough that it works with any type of merkle tree (one
caveat: we'll need an extension to store historic leaf values for
indexed-trees)
2. it shares structure with other versions of the tree: if some subtree
hasn't changed between two snapshots then it will be reused for both
snapshots (would work well for append-only trees)
3. getting a historic sibling path is extremely cheap only requiring
O(H) database reads

Cons:
1. it takes up a space to store every snapshot. Worst case scenario it
would take up an extra O(N * M) space (ie. the tree changes entirely
after every snapshot). For append-only trees it would be more
space-efficient (e.g. once we start filling the right subtree, the left
subtree will be shared by every future snapshot).

More details in this comment
AztecProtocol#3207 (comment).

## Append-only snapshots

For append-only trees we can have an infinite number of snapshots with
just O(N + M) extra space (N - number of nodes in the tree, M - number
of snapshots) at the cost of sibling paths possibly requiring O(H)
hashes.

This way of storing snapshots only works for `AppendOnlyTree` and
exploits two properties of this type of tree:

1. once a leaf is set, it can never be changed (i.e. the tree is
append-only). This property can be generalised to: once a subtree is
completely filled then none of its nodes can ever change.
2. there are no gaps in the leaves: at any moment in time T we can say
that the first K leaves of the tree are filled and the last 2^H-K leaves
are zeroes.

The algorithm stores a copy of the tree in the database:
- the last snapshot of that node (ie v1, v2, etc)
- the node value at that snapshot

Taking the snapshot is also a BF traversal of the tree, comparing the
current value of nodes with its previously stored value. If the value is
different we update both entries. If the values are the same then the
node hasn't changed and by the first property, none of the nodes in its
subtree have changed so it returns early. For each snapshot we also
store how many leaves have been filled (e.g. at v1 we had 10 leaves, at
v2 33 leaves, etc)

Building a sibling path is more involved and could potentially require
O(H) hashes:
1. walk the historic tree from leaf to root
2. check the sibling's last snapshot
- if it's before the target snapshot version then we can safely use the
node (e.g. node A was last changed at time T3 and we're building a proof
for the tree at time T10, then by property 1 we can conclude that
neither node A nor the subtree rooted at A will ever change at any
moment in time Tn where n > 3)
- if the node has changed then we have to rebuild its historic value at
the snapshot we're interested in
- to do this we check how "wide" the subtree rooted at that node is
(e.g. what's the first leaf index of the subtree) and if it intersects
with the filled leaf set at that snapshot. If it doesn't intersect at
all (e.g. my subtree's first leaf is 11 but only 5 leaves were filled at
the time) then we can safely conclude that the whole subtree has some
hash of zeros
- if it does intersect go down one level and level apply step 2 again.
- the invariant is: we will either reach a leaf and that leaf was
changed in the version we're interested in, or we reach a node that was
changed before the version we're interested in (and we return early) or
we reach a node that was historically a hash of zero

Two (big) SVGs showing the sibling path algorithm step-by-step

[Average
case](https://github.com/AztecProtocol/aztec-packages/assets/3816165/b87fa6eb-bcf4-42ca-879d-173a76d802bb)


[Drawing of sibling path algorithm in the worst
case](https://github.com/AztecProtocol/aztec-packages/assets/3816165/dd3788ec-6357-4fab-bf78-3496a2948040)


Pros:
- low space requirements only needing O(N+M) extra space.

Cons:
- generating a sibling path involves mixed workload: partly reading from
the database and partly hashing. Worst case scenario O(H) db reads +
O(H) hashing
- doesn't work for `IndexedTree`s because even though it only supports
appending new leaves, internally it updates its leaf values.

Fix AztecProtocol#3207

---------

Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

---------

Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
)

[See deployment preview
here](https://aztec-packages.vercel.app/docs/public-vm/InstructionSet#isa-section-add)

- Added instructions to emit noteshashes, nullifiers and l2tol1 messages
- Removed instruction (for now) to get l1tol2 messages
- added grandfather root instruction
- did some instruction reordering
- `indirect` is a flag like any other and is present for all
instructions with offset operands
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
…3495)

Originally, pointer_view was a compromise as we didn't have a good way
of making an iterable structure of references. Now with RefVector, we
can move away from pointer_view

Co-authored-by: ludamad <adam@aztecprotocol.com>
New Poseidon2 relations for efficient stdlib implementation of
Poseidon2. We create new relations for the external and internal rounds of
Poseidon2, in order to be able to execute a permutation with t=4 in just
64 rounds.

Added new tests, including consistency checks and manual hardcoded
tests.

Resolves AztecProtocol/barretenberg#775.
…AztecProtocol#3521)

This is achieved by adding some minimal templating that is redundant in
the context of GoblinUltra, but can be used to remove a lot of
duplication in GoblinUltraRecursive
To enable sharing transcripts in the context of Goblin, I make the
transcript be handled through a shared pointer.
)

We got users hitting the contract functions limit.
subrepo:
  subdir:   "build-system"
  merged:   "c41347e5e"
upstream:
  origin:   "https://github.com/AztecProtocol/build-system"
  branch:   "master"
  commit:   "c41347e5e"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???" [skip ci]
subrepo:
  subdir:   "barretenberg"
  merged:   "fe670eda0"
upstream:
  origin:   "https://github.com/AztecProtocol/barretenberg"
  branch:   "master"
  commit:   "fe670eda0"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???" [skip ci]
subrepo:
  subdir:   "yarn-project/aztec-nr"
  merged:   "8fcd07785"
upstream:
  origin:   "https://github.com/AztecProtocol/aztec-nr"
  branch:   "master"
  commit:   "8fcd07785"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???" [skip ci]
@Okm165 Okm165 merged commit ba4dfb8 into visoftsolutions Dec 2, 2023
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.