-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: add halo2-wasm cli #25
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for now, left some notes to add to issues / consider in the long-term.
For the short-term, the following should be mentioned in the readme:
- Need to use
-c src/examples/run.ts src/examples/circuit.ts
to use the default runner (consider just using default runner unless an override is provided` - To use default runner,
halo2-lib-js
needs to be globally installed - Global install needs to use
npm
and notpnpm
(haven't triedyarn
) npm
global install withoutsudo
: https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md- Global install of
halo2-wasm-cli
to use thehalo2-wasm
command
import { getFunctionFromTs, getRunCircuitFromTs, getUint8ArrayFromBuffer, saveBufferToFile, saveJsonToFile } from "./utils"; | ||
|
||
export const prove = async (path: string, options: { pk: string, stats: boolean, proof: string, instances:string, circuit: string }) => { | ||
const circuit = await getFunctionFromTs(path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the current way is fine, so this is just a note, but we may consider making the circuit path and circuit input path separate, so the proof runner code is .ts but the input is .json -- this is more just to make it clear you can re-run the same circuit code on multiple inputs.
We can just make it a ticket for later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added an inputs
field to mock/prove commands to optionally read inputs from a json file (if it's not provided, then just defaults to the circuit file)
cli/src/verify.ts
Outdated
import { CircuitScaffold } from "./scaffold"; | ||
import { getFunctionFromTs, getRunCircuitFromTs, getUint8ArrayFromBuffer, readJsonFromFile } from "./utils"; | ||
|
||
export const verify = async (path: string, options: { vk: string, proof: string, instances: string, circuit: string }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To verify shouldn't you only need: vkey
, instances
, proof
? There should no longer be a need for circuit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reading the vkey seems to require BaseCircuitParams
, which is instantiated in halo2-wasm
from CircuitConfig
. Currently the circuit file is responsible for exporting the circuit config (
halo2-browser/cli/src/examples/circuit.ts
Line 20 in 8737bac
export const config = { |
No description provided.