@aztec/pxe 0.0.1-commit.3469e52 → 0.0.1-commit.3895657bc

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