@aztec/pxe 3.0.0-canary.a9708bd → 3.0.0-devnet.2

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 (194) hide show
  1. package/README.md +5 -5
  2. package/dest/bin/check_oracle_version.js +18 -8
  3. package/dest/config/index.d.ts +8 -8
  4. package/dest/config/index.d.ts.map +1 -1
  5. package/dest/config/index.js +3 -3
  6. package/dest/config/package_info.js +1 -1
  7. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  8. package/dest/contract_function_simulator/contract_function_simulator.js +82 -26
  9. package/dest/contract_function_simulator/execution_data_provider.d.ts +27 -38
  10. package/dest/contract_function_simulator/execution_data_provider.d.ts.map +1 -1
  11. package/dest/contract_function_simulator/execution_note_cache.d.ts +2 -2
  12. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  13. package/dest/contract_function_simulator/execution_note_cache.js +7 -4
  14. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +16 -0
  15. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -0
  16. package/dest/contract_function_simulator/execution_tagging_index_cache.js +26 -0
  17. package/dest/contract_function_simulator/index.d.ts +3 -1
  18. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  19. package/dest/contract_function_simulator/index.js +2 -1
  20. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  21. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +7 -3
  22. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -0
  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 +1 -1
  25. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +22 -0
  26. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -0
  27. package/dest/contract_function_simulator/noir-structs/utility_context.js +33 -0
  28. package/dest/contract_function_simulator/oracle/index.d.ts +1 -1
  29. package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -1
  30. package/dest/contract_function_simulator/oracle/index.js +1 -1
  31. package/dest/contract_function_simulator/oracle/interfaces.d.ts +97 -0
  32. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -0
  33. package/dest/contract_function_simulator/oracle/interfaces.js +4 -0
  34. package/dest/contract_function_simulator/oracle/oracle.d.ts +12 -11
  35. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  36. package/dest/contract_function_simulator/oracle/oracle.js +79 -76
  37. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -2
  38. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  39. package/dest/contract_function_simulator/oracle/private_execution.js +6 -15
  40. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +26 -10
  41. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  42. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +69 -18
  43. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +10 -22
  44. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  45. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +33 -38
  46. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +19 -55
  47. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -1
  48. package/dest/contract_function_simulator/pxe_oracle_interface.js +174 -187
  49. package/dest/entrypoints/client/bundle/index.d.ts +3 -1
  50. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  51. package/dest/entrypoints/client/bundle/index.js +2 -1
  52. package/dest/entrypoints/client/bundle/utils.d.ts +8 -8
  53. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  54. package/dest/entrypoints/client/bundle/utils.js +8 -8
  55. package/dest/entrypoints/client/lazy/index.d.ts +3 -1
  56. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  57. package/dest/entrypoints/client/lazy/index.js +2 -1
  58. package/dest/entrypoints/client/lazy/utils.d.ts +7 -7
  59. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  60. package/dest/entrypoints/client/lazy/utils.js +7 -7
  61. package/dest/entrypoints/server/index.d.ts +3 -1
  62. package/dest/entrypoints/server/index.d.ts.map +1 -1
  63. package/dest/entrypoints/server/index.js +2 -1
  64. package/dest/entrypoints/server/utils.d.ts +4 -23
  65. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  66. package/dest/entrypoints/server/utils.js +4 -25
  67. package/dest/{pxe_service/error_enriching.d.ts → error_enriching.d.ts} +1 -1
  68. package/dest/error_enriching.d.ts.map +1 -0
  69. package/dest/{pxe_service/error_enriching.js → error_enriching.js} +3 -0
  70. package/dest/oracle_version.d.ts +2 -2
  71. package/dest/oracle_version.js +2 -2
  72. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +6 -6
  73. package/dest/private_kernel/private_kernel_execution_prover.d.ts +7 -0
  74. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  75. package/dest/private_kernel/private_kernel_execution_prover.js +23 -18
  76. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +2 -2
  77. package/dest/pxe.d.ts +233 -0
  78. package/dest/pxe.d.ts.map +1 -0
  79. package/dest/{pxe_service/pxe_service.js → pxe.js} +215 -214
  80. package/dest/storage/address_data_provider/address_data_provider.d.ts +1 -3
  81. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +1 -1
  82. package/dest/storage/address_data_provider/address_data_provider.js +0 -3
  83. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +1 -3
  84. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +1 -1
  85. package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -4
  86. package/dest/storage/contract_data_provider/contract_data_provider.d.ts +3 -4
  87. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +1 -1
  88. package/dest/storage/contract_data_provider/contract_data_provider.js +0 -3
  89. package/dest/storage/index.d.ts +0 -1
  90. package/dest/storage/index.d.ts.map +1 -1
  91. package/dest/storage/index.js +0 -1
  92. package/dest/storage/note_data_provider/note_dao.d.ts +1 -1
  93. package/dest/storage/note_data_provider/note_dao.d.ts.map +1 -1
  94. package/dest/storage/note_data_provider/note_data_provider.d.ts +70 -7
  95. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +1 -1
  96. package/dest/storage/note_data_provider/note_data_provider.js +120 -72
  97. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +1 -3
  98. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +1 -1
  99. package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -3
  100. package/dest/storage/sync_data_provider/sync_data_provider.d.ts +1 -3
  101. package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +1 -1
  102. package/dest/storage/sync_data_provider/sync_data_provider.js +0 -3
  103. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +28 -6
  104. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +1 -1
  105. package/dest/storage/tagging_data_provider/tagging_data_provider.js +46 -39
  106. package/dest/synchronizer/synchronizer.d.ts.map +1 -1
  107. package/dest/synchronizer/synchronizer.js +2 -3
  108. package/dest/tagging/constants.d.ts +2 -0
  109. package/dest/tagging/constants.d.ts.map +1 -0
  110. package/dest/tagging/constants.js +2 -0
  111. package/dest/tagging/index.d.ts +7 -0
  112. package/dest/tagging/index.d.ts.map +1 -0
  113. package/dest/tagging/index.js +5 -0
  114. package/dest/tagging/siloed_tag.d.ts +14 -0
  115. package/dest/tagging/siloed_tag.d.ts.map +1 -0
  116. package/dest/tagging/siloed_tag.js +20 -0
  117. package/dest/tagging/tag.d.ts +12 -0
  118. package/dest/tagging/tag.d.ts.map +1 -0
  119. package/dest/tagging/tag.js +17 -0
  120. package/dest/tagging/utils.d.ts +18 -0
  121. package/dest/tagging/utils.d.ts.map +1 -0
  122. package/dest/tagging/utils.js +24 -0
  123. package/package.json +19 -22
  124. package/src/bin/check_oracle_version.ts +23 -9
  125. package/src/config/index.ts +11 -10
  126. package/src/config/package_info.ts +1 -1
  127. package/src/contract_function_simulator/contract_function_simulator.ts +128 -44
  128. package/src/contract_function_simulator/execution_data_provider.ts +29 -47
  129. package/src/contract_function_simulator/execution_note_cache.ts +11 -6
  130. package/src/contract_function_simulator/execution_tagging_index_cache.ts +32 -0
  131. package/src/contract_function_simulator/index.ts +3 -1
  132. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +8 -3
  133. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  134. package/src/contract_function_simulator/noir-structs/utility_context.ts +42 -0
  135. package/src/contract_function_simulator/oracle/index.ts +1 -1
  136. package/src/contract_function_simulator/oracle/interfaces.ts +160 -0
  137. package/src/contract_function_simulator/oracle/oracle.ts +102 -77
  138. package/src/contract_function_simulator/oracle/private_execution.ts +7 -15
  139. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +106 -45
  140. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +51 -76
  141. package/src/contract_function_simulator/pxe_oracle_interface.ts +199 -218
  142. package/src/entrypoints/client/bundle/index.ts +3 -1
  143. package/src/entrypoints/client/bundle/utils.ts +11 -19
  144. package/src/entrypoints/client/lazy/index.ts +3 -1
  145. package/src/entrypoints/client/lazy/utils.ts +10 -18
  146. package/src/entrypoints/server/index.ts +3 -1
  147. package/src/entrypoints/server/utils.ts +9 -39
  148. package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +5 -1
  149. package/src/oracle_version.ts +2 -2
  150. package/src/private_kernel/hints/compute_tx_include_by_timestamp.ts +6 -6
  151. package/src/private_kernel/private_kernel_execution_prover.ts +35 -23
  152. package/src/{pxe_service/pxe_service.ts → pxe.ts} +230 -257
  153. package/src/storage/address_data_provider/address_data_provider.ts +1 -7
  154. package/src/storage/capsule_data_provider/capsule_data_provider.ts +1 -11
  155. package/src/storage/contract_data_provider/contract_data_provider.ts +3 -9
  156. package/src/storage/index.ts +0 -1
  157. package/src/storage/note_data_provider/note_dao.ts +1 -1
  158. package/src/storage/note_data_provider/note_data_provider.ts +142 -99
  159. package/src/storage/private_event_data_provider/private_event_data_provider.ts +1 -7
  160. package/src/storage/sync_data_provider/sync_data_provider.ts +1 -7
  161. package/src/storage/tagging_data_provider/tagging_data_provider.ts +52 -55
  162. package/src/synchronizer/synchronizer.ts +2 -3
  163. package/src/tagging/constants.ts +2 -0
  164. package/src/tagging/index.ts +6 -0
  165. package/src/tagging/siloed_tag.ts +22 -0
  166. package/src/tagging/tag.ts +16 -0
  167. package/src/tagging/utils.ts +31 -0
  168. package/dest/bin/index.d.ts +0 -3
  169. package/dest/bin/index.d.ts.map +0 -1
  170. package/dest/bin/index.js +0 -48
  171. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +0 -87
  172. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +0 -1
  173. package/dest/contract_function_simulator/oracle/typed_oracle.js +0 -146
  174. package/dest/contract_function_simulator/tagging_utils.d.ts +0 -17
  175. package/dest/contract_function_simulator/tagging_utils.d.ts.map +0 -1
  176. package/dest/contract_function_simulator/tagging_utils.js +0 -23
  177. package/dest/pxe_service/error_enriching.d.ts.map +0 -1
  178. package/dest/pxe_service/index.d.ts +0 -3
  179. package/dest/pxe_service/index.d.ts.map +0 -1
  180. package/dest/pxe_service/index.js +0 -2
  181. package/dest/pxe_service/pxe_service.d.ts +0 -100
  182. package/dest/pxe_service/pxe_service.d.ts.map +0 -1
  183. package/dest/storage/data_provider.d.ts +0 -4
  184. package/dest/storage/data_provider.d.ts.map +0 -1
  185. package/dest/storage/data_provider.js +0 -1
  186. package/dest/test/pxe_test_suite.d.ts +0 -3
  187. package/dest/test/pxe_test_suite.d.ts.map +0 -1
  188. package/dest/test/pxe_test_suite.js +0 -97
  189. package/src/bin/index.ts +0 -62
  190. package/src/contract_function_simulator/oracle/typed_oracle.ts +0 -289
  191. package/src/contract_function_simulator/tagging_utils.ts +0 -32
  192. package/src/pxe_service/index.ts +0 -2
  193. package/src/storage/data_provider.ts +0 -3
  194. package/src/test/pxe_test_suite.ts +0 -113
@@ -4,10 +4,11 @@ import { createLogger } from '@aztec/foundation/log';
4
4
  import { Timer } from '@aztec/foundation/timer';
5
5
  import { toACVMWitness } from '@aztec/simulator/client';
6
6
  import { FunctionSelector, countArgumentsSize } from '@aztec/stdlib/abi';
7
- import { computeUniqueNoteHash, siloNoteHash } from '@aztec/stdlib/hash';
7
+ import { computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
8
8
  import { PrivateContextInputs } from '@aztec/stdlib/kernel';
9
9
  import { Note } from '@aztec/stdlib/note';
10
10
  import { CallContext, CountedContractClassLog, NoteAndSlot } from '@aztec/stdlib/tx';
11
+ import { Tag } from '../../tagging/tag.js';
11
12
  import { pickNotes } from '../pick_notes.js';
12
13
  import { executePrivateFunction, verifyCurrentClassId } from './private_execution.js';
13
14
  import { UtilityExecutionOracle } from './utility_execution_oracle.js';
@@ -17,12 +18,15 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
17
18
  argsHash;
18
19
  txContext;
19
20
  callContext;
20
- historicalHeader;
21
+ anchorBlockHeader;
21
22
  executionCache;
22
23
  noteCache;
23
- simulator;
24
+ taggingIndexCache;
24
25
  totalPublicCalldataCount;
25
26
  sideEffectCounter;
27
+ senderForTags;
28
+ simulator;
29
+ isPrivate;
26
30
  /**
27
31
  * New notes created during this execution.
28
32
  * It's possible that a note in this list has been nullified (in the same or other executions) and doesn't exist in
@@ -44,10 +48,11 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
44
48
  contractClassLogs;
45
49
  offchainEffects;
46
50
  nestedExecutionResults;
47
- senderForTags;
48
- constructor(argsHash, txContext, callContext, /** Header of a block whose state is used during private execution (not the block the transaction is included in). */ historicalHeader, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, executionCache, noteCache, executionDataProvider, simulator, totalPublicCalldataCount, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes, senderForTags){
49
- super(callContext.contractAddress, authWitnesses, capsules, executionDataProvider, log, scopes), this.argsHash = argsHash, this.txContext = txContext, this.callContext = callContext, this.historicalHeader = historicalHeader, this.executionCache = executionCache, this.noteCache = noteCache, this.simulator = simulator, this.totalPublicCalldataCount = totalPublicCalldataCount, this.sideEffectCounter = sideEffectCounter, this.newNotes = [], this.noteHashLeafIndexMap = new Map(), this.noteHashNullifierCounterMap = new Map(), this.contractClassLogs = [], this.offchainEffects = [], this.nestedExecutionResults = [];
50
- this.senderForTags = senderForTags;
51
+ constructor(argsHash, txContext, callContext, /** Header of a block whose state is used during private execution (not the block the transaction is included in). */ anchorBlockHeader, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, executionCache, noteCache, taggingIndexCache, executionDataProvider, totalPublicCalldataCount = 0, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes, senderForTags, simulator){
52
+ super(callContext.contractAddress, authWitnesses, capsules, executionDataProvider, log, scopes), this.argsHash = argsHash, this.txContext = txContext, this.callContext = callContext, this.anchorBlockHeader = anchorBlockHeader, this.executionCache = executionCache, this.noteCache = noteCache, this.taggingIndexCache = taggingIndexCache, this.totalPublicCalldataCount = totalPublicCalldataCount, this.sideEffectCounter = sideEffectCounter, this.senderForTags = senderForTags, this.simulator = simulator, this.isPrivate = true, this.newNotes = [], this.noteHashLeafIndexMap = new Map(), this.noteHashNullifierCounterMap = new Map(), this.contractClassLogs = [], this.offchainEffects = [], this.nestedExecutionResults = [];
53
+ }
54
+ getPrivateContextInputs() {
55
+ return new PrivateContextInputs(this.callContext, this.anchorBlockHeader, this.txContext, this.sideEffectCounter);
51
56
  }
52
57
  // We still need this function until we can get user-defined ordering of structs for fn arguments
53
58
  // TODO When that is sorted out on noir side, we can use instead the utilities in serialize.ts
@@ -61,8 +66,7 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
61
66
  if (args?.length !== argumentsSize) {
62
67
  throw new Error(`Invalid arguments size: expected ${argumentsSize}, got ${args?.length}`);
63
68
  }
64
- const privateContextInputs = new PrivateContextInputs(this.callContext, this.historicalHeader, this.txContext, this.sideEffectCounter);
65
- const privateContextInputsAsFields = privateContextInputs.toFields();
69
+ const privateContextInputsAsFields = this.getPrivateContextInputs().toFields();
66
70
  if (privateContextInputsAsFields.length !== PRIVATE_CONTEXT_INPUTS_LENGTH) {
67
71
  throw new Error('Invalid private context inputs size');
68
72
  }
@@ -97,6 +101,11 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
97
101
  return this.offchainEffects;
98
102
  }
99
103
  /**
104
+ * Returns the pre tags that were used in this execution (and that need to be stored in the db).
105
+ */ getUsedPreTags() {
106
+ return this.taggingIndexCache.getUsedPreTags();
107
+ }
108
+ /**
100
109
  * Return the nested execution results during this execution.
101
110
  */ getNestedExecutionResults() {
102
111
  return this.nestedExecutionResults;
@@ -128,6 +137,37 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
128
137
  return Promise.resolve();
129
138
  }
130
139
  /**
140
+ * Returns the next app tag for a given sender and recipient pair.
141
+ * @param sender - The address sending the log
142
+ * @param recipient - The address receiving the log
143
+ * @returns An app tag to be used in a log.
144
+ */ async privateGetNextAppTagAsSender(sender, recipient) {
145
+ const secret = await this.executionDataProvider.calculateDirectionalAppTaggingSecret(this.contractAddress, sender, recipient);
146
+ const index = await this.#getIndexToUseForSecret(secret);
147
+ this.log.debug(`Incrementing tagging index for sender: ${sender}, recipient: ${recipient}, contract: ${this.contractAddress} to ${index}`);
148
+ this.taggingIndexCache.setLastUsedIndex(secret, index);
149
+ return Tag.compute({
150
+ secret,
151
+ index
152
+ });
153
+ }
154
+ async #getIndexToUseForSecret(secret) {
155
+ // If we have the tagging index in the cache, we use it. If not we obtain it from the execution data provider.
156
+ const lastUsedIndexInTx = this.taggingIndexCache.getLastUsedIndex(secret);
157
+ if (lastUsedIndexInTx !== undefined) {
158
+ return lastUsedIndexInTx + 1;
159
+ } else {
160
+ // This is a tagging secret we've not yet used in this tx, so first sync our store to make sure its indices
161
+ // are up to date. We do this here because this store is not synced as part of the global sync because
162
+ // that'd be wasteful as most tagging secrets are not used in each tx.
163
+ await this.executionDataProvider.syncTaggedLogsAsSender(secret, this.contractAddress);
164
+ const lastUsedIndex = await this.executionDataProvider.getLastUsedIndexAsSender(secret);
165
+ // If lastUsedIndex is undefined, we've never used this secret, so start from 0
166
+ // Otherwise, the next index to use is one past the last used index
167
+ return lastUsedIndex === undefined ? 0 : lastUsedIndex + 1;
168
+ }
169
+ }
170
+ /**
131
171
  * Store values in the execution cache.
132
172
  * @param values - Values to store.
133
173
  * @returns The hash of the values.
@@ -145,6 +185,16 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
145
185
  }
146
186
  return Promise.resolve(preimage);
147
187
  }
188
+ async utilityCheckNullifierExists(innerNullifier) {
189
+ // This oracle must be overridden because while utility execution can only meaningfully check if a nullifier exists
190
+ // in the synched block, during private execution there's also the possibility of it being pending, i.e. created
191
+ // in the current transaction.
192
+ this.log.debug(`Checking existence of inner nullifier ${innerNullifier}`, {
193
+ contractAddress: this.contractAddress
194
+ });
195
+ const nullifier = (await siloNullifier(this.contractAddress, innerNullifier)).toBigInt();
196
+ return this.noteCache.getNullifiers(this.contractAddress).has(nullifier) || await super.utilityCheckNullifierExists(innerNullifier);
197
+ }
148
198
  /**
149
199
  * Gets some notes for a storage slot.
150
200
  *
@@ -254,6 +304,9 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
254
304
  * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
255
305
  * @param noteHash - A hash of the new note.
256
306
  */ privateNotifyCreatedNullifier(innerNullifier) {
307
+ this.log.debug(`Notified of new inner nullifier ${innerNullifier}`, {
308
+ contractAddress: this.contractAddress
309
+ });
257
310
  return this.noteCache.nullifierCreated(this.callContext.contractAddress, innerNullifier);
258
311
  }
259
312
  /**
@@ -281,14 +334,19 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
281
334
  * @param isStaticCall - Whether the call is a static call.
282
335
  * @returns The execution result.
283
336
  */ async privateCallPrivateFunction(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
337
+ if (!this.simulator) {
338
+ // In practice it is only when creating inline private contexts in a Noir test using TXE that we create an
339
+ // instance of this class without a simulator.
340
+ throw new Error('No simulator provided, cannot perform a nested private call');
341
+ }
284
342
  const simulatorSetupTimer = new Timer();
285
343
  this.log.debug(`Calling private function ${targetContractAddress}:${functionSelector} from ${this.callContext.contractAddress}`);
286
344
  isStaticCall = isStaticCall || this.callContext.isStaticCall;
287
- await verifyCurrentClassId(targetContractAddress, this.executionDataProvider, this.historicalHeader);
345
+ await verifyCurrentClassId(targetContractAddress, this.executionDataProvider, this.anchorBlockHeader);
288
346
  const targetArtifact = await this.executionDataProvider.getFunctionArtifact(targetContractAddress, functionSelector);
289
347
  const derivedTxContext = this.txContext.clone();
290
348
  const derivedCallContext = await this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
291
- const privateExecutionOracle = new PrivateExecutionOracle(argsHash, derivedTxContext, derivedCallContext, this.historicalHeader, this.authWitnesses, this.capsules, this.executionCache, this.noteCache, this.executionDataProvider, this.simulator, this.totalPublicCalldataCount, sideEffectCounter, this.log, this.scopes, this.senderForTags);
349
+ const privateExecutionOracle = new PrivateExecutionOracle(argsHash, derivedTxContext, derivedCallContext, this.anchorBlockHeader, this.authWitnesses, this.capsules, this.executionCache, this.noteCache, this.taggingIndexCache, this.executionDataProvider, this.totalPublicCalldataCount, sideEffectCounter, this.log, this.scopes, this.senderForTags, this.simulator);
292
350
  const setupTime = simulatorSetupTimer.ms();
293
351
  const childExecutionResult = await executePrivateFunction(this.simulator, privateExecutionOracle, targetArtifact, targetContractAddress, functionSelector);
294
352
  if (isStaticCall) {
@@ -350,13 +408,6 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
350
408
  getDebugFunctionName() {
351
409
  return this.executionDataProvider.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
352
410
  }
353
- async privateIncrementAppTaggingSecretIndexAsSender(sender, recipient) {
354
- await this.executionDataProvider.incrementAppTaggingSecretIndexAsSender(this.contractAddress, sender, recipient);
355
- }
356
- async utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot) {
357
- await this.executionDataProvider.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
358
- await this.executionDataProvider.removeNullifiedNotes(this.contractAddress);
359
- }
360
411
  utilityEmitOffchainEffect(data) {
361
412
  this.offchainEffects.push({
362
413
  data
@@ -3,17 +3,16 @@ import type { AuthWitness } from '@aztec/stdlib/auth-witness';
3
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
5
5
  import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
6
- import { IndexedTaggingSecret } from '@aztec/stdlib/logs';
7
6
  import type { NoteStatus } from '@aztec/stdlib/note';
8
7
  import { type MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
9
8
  import type { BlockHeader, Capsule } from '@aztec/stdlib/tx';
10
- import type { UInt64 } from '@aztec/stdlib/types';
11
9
  import type { ExecutionDataProvider } from '../execution_data_provider.js';
12
- import { type NoteData, TypedOracle } from './typed_oracle.js';
10
+ import { UtilityContext } from '../noir-structs/utility_context.js';
11
+ import type { IMiscOracle, IUtilityExecutionOracle, NoteData } from './interfaces.js';
13
12
  /**
14
13
  * The oracle for an execution of utility contract functions.
15
14
  */
16
- export declare class UtilityExecutionOracle extends TypedOracle {
15
+ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOracle {
17
16
  protected readonly contractAddress: AztecAddress;
18
17
  /** List of transient auth witnesses to be used during this simulation */
19
18
  protected readonly authWitnesses: AuthWitness[];
@@ -21,17 +20,16 @@ export declare class UtilityExecutionOracle extends TypedOracle {
21
20
  protected readonly executionDataProvider: ExecutionDataProvider;
22
21
  protected log: import("@aztec/foundation/log").Logger;
23
22
  protected readonly scopes?: AztecAddress[] | undefined;
23
+ isMisc: true;
24
+ isUtility: true;
25
+ private aztecNrDebugLog;
24
26
  constructor(contractAddress: AztecAddress,
25
27
  /** List of transient auth witnesses to be used during this simulation */
26
28
  authWitnesses: AuthWitness[], capsules: Capsule[], // TODO(#12425): Rename to transientCapsules
27
29
  executionDataProvider: ExecutionDataProvider, log?: import("@aztec/foundation/log").Logger, scopes?: AztecAddress[] | undefined);
28
30
  utilityAssertCompatibleOracleVersion(version: number): void;
29
31
  utilityGetRandomField(): Fr;
30
- utilityGetBlockNumber(): Promise<number>;
31
- utilityGetTimestamp(): Promise<UInt64>;
32
- utilityGetContractAddress(): Promise<AztecAddress>;
33
- utilityGetChainId(): Promise<Fr>;
34
- utilityGetVersion(): Promise<Fr>;
32
+ utilityGetUtilityContext(): Promise<UtilityContext>;
35
33
  /**
36
34
  * Retrieve keys associated with a specific master public key and app address.
37
35
  * @param pkMHash - The master public key hash.
@@ -83,7 +81,7 @@ export declare class UtilityExecutionOracle extends TypedOracle {
83
81
  * @returns A complete address associated with the input address.
84
82
  * @throws An error if the account is not registered in the database.
85
83
  */
86
- utilityGetCompleteAddress(account: AztecAddress): Promise<CompleteAddress>;
84
+ utilityGetPublicKeysAndPartialAddress(account: AztecAddress): Promise<CompleteAddress>;
87
85
  /**
88
86
  * Returns a contract instance associated with an address or throws if not found.
89
87
  * @param address - Address.
@@ -133,7 +131,7 @@ export declare class UtilityExecutionOracle extends TypedOracle {
133
131
  * @dev Contract address and secret are only used to compute the nullifier to get non-nullified messages
134
132
  * @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
135
133
  */
136
- utilityGetL1ToL2MembershipWitness(contractAddress: AztecAddress, messageHash: Fr, secret: Fr): Promise<import("./message_load_oracle_inputs.js").MessageLoadOracleInputs<39>>;
134
+ utilityGetL1ToL2MembershipWitness(contractAddress: AztecAddress, messageHash: Fr, secret: Fr): Promise<import("./message_load_oracle_inputs.js").MessageLoadOracleInputs<36>>;
137
135
  /**
138
136
  * Read the public storage data.
139
137
  * @param contractAddress - The address to read storage from.
@@ -142,16 +140,7 @@ export declare class UtilityExecutionOracle extends TypedOracle {
142
140
  * @param numberOfElements - Number of elements to read from the starting storage slot.
143
141
  */
144
142
  utilityStorageRead(contractAddress: AztecAddress, startStorageSlot: Fr, blockNumber: number, numberOfElements: number): Promise<Fr[]>;
145
- utilityDebugLog(message: string, fields: Fr[]): void;
146
- /**
147
- * Returns the tagging secret for a given sender and recipient pair, siloed to the current contract address.
148
- * Includes the next index to be used used for tagging with this secret.
149
- * For this to work, the ivsk_m of the sender must be known.
150
- * @param sender - The address sending the note
151
- * @param recipient - The address receiving the note
152
- * @returns A tagging secret that can be used to tag notes.
153
- */
154
- utilityGetIndexedTaggingSecretAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<IndexedTaggingSecret>;
143
+ utilityDebugLog(level: number, message: string, fields: Fr[]): void;
155
144
  utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr): Promise<void>;
156
145
  utilityValidateEnqueuedNotesAndEvents(contractAddress: AztecAddress, noteValidationRequestsArrayBaseSlot: Fr, eventValidationRequestsArrayBaseSlot: Fr): Promise<void>;
157
146
  utilityBulkRetrieveLogs(contractAddress: AztecAddress, logRetrievalRequestsArrayBaseSlot: Fr, logRetrievalResponsesArrayBaseSlot: Fr): Promise<void>;
@@ -161,6 +150,5 @@ export declare class UtilityExecutionOracle extends TypedOracle {
161
150
  utilityCopyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise<void>;
162
151
  utilityAes128Decrypt(ciphertext: Buffer, iv: Buffer, symKey: Buffer): Promise<Buffer>;
163
152
  utilityGetSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
164
- utilityEmitOffchainEffect(_data: Fr[]): Promise<void>;
165
153
  }
166
154
  //# sourceMappingURL=utility_execution_oracle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utility_execution_oracle.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/utility_execution_oracle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,WAAW;IAEnD,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,YAAY;IAChD,yEAAyE;IACzE,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,EAAE;IAC/C,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE;IACtC,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB;IAC/D,SAAS,CAAC,GAAG;IACb,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,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AAC,oBAAoB,CAAC;IAIV,sBAAsB,CAAC,6BAA6B,EAAE,EAAE;IAMxD,qCAAqC,CACzD,eAAe,EAAE,YAAY,EAC7B,mCAAmC,EAAE,EAAE,EACvC,oCAAoC,EAAE,EAAE;IAcpB,uBAAuB,CAC3C,eAAe,EAAE,YAAY,EAC7B,iCAAiC,EAAE,EAAE,EACrC,kCAAkC,EAAE,EAAE;IAcxB,mBAAmB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpF,kBAAkB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAYvF,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ5E,kBAAkB,CAChC,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,EAAE,EACX,OAAO,EAAE,EAAE,EACX,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IASA,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKrF,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAI3E,yBAAyB,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtE"}
1
+ {"version":3,"file":"utility_execution_oracle.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/utility_execution_oracle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CA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CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAYvF,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ5E,kBAAkB,CACvB,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,EAAE,EACX,OAAO,EAAE,EAAE,EACX,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IAST,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKrF,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;CAGnF"}
@@ -1,20 +1,31 @@
1
1
  import { Aes128 } from '@aztec/foundation/crypto';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
- import { applyStringFormatting, createLogger } from '@aztec/foundation/log';
3
+ import { LogLevels, applyStringFormatting, createLogger } from '@aztec/foundation/log';
4
4
  import { siloNullifier } from '@aztec/stdlib/hash';
5
+ import { UtilityContext } from '../noir-structs/utility_context.js';
5
6
  import { pickNotes } from '../pick_notes.js';
6
- import { TypedOracle } from './typed_oracle.js';
7
7
  /**
8
8
  * The oracle for an execution of utility contract functions.
9
- */ export class UtilityExecutionOracle extends TypedOracle {
9
+ */ export class UtilityExecutionOracle {
10
10
  contractAddress;
11
11
  authWitnesses;
12
12
  capsules;
13
13
  executionDataProvider;
14
14
  log;
15
15
  scopes;
16
+ isMisc;
17
+ isUtility;
18
+ aztecNrDebugLog;
16
19
  constructor(contractAddress, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, executionDataProvider, log = createLogger('simulator:client_view_context'), scopes){
17
- super(), this.contractAddress = contractAddress, this.authWitnesses = authWitnesses, this.capsules = capsules, this.executionDataProvider = executionDataProvider, this.log = log, this.scopes = scopes;
20
+ this.contractAddress = contractAddress;
21
+ this.authWitnesses = authWitnesses;
22
+ this.capsules = capsules;
23
+ this.executionDataProvider = executionDataProvider;
24
+ this.log = log;
25
+ this.scopes = scopes;
26
+ this.isMisc = true;
27
+ this.isUtility = true;
28
+ this.aztecNrDebugLog = createLogger('aztec-nr:debug_log');
18
29
  }
19
30
  utilityAssertCompatibleOracleVersion(version) {
20
31
  this.executionDataProvider.assertCompatibleOracleVersion(version);
@@ -22,20 +33,15 @@ import { TypedOracle } from './typed_oracle.js';
22
33
  utilityGetRandomField() {
23
34
  return Fr.random();
24
35
  }
25
- utilityGetBlockNumber() {
26
- return this.executionDataProvider.getBlockNumber();
27
- }
28
- utilityGetTimestamp() {
29
- return this.executionDataProvider.getTimestamp();
30
- }
31
- utilityGetContractAddress() {
32
- return Promise.resolve(this.contractAddress);
33
- }
34
- utilityGetChainId() {
35
- return Promise.resolve(this.executionDataProvider.getChainId().then((id)=>new Fr(id)));
36
- }
37
- utilityGetVersion() {
38
- return Promise.resolve(this.executionDataProvider.getVersion().then((v)=>new Fr(v)));
36
+ async utilityGetUtilityContext() {
37
+ const blockHeader = await this.executionDataProvider.getAnchorBlockHeader();
38
+ return UtilityContext.from({
39
+ blockNumber: blockHeader.globalVariables.blockNumber,
40
+ timestamp: blockHeader.globalVariables.timestamp,
41
+ contractAddress: this.contractAddress,
42
+ version: blockHeader.globalVariables.version,
43
+ chainId: blockHeader.globalVariables.chainId
44
+ });
39
45
  }
40
46
  /**
41
47
  * Retrieve keys associated with a specific master public key and app address.
@@ -90,14 +96,14 @@ import { TypedOracle } from './typed_oracle.js';
90
96
  if (!block) {
91
97
  return undefined;
92
98
  }
93
- return block.header;
99
+ return block.getBlockHeader();
94
100
  }
95
101
  /**
96
102
  * Retrieve the complete address associated to a given address.
97
103
  * @param account - The account address.
98
104
  * @returns A complete address associated with the input address.
99
105
  * @throws An error if the account is not registered in the database.
100
- */ utilityGetCompleteAddress(account) {
106
+ */ utilityGetPublicKeysAndPartialAddress(account) {
101
107
  return this.executionDataProvider.getCompleteAddress(account);
102
108
  }
103
109
  /**
@@ -194,24 +200,16 @@ import { TypedOracle } from './typed_oracle.js';
194
200
  }
195
201
  return values;
196
202
  }
197
- utilityDebugLog(message, fields) {
198
- this.log.verbose(`${applyStringFormatting(message, fields)}`, {
199
- module: `${this.log.module}:debug_log`
200
- });
201
- }
202
- /**
203
- * Returns the tagging secret for a given sender and recipient pair, siloed to the current contract address.
204
- * Includes the next index to be used used for tagging with this secret.
205
- * For this to work, the ivsk_m of the sender must be known.
206
- * @param sender - The address sending the note
207
- * @param recipient - The address receiving the note
208
- * @returns A tagging secret that can be used to tag notes.
209
- */ async utilityGetIndexedTaggingSecretAsSender(sender, recipient) {
210
- return await this.executionDataProvider.getIndexedTaggingSecretAsSender(this.contractAddress, sender, recipient);
203
+ utilityDebugLog(level, message, fields) {
204
+ if (!LogLevels[level]) {
205
+ throw new Error(`Invalid debug log level: ${level}`);
206
+ }
207
+ const levelName = LogLevels[level];
208
+ this.aztecNrDebugLog[levelName](`${applyStringFormatting(message, fields)}`);
211
209
  }
212
210
  async utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot) {
213
211
  await this.executionDataProvider.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
214
- await this.executionDataProvider.removeNullifiedNotes(this.contractAddress);
212
+ await this.executionDataProvider.syncNoteNullifiers(this.contractAddress);
215
213
  }
216
214
  async utilityValidateEnqueuedNotesAndEvents(contractAddress, noteValidationRequestsArrayBaseSlot, eventValidationRequestsArrayBaseSlot) {
217
215
  // TODO(#10727): allow other contracts to deliver notes
@@ -264,7 +262,4 @@ import { TypedOracle } from './typed_oracle.js';
264
262
  utilityGetSharedSecret(address, ephPk) {
265
263
  return this.executionDataProvider.getSharedSecret(address, ephPk);
266
264
  }
267
- utilityEmitOffchainEffect(_data) {
268
- return Promise.reject(new Error('Cannot emit offchain effects from a utility function'));
269
- }
270
265
  }
@@ -7,12 +7,11 @@ import type { L2Block } from '@aztec/stdlib/block';
7
7
  import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
8
8
  import { type AztecNode } from '@aztec/stdlib/interfaces/client';
9
9
  import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
10
- import { IndexedTaggingSecret, PrivateLogWithTxData, PublicLogWithTxData } from '@aztec/stdlib/logs';
10
+ import { PrivateLogWithTxData, PublicLogWithTxData } from '@aztec/stdlib/logs';
11
11
  import { Note, type NoteStatus } from '@aztec/stdlib/note';
12
12
  import { MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
13
13
  import type { BlockHeader } from '@aztec/stdlib/tx';
14
14
  import { TxHash } from '@aztec/stdlib/tx';
15
- import type { UInt64 } from '@aztec/stdlib/types';
16
15
  import type { ExecutionDataProvider, ExecutionStats } from '../contract_function_simulator/execution_data_provider.js';
17
16
  import { MessageLoadOracleInputs } from '../contract_function_simulator/oracle/message_load_oracle_inputs.js';
18
17
  import type { AddressDataProvider } from '../storage/address_data_provider/address_data_provider.js';
@@ -22,6 +21,7 @@ import type { NoteDataProvider } from '../storage/note_data_provider/note_data_p
22
21
  import type { PrivateEventDataProvider } from '../storage/private_event_data_provider/private_event_data_provider.js';
23
22
  import type { SyncDataProvider } from '../storage/sync_data_provider/sync_data_provider.js';
24
23
  import type { TaggingDataProvider } from '../storage/tagging_data_provider/tagging_data_provider.js';
24
+ import { DirectionalAppTaggingSecret } from '../tagging/index.js';
25
25
  import type { ProxiedNode } from './proxied_node.js';
26
26
  /**
27
27
  * A data layer that provides and stores information needed for simulating/proving a transaction.
@@ -70,35 +70,8 @@ export declare class PXEOracleInterface implements ExecutionDataProvider {
70
70
  getBlock(blockNumber: number): Promise<L2Block | undefined>;
71
71
  getPublicDataWitness(blockNumber: number, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
72
72
  getPublicStorageAt(blockNumber: number, contract: AztecAddress, slot: Fr): Promise<Fr>;
73
- /**
74
- * Retrieve the latest block header synchronized by the PXE.
75
- * @dev This structure is fed into the circuits simulator and is used to prove against certain historical roots.
76
- * @returns The BlockHeader object.
77
- * TODO: I think this naming is bad as it's not the latest block header synched by the node, but the latest block
78
- * header synchronized by the PXE. Would rename this to something like getSynchronizedBlockHeader().
79
- */
80
- getBlockHeader(): Promise<BlockHeader>;
73
+ getAnchorBlockHeader(): Promise<BlockHeader>;
81
74
  assertCompatibleOracleVersion(version: number): void;
82
- /**
83
- * Fetches the latest block number synchronized by the node.
84
- * @returns The block number.
85
- */
86
- getBlockNumber(): Promise<number>;
87
- /**
88
- * Fetches the timestamp of the latest block synchronized by the node.
89
- * @returns The timestamp.
90
- */
91
- getTimestamp(): Promise<UInt64>;
92
- /**
93
- * Fetches the current chain id.
94
- * @returns The chain id.
95
- */
96
- getChainId(): Promise<number>;
97
- /**
98
- * Fetches the current version.
99
- * @returns The version.
100
- */
101
- getVersion(): Promise<number>;
102
75
  getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
103
76
  /**
104
77
  * Returns the full contents of your address book.
@@ -107,30 +80,9 @@ export declare class PXEOracleInterface implements ExecutionDataProvider {
107
80
  * @returns The full list of the users contact addresses.
108
81
  */
109
82
  getSenders(): Promise<AztecAddress[]>;
110
- /**
111
- * Returns the tagging secret for a given sender and recipient pair. For this to work, the ivsk_m of the sender must be known.
112
- * Includes the next index to be used used for tagging with this secret.
113
- * @param contractAddress - The contract address to silo the secret for
114
- * @param sender - The address sending the note
115
- * @param recipient - The address receiving the note
116
- * @returns An indexed tagging secret that can be used to tag notes.
117
- */
118
- getIndexedTaggingSecretAsSender(contractAddress: AztecAddress, sender: AztecAddress, recipient: AztecAddress): Promise<IndexedTaggingSecret>;
119
- /**
120
- * Increments the tagging secret for a given sender and recipient pair. For this to work, the ivsk_m of the sender must be known.
121
- * @param contractAddress - The contract address to silo the secret for
122
- * @param sender - The address sending the note
123
- * @param recipient - The address receiving the note
124
- */
125
- incrementAppTaggingSecretIndexAsSender(contractAddress: AztecAddress, sender: AztecAddress, recipient: AztecAddress): Promise<void>;
126
- /**
127
- * Updates the local index of the shared tagging secret of a sender / recipient pair
128
- * if a log with a larger index is found from the node.
129
- * @param contractAddress - The address of the contract that the logs are tagged for
130
- * @param sender - The address of the sender, we must know the sender's ivsk_m.
131
- * @param recipient - The address of the recipient.
132
- */
133
- syncTaggedLogsAsSender(contractAddress: AztecAddress, sender: AztecAddress, recipient: AztecAddress): Promise<void>;
83
+ getLastUsedIndexAsSender(secret: DirectionalAppTaggingSecret): Promise<number | undefined>;
84
+ calculateDirectionalAppTaggingSecret(contractAddress: AztecAddress, sender: AztecAddress, recipient: AztecAddress): Promise<DirectionalAppTaggingSecret>;
85
+ syncTaggedLogsAsSender(secret: DirectionalAppTaggingSecret, contractAddress: AztecAddress): Promise<void>;
134
86
  /**
135
87
  * Synchronizes the private logs tagged with scoped addresses and all the senders in the address book. Stores the found
136
88
  * logs in CapsuleArray ready for a later retrieval in Aztec.nr.
@@ -147,7 +99,19 @@ export declare class PXEOracleInterface implements ExecutionDataProvider {
147
99
  deliverEvent(contractAddress: AztecAddress, selector: EventSelector, content: Fr[], eventCommitment: Fr, txHash: TxHash, recipient: AztecAddress): Promise<void>;
148
100
  getPublicLogByTag(tag: Fr, contractAddress: AztecAddress): Promise<PublicLogWithTxData | null>;
149
101
  getPrivateLogByTag(siloedTag: Fr): Promise<PrivateLogWithTxData | null>;
150
- removeNullifiedNotes(contractAddress: AztecAddress): Promise<void>;
102
+ /**
103
+ * Looks for nullifiers of active contract notes and marks them as nullified if a nullifier is found.
104
+ *
105
+ * Fetches notes from the NoteDataProvider and checks which nullifiers are present in the
106
+ * onchain nullifier Merkle tree - up to the latest locally synced block. We use the
107
+ * locally synced block instead of querying the chain's 'latest' block to ensure correctness:
108
+ * notes are only marked nullified once their corresponding nullifier has been included in a
109
+ * block up to which the PXE has synced.
110
+ * This allows recent nullifications to be processed even if the node is not an archive node.
111
+ *
112
+ * @param contractAddress - The contract whose notes should be checked and nullified.
113
+ */
114
+ syncNoteNullifiers(contractAddress: AztecAddress): Promise<void>;
151
115
  storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[]): Promise<void>;
152
116
  loadCapsule(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null>;
153
117
  deleteCapsule(contractAddress: AztecAddress, slot: Fr): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"pxe_oracle_interface.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/pxe_oracle_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,KAAK,gCAAgC,EACrC,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAW,OAAO,EAAiB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EACL,oBAAoB,EAEpB,oBAAoB,EAEpB,mBAAmB,EAGpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACvG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1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