Skip to content

Conversation

@querolita
Copy link
Member

@querolita querolita commented Oct 16, 2025

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

@querolita querolita force-pushed the native/napi-gatevector branch from 4f637b7 to f4360a7 Compare October 16, 2025 17:53
@querolita querolita self-assigned this Oct 20, 2025
@querolita querolita marked this pull request as ready for review October 21, 2025 16:49
@querolita querolita requested review from a team as code owners October 21, 2025 16:49
@querolita querolita requested review from Shigoto-dev19 and ymekuria and removed request for a team October 21, 2025 16:49
@querolita querolita marked this pull request as draft October 21, 2025 16:52
@querolita querolita marked this pull request as ready for review November 5, 2025 16:21
Comment on lines +6 to +24
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();
Copy link
Contributor

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

@bleepbloopsify bleepbloopsify self-requested a review November 6, 2025 01:14
Copy link
Contributor

@Shigoto-dev19 Shigoto-dev19 left a 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!

Comment on lines +88 to +90
return {
fp: { ...core.fp, ...proof.fp },
fq: { ...core.fq, ...proof.fq },
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@querolita querolita merged commit a4a8c0c into native/napi Nov 6, 2025
8 of 10 checks passed
@querolita querolita deleted the native/napi-gatevector branch November 6, 2025 10:39
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.

4 participants