@aztec/pxe 5.0.0-rc.1 → 5.0.0-rc.2

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 (218) hide show
  1. package/dest/block_synchronizer/block_stream_source.d.ts +5 -5
  2. package/dest/block_synchronizer/block_stream_source.d.ts.map +1 -1
  3. package/dest/block_synchronizer/block_stream_source.js +4 -29
  4. package/dest/block_synchronizer/block_synchronizer.d.ts +13 -11
  5. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  6. package/dest/block_synchronizer/block_synchronizer.js +43 -15
  7. package/dest/config/index.d.ts +2 -1
  8. package/dest/config/index.d.ts.map +1 -1
  9. package/dest/config/index.js +1 -0
  10. package/dest/contract_function_simulator/contract_function_simulator.d.ts +11 -16
  11. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  12. package/dest/contract_function_simulator/contract_function_simulator.js +22 -18
  13. package/dest/contract_function_simulator/index.d.ts +15 -9
  14. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  15. package/dest/contract_function_simulator/index.js +3 -7
  16. package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts +8 -27
  17. package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts.map +1 -1
  18. package/dest/contract_function_simulator/noir-structs/bounded_vec.js +8 -23
  19. package/dest/contract_function_simulator/noir-structs/contract_class_log_data.d.ts +9 -0
  20. package/dest/contract_function_simulator/noir-structs/contract_class_log_data.d.ts.map +1 -0
  21. package/dest/contract_function_simulator/noir-structs/contract_class_log_data.js +1 -0
  22. package/dest/contract_function_simulator/noir-structs/embedded_curve_point.d.ts +7 -0
  23. package/dest/contract_function_simulator/noir-structs/embedded_curve_point.d.ts.map +1 -0
  24. package/dest/contract_function_simulator/noir-structs/embedded_curve_point.js +1 -0
  25. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
  26. package/dest/contract_function_simulator/noir-structs/fact.d.ts +16 -0
  27. package/dest/contract_function_simulator/noir-structs/fact.d.ts.map +1 -0
  28. package/dest/contract_function_simulator/noir-structs/fact.js +6 -0
  29. package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts +27 -0
  30. package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts.map +1 -0
  31. package/dest/contract_function_simulator/noir-structs/fact_collection.js +29 -0
  32. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +11 -12
  33. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
  34. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +6 -49
  35. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +4 -8
  36. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  37. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -60
  38. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +2 -2
  39. package/dest/contract_function_simulator/noir-structs/option.d.ts +9 -11
  40. package/dest/contract_function_simulator/noir-structs/option.d.ts.map +1 -1
  41. package/dest/contract_function_simulator/noir-structs/option.js +18 -13
  42. package/dest/contract_function_simulator/noir-structs/origin_block.d.ts +11 -0
  43. package/dest/contract_function_simulator/noir-structs/origin_block.d.ts.map +1 -0
  44. package/dest/contract_function_simulator/noir-structs/origin_block.js +5 -0
  45. package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts +5 -8
  46. package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts.map +1 -1
  47. package/dest/contract_function_simulator/noir-structs/provided_secret.js +1 -14
  48. package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts +21 -0
  49. package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts.map +1 -0
  50. package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.js +33 -0
  51. package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts +21 -0
  52. package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts.map +1 -0
  53. package/dest/contract_function_simulator/noir-structs/resolved_tx.js +50 -0
  54. package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts +14 -0
  55. package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts.map +1 -0
  56. package/dest/contract_function_simulator/noir-structs/tx_effect_data.js +5 -0
  57. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +6 -11
  58. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  59. package/dest/contract_function_simulator/noir-structs/utility_context.js +1 -20
  60. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -14
  61. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  62. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -24
  63. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +81 -6
  64. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
  65. package/dest/contract_function_simulator/oracle/oracle_registry.js +128 -9
  66. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +80 -36
  67. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
  68. package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +926 -264
  69. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +13 -8
  70. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  71. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +80 -11
  72. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +46 -20
  73. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  74. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +119 -55
  75. package/dest/contract_sync/helpers.d.ts +7 -6
  76. package/dest/contract_sync/helpers.d.ts.map +1 -1
  77. package/dest/contract_sync/helpers.js +11 -16
  78. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  79. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  80. package/dest/entrypoints/client/bundle/utils.js +1 -0
  81. package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
  82. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  83. package/dest/entrypoints/client/lazy/utils.js +1 -0
  84. package/dest/entrypoints/pxe_creation_options.d.ts +8 -2
  85. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  86. package/dest/entrypoints/server/index.d.ts +1 -2
  87. package/dest/entrypoints/server/index.d.ts.map +1 -1
  88. package/dest/entrypoints/server/index.js +0 -1
  89. package/dest/entrypoints/server/utils.d.ts +1 -1
  90. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  91. package/dest/entrypoints/server/utils.js +3 -1
  92. package/dest/error_enriching.js +1 -1
  93. package/dest/hooks/execution_hooks.d.ts +16 -7
  94. package/dest/hooks/execution_hooks.d.ts.map +1 -1
  95. package/dest/hooks/execution_hooks.js +3 -3
  96. package/dest/hooks/index.d.ts +3 -3
  97. package/dest/hooks/index.d.ts.map +1 -1
  98. package/dest/hooks/resolve_tagging_secret_strategy.d.ts +41 -0
  99. package/dest/hooks/resolve_tagging_secret_strategy.d.ts.map +1 -0
  100. package/dest/hooks/resolve_tagging_secret_strategy.js +3 -0
  101. package/dest/logs/log_service.d.ts +6 -6
  102. package/dest/logs/log_service.d.ts.map +1 -1
  103. package/dest/logs/log_service.js +62 -28
  104. package/dest/messages/tx_resolver_service.d.ts +17 -0
  105. package/dest/messages/tx_resolver_service.d.ts.map +1 -0
  106. package/dest/messages/{message_context_service.js → tx_resolver_service.js} +8 -8
  107. package/dest/oracle_version.d.ts +2 -2
  108. package/dest/oracle_version.js +2 -2
  109. package/dest/private_kernel/hints/test_utils.js +1 -1
  110. package/dest/pxe.d.ts +46 -19
  111. package/dest/pxe.d.ts.map +1 -1
  112. package/dest/pxe.js +104 -52
  113. package/dest/storage/allowed_scopes.d.ts +6 -0
  114. package/dest/storage/allowed_scopes.d.ts.map +1 -0
  115. package/dest/storage/allowed_scopes.js +7 -0
  116. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +1 -1
  117. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -1
  118. package/dest/storage/backwards_compatibility_tests/schema_tests.js +86 -33
  119. package/dest/storage/capsule_store/capsule_service.d.ts +1 -1
  120. package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -1
  121. package/dest/storage/capsule_store/capsule_service.js +6 -9
  122. package/dest/storage/contract_store/contract_store.js +2 -2
  123. package/dest/storage/fact_store/fact_service.d.ts +20 -0
  124. package/dest/storage/fact_store/fact_service.d.ts.map +1 -0
  125. package/dest/storage/fact_store/fact_service.js +30 -0
  126. package/dest/storage/fact_store/fact_store.d.ts +95 -0
  127. package/dest/storage/fact_store/fact_store.d.ts.map +1 -0
  128. package/dest/storage/fact_store/fact_store.js +408 -0
  129. package/dest/storage/fact_store/fact_store_keys.d.ts +34 -0
  130. package/dest/storage/fact_store/fact_store_keys.d.ts.map +1 -0
  131. package/dest/storage/fact_store/fact_store_keys.js +50 -0
  132. package/dest/storage/fact_store/index.d.ts +5 -0
  133. package/dest/storage/fact_store/index.d.ts.map +1 -0
  134. package/dest/storage/fact_store/index.js +3 -0
  135. package/dest/storage/fact_store/stored_fact.d.ts +32 -0
  136. package/dest/storage/fact_store/stored_fact.d.ts.map +1 -0
  137. package/dest/storage/fact_store/stored_fact.js +64 -0
  138. package/dest/storage/index.d.ts +2 -1
  139. package/dest/storage/index.d.ts.map +1 -1
  140. package/dest/storage/index.js +1 -0
  141. package/dest/storage/metadata.d.ts +1 -1
  142. package/dest/storage/metadata.js +1 -1
  143. package/dest/storage/open_pxe_stores.d.ts +5 -3
  144. package/dest/storage/open_pxe_stores.d.ts.map +1 -1
  145. package/dest/storage/open_pxe_stores.js +5 -3
  146. package/dest/storage/tagging_store/index.d.ts +2 -2
  147. package/dest/storage/tagging_store/index.d.ts.map +1 -1
  148. package/dest/storage/tagging_store/index.js +1 -1
  149. package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts +40 -0
  150. package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts.map +1 -0
  151. package/dest/storage/tagging_store/tagging_secret_sources_store.js +92 -0
  152. package/package.json +17 -17
  153. package/src/block_synchronizer/block_stream_source.ts +6 -45
  154. package/src/block_synchronizer/block_synchronizer.ts +56 -23
  155. package/src/config/index.ts +1 -0
  156. package/src/contract_function_simulator/contract_function_simulator.ts +32 -31
  157. package/src/contract_function_simulator/index.ts +17 -8
  158. package/src/contract_function_simulator/noir-structs/bounded_vec.ts +12 -24
  159. package/src/contract_function_simulator/noir-structs/contract_class_log_data.ts +9 -0
  160. package/src/contract_function_simulator/noir-structs/embedded_curve_point.ts +4 -0
  161. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
  162. package/src/contract_function_simulator/noir-structs/fact.ts +13 -0
  163. package/src/contract_function_simulator/noir-structs/fact_collection.ts +59 -0
  164. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +20 -46
  165. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +7 -60
  166. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +2 -2
  167. package/src/contract_function_simulator/noir-structs/option.ts +17 -11
  168. package/src/contract_function_simulator/noir-structs/origin_block.ts +8 -0
  169. package/src/contract_function_simulator/noir-structs/provided_secret.ts +3 -14
  170. package/src/contract_function_simulator/noir-structs/resolved_tagging_strategy.ts +45 -0
  171. package/src/contract_function_simulator/noir-structs/resolved_tx.ts +53 -0
  172. package/src/contract_function_simulator/noir-structs/tx_effect_data.ts +15 -0
  173. package/src/contract_function_simulator/noir-structs/utility_context.ts +5 -17
  174. package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +6 -21
  175. package/src/contract_function_simulator/oracle/oracle_registry.ts +87 -79
  176. package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +641 -247
  177. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +94 -14
  178. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +206 -66
  179. package/src/contract_sync/helpers.ts +11 -18
  180. package/src/entrypoints/client/bundle/utils.ts +1 -0
  181. package/src/entrypoints/client/lazy/utils.ts +1 -0
  182. package/src/entrypoints/pxe_creation_options.ts +7 -1
  183. package/src/entrypoints/server/index.ts +0 -1
  184. package/src/entrypoints/server/utils.ts +3 -1
  185. package/src/error_enriching.ts +1 -1
  186. package/src/hooks/execution_hooks.ts +17 -8
  187. package/src/hooks/index.ts +6 -2
  188. package/src/hooks/resolve_tagging_secret_strategy.ts +46 -0
  189. package/src/logs/log_service.ts +71 -37
  190. package/src/messages/{message_context_service.ts → tx_resolver_service.ts} +16 -9
  191. package/src/oracle_version.ts +2 -2
  192. package/src/private_kernel/hints/test_utils.ts +1 -1
  193. package/src/pxe.ts +150 -54
  194. package/src/storage/allowed_scopes.ts +14 -0
  195. package/src/storage/backwards_compatibility_tests/__snapshots__/FactStore.json +40 -0
  196. package/src/storage/backwards_compatibility_tests/__snapshots__/L2TipsKVStore.json +1 -1
  197. package/src/storage/backwards_compatibility_tests/__snapshots__/TaggingSecretSourcesStore.json +30 -0
  198. package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +21 -5
  199. package/src/storage/backwards_compatibility_tests/schema_tests.ts +88 -33
  200. package/src/storage/capsule_store/capsule_service.ts +8 -13
  201. package/src/storage/contract_store/contract_store.ts +2 -2
  202. package/src/storage/fact_store/fact_service.ts +45 -0
  203. package/src/storage/fact_store/fact_store.ts +487 -0
  204. package/src/storage/fact_store/fact_store_keys.ts +75 -0
  205. package/src/storage/fact_store/index.ts +4 -0
  206. package/src/storage/fact_store/stored_fact.ts +80 -0
  207. package/src/storage/index.ts +1 -0
  208. package/src/storage/metadata.ts +1 -1
  209. package/src/storage/open_pxe_stores.ts +6 -3
  210. package/src/storage/tagging_store/index.ts +1 -1
  211. package/src/storage/tagging_store/tagging_secret_sources_store.ts +117 -0
  212. package/dest/messages/message_context_service.d.ts +0 -17
  213. package/dest/messages/message_context_service.d.ts.map +0 -1
  214. package/dest/storage/tagging_store/sender_address_book_store.d.ts +0 -14
  215. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +0 -1
  216. package/dest/storage/tagging_store/sender_address_book_store.js +0 -36
  217. package/src/storage/backwards_compatibility_tests/__snapshots__/SenderAddressBookStore.json +0 -16
  218. package/src/storage/tagging_store/sender_address_book_store.ts +0 -48
@@ -1,31 +1,30 @@
1
- import { ARCHIVE_HEIGHT } from '@aztec/constants';
2
1
  import { uniqueBy } from '@aztec/foundation/collection';
3
2
  import { Aes128 } from '@aztec/foundation/crypto/aes128';
4
3
  import { Fr } from '@aztec/foundation/curves/bn254';
4
+ import { Point } from '@aztec/foundation/curves/grumpkin';
5
5
  import { LogLevels, createLogger } from '@aztec/foundation/log';
6
- import { MembershipWitness } from '@aztec/foundation/trees';
7
6
  import { ExecutionError, extractCallStack, resolveAssertionMessageFromError, toACVMWitness, witnessMapToFields } from '@aztec/simulator/client';
8
7
  import { STANDARD_HANDSHAKE_REGISTRY_ADDRESS } from '@aztec/standard-contracts/handshake-registry/constants';
9
8
  import { FunctionSelector } from '@aztec/stdlib/abi';
10
9
  import { siloNullifier } from '@aztec/stdlib/hash';
11
- import { PublicKeys, computeAddressSecret, hashPublicKey } from '@aztec/stdlib/keys';
12
- import { AppTaggingSecret, MessageContext, deriveAppSiloedSharedSecret } from '@aztec/stdlib/logs';
10
+ import { computeAddressSecret, hashPublicKey } from '@aztec/stdlib/keys';
11
+ import { AppTaggingSecret, FlatPublicLogs, deriveAppSiloedSharedSecret } from '@aztec/stdlib/logs';
13
12
  import { getNonNullifiedL1ToL2MessageWitness } from '@aztec/stdlib/messaging';
14
13
  import { MerkleTreeId } from '@aztec/stdlib/trees';
15
- import { TxEffect } from '@aztec/stdlib/tx';
14
+ import { CallContext } from '@aztec/stdlib/tx';
16
15
  import { createContractLogger, logContractMessage, stripAztecnrLogPrefix } from '../../contract_logging.js';
17
16
  import { EventService } from '../../events/event_service.js';
18
17
  import { LogService } from '../../logs/log_service.js';
19
18
  import { NoteService } from '../../notes/note_service.js';
20
19
  import { ORACLE_VERSION_MAJOR } from '../../oracle_version.js';
20
+ import { FactCollectionKey, FactCollectionTypeKey } from '../../storage/fact_store/index.js';
21
21
  import { EphemeralArrayService } from '../ephemeral_array_service.js';
22
22
  import { BoundedVec } from '../noir-structs/bounded_vec.js';
23
23
  import { EphemeralArray } from '../noir-structs/ephemeral_array.js';
24
+ import { emptyFactCollection, toNoirFactCollection } from '../noir-structs/fact_collection.js';
24
25
  import { Option } from '../noir-structs/option.js';
25
- import { UtilityContext } from '../noir-structs/utility_context.js';
26
26
  import { pickNotes } from '../pick_notes.js';
27
27
  import { buildACIRCallback } from './acir_callback.js';
28
- import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
29
28
  /**
30
29
  * The oracle for an execution of utility contract functions.
31
30
  */ export class UtilityExecutionOracle {
@@ -38,7 +37,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
38
37
  transientArrayService;
39
38
  // We store oracle version to be able to show a nice error message when an oracle handler is missing.
40
39
  contractOracleVersion;
41
- contractAddress;
40
+ callContext;
42
41
  authWitnesses;
43
42
  capsules;
44
43
  anchorBlockHeader;
@@ -48,10 +47,11 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
48
47
  addressStore;
49
48
  aztecNode;
50
49
  recipientTaggingStore;
51
- senderAddressBookStore;
50
+ taggingSecretSourcesStore;
52
51
  capsuleService;
52
+ factService;
53
53
  privateEventStore;
54
- messageContextService;
54
+ txResolver;
55
55
  contractSyncService;
56
56
  l2TipsStore;
57
57
  jobId;
@@ -61,7 +61,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
61
61
  hooks;
62
62
  utilityExecutor;
63
63
  constructor(args){
64
- this.contractAddress = args.contractAddress;
64
+ this.callContext = args.callContext;
65
65
  this.authWitnesses = args.authWitnesses;
66
66
  this.capsules = args.capsules;
67
67
  this.anchorBlockHeader = args.anchorBlockHeader;
@@ -71,10 +71,11 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
71
71
  this.addressStore = args.addressStore;
72
72
  this.aztecNode = args.aztecNode;
73
73
  this.recipientTaggingStore = args.recipientTaggingStore;
74
- this.senderAddressBookStore = args.senderAddressBookStore;
74
+ this.taggingSecretSourcesStore = args.taggingSecretSourcesStore;
75
75
  this.capsuleService = args.capsuleService;
76
+ this.factService = args.factService;
76
77
  this.privateEventStore = args.privateEventStore;
77
- this.messageContextService = args.messageContextService;
78
+ this.txResolver = args.txResolver;
78
79
  this.contractSyncService = args.contractSyncService;
79
80
  this.l2TipsStore = args.l2TipsStore;
80
81
  this.jobId = args.jobId;
@@ -103,15 +104,20 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
103
104
  return Fr.random();
104
105
  }
105
106
  getUtilityContext() {
106
- return new UtilityContext(this.anchorBlockHeader, this.contractAddress);
107
+ return {
108
+ blockHeader: this.anchorBlockHeader,
109
+ contractAddress: this.callContext.contractAddress,
110
+ msgSender: this.callContext.msgSender
111
+ };
107
112
  }
108
113
  /**
109
114
  * Retrieve keys associated with a specific master public key and app address.
110
115
  * @param pkMHash - The master public key hash.
116
+ * @param _keyIndex - Sent by the Noir oracle caller but unused here; kept to match the oracle signature.
111
117
  * @returns A Promise that resolves to nullifier keys.
112
118
  * @throws If the keys are not registered in the key store.
113
119
  * @throws If scopes are defined and the account is not in the scopes.
114
- */ async getKeyValidationRequest(pkMHash) {
120
+ */ async getKeyValidationRequest(pkMHash, _keyIndex) {
115
121
  let hasAccess = false;
116
122
  for(let i = 0; i < this.scopes.length && !hasAccess; i++){
117
123
  if (await this.keyStore.accountHasKey(this.scopes[i], pkMHash)) {
@@ -151,7 +157,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
151
157
  // hash at all. If the block hash did not exist by the reference block hash, then the node will not return the
152
158
  // membership witness as there is none.
153
159
  const witness = await this.#queryWithBlockHashNotAfterAnchor(referenceBlockHash, ()=>this.aztecNode.getBlockHashMembershipWitness(referenceBlockHash, blockHash));
154
- return witness ? Option.some(witness) : Option.none(MembershipWitness.empty(ARCHIVE_HEIGHT));
160
+ return witness ? Option.some(witness) : Option.none();
155
161
  }
156
162
  /**
157
163
  * Returns a nullifier membership witness for a given nullifier at a given block.
@@ -218,10 +224,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
218
224
  */ async getPublicKeysAndPartialAddress(account) {
219
225
  const completeAddress = await this.addressStore.getCompleteAddress(account);
220
226
  if (!completeAddress) {
221
- return Option.none({
222
- publicKeys: PublicKeys.default(),
223
- partialAddress: Fr.ZERO
224
- });
227
+ return Option.none();
225
228
  }
226
229
  return Option.some({
227
230
  publicKeys: completeAddress.publicKeys,
@@ -232,7 +235,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
232
235
  const completeAddress = await this.addressStore.getCompleteAddress(account);
233
236
  if (!completeAddress) {
234
237
  throw new Error(`No public key registered for address ${account}.
235
- Register it by calling pxe.addAccount(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#simulation-error-no-public-key-registered-for-address-0x0-register-it-by-calling-pxeregisterrecipient-or-pxeregisteraccount`);
238
+ Register it by calling wallet.registerSender(...).\nSee docs for context: https://docs.aztec.network/errors/14`);
236
239
  }
237
240
  return completeAddress;
238
241
  }
@@ -332,7 +335,10 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
332
335
  * @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
333
336
  */ async getL1ToL2MembershipWitness(contractAddress, messageHash, secret) {
334
337
  const [messageIndex, siblingPath] = await getNonNullifiedL1ToL2MessageWitness(this.aztecNode, contractAddress, messageHash, secret, await this.anchorBlockHeader.hash());
335
- return new MessageLoadOracleInputs(messageIndex, siblingPath);
338
+ return {
339
+ index: messageIndex,
340
+ siblingPath
341
+ };
336
342
  }
337
343
  /**
338
344
  * Read the public storage data.
@@ -387,7 +393,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
387
393
  return EphemeralArray.fromValues(this.ephemeralArrayService, logs);
388
394
  }
389
395
  #createLogService() {
390
- return new LogService(this.aztecNode, this.anchorBlockHeader, this.l2TipsStore, this.keyStore, this.recipientTaggingStore, this.senderAddressBookStore, this.addressStore, this.jobId, this.logger.getBindings());
396
+ return new LogService(this.aztecNode, this.anchorBlockHeader, this.l2TipsStore, this.keyStore, this.recipientTaggingStore, this.taggingSecretSourcesStore, this.addressStore, this.jobId, this.logger.getBindings());
391
397
  }
392
398
  async validateAndStoreEnqueuedNotesAndEvents(noteValidationRequests, eventValidationRequests, scope) {
393
399
  await this.#processValidationRequests(noteValidationRequests.readAll(this.ephemeralArrayService), eventValidationRequests.readAll(this.ephemeralArrayService), scope);
@@ -412,10 +418,10 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
412
418
  const innerArrays = logRetrievalResponses.map((responses)=>EphemeralArray.fromValues(this.ephemeralArrayService, responses));
413
419
  return EphemeralArray.fromValues(this.ephemeralArrayService, innerArrays);
414
420
  }
415
- /** Reads tx hash requests from an ephemeral array, resolves their contexts, and returns the response array. */ async getMessageContextsByTxHash(requests) {
421
+ /** Given an array of tx hashes, returns an aligned array of tx info if the tx is available. */ async getResolvedTxs(requests) {
416
422
  const txHashes = requests.readAll(this.ephemeralArrayService);
417
- const maybeMessageContexts = await this.messageContextService.getMessageContextsByTxHash(txHashes, this.anchorBlockHeader.getBlockNumber());
418
- const options = maybeMessageContexts.map((mc)=>mc ? Option.some(mc) : Option.none(MessageContext.empty()));
423
+ const resolved = await this.txResolver.resolveTxs(txHashes, this.anchorBlockHeader.getBlockNumber());
424
+ const options = resolved.map((r)=>r ? Option.some(r) : Option.none());
419
425
  return EphemeralArray.fromValues(this.ephemeralArrayService, options);
420
426
  }
421
427
  /**
@@ -429,38 +435,69 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
429
435
  includeTxEffect: true
430
436
  });
431
437
  if (!receipt.isMined() || !receipt.txEffect || receipt.blockNumber > this.anchorBlockHeader.getBlockNumber()) {
432
- return Option.none(TxEffect.empty());
438
+ return Option.none();
433
439
  }
434
- return Option.some(receipt.txEffect);
440
+ const txEffect = receipt.txEffect;
441
+ return Option.some({
442
+ ...txEffect,
443
+ publicLogs: FlatPublicLogs.fromLogs(txEffect.publicLogs),
444
+ contractClassLogs: txEffect.contractClassLogs.map((log)=>({
445
+ contractAddress: log.contractAddress,
446
+ fields: log.fields.toFields(),
447
+ emittedLength: log.emittedLength
448
+ }))
449
+ });
435
450
  }
436
451
  setCapsule(contractAddress, slot, capsule, scope) {
437
- if (!contractAddress.equals(this.contractAddress)) {
438
- // TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
439
- throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
440
- }
452
+ this.#assertOwnContract(contractAddress);
441
453
  this.capsuleService.setCapsule(contractAddress, slot, capsule, this.jobId, scope);
442
454
  }
443
455
  async getCapsule(contractAddress, slot, tSize, scope) {
444
- if (!contractAddress.equals(this.contractAddress)) {
445
- // TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
446
- throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
447
- }
456
+ this.#assertOwnContract(contractAddress);
448
457
  const values = await this.capsuleService.getCapsule(contractAddress, slot, this.jobId, scope, this.capsules);
449
- return values ? Option.some(values) : Option.none(new Array(tSize).fill(Fr.ZERO));
458
+ return values ? Option.some(values) : Option.none({
459
+ length: tSize
460
+ });
450
461
  }
451
462
  deleteCapsule(contractAddress, slot, scope) {
452
- if (!contractAddress.equals(this.contractAddress)) {
453
- // TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
454
- throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
455
- }
463
+ this.#assertOwnContract(contractAddress);
456
464
  this.capsuleService.deleteCapsule(contractAddress, slot, this.jobId, scope);
457
465
  }
458
466
  copyCapsule(contractAddress, srcSlot, dstSlot, numEntries, scope) {
467
+ this.#assertOwnContract(contractAddress);
468
+ return this.capsuleService.copyCapsule(contractAddress, srcSlot, dstSlot, numEntries, this.jobId, scope);
469
+ }
470
+ /**
471
+ * Asserts the executing contract may only access its own slice of PXE DB.
472
+ */ #assertOwnContract(contractAddress) {
459
473
  if (!contractAddress.equals(this.contractAddress)) {
460
- // TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
461
474
  throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
462
475
  }
463
- return this.capsuleService.copyCapsule(contractAddress, srcSlot, dstSlot, numEntries, this.jobId, scope);
476
+ }
477
+ /**
478
+ * Records a fact into a collection. A `Some` origin block makes the fact retractable (pruned on reorg of that
479
+ * block), a `None` origin block makes it non-retractable, surviving reorgs.
480
+ */ recordFact(contractAddress, scope, factCollectionTypeId, factCollectionId, factTypeId, payload, originBlock) {
481
+ this.#assertOwnContract(contractAddress);
482
+ return this.factService.recordFact(new FactCollectionKey(contractAddress, scope, factCollectionTypeId, factCollectionId), factTypeId, payload.readAll(this.ephemeralArrayService), originBlock.isSome() ? originBlock.value : undefined, this.jobId);
483
+ }
484
+ /**
485
+ * Deletes a fact collection, removing all its facts. A no-op if no such collection exists.
486
+ */ deleteFactCollection(contractAddress, scope, factCollectionTypeId, factCollectionId) {
487
+ this.#assertOwnContract(contractAddress);
488
+ return this.factService.deleteFactCollection(new FactCollectionKey(contractAddress, scope, factCollectionTypeId, factCollectionId), this.jobId);
489
+ }
490
+ /**
491
+ * Returns a fact collection.
492
+ */ async getFactCollection(contractAddress, scope, factCollectionTypeId, factCollectionId) {
493
+ this.#assertOwnContract(contractAddress);
494
+ const collection = await this.factService.getFactCollection(new FactCollectionKey(contractAddress, scope, factCollectionTypeId, factCollectionId), this.jobId);
495
+ return collection ? Option.some(toNoirFactCollection(this.ephemeralArrayService, contractAddress, scope, factCollectionTypeId, factCollectionId, collection.facts)) : Option.none(emptyFactCollection(this.ephemeralArrayService));
496
+ }
497
+ /** Returns every fact collection of `factCollectionTypeId`. */ async getFactCollectionsByType(contractAddress, scope, factCollectionTypeId) {
498
+ this.#assertOwnContract(contractAddress);
499
+ const collections = await this.factService.getFactCollectionsByType(new FactCollectionTypeKey(contractAddress, scope, factCollectionTypeId), this.jobId);
500
+ return EphemeralArray.fromValues(this.ephemeralArrayService, collections.map((collection)=>toNoirFactCollection(this.ephemeralArrayService, collection.key.contractAddress, collection.key.scope, collection.key.factCollectionTypeId, collection.key.factCollectionId, collection.facts)));
464
501
  }
465
502
  /**
466
503
  * Clears cached sync state for a contract for a set of scopes, forcing re-sync on the next query so that newly
@@ -484,9 +521,9 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
484
521
  maxLength: capacity
485
522
  }));
486
523
  } catch {
487
- return Option.none(BoundedVec.empty({
524
+ return Option.none({
488
525
  maxLength: capacity
489
- }));
526
+ });
490
527
  }
491
528
  }
492
529
  /**
@@ -504,7 +541,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
504
541
  const ivskM = await this.keyStore.getMasterSecretKey(ivpkMHash);
505
542
  const addressSecret = await computeAddressSecret(await recipientCompleteAddress.getPreaddress(), ivskM);
506
543
  const ephPkPoints = ephPks.readAll(this.ephemeralArrayService);
507
- const secrets = await Promise.all(ephPkPoints.map((ephPk)=>deriveAppSiloedSharedSecret(addressSecret, ephPk, this.contractAddress)));
544
+ const secrets = await Promise.all(ephPkPoints.map(({ x, y })=>deriveAppSiloedSharedSecret(addressSecret, new Point(x, y), this.contractAddress)));
508
545
  return EphemeralArray.fromValues(this.ephemeralArrayService, secrets);
509
546
  }
510
547
  pushEphemeral(slot, elements) {
@@ -559,10 +596,8 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
559
596
  /** Executes another utility function from within this one and returns its serialized return values. */ async callUtilityFunction(targetContractAddress, functionSelector, args) {
560
597
  const targetArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(targetContractAddress, functionSelector);
561
598
  if (!targetContractAddress.equals(this.contractAddress)) {
562
- // The HandshakeRegistry is called during every contract's sync to discover handshake secrets.
563
- // It is a standard contract that only reads its own state, so it is always authorized.
564
- const isHandshakeRegistryRead = targetContractAddress.equals(STANDARD_HANDSHAKE_REGISTRY_ADDRESS) && functionSelector.equals(await FunctionSelector.fromSignature('get_handshakes((Field),u32)'));
565
- if (!isHandshakeRegistryRead) {
599
+ // Standard handshake registry reads are authorized by default; every other cross-contract call needs the hook.
600
+ if (!await isStandardHandshakeRegistryUtilityRead(targetContractAddress, functionSelector)) {
566
601
  const [callerInstance, targetInstance] = await Promise.all([
567
602
  this.getContractInstance(this.contractAddress),
568
603
  this.getContractInstance(targetContractAddress)
@@ -577,9 +612,9 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
577
612
  args,
578
613
  callerContext: this.callerContext
579
614
  };
580
- const response = this.hooks ? await this.hooks.authorizeUtilityCall(request) : {
615
+ const response = this.hooks?.authorizeUtilityCall ? await this.hooks.authorizeUtilityCall(request) : {
581
616
  authorized: false,
582
- reason: 'No execution hooks configured'
617
+ reason: 'No authorizeUtilityCall hook configured'
583
618
  };
584
619
  if (!response.authorized) {
585
620
  const reason = response.reason ? `: ${response.reason}` : '';
@@ -590,7 +625,12 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
590
625
  }
591
626
  this.logger.debug(`Calling nested utility function ${targetContractAddress}:${functionSelector} from ${this.contractAddress}`);
592
627
  const nestedOracle = new UtilityExecutionOracle({
593
- contractAddress: targetContractAddress,
628
+ callContext: CallContext.from({
629
+ msgSender: this.contractAddress,
630
+ contractAddress: targetContractAddress,
631
+ functionSelector,
632
+ isStaticCall: true
633
+ }),
594
634
  authWitnesses: this.authWitnesses,
595
635
  capsules: this.capsules,
596
636
  anchorBlockHeader: this.anchorBlockHeader,
@@ -600,10 +640,11 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
600
640
  addressStore: this.addressStore,
601
641
  aztecNode: this.aztecNode,
602
642
  recipientTaggingStore: this.recipientTaggingStore,
603
- senderAddressBookStore: this.senderAddressBookStore,
643
+ taggingSecretSourcesStore: this.taggingSecretSourcesStore,
604
644
  capsuleService: this.capsuleService,
645
+ factService: this.factService,
605
646
  privateEventStore: this.privateEventStore,
606
- messageContextService: this.messageContextService,
647
+ txResolver: this.txResolver,
607
648
  contractSyncService: this.contractSyncService,
608
649
  l2TipsStore: this.l2TipsStore,
609
650
  jobId: this.jobId,
@@ -682,4 +723,27 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
682
723
  /** The execution context of the current call. */ get callerContext() {
683
724
  return 'utility';
684
725
  }
726
+ /** The address of the contract whose function is being executed, from the call context. */ get contractAddress() {
727
+ return this.callContext.contractAddress;
728
+ }
729
+ }
730
+ const STANDARD_HANDSHAKE_REGISTRY_GET_HANDSHAKES_SIGNATURE = 'get_handshakes((Field),u32)';
731
+ const STANDARD_HANDSHAKE_REGISTRY_GET_APP_SILOED_SECRET_SIGNATURE = 'get_app_siloed_secret((Field),(Field))';
732
+ async function doesSelectorHaveSignature(functionSelector, signature) {
733
+ return functionSelector.equals(await FunctionSelector.fromSignature(signature));
734
+ }
735
+ /**
736
+ * Whether a cross-contract utility call targets one of the standard handshake registry's read functions.
737
+ *
738
+ * These reads are authorized by PXE for every wallet, without consulting the `authorizeUtilityCall` hook, so that
739
+ * wallets don't need to know the handshake registry exists in order to deliver and discover messages through it.
740
+ */ async function isStandardHandshakeRegistryUtilityRead(targetContractAddress, functionSelector) {
741
+ if (!targetContractAddress.equals(STANDARD_HANDSHAKE_REGISTRY_ADDRESS)) {
742
+ return false;
743
+ }
744
+ const [isGetHandshakes, isGetAppSiloedSecret] = await Promise.all([
745
+ doesSelectorHaveSignature(functionSelector, STANDARD_HANDSHAKE_REGISTRY_GET_HANDSHAKES_SIGNATURE),
746
+ doesSelectorHaveSignature(functionSelector, STANDARD_HANDSHAKE_REGISTRY_GET_APP_SILOED_SECRET_SIGNATURE)
747
+ ]);
748
+ return isGetHandshakes || isGetAppSiloedSecret;
685
749
  }
@@ -5,12 +5,13 @@ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
5
5
  import type { BlockHeader } from '@aztec/stdlib/tx';
6
6
  import type { ContractStore } from '../storage/contract_store/contract_store.js';
7
7
  /**
8
- * Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
9
- * from the instance is used.
8
+ * Read the current class id of a contract as of the given block, as seen by the AztecNode. The node resolves it from
9
+ * the same scheduled value change the AVM enforces against the public data tree. If the node has no record of the
10
+ * instance (e.g. it was never publicly deployed), the original class id from the local instance is used.
10
11
  * @param contractAddress - The address of the contract to read the class id for.
11
- * @param instance - The instance of the contract.
12
- * @param aztecNode - The Aztec node to query for storage.
13
- * @param header - The header of the block at which to load the DelayedPublicMutable storing the class id.
12
+ * @param instance - The local instance of the contract, used as a fallback when the node doesn't know it.
13
+ * @param aztecNode - The Aztec node to query.
14
+ * @param header - The header of the block at which to resolve the current class id.
14
15
  * @returns The current class id.
15
16
  */
16
17
  export declare function readCurrentClassId(contractAddress: AztecAddress, instance: ContractInstance, aztecNode: AztecNode, header: BlockHeader): Promise<import("@aztec/foundation/schemas").Fr>;
@@ -24,4 +25,4 @@ export declare function syncScope(contractAddress: AztecAddress, contractStore:
24
25
  * @param header - The header of the block at which to verify the current class id.
25
26
  */
26
27
  export declare function verifyCurrentClassId(contractAddress: AztecAddress, aztecNode: AztecNode, contractStore: ContractStore, header: BlockHeader): Promise<void>;
27
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnRyYWN0X3N5bmMvaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQU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VMsRUFDcEIsYUFBYSxFQUFFLGFBQWEsRUFDNUIsTUFBTSxFQUFFLFdBQVcsaUJBYXBCIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/contract_sync/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAEjF;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,mDAapB;AAED,wBAAsB,SAAS,CAC7B,eAAe,EAAE,YAAY,EAC7B,aAAa,EAAE,aAAa,EAC5B,yBAAyB,EAAE,gBAAgB,GAAG,IAAI,EAClD,eAAe,EAAE,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EACxF,KAAK,EAAE,YAAY,iBAepB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,WAAW,iBAapB"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/contract_sync/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAEjF;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,mDAMpB;AAED,wBAAsB,SAAS,CAC7B,eAAe,EAAE,YAAY,EAC7B,aAAa,EAAE,aAAa,EAC5B,yBAAyB,EAAE,gBAAgB,GAAG,IAAI,EAClD,eAAe,EAAE,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EACxF,KAAK,EAAE,YAAY,iBAepB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,WAAW,iBAapB"}
@@ -1,23 +1,18 @@
1
- import { ProtocolContractAddress, isProtocolContract } from '@aztec/protocol-contracts';
2
- import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '@aztec/stdlib/delayed-public-mutable';
1
+ import { isProtocolContract } from '@aztec/protocol-contracts';
3
2
  /**
4
- * Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
5
- * from the instance is used.
3
+ * Read the current class id of a contract as of the given block, as seen by the AztecNode. The node resolves it from
4
+ * the same scheduled value change the AVM enforces against the public data tree. If the node has no record of the
5
+ * instance (e.g. it was never publicly deployed), the original class id from the local instance is used.
6
6
  * @param contractAddress - The address of the contract to read the class id for.
7
- * @param instance - The instance of the contract.
8
- * @param aztecNode - The Aztec node to query for storage.
9
- * @param header - The header of the block at which to load the DelayedPublicMutable storing the class id.
7
+ * @param instance - The local instance of the contract, used as a fallback when the node doesn't know it.
8
+ * @param aztecNode - The Aztec node to query.
9
+ * @param header - The header of the block at which to resolve the current class id.
10
10
  * @returns The current class id.
11
11
  */ export async function readCurrentClassId(contractAddress, instance, aztecNode, header) {
12
- const blockHash = await header.hash();
13
- const timestamp = header.globalVariables.timestamp;
14
- const { delayedPublicMutableSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
15
- const delayedPublicMutableValues = await DelayedPublicMutableValues.readFromTree(delayedPublicMutableSlot, (slot)=>aztecNode.getPublicStorageAt(blockHash, ProtocolContractAddress.ContractInstanceRegistry, slot));
16
- let currentClassId = delayedPublicMutableValues.svc.getCurrentAt(timestamp)[0];
17
- if (currentClassId.isZero()) {
18
- currentClassId = instance.originalContractClassId;
19
- }
20
- return currentClassId;
12
+ const nodeInstance = await aztecNode.getContract(contractAddress, await header.hash());
13
+ // If the contract was upgraded then the node WILL know of that and return a non-undefined instance. An undefined
14
+ // result therefore means that no upgrade has happened, and therefore that the original class is the current one.
15
+ return nodeInstance?.currentContractClassId ?? instance.originalContractClassId;
21
16
  }
22
17
  export async function syncScope(contractAddress, contractStore, functionToInvokeAfterSync, utilityExecutor, scope) {
23
18
  // Protocol contracts don't have private state to sync
@@ -13,4 +13,4 @@ import { type PXECreationOptions } from '../../pxe_creation_options.js';
13
13
  * @returns A Promise that resolves to the started PXE instance.
14
14
  */
15
15
  export declare function createPXE(aztecNode: AztecNode, config: PXEConfig, options?: PXECreationOptions): Promise<PXE>;
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvY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Usa0JBQW9DLGdCQWdEOUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/bundle/utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,+BAA+B,CAAC;AAE/F;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,kBAAoC,gBA+C9C"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/bundle/utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,+BAA+B,CAAC;AAE/F;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,kBAAoC,gBAgD9C"}
@@ -58,6 +58,7 @@ import { isPrivateKernelProver } from '../../pxe_creation_options.js';
58
58
  });
59
59
  const pxe = await PXE.create({
60
60
  node: aztecNode,
61
+ nodeDebug: options.nodeDebug,
61
62
  store,
62
63
  proofCreator: prover,
63
64
  simulator,
@@ -12,4 +12,4 @@ import { type PXECreationOptions } from '../../pxe_creation_options.js';
12
12
  * @returns A Promise that resolves to the started PXE instance.
13
13
  */
14
14
  export declare function createPXE(aztecNode: AztecNode, config: PXEConfig, options?: PXECreationOptions): Promise<PXE>;
15
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvbGF6eS91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVqRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsR0FBRyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFFdEMsT0FBTyxFQUFFLEtBQUssa0JBQWtCLEVBQXlCLE1BQU0sK0JBQStCLENBQUM7QUFFL0Y7Ozs7Ozs7O0dBUUc7QUFDSCx3QkFBc0IsU0FBUyxDQUM3QixTQUFTLEVBQUUsU0FBUyxFQUNwQixNQUFNLEVBQUUsU0FBUyxFQUNqQixPQUFPLEdBQUUsa0JBQW9DLGdCQWdEOUMifQ==
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvbGF6eS91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVqRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsR0FBRyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFFdEMsT0FBTyxFQUFFLEtBQUssa0JBQWtCLEVBQXlCLE1BQU0sK0JBQStCLENBQUM7QUFFL0Y7Ozs7Ozs7O0dBUUc7QUFDSCx3QkFBc0IsU0FBUyxDQUM3QixTQUFTLEVBQUUsU0FBUyxFQUNwQixNQUFNLEVBQUUsU0FBUyxFQUNqQixPQUFPLEdBQUUsa0JBQW9DLGdCQWlEOUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,+BAA+B,CAAC;AAE/F;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,kBAAoC,gBAgD9C"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,+BAA+B,CAAC;AAE/F;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,kBAAoC,gBAiD9C"}
@@ -57,6 +57,7 @@ import { isPrivateKernelProver } from '../../pxe_creation_options.js';
57
57
  });
58
58
  const pxe = await PXE.create({
59
59
  node: aztecNode,
60
+ nodeDebug: options.nodeDebug,
60
61
  store,
61
62
  proofCreator: prover,
62
63
  simulator,
@@ -2,7 +2,7 @@ import type { BBPrivateKernelProverOptions } from '@aztec/bb-prover/client';
2
2
  import type { Logger } from '@aztec/foundation/log';
3
3
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
4
  import type { CircuitSimulator } from '@aztec/simulator/client';
5
- import type { PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
5
+ import type { AztecNodeDebug, PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
6
6
  import type { ExecutionHooks } from '../hooks/index.js';
7
7
  import type { PreloadedContractsProvider } from '../pxe.js';
8
8
  export type PXECreationOptions = {
@@ -20,7 +20,13 @@ export type PXECreationOptions = {
20
20
  hooks?: ExecutionHooks;
21
21
  /** Contracts to preload on startup. Replaces the default when set. */
22
22
  preloadedContractsProvider?: PreloadedContractsProvider;
23
+ /**
24
+ * Optional debug API client for the same node. When provided, public function signatures are registered so the
25
+ * node can produce named public-execution stack traces. Only available on nodes started with debug endpoints
26
+ * enabled; omitted in prod-like setups.
27
+ */
28
+ nodeDebug?: AztecNodeDebug;
23
29
  };
24
30
  /** Checks if the given value implements the PrivateKernelProver interface via duck-typing. */
25
31
  export declare function isPrivateKernelProver(value: unknown): value is PrivateKernelProver;
26
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlX2NyZWF0aW9uX29wdGlvbnMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lbnRyeXBvaW50cy9weGVfY3JlYXRpb25fb3B0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSw0QkFBNEIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzVFLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixF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;AAC9F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAIlF"}
@@ -1,6 +1,5 @@
1
1
  export * from '../../notes_filter.js';
2
2
  export * from '../../pxe.js';
3
- export * from '../../hooks/index.js';
4
3
  export * from '../../config/index.js';
5
4
  export * from '../../error_enriching.js';
6
5
  export * from '../../storage/index.js';
@@ -10,4 +9,4 @@ export { ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR } from '../../oracle_version
10
9
  export { type PXECreationOptions } from '../pxe_creation_options.js';
11
10
  export { JobCoordinator } from '../../job_coordinator/job_coordinator.js';
12
11
  export { ContractSyncService } from '../../contract_sync/contract_sync_service.js';
13
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9zZXJ2ZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsWUFBWSxDQUFDO0FBQzNCLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNyRixPQUFPLEVBQUUsS0FBSyxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ3JFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSwwQ0FBMEMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSw4Q0FBOEMsQ0FBQyJ9
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9zZXJ2ZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLFlBQVksQ0FBQztBQUMzQixPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDMUQsT0FBTyxFQUFFLG9CQUFvQixFQUFFLG9CQUFvQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDckYsT0FBTyxFQUFFLEtBQUssa0JBQWtCLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNyRSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sMENBQTBDLENBQUM7QUFDMUUsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sOENBQThDLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC"}
@@ -1,6 +1,5 @@
1
1
  export * from '../../notes_filter.js';
2
2
  export * from '../../pxe.js';
3
- export * from '../../hooks/index.js';
4
3
  export * from '../../config/index.js';
5
4
  export * from '../../error_enriching.js';
6
5
  export * from '../../storage/index.js';
@@ -6,4 +6,4 @@ import { type PXECreationOptions } from '../pxe_creation_options.js';
6
6
  type PXEConfigWithoutDefaults = Omit<PXEConfig, 'l1ChainId' | 'l2BlockBatchSize' | 'rollupVersion' | keyof L1ContractAddresses>;
7
7
  export declare function createPXE(aztecNode: AztecNode, config: PXEConfigWithoutDefaults, options?: PXECreationOptions): Promise<PXE>;
8
8
  export {};
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzI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Sx1QkFBdUIsQ0FBQztBQUN2RCxPQUFPLEVBQUUsR0FBRyxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBRW5DLE9BQU8sRUFBRSxLQUFLLGtCQUFrQixFQUF5QixNQUFNLDRCQUE0QixDQUFDO0FBRTVGLEtBQUssd0JBQXdCLEdBQUcsSUFBSSxDQUNsQyxTQUFTLEVBQ1QsV0FBVyxHQUFHLGtCQUFrQixHQUFHLGVBQWUsR0FBRyxNQUFNLG1CQUFtQixDQUMvRSxDQUFDO0FBRUYsd0JBQXNCLFNBQVMsQ0FDN0IsU0FBUyxFQUFFLFNBQVMsRUFDcEIsTUFBTSxFQUFFLHdCQUF3QixFQUNoQyxPQUFPLEdBQUUsa0JBQW9DLGdCQTZEOUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AASjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,4BAA4B,CAAC;AAE5F,KAAK,wBAAwB,GAAG,IAAI,CAClC,SAAS,EACT,WAAW,GAAG,kBAAkB,GAAG,eAAe,GAAG,MAAM,mBAAmB,CAC/E,CAAC;AAEF,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,wBAAwB,EAChC,OAAO,GAAE,kBAAoC,gBA4D9C"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAUjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,4BAA4B,CAAC;AAE5F,KAAK,wBAAwB,GAAG,IAAI,CAClC,SAAS,EACT,WAAW,GAAG,kBAAkB,GAAG,eAAe,GAAG,MAAM,mBAAmB,CAC/E,CAAC;AAEF,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,wBAAwB,EAChC,OAAO,GAAE,kBAAoC,gBA6D9C"}
@@ -2,7 +2,8 @@ import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
2
2
  import { createLogger } from '@aztec/foundation/log';
3
3
  import { createStore } from '@aztec/kv-store/lmdb-v2';
4
4
  import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
5
- import { MemoryCircuitRecorder, SimulatorRecorderWrapper, WASMSimulator } from '@aztec/simulator/client';
5
+ import { WASMSimulator } from '@aztec/simulator/client';
6
+ import { MemoryCircuitRecorder, SimulatorRecorderWrapper } from '@aztec/simulator/server';
6
7
  import { FileCircuitRecorder } from '@aztec/simulator/testing';
7
8
  import { getStandardAuthRegistry } from '@aztec/standard-contracts/auth-registry';
8
9
  import { getStandardHandshakeRegistry } from '@aztec/standard-contracts/handshake-registry';
@@ -62,6 +63,7 @@ export async function createPXE(aztecNode, config, options = {
62
63
  });
63
64
  const pxe = await PXE.create({
64
65
  node: aztecNode,
66
+ nodeDebug: options.nodeDebug,
65
67
  store: options.store,
66
68
  proofCreator: prover,
67
69
  simulator,
@@ -23,7 +23,7 @@ import { isNoirCallStackUnresolved } from '@aztec/stdlib/errors';
23
23
  await Promise.all([
24
24
  ...mentionedFunctions.entries()
25
25
  ].map(async ([contractAddress, fnSelectors])=>{
26
- const parsedContractAddress = AztecAddress.fromString(contractAddress);
26
+ const parsedContractAddress = AztecAddress.fromStringUnsafe(contractAddress);
27
27
  const contract = await contractStore.getContract(parsedContractAddress);
28
28
  if (contract) {
29
29
  err.enrichWithContractName(parsedContractAddress, contract.name);