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

perf(imt): when updating a node, skip calculation if value is the same #350

Conversation

hannahredler
Copy link
Contributor

@hannahredler hannahredler commented Nov 21, 2024

Description

In order to improve performance, we can avoid recalculating the Incremental Merkel Tree in the event that the update value is the same as the tree value.

Related Issue(s)

Closes #340

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run yarn style without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

In order to improve performance, we can avoid recalculating the Incremental Merkel Tree in the event
that the update value is the same as the tree value.

re privacy-scaling-explorations#340
@hannahredler hannahredler requested a review from cedoor as a code owner November 21, 2024 15:37
@cedoor cedoor requested a review from 0xDatapunk November 22, 2024 04:54
Copy link
Collaborator

@0xDatapunk 0xDatapunk left a comment

Choose a reason for hiding this comment

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

Looks good

@cedoor cedoor merged commit c25353b into privacy-scaling-explorations:main Nov 25, 2024
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.

checking if newLeaf != this._nodes[0][index] first before update
3 participants