@aztec/pxe 0.0.1-commit.d6f2b3f94 → 0.0.1-commit.d939eb5aa

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 (236) hide show
  1. package/dest/bin/check_oracle_version.js +4 -4
  2. package/dest/block_synchronizer/block_synchronizer.d.ts +1 -1
  3. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  4. package/dest/block_synchronizer/block_synchronizer.js +6 -0
  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 +8 -15
  8. package/dest/config/package_info.js +1 -1
  9. package/dest/contract_function_simulator/contract_function_simulator.d.ts +62 -30
  10. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  11. package/dest/contract_function_simulator/contract_function_simulator.js +203 -72
  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 +61 -45
  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 +281 -96
  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 -80
  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 +108 -85
  44. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +115 -62
  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 +295 -128
  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 +7 -4
  57. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
  58. package/dest/contract_sync/contract_sync_service.js +69 -35
  59. package/dest/contract_sync/helpers.d.ts +2 -2
  60. package/dest/contract_sync/helpers.d.ts.map +1 -1
  61. package/dest/contract_sync/helpers.js +9 -4
  62. package/dest/debug/pxe_debug_utils.d.ts +4 -3
  63. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  64. package/dest/debug/pxe_debug_utils.js +4 -4
  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 +11 -3
  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 +2 -2
  75. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  76. package/dest/entrypoints/client/lazy/utils.js +11 -3
  77. package/dest/entrypoints/pxe_creation_options.d.ts +3 -1
  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 +3 -2
  81. package/dest/entrypoints/server/index.d.ts.map +1 -1
  82. package/dest/entrypoints/server/index.js +2 -1
  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 +11 -3
  86. package/dest/events/event_service.d.ts +3 -2
  87. package/dest/events/event_service.d.ts.map +1 -1
  88. package/dest/events/event_service.js +16 -4
  89. package/dest/events/private_event_filter_validator.d.ts +3 -2
  90. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  91. package/dest/events/private_event_filter_validator.js +15 -0
  92. package/dest/logs/log_service.d.ts +7 -7
  93. package/dest/logs/log_service.d.ts.map +1 -1
  94. package/dest/logs/log_service.js +33 -48
  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 +4 -4
  99. package/dest/notes/note_service.d.ts.map +1 -1
  100. package/dest/notes/note_service.js +17 -7
  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 +1 -1
  119. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  120. package/dest/private_kernel/private_kernel_execution_prover.js +18 -13
  121. package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
  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 +63 -24
  125. package/dest/pxe.d.ts.map +1 -1
  126. package/dest/pxe.js +110 -73
  127. package/dest/storage/capsule_store/capsule_service.d.ts +21 -0
  128. package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -0
  129. package/dest/storage/capsule_store/capsule_service.js +50 -0
  130. package/dest/storage/capsule_store/capsule_store.d.ts +9 -9
  131. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
  132. package/dest/storage/capsule_store/capsule_store.js +33 -28
  133. package/dest/storage/capsule_store/index.d.ts +2 -1
  134. package/dest/storage/capsule_store/index.d.ts.map +1 -1
  135. package/dest/storage/capsule_store/index.js +1 -0
  136. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  137. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  138. package/dest/storage/contract_store/contract_store.js +140 -64
  139. package/dest/storage/metadata.d.ts +1 -1
  140. package/dest/storage/metadata.js +1 -1
  141. package/dest/storage/note_store/note_store.d.ts +3 -3
  142. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  143. package/dest/storage/note_store/note_store.js +3 -4
  144. package/dest/storage/private_event_store/stored_private_event.js +1 -1
  145. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
  146. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  147. package/dest/storage/tagging_store/sender_tagging_store.d.ts +29 -28
  148. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  149. package/dest/storage/tagging_store/sender_tagging_store.js +141 -115
  150. package/dest/tagging/get_all_logs_by_tags.d.ts +1 -1
  151. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
  152. package/dest/tagging/get_all_logs_by_tags.js +17 -3
  153. package/dest/tagging/index.d.ts +3 -3
  154. package/dest/tagging/index.d.ts.map +1 -1
  155. package/dest/tagging/index.js +1 -1
  156. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -5
  157. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  158. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +7 -21
  159. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  160. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +6 -7
  161. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  162. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +12 -11
  163. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -8
  164. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  165. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +13 -7
  166. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +4 -3
  167. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  168. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +20 -10
  169. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -7
  170. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  171. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +36 -24
  172. package/package.json +16 -16
  173. package/src/bin/check_oracle_version.ts +4 -4
  174. package/src/block_synchronizer/block_synchronizer.ts +6 -0
  175. package/src/config/index.ts +3 -9
  176. package/src/config/package_info.ts +1 -1
  177. package/src/contract_function_simulator/contract_function_simulator.ts +362 -133
  178. package/src/contract_function_simulator/ephemeral_array_service.ts +110 -0
  179. package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -14
  180. package/src/contract_function_simulator/index.ts +1 -0
  181. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +9 -9
  182. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +1 -1
  183. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +2 -5
  184. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +4 -10
  185. package/src/contract_function_simulator/oracle/interfaces.ts +82 -54
  186. package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +104 -0
  187. package/src/contract_function_simulator/oracle/oracle.ts +363 -139
  188. package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
  189. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +132 -177
  190. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +506 -157
  191. package/src/contract_function_simulator/pick_notes.ts +9 -2
  192. package/src/contract_function_simulator/proxied_contract_data_source.ts +8 -1
  193. package/src/contract_logging.ts +52 -0
  194. package/src/contract_sync/contract_sync_service.ts +102 -55
  195. package/src/contract_sync/helpers.ts +8 -3
  196. package/src/debug/pxe_debug_utils.ts +10 -8
  197. package/src/entrypoints/client/bundle/index.ts +2 -0
  198. package/src/entrypoints/client/bundle/utils.ts +11 -4
  199. package/src/entrypoints/client/lazy/index.ts +2 -0
  200. package/src/entrypoints/client/lazy/utils.ts +11 -4
  201. package/src/entrypoints/pxe_creation_options.ts +7 -0
  202. package/src/entrypoints/server/index.ts +2 -1
  203. package/src/entrypoints/server/utils.ts +9 -10
  204. package/src/events/event_service.ts +17 -4
  205. package/src/events/private_event_filter_validator.ts +21 -1
  206. package/src/logs/log_service.ts +63 -91
  207. package/src/messages/message_context_service.ts +44 -0
  208. package/src/notes/note_service.ts +19 -8
  209. package/src/notes_filter.ts +24 -0
  210. package/src/oracle_version.ts +20 -10
  211. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  212. package/src/private_kernel/hints/index.ts +1 -1
  213. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +164 -117
  214. package/src/private_kernel/hints/test_utils.ts +325 -0
  215. package/src/private_kernel/private_kernel_execution_prover.ts +18 -16
  216. package/src/private_kernel/private_kernel_oracle.ts +7 -7
  217. package/src/pxe.ts +198 -117
  218. package/src/storage/capsule_store/capsule_service.ts +90 -0
  219. package/src/storage/capsule_store/capsule_store.ts +34 -26
  220. package/src/storage/capsule_store/index.ts +1 -0
  221. package/src/storage/contract_store/contract_store.ts +170 -71
  222. package/src/storage/metadata.ts +1 -1
  223. package/src/storage/note_store/note_store.ts +5 -5
  224. package/src/storage/private_event_store/stored_private_event.ts +1 -1
  225. package/src/storage/tagging_store/recipient_tagging_store.ts +9 -5
  226. package/src/storage/tagging_store/sender_tagging_store.ts +185 -138
  227. package/src/tagging/get_all_logs_by_tags.ts +28 -4
  228. package/src/tagging/index.ts +2 -2
  229. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +9 -24
  230. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  231. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +10 -15
  232. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +23 -10
  233. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +26 -11
  234. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +27 -26
  235. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  236. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
package/dest/pxe.js CHANGED
@@ -13,12 +13,14 @@ import { BlockSynchronizer } from './block_synchronizer/index.js';
13
13
  import { BenchmarkedNodeFactory } from './contract_function_simulator/benchmarked_node.js';
14
14
  import { ContractFunctionSimulator, generateSimulatedProvingResult } from './contract_function_simulator/contract_function_simulator.js';
15
15
  import { ProxiedContractStoreFactory } from './contract_function_simulator/proxied_contract_data_source.js';
16
+ import { displayDebugLogs } from './contract_logging.js';
16
17
  import { ContractSyncService } from './contract_sync/contract_sync_service.js';
17
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;
@@ -47,6 +50,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
47
50
  addressStore;
48
51
  privateEventStore;
49
52
  contractSyncService;
53
+ messageContextService;
54
+ l2TipsStore;
50
55
  simulator;
51
56
  proverEnabled;
52
57
  proofCreator;
@@ -55,8 +60,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
55
60
  jobQueue;
56
61
  jobCoordinator;
57
62
  debug;
58
- constructor(node, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
63
+ constructor(node, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, l2TipsStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
59
64
  this.node = node;
65
+ this.db = db;
60
66
  this.blockStateSynchronizer = blockStateSynchronizer;
61
67
  this.keyStore = keyStore;
62
68
  this.contractStore = contractStore;
@@ -69,6 +75,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
69
75
  this.addressStore = addressStore;
70
76
  this.privateEventStore = privateEventStore;
71
77
  this.contractSyncService = contractSyncService;
78
+ this.messageContextService = messageContextService;
79
+ this.l2TipsStore = l2TipsStore;
72
80
  this.simulator = simulator;
73
81
  this.proverEnabled = proverEnabled;
74
82
  this.proofCreator = proofCreator;
@@ -84,11 +92,12 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
84
92
  * can be contacted.
85
93
  *
86
94
  * @returns A promise that resolves PXE is ready to be used.
87
- */ static async create(node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix) {
95
+ */ static async create({ node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix }) {
88
96
  // Extract bindings from the logger, or use empty bindings if a string suffix is provided.
89
97
  const bindings = loggerOrSuffix && typeof loggerOrSuffix !== 'string' ? loggerOrSuffix.getBindings() : undefined;
90
98
  const log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:service:${loggerOrSuffix}` : `pxe:service`) : loggerOrSuffix;
91
- const proverEnabled = !!config.proverEnabled;
99
+ const info = await node.getNodeInfo();
100
+ const proverEnabled = config.proverEnabled !== undefined ? config.proverEnabled : info.realProofs;
92
101
  const addressStore = new AddressStore(store);
93
102
  const privateEventStore = new PrivateEventStore(store);
94
103
  const contractStore = new ContractStore(store);
@@ -101,6 +110,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
101
110
  const keyStore = new KeyStore(store);
102
111
  const tipsStore = new L2TipsKVStore(store, 'pxe');
103
112
  const contractSyncService = new ContractSyncService(node, contractStore, noteStore, createLogger('pxe:contract_sync', bindings));
113
+ const messageContextService = new MessageContextService(node);
104
114
  const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, contractSyncService, config, bindings);
105
115
  const jobCoordinator = new JobCoordinator(store, bindings);
106
116
  jobCoordinator.registerStores([
@@ -113,18 +123,32 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
113
123
  ]);
114
124
  const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
115
125
  const jobQueue = new SerialQueue();
116
- const pxe = new PXE(node, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
117
- debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#simulateUtility.bind(pxe));
126
+ const pxe = new PXE(node, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, tipsStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
127
+ debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#executeUtility.bind(pxe));
118
128
  pxe.jobQueue.start();
119
129
  await pxe.#registerProtocolContracts();
120
- const info = await node.getNodeInfo();
121
130
  log.info(`Started PXE connected to chain ${info.l1ChainId} version ${info.rollupVersion}`);
122
131
  return pxe;
123
132
  }
124
133
  // Internal methods
125
134
  #getSimulatorForTx(overrides) {
126
135
  const proxyContractStore = ProxiedContractStoreFactory.create(this.contractStore, overrides?.contracts);
127
- return new ContractFunctionSimulator(proxyContractStore, this.noteStore, this.keyStore, this.addressStore, BenchmarkedNodeFactory.create(this.node), this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.simulator, this.contractSyncService);
136
+ return new ContractFunctionSimulator({
137
+ contractStore: proxyContractStore,
138
+ noteStore: this.noteStore,
139
+ keyStore: this.keyStore,
140
+ addressStore: this.addressStore,
141
+ aztecNode: BenchmarkedNodeFactory.create(this.node),
142
+ l2TipsStore: this.l2TipsStore,
143
+ senderTaggingStore: this.senderTaggingStore,
144
+ recipientTaggingStore: this.recipientTaggingStore,
145
+ senderAddressBookStore: this.senderAddressBookStore,
146
+ capsuleStore: this.capsuleStore,
147
+ privateEventStore: this.privateEventStore,
148
+ simulator: this.simulator,
149
+ contractSyncService: this.contractSyncService,
150
+ messageContextService: this.messageContextService
151
+ });
128
152
  }
129
153
  #contextualizeError(err, ...context) {
130
154
  let contextStr = '';
@@ -167,8 +191,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
167
191
  async #registerProtocolContracts() {
168
192
  const registered = {};
169
193
  for (const name of protocolContractNames){
170
- const { address, contractClass, instance, artifact } = await this.protocolContractsProvider.getProtocolContractArtifact(name);
171
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
194
+ const { address, instance, artifact } = await this.protocolContractsProvider.getProtocolContractArtifact(name);
195
+ await this.contractStore.addContractArtifact(artifact);
172
196
  await this.contractStore.addContractInstance(instance);
173
197
  registered[name] = address.toString();
174
198
  }
@@ -180,10 +204,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
180
204
  const { origin: contractAddress, functionSelector } = txRequest;
181
205
  try {
182
206
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
183
- await this.contractSyncService.ensureContractSynced(contractAddress, functionSelector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), anchorBlockHeader, jobId);
184
- const result = await contractFunctionSimulator.run(txRequest, contractAddress, functionSelector, undefined, anchorBlockHeader, // The sender for tags is set by contracts, typically by an account
185
- // contract entrypoint
186
- undefined, scopes, jobId);
207
+ await this.contractSyncService.ensureContractSynced(contractAddress, functionSelector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
208
+ const result = await contractFunctionSimulator.run(txRequest, {
209
+ contractAddress,
210
+ selector: functionSelector,
211
+ anchorBlockHeader,
212
+ scopes,
213
+ jobId
214
+ });
187
215
  this.log.debug(`Private simulation completed for ${contractAddress.toString()}:${functionSelector}`);
188
216
  return result;
189
217
  } catch (err) {
@@ -194,18 +222,22 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
194
222
  }
195
223
  }
196
224
  /**
197
- * Simulate a utility function call on the given contract.
225
+ * Execute a utility function call on the given contract.
198
226
  * @param contractFunctionSimulator - The simulator to use for the function call.
199
227
  * @param call - The function call to execute.
200
228
  * @param authWitnesses - Authentication witnesses required for the function call.
201
229
  * @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
202
230
  * accounts if not specified.
203
231
  * @param jobId - The job ID for staged writes.
204
- * @returns The simulation result containing the outputs of the utility function.
205
- */ async #simulateUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
232
+ * @returns The execution result containing the outputs of the utility function.
233
+ */ async #executeUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
206
234
  try {
207
235
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
208
- return contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes, jobId);
236
+ const { result, offchainEffects } = await contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes, jobId);
237
+ return {
238
+ result,
239
+ offchainEffects
240
+ };
209
241
  } catch (err) {
210
242
  if (err instanceof SimulationError) {
211
243
  await enrichSimulationError(err, this.contractStore, this.log);
@@ -261,7 +293,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
261
293
  * Returns the block header up to which the PXE has synced.
262
294
  * @returns The synced block header
263
295
  */ getSyncedBlockHeader() {
264
- return this.anchorBlockStore.getBlockHeader();
296
+ return this.#putInJobQueue(()=>{
297
+ return this.anchorBlockStore.getBlockHeader();
298
+ });
265
299
  }
266
300
  /**
267
301
  * Returns the contract instance for a given address, if it's registered in the PXE.
@@ -309,6 +343,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
309
343
  * @returns The address of the sender.
310
344
  * TODO: It's strange that we return the address here and I (benesjan) think we should drop the return value.
311
345
  */ async registerSender(sender) {
346
+ if (!await sender.isValid()) {
347
+ throw new Error(`Address ${sender} is not valid: it does not correspond to a point on the Grumpkin curve. Cannot register it as a sender.`);
348
+ }
312
349
  const accounts = await this.keyStore.getAccounts();
313
350
  if (accounts.includes(sender)) {
314
351
  this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
@@ -317,6 +354,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
317
354
  const wasAdded = await this.senderAddressBookStore.addSender(sender);
318
355
  if (wasAdded) {
319
356
  this.log.info(`Added sender:\n ${sender.toString()}`);
357
+ // Wipe the entire sync cache: the new sender's tagged logs could contain notes/events for any contract, so
358
+ // all contracts must re-sync to discover them.
359
+ this.contractSyncService.wipe();
320
360
  } else {
321
361
  this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
322
362
  }
@@ -354,8 +394,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
354
394
  *
355
395
  * @param artifact - The build artifact for the contract class.
356
396
  */ async registerContractClass(artifact) {
357
- const { id: contractClassId } = await getContractClassFromArtifact(artifact);
358
- await this.contractStore.addContractArtifact(contractClassId, artifact);
397
+ const contractClassId = await this.contractStore.addContractArtifact(artifact);
359
398
  this.log.info(`Added contract class ${artifact.name} with id ${contractClassId}`);
360
399
  }
361
400
  /**
@@ -371,15 +410,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
371
410
  if (artifact) {
372
411
  // If the user provides an artifact, validate it against the expected class id and register it
373
412
  const contractClass = await getContractClassFromArtifact(artifact);
374
- const contractClassId = contractClass.id;
375
- if (!contractClassId.equals(instance.currentContractClassId)) {
376
- throw new Error(`Artifact does not match expected class id (computed ${contractClassId} but instance refers to ${instance.currentContractClassId})`);
413
+ if (!contractClass.id.equals(instance.currentContractClassId)) {
414
+ throw new Error(`Artifact does not match expected class id (computed ${contractClass.id} but instance refers to ${instance.currentContractClassId})`);
377
415
  }
378
416
  const computedAddress = await computeContractAddressFromInstance(instance);
379
417
  if (!computedAddress.equals(instance.address)) {
380
418
  throw new Error('Added a contract in which the address does not match the contract instance.');
381
419
  }
382
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
420
+ await this.contractStore.addContractArtifact(artifact, contractClass);
383
421
  const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
384
422
  await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
385
423
  } else {
@@ -415,11 +453,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
415
453
  if (!contractClass.id.equals(currentClassId)) {
416
454
  throw new Error('Could not update contract to a class different from the current one.');
417
455
  }
418
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
419
456
  const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
420
457
  await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
421
458
  currentInstance.currentContractClassId = contractClass.id;
422
- await this.contractStore.addContractInstance(currentInstance);
459
+ await Promise.all([
460
+ this.contractStore.addContractArtifact(artifact, contractClass),
461
+ this.contractStore.addContractInstance(currentInstance)
462
+ ]);
423
463
  this.log.info(`Updated contract ${artifact.name} at ${contractAddress.toString()} to class ${contractClass.id}`);
424
464
  });
425
465
  }
@@ -434,10 +474,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
434
474
  * (where validators prove the public portion).
435
475
  *
436
476
  * @param txRequest - An authenticated tx request ready for proving
477
+ * @param scopes - Addresses whose private state and keys are accessible during private execution.
437
478
  * @returns A result containing the proof and public inputs of the tail circuit.
438
479
  * @throws If contract code not found, or public simulation reverts.
439
480
  * Also throws if simulatePublic is true and public simulation reverts.
440
- */ proveTx(txRequest) {
481
+ */ proveTx(txRequest, scopes) {
441
482
  let privateExecutionResult;
442
483
  // We disable proving concurrently mostly out of caution, since it accesses some of our stores. Proving is so
443
484
  // computationally demanding that it'd be rare for someone to try to do it concurrently regardless.
@@ -448,7 +489,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
448
489
  await this.blockStateSynchronizer.sync();
449
490
  const syncTime = syncTimer.ms();
450
491
  const contractFunctionSimulator = this.#getSimulatorForTx();
451
- privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
492
+ privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
452
493
  const { publicInputs, chonkProof, executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
453
494
  simulate: false,
454
495
  skipFeeEnforcement: false,
@@ -479,16 +520,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
479
520
  // transaction before this one is included in a block from this PXE, and that transaction contains a log with
480
521
  // a tag derived from the same secret, we would reuse the tag and the transactions would be linked. Hence
481
522
  // storing the tags here prevents linkage of txs sent from the same PXE.
482
- const preTagsUsedInTheTx = privateExecutionResult.entrypoint.preTags;
483
- if (preTagsUsedInTheTx.length > 0) {
523
+ const taggingIndexRangesUsedInTheTx = privateExecutionResult.entrypoint.taggingIndexRanges;
524
+ if (taggingIndexRangesUsedInTheTx.length > 0) {
484
525
  // TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
485
526
  const txHash = (await txProvingResult.toTx()).txHash;
486
- await this.senderTaggingStore.storePendingIndexes(preTagsUsedInTheTx, txHash, jobId);
487
- this.log.debug(`Stored used pre-tags as sender for the tx`, {
488
- preTagsUsedInTheTx
527
+ await this.senderTaggingStore.storePendingIndexes(taggingIndexRangesUsedInTheTx, txHash, jobId);
528
+ this.log.debug(`Stored used tagging index ranges as sender for the tx`, {
529
+ taggingIndexRangesUsedInTheTx
489
530
  });
490
531
  } else {
491
- this.log.debug(`No pre-tags used in the tx`);
532
+ this.log.debug(`No tagging index ranges used in the tx`);
492
533
  }
493
534
  return txProvingResult;
494
535
  } catch (err) {
@@ -498,13 +539,10 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
498
539
  }
499
540
  /**
500
541
  * Profiles a transaction, reporting gate counts (unless disabled) and returns an execution trace.
501
- *
502
- * @param txRequest - An authenticated tx request ready for simulation
503
- * @param msgSender - (Optional) The message sender to use for the simulation.
504
- * @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
542
+ * @param txRequest - An authenticated tx request ready for simulation.
505
543
  * @returns A trace of the program execution with gate counts.
506
544
  * @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
507
- */ profileTx(txRequest, profileMode, skipProofGeneration = true) {
545
+ */ profileTx(txRequest, { profileMode, skipProofGeneration = true, scopes }) {
508
546
  // We disable concurrent profiles for consistency with simulateTx.
509
547
  return this.#putInJobQueue(async (jobId)=>{
510
548
  const totalTimer = new Timer();
@@ -522,7 +560,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
522
560
  await this.blockStateSynchronizer.sync();
523
561
  const syncTime = syncTimer.ms();
524
562
  const contractFunctionSimulator = this.#getSimulatorForTx();
525
- const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
563
+ const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
526
564
  const { executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
527
565
  simulate: skipProofGeneration,
528
566
  skipFeeEnforcement: false,
@@ -567,18 +605,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
567
605
  * In that case, the transaction returned is only potentially ready to be sent to the network for execution.
568
606
  *
569
607
  *
570
- * @param txRequest - An authenticated tx request ready for simulation
571
- * @param simulatePublic - Whether to simulate the public part of the transaction.
572
- * @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
573
- * @param skipFeeEnforcement - (Optional) If false, fees are enforced.
574
- * @param overrides - (Optional) State overrides for the simulation, such as msgSender, contract instances and artifacts.
575
- * @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will default to all.
608
+ * @param txRequest - An authenticated tx request ready for simulation.
576
609
  * @returns A simulated transaction result object that includes public and private return values.
577
610
  * @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
578
611
  * Also throws if simulatePublic is true and public simulation reverts.
579
612
  *
580
613
  * TODO(#7456) Prevent msgSender being defined here for the first call
581
- */ simulateTx(txRequest, simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes) {
614
+ */ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, skipKernels = true, overrides, scopes }) {
582
615
  // We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
583
616
  // to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
584
617
  // delete the same read value, or reading values that another simulation is currently modifying).
@@ -597,23 +630,23 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
597
630
  const syncTimer = new Timer();
598
631
  await this.blockStateSynchronizer.sync();
599
632
  const syncTime = syncTimer.ms();
600
- const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
601
- // Temporary: in case there are overrides, we have to skip the kernels or validations
602
- // will fail. Consider handing control to the user/wallet on whether they want to run them
603
- // or not.
604
633
  const overriddenContracts = overrides?.contracts ? new Set(Object.keys(overrides.contracts)) : undefined;
605
634
  const hasOverriddenContracts = overriddenContracts !== undefined && overriddenContracts.size > 0;
606
- const skipKernels = hasOverriddenContracts;
607
- // Set overridden contracts on the sync service so it knows to skip syncing them
635
+ if (hasOverriddenContracts && !skipKernels) {
636
+ throw new Error('Simulating with overridden contracts is not compatible with kernel execution. Please set skipKernels to true when simulating with overridden contracts.');
637
+ }
638
+ const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
608
639
  if (hasOverriddenContracts) {
609
- this.contractSyncService.setOverriddenContracts(jobId, overriddenContracts);
640
+ // Overridden contracts don't have a sync function, so calling sync on them would fail.
641
+ // We exclude them so the sync service skips them entirely.
642
+ this.contractSyncService.setExcludedFromSync(jobId, overriddenContracts);
610
643
  }
611
644
  // Execution of private functions only; no proving, and no kernel logic.
612
645
  const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
613
646
  let publicInputs;
614
647
  let executionSteps = [];
615
648
  if (skipKernels) {
616
- ({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel)));
649
+ ({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel), this.node));
617
650
  } else {
618
651
  // Kernel logic, plus proving of all private functions and kernels.
619
652
  ({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
@@ -630,6 +663,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
630
663
  const publicSimulationTimer = new Timer();
631
664
  publicOutput = await this.#simulatePublicCalls(simulatedTx, skipFeeEnforcement);
632
665
  publicSimulationTime = publicSimulationTimer.ms();
666
+ if (publicOutput?.debugLogs?.length) {
667
+ await displayDebugLogs(publicOutput.debugLogs, (addr)=>this.contractStore.getDebugContractName(addr));
668
+ }
633
669
  }
634
670
  let validationTime;
635
671
  if (!skipTxValidation) {
@@ -640,7 +676,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
640
676
  });
641
677
  validationTime = validationTimer.ms();
642
678
  if (validationResult.result === 'invalid') {
643
- throw new Error('The simulated transaction is unable to be added to state and is invalid.');
679
+ const reason = validationResult.reason.length > 0 ? ` Reason: ${validationResult.reason.join(', ')}` : '';
680
+ throw new Error(`The simulated transaction is unable to be added to state and is invalid.${reason}`);
644
681
  }
645
682
  }
646
683
  const txHash = simulatedTx.getTxHash();
@@ -673,22 +710,19 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
673
710
  nodeRPCCalls: simulatorStats.nodeRPCCalls
674
711
  });
675
712
  } catch (err) {
676
- throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes?.map((s)=>s.toString()).join(', ') ?? 'undefined'}`);
713
+ throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes.map((s)=>s.toString()).join(', ')}`);
677
714
  }
678
715
  });
679
716
  }
680
717
  /**
681
- * Simulate the execution of a contract utility function.
682
- *
718
+ * Executes a contract utility function.
683
719
  * @param call - The function call containing the function details, arguments, and target contract address.
684
- * @param authwits - (Optional) The authentication witnesses required for the function call.
685
- * @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will
686
- * default to all.
687
- * @returns The result of the utility function call, structured based on the function ABI.
688
- */ simulateUtility(call, authwits, scopes) {
689
- // We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
720
+ */ executeUtility(call, { authwits, scopes } = {
721
+ scopes: []
722
+ }) {
723
+ // We disable concurrent executions since those might execute oracles which read and write to the PXE stores (e.g.
690
724
  // to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
691
- // delete the same read value, or reading values that another simulation is currently modifying).
725
+ // delete the same read value, or reading values that another execution is currently modifying).
692
726
  return this.#putInJobQueue(async (jobId)=>{
693
727
  try {
694
728
  const totalTimer = new Timer();
@@ -698,8 +732,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
698
732
  const functionTimer = new Timer();
699
733
  const contractFunctionSimulator = this.#getSimulatorForTx();
700
734
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
701
- await this.contractSyncService.ensureContractSynced(call.to, call.selector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), anchorBlockHeader, jobId);
702
- const executionResult = await this.#simulateUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
735
+ await this.contractSyncService.ensureContractSynced(call.to, call.selector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
736
+ const { result: executionResult, offchainEffects } = await this.#executeUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
703
737
  const functionTime = functionTimer.ms();
704
738
  const totalTime = totalTimer.ms();
705
739
  const perFunction = [
@@ -717,6 +751,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
717
751
  const simulationStats = contractFunctionSimulator.getStats();
718
752
  return {
719
753
  result: executionResult,
754
+ offchainEffects,
755
+ anchorBlockTimestamp: anchorBlockHeader.globalVariables.timestamp,
720
756
  stats: {
721
757
  timings,
722
758
  nodeRPCCalls: simulationStats.nodeRPCCalls
@@ -725,7 +761,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
725
761
  } catch (err) {
726
762
  const { to, name, args } = call;
727
763
  const stringifiedArgs = args.map((arg)=>arg.toString()).join(', ');
728
- throw this.#contextualizeError(err, `simulateUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes?.map((s)=>s.toString()).join(', ') ?? 'undefined'}`);
764
+ throw this.#contextualizeError(err, `executeUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes.map((s)=>s.toString()).join(', ')}`);
729
765
  }
730
766
  });
731
767
  }
@@ -748,7 +784,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
748
784
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
749
785
  anchorBlockNumber = anchorBlockHeader.getBlockNumber();
750
786
  const contractFunctionSimulator = this.#getSimulatorForTx();
751
- await this.contractSyncService.ensureContractSynced(filter.contractAddress, null, async (privateSyncCall)=>await this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), anchorBlockHeader, jobId);
787
+ await this.contractSyncService.ensureContractSynced(filter.contractAddress, null, async (privateSyncCall, execScopes)=>await this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, filter.scopes);
752
788
  });
753
789
  // anchorBlockNumber is set during the job and fixed to whatever it is after a block sync
754
790
  const sanitizedFilter = new PrivateEventFilterValidator(anchorBlockNumber).validate(filter);
@@ -756,8 +792,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
756
792
  return this.privateEventStore.getPrivateEvents(eventSelector, sanitizedFilter);
757
793
  }
758
794
  /**
759
- * Stops the PXE's job queue.
760
- */ stop() {
761
- return this.jobQueue.end();
795
+ * Stops the PXE's job queue and closes the backing store.
796
+ */ async stop() {
797
+ await this.jobQueue.end();
798
+ await this.db.close();
762
799
  }
763
800
  }
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fwc3VsZV9zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9jYXBzdWxlX3N0b3JlL2NhcHN1bGVfc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDM0QsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFaEQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFdkQ7OztHQUdHO0FBQ0gscUJBQWEsY0FBYztJQUV2QixPQUFPLENBQUMsUUFBUSxDQUFDLFlBQVk7SUFDN0IsT0FBTyxDQUFDLFFBQVEsQ0FBQyxhQUFhO0lBRmhDLFlBQ21CLFlBQVksRUFBRSxZQUFZLEVBQzFCLGFBQWEsRUFBRSxZQUFZLEVBQUUsRUFDNUM7SUFFSixVQUFVLENBQUMsZUFBZSxFQUFFLFlBQVksRUFBRSxJQUFJLEVBQUUsRUFBRSxFQUFFLE9BQU8sRUFBRSxFQUFFLEVBQUUsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxZQUFZLFFBR3BHO0lBRUssVUFBVSxDQUNkLGVBQWUsRUFBRSxZQUFZLEVBQzdCLElBQUksRUFBRSxFQUFFLEVBQ1IsS0FBSy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EAAE,EAAE,EACZ,OAAO,EAAE,EAAE,EAAE,EAAE,EACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAGf;IAED,gBAAgB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAGjH;IAED,eAAe,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,iBAG/G;CACF"}
@@ -0,0 +1,50 @@
1
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+ /**
3
+ * Wraps a CapsuleStore with scope-based access control. Each operation asserts that the requested scope is in the
4
+ * allowed scopes list before delegating to the underlying store.
5
+ */ export class CapsuleService {
6
+ capsuleStore;
7
+ allowedScopes;
8
+ constructor(capsuleStore, allowedScopes){
9
+ this.capsuleStore = capsuleStore;
10
+ this.allowedScopes = allowedScopes;
11
+ }
12
+ setCapsule(contractAddress, slot, capsule, jobId, scope) {
13
+ assertAllowedScope(scope, this.allowedScopes);
14
+ this.capsuleStore.setCapsule(contractAddress, slot, capsule, jobId, scope);
15
+ }
16
+ async getCapsule(contractAddress, slot, jobId, scope, transientCapsules) {
17
+ assertAllowedScope(scope, this.allowedScopes);
18
+ // TODO(#12425): On the following line, the pertinent capsule gets overshadowed by the transient one. Tackle this.
19
+ const maybeTransientCapsule = transientCapsules?.find((c)=>c.contractAddress.equals(contractAddress) && c.storageSlot.equals(slot) && (c.scope ?? AztecAddress.ZERO).equals(scope))?.data;
20
+ return maybeTransientCapsule ?? await this.capsuleStore.getCapsule(contractAddress, slot, jobId, scope);
21
+ }
22
+ deleteCapsule(contractAddress, slot, jobId, scope) {
23
+ assertAllowedScope(scope, this.allowedScopes);
24
+ this.capsuleStore.deleteCapsule(contractAddress, slot, jobId, scope);
25
+ }
26
+ copyCapsule(contractAddress, srcSlot, dstSlot, numEntries, jobId, scope) {
27
+ assertAllowedScope(scope, this.allowedScopes);
28
+ return this.capsuleStore.copyCapsule(contractAddress, srcSlot, dstSlot, numEntries, jobId, scope);
29
+ }
30
+ appendToCapsuleArray(contractAddress, baseSlot, content, jobId, scope) {
31
+ assertAllowedScope(scope, this.allowedScopes);
32
+ return this.capsuleStore.appendToCapsuleArray(contractAddress, baseSlot, content, jobId, scope);
33
+ }
34
+ readCapsuleArray(contractAddress, baseSlot, jobId, scope) {
35
+ assertAllowedScope(scope, this.allowedScopes);
36
+ return this.capsuleStore.readCapsuleArray(contractAddress, baseSlot, jobId, scope);
37
+ }
38
+ setCapsuleArray(contractAddress, baseSlot, content, jobId, scope) {
39
+ assertAllowedScope(scope, this.allowedScopes);
40
+ return this.capsuleStore.setCapsuleArray(contractAddress, baseSlot, content, jobId, scope);
41
+ }
42
+ }
43
+ function assertAllowedScope(scope, allowedScopes) {
44
+ if (scope.equals(AztecAddress.ZERO)) {
45
+ return;
46
+ }
47
+ if (!allowedScopes.some((allowed)=>allowed.equals(scope))) {
48
+ throw new Error(`Scope ${scope.toString()} is not in the allowed scopes list: [${allowedScopes.map((s)=>s.toString()).join(', ')}]. See https://docs.aztec.network/errors/10`);
49
+ }
50
+ }
@@ -1,7 +1,7 @@
1
1
  import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { type Logger } from '@aztec/foundation/log';
3
3
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
5
  import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
6
6
  export declare class CapsuleStore implements StagedStore {
7
7
  #private;
@@ -31,20 +31,20 @@ export declare class CapsuleStore implements StagedStore {
31
31
  * to public contract storage in that it's indexed by the contract address and storage slot but instead of the global
32
32
  * network state it's backed by local PXE db.
33
33
  */
34
- storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[], jobId: string): void;
34
+ setCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[], jobId: string, scope: AztecAddress): void;
35
35
  /**
36
36
  * Returns data previously stored via `storeCapsule` in the per-contract non-volatile database.
37
37
  * @param contractAddress - The contract address under which the data is scoped.
38
38
  * @param slot - The slot in the database to read.
39
39
  * @returns The stored data or `null` if no data is stored under the slot.
40
40
  */
41
- loadCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string): Promise<Fr[] | null>;
41
+ getCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string, scope: AztecAddress): Promise<Fr[] | null>;
42
42
  /**
43
43
  * Deletes data in the per-contract non-volatile database. Does nothing if no data was present.
44
44
  * @param contractAddress - The contract address under which the data is scoped.
45
45
  * @param slot - The slot in the database to delete.
46
46
  */
47
- deleteCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string): void;
47
+ deleteCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string, scope: AztecAddress): void;
48
48
  /**
49
49
  * Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data
50
50
  * structures by avoiding repeated calls to `loadCapsule` and `storeCapsule`.
@@ -56,7 +56,7 @@ export declare class CapsuleStore implements StagedStore {
56
56
  * @param dstSlot - The first slot to copy to.
57
57
  * @param numEntries - The number of entries to copy.
58
58
  */
59
- copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number, jobId: string): Promise<void>;
59
+ copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number, jobId: string, scope: AztecAddress): Promise<void>;
60
60
  /**
61
61
  * Appends multiple capsules to a capsule array stored at the base slot.
62
62
  * The array length is stored at the base slot, and elements are stored in consecutive slots after it.
@@ -65,8 +65,8 @@ export declare class CapsuleStore implements StagedStore {
65
65
  * @param baseSlot - The slot where the array length is stored
66
66
  * @param content - Array of capsule data to append
67
67
  */
68
- appendToCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string): Promise<void>;
69
- readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, jobId: string): Promise<Fr[][]>;
70
- setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string): Promise<void>;
68
+ appendToCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string, scope: AztecAddress): Promise<void>;
69
+ readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, jobId: string, scope: AztecAddress): Promise<Fr[][]>;
70
+ setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string, scope: AztecAddress): Promise<void>;
71
71
  }
72
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fwc3VsZV9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvY2Fwc3VsZV9zdG9yZS9jYXBzdWxlX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0sdUJBQXVCLENBQUM7QUFDbEUsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFDeEUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFFaEUsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sMENBQTBDLENBQUM7QUFFNUUscUJBQWEsWUFBYSxZQUFXLFdBQVc7O0lBQzlDLFFBQVEsQ0FBQyxTQUFTLGFBQWE7SUFZL0IsTUFBTSxFQUFFLE1BQU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