-
Notifications
You must be signed in to change notification settings - Fork 171
(o1js) Native Prover with Napi - Gate Vector
#2564
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
Conversation
o1js) Native Prover with Napi - Gate Vectoro1js) Native Prover with Napi - Gate Vector
4f637b7 to
f4360a7
Compare
| const require = createRequire(import.meta.url); | ||
|
|
||
| function loadNative() { | ||
| const candidates = [ | ||
| '../../compiled/_node_bindings/plonk_napi.node', | ||
| '../../compiled/node_bindings/plonk_napi.node', | ||
| ]; | ||
| for (const path of candidates) { | ||
| try { | ||
| // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
| return require(path); | ||
| } catch (err) { | ||
| if ((err as any).code !== 'MODULE_NOT_FOUND') throw err; | ||
| } | ||
| } | ||
| throw new Error('plonk_napi.node not found in compiled bindings'); | ||
| } | ||
|
|
||
| const native: any = loadNative(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be able to do import native from '@o1js/native-${platform}-${arch}' soon (maybe once the packager is released)
I'd like to merge this so I can fix it up with the native packager as well
(`o1js`) Native Prover with Napi - Tables
(`o1js`) Native Prover with Napi - SRS
Shigoto-dev19
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cleaner, more readable and consistent with the existing conversions!
| return { | ||
| fp: { ...core.fp, ...proof.fp }, | ||
| fq: { ...core.fq, ...proof.fq }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Creates JSOO bindings for the gate-vector.
o1js side: #2564
mina side: MinaProtocol/mina#17951
proof-systems side: o1-labs/proof-systems#3341
(parent PR: #2454)
Closes #2562 #2563