-
Notifications
You must be signed in to change notification settings - Fork 200
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: Adding internal keyword #1873
Merged
Merged
Conversation
This file contains 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
jfecher
reviewed
Jul 6, 2023
jfecher
reviewed
Jul 6, 2023
Looks good, sans one more parser comment. Since this is still a draft, what work remains on this? |
6 tasks
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. |
LHerskind
force-pushed
the
lh/internal-functions
branch
from
July 7, 2023 10:35
408d491
to
3a053f7
Compare
Co-authored-by: jfecher <jfecher11@gmail.com>
LHerskind
force-pushed
the
lh/internal-functions
branch
from
July 7, 2023 11:05
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
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
internal
as a keyword for functions to specify that only the contracts itself can execute this function.Related to #1168. But functions are not
internal
by 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
internal
as a keyword and storeis_internal
as 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*
internal
keyword.is_internal
to 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 fmt
on default settings.