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

Number of read requests optimisation. #1660

Closed
LeilaWang opened this issue Aug 18, 2023 · 1 comment · Fixed by #2164
Closed

Number of read requests optimisation. #1660

LeilaWang opened this issue Aug 18, 2023 · 1 comment · Fixed by #2164
Assignees
Labels
T-bug Type: Bug. Something is broken.

Comments

@LeilaWang
Copy link
Collaborator

When we call oracle.get_notes(), the simulator adds the membership witness for all return notes.

But when aztec lib receives the notes, it applies a filter first, and then adds the hashes of the selected notes to read_requests.

It will cause the inconsistency between read_requests and witnesses if the filter returns fewer notes than the notes returned from the simulator.

Before we fix it properly, current workaround is to make read requests for all notes returned from the simulator.

In the meantime, the NoteGetterOption.filter will not help reducing the number of read requests per tx.

@github-project-automation github-project-automation bot moved this to Todo in A3 Aug 18, 2023
@LeilaWang LeilaWang added the T-bug Type: Bug. Something is broken. label Aug 21, 2023
@ludamad
Copy link
Collaborator

ludamad commented Aug 21, 2023

What's the issue with a mismatch between witnesses and read requests?

@iAmMichaelConnor iAmMichaelConnor added this to the 📢 Initial Public Sandbox Release milestone Aug 25, 2023
@LeilaWang LeilaWang self-assigned this Sep 4, 2023
@LeilaWang LeilaWang moved this from Todo to In Progress in A3 Sep 6, 2023
@LeilaWang LeilaWang moved this from In Progress to In Review in A3 Sep 11, 2023
LeilaWang added a commit that referenced this issue Sep 11, 2023
…2164)

Close #1660 

- An app can apply a filter to the returned notes from the `getNotes`
oracle call, to only read and make use of some of them. So the returned
notes are not always included in the read_requests. We now construct the
`readRequestPartialWitnesses` based on the content of the read_requests
array in public inputs at the end of an execution.

Refactoring:
- Create `ExecutionNoteCache` to share new notes (pending notes) and
emitted nullifiers among all executions.


# 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).
@github-project-automation github-project-automation bot moved this from In Review to Done in A3 Sep 11, 2023
codygunton pushed a commit that referenced this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: Bug. Something is broken.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants