Rebase Vite/Vitest tooling onto prover stack (self-contained IIFE, external bfj)#629
Open
OBrezhniev wants to merge 3 commits into
Open
Rebase Vite/Vitest tooling onto prover stack (self-contained IIFE, external bfj)#629OBrezhniev wants to merge 3 commits into
OBrezhniev wants to merge 3 commits into
Conversation
Rollup -> Vite (build:node/cli/browser/iife), Mocha -> Vitest (node-esm + browser-chromium via Playwright), flat eslint.config.js, CI workflow. Ports the tooling from feat/esm-migration onto our prover-optimization branch, keeping all of our work and behaviour: - src unchanged: groth16_prove.js (buildABCStream gather, msmBatching/msmGlv/ msmGls options, --memlog/memoryLogging), cli.js (--memlog, msm options), noble-hashes v2 imports. Only removed a redundant /* global window */. - Self-contained IIFE preserved: the Vite iife build bundles ffjavascript/ binfileutils/r1csfile (bare <script> still exposes a working window.snarkjs), unlike the source branch which externalised them as globals. Node built-ins and the wasm codegen toolchain are stubbed via resolve.alias (build-config/), reproducing the old rollup virtual stubs; snarkjs.min.js 763 -> 569 KB. - bfj/ejs kept in dependencies (external + lazily required in the CLI), so startup stays fast and JSON/Solidity exports still work. - exports keep node import/require + browser + umd (snarkjs.min.js). Validation: lint clean; 59 node tests (fullprocess/fflonk/keypar/polynomial) + 10 browser tests pass; built CLI prove+verify (OK!) with --memlog, and bfj r1cs-json export verified. Not included: the feat/esm-migration Hardhat/ethers Solidity-verifier test (test/smart_contracts.test.js) -- it needs a Solidity build toolchain and is a separate net-new capability, to be ported on its own. The unminified build/snarkjs.js is dropped (only the umd-referenced snarkjs.min.js is built).
This was referenced Jul 4, 2026
Member
Author
|
ESM-rebase set — the tooling migration re-applied on top of our optimization stack (rather than replaying the branches), so the MSM/CIOS/memory work is preserved. Review together:
Deviations from feat/esm-migration are called out in each PR body (e.g. binfileutils MAX_BUFFER_SIZE, snarkjs IIFE/bfj, mnt6753 excluded, smart_contracts test deferred). All branches keep git+https commit-ref pins; re-pin if a branch moves. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase tooling migration onto our prover stack (Vite + Vitest)
Applies the
feat/esm-migrationbuild/test tooling on top of ourfeature/memory-scopingprover-optimization work. Target:feat/esm-migration.Keeps all of our work and behaviour:
groth16_prove.js(buildABCStream witness gather,msmBatching/msmGlv/msmGlsoptions,--memlog/memoryLogging),cli.js(--memlog, msm options), noble-hashes v2 import paths. Only removeda redundant
/* global window */.ffjavascript/binfileutils/r1csfile so a bare
<script src="snarkjs.min.js">still exposes a working
window.snarkjs— this branch's iife externalisesthem as globals, which breaks that usage. Node built-ins and the wasm codegen
toolchain are stubbed via
resolve.alias(build-config/), reproducing theold rollup virtual stubs;
snarkjs.min.js763 → 569 KB.bfj/ejskept independencies(external + lazily required in the CLI)so startup stays fast and JSON/Solidity exports still work. (This branch moved
bfj to devDeps + bundled it.)
exportskeeps node import/require + browser +umd(snarkjs.min.js).Validation: lint clean; 59 node tests (fullprocess/fflonk/keypar/polynomial)
OK!)with
--memlog, and bfj r1cs-json export verified.Not included: the
test/smart_contracts.test.jsHardhat/ethers Solidity-verifiertest — it needs a Solidity build toolchain and is a net-new capability, better
ported on its own. The unminified
build/snarkjs.jsis dropped (only theumd-referenced
snarkjs.min.jsis built).