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

fix: Merkle tree bug fix #500

Merged
merged 3 commits into from
Feb 27, 2024
Merged

fix: Merkle tree bug fix #500

merged 3 commits into from
Feb 27, 2024

Conversation

mrain
Copy link
Contributor

@mrain mrain commented Feb 27, 2024

Description

closes: #499


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

@mrain mrain requested a review from jbearer February 27, 2024 17:22
jbearer
jbearer previously approved these changes Feb 27, 2024
@mrain
Copy link
Contributor Author

mrain commented Feb 27, 2024

Reason for previous CI failure is here

A temporary fix is to use stable cargo for test d6439a3

jbearer
jbearer previously approved these changes Feb 27, 2024
Comment on lines +291 to +303
} else if num_leaves == 0 {
Ok((Arc::new(MerkleNode::<E, u64, T>::Empty), height, 0))
} else if height == 0usize {
Ok((
Arc::new(MerkleNode::Leaf {
value: H::digest_leaf(&0, leaves[0].borrow())?,
pos: 0,
elem: leaves[0].borrow().clone(),
}),
height,
1,
))
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

copy pasta 😕

Comment on lines +177 to +180
// singleton merkle tree test (#499)
let mt = RescueLightWeightMerkleTree::<F>::from_elems(None, [F::from(0u64)]).unwrap();
let (elem, _) = mt.lookup(0).expect_ok().unwrap();
assert_eq!(elem, &F::from(0u64));
Copy link
Contributor

Choose a reason for hiding this comment

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

more copy pasta

Comment on lines -7 to -10
cargo +nightly test --release -p jf-utils -- -Zunstable-options --report-time
cargo +nightly test --release -p jf-plonk --lib --bins -- -Zunstable-options --report-time
cargo +nightly test --release -p jf-primitives --features test-srs -- -Zunstable-options --report-time # enable test-srs feature for gen_srs_for_testing
cargo +nightly test --release -p jf-relation -- -Zunstable-options --report-time
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for removing nightly!

@mrain mrain merged commit 214227e into main Feb 27, 2024
5 checks passed
@mrain mrain deleted the mt-bug-fix branch February 27, 2024 18:50
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.

[bug] Merkle tree constructor
3 participants