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

Refactor MerkleTreeGadget implementation #243

Merged

Conversation

mike1729
Copy link
Contributor

@mike1729 mike1729 commented Apr 20, 2023

Description

There are two implementations of MerkleTreeGadget for RescueMerkleTree and RescueSparseMerkleTree that are equivalent except types they use. Recently a bug was found in the impl for RescueMerkleTree that affected also the other and only one was fixed.
This PR proposes a refactor to a common implementation for both types.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (main)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

@CLAassistant
Copy link

CLAassistant commented Apr 20, 2023

CLA assistant check
All committers have signed the CLA.

@mike1729
Copy link
Contributor Author

There is still some work to be done in moving some tests around but I wanted first to check if you like the direction of the change.

@mrain
Copy link
Contributor

mrain commented Apr 20, 2023

There is still some work to be done in moving some tests around but I wanted first to check if you like the direction of the change.

Thanks very much for spotting this. It will be very helpful if you proceed ahead.
Much appreciated!

@mike1729 mike1729 marked this pull request as ready for review April 21, 2023 15:30
@mike1729
Copy link
Contributor Author

Ready for review :)

@@ -6,330 +6,3 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Shoule delete this file?

@mrain
Copy link
Contributor

mrain commented Apr 24, 2023

LGTM in general, minor comments above.

Also do you think it's better to rename sparse_merkle_tree.rs as universal_merkle_tree.rs?

@mike1729
Copy link
Contributor Author

mike1729 commented Apr 26, 2023

@mrain I've addressed all comments :)

Copy link
Contributor

@mrain mrain left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot!

@mrain mrain merged commit dbd040e into EspressoSystems:main Apr 28, 2023
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.

None yet

3 participants