Skip to content

Commit

Permalink
final fix: avoid mapping over the entire zkprogram
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Dec 17, 2024
1 parent c9c81f7 commit bf1e275
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/proof-system/recursive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function Recursive<

let methodKeys: MethodKey[] = Object.keys(methods);

let regularRecursiveProvers = mapObject(zkprogram, (prover, key) => {
let regularRecursiveProvers = mapToObject(methodKeys, (key) => {
return async function proveRecursively_(
publicInput: PublicInput,
...args: TupleToInstances<PrivateInputs[MethodKey]>
Expand All @@ -77,6 +77,9 @@ function Recursive<
let constArgs = zip(args, privateInputs[key]).map(([arg, type]) =>
Provable.toConstant(type, arg)
);

let prover = zkprogram[key];

if (hasPublicInput) {
let { proof } = await prover(constInput, ...constArgs);
return proof;
Expand Down

0 comments on commit bf1e275

Please sign in to comment.