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

chore(stdlib)!: remove unnecessary merkle functions from stdlib #1424

Merged
merged 2 commits into from
May 27, 2023

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Related to #1258 and noir-lang/acvm#295

Summary*

This PR removes the unnecessary functions from the merkle module in the stdlib (check_membership and compute_root_from_leaf).

We no longer use the black box version of compute_merkle_root in preparation for the opcode being removed and just use the noir implementation (which has been shown to be more efficient anyway). compute_root_from_leaf is then removed/renamed to compute_merkle_root

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@kevaundray kevaundray added this pull request to the merge queue May 27, 2023
Merged via the queue into master with commit 50fcb3c May 27, 2023
9 checks passed
@kevaundray kevaundray deleted the remove-check-membership branch May 27, 2023 21:40
@critesjosh
Copy link
Contributor

Has check_membership been removed in favor of just computing the root and comparing to a given root. If they match, then it's a member?

@TomAFrench
Copy link
Member Author

Yes, that's correct. We expect user code to use assert(expected_root == compute_merkle_root(...)) instead of wrapping it in an extra function.

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.

None yet

3 participants