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

feat: Allow arbitrary noir functions to be unconstrained #1044

Merged
merged 3 commits into from
Mar 28, 2023
Merged

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Mar 27, 2023

Related issue(s)

Resolves #

Description

Summary of changes

  • Renames unsafe back to unconstrained
  • Allows any noir function (not just contract functions) to be unconstrained
  • Renames ContractVisibility to ContractFunctionKind
  • To keep the JSON ABI the same, the ContractFunctionKind that is outputted still contains the three possible values of 'open', 'secret', or 'unconstrained' as mutually exclusive. Despite the fact the frontend now allows functions that are both 'open' and 'unconstrained' as a side effect of them being separated.

Dependency additions / changes

Test additions / changes

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.

Documentation needs

  • This PR requires documentation updates when merged.

Additional context

@jfecher jfecher changed the title Allow arbitrary noir functions to be unconstrained feat: Allow arbitrary noir functions to be unconstrained Mar 27, 2023
@jfecher jfecher mentioned this pull request Mar 28, 2023
6 tasks
@joss-aztec joss-aztec self-requested a review March 28, 2023 10:58
@jfecher jfecher enabled auto-merge March 28, 2023 11:03
@jfecher jfecher added this pull request to the merge queue Mar 28, 2023
Merged via the queue into master with commit ebc8a36 Mar 28, 2023
@jfecher jfecher deleted the jf/unsafe branch March 28, 2023 11:51
@critesjosh
Copy link
Contributor

@jfecher should all instances of the unsafe keyword be updated to unconstrained in the docs?

I think the only place we mention it is on the "Zeroed Function" page, std::unsafe::zeroed. Is it still in stdlib::unsafe?

@jfecher
Copy link
Contributor Author

jfecher commented Jul 19, 2023

@critesjosh I don't believe we've ever had an unsafe keyword in Noir. The unsafe in std::unsafe::zeroed is just the name of the module so it doesn't need to be changed - it's still at that location.

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.

4 participants