Closed YashBit closed 1 month ago
@cedoor I have created a DynamicCalculator trait which will works the same way but with the depth as a parameter now. This basically controls the loop.
In -> packages/merkle-trees/src/incremental_merkle/tree.nr
Questions:
Please let me know if this is the correct direction of implementation with a simple new modified trait that I have completed.
After which I will focus on the MembershipProver, etc methods. Then write the Poseidon Hash tests.
For the tests, how would you like me to test the dynamic depth function? So I should create a tree (let's say of depth 4), and then calculate the results for depth 1, 2, 3?
@YashBit
- Please let me know if this is the correct direction of implementation with a simple new modified trait that I have completed.
The trait seems to be fine, I added other comments for some files that are actually just a copy of the current Merkle tree. You should be able to re-use that code.
- After which I will focus on the MembershipProver, etc methods. Then write the Poseidon Hash tests.
Yes, those functions still need to be implemented I guess.
For the tests, how would you like me to test the dynamic depth function? So I should create a tree (let's say of depth 4), and then calculate the results for depth 1, 2, 3?
Exactly, sounds like a good way to test them. Please, take a look at these tests here: https://github.com/privacy-scaling-explorations/zk-kit.circom/blob/326cef9fdb9a2f845b890cffea0594975768be1f/packages/binary-merkle-root/tests/binary-merkle-root.test.ts#L98. You should have the same tests in Noir here.
Also, be aware that this is not an incremental Merkle tree. It works as a general binary Merkle tree with an addition feature: dynamic depth, i.e. the ability to generate a proof with an arbitrary depth even if there's a maximum depth in the circuit (which must be static by design).
Converting to draft while not ready to merge
@signorecello Please can you change this back from the draft? The core logic is complete, adding a few tests now.
@signorecello
Could you please comment on the algorithm? Most of it should remain the same, it is just the calculate_root_dynamic function in now a new trait called DynamicCalculator which should be able to handle the depth function dynamically.
Thank you again.
@YashBit CI is (style check ) is failing. Can you please address this issue? I think you should be familiar with that situation given what you've learnt by working on #8
@sripwoud I will make those changes.
I am mainly concerned with the logic of the incremental tree. That is the most important, since after that I will be done with unit the tests as well.
@YashBit can we close this PR in favor of https://github.com/privacy-scaling-explorations/zk-kit.noir/pull/16 ?
@cedoor Yes, please close this one!
Important:
Description