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

Mt refactor #135

Merged
merged 10 commits into from
Nov 22, 2022
Merged

Mt refactor #135

merged 10 commits into from
Nov 22, 2022

Conversation

mrain
Copy link
Contributor

@mrain mrain commented Nov 14, 2022

Description

closes: #88


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

alxiong and others added 3 commits November 8, 2022 00:16
* Initial commit

* structured + impl

* Base merkle tree impl

* merkle_tree_impl

* generic indextype

* Refactored code for further SMT impl.

* Batch insertion implementation.

* Major refactoring & forget implementation.

* Remember implemented.

* cargo fmt

* Big refactor. Leaf now digest index to prevent forge attack.

* unit test for Forgettable merkle tree.

* cleanup

* Clear Arity & replace F::zero() with default()

* trait bound refactor

* New example.

* cargo fmt

* More example.

* ElementType->Element; rename trait, impl and module; remove missing license check

* IndexType refactor

* Refactor DigestAlgorithm

* Pull out Element,Index,NodeValue as traits; add trait bound to unconstrainted generic struct/fn

* Refactor capacity interface

* Renaming & better crate import.

* var renaming

* MerkleProof API refactor

Co-authored-by: Alex Xiong <alex.xiong.tech@gmail.com>
* A new macro for general merkle tree implementation
* Better trait bound for data types
* New Universal Merkle tree implementation, including non-membership proof
* Better comments for examples.
@mrain mrain requested review from fkrell, jbearer and alxiong November 14, 2022 17:04
Copy link

@fkrell fkrell 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 over all. Reply to comments, then I'll approve

primitives/benches/merkle_path.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/append_only.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/append_only.rs Show resolved Hide resolved
primitives/src/merkle_tree/examples.rs Show resolved Hide resolved
primitives/src/merkle_tree/macros.rs Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Show resolved Hide resolved
@chancharles92
Copy link
Contributor

@mrain Let's change this PR from a draft to a ready-for-review PR.

@mrain mrain marked this pull request as ready for review November 16, 2022 15:00
prelude now includes 2 canonical instantiation of rescue merkle tree.
@mrain mrain requested review from jbearer and fkrell November 21, 2022 16:07
primitives/src/merkle_tree/mod.rs Show resolved Hide resolved
primitives/src/merkle_tree/macros.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/macros.rs Outdated Show resolved Hide resolved
jbearer
jbearer previously approved these changes Nov 21, 2022
Copy link
Member

@jbearer jbearer left a comment

Choose a reason for hiding this comment

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

This looks good to me from a systems/interface perspective

Copy link
Contributor

@alxiong alxiong left a comment

Choose a reason for hiding this comment

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

Really awesome job on this big PR! way to go! 💯

primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/mod.rs Outdated Show resolved Hide resolved
primitives/src/merkle_tree/internal.rs Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
@mrain mrain merged commit a5e13ae into main Nov 22, 2022
@mrain mrain deleted the mt-refactor branch November 22, 2022 16:23
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.

[API] Refactor Merkle tree and its gadget
6 participants