Skip to content

Conversation

@bleepbloopsify
Copy link
Member

@bleepbloopsify bleepbloopsify commented Oct 27, 2025

reset to native/napi

adds build and package.json dependency injection for native assets

@bleepbloopsify bleepbloopsify requested a review from a team as a code owner October 27, 2025 14:42
@bleepbloopsify bleepbloopsify force-pushed the leon/native-prover-build branch from 9b18de9 to cef9291 Compare October 28, 2025 15:06
@bleepbloopsify bleepbloopsify force-pushed the leon/native-prover-build branch from cef9291 to 1769fde Compare October 28, 2025 15:09
bleepbloopsify and others added 2 commits October 30, 2025 17:20
…neration-functions

feat: proof generation functions (native prover)
Copy link
Member

@querolita querolita left a comment

Choose a reason for hiding this comment

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

Approving already, but please can you solve the question regarding work in progress / local builds? Thanks!


// Provides: caml_pasta_fq_plonk_proof_create
// Requires: plonk_wasm, tsRustConversion
var caml_pasta_fq_plonk_proof_create = function (
Copy link
Member

Choose a reason for hiding this comment

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

Okay, this is indeed a strange location for these functions... However why are you only moving this one?


rm -f "${CURRENT_DIRECTORY}/plonk_napi.node"
cp "${ARTIFACT}" "${CURRENT_DIRECTORY}/plonk_napi.node"
napi build \
Copy link
Member

Choose a reason for hiding this comment

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

how clean!

// This file gets auto-included in the generated plonk-napi types to supplement
// external pointer types.

type WasmPastaFpPlonkIndex = {};
Copy link
Member

Choose a reason for hiding this comment

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

This means every time we have any External<T> we need to include a type T = {} here? Just confirming, looks like what you shared with us during this week call.

var plonk_napi = require('./plonk_napi.node');

module.exports = plonk_napi;
var plonk_napi = require('@o1js/native-' + process.platform + '-' + process.arch)
Copy link
Member

Choose a reason for hiding this comment

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

Will this still work for local debugging / work in progress ? Say we are still working on this and the current version is not published anywhere.

@@ -0,0 +1,6 @@
{
"napi": {
"binaryName": "plonk_napi",
Copy link
Member

Choose a reason for hiding this comment

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

Actually, this is a TODO: we wanted to rename plonk-wasm into kimchi-wasm, and the same for plonk-napi to kimchi-napi. But let's do that once we have it working to avoid a renaming craziness.

try {
var native = require('@o1js/native-' + process.platform + '-' + process.arch)

function override(functionName) {
Copy link
Member

Choose a reason for hiding this comment

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

Don't we prefer a helper here to avoid repeating this pattern over and over again as we have more overrides?

var plonk_wasm = (function() {
var wasm = require('./plonk_wasm.js');

function snakeToCamel(name) {
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense to delete this already given that napi does this automatically (unlike neon did).

var plonk_wasm = globalThis.plonk_wasm;

// Provides: plonk_napi
var plonk_napi = globalThis.plonk_wasm
Copy link
Member

Choose a reason for hiding this comment

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

oh sure, in web we still will have wasm

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