@aztec/pxe 0.0.1-commit.7d4e6cd → 0.0.1-commit.7ffbba4

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 (274) 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/bin/check_oracle_version.js +1 -1
  5. package/dest/block_synchronizer/block_synchronizer.d.ts +11 -5
  6. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  7. package/dest/block_synchronizer/block_synchronizer.js +72 -21
  8. package/dest/config/index.d.ts +4 -2
  9. package/dest/config/index.d.ts.map +1 -1
  10. package/dest/config/index.js +18 -1
  11. package/dest/config/package_info.js +1 -1
  12. package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
  13. package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
  14. package/dest/contract_function_simulator/benchmarked_node.js +77 -0
  15. package/dest/contract_function_simulator/contract_function_simulator.d.ts +57 -35
  16. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/contract_function_simulator.js +201 -87
  18. package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
  19. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/execution_note_cache.js +45 -28
  21. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +5 -5
  22. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/execution_tagging_index_cache.js +3 -3
  24. package/dest/contract_function_simulator/index.d.ts +2 -2
  25. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  26. package/dest/contract_function_simulator/index.js +1 -1
  27. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +3 -4
  28. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  29. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +6 -5
  30. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +1 -1
  31. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  32. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -3
  33. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +3 -5
  34. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  35. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +4 -6
  36. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
  37. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  38. package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
  39. package/dest/contract_function_simulator/oracle/interfaces.d.ts +54 -47
  40. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  41. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
  42. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  43. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
  44. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  45. package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
  46. package/dest/contract_function_simulator/oracle/oracle.d.ts +43 -42
  47. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  48. package/dest/contract_function_simulator/oracle/oracle.js +175 -114
  49. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -26
  50. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  51. package/dest/contract_function_simulator/oracle/private_execution.js +1 -36
  52. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +61 -66
  53. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  54. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +113 -75
  55. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +90 -55
  56. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  57. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +156 -136
  58. package/dest/contract_logging.d.ts +22 -0
  59. package/dest/contract_logging.d.ts.map +1 -0
  60. package/dest/contract_logging.js +23 -0
  61. package/dest/contract_sync/contract_sync_service.d.ts +43 -0
  62. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  63. package/dest/contract_sync/contract_sync_service.js +97 -0
  64. package/dest/contract_sync/helpers.d.ts +29 -0
  65. package/dest/contract_sync/helpers.d.ts.map +1 -0
  66. package/dest/contract_sync/helpers.js +55 -0
  67. package/dest/debug/pxe_debug_utils.d.ts +24 -10
  68. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  69. package/dest/debug/pxe_debug_utils.js +28 -17
  70. package/dest/entrypoints/client/bundle/index.d.ts +4 -1
  71. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  72. package/dest/entrypoints/client/bundle/index.js +3 -0
  73. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  74. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  75. package/dest/entrypoints/client/bundle/utils.js +21 -7
  76. package/dest/entrypoints/client/lazy/index.d.ts +4 -1
  77. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  78. package/dest/entrypoints/client/lazy/index.js +3 -0
  79. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  80. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  81. package/dest/entrypoints/client/lazy/utils.js +22 -8
  82. package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
  83. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  84. package/dest/entrypoints/server/index.d.ts +5 -1
  85. package/dest/entrypoints/server/index.d.ts.map +1 -1
  86. package/dest/entrypoints/server/index.js +4 -0
  87. package/dest/entrypoints/server/utils.d.ts +1 -1
  88. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  89. package/dest/entrypoints/server/utils.js +28 -9
  90. package/dest/events/event_service.d.ts +6 -6
  91. package/dest/events/event_service.d.ts.map +1 -1
  92. package/dest/events/event_service.js +19 -22
  93. package/dest/events/private_event_filter_validator.d.ts +5 -5
  94. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  95. package/dest/events/private_event_filter_validator.js +5 -6
  96. package/dest/job_coordinator/job_coordinator.d.ts +3 -2
  97. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -1
  98. package/dest/job_coordinator/job_coordinator.js +3 -2
  99. package/dest/logs/log_service.d.ts +8 -5
  100. package/dest/logs/log_service.d.ts.map +1 -1
  101. package/dest/logs/log_service.js +31 -33
  102. package/dest/notes/note_service.d.ts +10 -9
  103. package/dest/notes/note_service.d.ts.map +1 -1
  104. package/dest/notes/note_service.js +34 -38
  105. package/dest/notes_filter.d.ts +25 -0
  106. package/dest/notes_filter.d.ts.map +1 -0
  107. package/dest/notes_filter.js +4 -0
  108. package/dest/oracle_version.d.ts +3 -3
  109. package/dest/oracle_version.d.ts.map +1 -1
  110. package/dest/oracle_version.js +5 -4
  111. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  112. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  113. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  114. package/dest/private_kernel/hints/index.d.ts +3 -3
  115. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  116. package/dest/private_kernel/hints/index.js +2 -2
  117. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +29 -0
  118. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  119. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +140 -73
  120. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  121. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  122. package/dest/private_kernel/hints/test_utils.js +203 -0
  123. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  124. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  125. package/dest/private_kernel/private_kernel_execution_prover.js +22 -14
  126. package/dest/private_kernel/private_kernel_oracle.d.ts +23 -24
  127. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  128. package/dest/private_kernel/private_kernel_oracle.js +94 -2
  129. package/dest/pxe.d.ts +77 -59
  130. package/dest/pxe.d.ts.map +1 -1
  131. package/dest/pxe.js +132 -136
  132. package/dest/storage/address_store/address_store.d.ts +1 -1
  133. package/dest/storage/address_store/address_store.d.ts.map +1 -1
  134. package/dest/storage/address_store/address_store.js +12 -11
  135. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
  136. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
  137. package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
  138. package/dest/storage/capsule_store/capsule_store.d.ts +24 -9
  139. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
  140. package/dest/storage/capsule_store/capsule_store.js +130 -23
  141. package/dest/storage/contract_store/contract_store.d.ts +42 -16
  142. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  143. package/dest/storage/contract_store/contract_store.js +157 -84
  144. package/dest/storage/metadata.d.ts +1 -1
  145. package/dest/storage/metadata.js +1 -1
  146. package/dest/storage/note_store/note_store.d.ts +50 -51
  147. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  148. package/dest/storage/note_store/note_store.js +284 -263
  149. package/dest/storage/note_store/stored_note.d.ts +16 -0
  150. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  151. package/dest/storage/note_store/stored_note.js +43 -0
  152. package/dest/storage/private_event_store/private_event_store.d.ts +43 -8
  153. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  154. package/dest/storage/private_event_store/private_event_store.js +226 -111
  155. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  156. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  157. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  158. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +16 -9
  159. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  160. package/dest/storage/tagging_store/recipient_tagging_store.js +88 -19
  161. package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
  162. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
  163. package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
  164. package/dest/storage/tagging_store/sender_tagging_store.d.ts +20 -10
  165. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  166. package/dest/storage/tagging_store/sender_tagging_store.js +253 -101
  167. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  168. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  169. package/dest/tagging/get_all_logs_by_tags.js +60 -0
  170. package/dest/tagging/index.d.ts +3 -2
  171. package/dest/tagging/index.d.ts.map +1 -1
  172. package/dest/tagging/index.js +2 -1
  173. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +5 -5
  174. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  175. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +11 -11
  176. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  177. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +7 -7
  178. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  179. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +16 -12
  180. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +5 -8
  181. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  182. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +8 -11
  183. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +1 -1
  184. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  185. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +5 -8
  186. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +7 -7
  187. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  188. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +23 -19
  189. package/package.json +27 -18
  190. package/src/access_scopes.ts +9 -0
  191. package/src/bin/check_oracle_version.ts +1 -0
  192. package/src/block_synchronizer/block_synchronizer.ts +91 -33
  193. package/src/config/index.ts +15 -1
  194. package/src/config/package_info.ts +1 -1
  195. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  196. package/src/contract_function_simulator/contract_function_simulator.ts +352 -151
  197. package/src/contract_function_simulator/execution_note_cache.ts +44 -25
  198. package/src/contract_function_simulator/execution_tagging_index_cache.ts +5 -5
  199. package/src/contract_function_simulator/index.ts +1 -1
  200. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +9 -6
  201. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -4
  202. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +4 -7
  203. package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
  204. package/src/contract_function_simulator/oracle/interfaces.ts +63 -59
  205. package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
  206. package/src/contract_function_simulator/oracle/oracle.ts +195 -163
  207. package/src/contract_function_simulator/oracle/private_execution.ts +2 -68
  208. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +154 -169
  209. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +229 -153
  210. package/src/contract_logging.ts +39 -0
  211. package/src/contract_sync/contract_sync_service.ts +152 -0
  212. package/src/contract_sync/helpers.ts +98 -0
  213. package/src/debug/pxe_debug_utils.ts +63 -18
  214. package/src/entrypoints/client/bundle/index.ts +3 -0
  215. package/src/entrypoints/client/bundle/utils.ts +16 -15
  216. package/src/entrypoints/client/lazy/index.ts +3 -0
  217. package/src/entrypoints/client/lazy/utils.ts +17 -15
  218. package/src/entrypoints/pxe_creation_options.ts +2 -1
  219. package/src/entrypoints/server/index.ts +4 -0
  220. package/src/entrypoints/server/utils.ts +22 -26
  221. package/src/events/event_service.ts +17 -25
  222. package/src/events/private_event_filter_validator.ts +3 -5
  223. package/src/job_coordinator/job_coordinator.ts +4 -3
  224. package/src/logs/log_service.ts +51 -40
  225. package/src/notes/note_service.ts +41 -45
  226. package/src/notes_filter.ts +26 -0
  227. package/src/oracle_version.ts +5 -4
  228. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  229. package/src/private_kernel/hints/index.ts +2 -2
  230. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +195 -136
  231. package/src/private_kernel/hints/test_utils.ts +325 -0
  232. package/src/private_kernel/private_kernel_execution_prover.ts +26 -16
  233. package/src/private_kernel/private_kernel_oracle.ts +116 -37
  234. package/src/pxe.ts +243 -213
  235. package/src/storage/address_store/address_store.ts +15 -15
  236. package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
  237. package/src/storage/capsule_store/capsule_store.ts +159 -23
  238. package/src/storage/contract_store/contract_store.ts +186 -96
  239. package/src/storage/metadata.ts +1 -1
  240. package/src/storage/note_store/note_store.ts +326 -320
  241. package/src/storage/note_store/stored_note.ts +48 -0
  242. package/src/storage/private_event_store/private_event_store.ts +292 -124
  243. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  244. package/src/storage/tagging_store/recipient_tagging_store.ts +111 -21
  245. package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
  246. package/src/storage/tagging_store/sender_tagging_store.ts +296 -111
  247. package/src/tagging/get_all_logs_by_tags.ts +92 -0
  248. package/src/tagging/index.ts +2 -1
  249. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +22 -14
  250. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  251. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +17 -16
  252. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +12 -14
  253. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +5 -17
  254. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +26 -23
  255. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  256. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  257. package/dest/contract_function_simulator/proxied_node.js +0 -27
  258. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  259. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  260. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  261. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
  262. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
  263. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  264. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -85
  265. package/dest/public_storage/public_storage_service.d.ts +0 -24
  266. package/dest/public_storage/public_storage_service.d.ts.map +0 -1
  267. package/dest/public_storage/public_storage_service.js +0 -26
  268. package/dest/tree_membership/tree_membership_service.d.ts +0 -52
  269. package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
  270. package/dest/tree_membership/tree_membership_service.js +0 -84
  271. package/src/contract_function_simulator/proxied_node.ts +0 -33
  272. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -127
  273. package/src/public_storage/public_storage_service.ts +0 -33
  274. package/src/tree_membership/tree_membership_service.ts +0 -112
@@ -12,11 +12,11 @@ import {
12
12
  } from '@aztec/simulator/client';
13
13
  import { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
14
14
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
15
+ import { BlockHash } from '@aztec/stdlib/block';
15
16
  import { ContractClassLog, ContractClassLogFields } from '@aztec/stdlib/logs';
16
- import { MerkleTreeId } from '@aztec/stdlib/trees';
17
17
 
18
18
  import type { IMiscOracle, IPrivateExecutionOracle, IUtilityExecutionOracle } from './interfaces.js';
19
- import { packAsRetrievedNote } from './note_packing_utils.js';
19
+ import { packAsHintedNote } from './note_packing_utils.js';
20
20
 
21
21
  export class UnavailableOracleError extends Error {
22
22
  constructor(oracleName: string) {
@@ -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,109 +142,130 @@ export class Oracle {
137
142
  ].map(toACVMField);
138
143
  }
139
144
 
140
- async utilityGetMembershipWitness(
141
- [blockNumber]: ACVMField[],
142
- [treeId]: ACVMField[],
143
- [leafValue]: ACVMField[],
145
+ // eslint-disable-next-line camelcase
146
+ async aztec_utl_getNoteHashMembershipWitness(
147
+ [anchorBlockHash]: ACVMField[],
148
+ [noteHash]: ACVMField[],
144
149
  ): Promise<(ACVMField | ACVMField[])[]> {
145
- const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
146
- const parsedTreeId = Fr.fromString(treeId).toNumber();
147
- const parsedLeafValue = Fr.fromString(leafValue);
150
+ const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
151
+ const parsedNoteHash = Fr.fromString(noteHash);
148
152
 
149
- const witness = await this.handlerAsUtility().utilityGetMembershipWitness(
150
- BlockNumber(parsedBlockNumber),
151
- parsedTreeId,
152
- parsedLeafValue,
153
- );
153
+ const witness = await this.handlerAsUtility().getNoteHashMembershipWitness(parsedAnchorBlockHash, parsedNoteHash);
154
154
  if (!witness) {
155
155
  throw new Error(
156
- `Leaf ${leafValue} not found in the tree ${MerkleTreeId[parsedTreeId]} at block ${parsedBlockNumber}.`,
156
+ `Note hash ${noteHash} not found in the note hash tree at anchor block hash ${parsedAnchorBlockHash.toString()}.`,
157
157
  );
158
158
  }
159
- return [toACVMField(witness[0]), witness.slice(1).map(toACVMField)];
159
+ return witness.toNoirRepresentation();
160
160
  }
161
161
 
162
- async utilityGetNullifierMembershipWitness(
163
- [blockNumber]: ACVMField[],
162
+ // eslint-disable-next-line camelcase
163
+ async aztec_utl_getBlockHashMembershipWitness(
164
+ [anchorBlockHash]: ACVMField[],
165
+ [blockHash]: ACVMField[],
166
+ ): Promise<(ACVMField | ACVMField[])[]> {
167
+ const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
168
+ const parsedBlockHash = BlockHash.fromString(blockHash);
169
+
170
+ const witness = await this.handlerAsUtility().getBlockHashMembershipWitness(parsedAnchorBlockHash, parsedBlockHash);
171
+ if (!witness) {
172
+ throw new Error(
173
+ `Block hash ${parsedBlockHash.toString()} not found in the archive tree at anchor block ${parsedAnchorBlockHash.toString()}.`,
174
+ );
175
+ }
176
+ return witness.toNoirRepresentation();
177
+ }
178
+
179
+ // eslint-disable-next-line camelcase
180
+ async aztec_utl_getNullifierMembershipWitness(
181
+ [blockHash]: ACVMField[],
164
182
  [nullifier]: ACVMField[], // nullifier, we try to find the witness for (to prove inclusion)
165
183
  ): Promise<(ACVMField | ACVMField[])[]> {
166
- const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
184
+ const parsedBlockHash = BlockHash.fromString(blockHash);
167
185
  const parsedNullifier = Fr.fromString(nullifier);
168
186
 
169
- const witness = await this.handlerAsUtility().utilityGetNullifierMembershipWitness(
170
- BlockNumber(parsedBlockNumber),
171
- parsedNullifier,
172
- );
187
+ const witness = await this.handlerAsUtility().getNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
173
188
  if (!witness) {
174
- throw new Error(`Nullifier witness not found for nullifier ${parsedNullifier} at block ${parsedBlockNumber}.`);
189
+ throw new Error(
190
+ `Nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
191
+ );
175
192
  }
176
193
  return witness.toNoirRepresentation();
177
194
  }
178
195
 
179
- async utilityGetLowNullifierMembershipWitness(
180
- [blockNumber]: ACVMField[],
196
+ // eslint-disable-next-line camelcase
197
+ async aztec_utl_getLowNullifierMembershipWitness(
198
+ [blockHash]: ACVMField[],
181
199
  [nullifier]: ACVMField[], // nullifier, we try to find the low nullifier witness for (to prove non-inclusion)
182
200
  ): Promise<(ACVMField | ACVMField[])[]> {
183
- const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
201
+ const parsedBlockHash = BlockHash.fromString(blockHash);
184
202
  const parsedNullifier = Fr.fromString(nullifier);
185
203
 
186
- const witness = await this.handlerAsUtility().utilityGetLowNullifierMembershipWitness(
187
- BlockNumber(parsedBlockNumber),
188
- parsedNullifier,
189
- );
204
+ const witness = await this.handlerAsUtility().getLowNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
190
205
  if (!witness) {
191
206
  throw new Error(
192
- `Low nullifier witness not found for nullifier ${parsedNullifier} at block ${parsedBlockNumber}.`,
207
+ `Low nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
193
208
  );
194
209
  }
195
210
  return witness.toNoirRepresentation();
196
211
  }
197
212
 
198
- async utilityGetPublicDataWitness(
199
- [blockNumber]: ACVMField[],
213
+ // eslint-disable-next-line camelcase
214
+ async aztec_utl_getPublicDataWitness(
215
+ [blockHash]: ACVMField[],
200
216
  [leafSlot]: ACVMField[],
201
217
  ): Promise<(ACVMField | ACVMField[])[]> {
202
- const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
218
+ const parsedBlockHash = BlockHash.fromString(blockHash);
203
219
  const parsedLeafSlot = Fr.fromString(leafSlot);
204
220
 
205
- const witness = await this.handlerAsUtility().utilityGetPublicDataWitness(
206
- BlockNumber(parsedBlockNumber),
207
- parsedLeafSlot,
208
- );
221
+ const witness = await this.handlerAsUtility().getPublicDataWitness(parsedBlockHash, parsedLeafSlot);
209
222
  if (!witness) {
210
- throw new Error(`Public data witness not found for slot ${parsedLeafSlot} at block ${parsedBlockNumber}.`);
223
+ throw new Error(
224
+ `Public data witness not found for slot ${parsedLeafSlot} at block hash ${parsedBlockHash.toString()}.`,
225
+ );
211
226
  }
212
227
  return witness.toNoirRepresentation();
213
228
  }
214
229
 
215
- async utilityGetBlockHeader([blockNumber]: ACVMField[]): Promise<ACVMField[]> {
230
+ // eslint-disable-next-line camelcase
231
+ async aztec_utl_getBlockHeader([blockNumber]: ACVMField[]): Promise<ACVMField[]> {
216
232
  const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
217
233
 
218
- const header = await this.handlerAsUtility().utilityGetBlockHeader(BlockNumber(parsedBlockNumber));
234
+ const header = await this.handlerAsUtility().getBlockHeader(BlockNumber(parsedBlockNumber));
219
235
  if (!header) {
220
236
  throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
221
237
  }
222
238
  return header.toFields().map(toACVMField);
223
239
  }
224
240
 
225
- async utilityGetAuthWitness([messageHash]: ACVMField[]): Promise<ACVMField[][]> {
241
+ // eslint-disable-next-line camelcase
242
+ async aztec_utl_getAuthWitness([messageHash]: ACVMField[]): Promise<ACVMField[][]> {
226
243
  const messageHashField = Fr.fromString(messageHash);
227
- const witness = await this.handlerAsUtility().utilityGetAuthWitness(messageHashField);
244
+ const witness = await this.handlerAsUtility().getAuthWitness(messageHashField);
228
245
  if (!witness) {
229
246
  throw new Error(`Unknown auth witness for message hash ${messageHashField}`);
230
247
  }
231
248
  return [witness.map(toACVMField)];
232
249
  }
233
250
 
234
- async utilityGetPublicKeysAndPartialAddress([address]: ACVMField[]): Promise<ACVMField[][]> {
251
+ // eslint-disable-next-line camelcase
252
+ async aztec_utl_tryGetPublicKeysAndPartialAddress([address]: ACVMField[]): Promise<(ACVMField | ACVMField[])[]> {
235
253
  const parsedAddress = AztecAddress.fromField(Fr.fromString(address));
236
- const { publicKeys, partialAddress } =
237
- await this.handlerAsUtility().utilityGetPublicKeysAndPartialAddress(parsedAddress);
254
+ const result = await this.handlerAsUtility().tryGetPublicKeysAndPartialAddress(parsedAddress);
238
255
 
239
- 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
+ }
240
265
  }
241
266
 
242
- async utilityGetNotes(
267
+ // eslint-disable-next-line camelcase
268
+ async aztec_utl_getNotes(
243
269
  [ownerSome]: ACVMField[],
244
270
  [ownerValue]: ACVMField[],
245
271
  [storageSlot]: ACVMField[],
@@ -257,11 +283,11 @@ export class Oracle {
257
283
  [offset]: ACVMField[],
258
284
  [status]: ACVMField[],
259
285
  [maxNotes]: ACVMField[],
260
- [packedRetrievedNoteLength]: ACVMField[],
286
+ [packedHintedNoteLength]: ACVMField[],
261
287
  ): Promise<(ACVMField | ACVMField[])[]> {
262
288
  // Parse Option<AztecAddress>: ownerSome is 0 for None, 1 for Some
263
289
  const owner = Fr.fromString(ownerSome).toNumber() === 1 ? AztecAddress.fromString(ownerValue) : undefined;
264
- const noteDatas = await this.handlerAsUtility().utilityGetNotes(
290
+ const noteDatas = await this.handlerAsUtility().getNotes(
265
291
  owner,
266
292
  Fr.fromString(storageSlot),
267
293
  +numSelects,
@@ -279,28 +305,29 @@ export class Oracle {
279
305
  +status,
280
306
  );
281
307
 
282
- const returnDataAsArrayOfPackedRetrievedNotes = noteDatas.map(noteData =>
283
- packAsRetrievedNote({
308
+ const returnDataAsArrayOfPackedHintedNotes = noteDatas.map(noteData =>
309
+ packAsHintedNote({
284
310
  contractAddress: noteData.contractAddress,
285
311
  owner: noteData.owner,
286
312
  randomness: noteData.randomness,
287
313
  storageSlot: noteData.storageSlot,
288
314
  noteNonce: noteData.noteNonce,
289
- index: noteData.index,
315
+ isPending: noteData.isPending,
290
316
  note: noteData.note,
291
317
  }),
292
318
  );
293
319
 
294
320
  // Now we convert each sub-array to an array of ACVMField
295
- const returnDataAsArrayOfACVMFieldArrays = returnDataAsArrayOfPackedRetrievedNotes.map(subArray =>
321
+ const returnDataAsArrayOfACVMFieldArrays = returnDataAsArrayOfPackedHintedNotes.map(subArray =>
296
322
  subArray.map(toACVMField),
297
323
  );
298
324
 
299
325
  // At last we convert the array of arrays to a bounded vec of arrays
300
- return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedRetrievedNoteLength);
326
+ return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedHintedNoteLength);
301
327
  }
302
328
 
303
- privateNotifyCreatedNote(
329
+ // eslint-disable-next-line camelcase
330
+ aztec_prv_notifyCreatedNote(
304
331
  [owner]: ACVMField[],
305
332
  [storageSlot]: ACVMField[],
306
333
  [randomness]: ACVMField[],
@@ -309,7 +336,7 @@ export class Oracle {
309
336
  [noteHash]: ACVMField[],
310
337
  [counter]: ACVMField[],
311
338
  ): Promise<ACVMField[]> {
312
- this.handlerAsPrivate().privateNotifyCreatedNote(
339
+ this.handlerAsPrivate().notifyCreatedNote(
313
340
  AztecAddress.fromString(owner),
314
341
  Fr.fromString(storageSlot),
315
342
  Fr.fromString(randomness),
@@ -321,35 +348,47 @@ export class Oracle {
321
348
  return Promise.resolve([]);
322
349
  }
323
350
 
324
- async privateNotifyNullifiedNote(
351
+ // eslint-disable-next-line camelcase
352
+ async aztec_prv_notifyNullifiedNote(
325
353
  [innerNullifier]: ACVMField[],
326
354
  [noteHash]: ACVMField[],
327
355
  [counter]: ACVMField[],
328
356
  ): Promise<ACVMField[]> {
329
- await this.handlerAsPrivate().privateNotifyNullifiedNote(
330
- Fr.fromString(innerNullifier),
331
- Fr.fromString(noteHash),
332
- +counter,
333
- );
357
+ await this.handlerAsPrivate().notifyNullifiedNote(Fr.fromString(innerNullifier), Fr.fromString(noteHash), +counter);
334
358
  return [];
335
359
  }
336
360
 
337
- async privateNotifyCreatedNullifier([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
338
- 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));
339
364
  return [];
340
365
  }
341
366
 
342
- async utilityCheckNullifierExists([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
343
- const exists = await this.handlerAsUtility().utilityCheckNullifierExists(Fr.fromString(innerNullifier));
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(
373
+ Fr.fromString(innerNullifier),
374
+ AztecAddress.fromString(contractAddress),
375
+ );
376
+ return [toACVMField(isPending)];
377
+ }
378
+
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));
344
382
  return [toACVMField(exists)];
345
383
  }
346
384
 
347
- async utilityGetL1ToL2MembershipWitness(
385
+ // eslint-disable-next-line camelcase
386
+ async aztec_utl_getL1ToL2MembershipWitness(
348
387
  [contractAddress]: ACVMField[],
349
388
  [messageHash]: ACVMField[],
350
389
  [secret]: ACVMField[],
351
390
  ): Promise<(ACVMField | ACVMField[])[]> {
352
- const message = await this.handlerAsUtility().utilityGetL1ToL2MembershipWitness(
391
+ const message = await this.handlerAsUtility().getL1ToL2MembershipWitness(
353
392
  AztecAddress.fromString(contractAddress),
354
393
  Fr.fromString(messageHash),
355
394
  Fr.fromString(secret),
@@ -357,22 +396,24 @@ export class Oracle {
357
396
  return message.toNoirRepresentation();
358
397
  }
359
398
 
360
- async utilityStorageRead(
399
+ // eslint-disable-next-line camelcase
400
+ async aztec_utl_storageRead(
401
+ [blockHash]: ACVMField[],
361
402
  [contractAddress]: ACVMField[],
362
403
  [startStorageSlot]: ACVMField[],
363
- [blockNumber]: ACVMField[],
364
404
  [numberOfElements]: ACVMField[],
365
405
  ): Promise<ACVMField[][]> {
366
- const values = await this.handlerAsUtility().utilityStorageRead(
406
+ const values = await this.handlerAsUtility().storageRead(
407
+ BlockHash.fromString(blockHash),
367
408
  new AztecAddress(Fr.fromString(contractAddress)),
368
409
  Fr.fromString(startStorageSlot),
369
- BlockNumber(+blockNumber),
370
410
  +numberOfElements,
371
411
  );
372
412
  return [values.map(toACVMField)];
373
413
  }
374
414
 
375
- privateNotifyCreatedContractClassLog(
415
+ // eslint-disable-next-line camelcase
416
+ aztec_prv_notifyCreatedContractClassLog(
376
417
  [contractAddress]: ACVMField[],
377
418
  message: ACVMField[],
378
419
  [length]: ACVMField[],
@@ -381,11 +422,12 @@ export class Oracle {
381
422
  const logFields = new ContractClassLogFields(message.map(Fr.fromString));
382
423
  const log = new ContractClassLog(new AztecAddress(Fr.fromString(contractAddress)), logFields, +length);
383
424
 
384
- this.handlerAsPrivate().privateNotifyCreatedContractClassLog(log, +counter);
425
+ this.handlerAsPrivate().notifyCreatedContractClassLog(log, +counter);
385
426
  return Promise.resolve([]);
386
427
  }
387
428
 
388
- utilityDebugLog(
429
+ // eslint-disable-next-line camelcase
430
+ async aztec_utl_log(
389
431
  level: ACVMField[],
390
432
  message: ACVMField[],
391
433
  _ignoredFieldsSize: ACVMField[],
@@ -394,20 +436,21 @@ export class Oracle {
394
436
  const levelFr = Fr.fromString(level[0]);
395
437
  const messageStr = message.map(acvmField => String.fromCharCode(Fr.fromString(acvmField).toNumber())).join('');
396
438
  const fieldsFr = fields.map(Fr.fromString);
397
- this.handlerAsMisc().utilityDebugLog(levelFr.toNumber(), messageStr, fieldsFr);
398
- return Promise.resolve([]);
439
+ await this.handlerAsMisc().log(levelFr.toNumber(), messageStr, fieldsFr);
440
+ return [];
399
441
  }
400
442
 
401
443
  // This function's name is directly hardcoded in `circuit_recorder.ts`. Don't forget to update it there if you
402
444
  // change the name here.
403
- async privateCallPrivateFunction(
445
+ // eslint-disable-next-line camelcase
446
+ async aztec_prv_callPrivateFunction(
404
447
  [contractAddress]: ACVMField[],
405
448
  [functionSelector]: ACVMField[],
406
449
  [argsHash]: ACVMField[],
407
450
  [sideEffectCounter]: ACVMField[],
408
451
  [isStaticCall]: ACVMField[],
409
452
  ): Promise<ACVMField[][]> {
410
- const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().privateCallPrivateFunction(
453
+ const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().callPrivateFunction(
411
454
  AztecAddress.fromField(Fr.fromString(contractAddress)),
412
455
  FunctionSelector.fromField(Fr.fromString(functionSelector)),
413
456
  Fr.fromString(argsHash),
@@ -417,85 +460,65 @@ export class Oracle {
417
460
  return [[endSideEffectCounter, returnsHash].map(toACVMField)];
418
461
  }
419
462
 
420
- async privateNotifyEnqueuedPublicFunctionCall(
421
- [contractAddress]: ACVMField[],
422
- [calldataHash]: ACVMField[],
423
- [sideEffectCounter]: ACVMField[],
424
- [isStaticCall]: ACVMField[],
425
- ): Promise<ACVMField[]> {
426
- await this.handlerAsPrivate().privateNotifyEnqueuedPublicFunctionCall(
427
- AztecAddress.fromString(contractAddress),
428
- Fr.fromString(calldataHash),
429
- Fr.fromString(sideEffectCounter).toNumber(),
430
- Fr.fromString(isStaticCall).toBool(),
431
- );
432
- return [];
433
- }
434
-
435
- async privateNotifySetPublicTeardownFunctionCall(
436
- [contractAddress]: ACVMField[],
437
- [calldataHash]: ACVMField[],
438
- [sideEffectCounter]: ACVMField[],
439
- [isStaticCall]: ACVMField[],
440
- ): Promise<ACVMField[]> {
441
- await this.handlerAsPrivate().privateNotifySetPublicTeardownFunctionCall(
442
- AztecAddress.fromString(contractAddress),
443
- Fr.fromString(calldataHash),
444
- Fr.fromString(sideEffectCounter).toNumber(),
445
- Fr.fromString(isStaticCall).toBool(),
446
- );
463
+ // eslint-disable-next-line camelcase
464
+ async aztec_prv_validatePublicCalldata([calldataHash]: ACVMField[]): Promise<ACVMField[]> {
465
+ await this.handlerAsPrivate().validatePublicCalldata(Fr.fromString(calldataHash));
447
466
  return [];
448
467
  }
449
468
 
450
- async privateNotifySetMinRevertibleSideEffectCounter([minRevertibleSideEffectCounter]: ACVMField[]): Promise<
451
- ACVMField[]
452
- > {
453
- await this.handlerAsPrivate().privateNotifySetMinRevertibleSideEffectCounter(
454
- Fr.fromString(minRevertibleSideEffectCounter).toNumber(),
455
- );
469
+ // eslint-disable-next-line camelcase
470
+ async aztec_prv_notifyRevertiblePhaseStart([minRevertibleSideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
471
+ await this.handlerAsPrivate().notifyRevertiblePhaseStart(Fr.fromString(minRevertibleSideEffectCounter).toNumber());
456
472
  return Promise.resolve([]);
457
473
  }
458
474
 
459
- async privateIsSideEffectCounterRevertible([sideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
460
- const isRevertible = await this.handlerAsPrivate().privateIsSideEffectCounterRevertible(
461
- Fr.fromString(sideEffectCounter).toNumber(),
462
- );
475
+ // eslint-disable-next-line camelcase
476
+ async aztec_prv_inRevertiblePhase([sideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
477
+ const isRevertible = await this.handlerAsPrivate().inRevertiblePhase(Fr.fromString(sideEffectCounter).toNumber());
463
478
  return Promise.resolve([toACVMField(isRevertible)]);
464
479
  }
465
480
 
466
- async privateGetNextAppTagAsSender([sender]: ACVMField[], [recipient]: ACVMField[]): Promise<ACVMField[]> {
467
- const tag = await this.handlerAsPrivate().privateGetNextAppTagAsSender(
481
+ // eslint-disable-next-line camelcase
482
+ async aztec_prv_getNextAppTagAsSender([sender]: ACVMField[], [recipient]: ACVMField[]): Promise<ACVMField[]> {
483
+ const tag = await this.handlerAsPrivate().getNextAppTagAsSender(
468
484
  AztecAddress.fromString(sender),
469
485
  AztecAddress.fromString(recipient),
470
486
  );
471
487
  return [toACVMField(tag.value)];
472
488
  }
473
489
 
474
- async utilityFetchTaggedLogs([pendingTaggedLogArrayBaseSlot]: ACVMField[]): Promise<ACVMField[]> {
475
- await this.handlerAsUtility().utilityFetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
490
+ // eslint-disable-next-line camelcase
491
+ async aztec_utl_fetchTaggedLogs([pendingTaggedLogArrayBaseSlot]: ACVMField[]): Promise<ACVMField[]> {
492
+ await this.handlerAsUtility().fetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
476
493
  return [];
477
494
  }
478
495
 
479
- async utilityValidateEnqueuedNotesAndEvents(
496
+ // eslint-disable-next-line camelcase
497
+ async aztec_utl_validateAndStoreEnqueuedNotesAndEvents(
480
498
  [contractAddress]: ACVMField[],
481
499
  [noteValidationRequestsArrayBaseSlot]: ACVMField[],
482
500
  [eventValidationRequestsArrayBaseSlot]: ACVMField[],
501
+ [maxNotePackedLen]: ACVMField[],
502
+ [maxEventSerializedLen]: ACVMField[],
483
503
  ): Promise<ACVMField[]> {
484
- await this.handlerAsUtility().utilityValidateEnqueuedNotesAndEvents(
504
+ await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEvents(
485
505
  AztecAddress.fromString(contractAddress),
486
506
  Fr.fromString(noteValidationRequestsArrayBaseSlot),
487
507
  Fr.fromString(eventValidationRequestsArrayBaseSlot),
508
+ Fr.fromString(maxNotePackedLen).toNumber(),
509
+ Fr.fromString(maxEventSerializedLen).toNumber(),
488
510
  );
489
511
 
490
512
  return [];
491
513
  }
492
514
 
493
- async utilityBulkRetrieveLogs(
515
+ // eslint-disable-next-line camelcase
516
+ async aztec_utl_bulkRetrieveLogs(
494
517
  [contractAddress]: ACVMField[],
495
518
  [logRetrievalRequestsArrayBaseSlot]: ACVMField[],
496
519
  [logRetrievalResponsesArrayBaseSlot]: ACVMField[],
497
520
  ): Promise<ACVMField[]> {
498
- await this.handlerAsUtility().utilityBulkRetrieveLogs(
521
+ await this.handlerAsUtility().bulkRetrieveLogs(
499
522
  AztecAddress.fromString(contractAddress),
500
523
  Fr.fromString(logRetrievalRequestsArrayBaseSlot),
501
524
  Fr.fromString(logRetrievalResponsesArrayBaseSlot),
@@ -503,12 +526,13 @@ export class Oracle {
503
526
  return [];
504
527
  }
505
528
 
506
- async utilityStoreCapsule(
529
+ // eslint-disable-next-line camelcase
530
+ async aztec_utl_storeCapsule(
507
531
  [contractAddress]: ACVMField[],
508
532
  [slot]: ACVMField[],
509
533
  capsule: ACVMField[],
510
534
  ): Promise<ACVMField[]> {
511
- await this.handlerAsUtility().utilityStoreCapsule(
535
+ await this.handlerAsUtility().storeCapsule(
512
536
  AztecAddress.fromField(Fr.fromString(contractAddress)),
513
537
  Fr.fromString(slot),
514
538
  capsule.map(Fr.fromString),
@@ -516,12 +540,13 @@ export class Oracle {
516
540
  return [];
517
541
  }
518
542
 
519
- async utilityLoadCapsule(
543
+ // eslint-disable-next-line camelcase
544
+ async aztec_utl_loadCapsule(
520
545
  [contractAddress]: ACVMField[],
521
546
  [slot]: ACVMField[],
522
547
  [tSize]: ACVMField[],
523
548
  ): Promise<(ACVMField | ACVMField[])[]> {
524
- const values = await this.handlerAsUtility().utilityLoadCapsule(
549
+ const values = await this.handlerAsUtility().loadCapsule(
525
550
  AztecAddress.fromField(Fr.fromString(contractAddress)),
526
551
  Fr.fromString(slot),
527
552
  );
@@ -537,21 +562,23 @@ export class Oracle {
537
562
  }
538
563
  }
539
564
 
540
- async utilityDeleteCapsule([contractAddress]: ACVMField[], [slot]: ACVMField[]): Promise<ACVMField[]> {
541
- await this.handlerAsUtility().utilityDeleteCapsule(
565
+ // eslint-disable-next-line camelcase
566
+ async aztec_utl_deleteCapsule([contractAddress]: ACVMField[], [slot]: ACVMField[]): Promise<ACVMField[]> {
567
+ await this.handlerAsUtility().deleteCapsule(
542
568
  AztecAddress.fromField(Fr.fromString(contractAddress)),
543
569
  Fr.fromString(slot),
544
570
  );
545
571
  return [];
546
572
  }
547
573
 
548
- async utilityCopyCapsule(
574
+ // eslint-disable-next-line camelcase
575
+ async aztec_utl_copyCapsule(
549
576
  [contractAddress]: ACVMField[],
550
577
  [srcSlot]: ACVMField[],
551
578
  [dstSlot]: ACVMField[],
552
579
  [numEntries]: ACVMField[],
553
580
  ): Promise<ACVMField[]> {
554
- await this.handlerAsUtility().utilityCopyCapsule(
581
+ await this.handlerAsUtility().copyCapsule(
555
582
  AztecAddress.fromField(Fr.fromString(contractAddress)),
556
583
  Fr.fromString(srcSlot),
557
584
  Fr.fromString(dstSlot),
@@ -560,7 +587,8 @@ export class Oracle {
560
587
  return [];
561
588
  }
562
589
 
563
- async utilityAes128Decrypt(
590
+ // eslint-disable-next-line camelcase
591
+ async aztec_utl_aes128Decrypt(
564
592
  ciphertextBVecStorage: ACVMField[],
565
593
  [ciphertextLength]: ACVMField[],
566
594
  iv: ACVMField[],
@@ -570,36 +598,40 @@ export class Oracle {
570
598
  const ivBuffer = fromUintArray(iv, 8);
571
599
  const symKeyBuffer = fromUintArray(symKey, 8);
572
600
 
573
- const plaintext = await this.handlerAsUtility().utilityAes128Decrypt(ciphertext, ivBuffer, symKeyBuffer);
601
+ const plaintext = await this.handlerAsUtility().aes128Decrypt(ciphertext, ivBuffer, symKeyBuffer);
574
602
  return bufferToBoundedVec(plaintext, ciphertextBVecStorage.length);
575
603
  }
576
604
 
577
- async utilityGetSharedSecret(
605
+ // eslint-disable-next-line camelcase
606
+ async aztec_utl_getSharedSecret(
578
607
  [address]: ACVMField[],
579
608
  [ephPKField0]: ACVMField[],
580
609
  [ephPKField1]: ACVMField[],
581
610
  [ephPKField2]: ACVMField[],
582
611
  ): Promise<ACVMField[]> {
583
- const secret = await this.handlerAsUtility().utilityGetSharedSecret(
612
+ const secret = await this.handlerAsUtility().getSharedSecret(
584
613
  AztecAddress.fromField(Fr.fromString(address)),
585
614
  Point.fromFields([ephPKField0, ephPKField1, ephPKField2].map(Fr.fromString)),
586
615
  );
587
616
  return secret.toFields().map(toACVMField);
588
617
  }
589
618
 
590
- async utilityEmitOffchainEffect(data: ACVMField[]) {
591
- await this.handlerAsPrivate().utilityEmitOffchainEffect(data.map(Fr.fromString));
619
+ // eslint-disable-next-line camelcase
620
+ async aztec_utl_emitOffchainEffect(data: ACVMField[]) {
621
+ await this.handlerAsPrivate().emitOffchainEffect(data.map(Fr.fromString));
592
622
  return [];
593
623
  }
594
624
 
595
- async privateGetSenderForTags(): Promise<ACVMField[]> {
596
- const sender = await this.handlerAsPrivate().privateGetSenderForTags();
625
+ // eslint-disable-next-line camelcase
626
+ async aztec_prv_getSenderForTags(): Promise<ACVMField[]> {
627
+ const sender = await this.handlerAsPrivate().getSenderForTags();
597
628
  // Return [1, address] for Some(address), [0, 0] for None
598
629
  return sender ? [toACVMField(1n), toACVMField(sender)] : [toACVMField(0n), toACVMField(0n)];
599
630
  }
600
631
 
601
- async privateSetSenderForTags([senderForTags]: ACVMField[]): Promise<ACVMField[]> {
602
- await this.handlerAsPrivate().privateSetSenderForTags(AztecAddress.fromField(Fr.fromString(senderForTags)));
632
+ // eslint-disable-next-line camelcase
633
+ async aztec_prv_setSenderForTags([senderForTags]: ACVMField[]): Promise<ACVMField[]> {
634
+ await this.handlerAsPrivate().setSenderForTags(AztecAddress.fromField(Fr.fromString(senderForTags)));
603
635
  return [];
604
636
  }
605
637
  }