From fd7c9898ff28b40da9e25fde496c9f2ca2e3ef87 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Tue, 13 Aug 2024 10:43:53 -0300 Subject: [PATCH] Honor AVM_PROVING_PRESERVE_WORKING_DIR --- yarn-project/bb-prover/src/prover/bb_prover.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yarn-project/bb-prover/src/prover/bb_prover.ts b/yarn-project/bb-prover/src/prover/bb_prover.ts index d7275812e25..aa52c7d9f58 100644 --- a/yarn-project/bb-prover/src/prover/bb_prover.ts +++ b/yarn-project/bb-prover/src/prover/bb_prover.ts @@ -571,9 +571,10 @@ export class BBNativeRollupProver implements ServerCircuitProver { } private async createAvmProof(input: AvmCircuitInputs): Promise { - const cleanupDir: boolean = !process.env.AVM_PROVING_PRESERVE_WORKING_DIR; + const skipCleanup = + ['1', 'true'].includes(process.env.AVM_PROVING_PRESERVE_WORKING_DIR ?? '') || !!this.config.bbSkipCleanup; const operation = async (bbWorkingDirectory: string): Promise => { - if (!cleanupDir) { + if (skipCleanup) { logger.info(`Preserving working directory ${bbWorkingDirectory}`); } const provingResult = await this.generateAvmProofWithBB(input, bbWorkingDirectory); @@ -608,7 +609,7 @@ export class BBNativeRollupProver implements ServerCircuitProver { return { proof, verificationKey }; }; - return await this.runInDirectory(operation); + return await runInDirectory(this.config.bbWorkingDirectory, operation, skipCleanup); } public async getTubeProof(