@aztec/simulator 0.74.0 → 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2

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 (304) hide show
  1. package/dest/acvm/acvm.js +18 -21
  2. package/dest/acvm/acvm_types.js +3 -2
  3. package/dest/acvm/deserialize.js +9 -13
  4. package/dest/acvm/index.js +0 -1
  5. package/dest/acvm/oracle/index.js +0 -1
  6. package/dest/acvm/oracle/oracle.js +42 -23
  7. package/dest/acvm/oracle/typed_oracle.js +36 -38
  8. package/dest/acvm/serialize.js +7 -14
  9. package/dest/avm/avm_context.js +24 -27
  10. package/dest/avm/avm_contract_call_result.js +12 -7
  11. package/dest/avm/avm_execution_environment.js +10 -7
  12. package/dest/avm/avm_gas.js +93 -56
  13. package/dest/avm/avm_machine_state.js +60 -61
  14. package/dest/avm/avm_memory_types.js +166 -255
  15. package/dest/avm/avm_simulator.js +68 -47
  16. package/dest/avm/avm_tree.js +282 -276
  17. package/dest/avm/bytecode_utils.js +8 -6
  18. package/dest/avm/errors.js +46 -63
  19. package/dest/avm/fixtures/avm_simulation_tester.js +18 -17
  20. package/dest/avm/fixtures/base_avm_simulation_tester.js +21 -16
  21. package/dest/avm/fixtures/index.js +27 -26
  22. package/dest/avm/fixtures/simple_contract_data_source.js +9 -13
  23. package/dest/avm/index.js +0 -1
  24. package/dest/avm/journal/index.js +0 -1
  25. package/dest/avm/journal/journal.js +147 -200
  26. package/dest/avm/journal/nullifiers.js +43 -46
  27. package/dest/avm/journal/public_storage.js +73 -87
  28. package/dest/avm/opcodes/accrued_substate.js +140 -110
  29. package/dest/avm/opcodes/addressing_mode.js +29 -31
  30. package/dest/avm/opcodes/arithmetic.js +17 -15
  31. package/dest/avm/opcodes/bitwise.js +40 -26
  32. package/dest/avm/opcodes/comparators.js +12 -10
  33. package/dest/avm/opcodes/contract.js +31 -29
  34. package/dest/avm/opcodes/control_flow.js +47 -43
  35. package/dest/avm/opcodes/conversion.js +30 -26
  36. package/dest/avm/opcodes/ec_add.js +35 -34
  37. package/dest/avm/opcodes/environment_getters.js +33 -33
  38. package/dest/avm/opcodes/external_calls.js +83 -74
  39. package/dest/avm/opcodes/hashing.js +69 -61
  40. package/dest/avm/opcodes/index.js +0 -1
  41. package/dest/avm/opcodes/instruction.js +31 -40
  42. package/dest/avm/opcodes/instruction_impl.js +12 -15
  43. package/dest/avm/opcodes/memory.js +177 -156
  44. package/dest/avm/opcodes/misc.js +27 -25
  45. package/dest/avm/opcodes/multi_scalar_mul.js +43 -41
  46. package/dest/avm/opcodes/storage.js +28 -25
  47. package/dest/avm/serialization/buffer_cursor.js +4 -4
  48. package/dest/avm/serialization/bytecode_serialization.js +292 -89
  49. package/dest/avm/serialization/instruction_serialization.js +67 -28
  50. package/dest/avm/test_utils.js +6 -9
  51. package/dest/client/client_execution_context.js +197 -219
  52. package/dest/client/db_oracle.js +4 -7
  53. package/dest/client/execution_note_cache.js +80 -81
  54. package/dest/client/index.js +0 -1
  55. package/dest/client/pick_notes.js +27 -30
  56. package/dest/client/private_execution.js +13 -14
  57. package/dest/client/simulator.js +44 -48
  58. package/dest/client/unconstrained_execution.js +8 -11
  59. package/dest/client/view_data_oracle.js +130 -139
  60. package/dest/common/debug_fn_name.js +1 -4
  61. package/dest/common/errors.js +30 -39
  62. package/dest/common/hashed_values_cache.js +16 -20
  63. package/dest/common/index.js +0 -1
  64. package/dest/common/message_load_oracle_inputs.js +7 -7
  65. package/dest/common/simulation_provider.js +3 -6
  66. package/dest/common.js +0 -1
  67. package/dest/providers/acvm_native.js +46 -32
  68. package/dest/providers/acvm_wasm.js +18 -10
  69. package/dest/providers/acvm_wasm_with_blobs.js +2 -5
  70. package/dest/providers/factory.js +5 -5
  71. package/dest/providers/index.js +0 -1
  72. package/dest/public/bytecode_errors.js +1 -2
  73. package/dest/public/db_interfaces.js +1 -2
  74. package/dest/public/execution.js +2 -4
  75. package/dest/public/executor_metrics.js +16 -12
  76. package/dest/public/fee_payment.js +2 -5
  77. package/dest/public/fixtures/index.js +0 -1
  78. package/dest/public/fixtures/public_tx_simulation_tester.js +13 -17
  79. package/dest/public/fixtures/utils.js +11 -14
  80. package/dest/public/index.js +0 -1
  81. package/dest/public/public_db_sources.js +79 -87
  82. package/dest/public/public_processor.js +310 -306
  83. package/dest/public/public_processor_metrics.js +46 -27
  84. package/dest/public/public_tx_context.js +97 -118
  85. package/dest/public/public_tx_simulator.js +299 -314
  86. package/dest/public/side_effect_errors.js +1 -2
  87. package/dest/public/side_effect_trace.js +44 -71
  88. package/dest/public/side_effect_trace_interface.js +1 -2
  89. package/dest/public/unique_class_ids.js +22 -27
  90. package/dest/public/utils.js +16 -11
  91. package/dest/server.js +0 -1
  92. package/dest/stats/index.js +0 -1
  93. package/dest/stats/stats.js +1 -2
  94. package/dest/test/utils.js +5 -4
  95. package/package.json +11 -11
  96. package/src/acvm/oracle/typed_oracle.ts +34 -34
  97. package/src/avm/avm_machine_state.ts +18 -14
  98. package/src/avm/avm_memory_types.ts +43 -183
  99. package/src/avm/avm_simulator.ts +37 -11
  100. package/src/avm/opcodes/accrued_substate.ts +7 -21
  101. package/src/avm/opcodes/addressing_mode.ts +9 -2
  102. package/src/avm/opcodes/arithmetic.ts +1 -3
  103. package/src/avm/opcodes/bitwise.ts +2 -6
  104. package/src/avm/opcodes/comparators.ts +1 -3
  105. package/src/avm/opcodes/contract.ts +1 -3
  106. package/src/avm/opcodes/control_flow.ts +1 -9
  107. package/src/avm/opcodes/conversion.ts +1 -3
  108. package/src/avm/opcodes/ec_add.ts +1 -3
  109. package/src/avm/opcodes/environment_getters.ts +1 -3
  110. package/src/avm/opcodes/external_calls.ts +3 -6
  111. package/src/avm/opcodes/hashing.ts +3 -9
  112. package/src/avm/opcodes/memory.ts +6 -20
  113. package/src/avm/opcodes/misc.ts +1 -3
  114. package/src/avm/opcodes/multi_scalar_mul.ts +1 -7
  115. package/src/avm/opcodes/storage.ts +2 -6
  116. package/src/client/index.ts +2 -2
  117. package/dest/acvm/acvm.d.ts +0 -35
  118. package/dest/acvm/acvm.d.ts.map +0 -1
  119. package/dest/acvm/acvm_types.d.ts +0 -10
  120. package/dest/acvm/acvm_types.d.ts.map +0 -1
  121. package/dest/acvm/deserialize.d.ts +0 -36
  122. package/dest/acvm/deserialize.d.ts.map +0 -1
  123. package/dest/acvm/index.d.ts +0 -6
  124. package/dest/acvm/index.d.ts.map +0 -1
  125. package/dest/acvm/oracle/index.d.ts +0 -14
  126. package/dest/acvm/oracle/index.d.ts.map +0 -1
  127. package/dest/acvm/oracle/oracle.d.ts +0 -49
  128. package/dest/acvm/oracle/oracle.d.ts.map +0 -1
  129. package/dest/acvm/oracle/typed_oracle.d.ts +0 -75
  130. package/dest/acvm/oracle/typed_oracle.d.ts.map +0 -1
  131. package/dest/acvm/serialize.d.ts +0 -20
  132. package/dest/acvm/serialize.d.ts.map +0 -1
  133. package/dest/avm/avm_context.d.ts +0 -39
  134. package/dest/avm/avm_context.d.ts.map +0 -1
  135. package/dest/avm/avm_contract_call_result.d.ts +0 -30
  136. package/dest/avm/avm_contract_call_result.d.ts.map +0 -1
  137. package/dest/avm/avm_execution_environment.d.ts +0 -21
  138. package/dest/avm/avm_execution_environment.d.ts.map +0 -1
  139. package/dest/avm/avm_gas.d.ts +0 -60
  140. package/dest/avm/avm_gas.d.ts.map +0 -1
  141. package/dest/avm/avm_machine_state.d.ts +0 -93
  142. package/dest/avm/avm_machine_state.d.ts.map +0 -1
  143. package/dest/avm/avm_memory_types.d.ts +0 -310
  144. package/dest/avm/avm_memory_types.d.ts.map +0 -1
  145. package/dest/avm/avm_simulator.d.ts +0 -37
  146. package/dest/avm/avm_simulator.d.ts.map +0 -1
  147. package/dest/avm/avm_tree.d.ts +0 -281
  148. package/dest/avm/avm_tree.d.ts.map +0 -1
  149. package/dest/avm/bytecode_utils.d.ts +0 -5
  150. package/dest/avm/bytecode_utils.d.ts.map +0 -1
  151. package/dest/avm/errors.d.ts +0 -121
  152. package/dest/avm/errors.d.ts.map +0 -1
  153. package/dest/avm/fixtures/avm_simulation_tester.d.ts +0 -21
  154. package/dest/avm/fixtures/avm_simulation_tester.d.ts.map +0 -1
  155. package/dest/avm/fixtures/base_avm_simulation_tester.d.ts +0 -35
  156. package/dest/avm/fixtures/base_avm_simulation_tester.d.ts.map +0 -1
  157. package/dest/avm/fixtures/index.d.ts +0 -67
  158. package/dest/avm/fixtures/index.d.ts.map +0 -1
  159. package/dest/avm/fixtures/simple_contract_data_source.d.ts +0 -31
  160. package/dest/avm/fixtures/simple_contract_data_source.d.ts.map +0 -1
  161. package/dest/avm/index.d.ts +0 -4
  162. package/dest/avm/index.d.ts.map +0 -1
  163. package/dest/avm/journal/index.d.ts +0 -2
  164. package/dest/avm/journal/index.d.ts.map +0 -1
  165. package/dest/avm/journal/journal.d.ts +0 -176
  166. package/dest/avm/journal/journal.d.ts.map +0 -1
  167. package/dest/avm/journal/nullifiers.d.ts +0 -62
  168. package/dest/avm/journal/nullifiers.d.ts.map +0 -1
  169. package/dest/avm/journal/public_storage.d.ts +0 -66
  170. package/dest/avm/journal/public_storage.d.ts.map +0 -1
  171. package/dest/avm/opcodes/accrued_substate.d.ts +0 -75
  172. package/dest/avm/opcodes/accrued_substate.d.ts.map +0 -1
  173. package/dest/avm/opcodes/addressing_mode.d.ts +0 -27
  174. package/dest/avm/opcodes/addressing_mode.d.ts.map +0 -1
  175. package/dest/avm/opcodes/arithmetic.d.ts +0 -37
  176. package/dest/avm/opcodes/arithmetic.d.ts.map +0 -1
  177. package/dest/avm/opcodes/bitwise.d.ts +0 -50
  178. package/dest/avm/opcodes/bitwise.d.ts.map +0 -1
  179. package/dest/avm/opcodes/comparators.d.ts +0 -25
  180. package/dest/avm/opcodes/comparators.d.ts.map +0 -1
  181. package/dest/avm/opcodes/contract.d.ts +0 -21
  182. package/dest/avm/opcodes/contract.d.ts.map +0 -1
  183. package/dest/avm/opcodes/control_flow.d.ts +0 -41
  184. package/dest/avm/opcodes/control_flow.d.ts.map +0 -1
  185. package/dest/avm/opcodes/conversion.d.ts +0 -17
  186. package/dest/avm/opcodes/conversion.d.ts.map +0 -1
  187. package/dest/avm/opcodes/ec_add.d.ts +0 -19
  188. package/dest/avm/opcodes/ec_add.d.ts.map +0 -1
  189. package/dest/avm/opcodes/environment_getters.d.ts +0 -28
  190. package/dest/avm/opcodes/environment_getters.d.ts.map +0 -1
  191. package/dest/avm/opcodes/external_calls.d.ts +0 -50
  192. package/dest/avm/opcodes/external_calls.d.ts.map +0 -1
  193. package/dest/avm/opcodes/hashing.d.ts +0 -36
  194. package/dest/avm/opcodes/hashing.d.ts.map +0 -1
  195. package/dest/avm/opcodes/index.d.ts +0 -16
  196. package/dest/avm/opcodes/index.d.ts.map +0 -1
  197. package/dest/avm/opcodes/instruction.d.ts +0 -70
  198. package/dest/avm/opcodes/instruction.d.ts.map +0 -1
  199. package/dest/avm/opcodes/instruction_impl.d.ts +0 -19
  200. package/dest/avm/opcodes/instruction_impl.d.ts.map +0 -1
  201. package/dest/avm/opcodes/memory.d.ts +0 -74
  202. package/dest/avm/opcodes/memory.d.ts.map +0 -1
  203. package/dest/avm/opcodes/misc.d.ts +0 -17
  204. package/dest/avm/opcodes/misc.d.ts.map +0 -1
  205. package/dest/avm/opcodes/multi_scalar_mul.d.ts +0 -16
  206. package/dest/avm/opcodes/multi_scalar_mul.d.ts.map +0 -1
  207. package/dest/avm/opcodes/storage.d.ts +0 -24
  208. package/dest/avm/opcodes/storage.d.ts.map +0 -1
  209. package/dest/avm/serialization/buffer_cursor.d.ts +0 -28
  210. package/dest/avm/serialization/buffer_cursor.d.ts.map +0 -1
  211. package/dest/avm/serialization/bytecode_serialization.d.ts +0 -21
  212. package/dest/avm/serialization/bytecode_serialization.d.ts.map +0 -1
  213. package/dest/avm/serialization/instruction_serialization.d.ts +0 -105
  214. package/dest/avm/serialization/instruction_serialization.d.ts.map +0 -1
  215. package/dest/avm/test_utils.d.ts +0 -16
  216. package/dest/avm/test_utils.d.ts.map +0 -1
  217. package/dest/client/client_execution_context.d.ts +0 -214
  218. package/dest/client/client_execution_context.d.ts.map +0 -1
  219. package/dest/client/db_oracle.d.ts +0 -229
  220. package/dest/client/db_oracle.d.ts.map +0 -1
  221. package/dest/client/execution_note_cache.d.ts +0 -93
  222. package/dest/client/execution_note_cache.d.ts.map +0 -1
  223. package/dest/client/index.d.ts +0 -15
  224. package/dest/client/index.d.ts.map +0 -1
  225. package/dest/client/pick_notes.d.ts +0 -85
  226. package/dest/client/pick_notes.d.ts.map +0 -1
  227. package/dest/client/private_execution.d.ts +0 -19
  228. package/dest/client/private_execution.d.ts.map +0 -1
  229. package/dest/client/simulator.d.ts +0 -60
  230. package/dest/client/simulator.d.ts.map +0 -1
  231. package/dest/client/unconstrained_execution.d.ts +0 -10
  232. package/dest/client/unconstrained_execution.d.ts.map +0 -1
  233. package/dest/client/view_data_oracle.d.ts +0 -159
  234. package/dest/client/view_data_oracle.d.ts.map +0 -1
  235. package/dest/common/debug_fn_name.d.ts +0 -4
  236. package/dest/common/debug_fn_name.d.ts.map +0 -1
  237. package/dest/common/errors.d.ts +0 -54
  238. package/dest/common/errors.d.ts.map +0 -1
  239. package/dest/common/hashed_values_cache.d.ts +0 -28
  240. package/dest/common/hashed_values_cache.d.ts.map +0 -1
  241. package/dest/common/index.d.ts +0 -3
  242. package/dest/common/index.d.ts.map +0 -1
  243. package/dest/common/message_load_oracle_inputs.d.ts +0 -15
  244. package/dest/common/message_load_oracle_inputs.d.ts.map +0 -1
  245. package/dest/common/simulation_provider.d.ts +0 -19
  246. package/dest/common/simulation_provider.d.ts.map +0 -1
  247. package/dest/common.d.ts +0 -2
  248. package/dest/common.d.ts.map +0 -1
  249. package/dest/providers/acvm_native.d.ts +0 -40
  250. package/dest/providers/acvm_native.d.ts.map +0 -1
  251. package/dest/providers/acvm_wasm.d.ts +0 -15
  252. package/dest/providers/acvm_wasm.d.ts.map +0 -1
  253. package/dest/providers/acvm_wasm_with_blobs.d.ts +0 -19
  254. package/dest/providers/acvm_wasm_with_blobs.d.ts.map +0 -1
  255. package/dest/providers/factory.d.ts +0 -12
  256. package/dest/providers/factory.d.ts.map +0 -1
  257. package/dest/providers/index.d.ts +0 -5
  258. package/dest/providers/index.d.ts.map +0 -1
  259. package/dest/public/bytecode_errors.d.ts +0 -4
  260. package/dest/public/bytecode_errors.d.ts.map +0 -1
  261. package/dest/public/db_interfaces.d.ts +0 -105
  262. package/dest/public/db_interfaces.d.ts.map +0 -1
  263. package/dest/public/execution.d.ts +0 -102
  264. package/dest/public/execution.d.ts.map +0 -1
  265. package/dest/public/executor_metrics.d.ts +0 -13
  266. package/dest/public/executor_metrics.d.ts.map +0 -1
  267. package/dest/public/fee_payment.d.ts +0 -11
  268. package/dest/public/fee_payment.d.ts.map +0 -1
  269. package/dest/public/fixtures/index.d.ts +0 -3
  270. package/dest/public/fixtures/index.d.ts.map +0 -1
  271. package/dest/public/fixtures/public_tx_simulation_tester.d.ts +0 -21
  272. package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +0 -1
  273. package/dest/public/fixtures/utils.d.ts +0 -17
  274. package/dest/public/fixtures/utils.d.ts.map +0 -1
  275. package/dest/public/index.d.ts +0 -9
  276. package/dest/public/index.d.ts.map +0 -1
  277. package/dest/public/public_db_sources.d.ts +0 -81
  278. package/dest/public/public_db_sources.d.ts.map +0 -1
  279. package/dest/public/public_processor.d.ts +0 -72
  280. package/dest/public/public_processor.d.ts.map +0 -1
  281. package/dest/public/public_processor_metrics.d.ts +0 -27
  282. package/dest/public/public_processor_metrics.d.ts.map +0 -1
  283. package/dest/public/public_tx_context.d.ts +0 -131
  284. package/dest/public/public_tx_context.d.ts.map +0 -1
  285. package/dest/public/public_tx_simulator.d.ts +0 -99
  286. package/dest/public/public_tx_simulator.d.ts.map +0 -1
  287. package/dest/public/side_effect_errors.d.ts +0 -4
  288. package/dest/public/side_effect_errors.d.ts.map +0 -1
  289. package/dest/public/side_effect_trace.d.ts +0 -126
  290. package/dest/public/side_effect_trace.d.ts.map +0 -1
  291. package/dest/public/side_effect_trace_interface.d.ts +0 -32
  292. package/dest/public/side_effect_trace_interface.d.ts.map +0 -1
  293. package/dest/public/unique_class_ids.d.ts +0 -37
  294. package/dest/public/unique_class_ids.d.ts.map +0 -1
  295. package/dest/public/utils.d.ts +0 -5
  296. package/dest/public/utils.d.ts.map +0 -1
  297. package/dest/server.d.ts +0 -6
  298. package/dest/server.d.ts.map +0 -1
  299. package/dest/stats/index.d.ts +0 -2
  300. package/dest/stats/index.d.ts.map +0 -1
  301. package/dest/stats/stats.d.ts +0 -4
  302. package/dest/stats/stats.d.ts.map +0 -1
  303. package/dest/test/utils.d.ts +0 -12
  304. package/dest/test/utils.d.ts.map +0 -1
@@ -1,7 +1,5 @@
1
- var _ClientExecutionContext_instances, _ClientExecutionContext_checkValidStaticCall;
2
- import { __classPrivateFieldGet } from "tslib";
3
- import { CountedContractClassLog, CountedPublicExecutionRequest, Note, NoteAndSlot, PublicExecutionRequest, } from '@aztec/circuit-types';
4
- import { CallContext, FunctionSelector, PRIVATE_CONTEXT_INPUTS_LENGTH, PUBLIC_DISPATCH_SELECTOR, PrivateContextInputs, } from '@aztec/circuits.js';
1
+ import { CountedContractClassLog, CountedPublicExecutionRequest, Note, NoteAndSlot, PublicExecutionRequest } from '@aztec/circuit-types';
2
+ import { CallContext, FunctionSelector, PRIVATE_CONTEXT_INPUTS_LENGTH, PUBLIC_DISPATCH_SELECTOR, PrivateContextInputs } from '@aztec/circuits.js';
5
3
  import { computeUniqueNoteHash, siloNoteHash } from '@aztec/circuits.js/hash';
6
4
  import { countArgumentsSize } from '@aztec/foundation/abi';
7
5
  import { AztecAddress } from '@aztec/foundation/aztec-address';
@@ -13,56 +11,47 @@ import { executePrivateFunction } from './private_execution.js';
13
11
  import { ViewDataOracle } from './view_data_oracle.js';
14
12
  /**
15
13
  * The execution context for a client tx simulation.
16
- */
17
- export class ClientExecutionContext extends ViewDataOracle {
18
- constructor(argsHash, txContext, callContext,
19
- /** Header of a block whose state is used during private execution (not the block the transaction is included in). */
20
- historicalHeader,
21
- /** List of transient auth witnesses to be used during this simulation */
22
- authWitnesses, executionCache, noteCache, db, node, provider, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes) {
23
- super(callContext.contractAddress, authWitnesses, db, node, log, scopes);
24
- _ClientExecutionContext_instances.add(this);
25
- this.argsHash = argsHash;
26
- this.txContext = txContext;
27
- this.callContext = callContext;
28
- this.historicalHeader = historicalHeader;
29
- this.executionCache = executionCache;
30
- this.noteCache = noteCache;
31
- this.node = node;
32
- this.provider = provider;
33
- this.sideEffectCounter = sideEffectCounter;
34
- /**
35
- * New notes created during this execution.
36
- * It's possible that a note in this list has been nullified (in the same or other executions) and doesn't exist in the ExecutionNoteCache and the final proof data.
37
- * But we still include those notes in the execution result because their commitments are still in the public inputs of this execution.
38
- * This information is only for references (currently used for tests), and is not used for any sort of constrains.
39
- * Users can also use this to get a clearer idea of what's happened during a simulation.
40
- */
41
- this.newNotes = [];
42
- /**
43
- * Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
44
- * The mapping maps from the unique siloed note hash to the index for notes created in private executions.
45
- * It maps from siloed note hash to the index for notes created by public functions.
46
- *
47
- * They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
48
- * because these notes are meant to be maintained on a per-call basis
49
- * They should act as references for the read requests output by an app circuit via public inputs.
50
- */
51
- this.noteHashLeafIndexMap = new Map();
52
- this.noteHashNullifierCounterMap = new Map();
53
- this.contractClassLogs = [];
54
- this.nestedExecutions = [];
55
- this.enqueuedPublicFunctionCalls = [];
56
- this.publicTeardownFunctionCall = PublicExecutionRequest.empty();
14
+ */ export class ClientExecutionContext extends ViewDataOracle {
15
+ argsHash;
16
+ txContext;
17
+ callContext;
18
+ historicalHeader;
19
+ executionCache;
20
+ noteCache;
21
+ node;
22
+ provider;
23
+ sideEffectCounter;
24
+ /**
25
+ * New notes created during this execution.
26
+ * It's possible that a note in this list has been nullified (in the same or other executions) and doesn't exist in the ExecutionNoteCache and the final proof data.
27
+ * But we still include those notes in the execution result because their commitments are still in the public inputs of this execution.
28
+ * This information is only for references (currently used for tests), and is not used for any sort of constrains.
29
+ * Users can also use this to get a clearer idea of what's happened during a simulation.
30
+ */ newNotes;
31
+ /**
32
+ * Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
33
+ * The mapping maps from the unique siloed note hash to the index for notes created in private executions.
34
+ * It maps from siloed note hash to the index for notes created by public functions.
35
+ *
36
+ * They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
37
+ * because these notes are meant to be maintained on a per-call basis
38
+ * They should act as references for the read requests output by an app circuit via public inputs.
39
+ */ noteHashLeafIndexMap;
40
+ noteHashNullifierCounterMap;
41
+ contractClassLogs;
42
+ nestedExecutions;
43
+ enqueuedPublicFunctionCalls;
44
+ publicTeardownFunctionCall;
45
+ constructor(argsHash, txContext, callContext, /** Header of a block whose state is used during private execution (not the block the transaction is included in). */ historicalHeader, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, executionCache, noteCache, db, node, provider, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes){
46
+ super(callContext.contractAddress, authWitnesses, db, node, log, scopes), this.argsHash = argsHash, this.txContext = txContext, this.callContext = callContext, this.historicalHeader = historicalHeader, this.executionCache = executionCache, this.noteCache = noteCache, this.node = node, this.provider = provider, this.sideEffectCounter = sideEffectCounter, this.newNotes = [], this.noteHashLeafIndexMap = new Map(), this.noteHashNullifierCounterMap = new Map(), this.contractClassLogs = [], this.nestedExecutions = [], this.enqueuedPublicFunctionCalls = [], this.publicTeardownFunctionCall = PublicExecutionRequest.empty();
57
47
  }
58
48
  // We still need this function until we can get user-defined ordering of structs for fn arguments
59
49
  // TODO When that is sorted out on noir side, we can use instead the utilities in serialize.ts
60
50
  /**
61
- * Writes the function inputs to the initial witness.
62
- * @param abi - The function ABI.
63
- * @returns The initial witness.
64
- */
65
- getInitialWitness(abi) {
51
+ * Writes the function inputs to the initial witness.
52
+ * @param abi - The function ABI.
53
+ * @returns The initial witness.
54
+ */ getInitialWitness(abi) {
66
55
  const argumentsSize = countArgumentsSize(abi);
67
56
  const args = this.executionCache.getPreimage(this.argsHash);
68
57
  if (args.length !== argumentsSize) {
@@ -73,188 +62,192 @@ export class ClientExecutionContext extends ViewDataOracle {
73
62
  if (privateContextInputsAsFields.length !== PRIVATE_CONTEXT_INPUTS_LENGTH) {
74
63
  throw new Error('Invalid private context inputs size');
75
64
  }
76
- const fields = [...privateContextInputsAsFields, ...args];
65
+ const fields = [
66
+ ...privateContextInputsAsFields,
67
+ ...args
68
+ ];
77
69
  return toACVMWitness(0, fields);
78
70
  }
79
71
  /**
80
- * The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
81
- * regarding which note hash each settled read request corresponds to.
82
- */
83
- getNoteHashLeafIndexMap() {
72
+ * The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
73
+ * regarding which note hash each settled read request corresponds to.
74
+ */ getNoteHashLeafIndexMap() {
84
75
  return this.noteHashLeafIndexMap;
85
76
  }
86
77
  /**
87
- * Get the data for the newly created notes.
88
- */
89
- getNewNotes() {
78
+ * Get the data for the newly created notes.
79
+ */ getNewNotes() {
90
80
  return this.newNotes;
91
81
  }
92
82
  getNoteHashNullifierCounterMap() {
93
83
  return this.noteHashNullifierCounterMap;
94
84
  }
95
85
  /**
96
- * Return the contract class logs emitted during this execution.
97
- */
98
- getContractClassLogs() {
86
+ * Return the contract class logs emitted during this execution.
87
+ */ getContractClassLogs() {
99
88
  return this.contractClassLogs;
100
89
  }
101
90
  /**
102
- * Return the nested execution results during this execution.
103
- */
104
- getNestedExecutions() {
91
+ * Return the nested execution results during this execution.
92
+ */ getNestedExecutions() {
105
93
  return this.nestedExecutions;
106
94
  }
107
95
  /**
108
- * Return the enqueued public function calls during this execution.
109
- */
110
- getEnqueuedPublicFunctionCalls() {
96
+ * Return the enqueued public function calls during this execution.
97
+ */ getEnqueuedPublicFunctionCalls() {
111
98
  return this.enqueuedPublicFunctionCalls;
112
99
  }
113
100
  /**
114
- * Return the public teardown function call set during this execution.
115
- */
116
- getPublicTeardownFunctionCall() {
101
+ * Return the public teardown function call set during this execution.
102
+ */ getPublicTeardownFunctionCall() {
117
103
  return this.publicTeardownFunctionCall;
118
104
  }
119
105
  /**
120
- * Store values in the execution cache.
121
- * @param values - Values to store.
122
- * @returns The hash of the values.
123
- */
124
- storeInExecutionCache(values) {
106
+ * Store values in the execution cache.
107
+ * @param values - Values to store.
108
+ * @returns The hash of the values.
109
+ */ storeInExecutionCache(values) {
125
110
  return this.executionCache.store(values);
126
111
  }
127
112
  /**
128
- * Gets values from the execution cache.
129
- * @param hash - Hash of the values.
130
- * @returns The values.
131
- */
132
- loadFromExecutionCache(hash) {
113
+ * Gets values from the execution cache.
114
+ * @param hash - Hash of the values.
115
+ * @returns The values.
116
+ */ loadFromExecutionCache(hash) {
133
117
  return Promise.resolve(this.executionCache.getPreimage(hash));
134
118
  }
135
119
  /**
136
- * Gets some notes for a storage slot.
137
- *
138
- * @remarks
139
- * Check for pending notes with matching slot.
140
- * Real notes coming from DB will have a leafIndex which
141
- * represents their index in the note hash tree.
142
- *
143
- * @param storageSlot - The storage slot.
144
- * @param numSelects - The number of valid selects in selectBy and selectValues.
145
- * @param selectBy - An array of indices of the fields to selects.
146
- * @param selectValues - The values to match.
147
- * @param selectComparators - The comparators to match by.
148
- * @param sortBy - An array of indices of the fields to sort.
149
- * @param sortOrder - The order of the corresponding index in sortBy. (1: DESC, 2: ASC, 0: Do nothing)
150
- * @param limit - The number of notes to retrieve per query.
151
- * @param offset - The starting index for pagination.
152
- * @param status - The status of notes to fetch.
153
- * @returns Array of note data.
154
- */
155
- async getNotes(storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status) {
120
+ * Gets some notes for a storage slot.
121
+ *
122
+ * @remarks
123
+ * Check for pending notes with matching slot.
124
+ * Real notes coming from DB will have a leafIndex which
125
+ * represents their index in the note hash tree.
126
+ *
127
+ * @param storageSlot - The storage slot.
128
+ * @param numSelects - The number of valid selects in selectBy and selectValues.
129
+ * @param selectBy - An array of indices of the fields to selects.
130
+ * @param selectValues - The values to match.
131
+ * @param selectComparators - The comparators to match by.
132
+ * @param sortBy - An array of indices of the fields to sort.
133
+ * @param sortOrder - The order of the corresponding index in sortBy. (1: DESC, 2: ASC, 0: Do nothing)
134
+ * @param limit - The number of notes to retrieve per query.
135
+ * @param offset - The starting index for pagination.
136
+ * @param status - The status of notes to fetch.
137
+ * @returns Array of note data.
138
+ */ async getNotes(storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status) {
156
139
  // Nullified pending notes are already removed from the list.
157
140
  const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, storageSlot);
158
141
  const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
159
142
  const dbNotes = await this.db.getNotes(this.callContext.contractAddress, storageSlot, status, this.scopes);
160
- const dbNotesFiltered = dbNotes.filter(n => !pendingNullifiers.has(n.siloedNullifier.value));
161
- const notes = pickNotes([...dbNotesFiltered, ...pendingNotes], {
162
- selects: selectByIndexes.slice(0, numSelects).map((index, i) => ({
163
- selector: { index, offset: selectByOffsets[i], length: selectByLengths[i] },
164
- value: selectValues[i],
165
- comparator: selectComparators[i],
166
- })),
167
- sorts: sortByIndexes.map((index, i) => ({
168
- selector: { index, offset: sortByOffsets[i], length: sortByLengths[i] },
169
- order: sortOrder[i],
170
- })),
143
+ const dbNotesFiltered = dbNotes.filter((n)=>!pendingNullifiers.has(n.siloedNullifier.value));
144
+ const notes = pickNotes([
145
+ ...dbNotesFiltered,
146
+ ...pendingNotes
147
+ ], {
148
+ selects: selectByIndexes.slice(0, numSelects).map((index, i)=>({
149
+ selector: {
150
+ index,
151
+ offset: selectByOffsets[i],
152
+ length: selectByLengths[i]
153
+ },
154
+ value: selectValues[i],
155
+ comparator: selectComparators[i]
156
+ })),
157
+ sorts: sortByIndexes.map((index, i)=>({
158
+ selector: {
159
+ index,
160
+ offset: sortByOffsets[i],
161
+ length: sortByLengths[i]
162
+ },
163
+ order: sortOrder[i]
164
+ })),
171
165
  limit,
172
- offset,
166
+ offset
173
167
  });
174
- this.log.debug(`Returning ${notes.length} notes for ${this.callContext.contractAddress} at ${storageSlot}: ${notes
175
- .map(n => `${n.nonce.toString()}:[${n.note.items.map(i => i.toString()).join(',')}]`)
176
- .join(', ')}`);
177
- const noteHashesAndIndexes = await Promise.all(notes.map(async (n) => {
168
+ this.log.debug(`Returning ${notes.length} notes for ${this.callContext.contractAddress} at ${storageSlot}: ${notes.map((n)=>`${n.nonce.toString()}:[${n.note.items.map((i)=>i.toString()).join(',')}]`).join(', ')}`);
169
+ const noteHashesAndIndexes = await Promise.all(notes.map(async (n)=>{
178
170
  if (n.index !== undefined) {
179
171
  const siloedNoteHash = await siloNoteHash(n.contractAddress, n.noteHash);
180
172
  const uniqueNoteHash = await computeUniqueNoteHash(n.nonce, siloedNoteHash);
181
- return { hash: uniqueNoteHash, index: n.index };
173
+ return {
174
+ hash: uniqueNoteHash,
175
+ index: n.index
176
+ };
182
177
  }
183
178
  }));
184
- noteHashesAndIndexes
185
- .filter(n => n !== undefined)
186
- .forEach(n => {
179
+ noteHashesAndIndexes.filter((n)=>n !== undefined).forEach((n)=>{
187
180
  this.noteHashLeafIndexMap.set(n.hash.toBigInt(), n.index);
188
181
  });
189
182
  return notes;
190
183
  }
191
184
  /**
192
- * Keep track of the new note created during execution.
193
- * It can be used in subsequent calls (or transactions when chaining txs is possible).
194
- * @param contractAddress - The contract address.
195
- * @param storageSlot - The storage slot.
196
- * @param noteTypeId - The type ID of the note.
197
- * @param noteItems - The items to be included in a Note.
198
- * @param noteHash - A hash of the new note.
199
- * @returns
200
- */
201
- notifyCreatedNote(storageSlot, noteTypeId, noteItems, noteHash, counter) {
185
+ * Keep track of the new note created during execution.
186
+ * It can be used in subsequent calls (or transactions when chaining txs is possible).
187
+ * @param contractAddress - The contract address.
188
+ * @param storageSlot - The storage slot.
189
+ * @param noteTypeId - The type ID of the note.
190
+ * @param noteItems - The items to be included in a Note.
191
+ * @param noteHash - A hash of the new note.
192
+ * @returns
193
+ */ notifyCreatedNote(storageSlot, noteTypeId, noteItems, noteHash, counter) {
202
194
  const note = new Note(noteItems);
203
195
  this.noteCache.addNewNote({
204
196
  contractAddress: this.callContext.contractAddress,
205
197
  storageSlot,
206
- nonce: Fr.ZERO, // Nonce cannot be known during private execution.
198
+ nonce: Fr.ZERO,
207
199
  note,
208
- siloedNullifier: undefined, // Siloed nullifier cannot be known for newly created note.
209
- noteHash,
200
+ siloedNullifier: undefined,
201
+ noteHash
210
202
  }, counter);
211
203
  this.newNotes.push(new NoteAndSlot(note, storageSlot, noteTypeId));
212
204
  }
213
205
  /**
214
- * Adding a siloed nullifier into the current set of all pending nullifiers created
215
- * within the current transaction/execution.
216
- * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
217
- * @param noteHash - A hash of the new note.
218
- */
219
- async notifyNullifiedNote(innerNullifier, noteHash, counter) {
206
+ * Adding a siloed nullifier into the current set of all pending nullifiers created
207
+ * within the current transaction/execution.
208
+ * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
209
+ * @param noteHash - A hash of the new note.
210
+ */ async notifyNullifiedNote(innerNullifier, noteHash, counter) {
220
211
  const nullifiedNoteHashCounter = await this.noteCache.nullifyNote(this.callContext.contractAddress, innerNullifier, noteHash);
221
212
  if (nullifiedNoteHashCounter !== undefined) {
222
213
  this.noteHashNullifierCounterMap.set(nullifiedNoteHashCounter, counter);
223
214
  }
224
215
  }
225
216
  /**
226
- * Adding a siloed nullifier into the current set of all pending nullifiers created
227
- * within the current transaction/execution.
228
- * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
229
- * @param noteHash - A hash of the new note.
230
- */
231
- notifyCreatedNullifier(innerNullifier) {
217
+ * Adding a siloed nullifier into the current set of all pending nullifiers created
218
+ * within the current transaction/execution.
219
+ * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
220
+ * @param noteHash - A hash of the new note.
221
+ */ notifyCreatedNullifier(innerNullifier) {
232
222
  return this.noteCache.nullifierCreated(this.callContext.contractAddress, innerNullifier);
233
223
  }
234
224
  /**
235
- * Emit a contract class unencrypted log.
236
- * This fn exists because sha hashing the preimage
237
- * is too large to compile (16,200 fields, 518,400 bytes) => the oracle hashes it.
238
- * See private_context.nr
239
- * TODO(#8945): Contract class logs are currently sha hashes. When these are fields, delete this.
240
- * @param log - The unencrypted log to be emitted.
241
- */
242
- emitContractClassLog(log, counter) {
225
+ * Emit a contract class unencrypted log.
226
+ * This fn exists because sha hashing the preimage
227
+ * is too large to compile (16,200 fields, 518,400 bytes) => the oracle hashes it.
228
+ * See private_context.nr
229
+ * TODO(#8945): Contract class logs are currently sha hashes. When these are fields, delete this.
230
+ * @param log - The unencrypted log to be emitted.
231
+ */ emitContractClassLog(log, counter) {
243
232
  this.contractClassLogs.push(new CountedContractClassLog(log, counter));
244
233
  const text = log.toHumanReadable();
245
234
  this.log.verbose(`Emitted log from ContractClassRegisterer: "${text.length > 100 ? text.slice(0, 100) + '...' : text}"`);
246
235
  return Fr.fromBuffer(log.hash());
247
236
  }
237
+ #checkValidStaticCall(childExecutionResult) {
238
+ if (childExecutionResult.publicInputs.noteHashes.some((item)=>!item.isEmpty()) || childExecutionResult.publicInputs.nullifiers.some((item)=>!item.isEmpty()) || childExecutionResult.publicInputs.l2ToL1Msgs.some((item)=>!item.isEmpty()) || childExecutionResult.publicInputs.privateLogs.some((item)=>!item.isEmpty()) || childExecutionResult.publicInputs.contractClassLogsHashes.some((item)=>!item.isEmpty())) {
239
+ throw new Error(`Static call cannot update the state, emit L2->L1 messages or generate logs`);
240
+ }
241
+ }
248
242
  /**
249
- * Calls a private function as a nested execution.
250
- * @param targetContractAddress - The address of the contract to call.
251
- * @param functionSelector - The function selector of the function to call.
252
- * @param argsHash - The arguments hash to pass to the function.
253
- * @param sideEffectCounter - The side effect counter at the start of the call.
254
- * @param isStaticCall - Whether the call is a static call.
255
- * @returns The execution result.
256
- */
257
- async callPrivateFunction(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
243
+ * Calls a private function as a nested execution.
244
+ * @param targetContractAddress - The address of the contract to call.
245
+ * @param functionSelector - The function selector of the function to call.
246
+ * @param argsHash - The arguments hash to pass to the function.
247
+ * @param sideEffectCounter - The side effect counter at the start of the call.
248
+ * @param isStaticCall - Whether the call is a static call.
249
+ * @returns The execution result.
250
+ */ async callPrivateFunction(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
258
251
  this.log.debug(`Calling private function ${this.contractAddress}:${functionSelector} from ${this.callContext.contractAddress}`);
259
252
  isStaticCall = isStaticCall || this.callContext.isStaticCall;
260
253
  const targetArtifact = await this.db.getFunctionArtifact(targetContractAddress, functionSelector);
@@ -263,25 +256,24 @@ export class ClientExecutionContext extends ViewDataOracle {
263
256
  const context = new ClientExecutionContext(argsHash, derivedTxContext, derivedCallContext, this.historicalHeader, this.authWitnesses, this.executionCache, this.noteCache, this.db, this.node, this.provider, sideEffectCounter, this.log, this.scopes);
264
257
  const childExecutionResult = await executePrivateFunction(this.provider, context, targetArtifact, targetContractAddress, functionSelector);
265
258
  if (isStaticCall) {
266
- __classPrivateFieldGet(this, _ClientExecutionContext_instances, "m", _ClientExecutionContext_checkValidStaticCall).call(this, childExecutionResult);
259
+ this.#checkValidStaticCall(childExecutionResult);
267
260
  }
268
261
  this.nestedExecutions.push(childExecutionResult);
269
262
  const publicInputs = childExecutionResult.publicInputs;
270
263
  return {
271
264
  endSideEffectCounter: publicInputs.endSideEffectCounter,
272
- returnsHash: publicInputs.returnsHash,
265
+ returnsHash: publicInputs.returnsHash
273
266
  };
274
267
  }
275
268
  /**
276
- * Creates a PublicExecutionRequest object representing the request to call a public function.
277
- * @param targetContractAddress - The address of the contract to call.
278
- * @param functionSelector - The function selector of the function to call.
279
- * @param argsHash - The arguments hash to pass to the function.
280
- * @param sideEffectCounter - The side effect counter at the start of the call.
281
- * @param isStaticCall - Whether the call is a static call.
282
- * @returns The public call stack item with the request information.
283
- */
284
- async createPublicExecutionRequest(callType, targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
269
+ * Creates a PublicExecutionRequest object representing the request to call a public function.
270
+ * @param targetContractAddress - The address of the contract to call.
271
+ * @param functionSelector - The function selector of the function to call.
272
+ * @param argsHash - The arguments hash to pass to the function.
273
+ * @param sideEffectCounter - The side effect counter at the start of the call.
274
+ * @param isStaticCall - Whether the call is a static call.
275
+ * @returns The public call stack item with the request information.
276
+ */ async createPublicExecutionRequest(callType, targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
285
277
  const targetArtifact = await this.db.getFunctionArtifact(targetContractAddress, functionSelector);
286
278
  const derivedCallContext = await this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
287
279
  const args = this.executionCache.getPreimage(argsHash);
@@ -290,31 +282,29 @@ export class ClientExecutionContext extends ViewDataOracle {
290
282
  isStaticCall,
291
283
  functionSelector,
292
284
  targetContractAddress,
293
- callType,
285
+ callType
294
286
  });
295
287
  const request = PublicExecutionRequest.from({
296
288
  args,
297
- callContext: derivedCallContext,
289
+ callContext: derivedCallContext
298
290
  });
299
291
  if (callType === 'enqueued') {
300
292
  this.enqueuedPublicFunctionCalls.push(new CountedPublicExecutionRequest(request, sideEffectCounter));
301
- }
302
- else {
293
+ } else {
303
294
  this.publicTeardownFunctionCall = request;
304
295
  }
305
296
  }
306
297
  /**
307
- * Creates and enqueues a PublicExecutionRequest object representing the request to call a public function. No function
308
- * is actually called, since that must happen on the sequencer side. All the fields related to the result
309
- * of the execution are empty.
310
- * @param targetContractAddress - The address of the contract to call.
311
- * @param functionSelector - The function selector of the function to call.
312
- * @param argsHash - The arguments hash to pass to the function.
313
- * @param sideEffectCounter - The side effect counter at the start of the call.
314
- * @param isStaticCall - Whether the call is a static call.
315
- * @returns The public call stack item with the request information.
316
- */
317
- async enqueuePublicFunctionCall(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
298
+ * Creates and enqueues a PublicExecutionRequest object representing the request to call a public function. No function
299
+ * is actually called, since that must happen on the sequencer side. All the fields related to the result
300
+ * of the execution are empty.
301
+ * @param targetContractAddress - The address of the contract to call.
302
+ * @param functionSelector - The function selector of the function to call.
303
+ * @param argsHash - The arguments hash to pass to the function.
304
+ * @param sideEffectCounter - The side effect counter at the start of the call.
305
+ * @param isStaticCall - Whether the call is a static call.
306
+ * @returns The public call stack item with the request information.
307
+ */ async enqueuePublicFunctionCall(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
318
308
  // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.
319
309
  // WARNING: This is insecure and should be temporary!
320
310
  // The oracle re-hashes the arguments and returns a new args_hash.
@@ -323,23 +313,22 @@ export class ClientExecutionContext extends ViewDataOracle {
323
313
  // b) this is only temporary.
324
314
  const newArgsHash = await this.executionCache.store([
325
315
  functionSelector.toField(),
326
- ...this.executionCache.getPreimage(argsHash),
316
+ ...this.executionCache.getPreimage(argsHash)
327
317
  ]);
328
318
  await this.createPublicExecutionRequest('enqueued', targetContractAddress, FunctionSelector.fromField(new Fr(PUBLIC_DISPATCH_SELECTOR)), newArgsHash, sideEffectCounter, isStaticCall);
329
319
  return newArgsHash;
330
320
  }
331
321
  /**
332
- * Creates a PublicExecutionRequest and sets it as the public teardown function. No function
333
- * is actually called, since that must happen on the sequencer side. All the fields related to the result
334
- * of the execution are empty.
335
- * @param targetContractAddress - The address of the contract to call.
336
- * @param functionSelector - The function selector of the function to call.
337
- * @param argsHash - The arguments hash to pass to the function.
338
- * @param sideEffectCounter - The side effect counter at the start of the call.
339
- * @param isStaticCall - Whether the call is a static call.
340
- * @returns The public call stack item with the request information.
341
- */
342
- async setPublicTeardownFunctionCall(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
322
+ * Creates a PublicExecutionRequest and sets it as the public teardown function. No function
323
+ * is actually called, since that must happen on the sequencer side. All the fields related to the result
324
+ * of the execution are empty.
325
+ * @param targetContractAddress - The address of the contract to call.
326
+ * @param functionSelector - The function selector of the function to call.
327
+ * @param argsHash - The arguments hash to pass to the function.
328
+ * @param sideEffectCounter - The side effect counter at the start of the call.
329
+ * @param isStaticCall - Whether the call is a static call.
330
+ * @returns The public call stack item with the request information.
331
+ */ async setPublicTeardownFunctionCall(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
343
332
  // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.
344
333
  // WARNING: This is insecure and should be temporary!
345
334
  // The oracle rehashes the arguments and returns a new args_hash.
@@ -348,7 +337,7 @@ export class ClientExecutionContext extends ViewDataOracle {
348
337
  // b) this is only temporary.
349
338
  const newArgsHash = await this.executionCache.store([
350
339
  functionSelector.toField(),
351
- ...this.executionCache.getPreimage(argsHash),
340
+ ...this.executionCache.getPreimage(argsHash)
352
341
  ]);
353
342
  await this.createPublicExecutionRequest('teardown', targetContractAddress, FunctionSelector.fromField(new Fr(PUBLIC_DISPATCH_SELECTOR)), newArgsHash, sideEffectCounter, isStaticCall);
354
343
  return newArgsHash;
@@ -357,13 +346,12 @@ export class ClientExecutionContext extends ViewDataOracle {
357
346
  return this.noteCache.setMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter);
358
347
  }
359
348
  /**
360
- * Derives the call context for a nested execution.
361
- * @param targetContractAddress - The address of the contract being called.
362
- * @param targetArtifact - The artifact of the function being called.
363
- * @param isStaticCall - Whether the call is a static call.
364
- * @returns The derived call context.
365
- */
366
- async deriveCallContext(targetContractAddress, targetArtifact, isStaticCall = false) {
349
+ * Derives the call context for a nested execution.
350
+ * @param targetContractAddress - The address of the contract being called.
351
+ * @param targetArtifact - The artifact of the function being called.
352
+ * @param isStaticCall - Whether the call is a static call.
353
+ * @returns The derived call context.
354
+ */ async deriveCallContext(targetContractAddress, targetArtifact, isStaticCall = false) {
367
355
  return new CallContext(this.contractAddress, targetContractAddress, await FunctionSelector.fromNameAndParameters(targetArtifact.name, targetArtifact.parameters), isStaticCall);
368
356
  }
369
357
  getDebugFunctionName() {
@@ -374,19 +362,9 @@ export class ClientExecutionContext extends ViewDataOracle {
374
362
  }
375
363
  async syncNotes() {
376
364
  const taggedLogsByRecipient = await this.db.syncTaggedLogs(this.contractAddress, this.historicalHeader.globalVariables.blockNumber.toNumber(), this.scopes);
377
- for (const [recipient, taggedLogs] of taggedLogsByRecipient.entries()) {
365
+ for (const [recipient, taggedLogs] of taggedLogsByRecipient.entries()){
378
366
  await this.db.processTaggedLogs(taggedLogs, AztecAddress.fromString(recipient));
379
367
  }
380
368
  await this.db.removeNullifiedNotes(this.contractAddress);
381
369
  }
382
370
  }
383
- _ClientExecutionContext_instances = new WeakSet(), _ClientExecutionContext_checkValidStaticCall = function _ClientExecutionContext_checkValidStaticCall(childExecutionResult) {
384
- if (childExecutionResult.publicInputs.noteHashes.some(item => !item.isEmpty()) ||
385
- childExecutionResult.publicInputs.nullifiers.some(item => !item.isEmpty()) ||
386
- childExecutionResult.publicInputs.l2ToL1Msgs.some(item => !item.isEmpty()) ||
387
- childExecutionResult.publicInputs.privateLogs.some(item => !item.isEmpty()) ||
388
- childExecutionResult.publicInputs.contractClassLogsHashes.some(item => !item.isEmpty())) {
389
- throw new Error(`Static call cannot update the state, emit L2->L1 messages or generate logs`);
390
- }
391
- };
392
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpZW50X2V4ZWN1dGlvbl9jb250ZXh0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaWVudC9jbGllbnRfZXhlY3V0aW9uX2NvbnRleHQudHMiXSwibmFtZX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FDLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO1FBQzNFLG9CQUFvQixDQUFDLFlBQVksQ0FBQyx1QkFBdUIsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQyxFQUN2RixDQUFDO1FBQ0QsTUFBTSxJQUFJLEtBQUssQ0FBQyw0RUFBNEUsQ0FBQyxDQUFDO0lBQ2hHLENBQUM7QUFDSCxDQUFDIn0=
@@ -1,17 +1,14 @@
1
1
  /**
2
2
  * Error thrown when a contract is not found in the database.
3
- */
4
- export class ContractNotFoundError extends Error {
5
- constructor(contractAddress) {
3
+ */ export class ContractNotFoundError extends Error {
4
+ constructor(contractAddress){
6
5
  super(`DB has no contract with address ${contractAddress}`);
7
6
  }
8
7
  }
9
8
  /**
10
9
  * Error thrown when a contract class is not found in the database.
11
- */
12
- export class ContractClassNotFoundError extends Error {
13
- constructor(contractClassId) {
10
+ */ export class ContractClassNotFoundError extends Error {
11
+ constructor(contractClassId){
14
12
  super(`DB has no contract class with id ${contractClassId}`);
15
13
  }
16
14
  }
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGJfb3JhY2xlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaWVudC9kYl9vcmFjbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBc0JBOztHQUVHO0FBQ0gsTUFBTSxPQUFPLHFCQUFzQixTQUFRLEtBQUs7SUFDOUMsWUFBWSxlQUF1QjtRQUNqQyxLQUFLLENBQUMsbUNBQW1DLGVBQWUsRUFBRSxDQUFDLENBQUM7SUFDOUQsQ0FBQztDQUNGO0FBRUQ7O0dBRUc7QUFDSCxNQUFNLE9BQU8sMEJBQTJCLFNBQVEsS0FBSztJQUNuRCxZQUFZLGVBQXVCO1FBQ2pDLEtBQUssQ0FBQyxvQ0FBb0MsZUFBZSxFQUFFLENBQUMsQ0FBQztJQUMvRCxDQUFDO0NBQ0YifQ==