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

chore: Perform lazy initialization inside noir_js #2951

Merged
merged 2 commits into from
Oct 3, 2023
Merged

Conversation

kobyhallx
Copy link
Contributor

@kobyhallx kobyhallx commented Oct 3, 2023

Description

Provides lazy initialization when noirProgram.init() is not called before.

Problem*

Resolves noir_js should not "require" to .init()#2952

Summary*

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.

@kevaundray
Copy link
Contributor

kevaundray commented Oct 3, 2023

@signorecello had requested to not have lazy init, so that they could init once on loading the page. What are the thoughts here?

On mobile so did not see that it just adds it to generateFinalProof -- this should also be added to Verify too

@TomAFrench
Copy link
Member

@signorecello had requested to not have lazy init, so that they could init once on loading the page. What are the thoughts here?

This doesn't need to be mutually exclusive though?

@kobyhallx
Copy link
Contributor Author

kobyhallx commented Oct 3, 2023

Exactly, as stated in related issue you can

  1. (Optionally) init upfront
  2. generateProof
  • init will lazy init if step 1 omitted
  • if step 1 performed beforehand this call to init should be no-op
  1. Verify step does not rely on encoder or acvm so does not need init.

@TomAFrench TomAFrench changed the title chore: No need to init noir_js chore: Perform lazy initialization inside noir_js Oct 3, 2023
@kobyhallx kobyhallx added this pull request to the merge queue Oct 3, 2023
Merged via the queue into master with commit 4abd328 Oct 3, 2023
28 checks passed
@kobyhallx kobyhallx deleted the kh-njs-no-init branch October 3, 2023 11:48
TomAFrench added a commit that referenced this pull request Oct 3, 2023
* master:
  fix: Improve error message when multiplying unit values (#2950)
  chore: Perform lazy initialization inside `noir_js` (#2951)
TomAFrench added a commit that referenced this pull request Oct 3, 2023
…ation-test

* tf/reorganize-integration-tests:
  fix: Improve error message when multiplying unit values (#2950)
  chore: Perform lazy initialization inside `noir_js` (#2951)
  chore: update path
TomAFrench added a commit that referenced this pull request Oct 3, 2023
* master: (53 commits)
  feat: Nargo test runtime callstacks and assert messages without string matching (#2953)
  chore: Release Noir(0.16.0) (#2908)
  chore: run smart contract verification integration tests inside hardhat (#2957)
  chore: fix publishing workflows (#2926)
  chore: restructure integration tests (#2954)
  fix: Improve error message when multiplying unit values (#2950)
  chore: Perform lazy initialization inside `noir_js` (#2951)
  chore: Make one input public in simple assertion program (#2949)
  chore: use new JS packages in integration tests (#2938)
  fix(println): Enable printing of arrays/strings >2 in fmt strings  (#2947)
  feat(ssa): Multiple slice mergers (#2753)
  fix: fix should_fail_with (#2940)
  feat: Oracle mocker for nargo test (#2928)
  chore: add linting to new packages (#2937)
  feat: Dynamic indexing of non-homogenous slices (#2883)
  chore: Fix barretenberg noir typescript wrapper (#2922)
  chore(ci): Rename Noir.js test job (#2932)
  feat!: Maintain shape of foreign call arguments (#2935)
  chore: add init method to Noir class for web (#2920)
  chore: bump `reqwest` to 0.11.20 (#2931)
  ...
Sakapoi pushed a commit to Sakapoi/noir_fork that referenced this pull request Oct 19, 2023
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.

3 participants