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

Introduce destroy_note_unsafe #7831

Closed
nventuro opened this issue Aug 7, 2024 · 1 comment · Fixed by #7891
Closed

Introduce destroy_note_unsafe #7831

nventuro opened this issue Aug 7, 2024 · 1 comment · Fixed by #7891
Assignees

Comments

@nventuro
Copy link
Contributor

nventuro commented Aug 7, 2024

destroy_note currently computes a note hash, which it needs to pass to the kernel so that it can properly squash the note if it was a transient note. This is wasteful, because we typically have already computed the same note hash: e.g. in most cases we read before deleting.

We could have a version of destroy_note that also takes the note hash as a second parameter, where the caller needs to make certain that the hash corresponds to the note. We'd then make e.g. get_notes return both the notes and the hashes, so that they can be passed to destroy_note_unsafe.

@nventuro
Copy link
Contributor Author

nventuro commented Aug 8, 2024

With #7834 merged, we should use this new function in pop_notes.

nventuro pushed a commit that referenced this issue Aug 14, 2024
Fixes #7831

Gate diff: 82803 - 78619 = **4184** gates saved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants