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

public-vm(ts): Implement Call and static call instructions #4127

Closed
2 tasks done
Tracked by #3383
Maddiaa0 opened this issue Jan 18, 2024 · 0 comments · Fixed by #4194
Closed
2 tasks done
Tracked by #3383

public-vm(ts): Implement Call and static call instructions #4127

Maddiaa0 opened this issue Jan 18, 2024 · 0 comments · Fixed by #4194
Assignees
Labels
C-avm Component: AVM related tickets (aka public VM)

Comments

@Maddiaa0
Copy link
Member

Maddiaa0 commented Jan 18, 2024

#Overview
Part of general implementation (and testing) of all of the VM instructions.

Tasks

@github-project-automation github-project-automation bot moved this to Todo in A3 Jan 18, 2024
@Maddiaa0 Maddiaa0 added the C-avm Component: AVM related tickets (aka public VM) label Jan 18, 2024
@Maddiaa0 Maddiaa0 assigned fcarreiro and Maddiaa0 and unassigned fcarreiro Jan 22, 2024
@Maddiaa0 Maddiaa0 moved this from Todo to In Progress in A3 Jan 23, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in A3 Jan 25, 2024
fcarreiro added a commit that referenced this issue Mar 11, 2024
This PR enables the stack of 6 PRs on top.
\
While working on external calls, we came across several problems with Brillig. I made some changes to fix them. Some Brillig changes:
* **Truncation**: Brillig was using AND of Fields (actually, AND on Ints of 254 bits). This is not supported by the VM. Truncation was changed to be done without ANDing, and using `CAST` instead, which truncates to the required bit size. 
* **Array.get**/**Array.set**: Calculation of the `arrayBase+index` was done using field arithmetic (or field sizes). Now it's done using ints.
* **Reference counting**: Checking `refCount==1` was done using field arithmetic (or field sizes). Now it's done with ints.

These changes seem to solve all the comparison w/different bit sizes, and unexpected uses of field arithmetic. (That we've found with the current test contract).

NOTE: I had to recreate the contract snapshots with `yarn workspace @aztec/protocol-contracts test -u`, then modify 
* noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr
* noir-projects/noir-contracts/contracts/fpc_contract/src/main.nr

Relates to #4313, #4127.
fcarreiro added a commit that referenced this issue Mar 11, 2024
* Logging
* `Call` and `StaticCall` were returning Field while per YP should be Uint8.
* I'm also moving the RETURN and REVERT opcodes to `external_calls.ts` (from `control_flow.ts`).

Relates to #4313, #4127.
fcarreiro added a commit that referenced this issue Mar 11, 2024
This PR finishes the external call opcodes, adds the necessary aztec.nr machinery and tests. It's based on David's work.

Relates to #4313, #4127.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-avm Component: AVM related tickets (aka public VM)
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants