Skip to content

Commit

Permalink
fix: Access ptau with filename to support sizes >2gb (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated authored Jul 12, 2022
1 parent 71a2ad1 commit 2819e1b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ async function groth16({
debug?: { path: string };
wasm: Required<MemFastFile>;
r1cs: Required<MemFastFile>;
ptau: Buffer;
ptau: string;
}): Promise<ZkeyFastFile> {
const input = await getInputJson(circuit.input);

Expand Down Expand Up @@ -573,7 +573,7 @@ async function plonk({
debug?: { path: string };
wasm: Required<MemFastFile>;
r1cs: Required<MemFastFile>;
ptau: Buffer;
ptau: string;
}): Promise<ZkeyFastFile> {
const input = await getInputJson(circuit.input);

Expand Down Expand Up @@ -654,7 +654,10 @@ async function circomCompile(
);
}
}
const ptau = await fs.readFile(hre.config.circom.ptau);

if (!existsSync(hre.config.circom.ptau)) {
throw new HardhatPluginError(PLUGIN_NAME, `Could not locate ptau file: ${hre.config.circom.ptau}`);
}

const zkeys: ZkeyFastFile[] = [];
for (const circuit of hre.config.circom.circuits) {
Expand Down Expand Up @@ -686,7 +689,7 @@ async function circomCompile(
debug: debug ? { path: artifactPath } : undefined,
wasm,
r1cs,
ptau,
ptau: hre.config.circom.ptau,
// Only used by groth16
deterministic,
});
Expand Down

0 comments on commit 2819e1b

Please sign in to comment.