@aztec/pxe 0.0.1-commit.86469d5 → 0.0.1-commit.88c5703d4

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 (200) hide show
  1. package/dest/access_scopes.d.ts +9 -0
  2. package/dest/access_scopes.d.ts.map +1 -0
  3. package/dest/access_scopes.js +6 -0
  4. package/dest/block_synchronizer/block_synchronizer.d.ts +4 -2
  5. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  6. package/dest/block_synchronizer/block_synchronizer.js +7 -1
  7. package/dest/config/index.d.ts +2 -2
  8. package/dest/config/index.d.ts.map +1 -1
  9. package/dest/config/index.js +1 -1
  10. package/dest/config/package_info.js +1 -1
  11. package/dest/contract_function_simulator/contract_function_simulator.d.ts +61 -29
  12. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  13. package/dest/contract_function_simulator/contract_function_simulator.js +185 -72
  14. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +7 -7
  15. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  16. package/dest/contract_function_simulator/execution_tagging_index_cache.js +19 -11
  17. package/dest/contract_function_simulator/index.d.ts +2 -1
  18. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  19. package/dest/contract_function_simulator/index.js +1 -0
  20. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -3
  21. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  22. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +5 -4
  23. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +1 -1
  24. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  25. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -3
  26. package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts +16 -0
  27. package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts.map +1 -0
  28. package/dest/contract_function_simulator/noir-structs/message_tx_context.js +57 -0
  29. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -4
  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 +3 -5
  32. package/dest/contract_function_simulator/oracle/interfaces.d.ts +49 -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 +52 -0
  37. package/dest/contract_function_simulator/oracle/oracle.d.ts +44 -44
  38. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  39. package/dest/contract_function_simulator/oracle/oracle.js +161 -100
  40. package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
  41. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +57 -78
  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 +101 -86
  44. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +75 -45
  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 +147 -75
  47. package/dest/contract_logging.d.ts +22 -0
  48. package/dest/contract_logging.d.ts.map +1 -0
  49. package/dest/contract_logging.js +23 -0
  50. package/dest/contract_sync/contract_sync_service.d.ts +43 -0
  51. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  52. package/dest/contract_sync/contract_sync_service.js +97 -0
  53. package/dest/contract_sync/helpers.d.ts +29 -0
  54. package/dest/contract_sync/helpers.d.ts.map +1 -0
  55. package/dest/contract_sync/{index.js → helpers.js} +8 -14
  56. package/dest/debug/pxe_debug_utils.d.ts +14 -10
  57. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  58. package/dest/debug/pxe_debug_utils.js +16 -15
  59. package/dest/entrypoints/client/bundle/index.d.ts +4 -1
  60. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  61. package/dest/entrypoints/client/bundle/index.js +3 -0
  62. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  63. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  64. package/dest/entrypoints/client/bundle/utils.js +9 -1
  65. package/dest/entrypoints/client/lazy/index.d.ts +4 -1
  66. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  67. package/dest/entrypoints/client/lazy/index.js +3 -0
  68. package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
  69. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  70. package/dest/entrypoints/client/lazy/utils.js +9 -1
  71. package/dest/entrypoints/server/index.d.ts +4 -2
  72. package/dest/entrypoints/server/index.d.ts.map +1 -1
  73. package/dest/entrypoints/server/index.js +3 -1
  74. package/dest/entrypoints/server/utils.js +9 -1
  75. package/dest/logs/log_service.d.ts +3 -2
  76. package/dest/logs/log_service.d.ts.map +1 -1
  77. package/dest/logs/log_service.js +9 -14
  78. package/dest/messages/message_context_service.d.ts +17 -0
  79. package/dest/messages/message_context_service.d.ts.map +1 -0
  80. package/dest/messages/message_context_service.js +36 -0
  81. package/dest/notes/note_service.d.ts +4 -3
  82. package/dest/notes/note_service.d.ts.map +1 -1
  83. package/dest/notes/note_service.js +3 -2
  84. package/dest/notes_filter.d.ts +25 -0
  85. package/dest/notes_filter.d.ts.map +1 -0
  86. package/dest/notes_filter.js +4 -0
  87. package/dest/oracle_version.d.ts +2 -2
  88. package/dest/oracle_version.js +3 -3
  89. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  90. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  91. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  92. package/dest/private_kernel/hints/index.d.ts +1 -1
  93. package/dest/private_kernel/hints/index.js +1 -1
  94. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +4 -3
  95. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
  96. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +129 -68
  97. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  98. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  99. package/dest/private_kernel/hints/test_utils.js +203 -0
  100. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  101. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  102. package/dest/private_kernel/private_kernel_execution_prover.js +19 -11
  103. package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
  104. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  105. package/dest/private_kernel/private_kernel_oracle.js +7 -3
  106. package/dest/pxe.d.ts +72 -24
  107. package/dest/pxe.d.ts.map +1 -1
  108. package/dest/pxe.js +118 -71
  109. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  110. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  111. package/dest/storage/contract_store/contract_store.js +145 -69
  112. package/dest/storage/metadata.d.ts +1 -1
  113. package/dest/storage/metadata.js +1 -1
  114. package/dest/storage/note_store/note_store.d.ts +3 -3
  115. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  116. package/dest/storage/note_store/note_store.js +6 -4
  117. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
  118. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  119. package/dest/storage/tagging_store/sender_tagging_store.d.ts +29 -28
  120. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  121. package/dest/storage/tagging_store/sender_tagging_store.js +141 -115
  122. package/dest/tagging/get_all_logs_by_tags.d.ts +1 -1
  123. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
  124. package/dest/tagging/get_all_logs_by_tags.js +17 -3
  125. package/dest/tagging/index.d.ts +3 -3
  126. package/dest/tagging/index.d.ts.map +1 -1
  127. package/dest/tagging/index.js +1 -1
  128. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -5
  129. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  130. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +7 -7
  131. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  132. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +6 -7
  133. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  134. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +12 -11
  135. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -8
  136. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  137. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +13 -7
  138. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +4 -3
  139. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  140. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +20 -10
  141. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -7
  142. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  143. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +36 -24
  144. package/package.json +25 -16
  145. package/src/access_scopes.ts +9 -0
  146. package/src/block_synchronizer/block_synchronizer.ts +6 -0
  147. package/src/config/index.ts +1 -1
  148. package/src/config/package_info.ts +1 -1
  149. package/src/contract_function_simulator/contract_function_simulator.ts +338 -133
  150. package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -14
  151. package/src/contract_function_simulator/index.ts +1 -0
  152. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +8 -5
  153. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -4
  154. package/src/contract_function_simulator/noir-structs/message_tx_context.ts +55 -0
  155. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +3 -6
  156. package/src/contract_function_simulator/oracle/interfaces.ts +53 -54
  157. package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +77 -0
  158. package/src/contract_function_simulator/oracle/oracle.ts +165 -140
  159. package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
  160. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +128 -180
  161. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +222 -82
  162. package/src/contract_logging.ts +39 -0
  163. package/src/contract_sync/contract_sync_service.ts +152 -0
  164. package/src/contract_sync/{index.ts → helpers.ts} +13 -34
  165. package/src/debug/pxe_debug_utils.ts +48 -18
  166. package/src/entrypoints/client/bundle/index.ts +3 -0
  167. package/src/entrypoints/client/bundle/utils.ts +9 -1
  168. package/src/entrypoints/client/lazy/index.ts +3 -0
  169. package/src/entrypoints/client/lazy/utils.ts +9 -1
  170. package/src/entrypoints/server/index.ts +3 -1
  171. package/src/entrypoints/server/utils.ts +7 -7
  172. package/src/logs/log_service.ts +17 -24
  173. package/src/messages/message_context_service.ts +45 -0
  174. package/src/notes/note_service.ts +4 -3
  175. package/src/notes_filter.ts +26 -0
  176. package/src/oracle_version.ts +3 -3
  177. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  178. package/src/private_kernel/hints/index.ts +1 -1
  179. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +164 -117
  180. package/src/private_kernel/hints/test_utils.ts +325 -0
  181. package/src/private_kernel/private_kernel_execution_prover.ts +19 -12
  182. package/src/private_kernel/private_kernel_oracle.ts +7 -7
  183. package/src/pxe.ts +207 -124
  184. package/src/storage/contract_store/contract_store.ts +174 -75
  185. package/src/storage/metadata.ts +1 -1
  186. package/src/storage/note_store/note_store.ts +12 -5
  187. package/src/storage/tagging_store/recipient_tagging_store.ts +9 -5
  188. package/src/storage/tagging_store/sender_tagging_store.ts +185 -138
  189. package/src/tagging/get_all_logs_by_tags.ts +28 -4
  190. package/src/tagging/index.ts +2 -2
  191. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +7 -10
  192. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  193. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +10 -15
  194. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +23 -10
  195. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +26 -11
  196. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +27 -26
  197. package/dest/contract_sync/index.d.ts +0 -24
  198. package/dest/contract_sync/index.d.ts.map +0 -1
  199. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  200. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
package/dest/pxe.js CHANGED
@@ -13,11 +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 { ensureContractSynced, readCurrentClassId } from './contract_sync/index.js';
16
+ import { displayDebugLogs } from './contract_logging.js';
17
+ import { ContractSyncService } from './contract_sync/contract_sync_service.js';
18
+ import { readCurrentClassId } from './contract_sync/helpers.js';
17
19
  import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
18
20
  import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
19
21
  import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
20
22
  import { JobCoordinator } from './job_coordinator/job_coordinator.js';
23
+ import { MessageContextService } from './messages/message_context_service.js';
21
24
  import { PrivateKernelExecutionProver } from './private_kernel/private_kernel_execution_prover.js';
22
25
  import { PrivateKernelOracle } from './private_kernel/private_kernel_oracle.js';
23
26
  import { AddressStore } from './storage/address_store/address_store.js';
@@ -34,6 +37,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
34
37
  * manage private state of users.
35
38
  */ export class PXE {
36
39
  node;
40
+ db;
37
41
  blockStateSynchronizer;
38
42
  keyStore;
39
43
  contractStore;
@@ -45,6 +49,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
45
49
  recipientTaggingStore;
46
50
  addressStore;
47
51
  privateEventStore;
52
+ contractSyncService;
53
+ messageContextService;
48
54
  simulator;
49
55
  proverEnabled;
50
56
  proofCreator;
@@ -53,8 +59,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
53
59
  jobQueue;
54
60
  jobCoordinator;
55
61
  debug;
56
- constructor(node, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
62
+ constructor(node, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
57
63
  this.node = node;
64
+ this.db = db;
58
65
  this.blockStateSynchronizer = blockStateSynchronizer;
59
66
  this.keyStore = keyStore;
60
67
  this.contractStore = contractStore;
@@ -66,6 +73,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
66
73
  this.recipientTaggingStore = recipientTaggingStore;
67
74
  this.addressStore = addressStore;
68
75
  this.privateEventStore = privateEventStore;
76
+ this.contractSyncService = contractSyncService;
77
+ this.messageContextService = messageContextService;
69
78
  this.simulator = simulator;
70
79
  this.proverEnabled = proverEnabled;
71
80
  this.proofCreator = proofCreator;
@@ -81,11 +90,12 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
81
90
  * can be contacted.
82
91
  *
83
92
  * @returns A promise that resolves PXE is ready to be used.
84
- */ static async create(node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix) {
93
+ */ static async create({ node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix }) {
85
94
  // Extract bindings from the logger, or use empty bindings if a string suffix is provided.
86
95
  const bindings = loggerOrSuffix && typeof loggerOrSuffix !== 'string' ? loggerOrSuffix.getBindings() : undefined;
87
96
  const log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:service:${loggerOrSuffix}` : `pxe:service`) : loggerOrSuffix;
88
- const proverEnabled = !!config.proverEnabled;
97
+ const info = await node.getNodeInfo();
98
+ const proverEnabled = config.proverEnabled !== undefined ? config.proverEnabled : info.realProofs;
89
99
  const addressStore = new AddressStore(store);
90
100
  const privateEventStore = new PrivateEventStore(store);
91
101
  const contractStore = new ContractStore(store);
@@ -97,29 +107,45 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
97
107
  const capsuleStore = new CapsuleStore(store);
98
108
  const keyStore = new KeyStore(store);
99
109
  const tipsStore = new L2TipsKVStore(store, 'pxe');
100
- const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, config, bindings);
110
+ const contractSyncService = new ContractSyncService(node, contractStore, noteStore, createLogger('pxe:contract_sync', bindings));
111
+ const messageContextService = new MessageContextService(node);
112
+ const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, contractSyncService, config, bindings);
101
113
  const jobCoordinator = new JobCoordinator(store, bindings);
102
114
  jobCoordinator.registerStores([
103
115
  capsuleStore,
104
116
  senderTaggingStore,
105
117
  recipientTaggingStore,
106
118
  privateEventStore,
107
- noteStore
119
+ noteStore,
120
+ contractSyncService
108
121
  ]);
109
- const debugUtils = new PXEDebugUtils(contractStore, noteStore, synchronizer, anchorBlockStore);
122
+ const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
110
123
  const jobQueue = new SerialQueue();
111
- const pxe = new PXE(node, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
112
- debugUtils.setPXE(pxe, pxe.#putInJobQueue.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));
113
126
  pxe.jobQueue.start();
114
127
  await pxe.#registerProtocolContracts();
115
- const info = await node.getNodeInfo();
116
128
  log.info(`Started PXE connected to chain ${info.l1ChainId} version ${info.rollupVersion}`);
117
129
  return pxe;
118
130
  }
119
131
  // Internal methods
120
132
  #getSimulatorForTx(overrides) {
121
133
  const proxyContractStore = ProxiedContractStoreFactory.create(this.contractStore, overrides?.contracts);
122
- 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);
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
+ });
123
149
  }
124
150
  #contextualizeError(err, ...context) {
125
151
  let contextStr = '';
@@ -162,8 +188,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
162
188
  async #registerProtocolContracts() {
163
189
  const registered = {};
164
190
  for (const name of protocolContractNames){
165
- const { address, contractClass, instance, artifact } = await this.protocolContractsProvider.getProtocolContractArtifact(name);
166
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
191
+ const { address, instance, artifact } = await this.protocolContractsProvider.getProtocolContractArtifact(name);
192
+ await this.contractStore.addContractArtifact(artifact);
167
193
  await this.contractStore.addContractInstance(instance);
168
194
  registered[name] = address.toString();
169
195
  }
@@ -175,10 +201,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
175
201
  const { origin: contractAddress, functionSelector } = txRequest;
176
202
  try {
177
203
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
178
- await ensureContractSynced(contractAddress, functionSelector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), this.node, this.contractStore, this.noteStore, anchorBlockHeader, jobId);
179
- const result = await contractFunctionSimulator.run(txRequest, contractAddress, functionSelector, undefined, anchorBlockHeader, // The sender for tags is set by contracts, typically by an account
180
- // contract entrypoint
181
- 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
+ });
182
212
  this.log.debug(`Private simulation completed for ${contractAddress.toString()}:${functionSelector}`);
183
213
  return result;
184
214
  } catch (err) {
@@ -189,18 +219,22 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
189
219
  }
190
220
  }
191
221
  /**
192
- * Simulate a utility function call on the given contract.
222
+ * Execute a utility function call on the given contract.
193
223
  * @param contractFunctionSimulator - The simulator to use for the function call.
194
224
  * @param call - The function call to execute.
195
225
  * @param authWitnesses - Authentication witnesses required for the function call.
196
226
  * @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
197
227
  * accounts if not specified.
198
228
  * @param jobId - The job ID for staged writes.
199
- * @returns The simulation result containing the outputs of the utility function.
200
- */ 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) {
201
231
  try {
202
232
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
203
- 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
+ };
204
238
  } catch (err) {
205
239
  if (err instanceof SimulationError) {
206
240
  await enrichSimulationError(err, this.contractStore, this.log);
@@ -252,7 +286,17 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
252
286
  return await kernelTraceProver.proveWithKernels(txExecutionRequest.toTxRequest(), privateExecutionResult, config);
253
287
  }
254
288
  // Public API
255
- 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.anchorBlockStore.getBlockHeader();
294
+ }
295
+ /**
296
+ * Returns the contract instance for a given address, if it's registered in the PXE.
297
+ * @param address - The contract address.
298
+ * @returns The contract instance if found, undefined otherwise.
299
+ */ getContractInstance(address) {
256
300
  return this.contractStore.getContractInstance(address);
257
301
  }
258
302
  /**
@@ -339,8 +383,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
339
383
  *
340
384
  * @param artifact - The build artifact for the contract class.
341
385
  */ async registerContractClass(artifact) {
342
- const { id: contractClassId } = await getContractClassFromArtifact(artifact);
343
- await this.contractStore.addContractArtifact(contractClassId, artifact);
386
+ const contractClassId = await this.contractStore.addContractArtifact(artifact);
344
387
  this.log.info(`Added contract class ${artifact.name} with id ${contractClassId}`);
345
388
  }
346
389
  /**
@@ -356,15 +399,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
356
399
  if (artifact) {
357
400
  // If the user provides an artifact, validate it against the expected class id and register it
358
401
  const contractClass = await getContractClassFromArtifact(artifact);
359
- const contractClassId = contractClass.id;
360
- if (!contractClassId.equals(instance.currentContractClassId)) {
361
- throw new Error(`Artifact does not match expected class id (computed ${contractClassId} but instance refers to ${instance.currentContractClassId})`);
402
+ if (!contractClass.id.equals(instance.currentContractClassId)) {
403
+ throw new Error(`Artifact does not match expected class id (computed ${contractClass.id} but instance refers to ${instance.currentContractClassId})`);
362
404
  }
363
405
  const computedAddress = await computeContractAddressFromInstance(instance);
364
406
  if (!computedAddress.equals(instance.address)) {
365
407
  throw new Error('Added a contract in which the address does not match the contract instance.');
366
408
  }
367
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
409
+ await this.contractStore.addContractArtifact(artifact, contractClass);
368
410
  const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
369
411
  await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
370
412
  } else {
@@ -400,11 +442,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
400
442
  if (!contractClass.id.equals(currentClassId)) {
401
443
  throw new Error('Could not update contract to a class different from the current one.');
402
444
  }
403
- await this.contractStore.addContractArtifact(contractClass.id, artifact);
404
445
  const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
405
446
  await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
406
447
  currentInstance.currentContractClassId = contractClass.id;
407
- await this.contractStore.addContractInstance(currentInstance);
448
+ await Promise.all([
449
+ this.contractStore.addContractArtifact(artifact, contractClass),
450
+ this.contractStore.addContractInstance(currentInstance)
451
+ ]);
408
452
  this.log.info(`Updated contract ${artifact.name} at ${contractAddress.toString()} to class ${contractClass.id}`);
409
453
  });
410
454
  }
@@ -419,10 +463,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
419
463
  * (where validators prove the public portion).
420
464
  *
421
465
  * @param txRequest - An authenticated tx request ready for proving
466
+ * @param scopes - Addresses whose private state and keys are accessible during private execution.
422
467
  * @returns A result containing the proof and public inputs of the tail circuit.
423
468
  * @throws If contract code not found, or public simulation reverts.
424
469
  * Also throws if simulatePublic is true and public simulation reverts.
425
- */ proveTx(txRequest) {
470
+ */ proveTx(txRequest, scopes) {
426
471
  let privateExecutionResult;
427
472
  // We disable proving concurrently mostly out of caution, since it accesses some of our stores. Proving is so
428
473
  // computationally demanding that it'd be rare for someone to try to do it concurrently regardless.
@@ -433,7 +478,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
433
478
  await this.blockStateSynchronizer.sync();
434
479
  const syncTime = syncTimer.ms();
435
480
  const contractFunctionSimulator = this.#getSimulatorForTx();
436
- privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
481
+ privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
437
482
  const { publicInputs, chonkProof, executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
438
483
  simulate: false,
439
484
  skipFeeEnforcement: false,
@@ -464,16 +509,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
464
509
  // transaction before this one is included in a block from this PXE, and that transaction contains a log with
465
510
  // a tag derived from the same secret, we would reuse the tag and the transactions would be linked. Hence
466
511
  // storing the tags here prevents linkage of txs sent from the same PXE.
467
- const preTagsUsedInTheTx = privateExecutionResult.entrypoint.preTags;
468
- if (preTagsUsedInTheTx.length > 0) {
512
+ const taggingIndexRangesUsedInTheTx = privateExecutionResult.entrypoint.taggingIndexRanges;
513
+ if (taggingIndexRangesUsedInTheTx.length > 0) {
469
514
  // TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
470
515
  const txHash = (await txProvingResult.toTx()).txHash;
471
- await this.senderTaggingStore.storePendingIndexes(preTagsUsedInTheTx, txHash, jobId);
472
- this.log.debug(`Stored used pre-tags as sender for the tx`, {
473
- preTagsUsedInTheTx
516
+ await this.senderTaggingStore.storePendingIndexes(taggingIndexRangesUsedInTheTx, txHash, jobId);
517
+ this.log.debug(`Stored used tagging index ranges as sender for the tx`, {
518
+ taggingIndexRangesUsedInTheTx
474
519
  });
475
520
  } else {
476
- this.log.debug(`No pre-tags used in the tx`);
521
+ this.log.debug(`No tagging index ranges used in the tx`);
477
522
  }
478
523
  return txProvingResult;
479
524
  } catch (err) {
@@ -483,13 +528,10 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
483
528
  }
484
529
  /**
485
530
  * Profiles a transaction, reporting gate counts (unless disabled) and returns an execution trace.
486
- *
487
- * @param txRequest - An authenticated tx request ready for simulation
488
- * @param msgSender - (Optional) The message sender to use for the simulation.
489
- * @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
531
+ * @param txRequest - An authenticated tx request ready for simulation.
490
532
  * @returns A trace of the program execution with gate counts.
491
533
  * @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
492
- */ profileTx(txRequest, profileMode, skipProofGeneration = true) {
534
+ */ profileTx(txRequest, { profileMode, skipProofGeneration = true, scopes }) {
493
535
  // We disable concurrent profiles for consistency with simulateTx.
494
536
  return this.#putInJobQueue(async (jobId)=>{
495
537
  const totalTimer = new Timer();
@@ -507,7 +549,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
507
549
  await this.blockStateSynchronizer.sync();
508
550
  const syncTime = syncTimer.ms();
509
551
  const contractFunctionSimulator = this.#getSimulatorForTx();
510
- const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
552
+ const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
511
553
  const { executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
512
554
  simulate: skipProofGeneration,
513
555
  skipFeeEnforcement: false,
@@ -552,18 +594,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
552
594
  * In that case, the transaction returned is only potentially ready to be sent to the network for execution.
553
595
  *
554
596
  *
555
- * @param txRequest - An authenticated tx request ready for simulation
556
- * @param simulatePublic - Whether to simulate the public part of the transaction.
557
- * @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
558
- * @param skipFeeEnforcement - (Optional) If false, fees are enforced.
559
- * @param overrides - (Optional) State overrides for the simulation, such as msgSender, contract instances and artifacts.
560
- * @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will default to all.
597
+ * @param txRequest - An authenticated tx request ready for simulation.
561
598
  * @returns A simulated transaction result object that includes public and private return values.
562
599
  * @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
563
600
  * Also throws if simulatePublic is true and public simulation reverts.
564
601
  *
565
602
  * TODO(#7456) Prevent msgSender being defined here for the first call
566
- */ simulateTx(txRequest, simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes) {
603
+ */ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes }) {
567
604
  // We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
568
605
  // to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
569
606
  // delete the same read value, or reading values that another simulation is currently modifying).
@@ -586,13 +623,19 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
586
623
  // Temporary: in case there are overrides, we have to skip the kernels or validations
587
624
  // will fail. Consider handing control to the user/wallet on whether they want to run them
588
625
  // or not.
589
- const skipKernels = overrides?.contracts !== undefined && Object.keys(overrides.contracts ?? {}).length > 0;
626
+ const overriddenContracts = overrides?.contracts ? new Set(Object.keys(overrides.contracts)) : undefined;
627
+ const hasOverriddenContracts = overriddenContracts !== undefined && overriddenContracts.size > 0;
628
+ const skipKernels = hasOverriddenContracts;
629
+ // Set overridden contracts on the sync service so it knows to skip syncing them
630
+ if (hasOverriddenContracts) {
631
+ this.contractSyncService.setOverriddenContracts(jobId, overriddenContracts);
632
+ }
590
633
  // Execution of private functions only; no proving, and no kernel logic.
591
634
  const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
592
635
  let publicInputs;
593
636
  let executionSteps = [];
594
637
  if (skipKernels) {
595
- ({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, this.contractStore));
638
+ ({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel), this.node));
596
639
  } else {
597
640
  // Kernel logic, plus proving of all private functions and kernels.
598
641
  ({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
@@ -609,6 +652,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
609
652
  const publicSimulationTimer = new Timer();
610
653
  publicOutput = await this.#simulatePublicCalls(simulatedTx, skipFeeEnforcement);
611
654
  publicSimulationTime = publicSimulationTimer.ms();
655
+ if (publicOutput?.debugLogs?.length) {
656
+ await displayDebugLogs(publicOutput.debugLogs, (addr)=>this.contractStore.getDebugContractName(addr));
657
+ }
612
658
  }
613
659
  let validationTime;
614
660
  if (!skipTxValidation) {
@@ -619,7 +665,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
619
665
  });
620
666
  validationTime = validationTimer.ms();
621
667
  if (validationResult.result === 'invalid') {
622
- throw new Error('The simulated transaction is unable to be added to state and is invalid.');
668
+ const reason = validationResult.reason.length > 0 ? ` Reason: ${validationResult.reason.join(', ')}` : '';
669
+ throw new Error(`The simulated transaction is unable to be added to state and is invalid.${reason}`);
623
670
  }
624
671
  }
625
672
  const txHash = simulatedTx.getTxHash();
@@ -652,22 +699,19 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
652
699
  nodeRPCCalls: simulatorStats.nodeRPCCalls
653
700
  });
654
701
  } catch (err) {
655
- throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes?.map((s)=>s.toString()).join(', ') ?? 'undefined'}`);
702
+ throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes === 'ALL_SCOPES' ? scopes : scopes.map((s)=>s.toString()).join(', ')}`);
656
703
  }
657
704
  });
658
705
  }
659
706
  /**
660
- * Simulate the execution of a contract utility function.
661
- *
707
+ * Executes a contract utility function.
662
708
  * @param call - The function call containing the function details, arguments, and target contract address.
663
- * @param authwits - (Optional) The authentication witnesses required for the function call.
664
- * @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will
665
- * default to all.
666
- * @returns The result of the utility function call, structured based on the function ABI.
667
- */ simulateUtility(call, authwits, scopes) {
668
- // We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
709
+ */ executeUtility(call, { authwits, scopes } = {
710
+ scopes: 'ALL_SCOPES'
711
+ }) {
712
+ // We disable concurrent executions since those might execute oracles which read and write to the PXE stores (e.g.
669
713
  // to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
670
- // delete the same read value, or reading values that another simulation is currently modifying).
714
+ // delete the same read value, or reading values that another execution is currently modifying).
671
715
  return this.#putInJobQueue(async (jobId)=>{
672
716
  try {
673
717
  const totalTimer = new Timer();
@@ -677,8 +721,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
677
721
  const functionTimer = new Timer();
678
722
  const contractFunctionSimulator = this.#getSimulatorForTx();
679
723
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
680
- await ensureContractSynced(call.to, call.selector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), this.node, this.contractStore, this.noteStore, anchorBlockHeader, jobId);
681
- const executionResult = await this.#simulateUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
724
+ await this.contractSyncService.ensureContractSynced(call.to, call.selector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
725
+ const { result: executionResult, offchainEffects } = await this.#executeUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
682
726
  const functionTime = functionTimer.ms();
683
727
  const totalTime = totalTimer.ms();
684
728
  const perFunction = [
@@ -696,6 +740,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
696
740
  const simulationStats = contractFunctionSimulator.getStats();
697
741
  return {
698
742
  result: executionResult,
743
+ offchainEffects,
744
+ anchorBlockTimestamp: anchorBlockHeader.globalVariables.timestamp,
699
745
  stats: {
700
746
  timings,
701
747
  nodeRPCCalls: simulationStats.nodeRPCCalls
@@ -704,7 +750,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
704
750
  } catch (err) {
705
751
  const { to, name, args } = call;
706
752
  const stringifiedArgs = args.map((arg)=>arg.toString()).join(', ');
707
- throw this.#contextualizeError(err, `simulateUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes?.map((s)=>s.toString()).join(', ') ?? 'undefined'}`);
753
+ throw this.#contextualizeError(err, `executeUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes === 'ALL_SCOPES' ? scopes : scopes.map((s)=>s.toString()).join(', ')}`);
708
754
  }
709
755
  });
710
756
  }
@@ -727,7 +773,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
727
773
  const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
728
774
  anchorBlockNumber = anchorBlockHeader.getBlockNumber();
729
775
  const contractFunctionSimulator = this.#getSimulatorForTx();
730
- await ensureContractSynced(filter.contractAddress, null, async (privateSyncCall)=>await this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), this.node, this.contractStore, this.noteStore, anchorBlockHeader, jobId);
776
+ await this.contractSyncService.ensureContractSynced(filter.contractAddress, null, async (privateSyncCall, execScopes)=>await this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, filter.scopes);
731
777
  });
732
778
  // anchorBlockNumber is set during the job and fixed to whatever it is after a block sync
733
779
  const sanitizedFilter = new PrivateEventFilterValidator(anchorBlockNumber).validate(filter);
@@ -735,8 +781,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
735
781
  return this.privateEventStore.getPrivateEvents(eventSelector, sanitizedFilter);
736
782
  }
737
783
  /**
738
- * Stops the PXE's job queue.
739
- */ stop() {
740
- return this.jobQueue.end();
784
+ * Stops the PXE's job queue and closes the backing store.
785
+ */ async stop() {
786
+ await this.jobQueue.end();
787
+ await this.db.close();
741
788
  }
742
789
  }
@@ -1,10 +1,37 @@
1
1
  import type { FUNCTION_TREE_HEIGHT } from '@aztec/constants';
2
- import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import { BufferReader } from '@aztec/foundation/serialize';
3
4
  import type { MembershipWitness } from '@aztec/foundation/trees';
4
5
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
5
6
  import { type ContractArtifact, type FunctionAbi, type FunctionArtifactWithContractName, FunctionCall, type FunctionDebugMetadata, FunctionSelector } from '@aztec/stdlib/abi';
6
7
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
7
- import { type ContractClass, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
8
+ import { type ContractClassIdPreimage, type ContractClassWithId, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
9
+ /**
10
+ * All contract class data except the large packedBytecode.
11
+ * The expensive data from the ContractClass is precomputed and stored in this format to avoid redundant hashing.
12
+ * Since we have to store the artifacts anyway, the final ContractClass is reconstructed by combining this data
13
+ * with the packedBytecode obtained from the former. That way we can have quick class lookups without wasted storage.
14
+ */
15
+ export declare class SerializableContractClassData {
16
+ readonly version: 1;
17
+ readonly id: Fr;
18
+ readonly artifactHash: Fr;
19
+ readonly privateFunctionsRoot: Fr;
20
+ readonly publicBytecodeCommitment: Fr;
21
+ readonly privateFunctions: {
22
+ selector: FunctionSelector;
23
+ vkHash: Fr;
24
+ }[];
25
+ constructor(data: ContractClassIdPreimage & {
26
+ id: Fr;
27
+ privateFunctions: {
28
+ selector: FunctionSelector;
29
+ vkHash: Fr;
30
+ }[];
31
+ });
32
+ toBuffer(): Buffer;
33
+ static fromBuffer(bufferOrReader: Buffer | BufferReader): SerializableContractClassData;
34
+ }
8
35
  /**
9
36
  * ContractStore serves as a data manager and retriever for Aztec.nr contracts.
10
37
  * It provides methods to obtain contract addresses, function ABI, bytecode, and membership witnesses
@@ -15,19 +42,24 @@ import { type ContractClass, type ContractInstanceWithAddress } from '@aztec/std
15
42
  export declare class ContractStore {
16
43
  #private;
17
44
  constructor(store: AztecAsyncKVStore);
18
- addContractArtifact(id: Fr, contract: ContractArtifact): Promise<void>;
45
+ /**
46
+ * Registers a new contract artifact and its corresponding class data.
47
+ * IMPORTANT: This method does not verify that the provided artifact matches the class data or that the class id matches the artifact.
48
+ * It is the caller's responsibility to ensure the consistency and correctness of the provided data.
49
+ * This is done to avoid redundant, expensive contract class computations
50
+ */
51
+ addContractArtifact(contract: ContractArtifact, contractClassWithIdAndPreimage?: ContractClassWithId & ContractClassIdPreimage): Promise<Fr>;
19
52
  addContractInstance(contract: ContractInstanceWithAddress): Promise<void>;
20
53
  getContractsAddresses(): Promise<AztecAddress[]>;
21
- /** Returns a contract instance for a given address. Throws if not found. */
54
+ /** Returns a contract instance for a given address. */
22
55
  getContractInstance(contractAddress: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
56
+ /** Returns the raw contract artifact for a given class id. */
23
57
  getContractArtifact(contractClassId: Fr): Promise<ContractArtifact | undefined>;
24
- /** Returns a contract class for a given class id. Throws if not found. */
25
- getContractClass(contractClassId: Fr): Promise<ContractClass | undefined>;
58
+ /** Returns a contract class for a given class id. */
59
+ getContractClassWithPreimage(contractClassId: Fr): Promise<(ContractClassWithId & ContractClassIdPreimage) | undefined>;
26
60
  getContract(address: AztecAddress): Promise<(ContractInstanceWithAddress & ContractArtifact) | undefined>;
27
61
  /**
28
62
  * Retrieves the artifact of a specified function within a given contract.
29
- * The function is identified by its selector, which is a unique code generated from the function's signature.
30
- * Throws an error if the contract address or function selector are invalid or not found.
31
63
  *
32
64
  * @param contractAddress - The AztecAddress representing the contract containing the function.
33
65
  * @param selector - The function selector.
@@ -39,20 +71,15 @@ export declare class ContractStore {
39
71
  getFunctionAbi(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionAbi | undefined>;
40
72
  /**
41
73
  * Retrieves the debug metadata of a specified function within a given contract.
42
- * The function is identified by its selector, which is a unique code generated from the function's signature.
43
- * Returns undefined if the debug metadata for the given function is not found.
44
- * Throws if the contract has not been added to the database.
45
74
  *
46
75
  * @param contractAddress - The AztecAddress representing the contract containing the function.
47
76
  * @param selector - The function selector.
48
- * @returns The corresponding function's artifact as an object.
77
+ * @returns The corresponding function's debug metadata, or undefined.
49
78
  */
50
79
  getFunctionDebugMetadata(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionDebugMetadata | undefined>;
51
80
  getPublicFunctionDebugMetadata(contractAddress: AztecAddress): Promise<FunctionDebugMetadata | undefined>;
52
81
  /**
53
82
  * Retrieve the function membership witness for the given contract class and function selector.
54
- * The function membership witness represents a proof that the function belongs to the specified contract.
55
- * Throws an error if the contract address or function selector is unknown.
56
83
  *
57
84
  * @param contractClassId - The id of the class.
58
85
  * @param selector - The function selector.
@@ -63,4 +90,4 @@ export declare class ContractStore {
63
90
  getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
64
91
  getFunctionCall(functionName: string, args: any[], to: AztecAddress): Promise<FunctionCall>;
65
92
  }
66
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3Rfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2NvbnRyYWN0X3N0b3JlL2NvbnRyYWN0X3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDN0QsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFFekQsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBaUIsTUFBTSxpQkFBaUIsQ0FBQztBQUN4RSxPQUFPLEVBQ0wsS0FBSyxnQkFBZ0IsRUFDckIsS0FBSyxXQUFXLEVBRWhCLEtBQUssZ0NBQWdDLEVBQ3JDLFlBQVksRUFDWixLQUFLLHFCQUFxQixFQUMxQixnQkFBZ0IsRUFNakIsTUFBTSxtQkFBbUIsQ0FBQztBQUMzQixPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDM0QsT0FBTyxFQUNMLEtBQUssYUFBYS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