@aztec-labs/pxe 6.0.0-rc.2 → 6.0.0-rc.4

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 (103) hide show
  1. package/dest/config/index.d.ts +1 -1
  2. package/dest/config/index.d.ts.map +1 -1
  3. package/dest/config/index.js +2 -1
  4. package/dest/contract_function_simulator/index.d.ts +2 -2
  5. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  6. package/dest/contract_function_simulator/index.js +1 -1
  7. package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts +6 -12
  8. package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts.map +1 -1
  9. package/dest/contract_function_simulator/noir-structs/fact_collection.js +1 -15
  10. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +7 -7
  11. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
  12. package/dest/contract_function_simulator/oracle/oracle_registry.js +19 -15
  13. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +5 -2
  14. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
  15. package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +26 -2
  16. package/dest/contract_function_simulator/oracle/private_execution.d.ts +1 -1
  17. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  18. package/dest/contract_function_simulator/oracle/private_execution.js +1 -0
  19. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +15 -7
  20. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  21. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +19 -3
  22. package/dest/contract_function_simulator/pick_notes.d.ts +1 -1
  23. package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
  24. package/dest/contract_function_simulator/pick_notes.js +1 -0
  25. package/dest/entrypoints/server/circuit_recording/simulator_recorder_wrapper.d.ts +1 -1
  26. package/dest/entrypoints/server/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -1
  27. package/dest/entrypoints/server/circuit_recording/simulator_recorder_wrapper.js +1 -0
  28. package/dest/entrypoints/server/utils.d.ts +1 -1
  29. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  30. package/dest/entrypoints/server/utils.js +3 -1
  31. package/dest/oracle_version.d.ts +3 -3
  32. package/dest/oracle_version.js +3 -3
  33. package/dest/private_kernel/batch_planner.d.ts +1 -1
  34. package/dest/private_kernel/batch_planner.d.ts.map +1 -1
  35. package/dest/private_kernel/batch_planner.js +1 -0
  36. package/dest/private_kernel/hints/test_utils.d.ts +1 -1
  37. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -1
  38. package/dest/private_kernel/hints/test_utils.js +1 -0
  39. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  40. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  41. package/dest/private_kernel/private_kernel_execution_prover.js +1 -0
  42. package/dest/pxe.d.ts +27 -2
  43. package/dest/pxe.d.ts.map +1 -1
  44. package/dest/pxe.js +201 -128
  45. package/dest/storage/address_store/address_store.d.ts +1 -1
  46. package/dest/storage/address_store/address_store.d.ts.map +1 -1
  47. package/dest/storage/address_store/address_store.js +1 -0
  48. package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts +1 -1
  49. package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts.map +1 -1
  50. package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.js +1 -0
  51. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +1 -1
  52. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -1
  53. package/dest/storage/backwards_compatibility_tests/schema_tests.js +23 -1
  54. package/dest/storage/contract_store/contract_store.d.ts +2 -1
  55. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  56. package/dest/storage/contract_store/contract_store.js +1 -0
  57. package/dest/storage/fact_store/fact_scope.d.ts +19 -0
  58. package/dest/storage/fact_store/fact_scope.d.ts.map +1 -0
  59. package/dest/storage/fact_store/fact_scope.js +37 -0
  60. package/dest/storage/fact_store/fact_service.d.ts +2 -2
  61. package/dest/storage/fact_store/fact_service.d.ts.map +1 -1
  62. package/dest/storage/fact_store/fact_service.js +19 -5
  63. package/dest/storage/fact_store/fact_store_keys.d.ts +6 -5
  64. package/dest/storage/fact_store/fact_store_keys.d.ts.map +1 -1
  65. package/dest/storage/fact_store/fact_store_keys.js +24 -8
  66. package/dest/storage/fact_store/index.d.ts +2 -1
  67. package/dest/storage/fact_store/index.d.ts.map +1 -1
  68. package/dest/storage/fact_store/index.js +1 -0
  69. package/dest/storage/fact_store/stored_fact.d.ts +9 -3
  70. package/dest/storage/fact_store/stored_fact.d.ts.map +1 -1
  71. package/dest/storage/fact_store/stored_fact.js +45 -3
  72. package/dest/storage/store_identity.d.ts +1 -1
  73. package/dest/storage/store_identity.d.ts.map +1 -1
  74. package/dest/storage/store_identity.js +1 -0
  75. package/package.json +21 -20
  76. package/src/config/index.ts +2 -1
  77. package/src/contract_function_simulator/index.ts +1 -0
  78. package/src/contract_function_simulator/noir-structs/fact_collection.ts +6 -22
  79. package/src/contract_function_simulator/oracle/oracle_registry.ts +15 -15
  80. package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +21 -1
  81. package/src/contract_function_simulator/oracle/private_execution.ts +1 -0
  82. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +34 -8
  83. package/src/contract_function_simulator/pick_notes.ts +1 -0
  84. package/src/entrypoints/server/circuit_recording/simulator_recorder_wrapper.ts +1 -0
  85. package/src/entrypoints/server/utils.ts +4 -2
  86. package/src/oracle_version.ts +3 -3
  87. package/src/private_kernel/batch_planner.ts +1 -0
  88. package/src/private_kernel/hints/test_utils.ts +1 -0
  89. package/src/private_kernel/private_kernel_execution_prover.ts +1 -0
  90. package/src/pxe.ts +291 -189
  91. package/src/storage/address_store/address_store.ts +1 -0
  92. package/src/storage/backwards_compatibility_tests/__snapshots__/AddressStore.json +6 -6
  93. package/src/storage/backwards_compatibility_tests/__snapshots__/FactStore.json +20 -0
  94. package/src/storage/backwards_compatibility_tests/__snapshots__/KeyStore.json +12 -12
  95. package/src/storage/backwards_compatibility_tests/kv_store_snapshot.ts +1 -0
  96. package/src/storage/backwards_compatibility_tests/schema_tests.ts +18 -1
  97. package/src/storage/contract_store/contract_store.ts +1 -0
  98. package/src/storage/fact_store/fact_scope.ts +39 -0
  99. package/src/storage/fact_store/fact_service.ts +20 -5
  100. package/src/storage/fact_store/fact_store_keys.ts +28 -15
  101. package/src/storage/fact_store/index.ts +1 -0
  102. package/src/storage/fact_store/stored_fact.ts +50 -14
  103. package/src/storage/store_identity.ts +1 -0
@@ -3,7 +3,6 @@ import { ARCHIVE_HEIGHT, L1_TO_L2_MSG_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT } from
3
3
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
4
  import { FieldReader } from '@aztec-labs/foundation/serialize';
5
5
  import { toACVMField } from '@aztec-labs/simulator/client';
6
- import type { UnsiloedMessageNullifier } from '@aztec-labs/stdlib/messaging';
7
6
 
8
7
  import {
9
8
  ARRAY,
@@ -20,6 +19,7 @@ import {
20
19
  EPHEMERAL_ARRAY,
21
20
  EVENT_VALIDATION_REQUEST,
22
21
  FACT_COLLECTION,
22
+ FACT_SCOPE,
23
23
  FIELD,
24
24
  FIXED_ARRAY,
25
25
  FUNCTION_SELECTOR,
@@ -45,12 +45,12 @@ import {
45
45
  RESOLVED_TAGGING_STRATEGY,
46
46
  RESOLVED_TX,
47
47
  STR,
48
- STRUCT,
49
48
  TX_EFFECT,
50
49
  TX_HASH,
51
50
  type TypeMapping,
52
51
  U8,
53
52
  U32,
53
+ UNSILOED_MESSAGE_NULLIFIER,
54
54
  UTILITY_CONTEXT,
55
55
  assertReadersConsumed,
56
56
  slotsOf,
@@ -194,19 +194,19 @@ export const ORACLE_REGISTRY = {
194
194
  aztec_utl_getL1ToL2MembershipWitnessV2: makeEntry({
195
195
  params: [
196
196
  { name: 'messageHash', type: FIELD },
197
- {
198
- name: 'nullifier',
199
- type: OPTION(
200
- STRUCT<UnsiloedMessageNullifier>([
201
- { name: 'contractAddress', type: AZTEC_ADDRESS },
202
- { name: 'nullifier', type: FIELD },
203
- ]),
204
- ),
205
- },
197
+ { name: 'nullifier', type: OPTION(UNSILOED_MESSAGE_NULLIFIER) },
206
198
  ],
207
199
  returnType: MEMBERSHIP_WITNESS(L1_TO_L2_MSG_TREE_HEIGHT),
208
200
  }),
209
201
 
202
+ aztec_utl_tryGetL1ToL2MembershipWitness: makeEntry({
203
+ params: [
204
+ { name: 'messageHash', type: FIELD },
205
+ { name: 'nullifier', type: OPTION(UNSILOED_MESSAGE_NULLIFIER) },
206
+ ],
207
+ returnType: OPTION(MEMBERSHIP_WITNESS(L1_TO_L2_MSG_TREE_HEIGHT)),
208
+ }),
209
+
210
210
  aztec_utl_getFromPublicStorage: makeEntry({
211
211
  params: [
212
212
  { name: 'blockHash', type: BLOCK_HASH },
@@ -354,7 +354,7 @@ export const ORACLE_REGISTRY = {
354
354
  aztec_utl_recordFact: makeEntry({
355
355
  params: [
356
356
  { name: 'contractAddress', type: AZTEC_ADDRESS },
357
- { name: 'scope', type: AZTEC_ADDRESS },
357
+ { name: 'scope', type: FACT_SCOPE },
358
358
  { name: 'factCollectionTypeId', type: FIELD },
359
359
  { name: 'factCollectionId', type: FIELD },
360
360
  { name: 'factTypeId', type: FIELD },
@@ -366,7 +366,7 @@ export const ORACLE_REGISTRY = {
366
366
  aztec_utl_deleteFactCollection: makeEntry({
367
367
  params: [
368
368
  { name: 'contractAddress', type: AZTEC_ADDRESS },
369
- { name: 'scope', type: AZTEC_ADDRESS },
369
+ { name: 'scope', type: FACT_SCOPE },
370
370
  { name: 'factCollectionTypeId', type: FIELD },
371
371
  { name: 'factCollectionId', type: FIELD },
372
372
  ],
@@ -375,7 +375,7 @@ export const ORACLE_REGISTRY = {
375
375
  aztec_utl_getFactCollection: makeEntry({
376
376
  params: [
377
377
  { name: 'contractAddress', type: AZTEC_ADDRESS },
378
- { name: 'scope', type: AZTEC_ADDRESS },
378
+ { name: 'scope', type: FACT_SCOPE },
379
379
  { name: 'factCollectionTypeId', type: FIELD },
380
380
  { name: 'factCollectionId', type: FIELD },
381
381
  ],
@@ -385,7 +385,7 @@ export const ORACLE_REGISTRY = {
385
385
  aztec_utl_getFactCollectionsByType: makeEntry({
386
386
  params: [
387
387
  { name: 'contractAddress', type: AZTEC_ADDRESS },
388
- { name: 'scope', type: AZTEC_ADDRESS },
388
+ { name: 'scope', type: FACT_SCOPE },
389
389
  { name: 'factCollectionTypeId', type: FIELD },
390
390
  ],
391
391
  returnType: EPHEMERAL_ARRAY(FACT_COLLECTION),
@@ -34,6 +34,7 @@ import {
34
34
  Tag,
35
35
  appTaggingSecretKindFromDeliveryMode,
36
36
  } from '@aztec-labs/stdlib/logs';
37
+ import type { UnsiloedMessageNullifier } from '@aztec-labs/stdlib/messaging';
37
38
  import type {
38
39
  AppendOnlyTreeSnapshot,
39
40
  NullifierLeaf,
@@ -48,11 +49,15 @@ import {
48
49
  type StateReference,
49
50
  TxHash,
50
51
  } from '@aztec-labs/stdlib/tx';
52
+ import { Buffer } from 'buffer';
51
53
 
52
54
  import {
53
55
  type BlockReference,
56
+ type FactScope,
54
57
  type OriginBlockState,
55
58
  type RetractableFactOrigin,
59
+ factScopeFromFields,
60
+ factScopeToFields,
56
61
  originBlockStateFromNumber,
57
62
  } from '../../storage/fact_store/index.js';
58
63
  import { BoundedVec } from '../noir-structs/bounded_vec.js';
@@ -550,6 +555,11 @@ export const BLOCK_REFERENCE: TypeMapping<BlockReference> = STRUCT([
550
555
  { name: 'blockHash', type: FIELD },
551
556
  ]);
552
557
 
558
+ export const UNSILOED_MESSAGE_NULLIFIER: TypeMapping<UnsiloedMessageNullifier> = STRUCT([
559
+ { name: 'contractAddress', type: AZTEC_ADDRESS },
560
+ { name: 'nullifier', type: FIELD },
561
+ ]);
562
+
553
563
  export const NULLIFIER_STATUS: TypeMapping<NullifierStatus> = STRUCT([
554
564
  { name: 'exists', type: BOOL },
555
565
  { name: 'originBlock', type: OPTION(BLOCK_REFERENCE) },
@@ -579,9 +589,19 @@ export const FACT: TypeMapping<Fact> = STRUCT([
579
589
  { name: 'originBlock', type: OPTION(RETRACTABLE_FACT_ORIGIN) },
580
590
  ]);
581
591
 
592
+ export const FACT_SCOPE: TypeMapping<FactScope> = LEAF({
593
+ kind: 'fact-scope',
594
+ serialization: { fn: scope => factScopeToFields(scope) },
595
+ deserialization: {
596
+ fn: ([kindReader, accountReader]) =>
597
+ factScopeFromFields(kindReader.readField().toNumber(), accountReader.readField()),
598
+ },
599
+ shape: ['scalar', 'scalar'],
600
+ });
601
+
582
602
  export const FACT_COLLECTION: TypeMapping<FactCollection> = STRUCT([
583
603
  { name: 'contractAddress', type: AZTEC_ADDRESS },
584
- { name: 'scope', type: AZTEC_ADDRESS },
604
+ { name: 'scope', type: FACT_SCOPE },
585
605
  { name: 'factCollectionTypeId', type: FIELD },
586
606
  { name: 'factCollectionId', type: FIELD },
587
607
  { name: 'facts', type: EPHEMERAL_ARRAY(FACT) },
@@ -20,6 +20,7 @@ import type { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
20
20
  import { PrivateCircuitPublicInputs } from '@aztec-labs/stdlib/kernel';
21
21
  import type { CircuitWitnessGenerationStats } from '@aztec-labs/stdlib/stats';
22
22
  import { PrivateCallExecutionResult } from '@aztec-labs/stdlib/tx';
23
+ import { Buffer } from 'buffer';
23
24
 
24
25
  import { buildACIRCallback } from './acir_callback.js';
25
26
  import type { PrivateExecutionOracle } from './private_execution_oracle.js';
@@ -32,7 +32,11 @@ import { type AztecNode, MAX_RPC_LEN } from '@aztec-labs/stdlib/interfaces/clien
32
32
  import type { KeyValidationRequest } from '@aztec-labs/stdlib/kernel';
33
33
  import { PublicKeys, computeAddressSecret, hashPublicKey } from '@aztec-labs/stdlib/keys';
34
34
  import { AppTaggingSecret, FlatPublicLogs, appSiloEcdhSharedSecret } from '@aztec-labs/stdlib/logs';
35
- import { type UnsiloedMessageNullifier, getL1ToL2MessageWitness } from '@aztec-labs/stdlib/messaging';
35
+ import {
36
+ type UnsiloedMessageNullifier,
37
+ getL1ToL2MessageWitness,
38
+ lookUpL1ToL2MessageWitness,
39
+ } from '@aztec-labs/stdlib/messaging';
36
40
  import { NoteStatus } from '@aztec-labs/stdlib/note';
37
41
  import { MerkleTreeId } from '@aztec-labs/stdlib/trees';
38
42
  import {
@@ -44,6 +48,7 @@ import {
44
48
  type TxHash,
45
49
  type TxReceipt,
46
50
  } from '@aztec-labs/stdlib/tx';
51
+ import { Buffer } from 'buffer';
47
52
 
48
53
  import type { ContractSyncService } from '../../contract/contract_sync_service.js';
49
54
  import { createContractLogger, logContractMessage, stripAztecnrLogPrefix } from '../../contract_logging.js';
@@ -58,7 +63,7 @@ import type { AddressStore } from '../../storage/address_store/address_store.js'
58
63
  import { assertAllowedScope } from '../../storage/allowed_scopes.js';
59
64
  import type { CapsuleService } from '../../storage/capsule_store/capsule_service.js';
60
65
  import { FactCollectionKey, FactCollectionTypeKey, anchoredTipBlockNumbers } from '../../storage/fact_store/index.js';
61
- import type { BlockReference, FactService } from '../../storage/fact_store/index.js';
66
+ import type { BlockReference, FactScope, FactService } from '../../storage/fact_store/index.js';
62
67
  import type { NoteStore } from '../../storage/note_store/note_store.js';
63
68
  import type { PrivateEventStore } from '../../storage/private_event_store/private_event_store.js';
64
69
  import type { ChangeSetId } from '../../storage/staged_write_coordinator.js';
@@ -70,7 +75,7 @@ import { BoundedVec } from '../noir-structs/bounded_vec.js';
70
75
  import type { EmbeddedCurvePoint } from '../noir-structs/embedded_curve_point.js';
71
76
  import { EphemeralArray } from '../noir-structs/ephemeral_array.js';
72
77
  import type { EventValidationRequest } from '../noir-structs/event_validation_request.js';
73
- import { type FactCollection, emptyFactCollection, toNoirFactCollection } from '../noir-structs/fact_collection.js';
78
+ import { type FactCollection, toNoirFactCollection } from '../noir-structs/fact_collection.js';
74
79
  import type { LogRetrievalRequest } from '../noir-structs/log_retrieval_request.js';
75
80
  import type { LogRetrievalResponse } from '../noir-structs/log_retrieval_response.js';
76
81
  import type { NoteData } from '../noir-structs/note_data.js';
@@ -587,6 +592,27 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
587
592
  return new MembershipWitness(L1_TO_L2_MSG_TREE_HEIGHT, messageIndex, siblingPath.toTuple());
588
593
  }
589
594
 
595
+ /**
596
+ * Returns the membership witness of an L1 to L2 message, or none if there is no such message.
597
+ * @param messageHash - Hash of the message.
598
+ * @param nullifier - When present, the unsiloed nullifier of the message and the address to silo it with. The witness
599
+ * is only returned if the siloed nullifier is absent from the nullifier tree, i.e. the message has not been consumed.
600
+ * @returns The l1 to l2 membership witness (index of message in the tree and sibling path), or none.
601
+ */
602
+ public async tryGetL1ToL2MembershipWitness(
603
+ messageHash: Fr,
604
+ nullifier: Option<UnsiloedMessageNullifier>,
605
+ ): Promise<Option<MembershipWitness<typeof L1_TO_L2_MSG_TREE_HEIGHT>>> {
606
+ const anchor = await this.anchorBlockHeader.toBlockParameter();
607
+ const lookup = await lookUpL1ToL2MessageWitness(this.aztecNode, messageHash, nullifier.value, anchor);
608
+ if (lookup.type !== 'found') {
609
+ return Option.none();
610
+ }
611
+
612
+ const [messageIndex, siblingPath] = lookup.witness;
613
+ return Option.some(new MembershipWitness(L1_TO_L2_MSG_TREE_HEIGHT, messageIndex, siblingPath.toTuple()));
614
+ }
615
+
590
616
  /**
591
617
  * Read the public storage data.
592
618
  * @param blockHash - The block hash to read storage at.
@@ -832,7 +858,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
832
858
  */
833
859
  public recordFact(
834
860
  contractAddress: AztecAddress,
835
- scope: AztecAddress,
861
+ scope: FactScope,
836
862
  factCollectionTypeId: Fr,
837
863
  factCollectionId: Fr,
838
864
  factTypeId: Fr,
@@ -854,7 +880,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
854
880
  */
855
881
  public deleteFactCollection(
856
882
  contractAddress: AztecAddress,
857
- scope: AztecAddress,
883
+ scope: FactScope,
858
884
  factCollectionTypeId: Fr,
859
885
  factCollectionId: Fr,
860
886
  ): Promise<void> {
@@ -870,7 +896,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
870
896
  */
871
897
  public async getFactCollection(
872
898
  contractAddress: AztecAddress,
873
- scope: AztecAddress,
899
+ scope: FactScope,
874
900
  factCollectionTypeId: Fr,
875
901
  factCollectionId: Fr,
876
902
  ): Promise<Option<FactCollection>> {
@@ -892,13 +918,13 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
892
918
  collection.facts,
893
919
  ),
894
920
  )
895
- : Option.none(emptyFactCollection(this.ephemeralArrayService));
921
+ : Option.none();
896
922
  }
897
923
 
898
924
  /** Returns every fact collection of `factCollectionTypeId`. */
899
925
  public async getFactCollectionsByType(
900
926
  contractAddress: AztecAddress,
901
- scope: AztecAddress,
927
+ scope: FactScope,
902
928
  factCollectionTypeId: Fr,
903
929
  ): Promise<EphemeralArray<FactCollection>> {
904
930
  this.#assertOwnContract(contractAddress);
@@ -1,5 +1,6 @@
1
1
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
2
2
  import { Comparator, type Note } from '@aztec-labs/stdlib/note';
3
+ import { Buffer } from 'buffer';
3
4
 
4
5
  export interface PropertySelector {
5
6
  index: number;
@@ -13,6 +13,7 @@ import type {
13
13
  } from '@aztec-labs/simulator/client';
14
14
  import type { FunctionArtifactWithContractName } from '@aztec-labs/stdlib/abi';
15
15
  import type { NoirCompiledCircuitWithName } from '@aztec-labs/stdlib/noir';
16
+ import { Buffer } from 'buffer';
16
17
 
17
18
  import type { CircuitRecorder } from './circuit_recorder.js';
18
19
 
@@ -1,5 +1,6 @@
1
1
  import { BBBundlePrivateKernelProver } from '@aztec-labs/bb-prover/client/bundle';
2
2
  import type { L1ContractAddresses } from '@aztec-labs/ethereum/l1-contract-addresses';
3
+ import { getEnv } from '@aztec-labs/foundation/config/env';
3
4
  import { createLogger } from '@aztec-labs/foundation/log';
4
5
  import { openTmpStore } from '@aztec-labs/kv-store/lmdb-v2';
5
6
  import { BundledProtocolContractsProvider } from '@aztec-labs/protocol-contracts/providers/bundle';
@@ -30,8 +31,9 @@ export async function createPXE(
30
31
  ) {
31
32
  const actor = options.loggerActorLabel;
32
33
  const recorderLogger = createLogger('simulator:acvm:recording', { actor });
33
- const recorder = process.env.CIRCUIT_RECORD_DIR
34
- ? new FileCircuitRecorder(process.env.CIRCUIT_RECORD_DIR, recorderLogger)
34
+ const { CIRCUIT_RECORD_DIR } = getEnv();
35
+ const recorder = CIRCUIT_RECORD_DIR
36
+ ? new FileCircuitRecorder(CIRCUIT_RECORD_DIR, recorderLogger)
35
37
  : new MemoryCircuitRecorder(recorderLogger);
36
38
  const simulatorLogger = createLogger('wasm-simulator', { actor });
37
39
  const simulator = new SimulatorRecorderWrapper(new WASMSimulator(simulatorLogger), recorder);
@@ -10,8 +10,8 @@
10
10
  /// used to provide helpful error messages if a contract calls an oracle that doesn't exist. We don't throw immediately
11
11
  /// if AZTEC_NR_MINOR > PXE_MINOR because if a contract is updated to use a newer Aztec.nr dependency without actually
12
12
  /// using any of the new oracles then there is no reason to throw.
13
- export const ORACLE_VERSION_MAJOR = 32;
14
- export const ORACLE_VERSION_MINOR = 1;
13
+ export const ORACLE_VERSION_MAJOR = 33;
14
+ export const ORACLE_VERSION_MINOR = 0;
15
15
 
16
16
  /// This hash is computed from `ORACLE_REGISTRY` (each oracle's name, ordered parameter names and
17
17
  /// types, and return type) and is used to detect when the oracle interface changes. When it does, you need to either:
@@ -19,7 +19,7 @@ export const ORACLE_VERSION_MINOR = 1;
19
19
  /// - increment only `ORACLE_VERSION_MINOR` if the change is additive (a new oracle was added).
20
20
  ///
21
21
  /// These constants must be kept in sync between this file and `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
22
- export const ORACLE_INTERFACE_HASH = 'f597d4c9e2b7d578e1b26ae757bfdc3bf698593cb82893dd80aad59442eecb7c';
22
+ export const ORACLE_INTERFACE_HASH = '318f8f81844b3bb827aeea6cb480eed35c94e67ac4330bd9d640b23975d3fe9f';
23
23
 
24
24
  /// The oracle interface served to the protocol contracts, which is versioned separately from the Aztec.nr one above.
25
25
  /// It is a single number that must match exactly: protocol contracts are only rebuilt when they are redeployed on a
@@ -9,6 +9,7 @@ import {
9
9
  } from '@aztec-labs/stdlib/kernel';
10
10
  import type { PrivateCallExecutionResult } from '@aztec-labs/stdlib/tx';
11
11
  import { VerificationKeyData } from '@aztec-labs/stdlib/vks';
12
+ import { Buffer } from 'buffer';
12
13
 
13
14
  import { PrivateKernelResetPrivateInputsBuilder } from './hints/private_kernel_reset_private_inputs_builder.js';
14
15
 
@@ -35,6 +35,7 @@ import { PrivateLogData, ScopedPrivateLogData } from '@aztec-labs/stdlib/kernel'
35
35
  import { PrivateLog } from '@aztec-labs/stdlib/logs';
36
36
  import { PrivateCallExecutionResult } from '@aztec-labs/stdlib/tx';
37
37
  import { VerificationKeyData } from '@aztec-labs/stdlib/vks';
38
+ import { Buffer } from 'buffer';
38
39
 
39
40
  const DEFAULT_CONTRACT_ADDRESS = AztecAddress.fromBigIntUnsafe(987654n);
40
41
 
@@ -47,6 +47,7 @@ import {
47
47
  getFinalMinRevertibleSideEffectCounter,
48
48
  } from '@aztec-labs/stdlib/tx';
49
49
  import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec-labs/stdlib/vks';
50
+ import { Buffer } from 'buffer';
50
51
 
51
52
  import { BatchPlanner } from './batch_planner.js';
52
53
  import { computeTxExpirationTimestamp } from './hints/compute_tx_expiration_timestamp.js';