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

simplify MerkleSet by making it immutable #17861

Merged
merged 1 commit into from
Apr 16, 2024
Merged

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented Apr 12, 2024

Purpose:

This is in preparation for the rust port of MerkleSet, which does not have add_already_hashed(), but instead builds the tree in its constructor.

Current Behavior:

To build a MerkleSet, you default construct it and call add_already_hashed() to add all leafs to it.

New Behavior:

To build a MerkleSet, you construct it with a list of all leafs.

@arvidn arvidn added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Apr 12, 2024
@arvidn arvidn marked this pull request as ready for review April 12, 2024 14:18
@arvidn arvidn requested a review from a team as a code owner April 12, 2024 14:18
@arvidn arvidn requested a review from altendky April 12, 2024 14:21
@arvidn arvidn requested a review from matt-o-how April 15, 2024 11:51
chia/util/merkle_set.py Outdated Show resolved Hide resolved
chia/util/merkle_set.py Outdated Show resolved Hide resolved
matt-o-how
matt-o-how previously approved these changes Apr 15, 2024
Copy link
Contributor

@matt-o-how matt-o-how 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 and is a good first step to moving to using the Rust version of MerkleSet

chia/_tests/core/test_merkle_set.py Show resolved Hide resolved
chia/_tests/core/test_merkle_set.py Show resolved Hide resolved
chia/_tests/core/test_merkle_set.py Show resolved Hide resolved
chia/util/merkle_set.py Show resolved Hide resolved
@pmaslana pmaslana merged commit d117e0a into main Apr 16, 2024
351 checks passed
@pmaslana pmaslana deleted the immutable-merkle-set branch April 16, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changed Required label for PR that categorizes merge commit message as "Changed" for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants