@aztec/pxe 0.87.1 → 0.87.2-nightly.20250524
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/config/package_info.js +1 -1
- 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 +8 -4
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +9 -7
- package/dest/pxe_service/pxe_service.js +2 -2
- package/package.json +15 -15
- package/src/config/package_info.ts +1 -1
- package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +9 -4
- package/src/private_kernel/private_kernel_execution_prover.ts +11 -10
- package/src/pxe_service/pxe_service.ts +2 -2
|
@@ -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":"
|
|
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":"AAeA,OAAO,EAIL,KAAK,gCAAgC,EAErC,sCAAsC,EAGtC,KAAK,2BAA2B,EAkBjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,0BAA0B,EAAiB,MAAM,kBAAkB,CAAC;AAGlF,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;IAsElF,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"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PRIVATE_LOGS_PER_TX, NULLIFIER_TREE_HEIGHT
|
|
1
|
+
import { MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PRIVATE_LOGS_PER_TX, NULLIFIER_TREE_HEIGHT } from '@aztec/constants';
|
|
2
2
|
import { makeTuple } from '@aztec/foundation/array';
|
|
3
3
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
4
4
|
import { assertLength } from '@aztec/foundation/serialize';
|
|
5
5
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
6
6
|
import { privateKernelResetDimensionsConfig } from '@aztec/noir-protocol-circuits-types/client';
|
|
7
|
-
import { KeyValidationHint, PrivateKernelData, PrivateKernelResetCircuitPrivateInputs, PrivateKernelResetDimensions, PrivateKernelResetHints, ReadRequestResetStates, ReadRequestState, ScopedNoteHash, ScopedNullifier, ScopedReadRequest, TransientDataIndexHint, buildNoteHashReadRequestHintsFromResetStates, buildNullifierReadRequestHintsFromResetStates, buildTransientDataHints, countAccumulatedItems, findPrivateKernelResetDimensions, getNonEmptyItems, getNoteHashReadRequestResetStates, getNullifierReadRequestResetStates, privateKernelResetDimensionNames } from '@aztec/stdlib/kernel';
|
|
7
|
+
import { KeyValidationHint, PaddedSideEffects, PrivateKernelData, PrivateKernelResetCircuitPrivateInputs, PrivateKernelResetDimensions, PrivateKernelResetHints, ReadRequestResetStates, ReadRequestState, ScopedNoteHash, ScopedNullifier, ScopedReadRequest, TransientDataIndexHint, buildNoteHashReadRequestHintsFromResetStates, buildNullifierReadRequestHintsFromResetStates, buildTransientDataHints, countAccumulatedItems, findPrivateKernelResetDimensions, getNonEmptyItems, getNoteHashReadRequestResetStates, getNullifierReadRequestResetStates, privateKernelResetDimensionNames } from '@aztec/stdlib/kernel';
|
|
8
8
|
import { collectNested } from '@aztec/stdlib/tx';
|
|
9
|
+
import { VkData } from '@aztec/stdlib/vks';
|
|
9
10
|
function collectNestedReadRequests(executionStack, extractReadRequests) {
|
|
10
11
|
return collectNested(executionStack, (executionResult)=>{
|
|
11
12
|
const nonEmptyReadRequests = getNonEmptyItems(extractReadRequests(executionResult));
|
|
@@ -97,10 +98,13 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
97
98
|
const allowRemainder = isInner;
|
|
98
99
|
const dimensions = findPrivateKernelResetDimensions(this.requestedDimensions, privateKernelResetDimensionsConfig, isInner, allowRemainder);
|
|
99
100
|
const previousVkMembershipWitness = await oracle.getVkMembershipWitness(this.previousKernelOutput.verificationKey.keyAsFields);
|
|
100
|
-
const
|
|
101
|
+
const vkData = new VkData(this.previousKernelOutput.verificationKey, Number(previousVkMembershipWitness.leafIndex), previousVkMembershipWitness.siblingPath);
|
|
102
|
+
const previousKernelData = new PrivateKernelData(this.previousKernelOutput.publicInputs, vkData);
|
|
101
103
|
this.reduceReadRequestStates(this.noteHashResetStates, dimensions.NOTE_HASH_PENDING_AMOUNT, dimensions.NOTE_HASH_SETTLED_AMOUNT);
|
|
102
104
|
this.reduceReadRequestStates(this.nullifierResetStates, dimensions.NULLIFIER_PENDING_AMOUNT, dimensions.NULLIFIER_SETTLED_AMOUNT);
|
|
103
|
-
|
|
105
|
+
// TODO: Enable padding when we have a better idea what are the final amounts we should pad to.
|
|
106
|
+
const paddedSideEffects = PaddedSideEffects.empty();
|
|
107
|
+
return new PrivateKernelResetCircuitPrivateInputs(previousKernelData, paddedSideEffects, new PrivateKernelResetHints(await buildNoteHashReadRequestHintsFromResetStates(oracle, this.previousKernel.validationRequests.noteHashReadRequests, this.previousKernel.end.noteHashes, this.noteHashResetStates, noteHashLeafIndexMap), await buildNullifierReadRequestHintsFromResetStates({
|
|
104
108
|
getNullifierMembershipWitness: getNullifierMembershipWitnessResolver(oracle)
|
|
105
109
|
}, this.previousKernel.validationRequests.nullifierReadRequests, this.nullifierResetStates), await getMasterSecretKeysAndAppKeyGenerators(this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators, oracle), this.transientDataIndexHints, this.validationRequestsSplitCounter), dimensions);
|
|
106
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAML,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;YAsPrE,qBAAqB;CA2CpC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { VK_TREE_HEIGHT } from '@aztec/constants';
|
|
2
1
|
import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto';
|
|
3
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import { assertLength } from '@aztec/foundation/serialize';
|
|
6
4
|
import { pushTestData } from '@aztec/foundation/testing';
|
|
7
5
|
import { Timer } from '@aztec/foundation/timer';
|
|
8
6
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
@@ -10,10 +8,10 @@ import { getProtocolContractLeafAndMembershipWitness, protocolContractTreeRoot }
|
|
|
10
8
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
11
9
|
import { computeContractAddressFromInstance } from '@aztec/stdlib/contract';
|
|
12
10
|
import { hashVK } from '@aztec/stdlib/hash';
|
|
13
|
-
import { PrivateCallData, PrivateKernelCircuitPublicInputs, PrivateKernelData, PrivateKernelInitCircuitPrivateInputs, PrivateKernelInnerCircuitPrivateInputs, PrivateKernelTailCircuitPrivateInputs, PrivateVerificationKeyHints } from '@aztec/stdlib/kernel';
|
|
11
|
+
import { PaddedSideEffectAmounts, PrivateCallData, PrivateKernelCircuitPublicInputs, PrivateKernelData, PrivateKernelInitCircuitPrivateInputs, PrivateKernelInnerCircuitPrivateInputs, PrivateKernelTailCircuitPrivateInputs, PrivateVerificationKeyHints } from '@aztec/stdlib/kernel';
|
|
14
12
|
import { ClientIvcProof } from '@aztec/stdlib/proofs';
|
|
15
13
|
import { collectNoteHashLeafIndexMap, collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
|
|
16
|
-
import { VerificationKeyAsFields, VerificationKeyData } from '@aztec/stdlib/vks';
|
|
14
|
+
import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';
|
|
17
15
|
import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
|
|
18
16
|
const NULL_SIMULATE_OUTPUT = {
|
|
19
17
|
publicInputs: PrivateKernelCircuitPublicInputs.empty(),
|
|
@@ -116,7 +114,8 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
116
114
|
});
|
|
117
115
|
} else {
|
|
118
116
|
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey.keyAsFields);
|
|
119
|
-
const
|
|
117
|
+
const vkData = new VkData(output.verificationKey, Number(previousVkMembershipWitness.leafIndex), previousVkMembershipWitness.siblingPath);
|
|
118
|
+
const previousKernelData = new PrivateKernelData(output.publicInputs, vkData);
|
|
120
119
|
const proofInput = new PrivateKernelInnerCircuitPrivateInputs(previousKernelData, privateCallData);
|
|
121
120
|
pushTestData('private-kernel-inputs-inner', proofInput);
|
|
122
121
|
const witgenTimer = new Timer();
|
|
@@ -158,9 +157,12 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
158
157
|
}
|
|
159
158
|
// Private tail.
|
|
160
159
|
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey.keyAsFields);
|
|
161
|
-
const
|
|
160
|
+
const vkData = new VkData(output.verificationKey, Number(previousVkMembershipWitness.leafIndex), previousVkMembershipWitness.siblingPath);
|
|
161
|
+
const previousKernelData = new PrivateKernelData(output.publicInputs, vkData);
|
|
162
162
|
this.log.debug(`Calling private kernel tail with hwm ${previousKernelData.publicInputs.minRevertibleSideEffectCounter}`);
|
|
163
|
-
|
|
163
|
+
// TODO: Enable padding when we have a better what are the final amounts we should pad to.
|
|
164
|
+
const paddedSideEffectAmounts = PaddedSideEffectAmounts.empty();
|
|
165
|
+
const privateInputs = new PrivateKernelTailCircuitPrivateInputs(previousKernelData, paddedSideEffectAmounts);
|
|
164
166
|
pushTestData('private-kernel-inputs-ordering', privateInputs);
|
|
165
167
|
const witgenTimer = new Timer();
|
|
166
168
|
const tailOutput = generateWitnesses ? await this.proofCreator.generateTailOutput(privateInputs) : await this.proofCreator.simulateTail(privateInputs);
|
|
@@ -691,8 +691,8 @@ import { enrichPublicSimulationError, enrichSimulationError } from './error_enri
|
|
|
691
691
|
throw new Error('Recipients are required to get private events');
|
|
692
692
|
}
|
|
693
693
|
this.log.verbose(`Getting private events for ${contractAddress.toString()} from ${from} to ${from + numBlocks}`);
|
|
694
|
-
//
|
|
695
|
-
await this.simulateUtility('
|
|
694
|
+
// We need to manually trigger private state sync to have a guarantee that all the events are available.
|
|
695
|
+
await this.simulateUtility('sync_private_state', [], contractAddress);
|
|
696
696
|
const events = await this.privateEventDataProvider.getPrivateEvents(contractAddress, from, numBlocks, recipients, eventMetadataDef.eventSelector);
|
|
697
697
|
const decodedEvents = events.map((event)=>decodeFromAbi([
|
|
698
698
|
eventMetadataDef.abiType
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.2-nightly.20250524",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/entrypoints/server/index.js",
|
|
@@ -57,19 +57,19 @@
|
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@aztec/bb-prover": "0.87.
|
|
61
|
-
"@aztec/bb.js": "0.87.
|
|
62
|
-
"@aztec/builder": "0.87.
|
|
63
|
-
"@aztec/constants": "0.87.
|
|
64
|
-
"@aztec/ethereum": "0.87.
|
|
65
|
-
"@aztec/foundation": "0.87.
|
|
66
|
-
"@aztec/key-store": "0.87.
|
|
67
|
-
"@aztec/kv-store": "0.87.
|
|
68
|
-
"@aztec/noir-protocol-circuits-types": "0.87.
|
|
69
|
-
"@aztec/noir-types": "0.87.
|
|
70
|
-
"@aztec/protocol-contracts": "0.87.
|
|
71
|
-
"@aztec/simulator": "0.87.
|
|
72
|
-
"@aztec/stdlib": "0.87.
|
|
60
|
+
"@aztec/bb-prover": "0.87.2-nightly.20250524",
|
|
61
|
+
"@aztec/bb.js": "0.87.2-nightly.20250524",
|
|
62
|
+
"@aztec/builder": "0.87.2-nightly.20250524",
|
|
63
|
+
"@aztec/constants": "0.87.2-nightly.20250524",
|
|
64
|
+
"@aztec/ethereum": "0.87.2-nightly.20250524",
|
|
65
|
+
"@aztec/foundation": "0.87.2-nightly.20250524",
|
|
66
|
+
"@aztec/key-store": "0.87.2-nightly.20250524",
|
|
67
|
+
"@aztec/kv-store": "0.87.2-nightly.20250524",
|
|
68
|
+
"@aztec/noir-protocol-circuits-types": "0.87.2-nightly.20250524",
|
|
69
|
+
"@aztec/noir-types": "0.87.2-nightly.20250524",
|
|
70
|
+
"@aztec/protocol-contracts": "0.87.2-nightly.20250524",
|
|
71
|
+
"@aztec/simulator": "0.87.2-nightly.20250524",
|
|
72
|
+
"@aztec/stdlib": "0.87.2-nightly.20250524",
|
|
73
73
|
"koa": "^2.16.1",
|
|
74
74
|
"koa-router": "^12.0.0",
|
|
75
75
|
"lodash.omit": "^4.5.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"viem": "2.23.7"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@aztec/noir-test-contracts.js": "0.87.
|
|
81
|
+
"@aztec/noir-test-contracts.js": "0.87.2-nightly.20250524",
|
|
82
82
|
"@jest/globals": "^29.5.0",
|
|
83
83
|
"@types/jest": "^29.5.0",
|
|
84
84
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
MAX_NULLIFIER_READ_REQUESTS_PER_TX,
|
|
7
7
|
MAX_PRIVATE_LOGS_PER_TX,
|
|
8
8
|
NULLIFIER_TREE_HEIGHT,
|
|
9
|
-
VK_TREE_HEIGHT,
|
|
10
9
|
} from '@aztec/constants';
|
|
11
10
|
import { makeTuple } from '@aztec/foundation/array';
|
|
12
11
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
@@ -16,6 +15,7 @@ import { MembershipWitness } from '@aztec/foundation/trees';
|
|
|
16
15
|
import { privateKernelResetDimensionsConfig } from '@aztec/noir-protocol-circuits-types/client';
|
|
17
16
|
import {
|
|
18
17
|
KeyValidationHint,
|
|
18
|
+
PaddedSideEffects,
|
|
19
19
|
type PrivateCircuitPublicInputs,
|
|
20
20
|
type PrivateKernelCircuitPublicInputs,
|
|
21
21
|
PrivateKernelData,
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
privateKernelResetDimensionNames,
|
|
43
43
|
} from '@aztec/stdlib/kernel';
|
|
44
44
|
import { type PrivateCallExecutionResult, collectNested } from '@aztec/stdlib/tx';
|
|
45
|
+
import { VkData } from '@aztec/stdlib/vks';
|
|
45
46
|
|
|
46
47
|
import type { PrivateKernelOracle } from '../private_kernel_oracle.js';
|
|
47
48
|
|
|
@@ -166,12 +167,12 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
166
167
|
const previousVkMembershipWitness = await oracle.getVkMembershipWitness(
|
|
167
168
|
this.previousKernelOutput.verificationKey.keyAsFields,
|
|
168
169
|
);
|
|
169
|
-
const
|
|
170
|
-
this.previousKernelOutput.publicInputs,
|
|
170
|
+
const vkData = new VkData(
|
|
171
171
|
this.previousKernelOutput.verificationKey,
|
|
172
172
|
Number(previousVkMembershipWitness.leafIndex),
|
|
173
|
-
|
|
173
|
+
previousVkMembershipWitness.siblingPath,
|
|
174
174
|
);
|
|
175
|
+
const previousKernelData = new PrivateKernelData(this.previousKernelOutput.publicInputs, vkData);
|
|
175
176
|
|
|
176
177
|
this.reduceReadRequestStates(
|
|
177
178
|
this.noteHashResetStates,
|
|
@@ -184,8 +185,12 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
184
185
|
dimensions.NULLIFIER_SETTLED_AMOUNT,
|
|
185
186
|
);
|
|
186
187
|
|
|
188
|
+
// TODO: Enable padding when we have a better idea what are the final amounts we should pad to.
|
|
189
|
+
const paddedSideEffects = PaddedSideEffects.empty();
|
|
190
|
+
|
|
187
191
|
return new PrivateKernelResetCircuitPrivateInputs(
|
|
188
192
|
previousKernelData,
|
|
193
|
+
paddedSideEffects,
|
|
189
194
|
new PrivateKernelResetHints(
|
|
190
195
|
await buildNoteHashReadRequestHintsFromResetStates(
|
|
191
196
|
oracle,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { VK_TREE_HEIGHT } from '@aztec/constants';
|
|
2
1
|
import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto';
|
|
3
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import { assertLength } from '@aztec/foundation/serialize';
|
|
6
4
|
import { pushTestData } from '@aztec/foundation/testing';
|
|
7
5
|
import { Timer } from '@aztec/foundation/timer';
|
|
8
6
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
@@ -12,6 +10,7 @@ import { computeContractAddressFromInstance } from '@aztec/stdlib/contract';
|
|
|
12
10
|
import { hashVK } from '@aztec/stdlib/hash';
|
|
13
11
|
import type { PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
14
12
|
import {
|
|
13
|
+
PaddedSideEffectAmounts,
|
|
15
14
|
PrivateCallData,
|
|
16
15
|
type PrivateExecutionStep,
|
|
17
16
|
PrivateKernelCircuitPublicInputs,
|
|
@@ -33,7 +32,7 @@ import {
|
|
|
33
32
|
collectNoteHashNullifierCounterMap,
|
|
34
33
|
getFinalMinRevertibleSideEffectCounter,
|
|
35
34
|
} from '@aztec/stdlib/tx';
|
|
36
|
-
import { VerificationKeyAsFields, VerificationKeyData } from '@aztec/stdlib/vks';
|
|
35
|
+
import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';
|
|
37
36
|
|
|
38
37
|
import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
|
|
39
38
|
import type { PrivateKernelOracle } from './private_kernel_oracle.js';
|
|
@@ -192,12 +191,12 @@ export class PrivateKernelExecutionProver {
|
|
|
192
191
|
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(
|
|
193
192
|
output.verificationKey.keyAsFields,
|
|
194
193
|
);
|
|
195
|
-
const
|
|
196
|
-
output.publicInputs,
|
|
194
|
+
const vkData = new VkData(
|
|
197
195
|
output.verificationKey,
|
|
198
196
|
Number(previousVkMembershipWitness.leafIndex),
|
|
199
|
-
|
|
197
|
+
previousVkMembershipWitness.siblingPath,
|
|
200
198
|
);
|
|
199
|
+
const previousKernelData = new PrivateKernelData(output.publicInputs, vkData);
|
|
201
200
|
const proofInput = new PrivateKernelInnerCircuitPrivateInputs(previousKernelData, privateCallData);
|
|
202
201
|
|
|
203
202
|
pushTestData('private-kernel-inputs-inner', proofInput);
|
|
@@ -259,18 +258,20 @@ export class PrivateKernelExecutionProver {
|
|
|
259
258
|
}
|
|
260
259
|
// Private tail.
|
|
261
260
|
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey.keyAsFields);
|
|
262
|
-
const
|
|
263
|
-
output.publicInputs,
|
|
261
|
+
const vkData = new VkData(
|
|
264
262
|
output.verificationKey,
|
|
265
263
|
Number(previousVkMembershipWitness.leafIndex),
|
|
266
|
-
|
|
264
|
+
previousVkMembershipWitness.siblingPath,
|
|
267
265
|
);
|
|
266
|
+
const previousKernelData = new PrivateKernelData(output.publicInputs, vkData);
|
|
268
267
|
|
|
269
268
|
this.log.debug(
|
|
270
269
|
`Calling private kernel tail with hwm ${previousKernelData.publicInputs.minRevertibleSideEffectCounter}`,
|
|
271
270
|
);
|
|
272
271
|
|
|
273
|
-
|
|
272
|
+
// TODO: Enable padding when we have a better what are the final amounts we should pad to.
|
|
273
|
+
const paddedSideEffectAmounts = PaddedSideEffectAmounts.empty();
|
|
274
|
+
const privateInputs = new PrivateKernelTailCircuitPrivateInputs(previousKernelData, paddedSideEffectAmounts);
|
|
274
275
|
|
|
275
276
|
pushTestData('private-kernel-inputs-ordering', privateInputs);
|
|
276
277
|
|
|
@@ -1011,8 +1011,8 @@ export class PXEService implements PXE {
|
|
|
1011
1011
|
|
|
1012
1012
|
this.log.verbose(`Getting private events for ${contractAddress.toString()} from ${from} to ${from + numBlocks}`);
|
|
1013
1013
|
|
|
1014
|
-
//
|
|
1015
|
-
await this.simulateUtility('
|
|
1014
|
+
// We need to manually trigger private state sync to have a guarantee that all the events are available.
|
|
1015
|
+
await this.simulateUtility('sync_private_state', [], contractAddress);
|
|
1016
1016
|
|
|
1017
1017
|
const events = await this.privateEventDataProvider.getPrivateEvents(
|
|
1018
1018
|
contractAddress,
|