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

Nullifier map optimization #349

Merged
merged 2 commits into from May 24, 2023
Merged

Nullifier map optimization #349

merged 2 commits into from May 24, 2023

Conversation

SupremoUGH
Copy link
Contributor

@SupremoUGH SupremoUGH commented May 23, 2023

Frees the signer memory from holding every nullifier. Now it only holds the user's nullifiers if they haven't been spent yet.
Goes together with Manta-Network/sdk#129


Before we can merge this PR, please make sure that all the following items have been checked off:

  • Linked to an issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Added one line describing your change in CHANGELOG.md and added the appropriate changelog label to the PR.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Checked that changes and commits conform to the standards outlined in CONTRIBUTING.md.

@SupremoUGH SupremoUGH self-assigned this May 23, 2023
@SupremoUGH SupremoUGH added the changelog:added Changelog: add these changes to the `added` section of the changelog label May 23, 2023
@SupremoUGH SupremoUGH marked this pull request as ready for review May 23, 2023 15:41
@SupremoUGH SupremoUGH mentioned this pull request May 23, 2023
3 tasks
@SupremoUGH SupremoUGH marked this pull request as draft May 23, 2023 16:29
@SupremoUGH SupremoUGH marked this pull request as ready for review May 23, 2023 16:40
Copy link
Contributor

@Apokalip Apokalip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@SupremoUGH SupremoUGH merged commit 7a0a4be into main May 24, 2023
17 checks passed
@SupremoUGH SupremoUGH deleted the signer_sync_optimization branch May 24, 2023 13:04
nullifier: &Self::Nullifier,
decryption_key: &Self::DecryptionKey,
) -> bool {
self.open(nullifier, decryption_key).is_some()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

layman question: is there some way to check it can be opened without actually opening it ?

@@ -75,6 +78,16 @@ where
Extend::extend(self, items)
}

#[inline]
fn remove(&mut self, item: &T) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw why was the vector impl needed ?
Seems we're mostly looking up and removing, so the hashset should be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:added Changelog: add these changes to the `added` section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants