feat!: Unify ABIs between nargo and yarn-project#3906
Closed
spalladino wants to merge 7 commits intomasterfrom
Closed
feat!: Unify ABIs between nargo and yarn-project#3906spalladino wants to merge 7 commits intomasterfrom
spalladino wants to merge 7 commits intomasterfrom
Conversation
f3eb42c to
583cd45
Compare
TomAFrench
reviewed
Jan 11, 2024
Member
TomAFrench
left a comment
There was a problem hiding this comment.
Some small bits on alignment between native artifacts vs wasm return values
Comment on lines
+26
to
+27
| /// Compilation warnings. | ||
| pub warnings: Vec<SsaReport>, |
Member
There was a problem hiding this comment.
We don't need to store these on the artifact as they're not really relevant after compilation in my mind.
Comment on lines
+39
to
+40
| /// Compilation warnings. | ||
| pub warnings: Vec<SsaReport>, |
| warnings: Array<any>; | ||
| }; | ||
|
|
||
| export type CompiledProgram = { |
Member
There was a problem hiding this comment.
Can you rename these types to align with ProgramArtifact and ContractArtifact? I think ideally we should have these be consistent across JS and Rust.
This is a preexisting issue but I think this PR is a good time to make the change tbh.
| export type CompileResult = ( | ||
| | { | ||
| contract: CompiledContract; | ||
| debug: DebugArtifact; |
Member
There was a problem hiding this comment.
As we're pulling the warnings out of the artifact, we'll need to include them on the CompileResult so that they can be displayed in JS
Contributor
Author
|
Closed in favor of #3989 |
spalladino
added a commit
that referenced
this pull request
Jan 17, 2024
Changes the output of `nargo` and `noir-wasm` to generate a single artifact that includes debug information. Compiled contracts now have a `file_map` at the root of the artifact, and a `debug_symbols` within each function. For consistency, compiled programs also have `file_map` and `debug_symbols`. Debug symbols are compressed and base64-encoded, as they were by the former `noir-compiler` postprocessing. The `debug` json artifact is no longer emitted. Removes all code related to generating `yarn-project`-specific ABIs from noir compiler. Instead, `types` now exposes a `loadContractArtifact` that renames fields as needed (and use camel instead of snake case), and is required when loading a noir contract artifact. Autogenerated types run this automatically. Since we are no longer post-processing artifacts, the `noir-contracts` project shape is changed. JSON files live in the `target` folder where nargo outputs them (this is not configurable), and are loaded by the autogenerated typescript interfaces from there. As part of the refactor, moves functions for getting functions debug info out of `acir-simulator` and into `types`. **Breaking change**: This removes the need to run `codegen` for using a compiled contract. However, when creating a new contract object from aztec.js, a dev needs to call `loadContractArtifact`. **Future changes**: Type information for a compilation artifact is now spread all over the place, and duplicated in more than one place. There are types defined within rust code in Noir as `[wasm_bindgen(typescript_custom_section)]`, others defined within typescript code in the `noir_wasm` package, others in `foundation`, and others in `types`. We should unify it in a single place. Fixes #3812 Supersedes #3906 Noir subrepo has been pushed to noir-lang/noir#4035 to run the Noir CI
michaelelliot
pushed a commit
to Swoir/noir_rs
that referenced
this pull request
Feb 28, 2024
Changes the output of `nargo` and `noir-wasm` to generate a single artifact that includes debug information. Compiled contracts now have a `file_map` at the root of the artifact, and a `debug_symbols` within each function. For consistency, compiled programs also have `file_map` and `debug_symbols`. Debug symbols are compressed and base64-encoded, as they were by the former `noir-compiler` postprocessing. The `debug` json artifact is no longer emitted. Removes all code related to generating `yarn-project`-specific ABIs from noir compiler. Instead, `types` now exposes a `loadContractArtifact` that renames fields as needed (and use camel instead of snake case), and is required when loading a noir contract artifact. Autogenerated types run this automatically. Since we are no longer post-processing artifacts, the `noir-contracts` project shape is changed. JSON files live in the `target` folder where nargo outputs them (this is not configurable), and are loaded by the autogenerated typescript interfaces from there. As part of the refactor, moves functions for getting functions debug info out of `acir-simulator` and into `types`. **Breaking change**: This removes the need to run `codegen` for using a compiled contract. However, when creating a new contract object from aztec.js, a dev needs to call `loadContractArtifact`. **Future changes**: Type information for a compilation artifact is now spread all over the place, and duplicated in more than one place. There are types defined within rust code in Noir as `[wasm_bindgen(typescript_custom_section)]`, others defined within typescript code in the `noir_wasm` package, others in `foundation`, and others in `types`. We should unify it in a single place. Fixes AztecProtocol#3812 Supersedes AztecProtocol#3906 Noir subrepo has been pushed to noir-lang/noir#4035 to run the Noir CI
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.
Work in progress
Fixes #3812