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: Support unconstrained public functions #1375

Closed
LHerskind opened this issue Aug 2, 2023 · 0 comments · Fixed by #1421
Closed

feat: Support unconstrained public functions #1375

LHerskind opened this issue Aug 2, 2023 · 0 comments · Fixed by #1421
Labels
A-internal-devex Area: Relates to the devex of internal teams building Aztec.

Comments

@LHerskind
Copy link
Contributor

LHerskind commented Aug 2, 2023

Currently unconstrained execution UnconstrainedFunctionExecution don't support accessing public storage which makes it quite painful to read public storage as you then need to do it by computing storage slots and handle that yourself.

We should extend the unconstrained execution such that it have access to public storage.

For a noir function

unconstrained fn publicBalanceOf(
    owner: Field,
) -> Field {
    let storage = Storage::init();
    let owner_balance = storage.balances.at(owner);

    owner_balance.read()
}

We should be able to run the following without handing out errors as goldstars in a kindergarden.

const balance = await contract.methods.publicBalanceOf(recipient.toField()).view();
@LHerskind LHerskind added the A-internal-devex Area: Relates to the devex of internal teams building Aztec. label Aug 2, 2023
@LHerskind LHerskind added this to A3 Aug 2, 2023
@github-project-automation github-project-automation bot moved this to Todo in A3 Aug 2, 2023
@LHerskind LHerskind changed the title Give Unconstrained execution access to public storage feat: Support unconstrained public functions Aug 2, 2023
@LHerskind LHerskind linked a pull request Aug 7, 2023 that will close this issue
4 tasks
LHerskind added a commit that referenced this issue Aug 7, 2023
…1421)

Addresses #1375 by giving the unconstrained execution access to public
storage through the node.

Good things: 
- Makes it simpler to read values

Bad things:
- Because the simulator is much slower than reading the value, makes
testing slower 😭.
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-internal-devex Area: Relates to the devex of internal teams building Aztec.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants