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: add noirc_abi_wasm crate for ABI encoding in JS #1945

Merged
merged 49 commits into from
Sep 5, 2023
Merged

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Resolves

Summary*

Draft PR for tracking development of the Noir ABI encoding wasm package.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

crates/noirc_abi_wasm/README.md Show resolved Hide resolved
crates/noirc_abi_wasm/Cargo.toml Outdated Show resolved Hide resolved
crates/noirc_abi_wasm/package.json Outdated Show resolved Hide resolved
crates/noirc_abi_wasm/src/lib.rs Show resolved Hide resolved
crates/noirc_abi_wasm/src/lib.rs Show resolved Hide resolved
@TomAFrench
Copy link
Member Author

@kobyhallx I forgot to mention, I'm using this PR for developing the abi encoding package.

@kevaundray
Copy link
Contributor

@TomAFrench what is the status of this and does it have a corresponding issue?

@TomAFrench TomAFrench linked an issue Jul 25, 2023 that may be closed by this pull request
@TomAFrench
Copy link
Member Author

@kevaundray I've added an issue for this. This PR is ongoing as time allows.

* master: (75 commits)
  fix: Mutating a variable no longer mutates its copy (#2057)
  fix: Implement `.len()` in Acir-Gen (#2077)
  chore: clippy fixes (#2101)
  chore: Update `noir-source-resolver` to v1.1.3 (#1912)
  chore: Document `GeneratedAcir::more_than_eq_comparison` (#2085)
  chore: refresh ACIR test artifacts (#2091)
  feat: Add `deprecated` attribute (#2041)
  chore(ssa refactor): Implement `acir_gen` errors (#2071)
  chore: use witnesses from the generated acir in the ABI (#2095)
  fix: Fix methods not mutating fields (#2087)
  chore(nargo): Use Display impl for InputValue (#1990)
  feat: Make arrays and slices polymorphic over each other (#2070)
  feat: Remove an unnecessary witness in `mul_with_witness` (#2078)
  chore: document truncate (#2082)
  fix: avoid potential panic in `two_complement` (#2081)
  chore: Cleanup integration tests (#2074)
  chore: replace `Type::TypeVariable`, `Type::PolymorphicInteger`, and … (#2065)
  chore!: Require package names in `Nargo.toml` files (#2056)
  fix: Avoid non-determinism in defunctionalization (#2069)
  chore: change 'unnecessary pub' error to a warning (#2064)
  ...
* master: (80 commits)
  fix: properly capture lvalues in closure environments (#2120) (#2257)
  fix: Optimize contracts built by `nargo info` (#2259)
  chore: impl Display for DebugType (#2258)
  chore: update `noir_wasm` build process to match `acvm_js` (#2067)
  feat: Implement traits - parser support #2094 (#2230)
  chore: Refactor DefCollector duplicate errors (#2231)
  chore: Address clippy warnings (#2246)
  feat: Support `contract` package type in `nargo info` command (#2249)
  feat: Add slice append (#2241)
  chore: Bump `async-lsp` to v0.0.5 (#2186)
  chore: Move the remaining `nargo_cli` lib funcs into `nargo` crate (#2225)
  chore: Add test for eddsa (#2237)
  chore: Split `Nargo.toml` operations into separate package (#2224)
  fix(stdlib): correct `tecurve::contains` formula (#1821)
  feat: Remove `comptime` and warn upon usage (#2178)
  fix: Remove last vestige of array of structs to struct of arrays conversion (#2217)
  fix: Add foreign impl error (#2216)
  feat(nargo)!: Replace `--contracts` flag with `contract` package type (#2204)
  feat: Optimize `x < 0` for unsigned `x` to false (#2206)
  fix: Initialize numeric generics' type to a polymorphic integer when used in an expression (#2179)
  ...
flake.nix Outdated Show resolved Hide resolved
.devcontainer.json Outdated Show resolved Hide resolved
@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
typescript 5.2.2 None +0 40.6 MB typescript-bot
@esm-bundle/chai 4.3.4 None +0 1.04 MB joeldenning
@typescript-eslint/eslint-plugin 5.62.0 eval +63 54.3 MB jameshenry
@typescript-eslint/parser 5.62.0 eval +55 51.1 MB jameshenry
eslint 8.45.0 eval, filesystem, environment +47 8.65 MB eslintbot
eslint-plugin-prettier 4.2.1 eval +51 20 MB jounqin
prettier 2.8.8 filesystem, environment +0 11.2 MB prettier-bot

@kobyhallx kobyhallx marked this pull request as ready for review September 5, 2023 12:14
Copy link
Member Author

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, some small nits

crates/noirc_abi_wasm/test/browser/abi_encode.test.ts Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
Copy link
Contributor

@kobyhallx kobyhallx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@kobyhallx kobyhallx added this pull request to the merge queue Sep 5, 2023
Merged via the queue into master with commit 669e0da Sep 5, 2023
13 of 14 checks passed
@kobyhallx kobyhallx deleted the abi-wasm branch September 5, 2023 14:12
TomAFrench added a commit that referenced this pull request Sep 5, 2023
* master:
  feat: Add support for brillig call stacks in runtime errors (#2549)
  feat: add `noirc_abi_wasm` crate for ABI encoding in JS (#1945)
  chore: move CRS files into their own directory (#2558)
@TomAFrench
Copy link
Member Author

This got merged while CI is failing and now causes failures in master: https://github.com/noir-lang/noir/actions/runs/6085386587/job/16509862802

@kobyhallx Can you fix this?

TomAFrench added a commit that referenced this pull request Sep 5, 2023
* master:
  chore: Replace hashers of hashmaps in dfg with fxhashes (#2490)
  chore: remove duplicate span from FunctionReturnType (#2546)
  feat: Add support for brillig call stacks in runtime errors (#2549)
  feat: add `noirc_abi_wasm` crate for ABI encoding in JS (#1945)
  chore: move CRS files into their own directory (#2558)
  chore: Cleanup `rebuild.sh` script (#2470)
  chore(ci): add mocked backend binary to improve `compile_success_empty` tests (#2554)
  chore: add noir-source-resolver (#2485)
  chore: fix double verify proof (#2556)
  feat: add `nargo backend ls` and `nargo backend use` command to switch between backends (#2552)
  chore(ci): bump checkout action to v4 (#2551)
  feat: Support for optional assertion messages (#2491)
  fix: allow usage of decimal string encoding for fields larger than a `i128` (#2547)
  feat(nargo): add hidden option to produce JSON output from `nargo info` (#2542)
  chore(stdlib)!: Rename `fixed_base_scalar_mul` to be more descriptive (#2488)
  chore: Document requirement for range opcode on `r_witness` in  `GeneratedAcir::euclidean_division` (#2437)
  chore!: ACVM 0.24 (#2504)
  fix(aztec_noir): generalise loop to not always inject a hasher instance (#2529)
  chore: create helper functions for writing programs and contracts to file (#2526)
@Savio-Sou
Copy link
Collaborator

Savio-Sou commented Sep 6, 2023

Is this meant to be used by Noir devs? (If yes, we probably need to doc it.)

@Savio-Sou
Copy link
Collaborator

Best to document this PR as a part of Noir.js after packaging this noirc_abi_wasm crate into Noir.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a JS package to handle ABI encoding/decoding
4 participants