@aztec/txe 0.86.0 → 0.87.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.
Files changed (37) hide show
  1. package/dest/oracle/txe_oracle.d.ts +11 -6
  2. package/dest/oracle/txe_oracle.d.ts.map +1 -1
  3. package/dest/oracle/txe_oracle.js +209 -38
  4. package/dest/state_machine/archiver.d.ts +53 -0
  5. package/dest/state_machine/archiver.d.ts.map +1 -0
  6. package/dest/state_machine/archiver.js +100 -0
  7. package/dest/state_machine/dummy_p2p_client.d.ts +48 -0
  8. package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -0
  9. package/dest/state_machine/dummy_p2p_client.js +122 -0
  10. package/dest/state_machine/global_variable_builder.d.ts +23 -0
  11. package/dest/state_machine/global_variable_builder.d.ts.map +1 -0
  12. package/dest/state_machine/global_variable_builder.js +29 -0
  13. package/dest/state_machine/index.d.ts +16 -0
  14. package/dest/state_machine/index.d.ts.map +1 -0
  15. package/dest/state_machine/index.js +48 -0
  16. package/dest/state_machine/synchronizer.d.ts +32 -0
  17. package/dest/state_machine/synchronizer.d.ts.map +1 -0
  18. package/dest/state_machine/synchronizer.js +58 -0
  19. package/dest/txe_service/txe_service.d.ts +12 -3
  20. package/dest/txe_service/txe_service.d.ts.map +1 -1
  21. package/dest/txe_service/txe_service.js +221 -37
  22. package/dest/util/encoding.d.ts +11 -4
  23. package/dest/util/encoding.d.ts.map +1 -1
  24. package/dest/util/encoding.js +38 -2
  25. package/package.json +18 -15
  26. package/src/oracle/txe_oracle.ts +387 -40
  27. package/src/state_machine/archiver.ts +132 -0
  28. package/src/state_machine/dummy_p2p_client.ts +167 -0
  29. package/src/state_machine/global_variable_builder.ts +55 -0
  30. package/src/state_machine/index.ts +71 -0
  31. package/src/state_machine/synchronizer.ts +87 -0
  32. package/src/txe_service/txe_service.ts +427 -31
  33. package/src/util/encoding.ts +51 -2
  34. package/dest/node/txe_node.d.ts +0 -320
  35. package/dest/node/txe_node.d.ts.map +0 -1
  36. package/dest/node/txe_node.js +0 -481
  37. package/src/node/txe_node.ts +0 -703
@@ -7,18 +7,20 @@ import { PublicDataWrite } from '@aztec/stdlib/avm';
7
7
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
8
8
  import { computePartialAddress } from '@aztec/stdlib/contract';
9
9
  import { SimulationError } from '@aztec/stdlib/errors';
10
- import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/stdlib/hash';
10
+ import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
11
11
  import { LogWithTxData } from '@aztec/stdlib/logs';
12
12
  import { MerkleTreeId } from '@aztec/stdlib/trees';
13
13
  import { TXE } from '../oracle/txe_oracle.js';
14
- import { addressFromSingle, arrayToBoundedVec, bufferToU8Array, fromArray, fromSingle, fromUintArray, fromUintBoundedVec, toArray, toForeignCallResult, toSingle, toSingleOrArray } from '../util/encoding.js';
14
+ import { addressFromSingle, arrayOfArraysToBoundedVecOfArrays, arrayToBoundedVec, bufferToU8Array, fromArray, fromSingle, fromUintArray, fromUintBoundedVec, toArray, toForeignCallResult, toSingle, toSingleOrArray } from '../util/encoding.js';
15
15
  import { ExpectedFailureError } from '../util/expected_failure_error.js';
16
16
  export class TXEService {
17
17
  logger;
18
18
  typedOracle;
19
+ oraclesEnabled;
19
20
  constructor(logger, typedOracle){
20
21
  this.logger = logger;
21
22
  this.typedOracle = typedOracle;
23
+ this.oraclesEnabled = true;
22
24
  }
23
25
  static async init(logger, protocolContracts) {
24
26
  logger.debug(`TXE service initialized`);
@@ -54,9 +56,7 @@ export class TXEService {
54
56
  }
55
57
  async deploy(artifact, instance, secret) {
56
58
  // Emit deployment nullifier
57
- this.typedOracle.addSiloedNullifiersFromPublic([
58
- await siloNullifier(AztecAddress.fromNumber(DEPLOYER_CONTRACT_ADDRESS), instance.address.toField())
59
- ]);
59
+ await this.typedOracle.noteCache.nullifierCreated(AztecAddress.fromNumber(DEPLOYER_CONTRACT_ADDRESS), instance.address.toField());
60
60
  if (!fromSingle(secret).equals(Fr.ZERO)) {
61
61
  await this.addAccount(artifact, instance, secret);
62
62
  } else {
@@ -155,17 +155,26 @@ export class TXEService {
155
155
  }
156
156
  // PXE oracles
157
157
  getRandomField() {
158
+ if (!this.oraclesEnabled) {
159
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
160
+ }
158
161
  return toForeignCallResult([
159
162
  toSingle(this.typedOracle.getRandomField())
160
163
  ]);
161
164
  }
162
165
  async getContractAddress() {
166
+ if (!this.oraclesEnabled) {
167
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
168
+ }
163
169
  const contractAddress = await this.typedOracle.getContractAddress();
164
170
  return toForeignCallResult([
165
171
  toSingle(contractAddress.toField())
166
172
  ]);
167
173
  }
168
174
  async getBlockNumber() {
175
+ if (!this.oraclesEnabled) {
176
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
177
+ }
169
178
  const blockNumber = await this.typedOracle.getBlockNumber();
170
179
  return toForeignCallResult([
171
180
  toSingle(new Fr(blockNumber))
@@ -173,10 +182,16 @@ export class TXEService {
173
182
  }
174
183
  // Since the argument is a slice, noir automatically adds a length field to oracle call.
175
184
  storeInExecutionCache(_length, values, hash) {
185
+ if (!this.oraclesEnabled) {
186
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
187
+ }
176
188
  this.typedOracle.storeInExecutionCache(fromArray(values), fromSingle(hash));
177
189
  return toForeignCallResult([]);
178
190
  }
179
191
  async loadFromExecutionCache(hash) {
192
+ if (!this.oraclesEnabled) {
193
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
194
+ }
180
195
  const returns = await this.typedOracle.loadFromExecutionCache(fromSingle(hash));
181
196
  return toForeignCallResult([
182
197
  toArray(returns)
@@ -202,6 +217,9 @@ export class TXEService {
202
217
  ]);
203
218
  }
204
219
  async getPublicDataWitness(blockNumber, leafSlot) {
220
+ if (!this.oraclesEnabled) {
221
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
222
+ }
205
223
  const parsedBlockNumber = fromSingle(blockNumber).toNumber();
206
224
  const parsedLeafSlot = fromSingle(leafSlot);
207
225
  const witness = await this.typedOracle.getPublicDataWitness(parsedBlockNumber, parsedLeafSlot);
@@ -210,59 +228,71 @@ export class TXEService {
210
228
  }
211
229
  return toForeignCallResult(witness.toNoirRepresentation());
212
230
  }
213
- async getNotes(storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status, returnSize) {
231
+ async getNotes(storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status, maxNotes, packedRetrievedNoteLength) {
232
+ if (!this.oraclesEnabled) {
233
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
234
+ }
214
235
  const noteDatas = await this.typedOracle.getNotes(fromSingle(storageSlot), fromSingle(numSelects).toNumber(), fromArray(selectByIndexes).map((fr)=>fr.toNumber()), fromArray(selectByOffsets).map((fr)=>fr.toNumber()), fromArray(selectByLengths).map((fr)=>fr.toNumber()), fromArray(selectValues), fromArray(selectComparators).map((fr)=>fr.toNumber()), fromArray(sortByIndexes).map((fr)=>fr.toNumber()), fromArray(sortByOffsets).map((fr)=>fr.toNumber()), fromArray(sortByLengths).map((fr)=>fr.toNumber()), fromArray(sortOrder).map((fr)=>fr.toNumber()), fromSingle(limit).toNumber(), fromSingle(offset).toNumber(), fromSingle(status).toNumber());
215
- const noteLength = noteDatas?.[0]?.note.items.length ?? 0;
216
- if (!noteDatas.every(({ note })=>noteLength === note.items.length)) {
217
- throw new Error('Notes should all be the same length.');
218
- }
219
- const contractAddress = noteDatas[0]?.contractAddress ?? Fr.ZERO;
220
- // Values indicates whether the note is settled or transient.
221
- const noteTypes = {
222
- isSettled: new Fr(0),
223
- isTransient: new Fr(1)
224
- };
225
- const flattenData = noteDatas.flatMap(({ nonce, note, index })=>[
236
+ if (noteDatas.length > 0) {
237
+ const noteLength = noteDatas[0].note.items.length;
238
+ if (!noteDatas.every(({ note })=>noteLength === note.items.length)) {
239
+ throw new Error('Notes should all be the same length.');
240
+ }
241
+ }
242
+ // The expected return type is a BoundedVec<[Field; packedRetrievedNoteLength], maxNotes> where each
243
+ // array is structured as [contract_address, nonce, nonzero_note_hash_counter, ...packed_note].
244
+ const returnDataAsArrayOfArrays = noteDatas.map(({ contractAddress, nonce, index, note })=>{
245
+ // If index is undefined, the note is transient which implies that the nonzero_note_hash_counter has to be true
246
+ const noteIsTransient = index === undefined;
247
+ const nonzeroNoteHashCounter = noteIsTransient ? true : false;
248
+ // If you change the array on the next line you have to change the `unpack_retrieved_note` function in
249
+ // `aztec/src/note/retrieved_note.nr`
250
+ return [
251
+ contractAddress,
226
252
  nonce,
227
- index === undefined ? noteTypes.isTransient : noteTypes.isSettled,
253
+ nonzeroNoteHashCounter,
228
254
  ...note.items
229
- ]);
230
- const returnFieldSize = fromSingle(returnSize).toNumber();
231
- const returnData = [
232
- noteDatas.length,
233
- contractAddress.toField(),
234
- ...flattenData
235
- ].map((v)=>new Fr(v));
236
- if (returnData.length > returnFieldSize) {
237
- throw new Error(`Return data size too big. Maximum ${returnFieldSize} fields. Got ${flattenData.length}.`);
238
- }
239
- const paddedZeros = Array(returnFieldSize - returnData.length).fill(new Fr(0));
240
- return toForeignCallResult([
241
- toArray([
242
- ...returnData,
243
- ...paddedZeros
244
- ])
245
- ]);
255
+ ];
256
+ });
257
+ // Now we convert each sub-array to an array of ForeignCallSingles
258
+ const returnDataAsArrayOfForeignCallSingleArrays = returnDataAsArrayOfArrays.map((subArray)=>subArray.map(toSingle));
259
+ // At last we convert the array of arrays to a bounded vec of arrays
260
+ return toForeignCallResult(arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfForeignCallSingleArrays, fromSingle(maxNotes).toNumber(), fromSingle(packedRetrievedNoteLength).toNumber()));
246
261
  }
247
262
  notifyCreatedNote(storageSlot, noteTypeId, note, noteHash, counter) {
263
+ if (!this.oraclesEnabled) {
264
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
265
+ }
248
266
  this.typedOracle.notifyCreatedNote(fromSingle(storageSlot), NoteSelector.fromField(fromSingle(noteTypeId)), fromArray(note), fromSingle(noteHash), fromSingle(counter).toNumber());
249
267
  return toForeignCallResult([]);
250
268
  }
251
269
  async notifyNullifiedNote(innerNullifier, noteHash, counter) {
270
+ if (!this.oraclesEnabled) {
271
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
272
+ }
252
273
  await this.typedOracle.notifyNullifiedNote(fromSingle(innerNullifier), fromSingle(noteHash), fromSingle(counter).toNumber());
253
274
  return toForeignCallResult([]);
254
275
  }
255
276
  async notifyCreatedNullifier(innerNullifier) {
277
+ if (!this.oraclesEnabled) {
278
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
279
+ }
256
280
  await this.typedOracle.notifyCreatedNullifier(fromSingle(innerNullifier));
257
281
  return toForeignCallResult([]);
258
282
  }
259
283
  async checkNullifierExists(innerNullifier) {
284
+ if (!this.oraclesEnabled) {
285
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
286
+ }
260
287
  const exists = await this.typedOracle.checkNullifierExists(fromSingle(innerNullifier));
261
288
  return toForeignCallResult([
262
289
  toSingle(new Fr(exists))
263
290
  ]);
264
291
  }
265
292
  async getContractInstance(address) {
293
+ if (!this.oraclesEnabled) {
294
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
295
+ }
266
296
  const instance = await this.typedOracle.getContractInstance(addressFromSingle(address));
267
297
  return toForeignCallResult([
268
298
  instance.salt,
@@ -273,6 +303,9 @@ export class TXEService {
273
303
  ].map(toSingle));
274
304
  }
275
305
  async getPublicKeysAndPartialAddress(address) {
306
+ if (!this.oraclesEnabled) {
307
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
308
+ }
276
309
  const parsedAddress = addressFromSingle(address);
277
310
  const { publicKeys, partialAddress } = await this.typedOracle.getCompleteAddress(parsedAddress);
278
311
  return toForeignCallResult([
@@ -283,10 +316,16 @@ export class TXEService {
283
316
  ]);
284
317
  }
285
318
  async getKeyValidationRequest(pkMHash) {
319
+ if (!this.oraclesEnabled) {
320
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
321
+ }
286
322
  const keyValidationRequest = await this.typedOracle.getKeyValidationRequest(fromSingle(pkMHash));
287
323
  return toForeignCallResult(keyValidationRequest.toFields().map(toSingle));
288
324
  }
289
325
  async callPrivateFunction(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
326
+ if (!this.oraclesEnabled) {
327
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
328
+ }
290
329
  const result = await this.typedOracle.callPrivateFunction(addressFromSingle(targetContractAddress), FunctionSelector.fromField(fromSingle(functionSelector)), fromSingle(argsHash), fromSingle(sideEffectCounter).toNumber(), fromSingle(isStaticCall).toBool());
291
330
  return toForeignCallResult([
292
331
  toArray([
@@ -296,6 +335,9 @@ export class TXEService {
296
335
  ]);
297
336
  }
298
337
  async getNullifierMembershipWitness(blockNumber, nullifier) {
338
+ if (!this.oraclesEnabled) {
339
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
340
+ }
299
341
  const parsedBlockNumber = fromSingle(blockNumber).toNumber();
300
342
  const witness = await this.typedOracle.getNullifierMembershipWitness(parsedBlockNumber, fromSingle(nullifier));
301
343
  if (!witness) {
@@ -304,6 +346,9 @@ export class TXEService {
304
346
  return toForeignCallResult(witness.toNoirRepresentation());
305
347
  }
306
348
  async getAuthWitness(messageHash) {
349
+ if (!this.oraclesEnabled) {
350
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
351
+ }
307
352
  const parsedMessageHash = fromSingle(messageHash);
308
353
  const authWitness = await this.typedOracle.getAuthWitness(parsedMessageHash);
309
354
  if (!authWitness) {
@@ -314,28 +359,46 @@ export class TXEService {
314
359
  ]);
315
360
  }
316
361
  async notifyEnqueuedPublicFunctionCall(targetContractAddress, calldataHash, sideEffectCounter, isStaticCall) {
362
+ if (!this.oraclesEnabled) {
363
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
364
+ }
317
365
  await this.typedOracle.notifyEnqueuedPublicFunctionCall(addressFromSingle(targetContractAddress), fromSingle(calldataHash), fromSingle(sideEffectCounter).toNumber(), fromSingle(isStaticCall).toBool());
318
366
  return toForeignCallResult([]);
319
367
  }
320
368
  async notifySetPublicTeardownFunctionCall(targetContractAddress, calldataHash, sideEffectCounter, isStaticCall) {
369
+ if (!this.oraclesEnabled) {
370
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
371
+ }
321
372
  await this.typedOracle.notifySetPublicTeardownFunctionCall(addressFromSingle(targetContractAddress), fromSingle(calldataHash), fromSingle(sideEffectCounter).toNumber(), fromSingle(isStaticCall).toBool());
322
373
  return toForeignCallResult([]);
323
374
  }
324
- notifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter) {
325
- this.typedOracle.notifySetMinRevertibleSideEffectCounter(fromSingle(minRevertibleSideEffectCounter).toNumber());
375
+ async notifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter) {
376
+ if (!this.oraclesEnabled) {
377
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
378
+ }
379
+ await this.typedOracle.notifySetMinRevertibleSideEffectCounter(fromSingle(minRevertibleSideEffectCounter).toNumber());
326
380
  return toForeignCallResult([]);
327
381
  }
328
382
  async getChainId() {
383
+ if (!this.oraclesEnabled) {
384
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
385
+ }
329
386
  return toForeignCallResult([
330
387
  toSingle(await this.typedOracle.getChainId())
331
388
  ]);
332
389
  }
333
390
  async getVersion() {
391
+ if (!this.oraclesEnabled) {
392
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
393
+ }
334
394
  return toForeignCallResult([
335
395
  toSingle(await this.typedOracle.getVersion())
336
396
  ]);
337
397
  }
338
398
  async getBlockHeader(blockNumber) {
399
+ if (!this.oraclesEnabled) {
400
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
401
+ }
339
402
  const header = await this.typedOracle.getBlockHeader(fromSingle(blockNumber).toNumber());
340
403
  if (!header) {
341
404
  throw new Error(`Block header not found for block ${blockNumber}.`);
@@ -343,6 +406,9 @@ export class TXEService {
343
406
  return toForeignCallResult(header.toFields().map(toSingle));
344
407
  }
345
408
  async getMembershipWitness(blockNumber, treeId, leafValue) {
409
+ if (!this.oraclesEnabled) {
410
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
411
+ }
346
412
  const parsedBlockNumber = fromSingle(blockNumber).toNumber();
347
413
  const parsedTreeId = fromSingle(treeId).toNumber();
348
414
  const parsedLeafValue = fromSingle(leafValue);
@@ -356,6 +422,9 @@ export class TXEService {
356
422
  ]);
357
423
  }
358
424
  async getLowNullifierMembershipWitness(blockNumber, nullifier) {
425
+ if (!this.oraclesEnabled) {
426
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
427
+ }
359
428
  const parsedBlockNumber = fromSingle(blockNumber).toNumber();
360
429
  const witness = await this.typedOracle.getLowNullifierMembershipWitness(parsedBlockNumber, fromSingle(nullifier));
361
430
  if (!witness) {
@@ -364,20 +433,32 @@ export class TXEService {
364
433
  return toForeignCallResult(witness.toNoirRepresentation());
365
434
  }
366
435
  async getIndexedTaggingSecretAsSender(sender, recipient) {
436
+ if (!this.oraclesEnabled) {
437
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
438
+ }
367
439
  const secret = await this.typedOracle.getIndexedTaggingSecretAsSender(AztecAddress.fromField(fromSingle(sender)), AztecAddress.fromField(fromSingle(recipient)));
368
440
  return toForeignCallResult(secret.toFields().map(toSingle));
369
441
  }
370
442
  async syncNotes(pendingTaggedLogArrayBaseSlot) {
443
+ if (!this.oraclesEnabled) {
444
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
445
+ }
371
446
  await this.typedOracle.syncNotes(fromSingle(pendingTaggedLogArrayBaseSlot));
372
447
  return toForeignCallResult([]);
373
448
  }
374
449
  async deliverNote(contractAddress, storageSlot, nonce, content, contentLength, noteHash, nullifier, txHash, recipient) {
450
+ if (!this.oraclesEnabled) {
451
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
452
+ }
375
453
  await this.typedOracle.deliverNote(AztecAddress.fromField(fromSingle(contractAddress)), fromSingle(storageSlot), fromSingle(nonce), fromArray(content.slice(0, Number(BigInt(contentLength)))), fromSingle(noteHash), fromSingle(nullifier), new TxHash(fromSingle(txHash)), AztecAddress.fromField(fromSingle(recipient)));
376
454
  return toForeignCallResult([
377
455
  toSingle(Fr.ONE)
378
456
  ]);
379
457
  }
380
458
  async getLogByTag(tag) {
459
+ if (!this.oraclesEnabled) {
460
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
461
+ }
381
462
  // TODO(AD): this was warning that getLogByTag did not return a promise.
382
463
  const log = await Promise.resolve(this.typedOracle.getLogByTag(fromSingle(tag)));
383
464
  if (log == null) {
@@ -393,10 +474,16 @@ export class TXEService {
393
474
  }
394
475
  }
395
476
  async storeCapsule(contractAddress, slot, capsule) {
477
+ if (!this.oraclesEnabled) {
478
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
479
+ }
396
480
  await this.typedOracle.storeCapsule(AztecAddress.fromField(fromSingle(contractAddress)), fromSingle(slot), fromArray(capsule));
397
481
  return toForeignCallResult([]);
398
482
  }
399
483
  async loadCapsule(contractAddress, slot, tSize) {
484
+ if (!this.oraclesEnabled) {
485
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
486
+ }
400
487
  const values = await this.typedOracle.loadCapsule(AztecAddress.fromField(fromSingle(contractAddress)), fromSingle(slot));
401
488
  // We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
402
489
  // with two fields: `some` (a boolean) and `value` (a field array in this case).
@@ -415,10 +502,16 @@ export class TXEService {
415
502
  }
416
503
  }
417
504
  async deleteCapsule(contractAddress, slot) {
505
+ if (!this.oraclesEnabled) {
506
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
507
+ }
418
508
  await this.typedOracle.deleteCapsule(AztecAddress.fromField(fromSingle(contractAddress)), fromSingle(slot));
419
509
  return toForeignCallResult([]);
420
510
  }
421
511
  async copyCapsule(contractAddress, srcSlot, dstSlot, numEntries) {
512
+ if (!this.oraclesEnabled) {
513
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
514
+ }
422
515
  await this.typedOracle.copyCapsule(AztecAddress.fromField(fromSingle(contractAddress)), fromSingle(srcSlot), fromSingle(dstSlot), fromSingle(numEntries).toNumber());
423
516
  return toForeignCallResult([]);
424
517
  }
@@ -427,6 +520,9 @@ export class TXEService {
427
520
  // to implement this function here. Isn't there a way to programmatically identify that this is missing, given the
428
521
  // existence of a txe_oracle method?
429
522
  async aes128Decrypt(ciphertextBVecStorage, ciphertextLength, iv, symKey) {
523
+ if (!this.oraclesEnabled) {
524
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
525
+ }
430
526
  const ciphertext = fromUintBoundedVec(ciphertextBVecStorage, ciphertextLength, 8);
431
527
  const ivBuffer = fromUintArray(iv, 8);
432
528
  const symKeyBuffer = fromUintArray(symKey, 8);
@@ -434,6 +530,9 @@ export class TXEService {
434
530
  return toForeignCallResult(arrayToBoundedVec(bufferToU8Array(plaintextBuffer), ciphertextBVecStorage.length));
435
531
  }
436
532
  async getSharedSecret(address, ephPKField0, ephPKField1, ephPKField2) {
533
+ if (!this.oraclesEnabled) {
534
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
535
+ }
437
536
  const secret = await this.typedOracle.getSharedSecret(AztecAddress.fromField(fromSingle(address)), Point.fromFields([
438
537
  fromSingle(ephPKField0),
439
538
  fromSingle(ephPKField1),
@@ -442,27 +541,42 @@ export class TXEService {
442
541
  return toForeignCallResult(secret.toFields().map(toSingle));
443
542
  }
444
543
  async storePrivateEventLog(contractAddress, recipient, eventSelector, logContent, txHash, logIndexInTx, txIndexInBlock) {
544
+ if (!this.oraclesEnabled) {
545
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
546
+ }
445
547
  await this.typedOracle.storePrivateEventLog(AztecAddress.fromField(fromSingle(contractAddress)), AztecAddress.fromField(fromSingle(recipient)), EventSelector.fromField(fromSingle(eventSelector)), fromArray(logContent), new TxHash(fromSingle(txHash)), fromSingle(logIndexInTx).toNumber(), fromSingle(txIndexInBlock).toNumber());
446
548
  return toForeignCallResult([]);
447
549
  }
448
550
  // AVM opcodes
449
551
  avmOpcodeEmitUnencryptedLog(_message) {
552
+ if (!this.oraclesEnabled) {
553
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
554
+ }
450
555
  // TODO(#8811): Implement
451
556
  return toForeignCallResult([]);
452
557
  }
453
558
  async avmOpcodeStorageRead(slot) {
559
+ if (!this.oraclesEnabled) {
560
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
561
+ }
454
562
  const value = (await this.typedOracle.avmOpcodeStorageRead(fromSingle(slot))).value;
455
563
  return toForeignCallResult([
456
564
  toSingle(new Fr(value))
457
565
  ]);
458
566
  }
459
567
  async avmOpcodeStorageWrite(slot, value) {
568
+ if (!this.oraclesEnabled) {
569
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
570
+ }
460
571
  await this.typedOracle.storageWrite(fromSingle(slot), [
461
572
  fromSingle(value)
462
573
  ]);
463
574
  return toForeignCallResult([]);
464
575
  }
465
576
  async avmOpcodeGetContractInstanceDeployer(address) {
577
+ if (!this.oraclesEnabled) {
578
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
579
+ }
466
580
  const instance = await this.typedOracle.getContractInstance(addressFromSingle(address));
467
581
  return toForeignCallResult([
468
582
  toSingle(instance.deployer),
@@ -471,6 +585,9 @@ export class TXEService {
471
585
  ]);
472
586
  }
473
587
  async avmOpcodeGetContractInstanceClassId(address) {
588
+ if (!this.oraclesEnabled) {
589
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
590
+ }
474
591
  const instance = await this.typedOracle.getContractInstance(addressFromSingle(address));
475
592
  return toForeignCallResult([
476
593
  toSingle(instance.currentContractClassId),
@@ -479,6 +596,9 @@ export class TXEService {
479
596
  ]);
480
597
  }
481
598
  async avmOpcodeGetContractInstanceInitializationHash(address) {
599
+ if (!this.oraclesEnabled) {
600
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
601
+ }
482
602
  const instance = await this.typedOracle.getContractInstance(addressFromSingle(address));
483
603
  return toForeignCallResult([
484
604
  toSingle(instance.initializationHash),
@@ -487,62 +607,95 @@ export class TXEService {
487
607
  ]);
488
608
  }
489
609
  avmOpcodeSender() {
610
+ if (!this.oraclesEnabled) {
611
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
612
+ }
490
613
  const sender = this.typedOracle.getMsgSender();
491
614
  return toForeignCallResult([
492
615
  toSingle(sender)
493
616
  ]);
494
617
  }
495
618
  async avmOpcodeEmitNullifier(nullifier) {
619
+ if (!this.oraclesEnabled) {
620
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
621
+ }
496
622
  await this.typedOracle.avmOpcodeEmitNullifier(fromSingle(nullifier));
497
623
  return toForeignCallResult([]);
498
624
  }
499
625
  async avmOpcodeEmitNoteHash(noteHash) {
626
+ if (!this.oraclesEnabled) {
627
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
628
+ }
500
629
  await this.typedOracle.avmOpcodeEmitNoteHash(fromSingle(noteHash));
501
630
  return toForeignCallResult([]);
502
631
  }
503
632
  async avmOpcodeNullifierExists(innerNullifier, targetAddress) {
633
+ if (!this.oraclesEnabled) {
634
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
635
+ }
504
636
  const exists = await this.typedOracle.avmOpcodeNullifierExists(fromSingle(innerNullifier), AztecAddress.fromField(fromSingle(targetAddress)));
505
637
  return toForeignCallResult([
506
638
  toSingle(new Fr(exists))
507
639
  ]);
508
640
  }
509
641
  async avmOpcodeAddress() {
642
+ if (!this.oraclesEnabled) {
643
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
644
+ }
510
645
  const contractAddress = await this.typedOracle.getContractAddress();
511
646
  return toForeignCallResult([
512
647
  toSingle(contractAddress.toField())
513
648
  ]);
514
649
  }
515
650
  async avmOpcodeBlockNumber() {
651
+ if (!this.oraclesEnabled) {
652
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
653
+ }
516
654
  const blockNumber = await this.typedOracle.getBlockNumber();
517
655
  return toForeignCallResult([
518
656
  toSingle(new Fr(blockNumber))
519
657
  ]);
520
658
  }
521
659
  avmOpcodeIsStaticCall() {
660
+ if (!this.oraclesEnabled) {
661
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
662
+ }
522
663
  const isStaticCall = this.typedOracle.getIsStaticCall();
523
664
  return toForeignCallResult([
524
665
  toSingle(new Fr(isStaticCall ? 1 : 0))
525
666
  ]);
526
667
  }
527
668
  async avmOpcodeChainId() {
669
+ if (!this.oraclesEnabled) {
670
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
671
+ }
528
672
  const chainId = await this.typedOracle.getChainId();
529
673
  return toForeignCallResult([
530
674
  toSingle(chainId)
531
675
  ]);
532
676
  }
533
677
  async avmOpcodeVersion() {
678
+ if (!this.oraclesEnabled) {
679
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
680
+ }
534
681
  const version = await this.typedOracle.getVersion();
535
682
  return toForeignCallResult([
536
683
  toSingle(version)
537
684
  ]);
538
685
  }
539
686
  avmOpcodeReturndataSize() {
687
+ if (!this.oraclesEnabled) {
688
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
689
+ }
540
690
  const size = this.typedOracle.avmOpcodeReturndataSize();
541
691
  return toForeignCallResult([
542
692
  toSingle(new Fr(size))
543
693
  ]);
544
694
  }
545
695
  avmOpcodeReturndataCopy(rdOffset, copySize) {
696
+ if (!this.oraclesEnabled) {
697
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
698
+ }
546
699
  const returndata = this.typedOracle.avmOpcodeReturndataCopy(fromSingle(rdOffset).toNumber(), fromSingle(copySize).toNumber());
547
700
  // This is a slice, so we need to return the length as well.
548
701
  return toForeignCallResult([
@@ -551,6 +704,9 @@ export class TXEService {
551
704
  ]);
552
705
  }
553
706
  async avmOpcodeCall(_l2Gas, _daGas, address, _length, args) {
707
+ if (!this.oraclesEnabled) {
708
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
709
+ }
554
710
  const result = await this.typedOracle.avmOpcodeCall(addressFromSingle(address), fromArray(args), /* isStaticCall */ false);
555
711
  // Poor man's revert handling
556
712
  if (!result.revertCode.isOK()) {
@@ -564,6 +720,9 @@ export class TXEService {
564
720
  return toForeignCallResult([]);
565
721
  }
566
722
  async avmOpcodeStaticCall(_l2Gas, _daGas, address, _length, args) {
723
+ if (!this.oraclesEnabled) {
724
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
725
+ }
567
726
  const result = await this.typedOracle.avmOpcodeCall(addressFromSingle(address), fromArray(args), /* isStaticCall */ true);
568
727
  // Poor man's revert handling
569
728
  if (!result.revertCode.isOK()) {
@@ -577,9 +736,34 @@ export class TXEService {
577
736
  return toForeignCallResult([]);
578
737
  }
579
738
  avmOpcodeSuccessCopy() {
739
+ if (!this.oraclesEnabled) {
740
+ throw new Error('Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.');
741
+ }
580
742
  const success = this.typedOracle.avmOpcodeSuccessCopy();
581
743
  return toForeignCallResult([
582
744
  toSingle(new Fr(success))
583
745
  ]);
584
746
  }
747
+ async privateCallNewFlow(from, targetContractAddress, functionSelector, _argsLength, args, argsHash, isStaticCall) {
748
+ const result = await this.typedOracle.privateCallNewFlow(addressFromSingle(from), addressFromSingle(targetContractAddress), FunctionSelector.fromField(fromSingle(functionSelector)), fromArray(args), fromSingle(argsHash), fromSingle(isStaticCall).toBool());
749
+ return toForeignCallResult([
750
+ toArray([
751
+ result.endSideEffectCounter,
752
+ result.returnsHash,
753
+ result.txHash
754
+ ])
755
+ ]);
756
+ }
757
+ disableOracles() {
758
+ this.oraclesEnabled = false;
759
+ }
760
+ enableOracles() {
761
+ this.oraclesEnabled = true;
762
+ }
763
+ async simulateUtilityFunction(targetContractAddress, functionSelector, argsHash) {
764
+ const result = await this.typedOracle.simulateUtilityFunction(addressFromSingle(targetContractAddress), FunctionSelector.fromField(fromSingle(functionSelector)), fromSingle(argsHash));
765
+ return toForeignCallResult([
766
+ toSingle(result)
767
+ ]);
768
+ }
585
769
  }
@@ -1,5 +1,4 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
1
+ import type { EthAddress } from '@aztec/foundation/eth-address';
3
2
  import { Fr } from '@aztec/foundation/fields';
4
3
  import { type ContractArtifact } from '@aztec/stdlib/abi';
5
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
@@ -30,7 +29,7 @@ export declare function fromUintArray(obj: ForeignCallArray, uintBitSize: number
30
29
  * @returns A buffer containing the unsigned integers tightly packed
31
30
  */
32
31
  export declare function fromUintBoundedVec(storage: ForeignCallArray, length: ForeignCallSingle, uintBitSize: number): Buffer;
33
- export declare function toSingle(obj: Fr | AztecAddress): ForeignCallSingle;
32
+ export declare function toSingle(value: AztecAddress | EthAddress | Fr | Buffer | boolean | number | bigint): ForeignCallSingle;
34
33
  export declare function toArray(objs: Fr[]): ForeignCallArray;
35
34
  export declare function toSingleOrArray(value: Fr | Fr[]): string | string[];
36
35
  export declare function bufferToU8Array(buffer: Buffer): ForeignCallArray;
@@ -43,6 +42,14 @@ export declare function bufferToU8Array(buffer: Buffer): ForeignCallArray;
43
42
  * @returns a tuple representing a BoundedVec.
44
43
  */
45
44
  export declare function arrayToBoundedVec(bVecStorage: ForeignCallArray, maxLen: number): [ForeignCallArray, ForeignCallSingle];
45
+ /**
46
+ * Converts an array of arrays representing Noir BoundedVec of nested arrays into its Noir serialized form.
47
+ * @param bVecStorage - The array underlying the BoundedVec.
48
+ * @param maxLen - The max length of the BoundedVec (max num of the nested arrays in the BoundedVec).
49
+ * @param nestedArrayLength - The length of the nested arrays (each nested array has to have the same length).
50
+ * @returns Serialized BoundedVec following Noir intrinsic serialization.
51
+ */
52
+ export declare function arrayOfArraysToBoundedVecOfArrays(bVecStorage: ForeignCallArray[], maxLen: number, nestedArrayLength: number): [ForeignCallArray, ForeignCallSingle];
46
53
  export declare function toForeignCallResult(obj: (ForeignCallSingle | ForeignCallArray)[]): {
47
54
  values: (string | ForeignCallArray)[];
48
55
  };
@@ -78,8 +85,8 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
78
85
  }>;
79
86
  }, "strip", z.ZodTypeAny, {
80
87
  version: 1;
81
- publicKeys: import("@aztec/stdlib/keys").PublicKeys;
82
88
  salt: Fr;
89
+ publicKeys: import("@aztec/stdlib/keys").PublicKeys;
83
90
  deployer: AztecAddress;
84
91
  currentContractClassId: Fr;
85
92
  originalContractClassId: Fr;
@@ -1 +1 @@
1
- {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../src/util/encoding.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,KAAK,gBAAgB,EAA0B,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,KAAK,2BAA2B,EAAqC,MAAM,wBAAwB,CAAC;AAE7G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,gBAAgB,GAAG,MAAM,EAAE,CAAC;AAExC,MAAM,MAAM,eAAe,GAAG,CAAC,iBAAiB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,2BAA2B,CAAC,EAAE,CAAC;AAExH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,EAAE,CAAC;CAClD,CAAC;AAEF,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,MAEhD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,gBAEvD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,gBAAgB,QAE9C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAMhF;AAED;;;;;;;;GAQG;AACH,wBAAgB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