Skip to content

Commit c5d1135

Browse files
committed
zkprogram: add lazy mode
1 parent ee74d2d commit c5d1135

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib/proof-system/zkprogram.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ function ZkProgram<
245245
proofsEnabled?: boolean;
246246
withRuntimeTables?: boolean;
247247
numChunks?: number;
248+
lazyMode?: boolean;
248249
}) => Promise<{
249250
verificationKey: { data: string; hash: Field };
250251
}>;
@@ -382,6 +383,7 @@ function ZkProgram<
382383
forceRecompile = false,
383384
proofsEnabled = undefined as boolean | undefined,
384385
withRuntimeTables = false,
386+
lazyMode = false,
385387
} = {}) {
386388
doProving = proofsEnabled ?? doProving;
387389

@@ -405,6 +407,7 @@ function ZkProgram<
405407
numChunks: config.numChunks,
406408
state: programState,
407409
withRuntimeTables,
410+
lazyMode,
408411
});
409412

410413
compileOutput = { provers, verify, maxProofsVerified };
@@ -712,6 +715,7 @@ async function compileProgram({
712715
numChunks,
713716
state,
714717
withRuntimeTables,
718+
lazyMode,
715719
}: {
716720
publicInputType: Provable<any>;
717721
publicOutputType: Provable<any>;
@@ -726,6 +730,7 @@ async function compileProgram({
726730
numChunks?: number;
727731
state?: ReturnType<typeof createProgramState>;
728732
withRuntimeTables?: boolean;
733+
lazyMode?: boolean;
729734
}) {
730735
await initializeBindings();
731736
if (methodIntfs.length === 0)
@@ -782,7 +787,7 @@ If you are using a SmartContract, make sure you are using the @method decorator.
782787
storable: picklesCache,
783788
overrideWrapDomain,
784789
numChunks: numChunks ?? 1,
785-
lazyMode: false,
790+
lazyMode: lazyMode ?? false,
786791
});
787792
let { getVerificationKey, provers, verify, tag } = result;
788793
CompiledTag.store(proofSystemTag, tag);

0 commit comments

Comments
 (0)