@aztec/pxe 0.0.1-commit.1bea0213 → 0.0.1-commit.217f559981

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 (175) 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 +5 -3
  5. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  6. package/dest/block_synchronizer/block_synchronizer.js +9 -3
  7. package/dest/config/package_info.js +1 -1
  8. package/dest/contract_function_simulator/contract_function_simulator.d.ts +54 -30
  9. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  10. package/dest/contract_function_simulator/contract_function_simulator.js +172 -68
  11. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
  12. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -2
  13. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  14. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
  15. package/dest/contract_function_simulator/oracle/interfaces.d.ts +9 -9
  16. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/oracle/oracle.d.ts +5 -5
  18. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  19. package/dest/contract_function_simulator/oracle/oracle.js +32 -20
  20. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +36 -36
  21. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  22. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +66 -21
  23. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +48 -24
  24. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  25. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +84 -63
  26. package/dest/contract_logging.d.ts +22 -0
  27. package/dest/contract_logging.d.ts.map +1 -0
  28. package/dest/contract_logging.js +23 -0
  29. package/dest/contract_sync/contract_sync_service.d.ts +43 -0
  30. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  31. package/dest/contract_sync/contract_sync_service.js +97 -0
  32. package/dest/contract_sync/helpers.d.ts +29 -0
  33. package/dest/contract_sync/helpers.d.ts.map +1 -0
  34. package/dest/contract_sync/{index.js → helpers.js} +13 -12
  35. package/dest/debug/pxe_debug_utils.d.ts +24 -10
  36. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  37. package/dest/debug/pxe_debug_utils.js +28 -18
  38. package/dest/entrypoints/client/bundle/index.d.ts +4 -1
  39. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  40. package/dest/entrypoints/client/bundle/index.js +3 -0
  41. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  42. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  43. package/dest/entrypoints/client/bundle/utils.js +21 -7
  44. package/dest/entrypoints/client/lazy/index.d.ts +4 -1
  45. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  46. package/dest/entrypoints/client/lazy/index.js +3 -0
  47. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  48. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  49. package/dest/entrypoints/client/lazy/utils.js +22 -8
  50. package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
  51. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  52. package/dest/entrypoints/server/index.d.ts +4 -2
  53. package/dest/entrypoints/server/index.d.ts.map +1 -1
  54. package/dest/entrypoints/server/index.js +3 -1
  55. package/dest/entrypoints/server/utils.d.ts +1 -1
  56. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  57. package/dest/entrypoints/server/utils.js +28 -9
  58. package/dest/events/event_service.d.ts +4 -5
  59. package/dest/events/event_service.d.ts.map +1 -1
  60. package/dest/events/event_service.js +5 -6
  61. package/dest/job_coordinator/job_coordinator.d.ts +3 -2
  62. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -1
  63. package/dest/job_coordinator/job_coordinator.js +3 -2
  64. package/dest/logs/log_service.d.ts +7 -5
  65. package/dest/logs/log_service.d.ts.map +1 -1
  66. package/dest/logs/log_service.js +15 -25
  67. package/dest/notes/note_service.d.ts +7 -7
  68. package/dest/notes/note_service.d.ts.map +1 -1
  69. package/dest/notes/note_service.js +9 -9
  70. package/dest/notes_filter.d.ts +25 -0
  71. package/dest/notes_filter.d.ts.map +1 -0
  72. package/dest/notes_filter.js +4 -0
  73. package/dest/oracle_version.d.ts +3 -3
  74. package/dest/oracle_version.d.ts.map +1 -1
  75. package/dest/oracle_version.js +2 -2
  76. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  77. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  78. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  79. package/dest/private_kernel/hints/index.d.ts +1 -1
  80. package/dest/private_kernel/hints/index.js +1 -1
  81. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +4 -4
  82. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  83. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  84. package/dest/private_kernel/private_kernel_execution_prover.js +8 -8
  85. package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
  86. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  87. package/dest/private_kernel/private_kernel_oracle.js +7 -3
  88. package/dest/pxe.d.ts +69 -23
  89. package/dest/pxe.d.ts.map +1 -1
  90. package/dest/pxe.js +96 -62
  91. package/dest/storage/address_store/address_store.d.ts +1 -1
  92. package/dest/storage/address_store/address_store.d.ts.map +1 -1
  93. package/dest/storage/address_store/address_store.js +12 -11
  94. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
  95. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
  96. package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
  97. package/dest/storage/capsule_store/capsule_store.js +6 -8
  98. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  99. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  100. package/dest/storage/contract_store/contract_store.js +157 -72
  101. package/dest/storage/metadata.d.ts +1 -1
  102. package/dest/storage/metadata.js +1 -1
  103. package/dest/storage/note_store/note_store.d.ts +13 -3
  104. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  105. package/dest/storage/note_store/note_store.js +147 -107
  106. package/dest/storage/private_event_store/private_event_store.d.ts +1 -1
  107. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  108. package/dest/storage/private_event_store/private_event_store.js +84 -61
  109. package/dest/storage/private_event_store/stored_private_event.js +1 -1
  110. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +1 -1
  111. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  112. package/dest/storage/tagging_store/recipient_tagging_store.js +31 -19
  113. package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
  114. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
  115. package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
  116. package/dest/storage/tagging_store/sender_tagging_store.d.ts +1 -1
  117. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  118. package/dest/storage/tagging_store/sender_tagging_store.js +183 -113
  119. package/dest/tagging/get_all_logs_by_tags.d.ts +1 -1
  120. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
  121. package/dest/tagging/get_all_logs_by_tags.js +17 -3
  122. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +4 -4
  123. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  124. package/package.json +25 -16
  125. package/src/access_scopes.ts +9 -0
  126. package/src/block_synchronizer/block_synchronizer.ts +21 -12
  127. package/src/config/package_info.ts +1 -1
  128. package/src/contract_function_simulator/contract_function_simulator.ts +321 -125
  129. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
  130. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  131. package/src/contract_function_simulator/oracle/interfaces.ts +10 -10
  132. package/src/contract_function_simulator/oracle/oracle.ts +35 -18
  133. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +88 -101
  134. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +133 -64
  135. package/src/contract_logging.ts +39 -0
  136. package/src/contract_sync/contract_sync_service.ts +152 -0
  137. package/src/contract_sync/{index.ts → helpers.ts} +21 -21
  138. package/src/debug/pxe_debug_utils.ts +63 -19
  139. package/src/entrypoints/client/bundle/index.ts +3 -0
  140. package/src/entrypoints/client/bundle/utils.ts +16 -15
  141. package/src/entrypoints/client/lazy/index.ts +3 -0
  142. package/src/entrypoints/client/lazy/utils.ts +17 -15
  143. package/src/entrypoints/pxe_creation_options.ts +2 -1
  144. package/src/entrypoints/server/index.ts +3 -1
  145. package/src/entrypoints/server/utils.ts +22 -26
  146. package/src/events/event_service.ts +4 -6
  147. package/src/job_coordinator/job_coordinator.ts +4 -3
  148. package/src/logs/log_service.ts +20 -32
  149. package/src/notes/note_service.ts +9 -10
  150. package/src/notes_filter.ts +26 -0
  151. package/src/oracle_version.ts +2 -2
  152. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  153. package/src/private_kernel/hints/index.ts +1 -1
  154. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +7 -7
  155. package/src/private_kernel/private_kernel_execution_prover.ts +12 -9
  156. package/src/private_kernel/private_kernel_oracle.ts +7 -7
  157. package/src/pxe.ts +189 -114
  158. package/src/storage/address_store/address_store.ts +15 -15
  159. package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
  160. package/src/storage/capsule_store/capsule_store.ts +8 -8
  161. package/src/storage/contract_store/contract_store.ts +186 -76
  162. package/src/storage/metadata.ts +1 -1
  163. package/src/storage/note_store/note_store.ts +169 -132
  164. package/src/storage/private_event_store/private_event_store.ts +102 -81
  165. package/src/storage/private_event_store/stored_private_event.ts +1 -1
  166. package/src/storage/tagging_store/recipient_tagging_store.ts +31 -21
  167. package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
  168. package/src/storage/tagging_store/sender_tagging_store.ts +210 -126
  169. package/src/tagging/get_all_logs_by_tags.ts +28 -4
  170. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +4 -4
  171. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  172. package/dest/contract_sync/index.d.ts +0 -23
  173. package/dest/contract_sync/index.d.ts.map +0 -1
  174. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  175. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { MAX_INCLUDE_BY_TIMESTAMP_DURATION } from '@aztec/constants';
1
+ import { MAX_TX_LIFETIME } from '@aztec/constants';
2
2
  import type { PrivateKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
3
3
  import type { UInt64 } from '@aztec/stdlib/types';
4
4
 
@@ -8,12 +8,12 @@ const ROUNDED_DURATIONS = [
8
8
  1, // 1 second
9
9
  ];
10
10
 
11
- function roundTimestamp(blockTimestamp: bigint, includeByTimestamp: bigint): UInt64 {
11
+ function roundTimestamp(blockTimestamp: bigint, expirationTimestamp: bigint): UInt64 {
12
12
  return ROUNDED_DURATIONS.reduce((timestamp, duration) => {
13
13
  if (timestamp <= blockTimestamp) {
14
14
  // The timestamp must be greater than the block timestamp.
15
15
  // If it is too small, round it down again using a smaller duration.
16
- const totalDuration = includeByTimestamp - blockTimestamp;
16
+ const totalDuration = expirationTimestamp - blockTimestamp;
17
17
  const roundedDuration = totalDuration - (totalDuration % BigInt(duration));
18
18
  return blockTimestamp + roundedDuration;
19
19
  }
@@ -21,36 +21,36 @@ function roundTimestamp(blockTimestamp: bigint, includeByTimestamp: bigint): UIn
21
21
  }, 0n);
22
22
  }
23
23
 
24
- export function computeTxIncludeByTimestamp(
24
+ export function computeTxExpirationTimestamp(
25
25
  previousKernel: PrivateKernelCircuitPublicInputs,
26
- maxDuration = MAX_INCLUDE_BY_TIMESTAMP_DURATION,
26
+ txLifetime = MAX_TX_LIFETIME,
27
27
  ): UInt64 {
28
- if (maxDuration > MAX_INCLUDE_BY_TIMESTAMP_DURATION) {
28
+ if (txLifetime > MAX_TX_LIFETIME) {
29
29
  throw new Error(
30
- `Custom max duration cannot be greater than the max allowed. Max allowed: ${MAX_INCLUDE_BY_TIMESTAMP_DURATION}. Custom value: ${maxDuration}.`,
30
+ `Custom tx lifetime cannot be greater than the max allowed. Max allowed: ${MAX_TX_LIFETIME}. Custom value: ${txLifetime}.`,
31
31
  );
32
32
  }
33
33
 
34
34
  const anchorBlockTimestamp = previousKernel.constants.anchorBlockHeader.globalVariables.timestamp;
35
- const maxTimestamp = anchorBlockTimestamp + BigInt(maxDuration);
36
- const includeByTimestamp = previousKernel.includeByTimestamp;
35
+ const maxTimestamp = anchorBlockTimestamp + BigInt(txLifetime);
36
+ const expirationTimestamp = previousKernel.expirationTimestamp;
37
37
 
38
- // If the includeByTimestamp set during the tx execution is greater than or equal to the max allowed duration,
38
+ // If the expirationTimestamp set during the tx execution is greater than or equal to the max allowed duration,
39
39
  // use the maximum allowed timestamp.
40
40
  // Note: It shouldn't be larger than the max allowed duration, but we check for it anyway.
41
- if (includeByTimestamp >= maxTimestamp) {
41
+ if (expirationTimestamp >= maxTimestamp) {
42
42
  return maxTimestamp;
43
43
  }
44
44
 
45
45
  // Round it down to the nearest hour/min/second to reduce precision and avoid revealing the exact value.
46
46
  // This makes it harder for others to infer what function calls may have been used to produce a specific timestamp.
47
- const roundedTimestamp = roundTimestamp(anchorBlockTimestamp, includeByTimestamp);
47
+ const roundedTimestamp = roundTimestamp(anchorBlockTimestamp, expirationTimestamp);
48
48
 
49
49
  // The tx can't be published if the timestamp is the same or less than the anchor block's timestamp.
50
50
  // Future blocks will have a greater timestamp, so the tx would never be included.
51
51
  if (roundedTimestamp <= anchorBlockTimestamp) {
52
52
  throw new Error(
53
- `Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${includeByTimestamp}.`,
53
+ `Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${expirationTimestamp}.`,
54
54
  );
55
55
  }
56
56
 
@@ -1,2 +1,2 @@
1
1
  export * from './private_kernel_reset_private_inputs_builder.js';
2
- export * from './compute_tx_include_by_timestamp.js';
2
+ export * from './compute_tx_expiration_timestamp.js';
@@ -26,7 +26,7 @@ import {
26
26
  type PrivateKernelSimulateOutput,
27
27
  ReadRequestActionEnum,
28
28
  ReadRequestResetActions,
29
- type ScopedKeyValidationRequestAndGenerator,
29
+ type ScopedKeyValidationRequestAndSeparator,
30
30
  ScopedNoteHash,
31
31
  ScopedNullifier,
32
32
  ScopedReadRequest,
@@ -68,9 +68,9 @@ function getNullifierMembershipWitnessResolver(oracle: PrivateKernelOracle) {
68
68
  };
69
69
  }
70
70
 
71
- async function getMasterSecretKeysAndAppKeyGenerators(
71
+ async function getMasterSecretKeysAndKeyTypeDomainSeparators(
72
72
  keyValidationRequests: ClaimedLengthArray<
73
- ScopedKeyValidationRequestAndGenerator,
73
+ ScopedKeyValidationRequestAndSeparator,
74
74
  typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX
75
75
  >,
76
76
  numRequestsToVerify: number,
@@ -189,8 +189,8 @@ export class PrivateKernelResetPrivateInputsBuilder {
189
189
  this.previousKernel.validationRequests.nullifierReadRequests,
190
190
  this.nullifierResetActions,
191
191
  ),
192
- getMasterSecretKeysAndAppKeyGenerators(
193
- this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators,
192
+ getMasterSecretKeysAndKeyTypeDomainSeparators(
193
+ this.previousKernel.validationRequests.scopedKeyValidationRequestsAndSeparators,
194
194
  dimensions.KEY_VALIDATION,
195
195
  oracle,
196
196
  ),
@@ -357,8 +357,8 @@ export class PrivateKernelResetPrivateInputsBuilder {
357
357
  }
358
358
 
359
359
  private needsResetNullifierKeys() {
360
- const numCurr = this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators.claimedLength;
361
- const numNext = this.nextIteration ? this.nextIteration.keyValidationRequestsAndGenerators.claimedLength : 0;
360
+ const numCurr = this.previousKernel.validationRequests.scopedKeyValidationRequestsAndSeparators.claimedLength;
361
+ const numNext = this.nextIteration ? this.nextIteration.keyValidationRequestsAndSeparators.claimedLength : 0;
362
362
  const maxAmountToKeep = !this.nextIteration ? 0 : MAX_KEY_VALIDATION_REQUESTS_PER_TX;
363
363
  if (numCurr + numNext <= maxAmountToKeep) {
364
364
  return false;
@@ -1,6 +1,6 @@
1
1
  import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto/keys';
2
2
  import { Fr } from '@aztec/foundation/curves/bn254';
3
- import { createLogger } from '@aztec/foundation/log';
3
+ import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
4
4
  import { pushTestData } from '@aztec/foundation/testing';
5
5
  import { Timer } from '@aztec/foundation/timer';
6
6
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
@@ -56,13 +56,16 @@ export interface PrivateKernelExecutionProverConfig {
56
56
  * inform state tree updates.
57
57
  */
58
58
  export class PrivateKernelExecutionProver {
59
- private log = createLogger('pxe:private-kernel-execution-prover');
59
+ private log: Logger;
60
60
 
61
61
  constructor(
62
62
  private oracle: PrivateKernelOracle,
63
63
  private proofCreator: PrivateKernelProver,
64
64
  private fakeProofs = false,
65
- ) {}
65
+ bindings?: LoggerBindings,
66
+ ) {
67
+ this.log = createLogger('pxe:private-kernel-execution-prover', bindings);
68
+ }
66
69
 
67
70
  /**
68
71
  * Generate a proof for a given transaction request and execution result.
@@ -257,20 +260,20 @@ export class PrivateKernelExecutionProver {
257
260
  // TODO: Enable padding once we better understand the final amounts to pad to.
258
261
  const paddedSideEffectAmounts = PaddedSideEffectAmounts.empty();
259
262
 
260
- // Use the aggregated includeByTimestamp set throughout the tx execution.
261
- // TODO: Call `computeTxIncludeByTimestamp` to round the value down and reduce precision, improving privacy.
262
- const includeByTimestampUpperBound = previousKernelData.publicInputs.includeByTimestamp;
263
+ // Use the aggregated expirationTimestamp set throughout the tx execution.
264
+ // TODO: Call `computeTxExpirationTimestamp` to round the value down and reduce precision, improving privacy.
265
+ const expirationTimestampUpperBound = previousKernelData.publicInputs.expirationTimestamp;
263
266
  const anchorBlockTimestamp = previousKernelData.publicInputs.constants.anchorBlockHeader.globalVariables.timestamp;
264
- if (includeByTimestampUpperBound <= anchorBlockTimestamp) {
267
+ if (expirationTimestampUpperBound <= anchorBlockTimestamp) {
265
268
  throw new Error(
266
- `Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${includeByTimestampUpperBound}.`,
269
+ `Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${expirationTimestampUpperBound}.`,
267
270
  );
268
271
  }
269
272
 
270
273
  const privateInputs = new PrivateKernelTailCircuitPrivateInputs(
271
274
  previousKernelData,
272
275
  paddedSideEffectAmounts,
273
- includeByTimestampUpperBound,
276
+ expirationTimestampUpperBound,
274
277
  );
275
278
 
276
279
  const witgenTimer = new Timer();
@@ -8,11 +8,7 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
8
8
  import type { FunctionSelector } from '@aztec/stdlib/abi';
9
9
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
10
10
  import { BlockHash } from '@aztec/stdlib/block';
11
- import {
12
- type ContractInstanceWithAddress,
13
- computeContractClassIdPreimage,
14
- computeSaltedInitializationHash,
15
- } from '@aztec/stdlib/contract';
11
+ import { type ContractInstanceWithAddress, computeSaltedInitializationHash } from '@aztec/stdlib/contract';
16
12
  import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '@aztec/stdlib/delayed-public-mutable';
17
13
  import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
18
14
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
@@ -49,11 +45,15 @@ export class PrivateKernelOracle {
49
45
 
50
46
  /** Retrieves the preimage of a contract class id from the contract classes db. */
51
47
  public async getContractClassIdPreimage(contractClassId: Fr) {
52
- const contractClass = await this.contractStore.getContractClass(contractClassId);
48
+ const contractClass = await this.contractStore.getContractClassWithPreimage(contractClassId);
53
49
  if (!contractClass) {
54
50
  throw new Error(`Contract class not found when getting class id preimage. Class id: ${contractClassId}.`);
55
51
  }
56
- return computeContractClassIdPreimage(contractClass);
52
+ return {
53
+ artifactHash: contractClass.artifactHash,
54
+ privateFunctionsRoot: contractClass.privateFunctionsRoot,
55
+ publicBytecodeCommitment: contractClass.publicBytecodeCommitment,
56
+ };
57
57
  }
58
58
 
59
59
  /** Returns a membership witness with the sibling path and leaf index in our private functions tree. */