From a6e8e9555b35d4ff155035609def0ccfcdd214b2 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Wed, 7 Jun 2023 17:06:39 +0100 Subject: [PATCH 1/3] Fixup deserialization of proof-systems JSON format --- src/bindings | 2 +- src/lib/provable-context.ts | 10 +++------- src/snarky.d.ts | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/bindings b/src/bindings index 3a2480baa4..7df774ba76 160000 --- a/src/bindings +++ b/src/bindings @@ -1 +1 @@ -Subproject commit 3a2480baa486362ea3d306168c48d31bde1f8d87 +Subproject commit 7df774ba7695d838e6eecfe88bfb60f77aada034 diff --git a/src/lib/provable-context.ts b/src/lib/provable-context.ts index 62699fa78d..e8f9d78225 100644 --- a/src/lib/provable-context.ts +++ b/src/lib/provable-context.ts @@ -1,6 +1,6 @@ import { Context } from './global-context.js'; import { Gate, JsonGate, Snarky } from '../snarky.js'; -import { bytesToBigInt } from '../bindings/crypto/bigint-helpers.js'; +import { parseHexString } from '../bindings/crypto/bigint-helpers.js'; import { prettifyStacktrace } from './errors.js'; // internal API @@ -105,12 +105,8 @@ function constraintSystem(f: () => T) { // helpers function gatesFromJson(cs: { gates: JsonGate[]; public_input_size: number }) { - let gates: Gate[] = cs.gates.map(({ typ, wires, coeffs: byteCoeffs }) => { - let coeffs = []; - for (let coefficient of byteCoeffs) { - let arr = new Uint8Array(coefficient); - coeffs.push(bytesToBigInt(arr).toString()); - } + let gates: Gate[] = cs.gates.map(({ typ, wires, coeffs: hexCoeffs }) => { + let coeffs = hexCoeffs.map(hex => parseHexString(hex).toString()); return { type: typ, wires, coeffs }; }); return { publicInputSize: cs.public_input_size, gates }; diff --git a/src/snarky.d.ts b/src/snarky.d.ts index 5b57ce985c..dda77c8a35 100644 --- a/src/snarky.d.ts +++ b/src/snarky.d.ts @@ -222,7 +222,7 @@ declare const Snarky: { type JsonGate = { typ: string; wires: { row: number; col: number }[]; - coeffs: number[][]; + coeffs: string[]; }; type JsonConstraintSystem = { gates: JsonGate[]; public_input_size: number }; From ea2b1f962107e88f17a9b1198e9408c9a8d81020 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Wed, 7 Jun 2023 22:38:16 +0100 Subject: [PATCH 2/3] Rebuild the wasm bindings --- src/bindings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings b/src/bindings index 7df774ba76..34b87c2c4f 160000 --- a/src/bindings +++ b/src/bindings @@ -1 +1 @@ -Subproject commit 7df774ba7695d838e6eecfe88bfb60f77aada034 +Subproject commit 34b87c2c4f53b00958747a96ffa1f30952a139d8 From fe3300569347e22d7be9ecc4600b6e48204a2cff Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Wed, 7 Jun 2023 22:43:52 +0100 Subject: [PATCH 3/3] Make CI run pull requests against `develop` --- .github/workflows/build-action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-action.yml b/.github/workflows/build-action.yml index 5780cfa209..04f46b1920 100644 --- a/.github/workflows/build-action.yml +++ b/.github/workflows/build-action.yml @@ -4,10 +4,12 @@ on: branches: - main - berkeley + - develop pull_request: branches: - main - berkeley + - develop workflow_dispatch: {} jobs: