-
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: Sync from aztec-packages #4825
Closed
Closed
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
…er (AztecProtocol/aztec-packages#5797) A follow-up to AztecProtocol/aztec-packages#5737 Separate PR as this touches mainly the AVM transpiler and not Noir codegen itself. Look in PR #5737 for full details about the switch, but basically we are moving away from the `Brillig` opcode to a `BrilligCall` opcode that contains a Brillig call opcode. The AVM needs to be updated to account for this change.
…ckages#5800) This is a quick fix after AztecProtocol/aztec-packages#5737 since that PR assumes that one generated brillig is valid for all calls to the brillig function. This is however not true, since the generated brillig can differ if the arguments contains slices. This is because the entry point codegen depends on the size of the slice. We currently cannot copy slices of any length into brillig due to the limitations of [CALLDATACOPY](https://yp-aztec.netlify.app/docs/public-vm/instruction-set#calldatacopy) where the size being copied needs to be known at compile-time. I'm going to chat with the AVM team to see if we can lift this restriction and make brillig entry points be able to copy in arguments that contain slices of any length.
…ckages#5800) This is a quick fix after AztecProtocol/aztec-packages#5737 since that PR assumes that one generated brillig is valid for all calls to the brillig function. This is however not true, since the generated brillig can differ if the arguments contains slices. This is because the entry point codegen depends on the size of the slice. We currently cannot copy slices of any length into brillig due to the limitations of [CALLDATACOPY](https://yp-aztec.netlify.app/docs/public-vm/instruction-set#calldatacopy) where the size being copied needs to be known at compile-time. I'm going to chat with the AVM team to see if we can lift this restriction and make brillig entry points be able to copy in arguments that contain slices of any length.
…ztec-packages#5687) Closes AztecProtocol/aztec-packages#5081 This PR introduces autogenerated contract interfaces for easy intra and inter contract interactions. The `aztec-macro` crate is used to stub every non-internal private and public function and inject them into a ghost struct which has the same name as the contract that generated them. After that, they can be called like this: ```rust contract ImportTest { use dep::my_imported_contract::MyImportedContract; #[aztec(private)] fn a_private_fn() { let deserialized_return = MyImportedContract::at(some_address).another_private_fn(arg1, arg2).call(&mut context); MyImportedContract::at(some_address).a_public_fn(arg1).enqueue(&mut context); } #[aztec(public)] fn a_public_fn() { let deserialized_return = MyImportedContract::at(some_address).a_public_fn(arg1).call(&mut context); } #[aztec(private)] fn calling_my_own_fns() { ImportTest::at(context.this_address).a_private_fn().call(&mut context); ImportTest::at(context.this_address).a_public_fn().enqueue(&mut context); } } ``` Return values are `deserialized_into()` automatically, providing "real" return values thanks to AztecProtocol/aztec-packages#5633 Also, some general cleanup was required to allow importing contracts in another contracts. Main changes: - `HirContext.fully_qualified_struct_path` now uses BFS to avoid returning the longest path when looking for a struct in a crate. This is required to avoid pulling structs usually imported in top-level dependencies (usually notes from our main contract) from other imported contracts. - `pack_args_oracle` now has a slice mode in addition to its usual array mode. PENDING: ~~AvmContext. The AVM team is discussing supporting args as slices. In case it's decided not to do that, a workaround could possibly be implemented using the macro, but it would be fairly complex.~~ Thanks to @fcarreiro and the amazing AVM team, this is now supported for the AvmContext! --------- Co-authored-by: esau <152162806+sklppy88@users.noreply.github.com> Co-authored-by: Álvaro Rodríguez <sirasistant@gmail.com>
…ztec-packages#5687) Closes AztecProtocol/aztec-packages#5081 This PR introduces autogenerated contract interfaces for easy intra and inter contract interactions. The `aztec-macro` crate is used to stub every non-internal private and public function and inject them into a ghost struct which has the same name as the contract that generated them. After that, they can be called like this: ```rust contract ImportTest { use dep::my_imported_contract::MyImportedContract; #[aztec(private)] fn a_private_fn() { let deserialized_return = MyImportedContract::at(some_address).another_private_fn(arg1, arg2).call(&mut context); MyImportedContract::at(some_address).a_public_fn(arg1).enqueue(&mut context); } #[aztec(public)] fn a_public_fn() { let deserialized_return = MyImportedContract::at(some_address).a_public_fn(arg1).call(&mut context); } #[aztec(private)] fn calling_my_own_fns() { ImportTest::at(context.this_address).a_private_fn().call(&mut context); ImportTest::at(context.this_address).a_public_fn().enqueue(&mut context); } } ``` Return values are `deserialized_into()` automatically, providing "real" return values thanks to AztecProtocol/aztec-packages#5633 Also, some general cleanup was required to allow importing contracts in another contracts. Main changes: - `HirContext.fully_qualified_struct_path` now uses BFS to avoid returning the longest path when looking for a struct in a crate. This is required to avoid pulling structs usually imported in top-level dependencies (usually notes from our main contract) from other imported contracts. - `pack_args_oracle` now has a slice mode in addition to its usual array mode. PENDING: ~~AvmContext. The AVM team is discussing supporting args as slices. In case it's decided not to do that, a workaround could possibly be implemented using the macro, but it would be fairly complex.~~ Thanks to @fcarreiro and the amazing AVM team, this is now supported for the AvmContext! --------- Co-authored-by: esau <152162806+sklppy88@users.noreply.github.com> Co-authored-by: Álvaro Rodríguez <sirasistant@gmail.com>
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore: fix alerts on rust msrv (#4817) chore(ci): fix alerts on msrv issues (#4816) chore: run clippy (#4810) chore: optimize poseidon2 implementation (#4807) fix: catch panics from EC point creation (e.g. the point is at infinity) (#4790) feat: Sync from aztec-packages (#4792) feat: lalrpop lexer prototype (#4656) feat(nargo): Handle call stacks for multiple Acir calls (#4711) fix: proper field inversion for bigints (#4802) feat: add `NARGO_FOREIGN_CALL_TIMEOUT` environment variable (#4780) chore(debugger): Docs (#4145) feat: narrow ABI encoding errors down to target problem argument/field (#4798) chore: Rename 'global' to 'function' in the monomorphization pass (#4774) chore: Add Hir -> Ast conversion (#4788) fix: Fix panic when returning a zeroed unit value (#4797) END_COMMIT_OVERRIDE --------- Co-authored-by: vezenovm <mvezenov@gmail.com> Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore: fix alerts on rust msrv (#4817) chore(ci): fix alerts on msrv issues (#4816) chore: run clippy (#4810) chore: optimize poseidon2 implementation (#4807) fix: catch panics from EC point creation (e.g. the point is at infinity) (#4790) feat: Sync from aztec-packages (#4792) feat: lalrpop lexer prototype (#4656) feat(nargo): Handle call stacks for multiple Acir calls (#4711) fix: proper field inversion for bigints (#4802) feat: add `NARGO_FOREIGN_CALL_TIMEOUT` environment variable (#4780) chore(debugger): Docs (#4145) feat: narrow ABI encoding errors down to target problem argument/field (#4798) chore: Rename 'global' to 'function' in the monomorphization pass (#4774) chore: Add Hir -> Ast conversion (#4788) fix: Fix panic when returning a zeroed unit value (#4797) END_COMMIT_OVERRIDE --------- Co-authored-by: vezenovm <mvezenov@gmail.com> Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
* master: chore: remove unnecessary casts in `BoundedVec` (#4831) fix: issue 4682 and add solver for unconstrained bigintegers (#4729) chore(docs): fix wrong Nargo.toml workspace examples (#4822) chore: delete unnecessary Prover.toml file (#4829) chore: fix alerts on rust msrv (#4817) chore(ci): fix alerts on msrv issues (#4816) chore: run clippy (#4810) chore: optimize poseidon2 implementation (#4807) fix: catch panics from EC point creation (e.g. the point is at infinity) (#4790)
github-actions
bot
added
the
documentation
Improvements or additions to documentation
label
Apr 17, 2024
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.
Automated pull of Noir development from aztec-packages.
BEGIN_COMMIT_OVERRIDE
feat: Sync from noir (AztecProtocol/aztec-packages#5794)
feat!: contract interfaces and better function calls (AztecProtocol/aztec-packages#5687)
fix: Don't reuse brillig with slice arguments (AztecProtocol/aztec-packages#5800)
chore: Use BrilligCall for unconstrained main and update AVM transpiler (AztecProtocol/aztec-packages#5797)
feat: Brillig pointer codegen and execution (AztecProtocol/aztec-packages#5737)
feat!: change backend width to 4 (AztecProtocol/aztec-packages#5374)
feat!: Use fixed size arrays in black box functions where sizes are known (AztecProtocol/aztec-packages#5620)
feat!: trap with revert data (AztecProtocol/aztec-packages#5732)
feat: impl of missing functionality in new key store (AztecProtocol/aztec-packages#5750)
feat(acir)!: BrilligCall opcode (AztecProtocol/aztec-packages#5709)
END_COMMIT_OVERRIDE