-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Unify ABIs between nargo and yarn-project (#3989)
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/aztec-packages#3812 Supersedes #3906 Noir subrepo has been pushed to #4035 to run the Noir CI
- Loading branch information
1 parent
0c185c2
commit 0858aa4
Showing
20 changed files
with
316 additions
and
210 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { inflate } from 'pako'; | ||
|
||
/** Decompresses and decodes the debug symbols */ | ||
export function inflateDebugSymbols(debugSymbols: string) { | ||
return JSON.parse(inflate(Buffer.from(debugSymbols, 'base64'), { to: 'string', raw: true })); | ||
} |
Oops, something went wrong.