@aztec/pxe 0.0.1-commit.e558bd1c → 0.0.1-commit.e588bc7e5

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 (206) hide show
  1. package/dest/block_synchronizer/block_synchronizer.d.ts +1 -1
  2. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  3. package/dest/block_synchronizer/block_synchronizer.js +6 -0
  4. package/dest/config/index.d.ts +2 -2
  5. package/dest/config/index.d.ts.map +1 -1
  6. package/dest/config/index.js +1 -1
  7. package/dest/config/package_info.js +1 -1
  8. package/dest/contract_function_simulator/contract_function_simulator.d.ts +59 -30
  9. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  10. package/dest/contract_function_simulator/contract_function_simulator.js +200 -73
  11. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +7 -7
  12. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  13. package/dest/contract_function_simulator/execution_tagging_index_cache.js +19 -11
  14. package/dest/contract_function_simulator/index.d.ts +2 -1
  15. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  16. package/dest/contract_function_simulator/index.js +1 -0
  17. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +3 -5
  18. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  19. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +7 -9
  20. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +1 -1
  21. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  22. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -3
  23. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +3 -6
  24. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  25. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +5 -10
  26. package/dest/contract_function_simulator/oracle/interfaces.d.ts +50 -45
  27. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +9 -0
  29. package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -0
  30. package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +38 -0
  31. package/dest/contract_function_simulator/oracle/oracle.d.ts +64 -44
  32. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  33. package/dest/contract_function_simulator/oracle/oracle.js +188 -98
  34. package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
  35. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +53 -80
  36. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  37. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +107 -85
  38. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +90 -51
  39. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  40. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +220 -111
  41. package/dest/contract_logging.d.ts +27 -0
  42. package/dest/contract_logging.d.ts.map +1 -0
  43. package/dest/contract_logging.js +38 -0
  44. package/dest/contract_sync/contract_sync_service.d.ts +7 -4
  45. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
  46. package/dest/contract_sync/contract_sync_service.js +51 -29
  47. package/dest/contract_sync/helpers.d.ts +2 -2
  48. package/dest/contract_sync/helpers.d.ts.map +1 -1
  49. package/dest/contract_sync/helpers.js +9 -4
  50. package/dest/debug/pxe_debug_utils.d.ts +5 -6
  51. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  52. package/dest/debug/pxe_debug_utils.js +4 -7
  53. package/dest/entrypoints/client/bundle/index.d.ts +3 -1
  54. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  55. package/dest/entrypoints/client/bundle/index.js +2 -0
  56. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  57. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  58. package/dest/entrypoints/client/bundle/utils.js +9 -1
  59. package/dest/entrypoints/client/lazy/index.d.ts +3 -1
  60. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  61. package/dest/entrypoints/client/lazy/index.js +2 -0
  62. package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
  63. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  64. package/dest/entrypoints/client/lazy/utils.js +9 -1
  65. package/dest/entrypoints/server/index.d.ts +2 -1
  66. package/dest/entrypoints/server/index.d.ts.map +1 -1
  67. package/dest/entrypoints/server/index.js +1 -0
  68. package/dest/entrypoints/server/utils.js +9 -1
  69. package/dest/events/event_service.d.ts +3 -2
  70. package/dest/events/event_service.d.ts.map +1 -1
  71. package/dest/events/event_service.js +16 -4
  72. package/dest/logs/log_service.d.ts +6 -6
  73. package/dest/logs/log_service.d.ts.map +1 -1
  74. package/dest/logs/log_service.js +38 -41
  75. package/dest/messages/message_context_service.d.ts +17 -0
  76. package/dest/messages/message_context_service.d.ts.map +1 -0
  77. package/dest/messages/message_context_service.js +36 -0
  78. package/dest/notes/note_service.d.ts +4 -4
  79. package/dest/notes/note_service.d.ts.map +1 -1
  80. package/dest/notes/note_service.js +17 -7
  81. package/dest/notes_filter.d.ts +24 -0
  82. package/dest/notes_filter.d.ts.map +1 -0
  83. package/dest/notes_filter.js +4 -0
  84. package/dest/oracle_version.d.ts +2 -2
  85. package/dest/oracle_version.js +3 -3
  86. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  87. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  88. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  89. package/dest/private_kernel/hints/index.d.ts +1 -1
  90. package/dest/private_kernel/hints/index.js +1 -1
  91. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +4 -3
  92. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
  93. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +129 -68
  94. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  95. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  96. package/dest/private_kernel/hints/test_utils.js +203 -0
  97. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  98. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  99. package/dest/private_kernel/private_kernel_execution_prover.js +19 -11
  100. package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
  101. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  102. package/dest/private_kernel/private_kernel_oracle.js +7 -3
  103. package/dest/pxe.d.ts +72 -24
  104. package/dest/pxe.d.ts.map +1 -1
  105. package/dest/pxe.js +114 -73
  106. package/dest/storage/capsule_store/capsule_service.d.ts +21 -0
  107. package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -0
  108. package/dest/storage/capsule_store/capsule_service.js +50 -0
  109. package/dest/storage/capsule_store/capsule_store.d.ts +9 -9
  110. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
  111. package/dest/storage/capsule_store/capsule_store.js +33 -28
  112. package/dest/storage/capsule_store/index.d.ts +2 -1
  113. package/dest/storage/capsule_store/index.d.ts.map +1 -1
  114. package/dest/storage/capsule_store/index.js +1 -0
  115. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  116. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  117. package/dest/storage/contract_store/contract_store.js +145 -69
  118. package/dest/storage/metadata.d.ts +1 -1
  119. package/dest/storage/metadata.js +1 -1
  120. package/dest/storage/note_store/note_store.d.ts +3 -3
  121. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  122. package/dest/storage/note_store/note_store.js +3 -4
  123. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
  124. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  125. package/dest/storage/tagging_store/sender_tagging_store.d.ts +29 -28
  126. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  127. package/dest/storage/tagging_store/sender_tagging_store.js +141 -115
  128. package/dest/tagging/get_all_logs_by_tags.d.ts +1 -1
  129. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
  130. package/dest/tagging/get_all_logs_by_tags.js +17 -3
  131. package/dest/tagging/index.d.ts +3 -3
  132. package/dest/tagging/index.d.ts.map +1 -1
  133. package/dest/tagging/index.js +1 -1
  134. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -5
  135. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  136. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +7 -7
  137. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  138. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +6 -7
  139. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  140. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +12 -11
  141. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -8
  142. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  143. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +13 -7
  144. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +4 -3
  145. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  146. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +20 -10
  147. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -7
  148. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  149. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +36 -24
  150. package/package.json +16 -16
  151. package/src/block_synchronizer/block_synchronizer.ts +6 -0
  152. package/src/config/index.ts +1 -1
  153. package/src/config/package_info.ts +1 -1
  154. package/src/contract_function_simulator/contract_function_simulator.ts +359 -135
  155. package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -14
  156. package/src/contract_function_simulator/index.ts +1 -0
  157. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +8 -8
  158. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -4
  159. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +3 -9
  160. package/src/contract_function_simulator/oracle/interfaces.ts +63 -54
  161. package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +98 -0
  162. package/src/contract_function_simulator/oracle/oracle.ts +224 -140
  163. package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
  164. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +131 -177
  165. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +383 -127
  166. package/src/contract_logging.ts +52 -0
  167. package/src/contract_sync/contract_sync_service.ts +86 -45
  168. package/src/contract_sync/helpers.ts +8 -3
  169. package/src/debug/pxe_debug_utils.ts +11 -14
  170. package/src/entrypoints/client/bundle/index.ts +2 -0
  171. package/src/entrypoints/client/bundle/utils.ts +9 -1
  172. package/src/entrypoints/client/lazy/index.ts +2 -0
  173. package/src/entrypoints/client/lazy/utils.ts +9 -1
  174. package/src/entrypoints/server/index.ts +1 -0
  175. package/src/entrypoints/server/utils.ts +7 -7
  176. package/src/events/event_service.ts +17 -4
  177. package/src/logs/log_service.ts +72 -64
  178. package/src/messages/message_context_service.ts +44 -0
  179. package/src/notes/note_service.ts +19 -8
  180. package/src/notes_filter.ts +24 -0
  181. package/src/oracle_version.ts +3 -3
  182. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  183. package/src/private_kernel/hints/index.ts +1 -1
  184. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +164 -117
  185. package/src/private_kernel/hints/test_utils.ts +325 -0
  186. package/src/private_kernel/private_kernel_execution_prover.ts +19 -12
  187. package/src/private_kernel/private_kernel_oracle.ts +7 -7
  188. package/src/pxe.ts +202 -117
  189. package/src/storage/capsule_store/capsule_service.ts +90 -0
  190. package/src/storage/capsule_store/capsule_store.ts +34 -26
  191. package/src/storage/capsule_store/index.ts +1 -0
  192. package/src/storage/contract_store/contract_store.ts +174 -75
  193. package/src/storage/metadata.ts +1 -1
  194. package/src/storage/note_store/note_store.ts +5 -5
  195. package/src/storage/tagging_store/recipient_tagging_store.ts +9 -5
  196. package/src/storage/tagging_store/sender_tagging_store.ts +185 -138
  197. package/src/tagging/get_all_logs_by_tags.ts +28 -4
  198. package/src/tagging/index.ts +2 -2
  199. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +7 -10
  200. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  201. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +10 -15
  202. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +23 -10
  203. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +26 -11
  204. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +27 -26
  205. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  206. 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,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
47
50
  addressStore;
48
51
  privateEventStore;
49
52
  contractSyncService;
53
+ messageContextService;
50
54
  simulator;
51
55
  proverEnabled;
52
56
  proofCreator;
@@ -55,8 +59,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
55
59
  jobQueue;
56
60
  jobCoordinator;
57
61
  debug;
58
- constructor(node, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, 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){
59
63
  this.node = node;
64
+ this.db = db;
60
65
  this.blockStateSynchronizer = blockStateSynchronizer;
61
66
  this.keyStore = keyStore;
62
67
  this.contractStore = contractStore;
@@ -69,6 +74,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
69
74
  this.addressStore = addressStore;
70
75
  this.privateEventStore = privateEventStore;
71
76
  this.contractSyncService = contractSyncService;
77
+ this.messageContextService = messageContextService;
72
78
  this.simulator = simulator;
73
79
  this.proverEnabled = proverEnabled;
74
80
  this.proofCreator = proofCreator;
@@ -84,11 +90,12 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
84
90
  * can be contacted.
85
91
  *
86
92
  * @returns A promise that resolves PXE is ready to be used.
87
- */ static async create(node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix) {
93
+ */ static async create({ node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix }) {
88
94
  // Extract bindings from the logger, or use empty bindings if a string suffix is provided.
89
95
  const bindings = loggerOrSuffix && typeof loggerOrSuffix !== 'string' ? loggerOrSuffix.getBindings() : undefined;
90
96
  const log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:service:${loggerOrSuffix}` : `pxe:service`) : loggerOrSuffix;
91
- const proverEnabled = !!config.proverEnabled;
97
+ const info = await node.getNodeInfo();
98
+ const proverEnabled = config.proverEnabled !== undefined ? config.proverEnabled : info.realProofs;
92
99
  const addressStore = new AddressStore(store);
93
100
  const privateEventStore = new PrivateEventStore(store);
94
101
  const contractStore = new ContractStore(store);
@@ -101,6 +108,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
101
108
  const keyStore = new KeyStore(store);
102
109
  const tipsStore = new L2TipsKVStore(store, 'pxe');
103
110
  const contractSyncService = new ContractSyncService(node, contractStore, noteStore, createLogger('pxe:contract_sync', bindings));
111
+ const messageContextService = new MessageContextService(node);
104
112
  const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, contractSyncService, config, bindings);
105
113
  const jobCoordinator = new JobCoordinator(store, bindings);
106
114
  jobCoordinator.registerStores([
@@ -113,18 +121,31 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
113
121
  ]);
114
122
  const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
115
123
  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));
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));
118
126
  pxe.jobQueue.start();
119
127
  await pxe.#registerProtocolContracts();
120
- const info = await node.getNodeInfo();
121
128
  log.info(`Started PXE connected to chain ${info.l1ChainId} version ${info.rollupVersion}`);
122
129
  return pxe;
123
130
  }
124
131
  // Internal methods
125
132
  #getSimulatorForTx(overrides) {
126
133
  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);
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
+ });
128
149
  }
129
150
  #contextualizeError(err, ...context) {
130
151
  let contextStr = '';
@@ -167,8 +188,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
167
188
  async #registerProtocolContracts() {
168
189
  const registered = {};
169
190
  for (const name of protocolContractNames){
170
- const { address, contractClass, instance, artifact } = await this.protocolContractsProvider.getProtocolContractArtifact(name);
171
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
191
+ const { address, instance, artifact } = await this.protocolContractsProvider.getProtocolContractArtifact(name);
192
+ await this.contractStore.addContractArtifact(artifact);
172
193
  await this.contractStore.addContractInstance(instance);
173
194
  registered[name] = address.toString();
174
195
  }
@@ -180,10 +201,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
180
201
  const { origin: contractAddress, functionSelector } = txRequest;
181
202
  try {
182
203
  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);
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
+ });
187
212
  this.log.debug(`Private simulation completed for ${contractAddress.toString()}:${functionSelector}`);
188
213
  return result;
189
214
  } catch (err) {
@@ -194,18 +219,22 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
194
219
  }
195
220
  }
196
221
  /**
197
- * Simulate a utility function call on the given contract.
222
+ * Execute a utility function call on the given contract.
198
223
  * @param contractFunctionSimulator - The simulator to use for the function call.
199
224
  * @param call - The function call to execute.
200
225
  * @param authWitnesses - Authentication witnesses required for the function call.
201
226
  * @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
202
227
  * accounts if not specified.
203
228
  * @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) {
229
+ * @returns The execution result containing the outputs of the utility function.
230
+ */ async #executeUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
206
231
  try {
207
232
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
208
- 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
+ };
209
238
  } catch (err) {
210
239
  if (err instanceof SimulationError) {
211
240
  await enrichSimulationError(err, this.contractStore, this.log);
@@ -257,7 +286,19 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
257
286
  return await kernelTraceProver.proveWithKernels(txExecutionRequest.toTxRequest(), privateExecutionResult, config);
258
287
  }
259
288
  // Public API
260
- 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) {
261
302
  return this.contractStore.getContractInstance(address);
262
303
  }
263
304
  /**
@@ -307,6 +348,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
307
348
  const wasAdded = await this.senderAddressBookStore.addSender(sender);
308
349
  if (wasAdded) {
309
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();
310
354
  } else {
311
355
  this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
312
356
  }
@@ -344,8 +388,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
344
388
  *
345
389
  * @param artifact - The build artifact for the contract class.
346
390
  */ async registerContractClass(artifact) {
347
- const { id: contractClassId } = await getContractClassFromArtifact(artifact);
348
- await this.contractStore.addContractArtifact(contractClassId, artifact);
391
+ const contractClassId = await this.contractStore.addContractArtifact(artifact);
349
392
  this.log.info(`Added contract class ${artifact.name} with id ${contractClassId}`);
350
393
  }
351
394
  /**
@@ -361,15 +404,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
361
404
  if (artifact) {
362
405
  // If the user provides an artifact, validate it against the expected class id and register it
363
406
  const contractClass = await getContractClassFromArtifact(artifact);
364
- const contractClassId = contractClass.id;
365
- if (!contractClassId.equals(instance.currentContractClassId)) {
366
- 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})`);
367
409
  }
368
410
  const computedAddress = await computeContractAddressFromInstance(instance);
369
411
  if (!computedAddress.equals(instance.address)) {
370
412
  throw new Error('Added a contract in which the address does not match the contract instance.');
371
413
  }
372
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
414
+ await this.contractStore.addContractArtifact(artifact, contractClass);
373
415
  const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
374
416
  await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
375
417
  } else {
@@ -405,11 +447,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
405
447
  if (!contractClass.id.equals(currentClassId)) {
406
448
  throw new Error('Could not update contract to a class different from the current one.');
407
449
  }
408
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
409
450
  const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
410
451
  await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
411
452
  currentInstance.currentContractClassId = contractClass.id;
412
- await this.contractStore.addContractInstance(currentInstance);
453
+ await Promise.all([
454
+ this.contractStore.addContractArtifact(artifact, contractClass),
455
+ this.contractStore.addContractInstance(currentInstance)
456
+ ]);
413
457
  this.log.info(`Updated contract ${artifact.name} at ${contractAddress.toString()} to class ${contractClass.id}`);
414
458
  });
415
459
  }
@@ -424,10 +468,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
424
468
  * (where validators prove the public portion).
425
469
  *
426
470
  * @param txRequest - An authenticated tx request ready for proving
471
+ * @param scopes - Addresses whose private state and keys are accessible during private execution.
427
472
  * @returns A result containing the proof and public inputs of the tail circuit.
428
473
  * @throws If contract code not found, or public simulation reverts.
429
474
  * Also throws if simulatePublic is true and public simulation reverts.
430
- */ proveTx(txRequest) {
475
+ */ proveTx(txRequest, scopes) {
431
476
  let privateExecutionResult;
432
477
  // We disable proving concurrently mostly out of caution, since it accesses some of our stores. Proving is so
433
478
  // computationally demanding that it'd be rare for someone to try to do it concurrently regardless.
@@ -438,7 +483,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
438
483
  await this.blockStateSynchronizer.sync();
439
484
  const syncTime = syncTimer.ms();
440
485
  const contractFunctionSimulator = this.#getSimulatorForTx();
441
- privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
486
+ privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
442
487
  const { publicInputs, chonkProof, executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
443
488
  simulate: false,
444
489
  skipFeeEnforcement: false,
@@ -469,16 +514,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
469
514
  // transaction before this one is included in a block from this PXE, and that transaction contains a log with
470
515
  // a tag derived from the same secret, we would reuse the tag and the transactions would be linked. Hence
471
516
  // storing the tags here prevents linkage of txs sent from the same PXE.
472
- const preTagsUsedInTheTx = privateExecutionResult.entrypoint.preTags;
473
- if (preTagsUsedInTheTx.length > 0) {
517
+ const taggingIndexRangesUsedInTheTx = privateExecutionResult.entrypoint.taggingIndexRanges;
518
+ if (taggingIndexRangesUsedInTheTx.length > 0) {
474
519
  // TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
475
520
  const txHash = (await txProvingResult.toTx()).txHash;
476
- await this.senderTaggingStore.storePendingIndexes(preTagsUsedInTheTx, txHash, jobId);
477
- this.log.debug(`Stored used pre-tags as sender for the tx`, {
478
- 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
479
524
  });
480
525
  } else {
481
- this.log.debug(`No pre-tags used in the tx`);
526
+ this.log.debug(`No tagging index ranges used in the tx`);
482
527
  }
483
528
  return txProvingResult;
484
529
  } catch (err) {
@@ -488,13 +533,10 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
488
533
  }
489
534
  /**
490
535
  * Profiles a transaction, reporting gate counts (unless disabled) and returns an execution trace.
491
- *
492
- * @param txRequest - An authenticated tx request ready for simulation
493
- * @param msgSender - (Optional) The message sender to use for the simulation.
494
- * @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.
495
537
  * @returns A trace of the program execution with gate counts.
496
538
  * @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
497
- */ profileTx(txRequest, profileMode, skipProofGeneration = true) {
539
+ */ profileTx(txRequest, { profileMode, skipProofGeneration = true, scopes }) {
498
540
  // We disable concurrent profiles for consistency with simulateTx.
499
541
  return this.#putInJobQueue(async (jobId)=>{
500
542
  const totalTimer = new Timer();
@@ -512,7 +554,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
512
554
  await this.blockStateSynchronizer.sync();
513
555
  const syncTime = syncTimer.ms();
514
556
  const contractFunctionSimulator = this.#getSimulatorForTx();
515
- const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
557
+ const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
516
558
  const { executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
517
559
  simulate: skipProofGeneration,
518
560
  skipFeeEnforcement: false,
@@ -557,18 +599,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
557
599
  * In that case, the transaction returned is only potentially ready to be sent to the network for execution.
558
600
  *
559
601
  *
560
- * @param txRequest - An authenticated tx request ready for simulation
561
- * @param simulatePublic - Whether to simulate the public part of the transaction.
562
- * @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
563
- * @param skipFeeEnforcement - (Optional) If false, fees are enforced.
564
- * @param overrides - (Optional) State overrides for the simulation, such as msgSender, contract instances and artifacts.
565
- * @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.
566
603
  * @returns A simulated transaction result object that includes public and private return values.
567
604
  * @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
568
605
  * Also throws if simulatePublic is true and public simulation reverts.
569
606
  *
570
607
  * TODO(#7456) Prevent msgSender being defined here for the first call
571
- */ simulateTx(txRequest, simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes) {
608
+ */ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, skipKernels = true, overrides, scopes }) {
572
609
  // We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
573
610
  // to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
574
611
  // delete the same read value, or reading values that another simulation is currently modifying).
@@ -587,23 +624,23 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
587
624
  const syncTimer = new Timer();
588
625
  await this.blockStateSynchronizer.sync();
589
626
  const syncTime = syncTimer.ms();
590
- const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
591
- // Temporary: in case there are overrides, we have to skip the kernels or validations
592
- // will fail. Consider handing control to the user/wallet on whether they want to run them
593
- // or not.
594
627
  const overriddenContracts = overrides?.contracts ? new Set(Object.keys(overrides.contracts)) : undefined;
595
628
  const hasOverriddenContracts = overriddenContracts !== undefined && overriddenContracts.size > 0;
596
- const skipKernels = hasOverriddenContracts;
597
- // Set overridden contracts on the sync service so it knows to skip syncing them
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
+ }
632
+ const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
598
633
  if (hasOverriddenContracts) {
599
- this.contractSyncService.setOverriddenContracts(jobId, overriddenContracts);
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);
600
637
  }
601
638
  // Execution of private functions only; no proving, and no kernel logic.
602
639
  const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
603
640
  let publicInputs;
604
641
  let executionSteps = [];
605
642
  if (skipKernels) {
606
- ({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, this.contractStore));
643
+ ({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel), this.node));
607
644
  } else {
608
645
  // Kernel logic, plus proving of all private functions and kernels.
609
646
  ({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
@@ -620,6 +657,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
620
657
  const publicSimulationTimer = new Timer();
621
658
  publicOutput = await this.#simulatePublicCalls(simulatedTx, skipFeeEnforcement);
622
659
  publicSimulationTime = publicSimulationTimer.ms();
660
+ if (publicOutput?.debugLogs?.length) {
661
+ await displayDebugLogs(publicOutput.debugLogs, (addr)=>this.contractStore.getDebugContractName(addr));
662
+ }
623
663
  }
624
664
  let validationTime;
625
665
  if (!skipTxValidation) {
@@ -630,7 +670,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
630
670
  });
631
671
  validationTime = validationTimer.ms();
632
672
  if (validationResult.result === 'invalid') {
633
- 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}`);
634
675
  }
635
676
  }
636
677
  const txHash = simulatedTx.getTxHash();
@@ -663,22 +704,19 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
663
704
  nodeRPCCalls: simulatorStats.nodeRPCCalls
664
705
  });
665
706
  } catch (err) {
666
- 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(', ')}`);
667
708
  }
668
709
  });
669
710
  }
670
711
  /**
671
- * Simulate the execution of a contract utility function.
672
- *
712
+ * Executes a contract utility function.
673
713
  * @param call - The function call containing the function details, arguments, and target contract address.
674
- * @param authwits - (Optional) The authentication witnesses required for the function call.
675
- * @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will
676
- * default to all.
677
- * @returns The result of the utility function call, structured based on the function ABI.
678
- */ simulateUtility(call, authwits, scopes) {
679
- // 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.
680
718
  // to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
681
- // 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).
682
720
  return this.#putInJobQueue(async (jobId)=>{
683
721
  try {
684
722
  const totalTimer = new Timer();
@@ -688,8 +726,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
688
726
  const functionTimer = new Timer();
689
727
  const contractFunctionSimulator = this.#getSimulatorForTx();
690
728
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
691
- await this.contractSyncService.ensureContractSynced(call.to, call.selector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), anchorBlockHeader, jobId);
692
- 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);
693
731
  const functionTime = functionTimer.ms();
694
732
  const totalTime = totalTimer.ms();
695
733
  const perFunction = [
@@ -707,6 +745,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
707
745
  const simulationStats = contractFunctionSimulator.getStats();
708
746
  return {
709
747
  result: executionResult,
748
+ offchainEffects,
749
+ anchorBlockTimestamp: anchorBlockHeader.globalVariables.timestamp,
710
750
  stats: {
711
751
  timings,
712
752
  nodeRPCCalls: simulationStats.nodeRPCCalls
@@ -715,7 +755,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
715
755
  } catch (err) {
716
756
  const { to, name, args } = call;
717
757
  const stringifiedArgs = args.map((arg)=>arg.toString()).join(', ');
718
- 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(', ')}`);
719
759
  }
720
760
  });
721
761
  }
@@ -738,7 +778,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
738
778
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
739
779
  anchorBlockNumber = anchorBlockHeader.getBlockNumber();
740
780
  const contractFunctionSimulator = this.#getSimulatorForTx();
741
- await this.contractSyncService.ensureContractSynced(filter.contractAddress, null, async (privateSyncCall)=>await this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), anchorBlockHeader, jobId);
781
+ await this.contractSyncService.ensureContractSynced(filter.contractAddress, null, async (privateSyncCall, execScopes)=>await this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, filter.scopes);
742
782
  });
743
783
  // anchorBlockNumber is set during the job and fixed to whatever it is after a block sync
744
784
  const sanitizedFilter = new PrivateEventFilterValidator(anchorBlockNumber).validate(filter);
@@ -746,8 +786,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
746
786
  return this.privateEventStore.getPrivateEvents(eventSelector, sanitizedFilter);
747
787
  }
748
788
  /**
749
- * Stops the PXE's job queue.
750
- */ stop() {
751
- 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();
752
793
  }
753
794
  }
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fwc3Vs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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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fwc3VsZV9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvY2Fwc3VsZV9zdG9yZS9jYXBzdWxlX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0sdUJBQXVCLENBQUM7QUFDbEUsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFDeEUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFFaEUsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sMENBQTBDLENBQUM7QUFFNUUscUJBQWEsWUFBYSxZQUFXLFdBQVc7O0lBQzlDLFFBQVEsQ0FBQyxTQUFTLGFBQWE7SUFZL0IsTUFBTSxFQUFFLE1BQU0sQ0FBQztJQUVmLFlBQVksS0FBSyxFQUFFLGlCQUFpQixFQVFuQztJQStERDs7Ozs7O09BTUc7SUFDRyxNQUFNLENBQUMsS0FBSyxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBZXpDO0lBRUQ7O09BRUc7SUFDSCxhQUFhLENBQUMsS0FBSyxFQ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