@aztec/pxe 0.87.2 → 0.87.3-nightly.20250529
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/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +9 -3
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +9 -3
- package/dest/entrypoints/{client/pxe_creation_options.d.ts → pxe_creation_options.d.ts} +4 -1
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -0
- package/dest/entrypoints/server/utils.d.ts +3 -3
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +23 -15
- 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 +30 -30
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +11 -8
- package/dest/pxe_oracle_interface/pxe_oracle_interface.d.ts +4 -4
- package/dest/pxe_oracle_interface/pxe_oracle_interface.d.ts.map +1 -1
- package/dest/pxe_oracle_interface/pxe_oracle_interface.js +26 -21
- package/dest/pxe_service/pxe_service.d.ts.map +1 -1
- package/dest/pxe_service/pxe_service.js +12 -7
- package/package.json +15 -15
- package/src/config/package_info.ts +1 -1
- package/src/entrypoints/client/bundle/utils.ts +22 -14
- package/src/entrypoints/client/lazy/utils.ts +23 -10
- package/src/entrypoints/{client/pxe_creation_options.ts → pxe_creation_options.ts} +4 -1
- package/src/entrypoints/server/utils.ts +38 -20
- package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +35 -34
- package/src/private_kernel/private_kernel_execution_prover.ts +12 -10
- package/src/pxe_oracle_interface/pxe_oracle_interface.ts +33 -21
- package/src/pxe_service/pxe_service.ts +11 -6
- package/dest/entrypoints/client/pxe_creation_options.d.ts.map +0 -1
- /package/dest/entrypoints/{client/pxe_creation_options.js → pxe_creation_options.js} +0 -0
|
@@ -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
|
|
|
@@ -74,22 +75,17 @@ function getNullifierMembershipWitnessResolver(oracle: PrivateKernelOracle) {
|
|
|
74
75
|
|
|
75
76
|
async function getMasterSecretKeysAndAppKeyGenerators(
|
|
76
77
|
keyValidationRequests: Tuple<ScopedKeyValidationRequestAndGenerator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX>,
|
|
78
|
+
numRequestsToVerify: number,
|
|
77
79
|
oracle: PrivateKernelOracle,
|
|
78
80
|
) {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
const secretKeys = await oracle.getMasterSecretKey(request.request.pkM);
|
|
86
|
-
keysHints.push(new KeyValidationHint(secretKeys, i));
|
|
87
|
-
}
|
|
88
|
-
return padArrayEnd(
|
|
89
|
-
keysHints,
|
|
90
|
-
KeyValidationHint.nada(MAX_KEY_VALIDATION_REQUESTS_PER_TX),
|
|
91
|
-
MAX_KEY_VALIDATION_REQUESTS_PER_TX,
|
|
81
|
+
const numRequests = countAccumulatedItems(keyValidationRequests);
|
|
82
|
+
const keysHints = await Promise.all(
|
|
83
|
+
keyValidationRequests.slice(0, Math.min(numRequests, numRequestsToVerify)).map(async ({ request }) => {
|
|
84
|
+
const secretKeys = await oracle.getMasterSecretKey(request.request.pkM);
|
|
85
|
+
return new KeyValidationHint(secretKeys);
|
|
86
|
+
}),
|
|
92
87
|
);
|
|
88
|
+
return padArrayEnd(keysHints, KeyValidationHint.empty(), MAX_KEY_VALIDATION_REQUESTS_PER_TX);
|
|
93
89
|
}
|
|
94
90
|
|
|
95
91
|
export class PrivateKernelResetPrivateInputsBuilder {
|
|
@@ -166,26 +162,30 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
166
162
|
const previousVkMembershipWitness = await oracle.getVkMembershipWitness(
|
|
167
163
|
this.previousKernelOutput.verificationKey.keyAsFields,
|
|
168
164
|
);
|
|
169
|
-
const
|
|
170
|
-
this.previousKernelOutput.publicInputs,
|
|
165
|
+
const vkData = new VkData(
|
|
171
166
|
this.previousKernelOutput.verificationKey,
|
|
172
167
|
Number(previousVkMembershipWitness.leafIndex),
|
|
173
|
-
|
|
168
|
+
previousVkMembershipWitness.siblingPath,
|
|
174
169
|
);
|
|
170
|
+
const previousKernelData = new PrivateKernelData(this.previousKernelOutput.publicInputs, vkData);
|
|
175
171
|
|
|
176
172
|
this.reduceReadRequestStates(
|
|
177
173
|
this.noteHashResetStates,
|
|
178
|
-
dimensions.
|
|
179
|
-
dimensions.
|
|
174
|
+
dimensions.NOTE_HASH_PENDING_READ,
|
|
175
|
+
dimensions.NOTE_HASH_SETTLED_READ,
|
|
180
176
|
);
|
|
181
177
|
this.reduceReadRequestStates(
|
|
182
178
|
this.nullifierResetStates,
|
|
183
|
-
dimensions.
|
|
184
|
-
dimensions.
|
|
179
|
+
dimensions.NULLIFIER_PENDING_READ,
|
|
180
|
+
dimensions.NULLIFIER_SETTLED_READ,
|
|
185
181
|
);
|
|
186
182
|
|
|
183
|
+
// TODO: Enable padding when we have a better idea what are the final amounts we should pad to.
|
|
184
|
+
const paddedSideEffects = PaddedSideEffects.empty();
|
|
185
|
+
|
|
187
186
|
return new PrivateKernelResetCircuitPrivateInputs(
|
|
188
187
|
previousKernelData,
|
|
188
|
+
paddedSideEffects,
|
|
189
189
|
new PrivateKernelResetHints(
|
|
190
190
|
await buildNoteHashReadRequestHintsFromResetStates(
|
|
191
191
|
oracle,
|
|
@@ -201,6 +201,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
201
201
|
),
|
|
202
202
|
await getMasterSecretKeysAndAppKeyGenerators(
|
|
203
203
|
this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators,
|
|
204
|
+
dimensions.KEY_VALIDATION,
|
|
204
205
|
oracle,
|
|
205
206
|
),
|
|
206
207
|
this.transientDataIndexHints,
|
|
@@ -266,19 +267,19 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
266
267
|
|
|
267
268
|
if (!this.nextIteration) {
|
|
268
269
|
this.noteHashResetStates = resetStates;
|
|
269
|
-
this.requestedDimensions.
|
|
270
|
-
this.requestedDimensions.
|
|
270
|
+
this.requestedDimensions.NOTE_HASH_PENDING_READ = numPendingReads;
|
|
271
|
+
this.requestedDimensions.NOTE_HASH_SETTLED_READ = numSettledReads;
|
|
271
272
|
} else {
|
|
272
273
|
// Pick only one dimension to reset if next iteration is not empty.
|
|
273
274
|
if (numPendingReads > numSettledReads) {
|
|
274
|
-
this.requestedDimensions.
|
|
275
|
+
this.requestedDimensions.NOTE_HASH_PENDING_READ = numPendingReads;
|
|
275
276
|
this.noteHashResetStates.states = assertLength(
|
|
276
277
|
resetStates.states.map(state => (state === ReadRequestState.PENDING ? state : ReadRequestState.NADA)),
|
|
277
278
|
MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
|
|
278
279
|
);
|
|
279
280
|
this.noteHashResetStates.pendingReadHints = resetStates.pendingReadHints;
|
|
280
281
|
} else {
|
|
281
|
-
this.requestedDimensions.
|
|
282
|
+
this.requestedDimensions.NOTE_HASH_SETTLED_READ = numSettledReads;
|
|
282
283
|
this.noteHashResetStates.states = assertLength(
|
|
283
284
|
resetStates.states.map(state => (state === ReadRequestState.SETTLED ? state : ReadRequestState.NADA)),
|
|
284
285
|
MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
|
|
@@ -318,19 +319,19 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
318
319
|
|
|
319
320
|
if (!this.nextIteration) {
|
|
320
321
|
this.nullifierResetStates = resetStates;
|
|
321
|
-
this.requestedDimensions.
|
|
322
|
-
this.requestedDimensions.
|
|
322
|
+
this.requestedDimensions.NULLIFIER_PENDING_READ = numPendingReads;
|
|
323
|
+
this.requestedDimensions.NULLIFIER_SETTLED_READ = numSettledReads;
|
|
323
324
|
} else {
|
|
324
325
|
// Pick only one dimension to reset if next iteration is not empty.
|
|
325
326
|
if (numPendingReads > numSettledReads) {
|
|
326
|
-
this.requestedDimensions.
|
|
327
|
+
this.requestedDimensions.NULLIFIER_PENDING_READ = numPendingReads;
|
|
327
328
|
this.nullifierResetStates.states = assertLength(
|
|
328
329
|
resetStates.states.map(state => (state === ReadRequestState.PENDING ? state : ReadRequestState.NADA)),
|
|
329
330
|
MAX_NULLIFIER_READ_REQUESTS_PER_TX,
|
|
330
331
|
);
|
|
331
332
|
this.nullifierResetStates.pendingReadHints = resetStates.pendingReadHints;
|
|
332
333
|
} else {
|
|
333
|
-
this.requestedDimensions.
|
|
334
|
+
this.requestedDimensions.NULLIFIER_SETTLED_READ = numSettledReads;
|
|
334
335
|
this.nullifierResetStates.states = assertLength(
|
|
335
336
|
resetStates.states.map(state => (state === ReadRequestState.SETTLED ? state : ReadRequestState.NADA)),
|
|
336
337
|
MAX_NULLIFIER_READ_REQUESTS_PER_TX,
|
|
@@ -353,7 +354,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
353
354
|
return false;
|
|
354
355
|
}
|
|
355
356
|
|
|
356
|
-
this.requestedDimensions.
|
|
357
|
+
this.requestedDimensions.KEY_VALIDATION = numCurr;
|
|
357
358
|
|
|
358
359
|
return true;
|
|
359
360
|
}
|
|
@@ -430,7 +431,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
430
431
|
|
|
431
432
|
this.numTransientData = numTransientData;
|
|
432
433
|
this.transientDataIndexHints = transientDataIndexHints;
|
|
433
|
-
this.requestedDimensions.
|
|
434
|
+
this.requestedDimensions.TRANSIENT_DATA_SQUASHING = numTransientData;
|
|
434
435
|
|
|
435
436
|
return numTransientData > 0;
|
|
436
437
|
}
|
|
@@ -442,7 +443,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
442
443
|
|
|
443
444
|
const numNoteHashes = this.previousKernel.end.noteHashes.filter(n => !n.contractAddress.isZero()).length;
|
|
444
445
|
const numToSilo = Math.max(0, numNoteHashes - this.numTransientData);
|
|
445
|
-
this.requestedDimensions.
|
|
446
|
+
this.requestedDimensions.NOTE_HASH_SILOING = numToSilo;
|
|
446
447
|
|
|
447
448
|
return numToSilo > 0;
|
|
448
449
|
}
|
|
@@ -458,7 +459,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
458
459
|
// The reset circuit checks that capped_size must be greater than or equal to all non-empty nullifiers.
|
|
459
460
|
// Which includes the first nullifier, even though its contract address is always zero and doesn't need siloing.
|
|
460
461
|
const cappedSize = numToSilo ? numToSilo + 1 : 0;
|
|
461
|
-
this.requestedDimensions.
|
|
462
|
+
this.requestedDimensions.NULLIFIER_SILOING = cappedSize;
|
|
462
463
|
|
|
463
464
|
return numToSilo > 0;
|
|
464
465
|
}
|
|
@@ -478,7 +479,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
478
479
|
const numSquashedLogs = privateLogs.filter(l => squashedNoteHashCounters.includes(l.inner.noteHashCounter)).length;
|
|
479
480
|
|
|
480
481
|
const numToSilo = numLogs - numSquashedLogs;
|
|
481
|
-
this.requestedDimensions.
|
|
482
|
+
this.requestedDimensions.PRIVATE_LOG_SILOING = numToSilo;
|
|
482
483
|
|
|
483
484
|
return numToSilo > 0;
|
|
484
485
|
}
|
|
@@ -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';
|
|
@@ -154,6 +153,7 @@ export class PrivateKernelExecutionProver {
|
|
|
154
153
|
vk: currentExecution.vk,
|
|
155
154
|
timings: {
|
|
156
155
|
witgen: currentExecution.profileResult?.timings.witgen ?? 0,
|
|
156
|
+
oracles: currentExecution.profileResult?.timings.oracles,
|
|
157
157
|
},
|
|
158
158
|
});
|
|
159
159
|
|
|
@@ -192,12 +192,12 @@ export class PrivateKernelExecutionProver {
|
|
|
192
192
|
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(
|
|
193
193
|
output.verificationKey.keyAsFields,
|
|
194
194
|
);
|
|
195
|
-
const
|
|
196
|
-
output.publicInputs,
|
|
195
|
+
const vkData = new VkData(
|
|
197
196
|
output.verificationKey,
|
|
198
197
|
Number(previousVkMembershipWitness.leafIndex),
|
|
199
|
-
|
|
198
|
+
previousVkMembershipWitness.siblingPath,
|
|
200
199
|
);
|
|
200
|
+
const previousKernelData = new PrivateKernelData(output.publicInputs, vkData);
|
|
201
201
|
const proofInput = new PrivateKernelInnerCircuitPrivateInputs(previousKernelData, privateCallData);
|
|
202
202
|
|
|
203
203
|
pushTestData('private-kernel-inputs-inner', proofInput);
|
|
@@ -259,18 +259,20 @@ export class PrivateKernelExecutionProver {
|
|
|
259
259
|
}
|
|
260
260
|
// Private tail.
|
|
261
261
|
const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(output.verificationKey.keyAsFields);
|
|
262
|
-
const
|
|
263
|
-
output.publicInputs,
|
|
262
|
+
const vkData = new VkData(
|
|
264
263
|
output.verificationKey,
|
|
265
264
|
Number(previousVkMembershipWitness.leafIndex),
|
|
266
|
-
|
|
265
|
+
previousVkMembershipWitness.siblingPath,
|
|
267
266
|
);
|
|
267
|
+
const previousKernelData = new PrivateKernelData(output.publicInputs, vkData);
|
|
268
268
|
|
|
269
269
|
this.log.debug(
|
|
270
270
|
`Calling private kernel tail with hwm ${previousKernelData.publicInputs.minRevertibleSideEffectCounter}`,
|
|
271
271
|
);
|
|
272
272
|
|
|
273
|
-
|
|
273
|
+
// TODO: Enable padding when we have a better what are the final amounts we should pad to.
|
|
274
|
+
const paddedSideEffectAmounts = PaddedSideEffectAmounts.empty();
|
|
275
|
+
const privateInputs = new PrivateKernelTailCircuitPrivateInputs(previousKernelData, paddedSideEffectAmounts);
|
|
274
276
|
|
|
275
277
|
pushTestData('private-kernel-inputs-ordering', privateInputs);
|
|
276
278
|
|
|
@@ -19,9 +19,9 @@ import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
|
|
|
19
19
|
import { computeAddressSecret, computeAppTaggingSecret } from '@aztec/stdlib/keys';
|
|
20
20
|
import {
|
|
21
21
|
IndexedTaggingSecret,
|
|
22
|
-
LogWithTxData,
|
|
23
22
|
PendingTaggedLog,
|
|
24
23
|
PublicLog,
|
|
24
|
+
PublicLogWithTxData,
|
|
25
25
|
TxScopedL2Log,
|
|
26
26
|
deriveEcdhSharedSecret,
|
|
27
27
|
} from '@aztec/stdlib/logs';
|
|
@@ -392,7 +392,7 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
392
392
|
});
|
|
393
393
|
|
|
394
394
|
// We fetch the logs for the tags
|
|
395
|
-
const possibleLogs = await this
|
|
395
|
+
const possibleLogs = await this.#getPrivateLogsByTags(currentTags);
|
|
396
396
|
|
|
397
397
|
// We find the index of the last log in the window that is not empty
|
|
398
398
|
const indexOfLastLog = possibleLogs.findLastIndex(possibleLog => possibleLog.length !== 0);
|
|
@@ -429,8 +429,8 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
/**
|
|
432
|
-
* Synchronizes the logs tagged with scoped addresses and all the senders in the address book. Stores the found
|
|
433
|
-
* in CapsuleArray ready for a later retrieval in Aztec.nr.
|
|
432
|
+
* Synchronizes the private logs tagged with scoped addresses and all the senders in the address book. Stores the found
|
|
433
|
+
* logs in CapsuleArray ready for a later retrieval in Aztec.nr.
|
|
434
434
|
* @param contractAddress - The address of the contract that the logs are tagged for.
|
|
435
435
|
* @param pendingTaggedLogArrayBaseSlot - The base slot of the pending tagged logs capsule array in which
|
|
436
436
|
* found logs will be stored.
|
|
@@ -490,20 +490,14 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
490
490
|
// a new set of secrets and windows to fetch logs for.
|
|
491
491
|
const newLargestIndexMapForIteration: { [k: string]: number } = {};
|
|
492
492
|
|
|
493
|
-
// Fetch the logs for the tags and iterate over them
|
|
494
|
-
const logsByTags = await this
|
|
493
|
+
// Fetch the private logs for the tags and iterate over them
|
|
494
|
+
const logsByTags = await this.#getPrivateLogsByTags(tagsForTheWholeWindow);
|
|
495
495
|
|
|
496
496
|
for (let logIndex = 0; logIndex < logsByTags.length; logIndex++) {
|
|
497
497
|
const logsByTag = logsByTags[logIndex];
|
|
498
498
|
if (logsByTag.length > 0) {
|
|
499
|
-
// Discard public logs
|
|
500
|
-
const filteredLogsByTag = logsByTag.filter(l => !l.isFromPublic);
|
|
501
|
-
if (filteredLogsByTag.length < logsByTag.length) {
|
|
502
|
-
this.log.warn(`Discarded ${logsByTag.filter(l => l.isFromPublic).length} public logs with matching tags`);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
499
|
// We filter out the logs that are newer than the historical block number of the tx currently being constructed
|
|
506
|
-
const filteredLogsByBlockNumber =
|
|
500
|
+
const filteredLogsByBlockNumber = logsByTag.filter(l => l.blockNumber <= maxBlockNumber);
|
|
507
501
|
|
|
508
502
|
// We store the logs in capsules (to later be obtained in Noir)
|
|
509
503
|
await this.#storePendingTaggedLogs(
|
|
@@ -518,7 +512,7 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
518
512
|
const secretCorrespondingToLog = secretsForTheWholeWindow[logIndex];
|
|
519
513
|
const initialIndex = initialIndexesMap[secretCorrespondingToLog.appTaggingSecret.toString()];
|
|
520
514
|
|
|
521
|
-
this.log.debug(`Found ${
|
|
515
|
+
this.log.debug(`Found ${logsByTags.length} logs as recipient ${recipient}`, {
|
|
522
516
|
recipient,
|
|
523
517
|
secret: secretCorrespondingToLog.appTaggingSecret,
|
|
524
518
|
contractName,
|
|
@@ -700,8 +694,8 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
700
694
|
}
|
|
701
695
|
}
|
|
702
696
|
|
|
703
|
-
public async
|
|
704
|
-
const logs = await this
|
|
697
|
+
public async getPublicLogByTag(tag: Fr, contractAddress: AztecAddress): Promise<PublicLogWithTxData | null> {
|
|
698
|
+
const logs = await this.#getPublicLogsByTagsFromContract([tag], contractAddress);
|
|
705
699
|
const logsForTag = logs[0];
|
|
706
700
|
|
|
707
701
|
this.log.debug(`Got ${logsForTag.length} logs for tag ${tag}`);
|
|
@@ -711,7 +705,7 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
711
705
|
} else if (logsForTag.length > 1) {
|
|
712
706
|
// TODO(#11627): handle this case
|
|
713
707
|
throw new Error(
|
|
714
|
-
`Got ${logsForTag.length} logs for tag ${tag}.
|
|
708
|
+
`Got ${logsForTag.length} logs for tag ${tag} and contract ${contractAddress.toString()}. getPublicLogByTag currently only supports a single log per tag`,
|
|
715
709
|
);
|
|
716
710
|
}
|
|
717
711
|
|
|
@@ -725,11 +719,12 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
725
719
|
throw new Error(`Unexpected: failed to retrieve tx effects for tx ${scopedLog.txHash} which is known to exist`);
|
|
726
720
|
}
|
|
727
721
|
|
|
728
|
-
|
|
729
|
-
scopedLog.log.
|
|
722
|
+
return new PublicLogWithTxData(
|
|
723
|
+
scopedLog.log.getEmittedFieldsWithoutTag(),
|
|
724
|
+
scopedLog.txHash,
|
|
725
|
+
txEffect.data.noteHashes,
|
|
726
|
+
txEffect.data.nullifiers[0],
|
|
730
727
|
);
|
|
731
|
-
|
|
732
|
-
return new LogWithTxData(logContent, scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
|
|
733
728
|
}
|
|
734
729
|
|
|
735
730
|
public async removeNullifiedNotes(contractAddress: AztecAddress) {
|
|
@@ -832,4 +827,21 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
832
827
|
blockNumber,
|
|
833
828
|
);
|
|
834
829
|
}
|
|
830
|
+
|
|
831
|
+
// TODO(#12656): Make this a public function on the AztecNode interface and remove the original getLogsByTags. This
|
|
832
|
+
// was not done yet as we were unsure about the API and we didn't want to introduce a breaking change.
|
|
833
|
+
async #getPrivateLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]> {
|
|
834
|
+
const allLogs = await this.aztecNode.getLogsByTags(tags);
|
|
835
|
+
return allLogs.map(logs => logs.filter(log => !log.isFromPublic));
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
// TODO(#12656): Make this a public function on the AztecNode interface and remove the original getLogsByTags. This
|
|
839
|
+
// was not done yet as we were unsure about the API and we didn't want to introduce a breaking change.
|
|
840
|
+
async #getPublicLogsByTagsFromContract(tags: Fr[], contractAddress: AztecAddress): Promise<TxScopedL2Log[][]> {
|
|
841
|
+
const allLogs = await this.aztecNode.getLogsByTags(tags);
|
|
842
|
+
const allPublicLogs = allLogs.map(logs => logs.filter(log => log.isFromPublic));
|
|
843
|
+
return allPublicLogs.map(logs =>
|
|
844
|
+
logs.filter(log => (log.log as PublicLog).contractAddress.equals(contractAddress)),
|
|
845
|
+
);
|
|
846
|
+
}
|
|
835
847
|
}
|
|
@@ -679,9 +679,10 @@ export class PXEService implements PXE {
|
|
|
679
679
|
|
|
680
680
|
const totalTime = totalTimer.ms();
|
|
681
681
|
|
|
682
|
-
const perFunction = executionSteps.map(({ functionName, timings: { witgen } }) => ({
|
|
682
|
+
const perFunction = executionSteps.map(({ functionName, timings: { witgen, oracles } }) => ({
|
|
683
683
|
functionName,
|
|
684
684
|
time: witgen,
|
|
685
|
+
oracles,
|
|
685
686
|
}));
|
|
686
687
|
|
|
687
688
|
const timings: ProvingTimings = {
|
|
@@ -746,10 +747,13 @@ export class PXEService implements PXE {
|
|
|
746
747
|
|
|
747
748
|
const totalTime = totalTimer.ms();
|
|
748
749
|
|
|
749
|
-
const perFunction = executionSteps.map(({ functionName, timings: { witgen } }) =>
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
750
|
+
const perFunction = executionSteps.map(({ functionName, timings: { witgen, oracles } }) => {
|
|
751
|
+
return {
|
|
752
|
+
functionName,
|
|
753
|
+
time: witgen,
|
|
754
|
+
oracles,
|
|
755
|
+
};
|
|
756
|
+
});
|
|
753
757
|
|
|
754
758
|
// Gate computation is time is not relevant for profiling, so we subtract it from the total time.
|
|
755
759
|
const gateCountComputationTime =
|
|
@@ -849,9 +853,10 @@ export class PXEService implements PXE {
|
|
|
849
853
|
|
|
850
854
|
const totalTime = totalTimer.ms();
|
|
851
855
|
|
|
852
|
-
const perFunction = executionSteps.map(({ functionName, timings: { witgen } }) => ({
|
|
856
|
+
const perFunction = executionSteps.map(({ functionName, timings: { witgen, oracles } }) => ({
|
|
853
857
|
functionName,
|
|
854
858
|
time: witgen,
|
|
859
|
+
oracles,
|
|
855
860
|
}));
|
|
856
861
|
|
|
857
862
|
const timings: SimulationTimings = {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_creation_options.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/client/pxe_creation_options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B,CAAC"}
|
|
File without changes
|