@aztec/pxe 0.85.0 → 0.86.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/entrypoints/client/bundle/utils.js +1 -1
- package/dest/entrypoints/client/lazy/utils.js +1 -1
- package/dest/entrypoints/server/utils.d.ts +3 -2
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +11 -7
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -1
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.js +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +18 -12
- package/dest/pxe_oracle_interface/pxe_oracle_interface.d.ts +1 -0
- package/dest/pxe_oracle_interface/pxe_oracle_interface.d.ts.map +1 -1
- package/dest/pxe_oracle_interface/pxe_oracle_interface.js +13 -3
- package/package.json +15 -18
- package/src/entrypoints/client/bundle/utils.ts +1 -1
- package/src/entrypoints/client/lazy/utils.ts +1 -1
- package/src/entrypoints/server/utils.ts +12 -10
- package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +3 -1
- package/src/private_kernel/private_kernel_execution_prover.ts +14 -6
- package/src/pxe_oracle_interface/pxe_oracle_interface.ts +14 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/wasm/bundle';
|
|
1
|
+
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/client/wasm/bundle';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import { createStore } from '@aztec/kv-store/indexeddb';
|
|
4
4
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BBWASMLazyPrivateKernelProver } from '@aztec/bb-prover/wasm/lazy';
|
|
1
|
+
import { BBWASMLazyPrivateKernelProver } from '@aztec/bb-prover/client/wasm/lazy';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import { createStore } from '@aztec/kv-store/indexeddb';
|
|
4
4
|
import { LazyProtocolContractsProvider } from '@aztec/protocol-contracts/providers/lazy';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
1
2
|
import { type SimulationProvider } from '@aztec/simulator/client';
|
|
2
3
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
4
|
import type { PXEServiceConfig } from '../../config/index.js';
|
|
@@ -10,7 +11,7 @@ import { PXEService } from '../../pxe_service/pxe_service.js';
|
|
|
10
11
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
11
12
|
* @returns A Promise that resolves to the started PXEService instance.
|
|
12
13
|
*/
|
|
13
|
-
export declare function createPXEService(aztecNode: AztecNode, config: PXEServiceConfig, useLogSuffix?: string | boolean | undefined): Promise<PXEService>;
|
|
14
|
+
export declare function createPXEService(aztecNode: AztecNode, config: PXEServiceConfig, useLogSuffix?: string | boolean | undefined, store?: AztecAsyncKVStore): Promise<PXEService>;
|
|
14
15
|
/**
|
|
15
16
|
* Create and start an PXEService instance with the given AztecNode, SimulationProvider and config.
|
|
16
17
|
*
|
|
@@ -20,5 +21,5 @@ export declare function createPXEService(aztecNode: AztecNode, config: PXEServic
|
|
|
20
21
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
21
22
|
* @returns A Promise that resolves to the started PXEService instance.
|
|
22
23
|
*/
|
|
23
|
-
export declare function createPXEServiceWithSimulationProvider(aztecNode: AztecNode, simulationProvider: SimulationProvider, config: PXEServiceConfig, useLogSuffix?: string | boolean | undefined): Promise<PXEService>;
|
|
24
|
+
export declare function createPXEServiceWithSimulationProvider(aztecNode: AztecNode, simulationProvider: SimulationProvider, config: PXEServiceConfig, useLogSuffix?: string | boolean | undefined, store?: AztecAsyncKVStore): Promise<PXEService>;
|
|
24
25
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,yBAAyB,CAAC;AAEjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAG9D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,gBAAgB,EACxB,YAAY,GAAE,MAAM,GAAG,OAAO,GAAG,SAAqB,EACtD,KAAK,CAAC,EAAE,iBAAiB,uBAK1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,sCAAsC,CAC1D,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,MAAM,EAAE,gBAAgB,EACxB,YAAY,GAAE,MAAM,GAAG,OAAO,GAAG,SAAqB,EACtD,KAAK,CAAC,EAAE,iBAAiB,uBA+B1B"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { BBNativePrivateKernelProver } from '@aztec/bb-prover';
|
|
2
|
-
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/wasm/bundle';
|
|
1
|
+
import { BBNativePrivateKernelProver } from '@aztec/bb-prover/client/native';
|
|
2
|
+
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/client/wasm/bundle';
|
|
3
3
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
6
5
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
7
6
|
import { WASMSimulator } from '@aztec/simulator/client';
|
|
8
7
|
import { SimulationProviderRecorderWrapper } from '@aztec/simulator/testing';
|
|
@@ -15,10 +14,10 @@ import { PXE_DATA_SCHEMA_VERSION } from '../../storage/index.js';
|
|
|
15
14
|
* @param config - The PXE Service Config to use
|
|
16
15
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
17
16
|
* @returns A Promise that resolves to the started PXEService instance.
|
|
18
|
-
*/ export function createPXEService(aztecNode, config, useLogSuffix = undefined) {
|
|
17
|
+
*/ export function createPXEService(aztecNode, config, useLogSuffix = undefined, store) {
|
|
19
18
|
const simulationProvider = new WASMSimulator();
|
|
20
19
|
const simulationProviderWithRecorder = new SimulationProviderRecorderWrapper(simulationProvider);
|
|
21
|
-
return createPXEServiceWithSimulationProvider(aztecNode, simulationProviderWithRecorder, config, useLogSuffix);
|
|
20
|
+
return createPXEServiceWithSimulationProvider(aztecNode, simulationProviderWithRecorder, config, useLogSuffix, store);
|
|
22
21
|
}
|
|
23
22
|
/**
|
|
24
23
|
* Create and start an PXEService instance with the given AztecNode, SimulationProvider and config.
|
|
@@ -28,7 +27,7 @@ import { PXE_DATA_SCHEMA_VERSION } from '../../storage/index.js';
|
|
|
28
27
|
* @param config - The PXE Service Config to use
|
|
29
28
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
30
29
|
* @returns A Promise that resolves to the started PXEService instance.
|
|
31
|
-
*/ export async function createPXEServiceWithSimulationProvider(aztecNode, simulationProvider, config, useLogSuffix = undefined) {
|
|
30
|
+
*/ export async function createPXEServiceWithSimulationProvider(aztecNode, simulationProvider, config, useLogSuffix = undefined, store) {
|
|
32
31
|
const logSuffix = typeof useLogSuffix === 'boolean' ? useLogSuffix ? randomBytes(3).toString('hex') : undefined : useLogSuffix;
|
|
33
32
|
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
34
33
|
const configWithContracts = {
|
|
@@ -36,7 +35,12 @@ import { PXE_DATA_SCHEMA_VERSION } from '../../storage/index.js';
|
|
|
36
35
|
l1Contracts,
|
|
37
36
|
l2BlockBatchSize: 200
|
|
38
37
|
};
|
|
39
|
-
|
|
38
|
+
if (!store) {
|
|
39
|
+
// TODO once https://github.com/AztecProtocol/aztec-packages/issues/13656 is fixed, we can remove this and always
|
|
40
|
+
// import the lmdb-v2 version
|
|
41
|
+
const { createStore } = await import('@aztec/kv-store/lmdb-v2');
|
|
42
|
+
store = await createStore('pxe_data', PXE_DATA_SCHEMA_VERSION, configWithContracts, createLogger('pxe:data:lmdb'));
|
|
43
|
+
}
|
|
40
44
|
const prover = await createProver(config, simulationProvider, logSuffix);
|
|
41
45
|
const protocolContractsProvider = new BundledProtocolContractsProvider();
|
|
42
46
|
const pxe = await PXEService.create(aztecNode, store, prover, simulationProvider, protocolContractsProvider, config, logSuffix);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_private_kernel_reset_private_inputs.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,gCAAgC,EAErC,sCAAsC,EAGtC,KAAK,2BAA2B,EAkBjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,0BAA0B,EAAiB,MAAM,kBAAkB,CAAC;AAElF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAiDvE,qBAAa,sCAAsC;IAY/C,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,2BAA2B;IACnC,OAAO,CAAC,8BAA8B;IAdxC,OAAO,CAAC,cAAc,CAAmC;IAEzD,OAAO,CAAC,aAAa,CAAC,CAA6B;IAEnD,OAAO,CAAC,mBAAmB,CAAoE;IAC/F,OAAO,CAAC,oBAAoB,CAAoE;IAChG,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,uBAAuB,CAA8D;IAC7F,OAAO,CAAC,mBAAmB,CAA+B;gBAGhD,oBAAoB,EAAE,2BAA2B,CAAC,gCAAgC,CAAC,EACnF,cAAc,EAAE,0BAA0B,EAAE,EAC5C,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,8BAA8B,EAAE,MAAM;IAahD,UAAU,IAAI,OAAO;IAwBf,KAAK,CAAC,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"build_private_kernel_reset_private_inputs.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,gCAAgC,EAErC,sCAAsC,EAGtC,KAAK,2BAA2B,EAkBjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,0BAA0B,EAAiB,MAAM,kBAAkB,CAAC;AAElF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAiDvE,qBAAa,sCAAsC;IAY/C,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,2BAA2B;IACnC,OAAO,CAAC,8BAA8B;IAdxC,OAAO,CAAC,cAAc,CAAmC;IAEzD,OAAO,CAAC,aAAa,CAAC,CAA6B;IAEnD,OAAO,CAAC,mBAAmB,CAAoE;IAC/F,OAAO,CAAC,oBAAoB,CAAoE;IAChG,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,uBAAuB,CAA8D;IAC7F,OAAO,CAAC,mBAAmB,CAA+B;gBAGhD,oBAAoB,EAAE,2BAA2B,CAAC,gCAAgC,CAAC,EACnF,cAAc,EAAE,0BAA0B,EAAE,EAC5C,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,8BAA8B,EAAE,MAAM;IAahD,UAAU,IAAI,OAAO;IAwBf,KAAK,CAAC,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAkElF,OAAO,CAAC,uBAAuB;IA2B/B,OAAO,CAAC,8BAA8B;IAoDtC,OAAO,CAAC,+BAA+B;IAoDvC,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,uBAAuB;IA6E/B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,oBAAoB;CAmB7B"}
|
|
@@ -96,7 +96,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
96
96
|
// The dimensions found must be big enough to reset all values, i.e. empty remainder.
|
|
97
97
|
const allowRemainder = isInner;
|
|
98
98
|
const dimensions = findPrivateKernelResetDimensions(this.requestedDimensions, privateKernelResetDimensionsConfig, isInner, allowRemainder);
|
|
99
|
-
const previousVkMembershipWitness = await oracle.getVkMembershipWitness(this.previousKernelOutput.verificationKey);
|
|
99
|
+
const previousVkMembershipWitness = await oracle.getVkMembershipWitness(this.previousKernelOutput.verificationKey.keyAsFields);
|
|
100
100
|
const previousKernelData = new PrivateKernelData(this.previousKernelOutput.publicInputs, this.previousKernelOutput.verificationKey, Number(previousVkMembershipWitness.leafIndex), assertLength(previousVkMembershipWitness.siblingPath, VK_TREE_HEIGHT));
|
|
101
101
|
this.reduceReadRequestStates(this.noteHashResetStates, dimensions.NOTE_HASH_PENDING_AMOUNT, dimensions.NOTE_HASH_SETTLED_AMOUNT);
|
|
102
102
|
this.reduceReadRequestStates(this.nullifierResetStates, dimensions.NULLIFIER_PENDING_AMOUNT, dimensions.NULLIFIER_SETTLED_AMOUNT);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAKL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAuD;gBAGxD,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ;IAG5B;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,sBAAsB,EACvC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAE,kCAI9C,GACA,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAKL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAuD;gBAGxD,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ;IAG5B;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,sBAAsB,EACvC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAE,kCAI9C,GACA,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC;YAwNrE,qBAAqB;CA2CpC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VK_TREE_HEIGHT } from '@aztec/constants';
|
|
2
2
|
import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -13,11 +13,11 @@ import { hashVK } from '@aztec/stdlib/hash';
|
|
|
13
13
|
import { PrivateCallData, PrivateKernelCircuitPublicInputs, PrivateKernelData, PrivateKernelInitCircuitPrivateInputs, PrivateKernelInnerCircuitPrivateInputs, PrivateKernelTailCircuitPrivateInputs, PrivateVerificationKeyHints } from '@aztec/stdlib/kernel';
|
|
14
14
|
import { ClientIvcProof } from '@aztec/stdlib/proofs';
|
|
15
15
|
import { collectNoteHashLeafIndexMap, collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
|
|
16
|
-
import { VerificationKeyAsFields } from '@aztec/stdlib/vks';
|
|
16
|
+
import { VerificationKeyAsFields, VerificationKeyData } from '@aztec/stdlib/vks';
|
|
17
17
|
import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
|
|
18
18
|
const NULL_SIMULATE_OUTPUT = {
|
|
19
19
|
publicInputs: PrivateKernelCircuitPublicInputs.empty(),
|
|
20
|
-
verificationKey:
|
|
20
|
+
verificationKey: VerificationKeyData.empty(),
|
|
21
21
|
outputWitness: new Map(),
|
|
22
22
|
bytecode: Buffer.from([])
|
|
23
23
|
};
|
|
@@ -74,7 +74,8 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
74
74
|
executionSteps.push({
|
|
75
75
|
functionName: 'private_kernel_reset',
|
|
76
76
|
bytecode: output.bytecode,
|
|
77
|
-
witness: output.outputWitness
|
|
77
|
+
witness: output.outputWitness,
|
|
78
|
+
vk: output.verificationKey.keyAsBytes
|
|
78
79
|
});
|
|
79
80
|
resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, validationRequestsSplitCounter);
|
|
80
81
|
}
|
|
@@ -87,7 +88,8 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
87
88
|
executionSteps.push({
|
|
88
89
|
functionName: functionName,
|
|
89
90
|
bytecode: currentExecution.acir,
|
|
90
|
-
witness: currentExecution.partialWitness
|
|
91
|
+
witness: currentExecution.partialWitness,
|
|
92
|
+
vk: currentExecution.vk
|
|
91
93
|
});
|
|
92
94
|
const privateCallData = await this.createPrivateCallData(currentExecution);
|
|
93
95
|
if (firstIteration) {
|
|
@@ -98,10 +100,11 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
98
100
|
executionSteps.push({
|
|
99
101
|
functionName: 'private_kernel_init',
|
|
100
102
|
bytecode: output.bytecode,
|
|
101
|
-
witness: output.outputWitness
|
|
103
|
+
witness: output.outputWitness,
|
|
104
|
+
vk: output.verificationKey.keyAsBytes
|
|
102
105
|
});
|
|
103
106
|
} else {
|
|
104
|
-
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey);
|
|
107
|
+
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey.keyAsFields);
|
|
105
108
|
const previousKernelData = new PrivateKernelData(output.publicInputs, output.verificationKey, Number(previousVkMembershipWitness.leafIndex), assertLength(previousVkMembershipWitness.siblingPath, VK_TREE_HEIGHT));
|
|
106
109
|
const proofInput = new PrivateKernelInnerCircuitPrivateInputs(previousKernelData, privateCallData);
|
|
107
110
|
pushTestData('private-kernel-inputs-inner', proofInput);
|
|
@@ -109,7 +112,8 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
109
112
|
executionSteps.push({
|
|
110
113
|
functionName: 'private_kernel_inner',
|
|
111
114
|
bytecode: output.bytecode,
|
|
112
|
-
witness: output.outputWitness
|
|
115
|
+
witness: output.outputWitness,
|
|
116
|
+
vk: output.verificationKey.keyAsBytes
|
|
113
117
|
});
|
|
114
118
|
}
|
|
115
119
|
firstIteration = false;
|
|
@@ -122,7 +126,8 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
122
126
|
executionSteps.push({
|
|
123
127
|
functionName: 'private_kernel_reset',
|
|
124
128
|
bytecode: output.bytecode,
|
|
125
|
-
witness: output.outputWitness
|
|
129
|
+
witness: output.outputWitness,
|
|
130
|
+
vk: output.verificationKey.keyAsBytes
|
|
126
131
|
});
|
|
127
132
|
resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, validationRequestsSplitCounter);
|
|
128
133
|
}
|
|
@@ -133,7 +138,7 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
133
138
|
output.publicInputs.feePayer = new AztecAddress(Fr.MAX_FIELD_VALUE);
|
|
134
139
|
}
|
|
135
140
|
// Private tail.
|
|
136
|
-
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey);
|
|
141
|
+
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey.keyAsFields);
|
|
137
142
|
const previousKernelData = new PrivateKernelData(output.publicInputs, output.verificationKey, Number(previousVkMembershipWitness.leafIndex), assertLength(previousVkMembershipWitness.siblingPath, VK_TREE_HEIGHT));
|
|
138
143
|
this.log.debug(`Calling private kernel tail with hwm ${previousKernelData.publicInputs.minRevertibleSideEffectCounter}`);
|
|
139
144
|
const privateInputs = new PrivateKernelTailCircuitPrivateInputs(previousKernelData);
|
|
@@ -142,7 +147,8 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
142
147
|
executionSteps.push({
|
|
143
148
|
functionName: 'private_kernel_tail',
|
|
144
149
|
bytecode: tailOutput.bytecode,
|
|
145
|
-
witness: tailOutput.outputWitness
|
|
150
|
+
witness: tailOutput.outputWitness,
|
|
151
|
+
vk: tailOutput.verificationKey.keyAsBytes
|
|
146
152
|
});
|
|
147
153
|
if (profileMode == 'gates' || profileMode == 'full') {
|
|
148
154
|
for (const entry of executionSteps){
|
|
@@ -171,7 +177,7 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
171
177
|
publicInputs: tailOutput.publicInputs,
|
|
172
178
|
executionSteps,
|
|
173
179
|
clientIvcProof,
|
|
174
|
-
|
|
180
|
+
vk: tailOutput.verificationKey.keyAsBytes
|
|
175
181
|
};
|
|
176
182
|
}
|
|
177
183
|
async createPrivateCallData({ publicInputs, vk: vkAsBuffer }) {
|
|
@@ -143,4 +143,5 @@ export declare class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
143
143
|
getSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
|
|
144
144
|
storePrivateEventLog(contractAddress: AztecAddress, recipient: AztecAddress, eventSelector: EventSelector, msgContent: Fr[], txHash: TxHash, logIndexInTx: number, txIndexInBlock: number): Promise<void>;
|
|
145
145
|
}
|
|
146
|
+
export declare function trimTrailingZeros(array: Fr[]): Fr[];
|
|
146
147
|
//# sourceMappingURL=pxe_oracle_interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_oracle_interface.d.ts","sourceRoot":"","sources":["../../src/pxe_oracle_interface/pxe_oracle_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EACL,aAAa,EACb,KAAK,gCAAgC,EACrC,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAW,OAAO,EAAiB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EACL,oBAAoB,EACpB,aAAa,EAId,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACvG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM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AAS,EAAE,EAAE,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,IAAI,CAAC;IA6EH,WAAW,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAiCnD,oBAAoB,CAAC,eAAe,EAAE,YAAY;IA2C/D,YAAY,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAInF,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAI1E,aAAa,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrE,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjG,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAUpE,oBAAoB,CACxB,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,YAAY,EACvB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,EAAE,EAAE,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC;CAuBjB;AAGD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CASnD"}
|
|
@@ -519,10 +519,9 @@ import { WINDOW_HALF_SIZE, getIndexedTaggingSecretsForTheWindow, getInitialIndex
|
|
|
519
519
|
throw new Error(`Unexpected: failed to retrieve tx effects for tx ${scopedLog.txHash} which is known to exist`);
|
|
520
520
|
}
|
|
521
521
|
// Public logs always take up all available fields by padding with zeroes, and the length of the originally emitted
|
|
522
|
-
// log is lost. Until this is improved, we simply remove all of the zero elements
|
|
523
|
-
// end).
|
|
522
|
+
// log is lost. Until this is improved, we simply remove all of the zero elements we find at the end.
|
|
524
523
|
// TODO(#11636): use the actual log length.
|
|
525
|
-
const trimmedLog = scopedLog.log.toFields()
|
|
524
|
+
const trimmedLog = trimTrailingZeros(scopedLog.log.toFields());
|
|
526
525
|
return new LogWithTxData(trimmedLog, scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
|
|
527
526
|
}
|
|
528
527
|
async removeNullifiedNotes(contractAddress) {
|
|
@@ -596,3 +595,14 @@ import { WINDOW_HALF_SIZE, getIndexedTaggingSecretsForTheWindow, getInitialIndex
|
|
|
596
595
|
return this.privateEventDataProvider.storePrivateEventLog(contractAddress, recipient, eventSelector, msgContent, txHash, logIndexInTx, txIndexInBlock, blockNumber);
|
|
597
596
|
}
|
|
598
597
|
}
|
|
598
|
+
// TODO(#11636): remove once we have the actual log length and we don't need to trim it anymore
|
|
599
|
+
export function trimTrailingZeros(array) {
|
|
600
|
+
// Make a copy to avoid modifying the original one
|
|
601
|
+
const toReturn = [
|
|
602
|
+
...array
|
|
603
|
+
];
|
|
604
|
+
while(toReturn.length > 0 && toReturn[toReturn.length - 1].isZero()){
|
|
605
|
+
toReturn.pop();
|
|
606
|
+
}
|
|
607
|
+
return toReturn;
|
|
608
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/entrypoints/server/index.js",
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
"build": "yarn clean && yarn generate && tsc -b",
|
|
15
15
|
"build:dev": "tsc -b --watch",
|
|
16
16
|
"clean": "rm -rf ./dest .tsbuildinfo ./src/config/package_info.ts",
|
|
17
|
-
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
18
|
-
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
19
17
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
|
|
20
18
|
"start": "LOG_LEVEL=${LOG_LEVEL:-debug} && node ./dest/bin/index.js",
|
|
21
19
|
"generate": "node ./scripts/generate_package_info.js"
|
|
@@ -59,20 +57,19 @@
|
|
|
59
57
|
]
|
|
60
58
|
},
|
|
61
59
|
"dependencies": {
|
|
62
|
-
"@aztec/bb-prover": "0.
|
|
63
|
-
"@aztec/bb.js": "0.
|
|
64
|
-
"@aztec/builder": "0.
|
|
65
|
-
"@aztec/constants": "0.
|
|
66
|
-
"@aztec/ethereum": "0.
|
|
67
|
-
"@aztec/foundation": "0.
|
|
68
|
-
"@aztec/key-store": "0.
|
|
69
|
-
"@aztec/kv-store": "0.
|
|
70
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
71
|
-
"@aztec/noir-types": "0.
|
|
72
|
-
"@aztec/protocol-contracts": "0.
|
|
73
|
-
"@aztec/simulator": "0.
|
|
74
|
-
"@aztec/stdlib": "0.
|
|
75
|
-
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
60
|
+
"@aztec/bb-prover": "0.86.0",
|
|
61
|
+
"@aztec/bb.js": "0.86.0",
|
|
62
|
+
"@aztec/builder": "0.86.0",
|
|
63
|
+
"@aztec/constants": "0.86.0",
|
|
64
|
+
"@aztec/ethereum": "0.86.0",
|
|
65
|
+
"@aztec/foundation": "0.86.0",
|
|
66
|
+
"@aztec/key-store": "0.86.0",
|
|
67
|
+
"@aztec/kv-store": "0.86.0",
|
|
68
|
+
"@aztec/noir-protocol-circuits-types": "0.86.0",
|
|
69
|
+
"@aztec/noir-types": "0.86.0",
|
|
70
|
+
"@aztec/protocol-contracts": "0.86.0",
|
|
71
|
+
"@aztec/simulator": "0.86.0",
|
|
72
|
+
"@aztec/stdlib": "0.86.0",
|
|
76
73
|
"koa": "^2.16.1",
|
|
77
74
|
"koa-router": "^12.0.0",
|
|
78
75
|
"lodash.omit": "^4.5.0",
|
|
@@ -81,7 +78,7 @@
|
|
|
81
78
|
"viem": "2.23.7"
|
|
82
79
|
},
|
|
83
80
|
"devDependencies": {
|
|
84
|
-
"@aztec/noir-contracts.js": "0.
|
|
81
|
+
"@aztec/noir-contracts.js": "0.86.0",
|
|
85
82
|
"@jest/globals": "^29.5.0",
|
|
86
83
|
"@types/jest": "^29.5.0",
|
|
87
84
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/wasm/bundle';
|
|
1
|
+
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/client/wasm/bundle';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import { createStore } from '@aztec/kv-store/indexeddb';
|
|
4
4
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BBWASMLazyPrivateKernelProver } from '@aztec/bb-prover/wasm/lazy';
|
|
1
|
+
import { BBWASMLazyPrivateKernelProver } from '@aztec/bb-prover/client/wasm/lazy';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import { createStore } from '@aztec/kv-store/indexeddb';
|
|
4
4
|
import { LazyProtocolContractsProvider } from '@aztec/protocol-contracts/providers/lazy';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BBNativePrivateKernelProver } from '@aztec/bb-prover';
|
|
2
|
-
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/wasm/bundle';
|
|
1
|
+
import { BBNativePrivateKernelProver } from '@aztec/bb-prover/client/native';
|
|
2
|
+
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/client/wasm/bundle';
|
|
3
3
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import {
|
|
5
|
+
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
6
6
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
7
7
|
import { type SimulationProvider, WASMSimulator } from '@aztec/simulator/client';
|
|
8
8
|
import { SimulationProviderRecorderWrapper } from '@aztec/simulator/testing';
|
|
@@ -24,10 +24,11 @@ export function createPXEService(
|
|
|
24
24
|
aztecNode: AztecNode,
|
|
25
25
|
config: PXEServiceConfig,
|
|
26
26
|
useLogSuffix: string | boolean | undefined = undefined,
|
|
27
|
+
store?: AztecAsyncKVStore,
|
|
27
28
|
) {
|
|
28
29
|
const simulationProvider = new WASMSimulator();
|
|
29
30
|
const simulationProviderWithRecorder = new SimulationProviderRecorderWrapper(simulationProvider);
|
|
30
|
-
return createPXEServiceWithSimulationProvider(aztecNode, simulationProviderWithRecorder, config, useLogSuffix);
|
|
31
|
+
return createPXEServiceWithSimulationProvider(aztecNode, simulationProviderWithRecorder, config, useLogSuffix, store);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -44,6 +45,7 @@ export async function createPXEServiceWithSimulationProvider(
|
|
|
44
45
|
simulationProvider: SimulationProvider,
|
|
45
46
|
config: PXEServiceConfig,
|
|
46
47
|
useLogSuffix: string | boolean | undefined = undefined,
|
|
48
|
+
store?: AztecAsyncKVStore,
|
|
47
49
|
) {
|
|
48
50
|
const logSuffix =
|
|
49
51
|
typeof useLogSuffix === 'boolean' ? (useLogSuffix ? randomBytes(3).toString('hex') : undefined) : useLogSuffix;
|
|
@@ -55,12 +57,12 @@ export async function createPXEServiceWithSimulationProvider(
|
|
|
55
57
|
l2BlockBatchSize: 200,
|
|
56
58
|
} as PXEServiceConfig;
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
createLogger('pxe:data:lmdb')
|
|
63
|
-
|
|
60
|
+
if (!store) {
|
|
61
|
+
// TODO once https://github.com/AztecProtocol/aztec-packages/issues/13656 is fixed, we can remove this and always
|
|
62
|
+
// import the lmdb-v2 version
|
|
63
|
+
const { createStore } = await import('@aztec/kv-store/lmdb-v2');
|
|
64
|
+
store = await createStore('pxe_data', PXE_DATA_SCHEMA_VERSION, configWithContracts, createLogger('pxe:data:lmdb'));
|
|
65
|
+
}
|
|
64
66
|
|
|
65
67
|
const prover = await createProver(config, simulationProvider, logSuffix);
|
|
66
68
|
const protocolContractsProvider = new BundledProtocolContractsProvider();
|
|
@@ -163,7 +163,9 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
163
163
|
allowRemainder,
|
|
164
164
|
);
|
|
165
165
|
|
|
166
|
-
const previousVkMembershipWitness = await oracle.getVkMembershipWitness(
|
|
166
|
+
const previousVkMembershipWitness = await oracle.getVkMembershipWitness(
|
|
167
|
+
this.previousKernelOutput.verificationKey.keyAsFields,
|
|
168
|
+
);
|
|
167
169
|
const previousKernelData = new PrivateKernelData(
|
|
168
170
|
this.previousKernelOutput.publicInputs,
|
|
169
171
|
this.previousKernelOutput.verificationKey,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VK_TREE_HEIGHT } from '@aztec/constants';
|
|
2
2
|
import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -33,14 +33,14 @@ import {
|
|
|
33
33
|
collectNoteHashNullifierCounterMap,
|
|
34
34
|
getFinalMinRevertibleSideEffectCounter,
|
|
35
35
|
} from '@aztec/stdlib/tx';
|
|
36
|
-
import { VerificationKeyAsFields } from '@aztec/stdlib/vks';
|
|
36
|
+
import { VerificationKeyAsFields, VerificationKeyData } from '@aztec/stdlib/vks';
|
|
37
37
|
|
|
38
38
|
import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
|
|
39
39
|
import type { PrivateKernelOracle } from './private_kernel_oracle.js';
|
|
40
40
|
|
|
41
41
|
const NULL_SIMULATE_OUTPUT: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs> = {
|
|
42
42
|
publicInputs: PrivateKernelCircuitPublicInputs.empty(),
|
|
43
|
-
verificationKey:
|
|
43
|
+
verificationKey: VerificationKeyData.empty(),
|
|
44
44
|
outputWitness: new Map(),
|
|
45
45
|
bytecode: Buffer.from([]),
|
|
46
46
|
};
|
|
@@ -123,6 +123,7 @@ export class PrivateKernelExecutionProver {
|
|
|
123
123
|
functionName: 'private_kernel_reset',
|
|
124
124
|
bytecode: output.bytecode,
|
|
125
125
|
witness: output.outputWitness,
|
|
126
|
+
vk: output.verificationKey.keyAsBytes,
|
|
126
127
|
});
|
|
127
128
|
resetBuilder = new PrivateKernelResetPrivateInputsBuilder(
|
|
128
129
|
output,
|
|
@@ -146,6 +147,7 @@ export class PrivateKernelExecutionProver {
|
|
|
146
147
|
functionName: functionName!,
|
|
147
148
|
bytecode: currentExecution.acir,
|
|
148
149
|
witness: currentExecution.partialWitness,
|
|
150
|
+
vk: currentExecution.vk,
|
|
149
151
|
});
|
|
150
152
|
|
|
151
153
|
const privateCallData = await this.createPrivateCallData(currentExecution);
|
|
@@ -173,9 +175,12 @@ export class PrivateKernelExecutionProver {
|
|
|
173
175
|
functionName: 'private_kernel_init',
|
|
174
176
|
bytecode: output.bytecode,
|
|
175
177
|
witness: output.outputWitness,
|
|
178
|
+
vk: output.verificationKey.keyAsBytes,
|
|
176
179
|
});
|
|
177
180
|
} else {
|
|
178
|
-
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(
|
|
181
|
+
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(
|
|
182
|
+
output.verificationKey.keyAsFields,
|
|
183
|
+
);
|
|
179
184
|
const previousKernelData = new PrivateKernelData(
|
|
180
185
|
output.publicInputs,
|
|
181
186
|
output.verificationKey,
|
|
@@ -194,6 +199,7 @@ export class PrivateKernelExecutionProver {
|
|
|
194
199
|
functionName: 'private_kernel_inner',
|
|
195
200
|
bytecode: output.bytecode,
|
|
196
201
|
witness: output.outputWitness,
|
|
202
|
+
vk: output.verificationKey.keyAsBytes,
|
|
197
203
|
});
|
|
198
204
|
}
|
|
199
205
|
firstIteration = false;
|
|
@@ -216,6 +222,7 @@ export class PrivateKernelExecutionProver {
|
|
|
216
222
|
functionName: 'private_kernel_reset',
|
|
217
223
|
bytecode: output.bytecode,
|
|
218
224
|
witness: output.outputWitness,
|
|
225
|
+
vk: output.verificationKey.keyAsBytes,
|
|
219
226
|
});
|
|
220
227
|
|
|
221
228
|
resetBuilder = new PrivateKernelResetPrivateInputsBuilder(
|
|
@@ -233,7 +240,7 @@ export class PrivateKernelExecutionProver {
|
|
|
233
240
|
output.publicInputs.feePayer = new AztecAddress(Fr.MAX_FIELD_VALUE);
|
|
234
241
|
}
|
|
235
242
|
// Private tail.
|
|
236
|
-
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey);
|
|
243
|
+
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey.keyAsFields);
|
|
237
244
|
const previousKernelData = new PrivateKernelData(
|
|
238
245
|
output.publicInputs,
|
|
239
246
|
output.verificationKey,
|
|
@@ -257,6 +264,7 @@ export class PrivateKernelExecutionProver {
|
|
|
257
264
|
functionName: 'private_kernel_tail',
|
|
258
265
|
bytecode: tailOutput.bytecode,
|
|
259
266
|
witness: tailOutput.outputWitness,
|
|
267
|
+
vk: tailOutput.verificationKey.keyAsBytes,
|
|
260
268
|
});
|
|
261
269
|
|
|
262
270
|
if (profileMode == 'gates' || profileMode == 'full') {
|
|
@@ -289,7 +297,7 @@ export class PrivateKernelExecutionProver {
|
|
|
289
297
|
publicInputs: tailOutput.publicInputs,
|
|
290
298
|
executionSteps,
|
|
291
299
|
clientIvcProof,
|
|
292
|
-
|
|
300
|
+
vk: tailOutput.verificationKey.keyAsBytes,
|
|
293
301
|
};
|
|
294
302
|
}
|
|
295
303
|
|
|
@@ -725,10 +725,9 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
725
725
|
}
|
|
726
726
|
|
|
727
727
|
// Public logs always take up all available fields by padding with zeroes, and the length of the originally emitted
|
|
728
|
-
// log is lost. Until this is improved, we simply remove all of the zero elements
|
|
729
|
-
// end).
|
|
728
|
+
// log is lost. Until this is improved, we simply remove all of the zero elements we find at the end.
|
|
730
729
|
// TODO(#11636): use the actual log length.
|
|
731
|
-
const trimmedLog = scopedLog.log.toFields()
|
|
730
|
+
const trimmedLog = trimTrailingZeros(scopedLog.log.toFields());
|
|
732
731
|
|
|
733
732
|
return new LogWithTxData(trimmedLog, scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
|
|
734
733
|
}
|
|
@@ -834,3 +833,15 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
834
833
|
);
|
|
835
834
|
}
|
|
836
835
|
}
|
|
836
|
+
|
|
837
|
+
// TODO(#11636): remove once we have the actual log length and we don't need to trim it anymore
|
|
838
|
+
export function trimTrailingZeros(array: Fr[]): Fr[] {
|
|
839
|
+
// Make a copy to avoid modifying the original one
|
|
840
|
+
const toReturn = [...array];
|
|
841
|
+
|
|
842
|
+
while (toReturn.length > 0 && toReturn[toReturn.length - 1].isZero()) {
|
|
843
|
+
toReturn.pop();
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
return toReturn;
|
|
847
|
+
}
|