Skip to content

fix: update merkle tree #1065

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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

fix: update merkle tree #1065

wants to merge 30 commits into from

Conversation

matteo-cristino
Copy link
Collaborator

  • added a function for test vectors in merkle_tree.lua, created tests for creation merkle tree check_merkle_tree.lua
  • chore(style): remove trailing whitespaces

@matteo-cristino matteo-cristino mentioned this pull request May 7, 2025
@jaromil
Copy link
Member

jaromil commented May 7, 2025

very well, there is no fix: commit so I'll wait for merge in case we want to trigger release

@matteo-cristino matteo-cristino marked this pull request as draft May 7, 2025 08:52
@matteo-cristino
Copy link
Collaborator Author

matteo-cristino commented May 7, 2025

TODO:

  • ✅ add merkle vector test to run with all other test (add it to bats file in vector test)
  • ✅ vector tests do not work beacuse function called are local in zencode_merkletree.lua, maybe create crypto_merkletree.lua as we did for the other packages?
  • ✅ vector test call a non existing data2 dictioanry

@matteo-cristino
Copy link
Collaborator Author

matteo-cristino commented May 7, 2025

✅ bonus point: maybe _create_merkle_tree can be optimized, I'm not sure if the first for loop where all the tree is set to 0 string is really needed 🔮

@matteo-cristino matteo-cristino marked this pull request as ready for review May 8, 2025 07:50
@matteo-cristino matteo-cristino marked this pull request as draft May 8, 2025 10:17
@matteo-cristino matteo-cristino marked this pull request as ready for review June 6, 2025 08:02
nsuzzi and others added 18 commits June 24, 2025 11:28
…or creation merkle tree check_merkle_tree.lua
small improvements to creation of merkle tree and error messages
the shift done in source code (that used 0-based indexing) seems only used to simplify math operations, so here we can directly start from beginning of array (1-based indexing)
…f a leaf and the correspodig function that verify it
…ulate the lenght of a merkle tree and finished test for MT.verify_proof from frigo's code
…ive verify function, added test vector from frigo's RFC
…tting of the test for merkle tree, added test for MT.verify_compressed_proof from Frigo's code
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.

3 participants