Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache SRS, split js and web #55

Merged
merged 15 commits into from
Jan 18, 2024
9 changes: 3 additions & 6 deletions .github/workflows/halo2-browser-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Build halo2-wasm
working-directory: halo2-wasm
run: |
rustup toolchain install nightly-2023-08-12-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2023-08-12-x86_64-unknown-linux-gnu
cargo build --target=x86_64-unknown-linux-gnu --verbose
- name: Set all packages to local and build
working-directory: ./
run: ./scripts/toggleLocal.sh ci
- name: Build halo2-lib-js
working-directory: halo2-lib-js
run: |
Expand Down
8 changes: 4 additions & 4 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axiom-crypto/halo2-wasm-cli",
"version": "0.1.6-rc.0",
"version": "0.1.7-alpha.0",
"description": "Halo2 Javascript library",
"main": "index.js",
"scripts": {
Expand All @@ -18,13 +18,13 @@
"author": "Intrinsic Technologies",
"license": "ISC",
"dependencies": {
"@axiom-crypto/halo2-lib-js": "0.2.14-rc.0",
"@axiom-crypto/halo2-wasm": "0.2.11-rc.1",
"@axiom-crypto/halo2-lib-js": "0.3.0-rc.0",
"@axiom-crypto/halo2-wasm": "0.3.0-rc2.0",
"commander": "^11.1.0",
"typescript": "^5.2.2"
},
"devDependencies": {
"@types/jest": "^29.5.6",
"@types/node": "^20.8.9"
}
}
}
18 changes: 9 additions & 9 deletions cli/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion cli/scripts/toggleLocal.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
const fs = require('fs');
const packageJson = require('../package.json');

let ci = false;
if (process.argv[2] === "ci") {
ci = true;
}
const local = ci ? "file:" : "link:";

const main = () => {
const packageJsonCopy = { ...packageJson };
packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = 'link:../halo2-wasm/pkg';
packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = `${local}../halo2-wasm/pkg`;
fs.writeFileSync('./package.json', JSON.stringify(packageJsonCopy, null, 2));
}

Expand Down
8 changes: 4 additions & 4 deletions halo2-lib-js/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@axiom-crypto/halo2-lib-js",
"version": "0.2.14-rc.0",
"version": "0.3.0-rc2.0",
"description": "Halo2 Javascript library",
"main": "index.js",
"scripts": {
"build": "rm -rf ./dist && tsc && node ./scripts/postTsc.js && pnpm build:docs",
"build:docs": "./node_modules/.bin/dts-bundle-generator ./dist/halo2lib/functions.d.ts -o src/shared/build.d.ts && node ./scripts/convertDTs.js && rm -rf ./src/shared/build.d.ts",
"test:vk": "./tests/test_vk.sh",
"test:constant": "./tests/test_constant.sh"
"test:constant": "./tests/test_constant.sh"
},
"keywords": [
"axiom",
Expand All @@ -32,11 +32,11 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@axiom-crypto/halo2-wasm": "0.2.11-rc.1",
"@axiom-crypto/halo2-wasm": "0.2.12-alpha.0",
"ethers": "^6.8.0",
"prettier": "1.18.2"
},
"publishConfig": {
"directory": "dist"
}
}
}
8 changes: 4 additions & 4 deletions halo2-lib-js/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion halo2-lib-js/scripts/toggleLocal.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
const fs = require('fs');
const packageJson = require('../package.json');

let ci = false;
if (process.argv[2] === "ci") {
ci = true;
}
const local = ci ? "file:" : "link:";

const main = () => {
const packageJsonCopy = { ...packageJson };
packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = 'link:../halo2-wasm/pkg';
packageJsonCopy.dependencies['@axiom-crypto/halo2-wasm'] = `${local}../halo2-wasm/pkg`;
fs.writeFileSync('./package.json', JSON.stringify(packageJsonCopy, null, 2));
}

Expand Down
3 changes: 2 additions & 1 deletion halo2-lib-js/src/shared/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { RawCircuitInput, ConstantValue } from './types'
export { convertRawInput } from './utils'
export { convertRawInput } from './utils'
export { BaseCircuitScaffold } from "@axiom-crypto/halo2-wasm/shared/scaffold";
2 changes: 1 addition & 1 deletion halo2-lib-js/src/wasm/js.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "@axiom-crypto/halo2-wasm/js"
export * from "@axiom-crypto/halo2-wasm/js/"
2 changes: 1 addition & 1 deletion halo2-lib-js/src/wasm/web.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "@axiom-crypto/halo2-wasm/web"
export * from "@axiom-crypto/halo2-wasm/web/"
2 changes: 1 addition & 1 deletion halo2-repl/app/worker/halo2repl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import prettier from 'prettier/standalone';
import parserTypescript from 'prettier/parser-typescript';
import { Halo2CircuitRunner } from '@axiom-crypto/halo2-lib-js';
import { Halo2LibWasm, getHalo2LibWasm, CircuitScaffold, getKzgParams, DEFAULT_CIRCUIT_CONFIG } from '@axiom-crypto/halo2-wasm/web'
import { Halo2LibWasm, getHalo2LibWasm, CircuitScaffold, getKzgParams, DEFAULT_CIRCUIT_CONFIG } from '@axiom-crypto/halo2-wasm/web/'
import { captureConsoleOutput } from '@/utils/log';


Expand Down
4 changes: 2 additions & 2 deletions halo2-repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"lint": "next lint"
},
"dependencies": {
"@axiom-crypto/halo2-lib-js": "0.2.14-rc.0",
"@axiom-crypto/halo2-wasm": "0.2.11-rc.1",
"@axiom-crypto/halo2-lib-js": "0.3.0-rc2.0",
"@axiom-crypto/halo2-wasm": "0.3.0-rc2.0",
"@devbookhq/splitter": "^1.4.2",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
Expand Down
Loading