feat: Adding internal keyword#1873
Merged
kevaundray merged 8 commits intonoir-lang:masterfrom Jul 8, 2023
Merged
Conversation
jfecher
reviewed
Jul 6, 2023
jfecher
reviewed
Jul 6, 2023
Contributor
|
Looks good, sans one more parser comment. Since this is still a draft, what work remains on this? |
6 tasks
Contributor
Author
The idea was that it should be behind a feature flag to see how easily we could use those to get things into noir for Aztec without wrecking master, just have not gotten around to it. |
408d491 to
3a053f7
Compare
Co-authored-by: jfecher <jfecher11@gmail.com>
3a053f7 to
50de98f
Compare
jfecher
reviewed
Jul 7, 2023
Co-authored-by: jfecher <jfecher11@gmail.com>
kevaundray
approved these changes
Jul 8, 2023
1 task
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adding
internalas a keyword for functions to specify that only the contracts itself can execute this function.Related to #1168. But functions are not
internalby default, instead it is callable by other contracts and itself.Problem*
When building noir contracts for Aztec, we want to support flows such as:
Currently, we could do this by inserting a commitment from private and then nullify it in public, but that is very wasteful.
Instead we can introduce
internalas a keyword and storeis_internalas part of the contracts tree, which allows the kernel to check that the contract itself is the caller, and reject anyone else from calling it.Similar to solidity
internal.Summary*
internalkeyword.is_internalto json outputDocumentation
This PR requires documentation updates when merged.
For documentation only of interest to contract noir, which don't seem to have documentation at the moment.
Additional Context
PR Checklist*
cargo fmton default settings.