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

Improve setup FFI in zokrates-js #1277

Merged
merged 2 commits into from
Feb 22, 2023
Merged

Improve setup FFI in zokrates-js #1277

merged 2 commits into from
Feb 22, 2023

Conversation

dark64
Copy link
Member

@dark64 dark64 commented Feb 8, 2023

Fixes #1276

This issue seems to be because we are serializing the setup keypair directly to JsValue. When calling JsValue::from_serde, the function will serialize the provided value to a JSON string, send the JSON string to JS, parse it into a JS object, and then return a handle to the JS object.

This is fine in most cases, but in some extreme cases with circuits that end up with a large proving key, this serialization method would fail because of a large JSON string that gets produced. This PR solves this issue with the same method we use for compilation artifacts.

@dark64 dark64 marked this pull request as ready for review February 16, 2023 11:32
@dark64 dark64 requested a review from Schaeff February 16, 2023 11:34
@Schaeff Schaeff merged commit 09bcaa8 into develop Feb 22, 2023
@Schaeff Schaeff deleted the fix-setup-ffi branch February 22, 2023 11:03
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.

Fatal JavaScript invalid size error 134324592
2 participants