@aztec/pxe 1.2.1 → 2.0.0-nightly.20250813
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/contract_function_simulator/contract_function_simulator.d.ts +5 -2
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +48 -29
- package/dest/contract_function_simulator/index.d.ts +1 -0
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +22 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +49 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +44 -43
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +127 -106
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +7 -2
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +16 -11
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +41 -17
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +51 -23
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +48 -47
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/typed_oracle.js +89 -87
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +31 -30
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +33 -30
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +6 -7
- package/dest/entrypoints/server/utils.d.ts +4 -2
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +4 -2
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +4 -4
- 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 +58 -59
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +41 -0
- package/dest/private_kernel/hints/index.d.ts +1 -0
- package/dest/private_kernel/hints/index.d.ts.map +1 -1
- package/dest/private_kernel/hints/index.js +1 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +13 -4
- package/dest/private_kernel/private_kernel_oracle.d.ts +1 -1
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +6 -6
- package/dest/pxe_service/error_enriching.d.ts.map +1 -1
- package/dest/pxe_service/error_enriching.js +1 -0
- package/dest/pxe_service/pxe_service.d.ts +3 -2
- package/dest/pxe_service/pxe_service.d.ts.map +1 -1
- package/dest/pxe_service/pxe_service.js +28 -19
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +1 -1
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +1 -1
- package/dest/storage/note_data_provider/note_data_provider.js +16 -4
- package/package.json +16 -16
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +67 -37
- package/src/contract_function_simulator/index.ts +1 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -1
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +52 -0
- package/src/contract_function_simulator/oracle/oracle.ts +149 -111
- package/src/contract_function_simulator/oracle/private_execution.ts +17 -12
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +60 -24
- package/src/contract_function_simulator/oracle/typed_oracle.ts +108 -92
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +34 -30
- package/src/contract_function_simulator/pxe_oracle_interface.ts +6 -8
- package/src/entrypoints/server/utils.ts +17 -6
- package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +106 -104
- package/src/private_kernel/hints/compute_tx_include_by_timestamp.ts +58 -0
- package/src/private_kernel/hints/index.ts +1 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +21 -4
- package/src/private_kernel/private_kernel_oracle.ts +1 -1
- package/src/private_kernel/private_kernel_oracle_impl.ts +12 -9
- package/src/pxe_service/error_enriching.ts +1 -0
- package/src/pxe_service/pxe_service.ts +30 -32
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +1 -1
- package/src/storage/note_data_provider/note_data_provider.ts +27 -16
|
@@ -32,23 +32,27 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
32
32
|
super();
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
public override
|
|
35
|
+
public override utilityGetRandomField(): Fr {
|
|
36
|
+
return Fr.random();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public override utilityGetBlockNumber(): Promise<number> {
|
|
36
40
|
return this.executionDataProvider.getBlockNumber();
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
public override
|
|
43
|
+
public override utilityGetTimestamp(): Promise<UInt64> {
|
|
40
44
|
return this.executionDataProvider.getTimestamp();
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
public override
|
|
47
|
+
public override utilityGetContractAddress(): Promise<AztecAddress> {
|
|
44
48
|
return Promise.resolve(this.contractAddress);
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
public override
|
|
51
|
+
public override utilityGetChainId(): Promise<Fr> {
|
|
48
52
|
return Promise.resolve(this.executionDataProvider.getChainId().then(id => new Fr(id)));
|
|
49
53
|
}
|
|
50
54
|
|
|
51
|
-
public override
|
|
55
|
+
public override utilityGetVersion(): Promise<Fr> {
|
|
52
56
|
return Promise.resolve(this.executionDataProvider.getVersion().then(v => new Fr(v)));
|
|
53
57
|
}
|
|
54
58
|
|
|
@@ -58,7 +62,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
58
62
|
* @returns A Promise that resolves to nullifier keys.
|
|
59
63
|
* @throws If the keys are not registered in the key store.
|
|
60
64
|
*/
|
|
61
|
-
public override
|
|
65
|
+
public override utilityGetKeyValidationRequest(pkMHash: Fr): Promise<KeyValidationRequest> {
|
|
62
66
|
return this.executionDataProvider.getKeyValidationRequest(pkMHash, this.contractAddress);
|
|
63
67
|
}
|
|
64
68
|
|
|
@@ -69,7 +73,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
69
73
|
* @param leafValue - The leaf value
|
|
70
74
|
* @returns The index and sibling path concatenated [index, sibling_path]
|
|
71
75
|
*/
|
|
72
|
-
public override
|
|
76
|
+
public override utilityGetMembershipWitness(blockNumber: number, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[]> {
|
|
73
77
|
return this.executionDataProvider.getMembershipWitness(blockNumber, treeId, leafValue);
|
|
74
78
|
}
|
|
75
79
|
|
|
@@ -79,7 +83,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
79
83
|
* @param nullifier - Nullifier we try to find witness for.
|
|
80
84
|
* @returns The nullifier membership witness (if found).
|
|
81
85
|
*/
|
|
82
|
-
public override async
|
|
86
|
+
public override async utilityGetNullifierMembershipWitness(
|
|
83
87
|
blockNumber: number,
|
|
84
88
|
nullifier: Fr,
|
|
85
89
|
): Promise<NullifierMembershipWitness | undefined> {
|
|
@@ -95,7 +99,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
95
99
|
* list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
|
|
96
100
|
* we are trying to prove non-inclusion for.
|
|
97
101
|
*/
|
|
98
|
-
public override async
|
|
102
|
+
public override async utilityGetLowNullifierMembershipWitness(
|
|
99
103
|
blockNumber: number,
|
|
100
104
|
nullifier: Fr,
|
|
101
105
|
): Promise<NullifierMembershipWitness | undefined> {
|
|
@@ -108,7 +112,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
108
112
|
* @param leafSlot - The slot of the public data tree to get the witness for.
|
|
109
113
|
* @returns - The witness
|
|
110
114
|
*/
|
|
111
|
-
public override async
|
|
115
|
+
public override async utilityGetPublicDataWitness(
|
|
112
116
|
blockNumber: number,
|
|
113
117
|
leafSlot: Fr,
|
|
114
118
|
): Promise<PublicDataWitness | undefined> {
|
|
@@ -120,7 +124,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
120
124
|
* @param blockNumber - The number of a block of which to get the block header.
|
|
121
125
|
* @returns Block extracted from a block with block number `blockNumber`.
|
|
122
126
|
*/
|
|
123
|
-
public override async
|
|
127
|
+
public override async utilityGetBlockHeader(blockNumber: number): Promise<BlockHeader | undefined> {
|
|
124
128
|
const block = await this.executionDataProvider.getBlock(blockNumber);
|
|
125
129
|
if (!block) {
|
|
126
130
|
return undefined;
|
|
@@ -134,7 +138,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
134
138
|
* @returns A complete address associated with the input address.
|
|
135
139
|
* @throws An error if the account is not registered in the database.
|
|
136
140
|
*/
|
|
137
|
-
public override
|
|
141
|
+
public override utilityGetCompleteAddress(account: AztecAddress): Promise<CompleteAddress> {
|
|
138
142
|
return this.executionDataProvider.getCompleteAddress(account);
|
|
139
143
|
}
|
|
140
144
|
|
|
@@ -143,7 +147,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
143
147
|
* @param address - Address.
|
|
144
148
|
* @returns A contract instance.
|
|
145
149
|
*/
|
|
146
|
-
public override
|
|
150
|
+
public override utilityGetContractInstance(address: AztecAddress): Promise<ContractInstance> {
|
|
147
151
|
return this.executionDataProvider.getContractInstance(address);
|
|
148
152
|
}
|
|
149
153
|
|
|
@@ -153,7 +157,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
153
157
|
* @param messageHash - Hash of the message to authenticate.
|
|
154
158
|
* @returns Authentication witness for the requested message hash.
|
|
155
159
|
*/
|
|
156
|
-
public override
|
|
160
|
+
public override utilityGetAuthWitness(messageHash: Fr): Promise<Fr[] | undefined> {
|
|
157
161
|
return Promise.resolve(this.authWitnesses.find(w => w.requestHash.equals(messageHash))?.witness);
|
|
158
162
|
}
|
|
159
163
|
|
|
@@ -178,7 +182,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
178
182
|
* @param status - The status of notes to fetch.
|
|
179
183
|
* @returns Array of note data.
|
|
180
184
|
*/
|
|
181
|
-
public override async
|
|
185
|
+
public override async utilityGetNotes(
|
|
182
186
|
storageSlot: Fr,
|
|
183
187
|
numSelects: number,
|
|
184
188
|
selectByIndexes: number[],
|
|
@@ -215,7 +219,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
215
219
|
* @param innerNullifier - The inner nullifier.
|
|
216
220
|
* @returns A boolean indicating whether the nullifier exists in the tree or not.
|
|
217
221
|
*/
|
|
218
|
-
public override async
|
|
222
|
+
public override async utilityCheckNullifierExists(innerNullifier: Fr) {
|
|
219
223
|
const nullifier = await siloNullifier(this.contractAddress, innerNullifier!);
|
|
220
224
|
const index = await this.executionDataProvider.getNullifierIndex(nullifier);
|
|
221
225
|
return index !== undefined;
|
|
@@ -229,7 +233,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
229
233
|
* @dev Contract address and secret are only used to compute the nullifier to get non-nullified messages
|
|
230
234
|
* @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
|
|
231
235
|
*/
|
|
232
|
-
public override async
|
|
236
|
+
public override async utilityGetL1ToL2MembershipWitness(contractAddress: AztecAddress, messageHash: Fr, secret: Fr) {
|
|
233
237
|
return await this.executionDataProvider.getL1ToL2MembershipWitness(contractAddress, messageHash, secret);
|
|
234
238
|
}
|
|
235
239
|
|
|
@@ -240,7 +244,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
240
244
|
* @param blockNumber - The block number to read storage at.
|
|
241
245
|
* @param numberOfElements - Number of elements to read from the starting storage slot.
|
|
242
246
|
*/
|
|
243
|
-
public override async
|
|
247
|
+
public override async utilityStorageRead(
|
|
244
248
|
contractAddress: AztecAddress,
|
|
245
249
|
startStorageSlot: Fr,
|
|
246
250
|
blockNumber: number,
|
|
@@ -259,7 +263,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
259
263
|
return values;
|
|
260
264
|
}
|
|
261
265
|
|
|
262
|
-
public override
|
|
266
|
+
public override utilityDebugLog(message: string, fields: Fr[]): void {
|
|
263
267
|
this.log.verbose(`${applyStringFormatting(message, fields)}`, { module: `${this.log.module}:debug_log` });
|
|
264
268
|
}
|
|
265
269
|
|
|
@@ -271,20 +275,20 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
271
275
|
* @param recipient - The address receiving the note
|
|
272
276
|
* @returns A tagging secret that can be used to tag notes.
|
|
273
277
|
*/
|
|
274
|
-
public override async
|
|
278
|
+
public override async utilityGetIndexedTaggingSecretAsSender(
|
|
275
279
|
sender: AztecAddress,
|
|
276
280
|
recipient: AztecAddress,
|
|
277
281
|
): Promise<IndexedTaggingSecret> {
|
|
278
282
|
return await this.executionDataProvider.getIndexedTaggingSecretAsSender(this.contractAddress, sender, recipient);
|
|
279
283
|
}
|
|
280
284
|
|
|
281
|
-
public override async
|
|
285
|
+
public override async utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr) {
|
|
282
286
|
await this.executionDataProvider.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
|
|
283
287
|
|
|
284
288
|
await this.executionDataProvider.removeNullifiedNotes(this.contractAddress);
|
|
285
289
|
}
|
|
286
290
|
|
|
287
|
-
public override async
|
|
291
|
+
public override async utilityValidateEnqueuedNotesAndEvents(
|
|
288
292
|
contractAddress: AztecAddress,
|
|
289
293
|
noteValidationRequestsArrayBaseSlot: Fr,
|
|
290
294
|
eventValidationRequestsArrayBaseSlot: Fr,
|
|
@@ -301,7 +305,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
301
305
|
);
|
|
302
306
|
}
|
|
303
307
|
|
|
304
|
-
public override async
|
|
308
|
+
public override async utilityBulkRetrieveLogs(
|
|
305
309
|
contractAddress: AztecAddress,
|
|
306
310
|
logRetrievalRequestsArrayBaseSlot: Fr,
|
|
307
311
|
logRetrievalResponsesArrayBaseSlot: Fr,
|
|
@@ -318,7 +322,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
318
322
|
);
|
|
319
323
|
}
|
|
320
324
|
|
|
321
|
-
public override
|
|
325
|
+
public override utilityStoreCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[]): Promise<void> {
|
|
322
326
|
if (!contractAddress.equals(this.contractAddress)) {
|
|
323
327
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
324
328
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
@@ -326,7 +330,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
326
330
|
return this.executionDataProvider.storeCapsule(this.contractAddress, slot, capsule);
|
|
327
331
|
}
|
|
328
332
|
|
|
329
|
-
public override async
|
|
333
|
+
public override async utilityLoadCapsule(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null> {
|
|
330
334
|
if (!contractAddress.equals(this.contractAddress)) {
|
|
331
335
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
332
336
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
@@ -338,7 +342,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
338
342
|
);
|
|
339
343
|
}
|
|
340
344
|
|
|
341
|
-
public override
|
|
345
|
+
public override utilityDeleteCapsule(contractAddress: AztecAddress, slot: Fr): Promise<void> {
|
|
342
346
|
if (!contractAddress.equals(this.contractAddress)) {
|
|
343
347
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
344
348
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
@@ -346,7 +350,7 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
346
350
|
return this.executionDataProvider.deleteCapsule(this.contractAddress, slot);
|
|
347
351
|
}
|
|
348
352
|
|
|
349
|
-
public override
|
|
353
|
+
public override utilityCopyCapsule(
|
|
350
354
|
contractAddress: AztecAddress,
|
|
351
355
|
srcSlot: Fr,
|
|
352
356
|
dstSlot: Fr,
|
|
@@ -360,16 +364,16 @@ export class UtilityExecutionOracle extends TypedOracle {
|
|
|
360
364
|
}
|
|
361
365
|
|
|
362
366
|
// TODO(#11849): consider replacing this oracle with a pure Noir implementation of aes decryption.
|
|
363
|
-
public override
|
|
367
|
+
public override utilityAes128Decrypt(ciphertext: Buffer, iv: Buffer, symKey: Buffer): Promise<Buffer> {
|
|
364
368
|
const aes128 = new Aes128();
|
|
365
369
|
return aes128.decryptBufferCBC(ciphertext, iv, symKey);
|
|
366
370
|
}
|
|
367
371
|
|
|
368
|
-
public override
|
|
372
|
+
public override utilityGetSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point> {
|
|
369
373
|
return this.executionDataProvider.getSharedSecret(address, ephPk);
|
|
370
374
|
}
|
|
371
375
|
|
|
372
|
-
public override
|
|
376
|
+
public override utilityEmitOffchainEffect(_data: Fr[]): Promise<void> {
|
|
373
377
|
return Promise.reject(new Error('Cannot emit offchain effects from a utility function'));
|
|
374
378
|
}
|
|
375
379
|
}
|
|
@@ -75,7 +75,7 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
75
75
|
if (!completeAddress) {
|
|
76
76
|
throw new Error(
|
|
77
77
|
`No public key registered for address ${account}.
|
|
78
|
-
Register it by calling pxe.
|
|
78
|
+
Register it by calling pxe.addAccount(...).\nSee docs for context: https://docs.aztec.network/developers/reference/debugging/aztecnr-errors#simulation-error-no-public-key-registered-for-address-0x0-register-it-by-calling-pxeregisterrecipient-or-pxeregisteraccount`,
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
return completeAddress;
|
|
@@ -500,6 +500,11 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
500
500
|
|
|
501
501
|
// Fetch the private logs for the tags and iterate over them
|
|
502
502
|
const logsByTags = await this.#getPrivateLogsByTags(tagsForTheWholeWindow);
|
|
503
|
+
this.log.debug(`Found ${logsByTags.filter(logs => logs.length > 0).length} logs as recipient ${recipient}`, {
|
|
504
|
+
recipient,
|
|
505
|
+
contractName,
|
|
506
|
+
contractAddress,
|
|
507
|
+
});
|
|
503
508
|
|
|
504
509
|
for (let logIndex = 0; logIndex < logsByTags.length; logIndex++) {
|
|
505
510
|
const logsByTag = logsByTags[logIndex];
|
|
@@ -520,13 +525,6 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
520
525
|
const secretCorrespondingToLog = secretsForTheWholeWindow[logIndex];
|
|
521
526
|
const initialIndex = initialIndexesMap[secretCorrespondingToLog.appTaggingSecret.toString()];
|
|
522
527
|
|
|
523
|
-
this.log.debug(`Found ${logsByTags.length} logs as recipient ${recipient}`, {
|
|
524
|
-
recipient,
|
|
525
|
-
secret: secretCorrespondingToLog.appTaggingSecret,
|
|
526
|
-
contractName,
|
|
527
|
-
contractAddress,
|
|
528
|
-
});
|
|
529
|
-
|
|
530
528
|
if (
|
|
531
529
|
secretCorrespondingToLog.index >= initialIndex &&
|
|
532
530
|
(newLargestIndexMapForIteration[secretCorrespondingToLog.appTaggingSecret.toString()] === undefined ||
|
|
@@ -17,6 +17,11 @@ import { PXEService } from '../../pxe_service/pxe_service.js';
|
|
|
17
17
|
import { PXE_DATA_SCHEMA_VERSION } from '../../storage/index.js';
|
|
18
18
|
import type { PXECreationOptions } from '../pxe_creation_options.js';
|
|
19
19
|
|
|
20
|
+
type PXEConfigWithoutDefaults = Omit<
|
|
21
|
+
PXEServiceConfig,
|
|
22
|
+
'l1Contracts' | 'l1ChainId' | 'l2BlockBatchSize' | 'rollupVersion'
|
|
23
|
+
>;
|
|
24
|
+
|
|
20
25
|
/**
|
|
21
26
|
* Create and start an PXEService instance with the given AztecNode and config.
|
|
22
27
|
*
|
|
@@ -27,7 +32,7 @@ import type { PXECreationOptions } from '../pxe_creation_options.js';
|
|
|
27
32
|
*/
|
|
28
33
|
export function createPXEService(
|
|
29
34
|
aztecNode: AztecNode,
|
|
30
|
-
config:
|
|
35
|
+
config: PXEConfigWithoutDefaults,
|
|
31
36
|
options: PXECreationOptions = { loggers: {} },
|
|
32
37
|
) {
|
|
33
38
|
const simulator = new WASMSimulator();
|
|
@@ -50,7 +55,7 @@ export function createPXEService(
|
|
|
50
55
|
export async function createPXEServiceWithSimulator(
|
|
51
56
|
aztecNode: AztecNode,
|
|
52
57
|
simulator: CircuitSimulator,
|
|
53
|
-
config:
|
|
58
|
+
config: PXEConfigWithoutDefaults,
|
|
54
59
|
options: PXECreationOptions = { loggers: {} },
|
|
55
60
|
) {
|
|
56
61
|
const logSuffix =
|
|
@@ -61,10 +66,12 @@ export async function createPXEServiceWithSimulator(
|
|
|
61
66
|
: options.useLogSuffix;
|
|
62
67
|
const loggers = options.loggers ?? {};
|
|
63
68
|
|
|
64
|
-
const l1Contracts = await aztecNode.
|
|
65
|
-
const configWithContracts = {
|
|
69
|
+
const { l1ChainId, l1ContractAddresses: l1Contracts, rollupVersion } = await aztecNode.getNodeInfo();
|
|
70
|
+
const configWithContracts: PXEServiceConfig = {
|
|
66
71
|
...config,
|
|
67
72
|
l1Contracts,
|
|
73
|
+
l1ChainId,
|
|
74
|
+
rollupVersion,
|
|
68
75
|
l2BlockBatchSize: 50,
|
|
69
76
|
};
|
|
70
77
|
|
|
@@ -91,13 +98,17 @@ export async function createPXEServiceWithSimulator(
|
|
|
91
98
|
prover,
|
|
92
99
|
simulator,
|
|
93
100
|
protocolContractsProvider,
|
|
94
|
-
|
|
101
|
+
configWithContracts,
|
|
95
102
|
pxeLogger,
|
|
96
103
|
);
|
|
97
104
|
return pxe;
|
|
98
105
|
}
|
|
99
106
|
|
|
100
|
-
function createProver(
|
|
107
|
+
function createProver(
|
|
108
|
+
config: Pick<PXEServiceConfig, 'bbBinaryPath' | 'bbWorkingDirectory'>,
|
|
109
|
+
simulator: CircuitSimulator,
|
|
110
|
+
logger?: Logger,
|
|
111
|
+
) {
|
|
101
112
|
if (!config.bbBinaryPath || !config.bbWorkingDirectory) {
|
|
102
113
|
return new BBWASMBundlePrivateKernelProver(simulator, 16, logger);
|
|
103
114
|
} else {
|