Skip to content

Commit

Permalink
Merge pull request #936 from o1-labs/refactor/bool
Browse files Browse the repository at this point in the history
Move Bool to JS
  • Loading branch information
mitschabaude authored Jun 12, 2023
2 parents ffad51c + ba96139 commit bff6b34
Show file tree
Hide file tree
Showing 12 changed files with 456 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/bindings
12 changes: 9 additions & 3 deletions src/examples/vk_regression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { HelloWorld } from './zkapps/hello_world/hello_world.js';
import { TokenContract, createDex } from './zkapps/dex/dex.js';
import { GroupCS } from './primitive_constraint_system.js';

// toggle this for quick iteration when debugging vk regressions
const skipVerificationKeys = false;

// usage ./run ./src/examples/vk_regression.ts --bundle --dump ./src/examples/regression_test.json
let dump = process.argv[4] === '--dump';
let jsonPath = process.argv[dump ? 5 : 4];
Expand Down Expand Up @@ -132,7 +135,10 @@ async function dumpVk(contracts: typeof ConstraintSystems) {
for await (const c of contracts) {
let data = c.analyzeMethods();
let digest = c.digest();
let { verificationKey } = await c.compile();
let verificationKey:
| { data: string; hash: { toString(): string } }
| undefined;
if (!skipVerificationKeys) ({ verificationKey } = await c.compile());
newEntries[c.name] = {
digest,
methods: Object.fromEntries(
Expand All @@ -142,8 +148,8 @@ async function dumpVk(contracts: typeof ConstraintSystems) {
])
),
verificationKey: {
data: verificationKey.data,
hash: verificationKey.hash.toString(),
data: verificationKey?.data ?? '',
hash: verificationKey?.hash.toString() ?? '0',
},
};
}
Expand Down
Loading

0 comments on commit bff6b34

Please sign in to comment.