@aztec/pxe 0.0.1-commit.e6bd8901 → 0.0.1-commit.ec7ac5448

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 (257) hide show
  1. package/dest/bin/check_oracle_version.js +4 -4
  2. package/dest/block_synchronizer/block_synchronizer.d.ts +5 -3
  3. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  4. package/dest/block_synchronizer/block_synchronizer.js +17 -5
  5. package/dest/config/index.d.ts +2 -2
  6. package/dest/config/index.d.ts.map +1 -1
  7. package/dest/config/index.js +1 -1
  8. package/dest/config/package_info.js +1 -1
  9. package/dest/contract_function_simulator/contract_function_simulator.d.ts +60 -31
  10. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  11. package/dest/contract_function_simulator/contract_function_simulator.js +201 -74
  12. package/dest/contract_function_simulator/ephemeral_array_service.d.ts +28 -0
  13. package/dest/contract_function_simulator/ephemeral_array_service.d.ts.map +1 -0
  14. package/dest/contract_function_simulator/ephemeral_array_service.js +78 -0
  15. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +7 -7
  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 +19 -11
  18. package/dest/contract_function_simulator/index.d.ts +2 -1
  19. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/index.js +1 -0
  21. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -6
  22. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +8 -10
  24. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +1 -1
  25. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +1 -1
  26. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +2 -2
  27. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +2 -4
  29. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +4 -7
  30. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  31. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +6 -11
  32. package/dest/contract_function_simulator/oracle/interfaces.d.ts +62 -46
  33. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  34. package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +9 -0
  35. package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -0
  36. package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +47 -0
  37. package/dest/contract_function_simulator/oracle/oracle.d.ts +75 -44
  38. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  39. package/dest/contract_function_simulator/oracle/oracle.js +310 -113
  40. package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
  41. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +53 -79
  42. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  43. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +109 -89
  44. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +124 -67
  45. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  46. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +326 -140
  47. package/dest/contract_function_simulator/pick_notes.d.ts +1 -1
  48. package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
  49. package/dest/contract_function_simulator/pick_notes.js +9 -2
  50. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +1 -1
  51. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  52. package/dest/contract_function_simulator/proxied_contract_data_source.js +3 -0
  53. package/dest/contract_logging.d.ts +27 -0
  54. package/dest/contract_logging.d.ts.map +1 -0
  55. package/dest/contract_logging.js +38 -0
  56. package/dest/contract_sync/contract_sync_service.d.ts +44 -0
  57. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  58. package/dest/contract_sync/contract_sync_service.js +104 -0
  59. package/dest/contract_sync/helpers.d.ts +28 -0
  60. package/dest/contract_sync/helpers.d.ts.map +1 -0
  61. package/dest/contract_sync/{index.js → helpers.js} +20 -16
  62. package/dest/debug/pxe_debug_utils.d.ts +24 -10
  63. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  64. package/dest/debug/pxe_debug_utils.js +28 -18
  65. package/dest/entrypoints/client/bundle/index.d.ts +3 -1
  66. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  67. package/dest/entrypoints/client/bundle/index.js +2 -0
  68. package/dest/entrypoints/client/bundle/utils.d.ts +2 -2
  69. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  70. package/dest/entrypoints/client/bundle/utils.js +23 -9
  71. package/dest/entrypoints/client/lazy/index.d.ts +3 -1
  72. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  73. package/dest/entrypoints/client/lazy/index.js +2 -0
  74. package/dest/entrypoints/client/lazy/utils.d.ts +3 -3
  75. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  76. package/dest/entrypoints/client/lazy/utils.js +24 -10
  77. package/dest/entrypoints/pxe_creation_options.d.ts +5 -2
  78. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  79. package/dest/entrypoints/pxe_creation_options.js +3 -1
  80. package/dest/entrypoints/server/index.d.ts +4 -3
  81. package/dest/entrypoints/server/index.d.ts.map +1 -1
  82. package/dest/entrypoints/server/index.js +3 -2
  83. package/dest/entrypoints/server/utils.d.ts +2 -2
  84. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  85. package/dest/entrypoints/server/utils.js +30 -11
  86. package/dest/events/event_service.d.ts +5 -5
  87. package/dest/events/event_service.d.ts.map +1 -1
  88. package/dest/events/event_service.js +20 -9
  89. package/dest/job_coordinator/job_coordinator.d.ts +3 -2
  90. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -1
  91. package/dest/job_coordinator/job_coordinator.js +3 -2
  92. package/dest/logs/log_service.d.ts +8 -9
  93. package/dest/logs/log_service.d.ts.map +1 -1
  94. package/dest/logs/log_service.js +38 -62
  95. package/dest/messages/message_context_service.d.ts +17 -0
  96. package/dest/messages/message_context_service.d.ts.map +1 -0
  97. package/dest/messages/message_context_service.js +36 -0
  98. package/dest/notes/note_service.d.ts +7 -8
  99. package/dest/notes/note_service.d.ts.map +1 -1
  100. package/dest/notes/note_service.js +23 -15
  101. package/dest/notes_filter.d.ts +24 -0
  102. package/dest/notes_filter.d.ts.map +1 -0
  103. package/dest/notes_filter.js +4 -0
  104. package/dest/oracle_version.d.ts +4 -3
  105. package/dest/oracle_version.d.ts.map +1 -1
  106. package/dest/oracle_version.js +20 -10
  107. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  108. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  109. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  110. package/dest/private_kernel/hints/index.d.ts +1 -1
  111. package/dest/private_kernel/hints/index.js +1 -1
  112. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +4 -3
  113. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
  114. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +129 -68
  115. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  116. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  117. package/dest/private_kernel/hints/test_utils.js +203 -0
  118. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  119. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  120. package/dest/private_kernel/private_kernel_execution_prover.js +21 -13
  121. package/dest/private_kernel/private_kernel_oracle.d.ts +8 -4
  122. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  123. package/dest/private_kernel/private_kernel_oracle.js +7 -3
  124. package/dest/pxe.d.ts +73 -24
  125. package/dest/pxe.d.ts.map +1 -1
  126. package/dest/pxe.js +131 -78
  127. package/dest/storage/address_store/address_store.d.ts +1 -1
  128. package/dest/storage/address_store/address_store.d.ts.map +1 -1
  129. package/dest/storage/address_store/address_store.js +12 -11
  130. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
  131. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
  132. package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
  133. package/dest/storage/capsule_store/capsule_service.d.ts +21 -0
  134. package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -0
  135. package/dest/storage/capsule_store/capsule_service.js +50 -0
  136. package/dest/storage/capsule_store/capsule_store.d.ts +9 -9
  137. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
  138. package/dest/storage/capsule_store/capsule_store.js +39 -36
  139. package/dest/storage/capsule_store/index.d.ts +2 -1
  140. package/dest/storage/capsule_store/index.d.ts.map +1 -1
  141. package/dest/storage/capsule_store/index.js +1 -0
  142. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  143. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  144. package/dest/storage/contract_store/contract_store.js +157 -72
  145. package/dest/storage/metadata.d.ts +1 -1
  146. package/dest/storage/metadata.js +1 -1
  147. package/dest/storage/note_store/note_store.d.ts +13 -3
  148. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  149. package/dest/storage/note_store/note_store.js +147 -107
  150. package/dest/storage/private_event_store/private_event_store.d.ts +1 -1
  151. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  152. package/dest/storage/private_event_store/private_event_store.js +84 -61
  153. package/dest/storage/private_event_store/stored_private_event.d.ts +4 -4
  154. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -1
  155. package/dest/storage/private_event_store/stored_private_event.js +2 -2
  156. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
  157. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  158. package/dest/storage/tagging_store/recipient_tagging_store.js +31 -19
  159. package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
  160. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
  161. package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
  162. package/dest/storage/tagging_store/sender_tagging_store.d.ts +29 -28
  163. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  164. package/dest/storage/tagging_store/sender_tagging_store.js +233 -137
  165. package/dest/tagging/get_all_logs_by_tags.d.ts +4 -4
  166. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
  167. package/dest/tagging/get_all_logs_by_tags.js +17 -3
  168. package/dest/tagging/index.d.ts +3 -3
  169. package/dest/tagging/index.d.ts.map +1 -1
  170. package/dest/tagging/index.js +1 -1
  171. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +5 -6
  172. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  173. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +7 -7
  174. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  175. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +7 -8
  176. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  177. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +12 -11
  178. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +5 -9
  179. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  180. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +13 -7
  181. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +4 -3
  182. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  183. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +20 -10
  184. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +6 -8
  185. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  186. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +36 -24
  187. package/package.json +25 -16
  188. package/src/bin/check_oracle_version.ts +4 -4
  189. package/src/block_synchronizer/block_synchronizer.ts +29 -19
  190. package/src/config/index.ts +1 -1
  191. package/src/config/package_info.ts +1 -1
  192. package/src/contract_function_simulator/contract_function_simulator.ts +360 -133
  193. package/src/contract_function_simulator/ephemeral_array_service.ts +110 -0
  194. package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -14
  195. package/src/contract_function_simulator/index.ts +1 -0
  196. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +9 -9
  197. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +1 -1
  198. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +2 -5
  199. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +4 -10
  200. package/src/contract_function_simulator/oracle/interfaces.ts +90 -62
  201. package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +104 -0
  202. package/src/contract_function_simulator/oracle/oracle.ts +391 -150
  203. package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
  204. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +136 -187
  205. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +544 -174
  206. package/src/contract_function_simulator/pick_notes.ts +9 -2
  207. package/src/contract_function_simulator/proxied_contract_data_source.ts +8 -1
  208. package/src/contract_logging.ts +52 -0
  209. package/src/contract_sync/contract_sync_service.ts +170 -0
  210. package/src/contract_sync/{index.ts → helpers.ts} +23 -25
  211. package/src/debug/pxe_debug_utils.ts +63 -19
  212. package/src/entrypoints/client/bundle/index.ts +2 -0
  213. package/src/entrypoints/client/bundle/utils.ts +18 -18
  214. package/src/entrypoints/client/lazy/index.ts +2 -0
  215. package/src/entrypoints/client/lazy/utils.ts +19 -18
  216. package/src/entrypoints/pxe_creation_options.ts +9 -1
  217. package/src/entrypoints/server/index.ts +3 -2
  218. package/src/entrypoints/server/utils.ts +24 -29
  219. package/src/events/event_service.ts +21 -10
  220. package/src/job_coordinator/job_coordinator.ts +4 -3
  221. package/src/logs/log_service.ts +72 -106
  222. package/src/messages/message_context_service.ts +44 -0
  223. package/src/notes/note_service.ts +24 -16
  224. package/src/notes_filter.ts +24 -0
  225. package/src/oracle_version.ts +20 -10
  226. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  227. package/src/private_kernel/hints/index.ts +1 -1
  228. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +164 -117
  229. package/src/private_kernel/hints/test_utils.ts +325 -0
  230. package/src/private_kernel/private_kernel_execution_prover.ts +25 -15
  231. package/src/private_kernel/private_kernel_oracle.ts +9 -9
  232. package/src/pxe.ts +243 -131
  233. package/src/storage/address_store/address_store.ts +15 -15
  234. package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
  235. package/src/storage/capsule_store/capsule_service.ts +90 -0
  236. package/src/storage/capsule_store/capsule_store.ts +42 -34
  237. package/src/storage/capsule_store/index.ts +1 -0
  238. package/src/storage/contract_store/contract_store.ts +186 -76
  239. package/src/storage/metadata.ts +1 -1
  240. package/src/storage/note_store/note_store.ts +166 -132
  241. package/src/storage/private_event_store/private_event_store.ts +102 -81
  242. package/src/storage/private_event_store/stored_private_event.ts +3 -3
  243. package/src/storage/tagging_store/recipient_tagging_store.ts +38 -24
  244. package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
  245. package/src/storage/tagging_store/sender_tagging_store.ts +287 -156
  246. package/src/tagging/get_all_logs_by_tags.ts +31 -7
  247. package/src/tagging/index.ts +2 -2
  248. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +9 -12
  249. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  250. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +12 -17
  251. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +25 -12
  252. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +26 -11
  253. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +30 -29
  254. package/dest/contract_sync/index.d.ts +0 -23
  255. package/dest/contract_sync/index.d.ts.map +0 -1
  256. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  257. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
package/dest/pxe.js CHANGED
@@ -5,7 +5,6 @@ import { KeyStore } from '@aztec/key-store';
5
5
  import { L2TipsKVStore } from '@aztec/kv-store/stores';
6
6
  import { protocolContractNames } from '@aztec/protocol-contracts';
7
7
  import { FunctionType, decodeFunctionSignature } from '@aztec/stdlib/abi';
8
- import { L2BlockHash } from '@aztec/stdlib/block';
9
8
  import { computeContractAddressFromInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
10
9
  import { SimulationError } from '@aztec/stdlib/errors';
11
10
  import { PrivateSimulationResult, TxProfileResult, TxProvingResult, TxSimulationResult } from '@aztec/stdlib/tx';
@@ -14,11 +13,14 @@ import { BlockSynchronizer } from './block_synchronizer/index.js';
14
13
  import { BenchmarkedNodeFactory } from './contract_function_simulator/benchmarked_node.js';
15
14
  import { ContractFunctionSimulator, generateSimulatedProvingResult } from './contract_function_simulator/contract_function_simulator.js';
16
15
  import { ProxiedContractStoreFactory } from './contract_function_simulator/proxied_contract_data_source.js';
17
- import { ensureContractSynced, readCurrentClassId } from './contract_sync/index.js';
16
+ import { displayDebugLogs } from './contract_logging.js';
17
+ import { ContractSyncService } from './contract_sync/contract_sync_service.js';
18
+ import { readCurrentClassId } from './contract_sync/helpers.js';
18
19
  import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
19
20
  import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
20
21
  import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
21
22
  import { JobCoordinator } from './job_coordinator/job_coordinator.js';
23
+ import { MessageContextService } from './messages/message_context_service.js';
22
24
  import { PrivateKernelExecutionProver } from './private_kernel/private_kernel_execution_prover.js';
23
25
  import { PrivateKernelOracle } from './private_kernel/private_kernel_oracle.js';
24
26
  import { AddressStore } from './storage/address_store/address_store.js';
@@ -35,6 +37,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
35
37
  * manage private state of users.
36
38
  */ export class PXE {
37
39
  node;
40
+ db;
38
41
  blockStateSynchronizer;
39
42
  keyStore;
40
43
  contractStore;
@@ -46,6 +49,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
46
49
  recipientTaggingStore;
47
50
  addressStore;
48
51
  privateEventStore;
52
+ contractSyncService;
53
+ messageContextService;
49
54
  simulator;
50
55
  proverEnabled;
51
56
  proofCreator;
@@ -54,8 +59,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
54
59
  jobQueue;
55
60
  jobCoordinator;
56
61
  debug;
57
- constructor(node, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
62
+ constructor(node, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
58
63
  this.node = node;
64
+ this.db = db;
59
65
  this.blockStateSynchronizer = blockStateSynchronizer;
60
66
  this.keyStore = keyStore;
61
67
  this.contractStore = contractStore;
@@ -67,6 +73,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
67
73
  this.recipientTaggingStore = recipientTaggingStore;
68
74
  this.addressStore = addressStore;
69
75
  this.privateEventStore = privateEventStore;
76
+ this.contractSyncService = contractSyncService;
77
+ this.messageContextService = messageContextService;
70
78
  this.simulator = simulator;
71
79
  this.proverEnabled = proverEnabled;
72
80
  this.proofCreator = proofCreator;
@@ -82,9 +90,12 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
82
90
  * can be contacted.
83
91
  *
84
92
  * @returns A promise that resolves PXE is ready to be used.
85
- */ static async create(node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix) {
93
+ */ static async create({ node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix }) {
94
+ // Extract bindings from the logger, or use empty bindings if a string suffix is provided.
95
+ const bindings = loggerOrSuffix && typeof loggerOrSuffix !== 'string' ? loggerOrSuffix.getBindings() : undefined;
86
96
  const log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:service:${loggerOrSuffix}` : `pxe:service`) : loggerOrSuffix;
87
- const proverEnabled = !!config.proverEnabled;
97
+ const info = await node.getNodeInfo();
98
+ const proverEnabled = config.proverEnabled !== undefined ? config.proverEnabled : info.realProofs;
88
99
  const addressStore = new AddressStore(store);
89
100
  const privateEventStore = new PrivateEventStore(store);
90
101
  const contractStore = new ContractStore(store);
@@ -96,29 +107,45 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
96
107
  const capsuleStore = new CapsuleStore(store);
97
108
  const keyStore = new KeyStore(store);
98
109
  const tipsStore = new L2TipsKVStore(store, 'pxe');
99
- const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, config, loggerOrSuffix);
100
- const jobCoordinator = new JobCoordinator(store);
110
+ const contractSyncService = new ContractSyncService(node, contractStore, noteStore, createLogger('pxe:contract_sync', bindings));
111
+ const messageContextService = new MessageContextService(node);
112
+ const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, contractSyncService, config, bindings);
113
+ const jobCoordinator = new JobCoordinator(store, bindings);
101
114
  jobCoordinator.registerStores([
102
115
  capsuleStore,
103
116
  senderTaggingStore,
104
117
  recipientTaggingStore,
105
118
  privateEventStore,
106
- noteStore
119
+ noteStore,
120
+ contractSyncService
107
121
  ]);
108
- const debugUtils = new PXEDebugUtils(contractStore, noteStore);
122
+ const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
109
123
  const jobQueue = new SerialQueue();
110
- const pxe = new PXE(node, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
111
- debugUtils.setPXE(pxe);
124
+ const pxe = new PXE(node, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
125
+ debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#executeUtility.bind(pxe));
112
126
  pxe.jobQueue.start();
113
127
  await pxe.#registerProtocolContracts();
114
- const info = await node.getNodeInfo();
115
128
  log.info(`Started PXE connected to chain ${info.l1ChainId} version ${info.rollupVersion}`);
116
129
  return pxe;
117
130
  }
118
131
  // Internal methods
119
132
  #getSimulatorForTx(overrides) {
120
133
  const proxyContractStore = ProxiedContractStoreFactory.create(this.contractStore, overrides?.contracts);
121
- return new ContractFunctionSimulator(proxyContractStore, this.noteStore, this.keyStore, this.addressStore, BenchmarkedNodeFactory.create(this.node), this.anchorBlockStore, this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.simulator);
134
+ return new ContractFunctionSimulator({
135
+ contractStore: proxyContractStore,
136
+ noteStore: this.noteStore,
137
+ keyStore: this.keyStore,
138
+ addressStore: this.addressStore,
139
+ aztecNode: BenchmarkedNodeFactory.create(this.node),
140
+ senderTaggingStore: this.senderTaggingStore,
141
+ recipientTaggingStore: this.recipientTaggingStore,
142
+ senderAddressBookStore: this.senderAddressBookStore,
143
+ capsuleStore: this.capsuleStore,
144
+ privateEventStore: this.privateEventStore,
145
+ simulator: this.simulator,
146
+ contractSyncService: this.contractSyncService,
147
+ messageContextService: this.messageContextService
148
+ });
122
149
  }
123
150
  #contextualizeError(err, ...context) {
124
151
  let contextStr = '';
@@ -161,8 +188,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
161
188
  async #registerProtocolContracts() {
162
189
  const registered = {};
163
190
  for (const name of protocolContractNames){
164
- const { address, contractClass, instance, artifact } = await this.protocolContractsProvider.getProtocolContractArtifact(name);
165
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
191
+ const { address, instance, artifact } = await this.protocolContractsProvider.getProtocolContractArtifact(name);
192
+ await this.contractStore.addContractArtifact(artifact);
166
193
  await this.contractStore.addContractInstance(instance);
167
194
  registered[name] = address.toString();
168
195
  }
@@ -174,10 +201,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
174
201
  const { origin: contractAddress, functionSelector } = txRequest;
175
202
  try {
176
203
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
177
- await ensureContractSynced(contractAddress, functionSelector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), this.node, this.contractStore, anchorBlockHeader);
178
- const result = await contractFunctionSimulator.run(txRequest, contractAddress, functionSelector, undefined, anchorBlockHeader, // The sender for tags is set by contracts, typically by an account
179
- // contract entrypoint
180
- undefined, scopes, jobId);
204
+ await this.contractSyncService.ensureContractSynced(contractAddress, functionSelector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
205
+ const result = await contractFunctionSimulator.run(txRequest, {
206
+ contractAddress,
207
+ selector: functionSelector,
208
+ anchorBlockHeader,
209
+ scopes,
210
+ jobId
211
+ });
181
212
  this.log.debug(`Private simulation completed for ${contractAddress.toString()}:${functionSelector}`);
182
213
  return result;
183
214
  } catch (err) {
@@ -188,18 +219,22 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
188
219
  }
189
220
  }
190
221
  /**
191
- * Simulate a utility function call on the given contract.
222
+ * Execute a utility function call on the given contract.
192
223
  * @param contractFunctionSimulator - The simulator to use for the function call.
193
224
  * @param call - The function call to execute.
194
225
  * @param authWitnesses - Authentication witnesses required for the function call.
195
226
  * @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
196
227
  * accounts if not specified.
197
228
  * @param jobId - The job ID for staged writes.
198
- * @returns The simulation result containing the outputs of the utility function.
199
- */ async #simulateUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
229
+ * @returns The execution result containing the outputs of the utility function.
230
+ */ async #executeUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
200
231
  try {
201
232
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
202
- return contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes, jobId);
233
+ const { result, offchainEffects } = await contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes, jobId);
234
+ return {
235
+ result,
236
+ offchainEffects
237
+ };
203
238
  } catch (err) {
204
239
  if (err instanceof SimulationError) {
205
240
  await enrichSimulationError(err, this.contractStore, this.log);
@@ -244,14 +279,26 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
244
279
  * @returns An object that contains the output of the kernel execution, including the ChonkProof if proving is enabled.
245
280
  */ async #prove(txExecutionRequest, proofCreator, privateExecutionResult, config) {
246
281
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
247
- const anchorBlockHash = L2BlockHash.fromField(await anchorBlockHeader.hash());
282
+ const anchorBlockHash = await anchorBlockHeader.hash();
248
283
  const kernelOracle = new PrivateKernelOracle(this.contractStore, this.keyStore, this.node, anchorBlockHash);
249
- const kernelTraceProver = new PrivateKernelExecutionProver(kernelOracle, proofCreator, !this.proverEnabled);
284
+ const kernelTraceProver = new PrivateKernelExecutionProver(kernelOracle, proofCreator, !this.proverEnabled, this.log.getBindings());
250
285
  this.log.debug(`Executing kernel trace prover (${JSON.stringify(config)})...`);
251
286
  return await kernelTraceProver.proveWithKernels(txExecutionRequest.toTxRequest(), privateExecutionResult, config);
252
287
  }
253
288
  // Public API
254
- getContractInstance(address) {
289
+ /**
290
+ * Returns the block header up to which the PXE has synced.
291
+ * @returns The synced block header
292
+ */ getSyncedBlockHeader() {
293
+ return this.#putInJobQueue(()=>{
294
+ return this.anchorBlockStore.getBlockHeader();
295
+ });
296
+ }
297
+ /**
298
+ * Returns the contract instance for a given address, if it's registered in the PXE.
299
+ * @param address - The contract address.
300
+ * @returns The contract instance if found, undefined otherwise.
301
+ */ getContractInstance(address) {
255
302
  return this.contractStore.getContractInstance(address);
256
303
  }
257
304
  /**
@@ -301,6 +348,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
301
348
  const wasAdded = await this.senderAddressBookStore.addSender(sender);
302
349
  if (wasAdded) {
303
350
  this.log.info(`Added sender:\n ${sender.toString()}`);
351
+ // Wipe the entire sync cache: the new sender's tagged logs could contain notes/events for any contract, so
352
+ // all contracts must re-sync to discover them.
353
+ this.contractSyncService.wipe();
304
354
  } else {
305
355
  this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
306
356
  }
@@ -338,8 +388,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
338
388
  *
339
389
  * @param artifact - The build artifact for the contract class.
340
390
  */ async registerContractClass(artifact) {
341
- const { id: contractClassId } = await getContractClassFromArtifact(artifact);
342
- await this.contractStore.addContractArtifact(contractClassId, artifact);
391
+ const contractClassId = await this.contractStore.addContractArtifact(artifact);
343
392
  this.log.info(`Added contract class ${artifact.name} with id ${contractClassId}`);
344
393
  }
345
394
  /**
@@ -355,15 +404,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
355
404
  if (artifact) {
356
405
  // If the user provides an artifact, validate it against the expected class id and register it
357
406
  const contractClass = await getContractClassFromArtifact(artifact);
358
- const contractClassId = contractClass.id;
359
- if (!contractClassId.equals(instance.currentContractClassId)) {
360
- throw new Error(`Artifact does not match expected class id (computed ${contractClassId} but instance refers to ${instance.currentContractClassId})`);
407
+ if (!contractClass.id.equals(instance.currentContractClassId)) {
408
+ throw new Error(`Artifact does not match expected class id (computed ${contractClass.id} but instance refers to ${instance.currentContractClassId})`);
361
409
  }
362
410
  const computedAddress = await computeContractAddressFromInstance(instance);
363
411
  if (!computedAddress.equals(instance.address)) {
364
412
  throw new Error('Added a contract in which the address does not match the contract instance.');
365
413
  }
366
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
414
+ await this.contractStore.addContractArtifact(artifact, contractClass);
367
415
  const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
368
416
  await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
369
417
  } else {
@@ -399,11 +447,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
399
447
  if (!contractClass.id.equals(currentClassId)) {
400
448
  throw new Error('Could not update contract to a class different from the current one.');
401
449
  }
402
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
403
450
  const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
404
451
  await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
405
452
  currentInstance.currentContractClassId = contractClass.id;
406
- await this.contractStore.addContractInstance(currentInstance);
453
+ await Promise.all([
454
+ this.contractStore.addContractArtifact(artifact, contractClass),
455
+ this.contractStore.addContractInstance(currentInstance)
456
+ ]);
407
457
  this.log.info(`Updated contract ${artifact.name} at ${contractAddress.toString()} to class ${contractClass.id}`);
408
458
  });
409
459
  }
@@ -418,10 +468,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
418
468
  * (where validators prove the public portion).
419
469
  *
420
470
  * @param txRequest - An authenticated tx request ready for proving
471
+ * @param scopes - Addresses whose private state and keys are accessible during private execution.
421
472
  * @returns A result containing the proof and public inputs of the tail circuit.
422
473
  * @throws If contract code not found, or public simulation reverts.
423
474
  * Also throws if simulatePublic is true and public simulation reverts.
424
- */ proveTx(txRequest) {
475
+ */ proveTx(txRequest, scopes) {
425
476
  let privateExecutionResult;
426
477
  // We disable proving concurrently mostly out of caution, since it accesses some of our stores. Proving is so
427
478
  // computationally demanding that it'd be rare for someone to try to do it concurrently regardless.
@@ -432,7 +483,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
432
483
  await this.blockStateSynchronizer.sync();
433
484
  const syncTime = syncTimer.ms();
434
485
  const contractFunctionSimulator = this.#getSimulatorForTx();
435
- privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
486
+ privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
436
487
  const { publicInputs, chonkProof, executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
437
488
  simulate: false,
438
489
  skipFeeEnforcement: false,
@@ -463,16 +514,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
463
514
  // transaction before this one is included in a block from this PXE, and that transaction contains a log with
464
515
  // a tag derived from the same secret, we would reuse the tag and the transactions would be linked. Hence
465
516
  // storing the tags here prevents linkage of txs sent from the same PXE.
466
- const preTagsUsedInTheTx = privateExecutionResult.entrypoint.preTags;
467
- if (preTagsUsedInTheTx.length > 0) {
517
+ const taggingIndexRangesUsedInTheTx = privateExecutionResult.entrypoint.taggingIndexRanges;
518
+ if (taggingIndexRangesUsedInTheTx.length > 0) {
468
519
  // TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
469
520
  const txHash = (await txProvingResult.toTx()).txHash;
470
- await this.senderTaggingStore.storePendingIndexes(preTagsUsedInTheTx, txHash, jobId);
471
- this.log.debug(`Stored used pre-tags as sender for the tx`, {
472
- preTagsUsedInTheTx
521
+ await this.senderTaggingStore.storePendingIndexes(taggingIndexRangesUsedInTheTx, txHash, jobId);
522
+ this.log.debug(`Stored used tagging index ranges as sender for the tx`, {
523
+ taggingIndexRangesUsedInTheTx
473
524
  });
474
525
  } else {
475
- this.log.debug(`No pre-tags used in the tx`);
526
+ this.log.debug(`No tagging index ranges used in the tx`);
476
527
  }
477
528
  return txProvingResult;
478
529
  } catch (err) {
@@ -482,13 +533,10 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
482
533
  }
483
534
  /**
484
535
  * Profiles a transaction, reporting gate counts (unless disabled) and returns an execution trace.
485
- *
486
- * @param txRequest - An authenticated tx request ready for simulation
487
- * @param msgSender - (Optional) The message sender to use for the simulation.
488
- * @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
536
+ * @param txRequest - An authenticated tx request ready for simulation.
489
537
  * @returns A trace of the program execution with gate counts.
490
538
  * @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
491
- */ profileTx(txRequest, profileMode, skipProofGeneration = true) {
539
+ */ profileTx(txRequest, { profileMode, skipProofGeneration = true, scopes }) {
492
540
  // We disable concurrent profiles for consistency with simulateTx.
493
541
  return this.#putInJobQueue(async (jobId)=>{
494
542
  const totalTimer = new Timer();
@@ -506,7 +554,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
506
554
  await this.blockStateSynchronizer.sync();
507
555
  const syncTime = syncTimer.ms();
508
556
  const contractFunctionSimulator = this.#getSimulatorForTx();
509
- const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
557
+ const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
510
558
  const { executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
511
559
  simulate: skipProofGeneration,
512
560
  skipFeeEnforcement: false,
@@ -551,18 +599,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
551
599
  * In that case, the transaction returned is only potentially ready to be sent to the network for execution.
552
600
  *
553
601
  *
554
- * @param txRequest - An authenticated tx request ready for simulation
555
- * @param simulatePublic - Whether to simulate the public part of the transaction.
556
- * @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
557
- * @param skipFeeEnforcement - (Optional) If false, fees are enforced.
558
- * @param overrides - (Optional) State overrides for the simulation, such as msgSender, contract instances and artifacts.
559
- * @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will default to all.
602
+ * @param txRequest - An authenticated tx request ready for simulation.
560
603
  * @returns A simulated transaction result object that includes public and private return values.
561
604
  * @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
562
605
  * Also throws if simulatePublic is true and public simulation reverts.
563
606
  *
564
607
  * TODO(#7456) Prevent msgSender being defined here for the first call
565
- */ simulateTx(txRequest, simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes) {
608
+ */ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, skipKernels = true, overrides, scopes }) {
566
609
  // We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
567
610
  // to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
568
611
  // delete the same read value, or reading values that another simulation is currently modifying).
@@ -581,17 +624,23 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
581
624
  const syncTimer = new Timer();
582
625
  await this.blockStateSynchronizer.sync();
583
626
  const syncTime = syncTimer.ms();
627
+ const overriddenContracts = overrides?.contracts ? new Set(Object.keys(overrides.contracts)) : undefined;
628
+ const hasOverriddenContracts = overriddenContracts !== undefined && overriddenContracts.size > 0;
629
+ if (hasOverriddenContracts && !skipKernels) {
630
+ throw new Error('Simulating with overridden contracts is not compatible with kernel execution. Please set skipKernels to true when simulating with overridden contracts.');
631
+ }
584
632
  const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
585
- // Temporary: in case there are overrides, we have to skip the kernels or validations
586
- // will fail. Consider handing control to the user/wallet on whether they want to run them
587
- // or not.
588
- const skipKernels = overrides?.contracts !== undefined && Object.keys(overrides.contracts ?? {}).length > 0;
633
+ if (hasOverriddenContracts) {
634
+ // Overridden contracts don't have a sync function, so calling sync on them would fail.
635
+ // We exclude them so the sync service skips them entirely.
636
+ this.contractSyncService.setExcludedFromSync(jobId, overriddenContracts);
637
+ }
589
638
  // Execution of private functions only; no proving, and no kernel logic.
590
639
  const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
591
640
  let publicInputs;
592
641
  let executionSteps = [];
593
642
  if (skipKernels) {
594
- ({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, this.contractStore));
643
+ ({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel), this.node));
595
644
  } else {
596
645
  // Kernel logic, plus proving of all private functions and kernels.
597
646
  ({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
@@ -608,6 +657,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
608
657
  const publicSimulationTimer = new Timer();
609
658
  publicOutput = await this.#simulatePublicCalls(simulatedTx, skipFeeEnforcement);
610
659
  publicSimulationTime = publicSimulationTimer.ms();
660
+ if (publicOutput?.debugLogs?.length) {
661
+ await displayDebugLogs(publicOutput.debugLogs, (addr)=>this.contractStore.getDebugContractName(addr));
662
+ }
611
663
  }
612
664
  let validationTime;
613
665
  if (!skipTxValidation) {
@@ -618,7 +670,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
618
670
  });
619
671
  validationTime = validationTimer.ms();
620
672
  if (validationResult.result === 'invalid') {
621
- throw new Error('The simulated transaction is unable to be added to state and is invalid.');
673
+ const reason = validationResult.reason.length > 0 ? ` Reason: ${validationResult.reason.join(', ')}` : '';
674
+ throw new Error(`The simulated transaction is unable to be added to state and is invalid.${reason}`);
622
675
  }
623
676
  }
624
677
  const txHash = simulatedTx.getTxHash();
@@ -651,22 +704,19 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
651
704
  nodeRPCCalls: simulatorStats.nodeRPCCalls
652
705
  });
653
706
  } catch (err) {
654
- throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes?.map((s)=>s.toString()).join(', ') ?? 'undefined'}`);
707
+ throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes.map((s)=>s.toString()).join(', ')}`);
655
708
  }
656
709
  });
657
710
  }
658
711
  /**
659
- * Simulate the execution of a contract utility function.
660
- *
712
+ * Executes a contract utility function.
661
713
  * @param call - The function call containing the function details, arguments, and target contract address.
662
- * @param authwits - (Optional) The authentication witnesses required for the function call.
663
- * @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will
664
- * default to all.
665
- * @returns The result of the utility function call, structured based on the function ABI.
666
- */ simulateUtility(call, authwits, scopes) {
667
- // We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
714
+ */ executeUtility(call, { authwits, scopes } = {
715
+ scopes: []
716
+ }) {
717
+ // We disable concurrent executions since those might execute oracles which read and write to the PXE stores (e.g.
668
718
  // to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
669
- // delete the same read value, or reading values that another simulation is currently modifying).
719
+ // delete the same read value, or reading values that another execution is currently modifying).
670
720
  return this.#putInJobQueue(async (jobId)=>{
671
721
  try {
672
722
  const totalTimer = new Timer();
@@ -676,8 +726,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
676
726
  const functionTimer = new Timer();
677
727
  const contractFunctionSimulator = this.#getSimulatorForTx();
678
728
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
679
- await ensureContractSynced(call.to, call.selector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), this.node, this.contractStore, anchorBlockHeader);
680
- const executionResult = await this.#simulateUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
729
+ await this.contractSyncService.ensureContractSynced(call.to, call.selector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
730
+ const { result: executionResult, offchainEffects } = await this.#executeUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
681
731
  const functionTime = functionTimer.ms();
682
732
  const totalTime = totalTimer.ms();
683
733
  const perFunction = [
@@ -695,6 +745,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
695
745
  const simulationStats = contractFunctionSimulator.getStats();
696
746
  return {
697
747
  result: executionResult,
748
+ offchainEffects,
749
+ anchorBlockTimestamp: anchorBlockHeader.globalVariables.timestamp,
698
750
  stats: {
699
751
  timings,
700
752
  nodeRPCCalls: simulationStats.nodeRPCCalls
@@ -703,7 +755,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
703
755
  } catch (err) {
704
756
  const { to, name, args } = call;
705
757
  const stringifiedArgs = args.map((arg)=>arg.toString()).join(', ');
706
- throw this.#contextualizeError(err, `simulateUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes?.map((s)=>s.toString()).join(', ') ?? 'undefined'}`);
758
+ throw this.#contextualizeError(err, `executeUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes.map((s)=>s.toString()).join(', ')}`);
707
759
  }
708
760
  });
709
761
  }
@@ -726,7 +778,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
726
778
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
727
779
  anchorBlockNumber = anchorBlockHeader.getBlockNumber();
728
780
  const contractFunctionSimulator = this.#getSimulatorForTx();
729
- await ensureContractSynced(filter.contractAddress, null, async (privateSyncCall)=>await this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), this.node, this.contractStore, anchorBlockHeader);
781
+ await this.contractSyncService.ensureContractSynced(filter.contractAddress, null, async (privateSyncCall, execScopes)=>await this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, filter.scopes);
730
782
  });
731
783
  // anchorBlockNumber is set during the job and fixed to whatever it is after a block sync
732
784
  const sanitizedFilter = new PrivateEventFilterValidator(anchorBlockNumber).validate(filter);
@@ -734,8 +786,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
734
786
  return this.privateEventStore.getPrivateEvents(eventSelector, sanitizedFilter);
735
787
  }
736
788
  /**
737
- * Stops the PXE's job queue.
738
- */ stop() {
739
- return this.jobQueue.end();
789
+ * Stops the PXE's job queue and closes the backing store.
790
+ */ async stop() {
791
+ await this.jobQueue.end();
792
+ await this.db.close();
740
793
  }
741
794
  }
@@ -8,4 +8,4 @@ export declare class AddressStore {
8
8
  getCompleteAddress(account: AztecAddress): Promise<CompleteAddress | undefined>;
9
9
  getCompleteAddresses(): Promise<CompleteAddress[]>;
10
10
  }
11
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzc19zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvYWRkcmVzc19zdG9yZS9hZGRyZXNzX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFtQixpQkFBaUIsRUFBaUIsTUFBTSxpQkFBaUIsQ0FBQztBQ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dBQUcsT0FBTyxDQUFDLGVBQWUsR0FBRyxTQUFTLENBQUMsQ0FVOUU7SUFFRCxvQkFBb0IsSUFBSSxPQUFPLENBQUMsZUFBZSxFQUFFLENBQUMsQ0FNakQ7Q0FDRiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"address_store.d.ts","sourceRoot":"","sources":["../../../src/storage/address_store/address_store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBAAa,YAAY;;IAKvB,YAAY,KAAK,EAAE,iBAAiB,EAKnC;IAED,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CA0BrE;IAYD,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAE9E;IAEK,oBAAoB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAIvD;CACF"}
1
+ {"version":3,"file":"address_store.d.ts","sourceRoot":"","sources":["../../../src/storage/address_store/address_store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBAAa,YAAY;;IAKvB,YAAY,KAAK,EAAE,iBAAiB,EAKnC;IAED,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CA0BrE;IAED,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAU9E;IAED,oBAAoB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAMjD;CACF"}
@@ -30,18 +30,19 @@ export class AddressStore {
30
30
  }
31
31
  });
32
32
  }
33
- async #getCompleteAddress(address) {
34
- const index = await this.#completeAddressIndex.getAsync(address.toString());
35
- if (index === undefined) {
36
- return undefined;
37
- }
38
- const value = await this.#completeAddresses.atAsync(index);
39
- return value ? await CompleteAddress.fromBuffer(value) : undefined;
40
- }
41
33
  getCompleteAddress(account) {
42
- return this.#getCompleteAddress(account);
34
+ return this.#store.transactionAsync(async ()=>{
35
+ const index = await this.#completeAddressIndex.getAsync(account.toString());
36
+ if (index === undefined) {
37
+ return undefined;
38
+ }
39
+ const value = await this.#completeAddresses.atAsync(index);
40
+ return value ? await CompleteAddress.fromBuffer(value) : undefined;
41
+ });
43
42
  }
44
- async getCompleteAddresses() {
45
- return await Promise.all((await toArray(this.#completeAddresses.valuesAsync())).map((v)=>CompleteAddress.fromBuffer(v)));
43
+ getCompleteAddresses() {
44
+ return this.#store.transactionAsync(async ()=>{
45
+ return await Promise.all((await toArray(this.#completeAddresses.valuesAsync())).map((v)=>CompleteAddress.fromBuffer(v)));
46
+ });
46
47
  }
47
48
  }
@@ -3,7 +3,15 @@ import { BlockHeader } from '@aztec/stdlib/tx';
3
3
  export declare class AnchorBlockStore {
4
4
  #private;
5
5
  constructor(store: AztecAsyncKVStore);
6
+ /**
7
+ * Sets the currently synchronized block
8
+ *
9
+ * Important: this method is only called from BlockSynchronizer, and since we need it to run atomically with other
10
+ * stores in the case of a reorg, it MUST NOT be wrapped in a `transactionAsync` call. Doing so would result in a
11
+ * deadlock when the backend is IndexedDB, because `transactionAsync` is not designed to support reentrancy.
12
+ *
13
+ */
6
14
  setHeader(header: BlockHeader): Promise<void>;
7
15
  getBlockHeader(): Promise<BlockHeader>;
8
16
  }
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5jaG9yX2Jsb2NrX3N0b3JlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIu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PM0M7Q0FDRiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"anchor_block_store.d.ts","sourceRoot":"","sources":["../../../src/storage/anchor_block_store/anchor_block_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,qBAAa,gBAAgB;;IAI3B,YAAY,KAAK,EAAE,iBAAiB,EAGnC;IAEK,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAElD;IAEK,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAO3C;CACF"}
1
+ {"version":3,"file":"anchor_block_store.d.ts","sourceRoot":"","sources":["../../../src/storage/anchor_block_store/anchor_block_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,qBAAa,gBAAgB;;IAI3B,YAAY,KAAK,EAAE,iBAAiB,EAGnC;IAED;;;;;;;OAOG;IACG,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAElD;IAEK,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAO3C;CACF"}
@@ -6,7 +6,14 @@ export class AnchorBlockStore {
6
6
  this.#store = store;
7
7
  this.#synchronizedHeader = this.#store.openSingleton('header');
8
8
  }
9
- async setHeader(header) {
9
+ /**
10
+ * Sets the currently synchronized block
11
+ *
12
+ * Important: this method is only called from BlockSynchronizer, and since we need it to run atomically with other
13
+ * stores in the case of a reorg, it MUST NOT be wrapped in a `transactionAsync` call. Doing so would result in a
14
+ * deadlock when the backend is IndexedDB, because `transactionAsync` is not designed to support reentrancy.
15
+ *
16
+ */ async setHeader(header) {
10
17
  await this.#synchronizedHeader.set(header.toBuffer());
11
18
  }
12
19
  async getBlockHeader() {
@@ -0,0 +1,21 @@
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
3
+ import type { Capsule } from '@aztec/stdlib/tx';
4
+ import type { CapsuleStore } from './capsule_store.js';
5
+ /**
6
+ * Wraps a CapsuleStore with scope-based access control. Each operation asserts that the requested scope is in the
7
+ * allowed scopes list before delegating to the underlying store.
8
+ */
9
+ export declare class CapsuleService {
10
+ private readonly capsuleStore;
11
+ private readonly allowedScopes;
12
+ constructor(capsuleStore: CapsuleStore, allowedScopes: AztecAddress[]);
13
+ setCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[], jobId: string, scope: AztecAddress): void;
14
+ getCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string, scope: AztecAddress, transientCapsules?: Capsule[]): Promise<Fr[] | null>;
15
+ deleteCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string, scope: AztecAddress): void;
16
+ copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number, jobId: string, scope: AztecAddress): Promise<void>;
17
+ appendToCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string, scope: AztecAddress): Promise<void>;
18
+ readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, jobId: string, scope: AztecAddress): Promise<Fr[][]>;
19
+ setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string, scope: AztecAddress): Promise<void>;
20
+ }
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fwc3VsZV9zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9jYXBzdWxlX3N0b3JlL2NhcHN1bGVfc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFF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