@aztec/pxe 0.0.1-commit.29c6b1a3 → 0.0.1-commit.2c85e299c

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 (209) hide show
  1. package/dest/access_scopes.d.ts +9 -0
  2. package/dest/access_scopes.d.ts.map +1 -0
  3. package/dest/access_scopes.js +6 -0
  4. package/dest/block_synchronizer/block_synchronizer.d.ts +5 -3
  5. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  6. package/dest/block_synchronizer/block_synchronizer.js +9 -3
  7. package/dest/config/index.d.ts +2 -2
  8. package/dest/config/index.d.ts.map +1 -1
  9. package/dest/config/index.js +1 -1
  10. package/dest/config/package_info.js +1 -1
  11. package/dest/contract_function_simulator/contract_function_simulator.d.ts +54 -30
  12. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  13. package/dest/contract_function_simulator/contract_function_simulator.js +177 -73
  14. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +5 -5
  15. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  16. package/dest/contract_function_simulator/execution_tagging_index_cache.js +3 -3
  17. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
  18. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -2
  19. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
  21. package/dest/contract_function_simulator/oracle/interfaces.d.ts +49 -45
  22. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/oracle/oracle.d.ts +44 -44
  24. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  25. package/dest/contract_function_simulator/oracle/oracle.js +156 -101
  26. package/dest/contract_function_simulator/oracle/private_execution.js +1 -1
  27. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +55 -55
  28. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  29. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +101 -56
  30. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +77 -51
  31. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  32. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +116 -94
  33. package/dest/contract_logging.d.ts +22 -0
  34. package/dest/contract_logging.d.ts.map +1 -0
  35. package/dest/contract_logging.js +23 -0
  36. package/dest/contract_sync/contract_sync_service.d.ts +43 -0
  37. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  38. package/dest/contract_sync/contract_sync_service.js +97 -0
  39. package/dest/contract_sync/helpers.d.ts +29 -0
  40. package/dest/contract_sync/helpers.d.ts.map +1 -0
  41. package/dest/contract_sync/{index.js → helpers.js} +13 -12
  42. package/dest/debug/pxe_debug_utils.d.ts +14 -10
  43. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  44. package/dest/debug/pxe_debug_utils.js +16 -15
  45. package/dest/entrypoints/client/bundle/index.d.ts +4 -1
  46. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  47. package/dest/entrypoints/client/bundle/index.js +3 -0
  48. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  49. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  50. package/dest/entrypoints/client/bundle/utils.js +21 -7
  51. package/dest/entrypoints/client/lazy/index.d.ts +4 -1
  52. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  53. package/dest/entrypoints/client/lazy/index.js +3 -0
  54. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  55. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  56. package/dest/entrypoints/client/lazy/utils.js +22 -8
  57. package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
  58. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  59. package/dest/entrypoints/server/index.d.ts +4 -2
  60. package/dest/entrypoints/server/index.d.ts.map +1 -1
  61. package/dest/entrypoints/server/index.js +3 -1
  62. package/dest/entrypoints/server/utils.d.ts +1 -1
  63. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  64. package/dest/entrypoints/server/utils.js +28 -9
  65. package/dest/events/event_service.d.ts +4 -5
  66. package/dest/events/event_service.d.ts.map +1 -1
  67. package/dest/events/event_service.js +5 -6
  68. package/dest/job_coordinator/job_coordinator.d.ts +3 -2
  69. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -1
  70. package/dest/job_coordinator/job_coordinator.js +3 -2
  71. package/dest/logs/log_service.d.ts +7 -5
  72. package/dest/logs/log_service.d.ts.map +1 -1
  73. package/dest/logs/log_service.js +19 -29
  74. package/dest/notes/note_service.d.ts +7 -7
  75. package/dest/notes/note_service.d.ts.map +1 -1
  76. package/dest/notes/note_service.js +9 -9
  77. package/dest/notes_filter.d.ts +25 -0
  78. package/dest/notes_filter.d.ts.map +1 -0
  79. package/dest/notes_filter.js +4 -0
  80. package/dest/oracle_version.d.ts +3 -3
  81. package/dest/oracle_version.d.ts.map +1 -1
  82. package/dest/oracle_version.js +3 -3
  83. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  84. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  85. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  86. package/dest/private_kernel/hints/index.d.ts +1 -1
  87. package/dest/private_kernel/hints/index.js +1 -1
  88. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +4 -3
  89. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
  90. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +129 -68
  91. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  92. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  93. package/dest/private_kernel/hints/test_utils.js +203 -0
  94. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  95. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  96. package/dest/private_kernel/private_kernel_execution_prover.js +21 -13
  97. package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
  98. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  99. package/dest/private_kernel/private_kernel_oracle.js +7 -3
  100. package/dest/pxe.d.ts +71 -24
  101. package/dest/pxe.d.ts.map +1 -1
  102. package/dest/pxe.js +104 -66
  103. package/dest/storage/address_store/address_store.d.ts +1 -1
  104. package/dest/storage/address_store/address_store.d.ts.map +1 -1
  105. package/dest/storage/address_store/address_store.js +12 -11
  106. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
  107. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
  108. package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
  109. package/dest/storage/capsule_store/capsule_store.js +6 -8
  110. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  111. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  112. package/dest/storage/contract_store/contract_store.js +157 -72
  113. package/dest/storage/metadata.d.ts +1 -1
  114. package/dest/storage/metadata.js +1 -1
  115. package/dest/storage/note_store/note_store.d.ts +13 -3
  116. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  117. package/dest/storage/note_store/note_store.js +147 -107
  118. package/dest/storage/private_event_store/private_event_store.d.ts +1 -1
  119. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  120. package/dest/storage/private_event_store/private_event_store.js +84 -61
  121. package/dest/storage/private_event_store/stored_private_event.js +1 -1
  122. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
  123. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  124. package/dest/storage/tagging_store/recipient_tagging_store.js +31 -19
  125. package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
  126. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
  127. package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
  128. package/dest/storage/tagging_store/sender_tagging_store.d.ts +5 -5
  129. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  130. package/dest/storage/tagging_store/sender_tagging_store.js +184 -114
  131. package/dest/tagging/get_all_logs_by_tags.d.ts +1 -1
  132. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
  133. package/dest/tagging/get_all_logs_by_tags.js +17 -3
  134. package/dest/tagging/index.d.ts +2 -2
  135. package/dest/tagging/index.d.ts.map +1 -1
  136. package/dest/tagging/index.js +1 -1
  137. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -5
  138. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  139. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +7 -7
  140. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  141. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +6 -7
  142. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  143. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +12 -11
  144. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -8
  145. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  146. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +3 -6
  147. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +4 -7
  148. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  149. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +14 -15
  150. package/package.json +25 -16
  151. package/src/access_scopes.ts +9 -0
  152. package/src/block_synchronizer/block_synchronizer.ts +21 -12
  153. package/src/config/index.ts +1 -1
  154. package/src/config/package_info.ts +1 -1
  155. package/src/contract_function_simulator/contract_function_simulator.ts +326 -131
  156. package/src/contract_function_simulator/execution_tagging_index_cache.ts +5 -5
  157. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
  158. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  159. package/src/contract_function_simulator/oracle/interfaces.ts +53 -50
  160. package/src/contract_function_simulator/oracle/oracle.ts +157 -112
  161. package/src/contract_function_simulator/oracle/private_execution.ts +1 -1
  162. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +127 -137
  163. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +167 -105
  164. package/src/contract_logging.ts +39 -0
  165. package/src/contract_sync/contract_sync_service.ts +152 -0
  166. package/src/contract_sync/{index.ts → helpers.ts} +21 -21
  167. package/src/debug/pxe_debug_utils.ts +48 -18
  168. package/src/entrypoints/client/bundle/index.ts +3 -0
  169. package/src/entrypoints/client/bundle/utils.ts +16 -15
  170. package/src/entrypoints/client/lazy/index.ts +3 -0
  171. package/src/entrypoints/client/lazy/utils.ts +17 -15
  172. package/src/entrypoints/pxe_creation_options.ts +2 -1
  173. package/src/entrypoints/server/index.ts +3 -1
  174. package/src/entrypoints/server/utils.ts +22 -26
  175. package/src/events/event_service.ts +4 -6
  176. package/src/job_coordinator/job_coordinator.ts +4 -3
  177. package/src/logs/log_service.ts +31 -38
  178. package/src/notes/note_service.ts +9 -10
  179. package/src/notes_filter.ts +26 -0
  180. package/src/oracle_version.ts +3 -3
  181. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  182. package/src/private_kernel/hints/index.ts +1 -1
  183. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +164 -117
  184. package/src/private_kernel/hints/test_utils.ts +325 -0
  185. package/src/private_kernel/private_kernel_execution_prover.ts +25 -15
  186. package/src/private_kernel/private_kernel_oracle.ts +7 -7
  187. package/src/pxe.ts +197 -118
  188. package/src/storage/address_store/address_store.ts +15 -15
  189. package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
  190. package/src/storage/capsule_store/capsule_store.ts +8 -8
  191. package/src/storage/contract_store/contract_store.ts +186 -76
  192. package/src/storage/metadata.ts +1 -1
  193. package/src/storage/note_store/note_store.ts +169 -132
  194. package/src/storage/private_event_store/private_event_store.ts +102 -81
  195. package/src/storage/private_event_store/stored_private_event.ts +1 -1
  196. package/src/storage/tagging_store/recipient_tagging_store.ts +38 -24
  197. package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
  198. package/src/storage/tagging_store/sender_tagging_store.ts +214 -130
  199. package/src/tagging/get_all_logs_by_tags.ts +28 -4
  200. package/src/tagging/index.ts +1 -1
  201. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +7 -10
  202. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  203. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +10 -15
  204. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +4 -9
  205. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +11 -20
  206. package/dest/contract_sync/index.d.ts +0 -23
  207. package/dest/contract_sync/index.d.ts.map +0 -1
  208. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  209. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
@@ -69,12 +69,12 @@ export class Oracle {
69
69
  name => !excludedProps.includes(name as (typeof excludedProps)[number]),
70
70
  );
71
71
 
72
- // Validate oracle names - these must be prefixed with either "private" or "utility" to indicate their scope
72
+ // Validate oracle names - these must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate their scope
73
73
  // and must correspond to a function on the Oracle class.
74
74
  oracleNames.forEach(name => {
75
- if (!name.startsWith('private') && !name.startsWith('utility')) {
75
+ if (!name.startsWith('aztec_prv_') && !name.startsWith('aztec_utl_')) {
76
76
  throw new Error(
77
- `Oracle function "${name}" must be prefixed with either "private" or "utility" to indicate its scope`,
77
+ `Oracle function "${name}" must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate its scope`,
78
78
  );
79
79
  }
80
80
 
@@ -92,41 +92,46 @@ export class Oracle {
92
92
  }, {} as ACIRCallback);
93
93
  }
94
94
 
95
- utilityAssertCompatibleOracleVersion([version]: ACVMField[]) {
96
- this.handlerAsMisc().utilityAssertCompatibleOracleVersion(Fr.fromString(version).toNumber());
95
+ // eslint-disable-next-line camelcase
96
+ aztec_utl_assertCompatibleOracleVersion([version]: ACVMField[]) {
97
+ this.handlerAsMisc().assertCompatibleOracleVersion(Fr.fromString(version).toNumber());
97
98
  return Promise.resolve([]);
98
99
  }
99
100
 
100
- utilityGetRandomField(): Promise<ACVMField[]> {
101
- const val = this.handlerAsMisc().utilityGetRandomField();
101
+ // eslint-disable-next-line camelcase
102
+ aztec_utl_getRandomField(): Promise<ACVMField[]> {
103
+ const val = this.handlerAsMisc().getRandomField();
102
104
  return Promise.resolve([toACVMField(val)]);
103
105
  }
104
106
 
105
- privateStoreInExecutionCache(values: ACVMField[], [hash]: ACVMField[]): Promise<ACVMField[]> {
106
- this.handlerAsPrivate().privateStoreInExecutionCache(values.map(Fr.fromString), Fr.fromString(hash));
107
+ // eslint-disable-next-line camelcase
108
+ aztec_prv_storeInExecutionCache(values: ACVMField[], [hash]: ACVMField[]): Promise<ACVMField[]> {
109
+ this.handlerAsPrivate().storeInExecutionCache(values.map(Fr.fromString), Fr.fromString(hash));
107
110
  return Promise.resolve([]);
108
111
  }
109
112
 
110
- async privateLoadFromExecutionCache([returnsHash]: ACVMField[]): Promise<ACVMField[][]> {
111
- const values = await this.handlerAsPrivate().privateLoadFromExecutionCache(Fr.fromString(returnsHash));
113
+ // eslint-disable-next-line camelcase
114
+ async aztec_prv_loadFromExecutionCache([returnsHash]: ACVMField[]): Promise<ACVMField[][]> {
115
+ const values = await this.handlerAsPrivate().loadFromExecutionCache(Fr.fromString(returnsHash));
112
116
  return [values.map(toACVMField)];
113
117
  }
114
118
 
115
- utilityGetUtilityContext(): Promise<(ACVMField | ACVMField[])[]> {
116
- const context = this.handlerAsUtility().utilityGetUtilityContext();
119
+ // eslint-disable-next-line camelcase
120
+ aztec_utl_getUtilityContext(): Promise<(ACVMField | ACVMField[])[]> {
121
+ const context = this.handlerAsUtility().getUtilityContext();
117
122
  return Promise.resolve(context.toNoirRepresentation());
118
123
  }
119
124
 
120
- async utilityGetKeyValidationRequest([pkMHash]: ACVMField[]): Promise<ACVMField[]> {
121
- const keyValidationRequest = await this.handlerAsUtility().utilityGetKeyValidationRequest(Fr.fromString(pkMHash));
125
+ // eslint-disable-next-line camelcase
126
+ async aztec_utl_getKeyValidationRequest([pkMHash]: ACVMField[]): Promise<ACVMField[]> {
127
+ const keyValidationRequest = await this.handlerAsUtility().getKeyValidationRequest(Fr.fromString(pkMHash));
122
128
 
123
129
  return keyValidationRequest.toFields().map(toACVMField);
124
130
  }
125
131
 
126
- async utilityGetContractInstance([address]: ACVMField[]): Promise<ACVMField[]> {
127
- const instance = await this.handlerAsUtility().utilityGetContractInstance(
128
- AztecAddress.fromField(Fr.fromString(address)),
129
- );
132
+ // eslint-disable-next-line camelcase
133
+ async aztec_utl_getContractInstance([address]: ACVMField[]): Promise<ACVMField[]> {
134
+ const instance = await this.handlerAsUtility().getContractInstance(AztecAddress.fromField(Fr.fromString(address)));
130
135
 
131
136
  return [
132
137
  instance.salt,
@@ -137,45 +142,49 @@ export class Oracle {
137
142
  ].map(toACVMField);
138
143
  }
139
144
 
140
- async utilityGetNoteHashMembershipWitness(
141
- [blockHash]: ACVMField[],
142
- [leafValue]: ACVMField[],
145
+ // eslint-disable-next-line camelcase
146
+ async aztec_utl_getNoteHashMembershipWitness(
147
+ [anchorBlockHash]: ACVMField[],
148
+ [noteHash]: ACVMField[],
143
149
  ): Promise<(ACVMField | ACVMField[])[]> {
144
- const parsedBlockHash = BlockHash.fromString(blockHash);
145
- const parsedLeafValue = Fr.fromString(leafValue);
150
+ const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
151
+ const parsedNoteHash = Fr.fromString(noteHash);
146
152
 
147
- const witness = await this.handlerAsUtility().utilityGetNoteHashMembershipWitness(parsedBlockHash, parsedLeafValue);
153
+ const witness = await this.handlerAsUtility().getNoteHashMembershipWitness(parsedAnchorBlockHash, parsedNoteHash);
148
154
  if (!witness) {
149
- throw new Error(`Leaf ${leafValue} not found in the note hash tree at block hash ${parsedBlockHash.toString()}.`);
155
+ throw new Error(
156
+ `Note hash ${noteHash} not found in the note hash tree at anchor block hash ${parsedAnchorBlockHash.toString()}.`,
157
+ );
150
158
  }
151
159
  return witness.toNoirRepresentation();
152
160
  }
153
161
 
154
- async utilityGetArchiveMembershipWitness(
162
+ // eslint-disable-next-line camelcase
163
+ async aztec_utl_getBlockHashMembershipWitness(
164
+ [anchorBlockHash]: ACVMField[],
155
165
  [blockHash]: ACVMField[],
156
- [leafValue]: ACVMField[],
157
166
  ): Promise<(ACVMField | ACVMField[])[]> {
167
+ const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
158
168
  const parsedBlockHash = BlockHash.fromString(blockHash);
159
- const parsedLeafValue = Fr.fromString(leafValue);
160
169
 
161
- const witness = await this.handlerAsUtility().utilityGetArchiveMembershipWitness(parsedBlockHash, parsedLeafValue);
170
+ const witness = await this.handlerAsUtility().getBlockHashMembershipWitness(parsedAnchorBlockHash, parsedBlockHash);
162
171
  if (!witness) {
163
- throw new Error(`Leaf ${leafValue} not found in the archive tree at block hash ${parsedBlockHash.toString()}.`);
172
+ throw new Error(
173
+ `Block hash ${parsedBlockHash.toString()} not found in the archive tree at anchor block ${parsedAnchorBlockHash.toString()}.`,
174
+ );
164
175
  }
165
176
  return witness.toNoirRepresentation();
166
177
  }
167
178
 
168
- async utilityGetNullifierMembershipWitness(
179
+ // eslint-disable-next-line camelcase
180
+ async aztec_utl_getNullifierMembershipWitness(
169
181
  [blockHash]: ACVMField[],
170
182
  [nullifier]: ACVMField[], // nullifier, we try to find the witness for (to prove inclusion)
171
183
  ): Promise<(ACVMField | ACVMField[])[]> {
172
184
  const parsedBlockHash = BlockHash.fromString(blockHash);
173
185
  const parsedNullifier = Fr.fromString(nullifier);
174
186
 
175
- const witness = await this.handlerAsUtility().utilityGetNullifierMembershipWitness(
176
- parsedBlockHash,
177
- parsedNullifier,
178
- );
187
+ const witness = await this.handlerAsUtility().getNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
179
188
  if (!witness) {
180
189
  throw new Error(
181
190
  `Nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
@@ -184,17 +193,15 @@ export class Oracle {
184
193
  return witness.toNoirRepresentation();
185
194
  }
186
195
 
187
- async utilityGetLowNullifierMembershipWitness(
196
+ // eslint-disable-next-line camelcase
197
+ async aztec_utl_getLowNullifierMembershipWitness(
188
198
  [blockHash]: ACVMField[],
189
199
  [nullifier]: ACVMField[], // nullifier, we try to find the low nullifier witness for (to prove non-inclusion)
190
200
  ): Promise<(ACVMField | ACVMField[])[]> {
191
201
  const parsedBlockHash = BlockHash.fromString(blockHash);
192
202
  const parsedNullifier = Fr.fromString(nullifier);
193
203
 
194
- const witness = await this.handlerAsUtility().utilityGetLowNullifierMembershipWitness(
195
- parsedBlockHash,
196
- parsedNullifier,
197
- );
204
+ const witness = await this.handlerAsUtility().getLowNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
198
205
  if (!witness) {
199
206
  throw new Error(
200
207
  `Low nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
@@ -203,14 +210,15 @@ export class Oracle {
203
210
  return witness.toNoirRepresentation();
204
211
  }
205
212
 
206
- async utilityGetPublicDataWitness(
213
+ // eslint-disable-next-line camelcase
214
+ async aztec_utl_getPublicDataWitness(
207
215
  [blockHash]: ACVMField[],
208
216
  [leafSlot]: ACVMField[],
209
217
  ): Promise<(ACVMField | ACVMField[])[]> {
210
218
  const parsedBlockHash = BlockHash.fromString(blockHash);
211
219
  const parsedLeafSlot = Fr.fromString(leafSlot);
212
220
 
213
- const witness = await this.handlerAsUtility().utilityGetPublicDataWitness(parsedBlockHash, parsedLeafSlot);
221
+ const witness = await this.handlerAsUtility().getPublicDataWitness(parsedBlockHash, parsedLeafSlot);
214
222
  if (!witness) {
215
223
  throw new Error(
216
224
  `Public data witness not found for slot ${parsedLeafSlot} at block hash ${parsedBlockHash.toString()}.`,
@@ -219,34 +227,45 @@ export class Oracle {
219
227
  return witness.toNoirRepresentation();
220
228
  }
221
229
 
222
- async utilityGetBlockHeader([blockNumber]: ACVMField[]): Promise<ACVMField[]> {
230
+ // eslint-disable-next-line camelcase
231
+ async aztec_utl_getBlockHeader([blockNumber]: ACVMField[]): Promise<ACVMField[]> {
223
232
  const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
224
233
 
225
- const header = await this.handlerAsUtility().utilityGetBlockHeader(BlockNumber(parsedBlockNumber));
234
+ const header = await this.handlerAsUtility().getBlockHeader(BlockNumber(parsedBlockNumber));
226
235
  if (!header) {
227
236
  throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
228
237
  }
229
238
  return header.toFields().map(toACVMField);
230
239
  }
231
240
 
232
- async utilityGetAuthWitness([messageHash]: ACVMField[]): Promise<ACVMField[][]> {
241
+ // eslint-disable-next-line camelcase
242
+ async aztec_utl_getAuthWitness([messageHash]: ACVMField[]): Promise<ACVMField[][]> {
233
243
  const messageHashField = Fr.fromString(messageHash);
234
- const witness = await this.handlerAsUtility().utilityGetAuthWitness(messageHashField);
244
+ const witness = await this.handlerAsUtility().getAuthWitness(messageHashField);
235
245
  if (!witness) {
236
246
  throw new Error(`Unknown auth witness for message hash ${messageHashField}`);
237
247
  }
238
248
  return [witness.map(toACVMField)];
239
249
  }
240
250
 
241
- async utilityGetPublicKeysAndPartialAddress([address]: ACVMField[]): Promise<ACVMField[][]> {
251
+ // eslint-disable-next-line camelcase
252
+ async aztec_utl_tryGetPublicKeysAndPartialAddress([address]: ACVMField[]): Promise<(ACVMField | ACVMField[])[]> {
242
253
  const parsedAddress = AztecAddress.fromField(Fr.fromString(address));
243
- const { publicKeys, partialAddress } =
244
- await this.handlerAsUtility().utilityGetPublicKeysAndPartialAddress(parsedAddress);
254
+ const result = await this.handlerAsUtility().tryGetPublicKeysAndPartialAddress(parsedAddress);
245
255
 
246
- return [[...publicKeys.toFields(), partialAddress].map(toACVMField)];
256
+ // We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
257
+ // with two fields: `some` (a boolean) and `value` (a field array in this case).
258
+ if (result === undefined) {
259
+ // No data was found so we set `some` to 0 and pad `value` with zeros get the correct return size.
260
+ return [toACVMField(0), Array(13).fill(toACVMField(0))];
261
+ } else {
262
+ // Data was found so we set `some` to 1 and return it along with `value`.
263
+ return [toACVMField(1), [...result.publicKeys.toFields(), result.partialAddress].map(toACVMField)];
264
+ }
247
265
  }
248
266
 
249
- async utilityGetNotes(
267
+ // eslint-disable-next-line camelcase
268
+ async aztec_utl_getNotes(
250
269
  [ownerSome]: ACVMField[],
251
270
  [ownerValue]: ACVMField[],
252
271
  [storageSlot]: ACVMField[],
@@ -268,7 +287,7 @@ export class Oracle {
268
287
  ): Promise<(ACVMField | ACVMField[])[]> {
269
288
  // Parse Option<AztecAddress>: ownerSome is 0 for None, 1 for Some
270
289
  const owner = Fr.fromString(ownerSome).toNumber() === 1 ? AztecAddress.fromString(ownerValue) : undefined;
271
- const noteDatas = await this.handlerAsUtility().utilityGetNotes(
290
+ const noteDatas = await this.handlerAsUtility().getNotes(
272
291
  owner,
273
292
  Fr.fromString(storageSlot),
274
293
  +numSelects,
@@ -307,7 +326,8 @@ export class Oracle {
307
326
  return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedHintedNoteLength);
308
327
  }
309
328
 
310
- privateNotifyCreatedNote(
329
+ // eslint-disable-next-line camelcase
330
+ aztec_prv_notifyCreatedNote(
311
331
  [owner]: ACVMField[],
312
332
  [storageSlot]: ACVMField[],
313
333
  [randomness]: ACVMField[],
@@ -316,7 +336,7 @@ export class Oracle {
316
336
  [noteHash]: ACVMField[],
317
337
  [counter]: ACVMField[],
318
338
  ): Promise<ACVMField[]> {
319
- this.handlerAsPrivate().privateNotifyCreatedNote(
339
+ this.handlerAsPrivate().notifyCreatedNote(
320
340
  AztecAddress.fromString(owner),
321
341
  Fr.fromString(storageSlot),
322
342
  Fr.fromString(randomness),
@@ -328,43 +348,47 @@ export class Oracle {
328
348
  return Promise.resolve([]);
329
349
  }
330
350
 
331
- async privateNotifyNullifiedNote(
351
+ // eslint-disable-next-line camelcase
352
+ async aztec_prv_notifyNullifiedNote(
332
353
  [innerNullifier]: ACVMField[],
333
354
  [noteHash]: ACVMField[],
334
355
  [counter]: ACVMField[],
335
356
  ): Promise<ACVMField[]> {
336
- await this.handlerAsPrivate().privateNotifyNullifiedNote(
337
- Fr.fromString(innerNullifier),
338
- Fr.fromString(noteHash),
339
- +counter,
340
- );
357
+ await this.handlerAsPrivate().notifyNullifiedNote(Fr.fromString(innerNullifier), Fr.fromString(noteHash), +counter);
341
358
  return [];
342
359
  }
343
360
 
344
- async privateNotifyCreatedNullifier([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
345
- await this.handlerAsPrivate().privateNotifyCreatedNullifier(Fr.fromString(innerNullifier));
361
+ // eslint-disable-next-line camelcase
362
+ async aztec_prv_notifyCreatedNullifier([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
363
+ await this.handlerAsPrivate().notifyCreatedNullifier(Fr.fromString(innerNullifier));
346
364
  return [];
347
365
  }
348
366
 
349
- async privateIsNullifierPending([innerNullifier]: ACVMField[], [contractAddress]: ACVMField[]): Promise<ACVMField[]> {
350
- const isPending = await this.handlerAsPrivate().privateIsNullifierPending(
367
+ // eslint-disable-next-line camelcase
368
+ async aztec_prv_isNullifierPending(
369
+ [innerNullifier]: ACVMField[],
370
+ [contractAddress]: ACVMField[],
371
+ ): Promise<ACVMField[]> {
372
+ const isPending = await this.handlerAsPrivate().isNullifierPending(
351
373
  Fr.fromString(innerNullifier),
352
374
  AztecAddress.fromString(contractAddress),
353
375
  );
354
376
  return [toACVMField(isPending)];
355
377
  }
356
378
 
357
- async utilityCheckNullifierExists([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
358
- const exists = await this.handlerAsUtility().utilityCheckNullifierExists(Fr.fromString(innerNullifier));
379
+ // eslint-disable-next-line camelcase
380
+ async aztec_utl_checkNullifierExists([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
381
+ const exists = await this.handlerAsUtility().checkNullifierExists(Fr.fromString(innerNullifier));
359
382
  return [toACVMField(exists)];
360
383
  }
361
384
 
362
- async utilityGetL1ToL2MembershipWitness(
385
+ // eslint-disable-next-line camelcase
386
+ async aztec_utl_getL1ToL2MembershipWitness(
363
387
  [contractAddress]: ACVMField[],
364
388
  [messageHash]: ACVMField[],
365
389
  [secret]: ACVMField[],
366
390
  ): Promise<(ACVMField | ACVMField[])[]> {
367
- const message = await this.handlerAsUtility().utilityGetL1ToL2MembershipWitness(
391
+ const message = await this.handlerAsUtility().getL1ToL2MembershipWitness(
368
392
  AztecAddress.fromString(contractAddress),
369
393
  Fr.fromString(messageHash),
370
394
  Fr.fromString(secret),
@@ -372,13 +396,14 @@ export class Oracle {
372
396
  return message.toNoirRepresentation();
373
397
  }
374
398
 
375
- async utilityStorageRead(
399
+ // eslint-disable-next-line camelcase
400
+ async aztec_utl_storageRead(
376
401
  [blockHash]: ACVMField[],
377
402
  [contractAddress]: ACVMField[],
378
403
  [startStorageSlot]: ACVMField[],
379
404
  [numberOfElements]: ACVMField[],
380
405
  ): Promise<ACVMField[][]> {
381
- const values = await this.handlerAsUtility().utilityStorageRead(
406
+ const values = await this.handlerAsUtility().storageRead(
382
407
  BlockHash.fromString(blockHash),
383
408
  new AztecAddress(Fr.fromString(contractAddress)),
384
409
  Fr.fromString(startStorageSlot),
@@ -387,7 +412,8 @@ export class Oracle {
387
412
  return [values.map(toACVMField)];
388
413
  }
389
414
 
390
- privateNotifyCreatedContractClassLog(
415
+ // eslint-disable-next-line camelcase
416
+ aztec_prv_notifyCreatedContractClassLog(
391
417
  [contractAddress]: ACVMField[],
392
418
  message: ACVMField[],
393
419
  [length]: ACVMField[],
@@ -396,11 +422,12 @@ export class Oracle {
396
422
  const logFields = new ContractClassLogFields(message.map(Fr.fromString));
397
423
  const log = new ContractClassLog(new AztecAddress(Fr.fromString(contractAddress)), logFields, +length);
398
424
 
399
- this.handlerAsPrivate().privateNotifyCreatedContractClassLog(log, +counter);
425
+ this.handlerAsPrivate().notifyCreatedContractClassLog(log, +counter);
400
426
  return Promise.resolve([]);
401
427
  }
402
428
 
403
- utilityDebugLog(
429
+ // eslint-disable-next-line camelcase
430
+ async aztec_utl_log(
404
431
  level: ACVMField[],
405
432
  message: ACVMField[],
406
433
  _ignoredFieldsSize: ACVMField[],
@@ -409,20 +436,21 @@ export class Oracle {
409
436
  const levelFr = Fr.fromString(level[0]);
410
437
  const messageStr = message.map(acvmField => String.fromCharCode(Fr.fromString(acvmField).toNumber())).join('');
411
438
  const fieldsFr = fields.map(Fr.fromString);
412
- this.handlerAsMisc().utilityDebugLog(levelFr.toNumber(), messageStr, fieldsFr);
413
- return Promise.resolve([]);
439
+ await this.handlerAsMisc().log(levelFr.toNumber(), messageStr, fieldsFr);
440
+ return [];
414
441
  }
415
442
 
416
443
  // This function's name is directly hardcoded in `circuit_recorder.ts`. Don't forget to update it there if you
417
444
  // change the name here.
418
- async privateCallPrivateFunction(
445
+ // eslint-disable-next-line camelcase
446
+ async aztec_prv_callPrivateFunction(
419
447
  [contractAddress]: ACVMField[],
420
448
  [functionSelector]: ACVMField[],
421
449
  [argsHash]: ACVMField[],
422
450
  [sideEffectCounter]: ACVMField[],
423
451
  [isStaticCall]: ACVMField[],
424
452
  ): Promise<ACVMField[][]> {
425
- const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().privateCallPrivateFunction(
453
+ const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().callPrivateFunction(
426
454
  AztecAddress.fromField(Fr.fromString(contractAddress)),
427
455
  FunctionSelector.fromField(Fr.fromString(functionSelector)),
428
456
  Fr.fromString(argsHash),
@@ -432,13 +460,14 @@ export class Oracle {
432
460
  return [[endSideEffectCounter, returnsHash].map(toACVMField)];
433
461
  }
434
462
 
435
- async privateNotifyEnqueuedPublicFunctionCall(
463
+ // eslint-disable-next-line camelcase
464
+ async aztec_prv_notifyEnqueuedPublicFunctionCall(
436
465
  [contractAddress]: ACVMField[],
437
466
  [calldataHash]: ACVMField[],
438
467
  [sideEffectCounter]: ACVMField[],
439
468
  [isStaticCall]: ACVMField[],
440
469
  ): Promise<ACVMField[]> {
441
- await this.handlerAsPrivate().privateNotifyEnqueuedPublicFunctionCall(
470
+ await this.handlerAsPrivate().notifyEnqueuedPublicFunctionCall(
442
471
  AztecAddress.fromString(contractAddress),
443
472
  Fr.fromString(calldataHash),
444
473
  Fr.fromString(sideEffectCounter).toNumber(),
@@ -447,13 +476,14 @@ export class Oracle {
447
476
  return [];
448
477
  }
449
478
 
450
- async privateNotifySetPublicTeardownFunctionCall(
479
+ // eslint-disable-next-line camelcase
480
+ async aztec_prv_notifySetPublicTeardownFunctionCall(
451
481
  [contractAddress]: ACVMField[],
452
482
  [calldataHash]: ACVMField[],
453
483
  [sideEffectCounter]: ACVMField[],
454
484
  [isStaticCall]: ACVMField[],
455
485
  ): Promise<ACVMField[]> {
456
- await this.handlerAsPrivate().privateNotifySetPublicTeardownFunctionCall(
486
+ await this.handlerAsPrivate().notifySetPublicTeardownFunctionCall(
457
487
  AztecAddress.fromString(contractAddress),
458
488
  Fr.fromString(calldataHash),
459
489
  Fr.fromString(sideEffectCounter).toNumber(),
@@ -462,41 +492,46 @@ export class Oracle {
462
492
  return [];
463
493
  }
464
494
 
465
- async privateNotifySetMinRevertibleSideEffectCounter([minRevertibleSideEffectCounter]: ACVMField[]): Promise<
495
+ // eslint-disable-next-line camelcase
496
+ async aztec_prv_notifySetMinRevertibleSideEffectCounter([minRevertibleSideEffectCounter]: ACVMField[]): Promise<
466
497
  ACVMField[]
467
498
  > {
468
- await this.handlerAsPrivate().privateNotifySetMinRevertibleSideEffectCounter(
499
+ await this.handlerAsPrivate().notifySetMinRevertibleSideEffectCounter(
469
500
  Fr.fromString(minRevertibleSideEffectCounter).toNumber(),
470
501
  );
471
502
  return Promise.resolve([]);
472
503
  }
473
504
 
474
- async privateIsSideEffectCounterRevertible([sideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
475
- const isRevertible = await this.handlerAsPrivate().privateIsSideEffectCounterRevertible(
505
+ // eslint-disable-next-line camelcase
506
+ async aztec_prv_isSideEffectCounterRevertible([sideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
507
+ const isRevertible = await this.handlerAsPrivate().isSideEffectCounterRevertible(
476
508
  Fr.fromString(sideEffectCounter).toNumber(),
477
509
  );
478
510
  return Promise.resolve([toACVMField(isRevertible)]);
479
511
  }
480
512
 
481
- async privateGetNextAppTagAsSender([sender]: ACVMField[], [recipient]: ACVMField[]): Promise<ACVMField[]> {
482
- const tag = await this.handlerAsPrivate().privateGetNextAppTagAsSender(
513
+ // eslint-disable-next-line camelcase
514
+ async aztec_prv_getNextAppTagAsSender([sender]: ACVMField[], [recipient]: ACVMField[]): Promise<ACVMField[]> {
515
+ const tag = await this.handlerAsPrivate().getNextAppTagAsSender(
483
516
  AztecAddress.fromString(sender),
484
517
  AztecAddress.fromString(recipient),
485
518
  );
486
519
  return [toACVMField(tag.value)];
487
520
  }
488
521
 
489
- async utilityFetchTaggedLogs([pendingTaggedLogArrayBaseSlot]: ACVMField[]): Promise<ACVMField[]> {
490
- await this.handlerAsUtility().utilityFetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
522
+ // eslint-disable-next-line camelcase
523
+ async aztec_utl_fetchTaggedLogs([pendingTaggedLogArrayBaseSlot]: ACVMField[]): Promise<ACVMField[]> {
524
+ await this.handlerAsUtility().fetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
491
525
  return [];
492
526
  }
493
527
 
494
- async utilityValidateAndStoreEnqueuedNotesAndEvents(
528
+ // eslint-disable-next-line camelcase
529
+ async aztec_utl_validateAndStoreEnqueuedNotesAndEvents(
495
530
  [contractAddress]: ACVMField[],
496
531
  [noteValidationRequestsArrayBaseSlot]: ACVMField[],
497
532
  [eventValidationRequestsArrayBaseSlot]: ACVMField[],
498
533
  ): Promise<ACVMField[]> {
499
- await this.handlerAsUtility().utilityValidateAndStoreEnqueuedNotesAndEvents(
534
+ await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEvents(
500
535
  AztecAddress.fromString(contractAddress),
501
536
  Fr.fromString(noteValidationRequestsArrayBaseSlot),
502
537
  Fr.fromString(eventValidationRequestsArrayBaseSlot),
@@ -505,12 +540,13 @@ export class Oracle {
505
540
  return [];
506
541
  }
507
542
 
508
- async utilityBulkRetrieveLogs(
543
+ // eslint-disable-next-line camelcase
544
+ async aztec_utl_bulkRetrieveLogs(
509
545
  [contractAddress]: ACVMField[],
510
546
  [logRetrievalRequestsArrayBaseSlot]: ACVMField[],
511
547
  [logRetrievalResponsesArrayBaseSlot]: ACVMField[],
512
548
  ): Promise<ACVMField[]> {
513
- await this.handlerAsUtility().utilityBulkRetrieveLogs(
549
+ await this.handlerAsUtility().bulkRetrieveLogs(
514
550
  AztecAddress.fromString(contractAddress),
515
551
  Fr.fromString(logRetrievalRequestsArrayBaseSlot),
516
552
  Fr.fromString(logRetrievalResponsesArrayBaseSlot),
@@ -518,12 +554,13 @@ export class Oracle {
518
554
  return [];
519
555
  }
520
556
 
521
- async utilityStoreCapsule(
557
+ // eslint-disable-next-line camelcase
558
+ async aztec_utl_storeCapsule(
522
559
  [contractAddress]: ACVMField[],
523
560
  [slot]: ACVMField[],
524
561
  capsule: ACVMField[],
525
562
  ): Promise<ACVMField[]> {
526
- await this.handlerAsUtility().utilityStoreCapsule(
563
+ await this.handlerAsUtility().storeCapsule(
527
564
  AztecAddress.fromField(Fr.fromString(contractAddress)),
528
565
  Fr.fromString(slot),
529
566
  capsule.map(Fr.fromString),
@@ -531,12 +568,13 @@ export class Oracle {
531
568
  return [];
532
569
  }
533
570
 
534
- async utilityLoadCapsule(
571
+ // eslint-disable-next-line camelcase
572
+ async aztec_utl_loadCapsule(
535
573
  [contractAddress]: ACVMField[],
536
574
  [slot]: ACVMField[],
537
575
  [tSize]: ACVMField[],
538
576
  ): Promise<(ACVMField | ACVMField[])[]> {
539
- const values = await this.handlerAsUtility().utilityLoadCapsule(
577
+ const values = await this.handlerAsUtility().loadCapsule(
540
578
  AztecAddress.fromField(Fr.fromString(contractAddress)),
541
579
  Fr.fromString(slot),
542
580
  );
@@ -552,21 +590,23 @@ export class Oracle {
552
590
  }
553
591
  }
554
592
 
555
- async utilityDeleteCapsule([contractAddress]: ACVMField[], [slot]: ACVMField[]): Promise<ACVMField[]> {
556
- await this.handlerAsUtility().utilityDeleteCapsule(
593
+ // eslint-disable-next-line camelcase
594
+ async aztec_utl_deleteCapsule([contractAddress]: ACVMField[], [slot]: ACVMField[]): Promise<ACVMField[]> {
595
+ await this.handlerAsUtility().deleteCapsule(
557
596
  AztecAddress.fromField(Fr.fromString(contractAddress)),
558
597
  Fr.fromString(slot),
559
598
  );
560
599
  return [];
561
600
  }
562
601
 
563
- async utilityCopyCapsule(
602
+ // eslint-disable-next-line camelcase
603
+ async aztec_utl_copyCapsule(
564
604
  [contractAddress]: ACVMField[],
565
605
  [srcSlot]: ACVMField[],
566
606
  [dstSlot]: ACVMField[],
567
607
  [numEntries]: ACVMField[],
568
608
  ): Promise<ACVMField[]> {
569
- await this.handlerAsUtility().utilityCopyCapsule(
609
+ await this.handlerAsUtility().copyCapsule(
570
610
  AztecAddress.fromField(Fr.fromString(contractAddress)),
571
611
  Fr.fromString(srcSlot),
572
612
  Fr.fromString(dstSlot),
@@ -575,7 +615,8 @@ export class Oracle {
575
615
  return [];
576
616
  }
577
617
 
578
- async utilityAes128Decrypt(
618
+ // eslint-disable-next-line camelcase
619
+ async aztec_utl_aes128Decrypt(
579
620
  ciphertextBVecStorage: ACVMField[],
580
621
  [ciphertextLength]: ACVMField[],
581
622
  iv: ACVMField[],
@@ -585,36 +626,40 @@ export class Oracle {
585
626
  const ivBuffer = fromUintArray(iv, 8);
586
627
  const symKeyBuffer = fromUintArray(symKey, 8);
587
628
 
588
- const plaintext = await this.handlerAsUtility().utilityAes128Decrypt(ciphertext, ivBuffer, symKeyBuffer);
629
+ const plaintext = await this.handlerAsUtility().aes128Decrypt(ciphertext, ivBuffer, symKeyBuffer);
589
630
  return bufferToBoundedVec(plaintext, ciphertextBVecStorage.length);
590
631
  }
591
632
 
592
- async utilityGetSharedSecret(
633
+ // eslint-disable-next-line camelcase
634
+ async aztec_utl_getSharedSecret(
593
635
  [address]: ACVMField[],
594
636
  [ephPKField0]: ACVMField[],
595
637
  [ephPKField1]: ACVMField[],
596
638
  [ephPKField2]: ACVMField[],
597
639
  ): Promise<ACVMField[]> {
598
- const secret = await this.handlerAsUtility().utilityGetSharedSecret(
640
+ const secret = await this.handlerAsUtility().getSharedSecret(
599
641
  AztecAddress.fromField(Fr.fromString(address)),
600
642
  Point.fromFields([ephPKField0, ephPKField1, ephPKField2].map(Fr.fromString)),
601
643
  );
602
644
  return secret.toFields().map(toACVMField);
603
645
  }
604
646
 
605
- async utilityEmitOffchainEffect(data: ACVMField[]) {
606
- await this.handlerAsPrivate().utilityEmitOffchainEffect(data.map(Fr.fromString));
647
+ // eslint-disable-next-line camelcase
648
+ async aztec_utl_emitOffchainEffect(data: ACVMField[]) {
649
+ await this.handlerAsPrivate().emitOffchainEffect(data.map(Fr.fromString));
607
650
  return [];
608
651
  }
609
652
 
610
- async privateGetSenderForTags(): Promise<ACVMField[]> {
611
- const sender = await this.handlerAsPrivate().privateGetSenderForTags();
653
+ // eslint-disable-next-line camelcase
654
+ async aztec_prv_getSenderForTags(): Promise<ACVMField[]> {
655
+ const sender = await this.handlerAsPrivate().getSenderForTags();
612
656
  // Return [1, address] for Some(address), [0, 0] for None
613
657
  return sender ? [toACVMField(1n), toACVMField(sender)] : [toACVMField(0n), toACVMField(0n)];
614
658
  }
615
659
 
616
- async privateSetSenderForTags([senderForTags]: ACVMField[]): Promise<ACVMField[]> {
617
- await this.handlerAsPrivate().privateSetSenderForTags(AztecAddress.fromField(Fr.fromString(senderForTags)));
660
+ // eslint-disable-next-line camelcase
661
+ async aztec_prv_setSenderForTags([senderForTags]: ACVMField[]): Promise<ACVMField[]> {
662
+ await this.handlerAsPrivate().setSenderForTags(AztecAddress.fromField(Fr.fromString(senderForTags)));
618
663
  return [];
619
664
  }
620
665
  }
@@ -76,7 +76,7 @@ export async function executePrivateFunction(
76
76
 
77
77
  const contractClassLogs = privateExecutionOracle.getContractClassLogs();
78
78
 
79
- const rawReturnValues = await privateExecutionOracle.privateLoadFromExecutionCache(publicInputs.returnsHash);
79
+ const rawReturnValues = await privateExecutionOracle.loadFromExecutionCache(publicInputs.returnsHash);
80
80
 
81
81
  const newNotes = privateExecutionOracle.getNewNotes();
82
82
  const noteHashNullifierCounterMap = privateExecutionOracle.getNoteHashNullifierCounterMap();