Skip to content

Commit

Permalink
log transcript in verify
Browse files Browse the repository at this point in the history
  • Loading branch information
glamperd committed Sep 9, 2024
1 parent 7045762 commit 894e9af
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/backend/src/functions/circuit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -828,12 +828,17 @@ export const verifycontribution = functionsV2.https.onCall(

const potStoragePath = getPotStorageFilePath(files.potFilename)
const firstZkeyStoragePath = getZkeyStorageFilePath(prefix, `${prefix}_${genesisZkeyIndex}.zkey`)
printLog(`pot file: ${potStoragePath}`, LogLevel.DEBUG)
printLog(`zkey file: ${firstZkeyStoragePath}`, LogLevel.DEBUG)
// Prepare temporary file paths.
// (nb. these are needed to download the necessary artifacts for verification from AWS S3).
verificationTranscriptTemporaryLocalPath = createTemporaryLocalPath(verificationTranscriptCompleteFilename)
const potTempFilePath = createTemporaryLocalPath(`${circuitId}_${participantDoc.id}.pot`)
const firstZkeyTempFilePath = createTemporaryLocalPath(`${circuitId}_${participantDoc.id}_genesis.zkey`)
const lastZkeyTempFilePath = createTemporaryLocalPath(`${circuitId}_${participantDoc.id}_last.zkey`)
printLog(`pot file: ${potTempFilePath}`, LogLevel.DEBUG)
printLog(`firstZkey file: ${firstZkeyTempFilePath}`, LogLevel.DEBUG)
printLog(`last zkey file: ${lastZkeyTempFilePath}`, LogLevel.DEBUG)

// Create and populate transcript.
const transcriptLogger = createCustomLoggerForFile(verificationTranscriptTemporaryLocalPath)
Expand All @@ -858,6 +863,17 @@ export const verifycontribution = functionsV2.https.onCall(
transcriptLogger
)

printLog(`transcript >>>>>>`, LogLevel.DEBUG)
const fs = require('fs');

fs.readFile(verificationTranscriptTemporaryLocalPath, 'utf8', (err: any, data: any) => {
if (err) {
console.error(err);
return;
}
printLog(data, LogLevel.DEBUG);
});

// Compute contribution hash.
lastZkeyBlake2bHash = await blake512FromPath(lastZkeyTempFilePath)

Expand Down

0 comments on commit 894e9af

Please sign in to comment.