Skip to content

Commit 2b83ec3

Browse files
authored
fix: limit number of threads when verifying server-side proofs (#20818)
.
1 parent 1f6a663 commit 2b83ec3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

yarn-project/bb-prover/src/bb/execute.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ type BBExecResult = {
5252
signal: string | undefined;
5353
};
5454

55+
export const DEFAULT_BB_VERIFY_CONCURRENCY = 4;
56+
5557
/**
5658
* Invokes the Barretenberg binary with the provided command and args
5759
* @param pathToBB - The path to the BB binary
@@ -398,7 +400,14 @@ export async function verifyProof(
398400
'--disable_zk',
399401
...getArgs(ultraHonkFlavor),
400402
];
401-
return await verifyProofInternal(pathToBB, `verify`, args, logger);
403+
404+
let concurrency = DEFAULT_BB_VERIFY_CONCURRENCY;
405+
406+
if (process.env.VERIFY_HARDWARE_CONCURRENCY) {
407+
concurrency = parseInt(process.env.VERIFY_HARDWARE_CONCURRENCY, 10);
408+
}
409+
410+
return await verifyProofInternal(pathToBB, `verify`, args, logger, concurrency);
402411
}
403412

404413
export async function verifyAvmProof(

0 commit comments

Comments
 (0)