Skip to content

Scaffold projects with o1js 3.1 (Mesa) - #785

Open
izzetemredemir wants to merge 1 commit into
o1-labs:mainfrom
izzetemredemir:o1js-3-template
Open

izzetemredemir wants to merge 1 commit into
o1-labs:mainfrom
izzetemredemir:o1js-3-template

Conversation

@izzetemredemir

Copy link
Copy Markdown

Closes #784. Fixes #761.

Problem

New projects, examples and UI scaffolds depend on o1js ^2.*. After Mesa, the networks only accept transactions and verification keys from o1js 3.x. Details are in #784.

Changes

  • templates/project-ts/package.json, src/lib/project.js (UI scaffolds) and the CLI's package.json: o1js ^2.* → ^3.1.0.
  • package-lock.json: regenerated with npm install --package-lock-only. Only the o1js subtree changes (o1js 2.0.0 → 3.1.0 and its dependencies).
  • engines.node → >=22.19.5 in the template and the CLI, the floor o1js 3.1.0 declares. README requirement updated.
  • CI: the generated project's workflow and this repo's test-and-publish, nightly-e2e-ci-tests and pkg-pr-new-publish workflows move from Node 18/20 to 22 (unit tests, publish) and 22/24 (E2E). release.yml only runs npm version and stays on 18.
  • npm run coverage fails in boilerplate repo #761: the template's coverage script runs node --test --experimental-test-coverage like test. The unused @babel/* and ts-jest devDependencies, babel.config.cjs and the jest ESLint env are removed. If you'd rather take npm run coverage fails in boilerplate repo #761 separately, I can drop this part.
  • CHANGELOG entries under Unreleased.

mina-signer stays on ^3.0.7. The CLI only uses it for genKeys(), which doesn't depend on the network.

Tests

On o1js 3.1.0:

  • CLI: npm ci from the new lockfile, npm run build, npm run coverage. 9 suites, 247/247 on Node 22.19.0 and 24.21.0. eslint . reports no problems. prettier --check passes on the changed files. src/lib/constants.js already fails prettier --check on main, and this PR doesn't touch it.
  • zk project o1js3check --ui none: installs o1js 3.1.0. npm run build, npm test (2/2: AddZkProgram proof settled on Add), npm run coverage (2/2) and npm run lint pass.
  • zk example sudoku and zk example tictactoe, as the CI jobs run them: npm run test (2/2 each), npm run build and npm run start pass.
  • The template tests also pass on Node 18.20.8 and 20.19.2. The engines bump follows o1js's declared support range. It doesn't fix a runtime failure.

Not run locally: the Next.js/SvelteKit/Nuxt scaffolds and the Lightnet E2E suites. The Next.js scaffold aliases node_modules/o1js/dist/web/index.js, and that file is still there in 3.1.0. The smoke E2E jobs use the compatible-latest-lightnet and master-latest-lightnet images, and o1js 3 transactions need those images to run Mesa. I couldn't check that.

This PR and #782 (Release v0.23.1) both touch CHANGELOG.md and package-lock.json. Whichever lands second will need a rebase, and I'll do it on this side.

Template, UI scaffolds and the CLI depend on o1js ^3.1.0 instead of
^2.*. Raise engines.node to >=22.19.5 (o1js 3.1.0's floor) and move
the generated project's and this repository's CI to Node 22 and 24.

Make the template's coverage script use node --test
--experimental-test-coverage and drop the unused Jest/Babel leftovers
(o1-labs#761).
@dkijania

Copy link
Copy Markdown
Contributor

Hey @izzetemredemir. Thanks for this contribution. I have one big ask to split this PR as IMHO it tackles 3 different things (though bump of node can be considered as precondition to bump o1js). I would recommend introducing 3 pr:

  1. Coverage fix
  2. Bump node
  3. Bump o1js

Thanks !

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.

Template still scaffolds o1js ^2.* after Mesa npm run coverage fails in boilerplate repo

2 participants