@aztec/bb-prover 0.55.1 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/honk.d.ts +1 -1
- package/dest/honk.d.ts.map +1 -1
- package/dest/honk.js +5 -2
- package/dest/index.d.ts +1 -0
- package/dest/index.d.ts.map +1 -1
- package/dest/prover/bb_prover.d.ts +19 -5
- package/dest/prover/bb_prover.d.ts.map +1 -1
- package/dest/prover/bb_prover.js +50 -26
- package/dest/stats.d.ts +0 -1
- package/dest/stats.d.ts.map +1 -1
- package/dest/stats.js +7 -8
- package/dest/test/index.d.ts +1 -0
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/index.js +2 -1
- package/dest/test/test_avm.d.ts +4 -0
- package/dest/test/test_avm.d.ts.map +1 -0
- package/dest/test/test_avm.js +33 -0
- package/dest/test/test_circuit_prover.d.ts +6 -4
- package/dest/test/test_circuit_prover.d.ts.map +1 -1
- package/dest/test/test_circuit_prover.js +40 -24
- package/package.json +8 -7
- package/src/honk.ts +4 -1
- package/src/index.ts +2 -0
- package/src/prover/bb_prover.ts +86 -35
- package/src/stats.ts +6 -8
- package/src/test/index.ts +1 -0
- package/src/test/test_avm.ts +85 -0
- package/src/test/test_circuit_prover.ts +66 -30
- package/dest/mappings/mappings.d.ts +0 -13
- package/dest/mappings/mappings.d.ts.map +0 -1
- package/dest/mappings/mappings.js +0 -41
- package/src/mappings/mappings.ts +0 -67
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type AvmProofAndVerificationKey,
|
|
3
3
|
type PublicInputsAndRecursiveProof,
|
|
4
|
-
type PublicKernelNonTailRequest,
|
|
5
|
-
type PublicKernelTailRequest,
|
|
6
4
|
type ServerCircuitProver,
|
|
7
5
|
makePublicInputsAndRecursiveProof,
|
|
8
6
|
} from '@aztec/circuit-types';
|
|
@@ -22,7 +20,10 @@ import {
|
|
|
22
20
|
type PrivateKernelEmptyInputData,
|
|
23
21
|
PrivateKernelEmptyInputs,
|
|
24
22
|
type Proof,
|
|
23
|
+
type PublicKernelCircuitPrivateInputs,
|
|
25
24
|
type PublicKernelCircuitPublicInputs,
|
|
25
|
+
type PublicKernelInnerCircuitPrivateInputs,
|
|
26
|
+
type PublicKernelTailCircuitPrivateInputs,
|
|
26
27
|
RECURSIVE_PROOF_LENGTH,
|
|
27
28
|
type RecursiveProof,
|
|
28
29
|
RootParityInput,
|
|
@@ -31,6 +32,7 @@ import {
|
|
|
31
32
|
type RootRollupPublicInputs,
|
|
32
33
|
TUBE_PROOF_LENGTH,
|
|
33
34
|
type TubeInputs,
|
|
35
|
+
type VMCircuitPublicInputs,
|
|
34
36
|
VerificationKeyData,
|
|
35
37
|
makeEmptyProof,
|
|
36
38
|
makeEmptyRecursiveProof,
|
|
@@ -61,6 +63,10 @@ import {
|
|
|
61
63
|
convertSimulatedBaseRollupInputsToWitnessMap,
|
|
62
64
|
convertSimulatedBaseRollupOutputsFromWitnessMap,
|
|
63
65
|
convertSimulatedPrivateKernelEmptyOutputsFromWitnessMap,
|
|
66
|
+
convertSimulatedPublicInnerInputsToWitnessMap,
|
|
67
|
+
convertSimulatedPublicInnerOutputFromWitnessMap,
|
|
68
|
+
convertSimulatedPublicMergeInputsToWitnessMap,
|
|
69
|
+
convertSimulatedPublicMergeOutputFromWitnessMap,
|
|
64
70
|
convertSimulatedPublicTailInputsToWitnessMap,
|
|
65
71
|
convertSimulatedPublicTailOutputFromWitnessMap,
|
|
66
72
|
getVKSiblingPath,
|
|
@@ -69,8 +75,7 @@ import { type SimulationProvider, WASMSimulator, emitCircuitSimulationStats } fr
|
|
|
69
75
|
import { type TelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
70
76
|
|
|
71
77
|
import { ProverInstrumentation } from '../instrumentation.js';
|
|
72
|
-
import {
|
|
73
|
-
import { mapPublicKernelToCircuitName } from '../stats.js';
|
|
78
|
+
import { mapProtocolArtifactNameToCircuitName } from '../stats.js';
|
|
74
79
|
|
|
75
80
|
/**
|
|
76
81
|
* A class for use in testing situations (e2e, unit test, etc) and temporarily for assembling a block in the sequencer.
|
|
@@ -342,6 +347,12 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
342
347
|
);
|
|
343
348
|
}
|
|
344
349
|
|
|
350
|
+
public getBlockRootRollupFinalProof(
|
|
351
|
+
input: BlockRootRollupInputs,
|
|
352
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs>> {
|
|
353
|
+
return this.getBlockRootRollupProof(input);
|
|
354
|
+
}
|
|
355
|
+
|
|
345
356
|
/**
|
|
346
357
|
* Simulates the block merge rollup circuit from its inputs.
|
|
347
358
|
* @param input - Inputs to the circuit.
|
|
@@ -413,29 +424,53 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
413
424
|
);
|
|
414
425
|
}
|
|
415
426
|
|
|
416
|
-
@trackSpan('TestCircuitProver.
|
|
417
|
-
public async
|
|
418
|
-
|
|
419
|
-
): Promise<PublicInputsAndRecursiveProof<
|
|
427
|
+
@trackSpan('TestCircuitProver.getPublicKernelInnerProof')
|
|
428
|
+
public async getPublicKernelInnerProof(
|
|
429
|
+
inputs: PublicKernelInnerCircuitPrivateInputs,
|
|
430
|
+
): Promise<PublicInputsAndRecursiveProof<VMCircuitPublicInputs>> {
|
|
420
431
|
const timer = new Timer();
|
|
421
|
-
const kernelOps = SimulatedPublicKernelArtifactMapping[kernelRequest.type];
|
|
422
|
-
if (kernelOps === undefined) {
|
|
423
|
-
throw new Error(`Unable to prove for kernel type ${kernelRequest.type}`);
|
|
424
|
-
}
|
|
425
|
-
const witnessMap = kernelOps.convertInputs(kernelRequest.inputs);
|
|
426
432
|
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
|
|
433
|
+
const artifact = 'PublicKernelInnerArtifact';
|
|
434
|
+
const circuitName = mapProtocolArtifactNameToCircuitName(artifact);
|
|
435
|
+
|
|
436
|
+
const witnessMap = convertSimulatedPublicInnerInputsToWitnessMap(inputs);
|
|
437
|
+
const witness = await this.wasmSimulator.simulateCircuit(witnessMap, SimulatedServerCircuitArtifacts[artifact]);
|
|
438
|
+
|
|
439
|
+
const result = convertSimulatedPublicInnerOutputFromWitnessMap(witness);
|
|
440
|
+
this.instrumentation.recordDuration('simulationDuration', circuitName, timer);
|
|
441
|
+
emitCircuitSimulationStats(
|
|
442
|
+
circuitName,
|
|
443
|
+
timer.ms(),
|
|
444
|
+
inputs.toBuffer().length,
|
|
445
|
+
result.toBuffer().length,
|
|
446
|
+
this.logger,
|
|
430
447
|
);
|
|
448
|
+
await this.delay();
|
|
449
|
+
return makePublicInputsAndRecursiveProof(
|
|
450
|
+
result,
|
|
451
|
+
makeEmptyRecursiveProof(NESTED_RECURSIVE_PROOF_LENGTH),
|
|
452
|
+
ProtocolCircuitVks[artifact],
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
@trackSpan('TestCircuitProver.getPublicKernelMergeProof')
|
|
457
|
+
public async getPublicKernelMergeProof(
|
|
458
|
+
inputs: PublicKernelCircuitPrivateInputs,
|
|
459
|
+
): Promise<PublicInputsAndRecursiveProof<PublicKernelCircuitPublicInputs>> {
|
|
460
|
+
const timer = new Timer();
|
|
461
|
+
|
|
462
|
+
const artifact = 'PublicKernelMergeArtifact';
|
|
463
|
+
const circuitName = mapProtocolArtifactNameToCircuitName(artifact);
|
|
464
|
+
|
|
465
|
+
const witnessMap = convertSimulatedPublicMergeInputsToWitnessMap(inputs);
|
|
466
|
+
const witness = await this.wasmSimulator.simulateCircuit(witnessMap, SimulatedServerCircuitArtifacts[artifact]);
|
|
431
467
|
|
|
432
|
-
const result =
|
|
433
|
-
const circuitName = mapPublicKernelToCircuitName(kernelRequest.type);
|
|
468
|
+
const result = convertSimulatedPublicMergeOutputFromWitnessMap(witness);
|
|
434
469
|
this.instrumentation.recordDuration('simulationDuration', circuitName, timer);
|
|
435
470
|
emitCircuitSimulationStats(
|
|
436
471
|
circuitName,
|
|
437
472
|
timer.ms(),
|
|
438
|
-
|
|
473
|
+
inputs.toBuffer().length,
|
|
439
474
|
result.toBuffer().length,
|
|
440
475
|
this.logger,
|
|
441
476
|
);
|
|
@@ -443,28 +478,29 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
443
478
|
return makePublicInputsAndRecursiveProof(
|
|
444
479
|
result,
|
|
445
480
|
makeEmptyRecursiveProof(NESTED_RECURSIVE_PROOF_LENGTH),
|
|
446
|
-
ProtocolCircuitVks[
|
|
481
|
+
ProtocolCircuitVks[artifact],
|
|
447
482
|
);
|
|
448
483
|
}
|
|
449
484
|
|
|
450
485
|
@trackSpan('TestCircuitProver.getPublicTailProof')
|
|
451
486
|
public async getPublicTailProof(
|
|
452
|
-
|
|
487
|
+
inputs: PublicKernelTailCircuitPrivateInputs,
|
|
453
488
|
): Promise<PublicInputsAndRecursiveProof<KernelCircuitPublicInputs>> {
|
|
454
489
|
const timer = new Timer();
|
|
455
|
-
|
|
490
|
+
|
|
491
|
+
const artifact = 'PublicKernelTailArtifact';
|
|
492
|
+
const circuitName = mapProtocolArtifactNameToCircuitName(artifact);
|
|
493
|
+
|
|
494
|
+
const witnessMap = convertSimulatedPublicTailInputsToWitnessMap(inputs);
|
|
456
495
|
// use WASM here as it is faster for small circuits
|
|
457
|
-
const witness = await this.wasmSimulator.simulateCircuit(
|
|
458
|
-
witnessMap,
|
|
459
|
-
SimulatedServerCircuitArtifacts['PublicKernelTailArtifact'],
|
|
460
|
-
);
|
|
496
|
+
const witness = await this.wasmSimulator.simulateCircuit(witnessMap, SimulatedServerCircuitArtifacts[artifact]);
|
|
461
497
|
|
|
462
498
|
const result = convertSimulatedPublicTailOutputFromWitnessMap(witness);
|
|
463
|
-
this.instrumentation.recordDuration('simulationDuration',
|
|
499
|
+
this.instrumentation.recordDuration('simulationDuration', circuitName, timer);
|
|
464
500
|
emitCircuitSimulationStats(
|
|
465
|
-
|
|
501
|
+
circuitName,
|
|
466
502
|
timer.ms(),
|
|
467
|
-
|
|
503
|
+
inputs.toBuffer().length,
|
|
468
504
|
result.toBuffer().length,
|
|
469
505
|
this.logger,
|
|
470
506
|
);
|
|
@@ -472,7 +508,7 @@ export class TestCircuitProver implements ServerCircuitProver {
|
|
|
472
508
|
return makePublicInputsAndRecursiveProof(
|
|
473
509
|
result,
|
|
474
510
|
makeEmptyRecursiveProof(NESTED_RECURSIVE_PROOF_LENGTH),
|
|
475
|
-
ProtocolCircuitVks[
|
|
511
|
+
ProtocolCircuitVks[artifact],
|
|
476
512
|
);
|
|
477
513
|
}
|
|
478
514
|
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PublicKernelType } from '@aztec/circuit-types';
|
|
2
|
-
import { type PublicKernelCircuitPrivateInputs, type PublicKernelCircuitPublicInputs } from '@aztec/circuits.js';
|
|
3
|
-
import { type ServerProtocolArtifact } from '@aztec/noir-protocol-circuits-types';
|
|
4
|
-
import { type WitnessMap } from '@noir-lang/types';
|
|
5
|
-
export type PublicKernelProvingOps = {
|
|
6
|
-
artifact: ServerProtocolArtifact;
|
|
7
|
-
convertInputs: (inputs: PublicKernelCircuitPrivateInputs) => WitnessMap;
|
|
8
|
-
convertOutputs: (outputs: WitnessMap) => PublicKernelCircuitPublicInputs;
|
|
9
|
-
};
|
|
10
|
-
export type KernelTypeToArtifact = Record<PublicKernelType, PublicKernelProvingOps | undefined>;
|
|
11
|
-
export declare const SimulatedPublicKernelArtifactMapping: KernelTypeToArtifact;
|
|
12
|
-
export declare const PublicKernelArtifactMapping: KernelTypeToArtifact;
|
|
13
|
-
//# sourceMappingURL=mappings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mappings.d.ts","sourceRoot":"","sources":["../../src/mappings/mappings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,KAAK,gCAAgC,EAAE,KAAK,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACjH,OAAO,EACL,KAAK,sBAAsB,EAa5B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,aAAa,EAAE,CAAC,MAAM,EAAE,gCAAgC,KAAK,UAAU,CAAC;IACxE,cAAc,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,+BAA+B,CAAC;CAC1E,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,SAAS,CAAC,CAAC;AAEhG,eAAO,MAAM,oCAAoC,EAAE,oBAkBlD,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,oBAkBzC,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { PublicKernelType } from '@aztec/circuit-types';
|
|
2
|
-
import { convertPublicInnerInputsToWitnessMap, convertPublicInnerOutputFromWitnessMap, convertPublicSetupInputsToWitnessMap, convertPublicSetupOutputFromWitnessMap, convertPublicTeardownInputsToWitnessMap, convertPublicTeardownOutputFromWitnessMap, convertSimulatedPublicInnerInputsToWitnessMap, convertSimulatedPublicInnerOutputFromWitnessMap, convertSimulatedPublicSetupInputsToWitnessMap, convertSimulatedPublicSetupOutputFromWitnessMap, convertSimulatedPublicTeardownInputsToWitnessMap, convertSimulatedPublicTeardownOutputFromWitnessMap, } from '@aztec/noir-protocol-circuits-types';
|
|
3
|
-
export const SimulatedPublicKernelArtifactMapping = {
|
|
4
|
-
[PublicKernelType.NON_PUBLIC]: undefined,
|
|
5
|
-
[PublicKernelType.APP_LOGIC]: {
|
|
6
|
-
artifact: 'PublicKernelAppLogicArtifact',
|
|
7
|
-
convertInputs: convertSimulatedPublicInnerInputsToWitnessMap,
|
|
8
|
-
convertOutputs: convertSimulatedPublicInnerOutputFromWitnessMap,
|
|
9
|
-
},
|
|
10
|
-
[PublicKernelType.SETUP]: {
|
|
11
|
-
artifact: 'PublicKernelSetupArtifact',
|
|
12
|
-
convertInputs: convertSimulatedPublicSetupInputsToWitnessMap,
|
|
13
|
-
convertOutputs: convertSimulatedPublicSetupOutputFromWitnessMap,
|
|
14
|
-
},
|
|
15
|
-
[PublicKernelType.TEARDOWN]: {
|
|
16
|
-
artifact: 'PublicKernelTeardownArtifact',
|
|
17
|
-
convertInputs: convertSimulatedPublicTeardownInputsToWitnessMap,
|
|
18
|
-
convertOutputs: convertSimulatedPublicTeardownOutputFromWitnessMap,
|
|
19
|
-
},
|
|
20
|
-
[PublicKernelType.TAIL]: undefined,
|
|
21
|
-
};
|
|
22
|
-
export const PublicKernelArtifactMapping = {
|
|
23
|
-
[PublicKernelType.NON_PUBLIC]: undefined,
|
|
24
|
-
[PublicKernelType.APP_LOGIC]: {
|
|
25
|
-
artifact: 'PublicKernelAppLogicArtifact',
|
|
26
|
-
convertInputs: convertPublicInnerInputsToWitnessMap,
|
|
27
|
-
convertOutputs: convertPublicInnerOutputFromWitnessMap,
|
|
28
|
-
},
|
|
29
|
-
[PublicKernelType.SETUP]: {
|
|
30
|
-
artifact: 'PublicKernelSetupArtifact',
|
|
31
|
-
convertInputs: convertPublicSetupInputsToWitnessMap,
|
|
32
|
-
convertOutputs: convertPublicSetupOutputFromWitnessMap,
|
|
33
|
-
},
|
|
34
|
-
[PublicKernelType.TEARDOWN]: {
|
|
35
|
-
artifact: 'PublicKernelTeardownArtifact',
|
|
36
|
-
convertInputs: convertPublicTeardownInputsToWitnessMap,
|
|
37
|
-
convertOutputs: convertPublicTeardownOutputFromWitnessMap,
|
|
38
|
-
},
|
|
39
|
-
[PublicKernelType.TAIL]: undefined,
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFwcGluZ3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbWFwcGluZ3MvbWFwcGluZ3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFeEQsT0FBTyxFQUVMLG9DQUFvQyxFQUNwQyxzQ0FBc0MsRUFDdEMsb0NBQW9DLEVBQ3BDLHNDQUFzQyxFQUN0Qyx1Q0FBdUMsRUFDdkMseUNBQXlDLEVBQ3pDLDZDQUE2QyxFQUM3QywrQ0FBK0MsRUFDL0MsNkNBQTZDLEVBQzdDLCtDQUErQyxFQUMvQyxnREFBZ0QsRUFDaEQsa0RBQWtELEdBQ25ELE1BQU0scUNBQXFDLENBQUM7QUFZN0MsTUFBTSxDQUFDLE1BQU0sb0NBQW9DLEdBQXlCO0lBQ3hFLENBQUMsZ0JBQWdCLENBQUMsVUFBVSxDQUFDLEVBQUUsU0FBUztJQUN4QyxDQUFDLGdCQUFnQixDQUFDLFNBQVMsQ0FBQyxFQUFFO1FBQzVCLFFBQVEsRUFBRSw4QkFBOEI7UUFDeEMsYUFBYSxFQUFFLDZDQUE2QztRQUM1RCxjQUFjLEVBQUUsK0NBQStDO0tBQ2hFO0lBQ0QsQ0FBQyxnQkFBZ0IsQ0FBQyxLQUFLLENBQUMsRUFBRTtRQUN4QixRQUFRLEVBQUUsMkJBQTJCO1FBQ3JDLGFBQWEsRUFBRSw2Q0FBNkM7UUFDNUQsY0FBYyxFQUFFLCtDQUErQztLQUNoRTtJQUNELENBQUMsZ0JBQWdCLENBQUMsUUFBUSxDQUFDLEVBQUU7UUFDM0IsUUFBUSxFQUFFLDhCQUE4QjtRQUN4QyxhQUFhLEVBQUUsZ0RBQWdEO1FBQy9ELGNBQWMsRUFBRSxrREFBa0Q7S0FDbkU7SUFDRCxDQUFDLGdCQUFnQixDQUFDLElBQUksQ0FBQyxFQUFFLFNBQVM7Q0FDbkMsQ0FBQztBQUVGLE1BQU0sQ0FBQyxNQUFNLDJCQUEyQixHQUF5QjtJQUMvRCxDQUFDLGdCQUFnQixDQUFDLFVBQVUsQ0FBQyxFQUFFLFNBQVM7SUFDeEMsQ0FBQyxnQkFBZ0IsQ0FBQyxTQUFTLENBQUMsRUFBRTtRQUM1QixRQUFRLEVBQUUsOEJBQThCO1FBQ3hDLGFBQWEsRUFBRSxvQ0FBb0M7UUFDbkQsY0FBYyxFQUFFLHNDQUFzQztLQUN2RDtJQUNELENBQUMsZ0JBQWdCLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDeEIsUUFBUSxFQUFFLDJCQUEyQjtRQUNyQyxhQUFhLEVBQUUsb0NBQW9DO1FBQ25ELGNBQWMsRUFBRSxzQ0FBc0M7S0FDdkQ7SUFDRCxDQUFDLGdCQUFnQixDQUFDLFFBQVEsQ0FBQyxFQUFFO1FBQzNCLFFBQVEsRUFBRSw4QkFBOEI7UUFDeEMsYUFBYSxFQUFFLHVDQUF1QztRQUN0RCxjQUFjLEVBQUUseUNBQXlDO0tBQzFEO0lBQ0QsQ0FBQyxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsRUFBRSxTQUFTO0NBQ25DLENBQUMifQ==
|
package/src/mappings/mappings.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { PublicKernelType } from '@aztec/circuit-types';
|
|
2
|
-
import { type PublicKernelCircuitPrivateInputs, type PublicKernelCircuitPublicInputs } from '@aztec/circuits.js';
|
|
3
|
-
import {
|
|
4
|
-
type ServerProtocolArtifact,
|
|
5
|
-
convertPublicInnerInputsToWitnessMap,
|
|
6
|
-
convertPublicInnerOutputFromWitnessMap,
|
|
7
|
-
convertPublicSetupInputsToWitnessMap,
|
|
8
|
-
convertPublicSetupOutputFromWitnessMap,
|
|
9
|
-
convertPublicTeardownInputsToWitnessMap,
|
|
10
|
-
convertPublicTeardownOutputFromWitnessMap,
|
|
11
|
-
convertSimulatedPublicInnerInputsToWitnessMap,
|
|
12
|
-
convertSimulatedPublicInnerOutputFromWitnessMap,
|
|
13
|
-
convertSimulatedPublicSetupInputsToWitnessMap,
|
|
14
|
-
convertSimulatedPublicSetupOutputFromWitnessMap,
|
|
15
|
-
convertSimulatedPublicTeardownInputsToWitnessMap,
|
|
16
|
-
convertSimulatedPublicTeardownOutputFromWitnessMap,
|
|
17
|
-
} from '@aztec/noir-protocol-circuits-types';
|
|
18
|
-
|
|
19
|
-
import { type WitnessMap } from '@noir-lang/types';
|
|
20
|
-
|
|
21
|
-
export type PublicKernelProvingOps = {
|
|
22
|
-
artifact: ServerProtocolArtifact;
|
|
23
|
-
convertInputs: (inputs: PublicKernelCircuitPrivateInputs) => WitnessMap;
|
|
24
|
-
convertOutputs: (outputs: WitnessMap) => PublicKernelCircuitPublicInputs;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type KernelTypeToArtifact = Record<PublicKernelType, PublicKernelProvingOps | undefined>;
|
|
28
|
-
|
|
29
|
-
export const SimulatedPublicKernelArtifactMapping: KernelTypeToArtifact = {
|
|
30
|
-
[PublicKernelType.NON_PUBLIC]: undefined,
|
|
31
|
-
[PublicKernelType.APP_LOGIC]: {
|
|
32
|
-
artifact: 'PublicKernelAppLogicArtifact',
|
|
33
|
-
convertInputs: convertSimulatedPublicInnerInputsToWitnessMap,
|
|
34
|
-
convertOutputs: convertSimulatedPublicInnerOutputFromWitnessMap,
|
|
35
|
-
},
|
|
36
|
-
[PublicKernelType.SETUP]: {
|
|
37
|
-
artifact: 'PublicKernelSetupArtifact',
|
|
38
|
-
convertInputs: convertSimulatedPublicSetupInputsToWitnessMap,
|
|
39
|
-
convertOutputs: convertSimulatedPublicSetupOutputFromWitnessMap,
|
|
40
|
-
},
|
|
41
|
-
[PublicKernelType.TEARDOWN]: {
|
|
42
|
-
artifact: 'PublicKernelTeardownArtifact',
|
|
43
|
-
convertInputs: convertSimulatedPublicTeardownInputsToWitnessMap,
|
|
44
|
-
convertOutputs: convertSimulatedPublicTeardownOutputFromWitnessMap,
|
|
45
|
-
},
|
|
46
|
-
[PublicKernelType.TAIL]: undefined,
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const PublicKernelArtifactMapping: KernelTypeToArtifact = {
|
|
50
|
-
[PublicKernelType.NON_PUBLIC]: undefined,
|
|
51
|
-
[PublicKernelType.APP_LOGIC]: {
|
|
52
|
-
artifact: 'PublicKernelAppLogicArtifact',
|
|
53
|
-
convertInputs: convertPublicInnerInputsToWitnessMap,
|
|
54
|
-
convertOutputs: convertPublicInnerOutputFromWitnessMap,
|
|
55
|
-
},
|
|
56
|
-
[PublicKernelType.SETUP]: {
|
|
57
|
-
artifact: 'PublicKernelSetupArtifact',
|
|
58
|
-
convertInputs: convertPublicSetupInputsToWitnessMap,
|
|
59
|
-
convertOutputs: convertPublicSetupOutputFromWitnessMap,
|
|
60
|
-
},
|
|
61
|
-
[PublicKernelType.TEARDOWN]: {
|
|
62
|
-
artifact: 'PublicKernelTeardownArtifact',
|
|
63
|
-
convertInputs: convertPublicTeardownInputsToWitnessMap,
|
|
64
|
-
convertOutputs: convertPublicTeardownOutputFromWitnessMap,
|
|
65
|
-
},
|
|
66
|
-
[PublicKernelType.TAIL]: undefined,
|
|
67
|
-
};
|