Skip to content

Rebase ESM + Vite/Vitest onto CIOS/MSM stack#76

Open
OBrezhniev wants to merge 3 commits into
feature/msm-signed-bucketsfrom
feature/esm-tooling
Open

Rebase ESM + Vite/Vitest onto CIOS/MSM stack#76
OBrezhniev wants to merge 3 commits into
feature/msm-signed-bucketsfrom
feature/esm-tooling

Conversation

@OBrezhniev

Copy link
Copy Markdown
Member

Rebase ESM migration onto our CIOS/MSM stack (ES modules + Vite/Vitest)

Applies the feat/esm-migration CJS→ESM conversion on top of our
feature/msm-signed-buckets work. Target: feat/esm-migration.

  • CJS → ESM across src/tools/tests/index.js, Rollup-less → Vite
    (build/main.cjs for the require condition), Mocha → Vitest, flat
    eslint.config.js, CI.
  • Keeps our rewritten hot files — ESM-converted in place, not replaced:
    build_f1m.js (CIOS / no-carry), build_multiexp.js (signed-digit),
    the opSub call sites in build_curve_jacobian_a0.js, the
    __reversePermutation export in build_fft.js, isKnownPrime in bigint.js
    — plus our AssemblyScript msm_batch module and its build tool.
  • index.js kept as ours (no bn128_wasm_gzip export — that file isn't built).
  • Interop verified: both require() and import() resolve
    { buildBn128, buildBls12381, buildF1m }.

Note: mnt6753 (legacy curve, unused by the iden3 stack) is excluded from
build:wasm and its Vitest run — its pedersen-table / base64 build tooling
needs a separate ESM pass (the same break exists on feat/esm-migration).

Validation: 87 tests pass; bn128/bls12381/msm_batch wasm regenerated.

CJS -> ESM across src/tools/tests/index.js (module.exports/require ->
export/import), Rollup-less build -> Vite (build/main.cjs for the require
condition), Mocha -> Vitest, flat eslint.config.js, CI workflow. Ports the
colleague's feat/esm-migration conversion, but keeps OUR rewritten hot files
(build_f1m.js CIOS/no-carry, build_multiexp.js signed-digit, the opSub call
sites in build_curve_jacobian_a0.js, build_fft reverse-permutation export,
bigint isKnownPrime) — ESM-converted in place — plus our AssemblyScript
msm_batch module and its build tool. index.js kept as ours (no broken
bn128_wasm_gzip export). Verified: CJS require() and ESM import() both resolve
{buildBn128, buildBls12381, buildF1m}; 87 tests pass; bn128/bls12381/msm_batch
wasm regenerated.

mnt6753 (legacy curve, unused by the iden3 stack) is excluded from build:wasm
and its test: its pedersen-table/base64 tooling needs a separate ESM pass.
@OBrezhniev

Copy link
Copy Markdown
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.

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.

1 participant