Skip to content

Commit

Permalink
chore: enable noir private kernel circuit init (#2781)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray authored Oct 11, 2023
1 parent de628ee commit 523d96a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions yarn-project/pxe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@aztec/foundation": "workspace:^",
"@aztec/key-store": "workspace:^",
"@aztec/noir-compiler": "workspace:^",
"@aztec/noir-private-kernel": "workspace:^",
"@aztec/types": "workspace:^",
"koa": "^2.14.2",
"koa-router": "^12.0.0",
Expand Down
9 changes: 3 additions & 6 deletions yarn-project/pxe/src/kernel_prover/proof_creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import {
PrivateKernelInputsOrdering,
Proof,
makeEmptyProof,
privateKernelSimInit,
privateKernelSimInner,
privateKernelSimOrdering,
} from '@aztec/circuits.js';
import { siloCommitment } from '@aztec/circuits.js/abis';
import { Fr } from '@aztec/foundation/fields';
import { createDebugLogger } from '@aztec/foundation/log';
import { elapsed } from '@aztec/foundation/timer';
import { executeInit } from '@aztec/noir-private-kernel';

/**
* Represents the output of the proof creation process for init and inner private kernel circuit.
Expand Down Expand Up @@ -108,11 +108,8 @@ export class KernelProofCreator implements ProofCreator {
}

public async createProofInit(privateInputs: PrivateKernelInputsInit): Promise<ProofOutput> {
const wasm = await CircuitsWasm.get();
const [time, result] = await elapsed(() => privateKernelSimInit(wasm, privateInputs));
if (result instanceof CircuitError) {
throw new CircuitError(result.code, result.message);
}
const [time, result] = await elapsed(() => executeInit(privateInputs));

this.log(`Simulated private kernel init`, {
eventName: 'circuit-simulation',
circuitName: 'private-kernel-init',
Expand Down
3 changes: 3 additions & 0 deletions yarn-project/pxe/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
{
"path": "../noir-compiler"
},
{
"path": "../noir-private-kernel"
},
{
"path": "../types"
}
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ __metadata:
languageName: unknown
linkType: soft

"@aztec/noir-private-kernel@workspace:noir-private-kernel":
"@aztec/noir-private-kernel@workspace:^, @aztec/noir-private-kernel@workspace:noir-private-kernel":
version: 0.0.0-use.local
resolution: "@aztec/noir-private-kernel@workspace:noir-private-kernel"
dependencies:
Expand Down Expand Up @@ -720,6 +720,7 @@ __metadata:
"@aztec/foundation": "workspace:^"
"@aztec/key-store": "workspace:^"
"@aztec/noir-compiler": "workspace:^"
"@aztec/noir-private-kernel": "workspace:^"
"@aztec/types": "workspace:^"
"@jest/globals": ^29.5.0
"@rushstack/eslint-patch": ^1.1.4
Expand Down

0 comments on commit 523d96a

Please sign in to comment.