@aztec/pxe 3.0.0-canary.a9708bd → 3.0.0-devnet.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 (194) hide show
  1. package/README.md +5 -5
  2. package/dest/bin/check_oracle_version.js +18 -8
  3. package/dest/config/index.d.ts +8 -8
  4. package/dest/config/index.d.ts.map +1 -1
  5. package/dest/config/index.js +3 -3
  6. package/dest/config/package_info.js +1 -1
  7. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  8. package/dest/contract_function_simulator/contract_function_simulator.js +82 -26
  9. package/dest/contract_function_simulator/execution_data_provider.d.ts +27 -38
  10. package/dest/contract_function_simulator/execution_data_provider.d.ts.map +1 -1
  11. package/dest/contract_function_simulator/execution_note_cache.d.ts +2 -2
  12. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  13. package/dest/contract_function_simulator/execution_note_cache.js +7 -4
  14. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +16 -0
  15. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -0
  16. package/dest/contract_function_simulator/execution_tagging_index_cache.js +26 -0
  17. package/dest/contract_function_simulator/index.d.ts +3 -1
  18. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  19. package/dest/contract_function_simulator/index.js +2 -1
  20. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  21. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +7 -3
  22. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -0
  23. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  24. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
  25. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +22 -0
  26. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -0
  27. package/dest/contract_function_simulator/noir-structs/utility_context.js +33 -0
  28. package/dest/contract_function_simulator/oracle/index.d.ts +1 -1
  29. package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -1
  30. package/dest/contract_function_simulator/oracle/index.js +1 -1
  31. package/dest/contract_function_simulator/oracle/interfaces.d.ts +97 -0
  32. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -0
  33. package/dest/contract_function_simulator/oracle/interfaces.js +4 -0
  34. package/dest/contract_function_simulator/oracle/oracle.d.ts +12 -11
  35. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  36. package/dest/contract_function_simulator/oracle/oracle.js +79 -76
  37. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -2
  38. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  39. package/dest/contract_function_simulator/oracle/private_execution.js +6 -15
  40. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +26 -10
  41. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  42. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +69 -18
  43. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +10 -22
  44. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  45. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +33 -38
  46. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +19 -55
  47. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -1
  48. package/dest/contract_function_simulator/pxe_oracle_interface.js +174 -187
  49. package/dest/entrypoints/client/bundle/index.d.ts +3 -1
  50. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  51. package/dest/entrypoints/client/bundle/index.js +2 -1
  52. package/dest/entrypoints/client/bundle/utils.d.ts +8 -8
  53. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  54. package/dest/entrypoints/client/bundle/utils.js +8 -8
  55. package/dest/entrypoints/client/lazy/index.d.ts +3 -1
  56. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  57. package/dest/entrypoints/client/lazy/index.js +2 -1
  58. package/dest/entrypoints/client/lazy/utils.d.ts +7 -7
  59. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  60. package/dest/entrypoints/client/lazy/utils.js +7 -7
  61. package/dest/entrypoints/server/index.d.ts +3 -1
  62. package/dest/entrypoints/server/index.d.ts.map +1 -1
  63. package/dest/entrypoints/server/index.js +2 -1
  64. package/dest/entrypoints/server/utils.d.ts +4 -23
  65. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  66. package/dest/entrypoints/server/utils.js +4 -25
  67. package/dest/{pxe_service/error_enriching.d.ts → error_enriching.d.ts} +1 -1
  68. package/dest/error_enriching.d.ts.map +1 -0
  69. package/dest/{pxe_service/error_enriching.js → error_enriching.js} +3 -0
  70. package/dest/oracle_version.d.ts +2 -2
  71. package/dest/oracle_version.js +2 -2
  72. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +6 -6
  73. package/dest/private_kernel/private_kernel_execution_prover.d.ts +7 -0
  74. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  75. package/dest/private_kernel/private_kernel_execution_prover.js +23 -18
  76. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +2 -2
  77. package/dest/pxe.d.ts +233 -0
  78. package/dest/pxe.d.ts.map +1 -0
  79. package/dest/{pxe_service/pxe_service.js → pxe.js} +215 -214
  80. package/dest/storage/address_data_provider/address_data_provider.d.ts +1 -3
  81. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +1 -1
  82. package/dest/storage/address_data_provider/address_data_provider.js +0 -3
  83. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +1 -3
  84. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +1 -1
  85. package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -4
  86. package/dest/storage/contract_data_provider/contract_data_provider.d.ts +3 -4
  87. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +1 -1
  88. package/dest/storage/contract_data_provider/contract_data_provider.js +0 -3
  89. package/dest/storage/index.d.ts +0 -1
  90. package/dest/storage/index.d.ts.map +1 -1
  91. package/dest/storage/index.js +0 -1
  92. package/dest/storage/note_data_provider/note_dao.d.ts +1 -1
  93. package/dest/storage/note_data_provider/note_dao.d.ts.map +1 -1
  94. package/dest/storage/note_data_provider/note_data_provider.d.ts +70 -7
  95. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +1 -1
  96. package/dest/storage/note_data_provider/note_data_provider.js +120 -72
  97. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +1 -3
  98. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +1 -1
  99. package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -3
  100. package/dest/storage/sync_data_provider/sync_data_provider.d.ts +1 -3
  101. package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +1 -1
  102. package/dest/storage/sync_data_provider/sync_data_provider.js +0 -3
  103. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +28 -6
  104. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +1 -1
  105. package/dest/storage/tagging_data_provider/tagging_data_provider.js +46 -39
  106. package/dest/synchronizer/synchronizer.d.ts.map +1 -1
  107. package/dest/synchronizer/synchronizer.js +2 -3
  108. package/dest/tagging/constants.d.ts +2 -0
  109. package/dest/tagging/constants.d.ts.map +1 -0
  110. package/dest/tagging/constants.js +2 -0
  111. package/dest/tagging/index.d.ts +7 -0
  112. package/dest/tagging/index.d.ts.map +1 -0
  113. package/dest/tagging/index.js +5 -0
  114. package/dest/tagging/siloed_tag.d.ts +14 -0
  115. package/dest/tagging/siloed_tag.d.ts.map +1 -0
  116. package/dest/tagging/siloed_tag.js +20 -0
  117. package/dest/tagging/tag.d.ts +12 -0
  118. package/dest/tagging/tag.d.ts.map +1 -0
  119. package/dest/tagging/tag.js +17 -0
  120. package/dest/tagging/utils.d.ts +18 -0
  121. package/dest/tagging/utils.d.ts.map +1 -0
  122. package/dest/tagging/utils.js +24 -0
  123. package/package.json +19 -22
  124. package/src/bin/check_oracle_version.ts +23 -9
  125. package/src/config/index.ts +11 -10
  126. package/src/config/package_info.ts +1 -1
  127. package/src/contract_function_simulator/contract_function_simulator.ts +128 -44
  128. package/src/contract_function_simulator/execution_data_provider.ts +29 -47
  129. package/src/contract_function_simulator/execution_note_cache.ts +11 -6
  130. package/src/contract_function_simulator/execution_tagging_index_cache.ts +32 -0
  131. package/src/contract_function_simulator/index.ts +3 -1
  132. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +8 -3
  133. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  134. package/src/contract_function_simulator/noir-structs/utility_context.ts +42 -0
  135. package/src/contract_function_simulator/oracle/index.ts +1 -1
  136. package/src/contract_function_simulator/oracle/interfaces.ts +160 -0
  137. package/src/contract_function_simulator/oracle/oracle.ts +102 -77
  138. package/src/contract_function_simulator/oracle/private_execution.ts +7 -15
  139. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +106 -45
  140. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +51 -76
  141. package/src/contract_function_simulator/pxe_oracle_interface.ts +199 -218
  142. package/src/entrypoints/client/bundle/index.ts +3 -1
  143. package/src/entrypoints/client/bundle/utils.ts +11 -19
  144. package/src/entrypoints/client/lazy/index.ts +3 -1
  145. package/src/entrypoints/client/lazy/utils.ts +10 -18
  146. package/src/entrypoints/server/index.ts +3 -1
  147. package/src/entrypoints/server/utils.ts +9 -39
  148. package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +5 -1
  149. package/src/oracle_version.ts +2 -2
  150. package/src/private_kernel/hints/compute_tx_include_by_timestamp.ts +6 -6
  151. package/src/private_kernel/private_kernel_execution_prover.ts +35 -23
  152. package/src/{pxe_service/pxe_service.ts → pxe.ts} +230 -257
  153. package/src/storage/address_data_provider/address_data_provider.ts +1 -7
  154. package/src/storage/capsule_data_provider/capsule_data_provider.ts +1 -11
  155. package/src/storage/contract_data_provider/contract_data_provider.ts +3 -9
  156. package/src/storage/index.ts +0 -1
  157. package/src/storage/note_data_provider/note_dao.ts +1 -1
  158. package/src/storage/note_data_provider/note_data_provider.ts +142 -99
  159. package/src/storage/private_event_data_provider/private_event_data_provider.ts +1 -7
  160. package/src/storage/sync_data_provider/sync_data_provider.ts +1 -7
  161. package/src/storage/tagging_data_provider/tagging_data_provider.ts +52 -55
  162. package/src/synchronizer/synchronizer.ts +2 -3
  163. package/src/tagging/constants.ts +2 -0
  164. package/src/tagging/index.ts +6 -0
  165. package/src/tagging/siloed_tag.ts +22 -0
  166. package/src/tagging/tag.ts +16 -0
  167. package/src/tagging/utils.ts +31 -0
  168. package/dest/bin/index.d.ts +0 -3
  169. package/dest/bin/index.d.ts.map +0 -1
  170. package/dest/bin/index.js +0 -48
  171. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +0 -87
  172. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +0 -1
  173. package/dest/contract_function_simulator/oracle/typed_oracle.js +0 -146
  174. package/dest/contract_function_simulator/tagging_utils.d.ts +0 -17
  175. package/dest/contract_function_simulator/tagging_utils.d.ts.map +0 -1
  176. package/dest/contract_function_simulator/tagging_utils.js +0 -23
  177. package/dest/pxe_service/error_enriching.d.ts.map +0 -1
  178. package/dest/pxe_service/index.d.ts +0 -3
  179. package/dest/pxe_service/index.d.ts.map +0 -1
  180. package/dest/pxe_service/index.js +0 -2
  181. package/dest/pxe_service/pxe_service.d.ts +0 -100
  182. package/dest/pxe_service/pxe_service.d.ts.map +0 -1
  183. package/dest/storage/data_provider.d.ts +0 -4
  184. package/dest/storage/data_provider.d.ts.map +0 -1
  185. package/dest/storage/data_provider.js +0 -1
  186. package/dest/test/pxe_test_suite.d.ts +0 -3
  187. package/dest/test/pxe_test_suite.d.ts.map +0 -1
  188. package/dest/test/pxe_test_suite.js +0 -97
  189. package/src/bin/index.ts +0 -62
  190. package/src/contract_function_simulator/oracle/typed_oracle.ts +0 -289
  191. package/src/contract_function_simulator/tagging_utils.ts +0 -32
  192. package/src/pxe_service/index.ts +0 -2
  193. package/src/storage/data_provider.ts +0 -3
  194. package/src/test/pxe_test_suite.ts +0 -113
@@ -6,23 +6,23 @@ import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/prov
6
6
  import { WASMSimulator } from '@aztec/simulator/client';
7
7
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
8
8
 
9
- import type { PXEServiceConfig } from '../../../config/index.js';
10
- import { PXEService } from '../../../pxe_service/pxe_service.js';
9
+ import type { PXEConfig } from '../../../config/index.js';
10
+ import { PXE } from '../../../pxe.js';
11
11
  import type { PXECreationOptions } from '../../pxe_creation_options.js';
12
12
 
13
13
  /**
14
- * Create and start an PXEService instance with the given AztecNode.
14
+ * Create and start an PXE instance with the given AztecNode.
15
15
  * If no keyStore or database is provided, it will use KeyStore and MemoryDB as default values.
16
- * Returns a Promise that resolves to the started PXEService instance.
16
+ * Returns a Promise that resolves to the started PXE instance.
17
17
  *
18
18
  * @param aztecNode - The AztecNode instance to be used by the server.
19
- * @param config - The PXE Service Config to use
20
- * @param options - (Optional) Optional information for creating an PXEService.
21
- * @returns A Promise that resolves to the started PXEService instance.
19
+ * @param config - The PXE Config to use
20
+ * @param options - (Optional) Optional information for creating an PXE.
21
+ * @returns A Promise that resolves to the started PXE instance.
22
22
  */
23
- export async function createPXEService(
23
+ export async function createPXE(
24
24
  aztecNode: AztecNode,
25
- config: PXEServiceConfig,
25
+ config: PXEConfig,
26
26
  options: PXECreationOptions = { loggers: {} },
27
27
  ) {
28
28
  const logSuffix =
@@ -38,7 +38,7 @@ export async function createPXEService(
38
38
  const configWithContracts = {
39
39
  ...config,
40
40
  l1Contracts,
41
- } as PXEServiceConfig;
41
+ } as PXEConfig;
42
42
 
43
43
  const storeLogger = loggers.store ? loggers.store : createLogger('pxe:data:idb' + (logSuffix ? `:${logSuffix}` : ''));
44
44
 
@@ -53,14 +53,6 @@ export async function createPXEService(
53
53
  const protocolContractsProvider = new BundledProtocolContractsProvider();
54
54
 
55
55
  const pxeLogger = loggers.pxe ? loggers.pxe : createLogger('pxe:service' + (logSuffix ? `:${logSuffix}` : ''));
56
- const pxe = await PXEService.create(
57
- aztecNode,
58
- store,
59
- prover,
60
- simulator,
61
- protocolContractsProvider,
62
- config,
63
- pxeLogger,
64
- );
56
+ const pxe = await PXE.create(aztecNode, store, prover, simulator, protocolContractsProvider, config, pxeLogger);
65
57
  return pxe;
66
58
  }
@@ -1,5 +1,7 @@
1
- export * from '../../../pxe_service/index.js';
1
+ export * from '../../../pxe.js';
2
2
  export * from '../../../config/index.js';
3
3
  export * from '../../../storage/index.js';
4
+ export * from '../../../error_enriching.js';
4
5
  export * from './utils.js';
5
6
  export { PXEOracleInterface } from '../../../contract_function_simulator/pxe_oracle_interface.js';
7
+ export { type PXECreationOptions } from '../../pxe_creation_options.js';
@@ -6,22 +6,22 @@ import { LazyProtocolContractsProvider } from '@aztec/protocol-contracts/provide
6
6
  import { WASMSimulator } from '@aztec/simulator/client';
7
7
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
8
8
 
9
- import type { PXEServiceConfig } from '../../../config/index.js';
10
- import { PXEService } from '../../../pxe_service/pxe_service.js';
9
+ import type { PXEConfig } from '../../../config/index.js';
10
+ import { PXE } from '../../../pxe.js';
11
11
  import type { PXECreationOptions } from '../../pxe_creation_options.js';
12
12
 
13
13
  /**
14
- * Create and start an PXEService instance with the given AztecNode.
15
- * Returns a Promise that resolves to the started PXEService instance.
14
+ * Create and start an PXE instance with the given AztecNode.
15
+ * Returns a Promise that resolves to the started PXE instance.
16
16
  *
17
17
  * @param aztecNode - The AztecNode instance to be used by the server.
18
- * @param config - The PXE Service Config to use
18
+ * @param config - The PXE Config to use
19
19
  * @param
20
- * @returns A Promise that resolves to the started PXEService instance.
20
+ * @returns A Promise that resolves to the started PXE instance.
21
21
  */
22
- export async function createPXEService(
22
+ export async function createPXE(
23
23
  aztecNode: AztecNode,
24
- config: PXEServiceConfig,
24
+ config: PXEConfig,
25
25
  options: PXECreationOptions = { loggers: {} },
26
26
  ) {
27
27
  const logSuffix =
@@ -35,7 +35,7 @@ export async function createPXEService(
35
35
  const configWithContracts = {
36
36
  ...config,
37
37
  l1Contracts,
38
- } as PXEServiceConfig;
38
+ } as PXEConfig;
39
39
 
40
40
  const loggers = options.loggers ?? {};
41
41
 
@@ -53,14 +53,6 @@ export async function createPXEService(
53
53
  const protocolContractsProvider = new LazyProtocolContractsProvider();
54
54
 
55
55
  const pxeLogger = loggers.pxe ? loggers.pxe : createLogger('pxe:service' + (logSuffix ? `:${logSuffix}` : ''));
56
- const pxe = await PXEService.create(
57
- aztecNode,
58
- store,
59
- prover,
60
- simulator,
61
- protocolContractsProvider,
62
- config,
63
- pxeLogger,
64
- );
56
+ const pxe = await PXE.create(aztecNode, store, prover, simulator, protocolContractsProvider, config, pxeLogger);
65
57
  return pxe;
66
58
  }
@@ -1,6 +1,8 @@
1
- export * from '../../pxe_service/index.js';
1
+ export * from '../../pxe.js';
2
2
  export * from '../../config/index.js';
3
+ export * from '../../error_enriching.js';
3
4
  export * from '../../storage/index.js';
4
5
  export * from './utils.js';
5
6
  export { PXEOracleInterface } from '../../contract_function_simulator/pxe_oracle_interface.js';
6
7
  export { ORACLE_VERSION } from '../../oracle_version.js';
8
+ export { type PXECreationOptions } from '../pxe_creation_options.js';
@@ -12,52 +12,23 @@ import {
12
12
  import { FileCircuitRecorder } from '@aztec/simulator/testing';
13
13
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
14
14
 
15
- import type { PXEServiceConfig } from '../../config/index.js';
16
- import { PXEService } from '../../pxe_service/pxe_service.js';
15
+ import type { PXEConfig } from '../../config/index.js';
16
+ import { PXE } from '../../pxe.js';
17
17
  import { PXE_DATA_SCHEMA_VERSION } from '../../storage/index.js';
18
18
  import type { PXECreationOptions } from '../pxe_creation_options.js';
19
19
 
20
- type PXEConfigWithoutDefaults = Omit<
21
- PXEServiceConfig,
22
- 'l1Contracts' | 'l1ChainId' | 'l2BlockBatchSize' | 'rollupVersion'
23
- >;
20
+ type PXEConfigWithoutDefaults = Omit<PXEConfig, 'l1Contracts' | 'l1ChainId' | 'l2BlockBatchSize' | 'rollupVersion'>;
24
21
 
25
- /**
26
- * Create and start an PXEService instance with the given AztecNode and config.
27
- *
28
- * @param aztecNode - The AztecNode instance to be used by the server.
29
- * @param config - The PXE Service Config to use
30
- * @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
31
- * @returns A Promise that resolves to the started PXEService instance.
32
- */
33
- export function createPXEService(
22
+ export async function createPXE(
34
23
  aztecNode: AztecNode,
35
24
  config: PXEConfigWithoutDefaults,
36
25
  options: PXECreationOptions = { loggers: {} },
37
26
  ) {
38
- const simulator = new WASMSimulator();
39
27
  const recorder = process.env.CIRCUIT_RECORD_DIR
40
28
  ? new FileCircuitRecorder(process.env.CIRCUIT_RECORD_DIR)
41
29
  : new MemoryCircuitRecorder();
42
- const simulatorWithRecorder = new SimulatorRecorderWrapper(simulator, recorder);
43
- return createPXEServiceWithSimulator(aztecNode, simulatorWithRecorder, config, options);
44
- }
30
+ const simulator = new SimulatorRecorderWrapper(new WASMSimulator(), recorder);
45
31
 
46
- /**
47
- * Create and start an PXEService instance with the given AztecNode, Simulator and config.
48
- *
49
- * @param aztecNode - The AztecNode instance to be used by the server.
50
- * @param simulator - The Simulator to use
51
- * @param config - The PXE Service Config to use
52
- * @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
53
- * @returns A Promise that resolves to the started PXEService instance.
54
- */
55
- export async function createPXEServiceWithSimulator(
56
- aztecNode: AztecNode,
57
- simulator: CircuitSimulator,
58
- config: PXEConfigWithoutDefaults,
59
- options: PXECreationOptions = { loggers: {} },
60
- ) {
61
32
  const logSuffix =
62
33
  typeof options.useLogSuffix === 'boolean'
63
34
  ? options.useLogSuffix
@@ -67,7 +38,7 @@ export async function createPXEServiceWithSimulator(
67
38
  const loggers = options.loggers ?? {};
68
39
 
69
40
  const { l1ChainId, l1ContractAddresses: l1Contracts, rollupVersion } = await aztecNode.getNodeInfo();
70
- const configWithContracts: PXEServiceConfig = {
41
+ const configWithContracts: PXEConfig = {
71
42
  ...config,
72
43
  l1Contracts,
73
44
  l1ChainId,
@@ -92,7 +63,7 @@ export async function createPXEServiceWithSimulator(
92
63
  const protocolContractsProvider = new BundledProtocolContractsProvider();
93
64
 
94
65
  const pxeLogger = loggers.pxe ? loggers.pxe : createLogger('pxe:service' + (logSuffix ? `:${logSuffix}` : ''));
95
- const pxe = await PXEService.create(
66
+ const pxe = await PXE.create(
96
67
  aztecNode,
97
68
  options.store,
98
69
  prover,
@@ -105,15 +76,14 @@ export async function createPXEServiceWithSimulator(
105
76
  }
106
77
 
107
78
  function createProver(
108
- config: Pick<PXEServiceConfig, 'bbBinaryPath' | 'bbWorkingDirectory'>,
79
+ config: Pick<PXEConfig, 'bbBinaryPath' | 'bbWorkingDirectory'>,
109
80
  simulator: CircuitSimulator,
110
81
  logger?: Logger,
111
82
  ) {
112
83
  if (!config.bbBinaryPath || !config.bbWorkingDirectory) {
113
84
  return new BBWASMBundlePrivateKernelProver(simulator, 16, logger);
114
85
  } else {
115
- const bbConfig = config as Required<Pick<PXEServiceConfig, 'bbBinaryPath' | 'bbWorkingDirectory'>> &
116
- PXEServiceConfig;
86
+ const bbConfig = config as Required<Pick<PXEConfig, 'bbBinaryPath' | 'bbWorkingDirectory'>> & PXEConfig;
117
87
  return BBNativePrivateKernelProver.new(
118
88
  { bbSkipCleanup: false, numConcurrentIVCVerifiers: 1, bbIVCConcurrency: 1, ...bbConfig },
119
89
  simulator,
@@ -4,7 +4,7 @@ import { FunctionSelector } from '@aztec/stdlib/abi';
4
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
5
  import { type SimulationError, isNoirCallStackUnresolved } from '@aztec/stdlib/errors';
6
6
 
7
- import type { ContractDataProvider } from '../storage/contract_data_provider/contract_data_provider.js';
7
+ import type { ContractDataProvider } from './storage/contract_data_provider/contract_data_provider.js';
8
8
 
9
9
  /**
10
10
  * Adds contract and function names to a simulation error, if they
@@ -76,6 +76,10 @@ export async function enrichPublicSimulationError(
76
76
  const callStack = err.getCallStack();
77
77
  const originalFailingFunction = callStack[callStack.length - 1];
78
78
 
79
+ if (!originalFailingFunction) {
80
+ throw new Error(`Original failing function not found when enriching public simulation, missing callstack`);
81
+ }
82
+
79
83
  const artifact = await contractDataProvider.getPublicFunctionArtifact(originalFailingFunction.contractAddress);
80
84
  if (!artifact) {
81
85
  throw new Error(
@@ -4,8 +4,8 @@
4
4
  ///
5
5
  /// @dev Whenever a contract function or Noir test is run, the `utilityAssertCompatibleOracleVersion` oracle is called
6
6
  /// and if the oracle version is incompatible an error is thrown.
7
- export const ORACLE_VERSION = 1;
7
+ export const ORACLE_VERSION = 3;
8
8
 
9
9
  /// This hash is computed as by hashing the Oracle interface and it is used to detect when the Oracle interface changes,
10
10
  /// which in turn implies that you need to update the ORACLE_VERSION constant.
11
- export const ORACLE_INTERFACE_HASH = 'b48d38f93eaa084033fc5970bf96e559c33c4cdc07d889ab00b4d63f9590739d';
11
+ export const ORACLE_INTERFACE_HASH = 'f9168ceb5a2227c148c5021ebffd4e2ca0da99885b87c5be3ee5ac0d8dd3d67c';
@@ -31,8 +31,8 @@ export function computeTxIncludeByTimestamp(
31
31
  );
32
32
  }
33
33
 
34
- const blockTimestamp = previousKernel.constants.historicalHeader.globalVariables.timestamp;
35
- const maxTimestamp = blockTimestamp + BigInt(maxDuration);
34
+ const anchorBlockTimestamp = previousKernel.constants.anchorBlockHeader.globalVariables.timestamp;
35
+ const maxTimestamp = anchorBlockTimestamp + BigInt(maxDuration);
36
36
  const includeByTimestamp = previousKernel.includeByTimestamp;
37
37
 
38
38
  // If the includeByTimestamp set during the tx execution is greater than or equal to the max allowed duration,
@@ -44,13 +44,13 @@ export function computeTxIncludeByTimestamp(
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(blockTimestamp, includeByTimestamp);
47
+ const roundedTimestamp = roundTimestamp(anchorBlockTimestamp, includeByTimestamp);
48
48
 
49
- // The tx can't be published if the timestamp is the same or less than the historical block's timestamp.
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
- if (roundedTimestamp <= blockTimestamp) {
51
+ if (roundedTimestamp <= anchorBlockTimestamp) {
52
52
  throw new Error(
53
- `Include-by timestamp must be greater than the historical block timestamp. Block timestamp: ${blockTimestamp}. Include-by timestamp: ${includeByTimestamp}.`,
53
+ `Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${includeByTimestamp}.`,
54
54
  );
55
55
  }
56
56
 
@@ -4,9 +4,8 @@ import { 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';
7
- import { getProtocolContractLeafAndMembershipWitness, protocolContractTreeRoot } from '@aztec/protocol-contracts';
7
+ import { ProtocolContractsList } from '@aztec/protocol-contracts';
8
8
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
9
- import { computeContractAddressFromInstance } from '@aztec/stdlib/contract';
10
9
  import type { PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
11
10
  import {
12
11
  HidingKernelToPublicPrivateInputs,
@@ -24,7 +23,7 @@ import {
24
23
  type PrivateKernelTailCircuitPublicInputs,
25
24
  PrivateVerificationKeyHints,
26
25
  } from '@aztec/stdlib/kernel';
27
- import { ClientIvcProof } from '@aztec/stdlib/proofs';
26
+ import { ClientIvcProof, ClientIvcProofWithPublicInputs } from '@aztec/stdlib/proofs';
28
27
  import {
29
28
  type PrivateCallExecutionResult,
30
29
  type PrivateExecutionResult,
@@ -168,7 +167,7 @@ export class PrivateKernelExecutionProver {
168
167
  const proofInput = new PrivateKernelInitCircuitPrivateInputs(
169
168
  txRequest,
170
169
  getVKTreeRoot(),
171
- protocolContractTreeRoot,
170
+ ProtocolContractsList,
172
171
  privateCallData,
173
172
  isPrivateOnlyTx,
174
173
  executionResult.firstNullifier,
@@ -268,10 +267,10 @@ export class PrivateKernelExecutionProver {
268
267
  // Use the aggregated includeByTimestamp set throughout the tx execution.
269
268
  // TODO: Call `computeTxIncludeByTimestamp` to round the value down and reduce precision, improving privacy.
270
269
  const includeByTimestampUpperBound = previousKernelData.publicInputs.includeByTimestamp;
271
- const blockTimestamp = previousKernelData.publicInputs.constants.historicalHeader.globalVariables.timestamp;
272
- if (includeByTimestampUpperBound <= blockTimestamp) {
270
+ const anchorBlockTimestamp = previousKernelData.publicInputs.constants.anchorBlockHeader.globalVariables.timestamp;
271
+ if (includeByTimestampUpperBound <= anchorBlockTimestamp) {
273
272
  throw new Error(
274
- `Include-by timestamp must be greater than the historical block timestamp. Block timestamp: ${blockTimestamp}. Include-by timestamp: ${includeByTimestampUpperBound}.`,
273
+ `Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${includeByTimestampUpperBound}.`,
275
274
  );
276
275
  }
277
276
 
@@ -281,8 +280,6 @@ export class PrivateKernelExecutionProver {
281
280
  includeByTimestampUpperBound,
282
281
  );
283
282
 
284
- pushTestData('private-kernel-inputs-ordering', privateInputs);
285
-
286
283
  const witgenTimer = new Timer();
287
284
  const tailOutput = generateWitnesses
288
285
  ? await this.proofCreator.generateTailOutput(privateInputs)
@@ -355,8 +352,10 @@ export class PrivateKernelExecutionProver {
355
352
  let provingTime;
356
353
  if (!skipProofGeneration) {
357
354
  const provingTimer = new Timer();
358
- clientIvcProof = await this.proofCreator.createClientIvcProof(executionSteps);
355
+ const proofWithPublicInputs = await this.proofCreator.createClientIvcProof(executionSteps);
359
356
  provingTime = provingTimer.ms();
357
+ this.ensurePublicInputsMatch(proofWithPublicInputs, tailOutput.publicInputs);
358
+ clientIvcProof = proofWithPublicInputs.removePublicInputs();
360
359
  } else {
361
360
  clientIvcProof = ClientIvcProof.random();
362
361
  }
@@ -369,6 +368,32 @@ export class PrivateKernelExecutionProver {
369
368
  };
370
369
  }
371
370
 
371
+ /**
372
+ * Checks that the public inputs of the civc proof match the public inputs of the tail circuit.
373
+ * This can only mismatch if there is a circuit / noir / bb bug.
374
+ * @param civcProof - The civc proof with public inputs.
375
+ * @param tailPublicInputs - The public inputs resulting from witness generation of the tail circuit.
376
+ */
377
+ private ensurePublicInputsMatch(
378
+ civcProof: ClientIvcProofWithPublicInputs,
379
+ tailPublicInputs: PrivateKernelTailCircuitPublicInputs,
380
+ ) {
381
+ const serializedCivcProofPublicInputs = civcProof.getPublicInputs();
382
+ const serializedTailPublicInputs = tailPublicInputs.publicInputs().toFields();
383
+ if (serializedCivcProofPublicInputs.length !== serializedTailPublicInputs.length) {
384
+ throw new Error(
385
+ `Public inputs length mismatch: ${serializedCivcProofPublicInputs.length} !== ${serializedTailPublicInputs.length}`,
386
+ );
387
+ }
388
+ if (
389
+ !serializedCivcProofPublicInputs.every((input: Fr, index: number) =>
390
+ input.equals(serializedTailPublicInputs[index]),
391
+ )
392
+ ) {
393
+ throw new Error(`Public inputs mismatch between kernel and civc proof`);
394
+ }
395
+ }
396
+
372
397
  private async getVkData(verificationKey: VerificationKeyData) {
373
398
  const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(verificationKey.keyAsFields);
374
399
  return new VkData(
@@ -394,17 +419,6 @@ export class PrivateKernelExecutionProver {
394
419
  const { artifactHash: contractClassArtifactHash, publicBytecodeCommitment: contractClassPublicBytecodeCommitment } =
395
420
  await this.oracle.getContractClassIdPreimage(currentContractClassId);
396
421
 
397
- // This will be the address computed in the kernel by the executed class. We need to provide non membership of it in the protocol contract tree.
398
- // This would only be equal to contractAddress if the currentClassId is equal to the original class id (no update happened).
399
- const computedAddress = await computeContractAddressFromInstance({
400
- originalContractClassId: currentContractClassId,
401
- saltedInitializationHash,
402
- publicKeys,
403
- });
404
-
405
- const { lowLeaf: protocolContractLeaf, witness: protocolContractMembershipWitness } =
406
- await getProtocolContractLeafAndMembershipWitness(contractAddress, computedAddress);
407
-
408
422
  const updatedClassIdHints = await this.oracle.getUpdatedClassIdHints(contractAddress);
409
423
  return PrivateCallData.from({
410
424
  publicInputs,
@@ -415,8 +429,6 @@ export class PrivateKernelExecutionProver {
415
429
  contractClassPublicBytecodeCommitment,
416
430
  saltedInitializationHash,
417
431
  functionLeafMembershipWitness,
418
- protocolContractMembershipWitness,
419
- protocolContractLeaf,
420
432
  updatedClassIdHints,
421
433
  }),
422
434
  });