@aztec/pxe 0.0.1-commit.cd76b27 → 0.0.1-commit.ce4f8c4f2

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 (139) hide show
  1. package/dest/config/index.d.ts +2 -2
  2. package/dest/config/index.d.ts.map +1 -1
  3. package/dest/config/index.js +1 -1
  4. package/dest/contract_function_simulator/contract_function_simulator.d.ts +9 -3
  5. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  6. package/dest/contract_function_simulator/contract_function_simulator.js +33 -11
  7. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +7 -7
  8. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  9. package/dest/contract_function_simulator/execution_tagging_index_cache.js +19 -11
  10. package/dest/contract_function_simulator/index.d.ts +2 -1
  11. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  12. package/dest/contract_function_simulator/index.js +1 -0
  13. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -3
  14. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  15. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +5 -4
  16. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +1 -1
  17. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  18. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -3
  19. package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts +16 -0
  20. package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts.map +1 -0
  21. package/dest/contract_function_simulator/noir-structs/message_tx_context.js +57 -0
  22. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -4
  23. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  24. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +3 -5
  25. package/dest/contract_function_simulator/oracle/interfaces.d.ts +50 -45
  26. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  27. package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +9 -0
  28. package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -0
  29. package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +42 -0
  30. package/dest/contract_function_simulator/oracle/oracle.d.ts +45 -44
  31. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  32. package/dest/contract_function_simulator/oracle/oracle.js +163 -94
  33. package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
  34. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +22 -47
  35. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  36. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +40 -80
  37. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +57 -39
  38. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  39. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +138 -63
  40. package/dest/contract_logging.d.ts +22 -0
  41. package/dest/contract_logging.d.ts.map +1 -0
  42. package/dest/contract_logging.js +23 -0
  43. package/dest/contract_sync/contract_sync_service.d.ts +5 -3
  44. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
  45. package/dest/contract_sync/contract_sync_service.js +47 -30
  46. package/dest/entrypoints/client/bundle/index.d.ts +2 -1
  47. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  48. package/dest/entrypoints/client/bundle/index.js +1 -0
  49. package/dest/entrypoints/client/lazy/index.d.ts +2 -1
  50. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  51. package/dest/entrypoints/client/lazy/index.js +1 -0
  52. package/dest/logs/log_service.d.ts +1 -1
  53. package/dest/logs/log_service.d.ts.map +1 -1
  54. package/dest/logs/log_service.js +4 -4
  55. package/dest/messages/message_context_service.d.ts +17 -0
  56. package/dest/messages/message_context_service.d.ts.map +1 -0
  57. package/dest/messages/message_context_service.js +36 -0
  58. package/dest/oracle_version.d.ts +2 -2
  59. package/dest/oracle_version.js +3 -3
  60. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +4 -3
  61. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
  62. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +125 -64
  63. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  64. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  65. package/dest/private_kernel/hints/test_utils.js +203 -0
  66. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  67. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  68. package/dest/private_kernel/private_kernel_execution_prover.js +13 -5
  69. package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
  70. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  71. package/dest/private_kernel/private_kernel_oracle.js +7 -3
  72. package/dest/pxe.d.ts +8 -4
  73. package/dest/pxe.d.ts.map +1 -1
  74. package/dest/pxe.js +55 -33
  75. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  76. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  77. package/dest/storage/contract_store/contract_store.js +140 -64
  78. package/dest/storage/metadata.d.ts +1 -1
  79. package/dest/storage/metadata.js +1 -1
  80. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
  81. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  82. package/dest/storage/tagging_store/sender_tagging_store.d.ts +29 -28
  83. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  84. package/dest/storage/tagging_store/sender_tagging_store.js +141 -115
  85. package/dest/tagging/index.d.ts +3 -3
  86. package/dest/tagging/index.d.ts.map +1 -1
  87. package/dest/tagging/index.js +1 -1
  88. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -5
  89. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  90. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +3 -3
  91. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +6 -7
  92. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  93. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +12 -11
  94. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -8
  95. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  96. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +13 -7
  97. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +4 -3
  98. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  99. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +20 -10
  100. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -7
  101. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  102. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +36 -24
  103. package/package.json +16 -16
  104. package/src/config/index.ts +1 -1
  105. package/src/contract_function_simulator/contract_function_simulator.ts +51 -20
  106. package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -14
  107. package/src/contract_function_simulator/index.ts +1 -0
  108. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +8 -5
  109. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -4
  110. package/src/contract_function_simulator/noir-structs/message_tx_context.ts +55 -0
  111. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +3 -6
  112. package/src/contract_function_simulator/oracle/interfaces.ts +54 -54
  113. package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +135 -0
  114. package/src/contract_function_simulator/oracle/oracle.ts +176 -138
  115. package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
  116. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +45 -99
  117. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +200 -80
  118. package/src/contract_logging.ts +39 -0
  119. package/src/contract_sync/contract_sync_service.ts +67 -38
  120. package/src/entrypoints/client/bundle/index.ts +1 -0
  121. package/src/entrypoints/client/lazy/index.ts +1 -0
  122. package/src/logs/log_service.ts +10 -5
  123. package/src/messages/message_context_service.ts +45 -0
  124. package/src/oracle_version.ts +3 -3
  125. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +157 -110
  126. package/src/private_kernel/hints/test_utils.ts +325 -0
  127. package/src/private_kernel/private_kernel_execution_prover.ts +13 -6
  128. package/src/private_kernel/private_kernel_oracle.ts +7 -7
  129. package/src/pxe.ts +74 -34
  130. package/src/storage/contract_store/contract_store.ts +170 -71
  131. package/src/storage/metadata.ts +1 -1
  132. package/src/storage/tagging_store/recipient_tagging_store.ts +9 -5
  133. package/src/storage/tagging_store/sender_tagging_store.ts +185 -138
  134. package/src/tagging/index.ts +2 -2
  135. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +3 -6
  136. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +10 -15
  137. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +23 -10
  138. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +26 -11
  139. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +27 -26
@@ -20,12 +20,12 @@ export class ContractSyncService implements StagedStore {
20
20
  readonly storeName = 'contract_sync';
21
21
 
22
22
  // Tracks contracts synced since last wipe. The cache is keyed per individual scope address
23
- // (`contractAddress:scopeAddress`), or `contractAddress:*` for undefined scopes (all accounts).
23
+ // (`contractAddress:scopeAddress`), or `contractAddress:*` for all scopes (all accounts).
24
24
  // The value is a promise that resolves when the contract is synced.
25
25
  private syncedContracts: Map<string, Promise<void>> = new Map();
26
26
 
27
- // Per-job overridden contract addresses - these contracts should not be synced.
28
- private overriddenContracts: Map<string, Set<string>> = new Map();
27
+ // Per-job excluded contract addresses - these contracts should not be synced.
28
+ private excludedFromSync: Map<string, Set<string>> = new Map();
29
29
 
30
30
  constructor(
31
31
  private aztecNode: AztecNode,
@@ -35,8 +35,8 @@ export class ContractSyncService implements StagedStore {
35
35
  ) {}
36
36
 
37
37
  /** Sets contracts that should be skipped during sync for a specific job. */
38
- setOverriddenContracts(jobId: string, addresses: Set<string>): void {
39
- this.overriddenContracts.set(jobId, addresses);
38
+ setExcludedFromSync(jobId: string, addresses: Set<string>): void {
39
+ this.excludedFromSync.set(jobId, addresses);
40
40
  }
41
41
 
42
42
  /**
@@ -56,47 +56,34 @@ export class ContractSyncService implements StagedStore {
56
56
  jobId: string,
57
57
  scopes: AccessScopes,
58
58
  ): Promise<void> {
59
- // Skip sync if this contract has an override for this job (overrides are keyed by contract address only)
60
- const overrides = this.overriddenContracts.get(jobId);
61
- if (overrides?.has(contractAddress.toString())) {
59
+ if (this.#shouldSkipSync(jobId, contractAddress)) {
62
60
  return;
63
61
  }
64
62
 
65
- // Skip sync if we already synced for "all scopes", or if we have an empty list of scopes
66
- const allScopesKey = toKey(contractAddress, 'ALL_SCOPES');
67
- const allScopesExisting = this.syncedContracts.get(allScopesKey);
68
- if (allScopesExisting || (scopes !== 'ALL_SCOPES' && scopes.length == 0)) {
69
- return;
70
- }
71
-
72
- const unsyncedScopes =
73
- scopes === 'ALL_SCOPES'
74
- ? scopes
75
- : scopes.filter(scope => !this.syncedContracts.has(toKey(contractAddress, scope)));
76
- const unsyncedScopesKeys = toKeys(contractAddress, unsyncedScopes);
77
-
78
- if (unsyncedScopesKeys.length > 0) {
79
- // Start sync and store the promise for all unsynced scopes
80
- const promise = this.#doSync(
63
+ this.#startSyncIfNeeded(contractAddress, scopes, scopesToSync =>
64
+ this.#syncContract(
81
65
  contractAddress,
82
66
  functionToInvokeAfterSync,
83
67
  utilityExecutor,
84
68
  anchorBlockHeader,
85
69
  jobId,
86
- unsyncedScopes,
87
- ).catch(err => {
88
- // There was an error syncing the contract, so we remove it from the cache so that it can be retried.
89
- unsyncedScopesKeys.forEach(key => this.syncedContracts.delete(key));
90
- throw err;
91
- });
92
- unsyncedScopesKeys.forEach(key => this.syncedContracts.set(key, promise));
93
- }
70
+ scopesToSync,
71
+ ),
72
+ );
94
73
 
95
- const promises = toKeys(contractAddress, scopes).map(key => this.syncedContracts.get(key)!);
96
- await Promise.all(promises);
74
+ await this.#awaitSync(contractAddress, scopes);
97
75
  }
98
76
 
99
- async #doSync(
77
+ /** Clears sync cache entries for the given scopes of a contract. Also clears the ALL_SCOPES entry. */
78
+ invalidateContractForScopes(contractAddress: AztecAddress, scopes: AztecAddress[]): void {
79
+ if (scopes.length === 0) {
80
+ return;
81
+ }
82
+ scopes.forEach(scope => this.syncedContracts.delete(toKey(contractAddress, scope)));
83
+ this.syncedContracts.delete(toKey(contractAddress, 'ALL_SCOPES'));
84
+ }
85
+
86
+ async #syncContract(
100
87
  contractAddress: AztecAddress,
101
88
  functionToInvokeAfterSync: FunctionSelector | null,
102
89
  utilityExecutor: (call: FunctionCall, scopes: AccessScopes) => Promise<any>,
@@ -129,8 +116,8 @@ export class ContractSyncService implements StagedStore {
129
116
  }
130
117
 
131
118
  commit(jobId: string): Promise<void> {
132
- // Clear overridden contracts for this job
133
- this.overriddenContracts.delete(jobId);
119
+ // Clear excluded contracts for this job
120
+ this.excludedFromSync.delete(jobId);
134
121
  return Promise.resolve();
135
122
  }
136
123
 
@@ -138,9 +125,51 @@ export class ContractSyncService implements StagedStore {
138
125
  // We clear the synced contracts cache here because, when the job is discarded, any associated database writes from
139
126
  // the sync are also undone.
140
127
  this.syncedContracts.clear();
141
- this.overriddenContracts.delete(jobId);
128
+ this.excludedFromSync.delete(jobId);
142
129
  return Promise.resolve();
143
130
  }
131
+ /** Returns true if sync should be skipped for this contract */
132
+ #shouldSkipSync(jobId: string, contractAddress: AztecAddress): boolean {
133
+ return !!this.excludedFromSync.get(jobId)?.has(contractAddress.toString());
134
+ }
135
+
136
+ /** If there are unsynced scopes, starts sync and stores the promise in cache with error cleanup. */
137
+ #startSyncIfNeeded(
138
+ contractAddress: AztecAddress,
139
+ scopes: AccessScopes,
140
+ syncFn: (scopesToSync: AccessScopes) => Promise<void>,
141
+ ): void {
142
+ const scopesToSync = this.#getScopesToSync(contractAddress, scopes);
143
+ const keys = toKeys(contractAddress, scopesToSync);
144
+ if (keys.length === 0) {
145
+ return;
146
+ }
147
+ const promise = syncFn(scopesToSync).catch(err => {
148
+ keys.forEach(key => this.syncedContracts.delete(key));
149
+ throw err;
150
+ });
151
+ keys.forEach(key => this.syncedContracts.set(key, promise));
152
+ }
153
+
154
+ /** Filters out scopes that are already cached, returning only those that still need syncing. */
155
+ #getScopesToSync(contractAddress: AztecAddress, scopes: AccessScopes): AccessScopes {
156
+ if (this.syncedContracts.has(toKey(contractAddress, 'ALL_SCOPES'))) {
157
+ // If we are already syncing all scopes, then return an empty list
158
+ return [];
159
+ }
160
+ if (scopes === 'ALL_SCOPES') {
161
+ return 'ALL_SCOPES';
162
+ }
163
+ return scopes.filter(scope => !this.syncedContracts.has(toKey(contractAddress, scope)));
164
+ }
165
+
166
+ /** Collects all relevant scope promises (including in-flight ones from concurrent calls) and awaits them. */
167
+ async #awaitSync(contractAddress: AztecAddress, scopes: AccessScopes): Promise<void> {
168
+ const promises = toKeys(contractAddress, scopes)
169
+ .map(key => this.syncedContracts.get(key))
170
+ .filter(p => p !== undefined);
171
+ await Promise.all(promises);
172
+ }
144
173
  }
145
174
 
146
175
  function toKeys(contract: AztecAddress, scopes: AccessScopes) {
@@ -3,6 +3,7 @@ export * from '../../../notes_filter.js';
3
3
  export * from '../../../pxe.js';
4
4
  export * from '../../../config/index.js';
5
5
  export * from '../../../error_enriching.js';
6
+ export * from '../../../contract_logging.js';
6
7
  export * from '../../../storage/index.js';
7
8
  export * from './utils.js';
8
9
  export type { PXECreationOptions } from '../../pxe_creation_options.js';
@@ -4,5 +4,6 @@ export * from '../../../pxe.js';
4
4
  export * from '../../../config/index.js';
5
5
  export * from '../../../storage/index.js';
6
6
  export * from '../../../error_enriching.js';
7
+ export * from '../../../contract_logging.js';
7
8
  export * from './utils.js';
8
9
  export { type PXECreationOptions } from '../../pxe_creation_options.js';
@@ -3,7 +3,13 @@ import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundatio
3
3
  import type { KeyStore } from '@aztec/key-store';
4
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
5
  import type { AztecNode } from '@aztec/stdlib/interfaces/server';
6
- import { DirectionalAppTaggingSecret, PendingTaggedLog, SiloedTag, Tag, TxScopedL2Log } from '@aztec/stdlib/logs';
6
+ import {
7
+ ExtendedDirectionalAppTaggingSecret,
8
+ PendingTaggedLog,
9
+ SiloedTag,
10
+ Tag,
11
+ TxScopedL2Log,
12
+ } from '@aztec/stdlib/logs';
7
13
  import type { BlockHeader } from '@aztec/stdlib/tx';
8
14
 
9
15
  import type { AccessScopes } from '../access_scopes.js';
@@ -41,7 +47,7 @@ export class LogService {
41
47
  logRetrievalRequests.map(async request => {
42
48
  const [publicLog, privateLog] = await Promise.all([
43
49
  this.#getPublicLogByTag(request.tag, request.contractAddress),
44
- this.#getPrivateLogByTag(await SiloedTag.compute(request.tag, request.contractAddress)),
50
+ this.#getPrivateLogByTag(await SiloedTag.computeFromTagAndApp(request.tag, request.contractAddress)),
45
51
  ]);
46
52
 
47
53
  if (publicLog !== null && privateLog !== null) {
@@ -130,7 +136,6 @@ export class LogService {
130
136
  secrets.map(secret =>
131
137
  loadPrivateLogsForSenderRecipientPair(
132
138
  secret,
133
- contractAddress,
134
139
  this.aztecNode,
135
140
  this.recipientTaggingStore,
136
141
  anchorBlockNumber,
@@ -154,7 +159,7 @@ export class LogService {
154
159
  async #getSecretsForSenders(
155
160
  contractAddress: AztecAddress,
156
161
  recipient: AztecAddress,
157
- ): Promise<DirectionalAppTaggingSecret[]> {
162
+ ): Promise<ExtendedDirectionalAppTaggingSecret[]> {
158
163
  const recipientCompleteAddress = await this.addressStore.getCompleteAddress(recipient);
159
164
  if (!recipientCompleteAddress) {
160
165
  return [];
@@ -172,7 +177,7 @@ export class LogService {
172
177
 
173
178
  return Promise.all(
174
179
  deduplicatedSenders.map(sender => {
175
- return DirectionalAppTaggingSecret.compute(
180
+ return ExtendedDirectionalAppTaggingSecret.compute(
176
181
  recipientCompleteAddress,
177
182
  recipientIvsk,
178
183
  sender,
@@ -0,0 +1,45 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { AztecNode } from '@aztec/stdlib/interfaces/server';
3
+ import { TxHash } from '@aztec/stdlib/tx';
4
+
5
+ import { MessageTxContext } from '../contract_function_simulator/noir-structs/message_tx_context.js';
6
+
7
+ /** Resolves transaction hashes into the context needed to process messages. */
8
+ export class MessageContextService {
9
+ constructor(private readonly aztecNode: AztecNode) {}
10
+
11
+ /**
12
+ * Resolves a list of tx hashes into their message contexts.
13
+ *
14
+ * For each tx hash, looks up the corresponding tx effect and extracts the note hashes and first nullifier needed to
15
+ * process messages that originated from that transaction. Returns `null` for tx hashes that are zero, not yet
16
+ * available, or in blocks beyond the anchor block.
17
+ */
18
+ resolveMessageContexts(txHashes: Fr[], anchorBlockNumber: number): Promise<(MessageTxContext | null)[]> {
19
+ // TODO: optimize, we might be hitting the node to get the same txHash repeatedly
20
+ return Promise.all(
21
+ txHashes.map(async txHashField => {
22
+ // A zero tx hash indicates a tx-less offchain message (e.g. one not tied to any onchain transaction).
23
+ // These messages don't have a transaction context to resolve, so we return null.
24
+ if (txHashField.isZero()) {
25
+ return null;
26
+ }
27
+
28
+ const txHash = TxHash.fromField(txHashField);
29
+ const txEffect = await this.aztecNode.getTxEffect(txHash);
30
+ if (!txEffect || txEffect.l2BlockNumber > anchorBlockNumber) {
31
+ return null;
32
+ }
33
+
34
+ // Every tx has at least one nullifier (the first nullifier derived from the tx hash). Hitting this condition
35
+ // would mean a buggy node, but since we need to access data.nullifiers[0], the defensive check does no harm.
36
+ const data = txEffect.data;
37
+ if (data.nullifiers.length === 0) {
38
+ throw new Error(`Tx effect for ${txHash} has no nullifiers`);
39
+ }
40
+
41
+ return new MessageTxContext(data.txHash, data.noteHashes, data.nullifiers[0]);
42
+ }),
43
+ );
44
+ }
45
+ }
@@ -2,11 +2,11 @@
2
2
  /// to version the oracle interface to ensure that developers get a reasonable error message if they use incompatible
3
3
  /// versions of Aztec.nr and PXE. The Noir counterpart is in `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
4
4
  ///
5
- /// @dev Whenever a contract function or Noir test is run, the `utilityAssertCompatibleOracleVersion` oracle is called
5
+ /// @dev Whenever a contract function or Noir test is run, the `aztec_utl_assertCompatibleOracleVersion` oracle is called
6
6
  /// and if the oracle version is incompatible an error is thrown.
7
- export const ORACLE_VERSION = 12;
7
+ export const ORACLE_VERSION = 18;
8
8
 
9
9
  /// This hash is computed as by hashing the Oracle interface and it is used to detect when the Oracle interface changes,
10
10
  /// which in turn implies that you need to update the ORACLE_VERSION constant in this file and in
11
11
  /// `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
12
- export const ORACLE_INTERFACE_HASH = '666a8a7fc697f72b29dbf0ae7464db269cf5afa019acac8861f814543147dbb4';
12
+ export const ORACLE_INTERFACE_HASH = '57e5b07c6d55fb167ef90f8d0f410f9bdb5b154a31159c624a061be40b02a2c2';