@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
@@ -1,6 +1,8 @@
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
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -1,5 +1,6 @@
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';
@@ -1,15 +1,15 @@
1
1
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
2
- import type { PXEServiceConfig } from '../../../config/index.js';
3
- import { PXEService } from '../../../pxe_service/pxe_service.js';
2
+ import type { PXEConfig } from '../../../config/index.js';
3
+ import { PXE } from '../../../pxe.js';
4
4
  import type { PXECreationOptions } from '../../pxe_creation_options.js';
5
5
  /**
6
- * Create and start an PXEService instance with the given AztecNode.
7
- * Returns a Promise that resolves to the started PXEService instance.
6
+ * Create and start an PXE instance with the given AztecNode.
7
+ * Returns a Promise that resolves to the started PXE instance.
8
8
  *
9
9
  * @param aztecNode - The AztecNode instance to be used by the server.
10
- * @param config - The PXE Service Config to use
10
+ * @param config - The PXE Config to use
11
11
  * @param
12
- * @returns A Promise that resolves to the started PXEService instance.
12
+ * @returns A Promise that resolves to the started PXE instance.
13
13
  */
14
- export declare function createPXEService(aztecNode: AztecNode, config: PXEServiceConfig, options?: PXECreationOptions): Promise<PXEService>;
14
+ export declare function createPXE(aztecNode: AztecNode, config: PXEConfig, options?: PXECreationOptions): Promise<PXE>;
15
15
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/utils.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,kBAAoC,uBAyC9C"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/utils.ts"],"names":[],"mappings":"AAMA,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;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,kBAAoC,gBAiC9C"}
@@ -4,16 +4,16 @@ import { createLogger } from '@aztec/foundation/log';
4
4
  import { createStore } from '@aztec/kv-store/indexeddb';
5
5
  import { LazyProtocolContractsProvider } from '@aztec/protocol-contracts/providers/lazy';
6
6
  import { WASMSimulator } from '@aztec/simulator/client';
7
- import { PXEService } from '../../../pxe_service/pxe_service.js';
7
+ import { PXE } from '../../../pxe.js';
8
8
  /**
9
- * Create and start an PXEService instance with the given AztecNode.
10
- * Returns a Promise that resolves to the started PXEService instance.
9
+ * Create and start an PXE instance with the given AztecNode.
10
+ * Returns a Promise that resolves to the started PXE instance.
11
11
  *
12
12
  * @param aztecNode - The AztecNode instance to be used by the server.
13
- * @param config - The PXE Service Config to use
13
+ * @param config - The PXE Config to use
14
14
  * @param
15
- * @returns A Promise that resolves to the started PXEService instance.
16
- */ export async function createPXEService(aztecNode, config, options = {
15
+ * @returns A Promise that resolves to the started PXE instance.
16
+ */ export async function createPXE(aztecNode, config, options = {
17
17
  loggers: {}
18
18
  }) {
19
19
  const logSuffix = typeof options.useLogSuffix === 'boolean' ? options.useLogSuffix ? randomBytes(3).toString('hex') : undefined : options.useLogSuffix;
@@ -30,6 +30,6 @@ import { PXEService } from '../../../pxe_service/pxe_service.js';
30
30
  const prover = options.prover ?? new BBWASMLazyPrivateKernelProver(simulator, 16, proverLogger);
31
31
  const protocolContractsProvider = new LazyProtocolContractsProvider();
32
32
  const pxeLogger = loggers.pxe ? loggers.pxe : createLogger('pxe:service' + (logSuffix ? `:${logSuffix}` : ''));
33
- const pxe = await PXEService.create(aztecNode, store, prover, simulator, protocolContractsProvider, config, pxeLogger);
33
+ const pxe = await PXE.create(aztecNode, store, prover, simulator, protocolContractsProvider, config, pxeLogger);
34
34
  return pxe;
35
35
  }
@@ -1,7 +1,9 @@
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';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -1,5 +1,6 @@
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';
@@ -1,27 +1,8 @@
1
- import { type CircuitSimulator } from '@aztec/simulator/client';
2
1
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
3
- import type { PXEServiceConfig } from '../../config/index.js';
4
- import { PXEService } from '../../pxe_service/pxe_service.js';
2
+ import type { PXEConfig } from '../../config/index.js';
3
+ import { PXE } from '../../pxe.js';
5
4
  import type { PXECreationOptions } from '../pxe_creation_options.js';
6
- type PXEConfigWithoutDefaults = Omit<PXEServiceConfig, 'l1Contracts' | 'l1ChainId' | 'l2BlockBatchSize' | 'rollupVersion'>;
7
- /**
8
- * Create and start an PXEService instance with the given AztecNode and config.
9
- *
10
- * @param aztecNode - The AztecNode instance to be used by the server.
11
- * @param config - The PXE Service Config to use
12
- * @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
13
- * @returns A Promise that resolves to the started PXEService instance.
14
- */
15
- export declare function createPXEService(aztecNode: AztecNode, config: PXEConfigWithoutDefaults, options?: PXECreationOptions): Promise<PXEService>;
16
- /**
17
- * Create and start an PXEService instance with the given AztecNode, Simulator and config.
18
- *
19
- * @param aztecNode - The AztecNode instance to be used by the server.
20
- * @param simulator - The Simulator to use
21
- * @param config - The PXE Service Config to use
22
- * @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
23
- * @returns A Promise that resolves to the started PXEService instance.
24
- */
25
- export declare function createPXEServiceWithSimulator(aztecNode: AztecNode, simulator: CircuitSimulator, config: PXEConfigWithoutDefaults, options?: PXECreationOptions): Promise<PXEService>;
5
+ type PXEConfigWithoutDefaults = Omit<PXEConfig, 'l1Contracts' | 'l1ChainId' | 'l2BlockBatchSize' | 'rollupVersion'>;
6
+ export declare function createPXE(aztecNode: AztecNode, config: PXEConfigWithoutDefaults, options?: PXECreationOptions): Promise<PXE>;
26
7
  export {};
27
8
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,KAAK,wBAAwB,GAAG,IAAI,CAClC,gBAAgB,EAChB,aAAa,GAAG,WAAW,GAAG,kBAAkB,GAAG,eAAe,CACnE,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,wBAAwB,EAChC,OAAO,GAAE,kBAAoC,uBAQ9C;AAED;;;;;;;;GAQG;AACH,wBAAsB,6BAA6B,CACjD,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,wBAAwB,EAChC,OAAO,GAAE,kBAAoC,uBA8C9C"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"AAYA,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,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,KAAK,wBAAwB,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,GAAG,WAAW,GAAG,kBAAkB,GAAG,eAAe,CAAC,CAAC;AAEpH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,wBAAwB,EAChC,OAAO,GAAE,kBAAoC,gBAmD9C"}
@@ -5,34 +5,13 @@ import { createLogger } from '@aztec/foundation/log';
5
5
  import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
6
6
  import { MemoryCircuitRecorder, SimulatorRecorderWrapper, WASMSimulator } from '@aztec/simulator/client';
7
7
  import { FileCircuitRecorder } from '@aztec/simulator/testing';
8
- import { PXEService } from '../../pxe_service/pxe_service.js';
8
+ import { PXE } from '../../pxe.js';
9
9
  import { PXE_DATA_SCHEMA_VERSION } from '../../storage/index.js';
10
- /**
11
- * Create and start an PXEService instance with the given AztecNode and config.
12
- *
13
- * @param aztecNode - The AztecNode instance to be used by the server.
14
- * @param config - The PXE Service Config to use
15
- * @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
16
- * @returns A Promise that resolves to the started PXEService instance.
17
- */ export function createPXEService(aztecNode, config, options = {
10
+ export async function createPXE(aztecNode, config, options = {
18
11
  loggers: {}
19
12
  }) {
20
- const simulator = new WASMSimulator();
21
13
  const recorder = process.env.CIRCUIT_RECORD_DIR ? new FileCircuitRecorder(process.env.CIRCUIT_RECORD_DIR) : new MemoryCircuitRecorder();
22
- const simulatorWithRecorder = new SimulatorRecorderWrapper(simulator, recorder);
23
- return createPXEServiceWithSimulator(aztecNode, simulatorWithRecorder, config, options);
24
- }
25
- /**
26
- * Create and start an PXEService instance with the given AztecNode, Simulator and config.
27
- *
28
- * @param aztecNode - The AztecNode instance to be used by the server.
29
- * @param simulator - The Simulator to use
30
- * @param config - The PXE Service Config to use
31
- * @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
32
- * @returns A Promise that resolves to the started PXEService instance.
33
- */ export async function createPXEServiceWithSimulator(aztecNode, simulator, config, options = {
34
- loggers: {}
35
- }) {
14
+ const simulator = new SimulatorRecorderWrapper(new WASMSimulator(), recorder);
36
15
  const logSuffix = typeof options.useLogSuffix === 'boolean' ? options.useLogSuffix ? randomBytes(3).toString('hex') : undefined : options.useLogSuffix;
37
16
  const loggers = options.loggers ?? {};
38
17
  const { l1ChainId, l1ContractAddresses: l1Contracts, rollupVersion } = await aztecNode.getNodeInfo();
@@ -54,7 +33,7 @@ import { PXE_DATA_SCHEMA_VERSION } from '../../storage/index.js';
54
33
  const prover = options.prover ?? await createProver(config, simulator, proverLogger);
55
34
  const protocolContractsProvider = new BundledProtocolContractsProvider();
56
35
  const pxeLogger = loggers.pxe ? loggers.pxe : createLogger('pxe:service' + (logSuffix ? `:${logSuffix}` : ''));
57
- const pxe = await PXEService.create(aztecNode, options.store, prover, simulator, protocolContractsProvider, configWithContracts, pxeLogger);
36
+ const pxe = await PXE.create(aztecNode, options.store, prover, simulator, protocolContractsProvider, configWithContracts, pxeLogger);
58
37
  return pxe;
59
38
  }
60
39
  function createProver(config, simulator, logger) {
@@ -1,6 +1,6 @@
1
1
  import type { Logger } from '@aztec/foundation/log';
2
2
  import { type SimulationError } from '@aztec/stdlib/errors';
3
- import type { ContractDataProvider } from '../storage/contract_data_provider/contract_data_provider.js';
3
+ import type { ContractDataProvider } from './storage/contract_data_provider/contract_data_provider.js';
4
4
  /**
5
5
  * Adds contract and function names to a simulation error, if they
6
6
  * can be found in the PXE database
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error_enriching.d.ts","sourceRoot":"","sources":["../src/error_enriching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,OAAO,EAAE,KAAK,eAAe,EAA6B,MAAM,sBAAsB,CAAC;AAEvF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAEvG;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,eAAe,EACpB,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,MAAM,iBAoDf;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,eAAe,EACpB,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,MAAM,iBAyCf"}
@@ -48,6 +48,9 @@ import { isNoirCallStackUnresolved } from '@aztec/stdlib/errors';
48
48
  export async function enrichPublicSimulationError(err, contractDataProvider, logger) {
49
49
  const callStack = err.getCallStack();
50
50
  const originalFailingFunction = callStack[callStack.length - 1];
51
+ if (!originalFailingFunction) {
52
+ throw new Error(`Original failing function not found when enriching public simulation, missing callstack`);
53
+ }
51
54
  const artifact = await contractDataProvider.getPublicFunctionArtifact(originalFailingFunction.contractAddress);
52
55
  if (!artifact) {
53
56
  throw new Error(`Artifact not found when enriching public simulation error. Contract address: ${originalFailingFunction.contractAddress}.`);
@@ -1,3 +1,3 @@
1
- export declare const ORACLE_VERSION = 1;
2
- export declare const ORACLE_INTERFACE_HASH = "b48d38f93eaa084033fc5970bf96e559c33c4cdc07d889ab00b4d63f9590739d";
1
+ export declare const ORACLE_VERSION = 3;
2
+ export declare const ORACLE_INTERFACE_HASH = "f9168ceb5a2227c148c5021ebffd4e2ca0da99885b87c5be3ee5ac0d8dd3d67c";
3
3
  //# sourceMappingURL=oracle_version.d.ts.map
@@ -4,7 +4,7 @@
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
  /// This hash is computed as by hashing the Oracle interface and it is used to detect when the Oracle interface changes,
9
9
  /// which in turn implies that you need to update the ORACLE_VERSION constant.
10
- export const ORACLE_INTERFACE_HASH = 'b48d38f93eaa084033fc5970bf96e559c33c4cdc07d889ab00b4d63f9590739d';
10
+ export const ORACLE_INTERFACE_HASH = 'f9168ceb5a2227c148c5021ebffd4e2ca0da99885b87c5be3ee5ac0d8dd3d67c';
@@ -20,8 +20,8 @@ export function computeTxIncludeByTimestamp(previousKernel, maxDuration = MAX_IN
20
20
  if (maxDuration > MAX_INCLUDE_BY_TIMESTAMP_DURATION) {
21
21
  throw new Error(`Custom max duration cannot be greater than the max allowed. Max allowed: ${MAX_INCLUDE_BY_TIMESTAMP_DURATION}. Custom value: ${maxDuration}.`);
22
22
  }
23
- const blockTimestamp = previousKernel.constants.historicalHeader.globalVariables.timestamp;
24
- const maxTimestamp = blockTimestamp + BigInt(maxDuration);
23
+ const anchorBlockTimestamp = previousKernel.constants.anchorBlockHeader.globalVariables.timestamp;
24
+ const maxTimestamp = anchorBlockTimestamp + BigInt(maxDuration);
25
25
  const includeByTimestamp = previousKernel.includeByTimestamp;
26
26
  // If the includeByTimestamp set during the tx execution is greater than or equal to the max allowed duration,
27
27
  // use the maximum allowed timestamp.
@@ -31,11 +31,11 @@ export function computeTxIncludeByTimestamp(previousKernel, maxDuration = MAX_IN
31
31
  }
32
32
  // Round it down to the nearest hour/min/second to reduce precision and avoid revealing the exact value.
33
33
  // This makes it harder for others to infer what function calls may have been used to produce a specific timestamp.
34
- const roundedTimestamp = roundTimestamp(blockTimestamp, includeByTimestamp);
35
- // The tx can't be published if the timestamp is the same or less than the historical block's timestamp.
34
+ const roundedTimestamp = roundTimestamp(anchorBlockTimestamp, includeByTimestamp);
35
+ // The tx can't be published if the timestamp is the same or less than the anchor block's timestamp.
36
36
  // Future blocks will have a greater timestamp, so the tx would never be included.
37
- if (roundedTimestamp <= blockTimestamp) {
38
- throw new Error(`Include-by timestamp must be greater than the historical block timestamp. Block timestamp: ${blockTimestamp}. Include-by timestamp: ${includeByTimestamp}.`);
37
+ if (roundedTimestamp <= anchorBlockTimestamp) {
38
+ throw new Error(`Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${includeByTimestamp}.`);
39
39
  }
40
40
  return roundedTimestamp;
41
41
  }
@@ -31,6 +31,13 @@ export declare class PrivateKernelExecutionProver {
31
31
  * @returns A Promise that resolves to a KernelProverOutput object containing proof, public inputs, and output notes.
32
32
  */
33
33
  proveWithKernels(txRequest: TxRequest, executionResult: PrivateExecutionResult, { simulate, skipFeeEnforcement, profileMode }?: PrivateKernelExecutionProverConfig): Promise<PrivateKernelExecutionProofOutput<PrivateKernelTailCircuitPublicInputs>>;
34
+ /**
35
+ * Checks that the public inputs of the civc proof match the public inputs of the tail circuit.
36
+ * This can only mismatch if there is a circuit / noir / bb bug.
37
+ * @param civcProof - The civc proof with public inputs.
38
+ * @param tailPublicInputs - The public inputs resulting from witness generation of the tail circuit.
39
+ */
40
+ private ensurePublicInputsMatch;
34
41
  private getVkData;
35
42
  private createPrivateCallData;
36
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAQL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAuD;gBAGxD,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ;IAG5B;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,sBAAsB,EACvC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAE,kCAI9C,GACA,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC;YA4RrE,SAAS;YAST,qBAAqB;CA2CpC"}
1
+ {"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAQL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAuD;gBAGxD,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ;IAG5B;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,sBAAsB,EACvC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAE,kCAI9C,GACA,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC;IA4RnF;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;YAoBjB,SAAS;YAST,qBAAqB;CA8BpC"}
@@ -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 { HidingKernelToPublicPrivateInputs, HidingKernelToRollupPrivateInputs, PaddedSideEffectAmounts, PrivateCallData, PrivateKernelCircuitPublicInputs, PrivateKernelData, PrivateKernelInitCircuitPrivateInputs, PrivateKernelInnerCircuitPrivateInputs, PrivateKernelTailCircuitPrivateInputs, PrivateVerificationKeyHints } from '@aztec/stdlib/kernel';
11
10
  import { ClientIvcProof } from '@aztec/stdlib/proofs';
12
11
  import { collectNoteHashLeafIndexMap, collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
@@ -101,7 +100,7 @@ const NULL_SIMULATE_OUTPUT = {
101
100
  const privateCallData = await this.createPrivateCallData(currentExecution);
102
101
  if (firstIteration) {
103
102
  const witgenTimer = new Timer();
104
- const proofInput = new PrivateKernelInitCircuitPrivateInputs(txRequest, getVKTreeRoot(), protocolContractTreeRoot, privateCallData, isPrivateOnlyTx, executionResult.firstNullifier);
103
+ const proofInput = new PrivateKernelInitCircuitPrivateInputs(txRequest, getVKTreeRoot(), ProtocolContractsList, privateCallData, isPrivateOnlyTx, executionResult.firstNullifier);
105
104
  this.log.debug(`Calling private kernel init with isPrivateOnly ${isPrivateOnlyTx} and firstNullifierHint ${proofInput.firstNullifierHint}`);
106
105
  pushTestData('private-kernel-inputs-init', proofInput);
107
106
  output = generateWitnesses ? await this.proofCreator.generateInitOutput(proofInput) : await this.proofCreator.simulateInit(proofInput);
@@ -165,12 +164,11 @@ const NULL_SIMULATE_OUTPUT = {
165
164
  // Use the aggregated includeByTimestamp set throughout the tx execution.
166
165
  // TODO: Call `computeTxIncludeByTimestamp` to round the value down and reduce precision, improving privacy.
167
166
  const includeByTimestampUpperBound = previousKernelData.publicInputs.includeByTimestamp;
168
- const blockTimestamp = previousKernelData.publicInputs.constants.historicalHeader.globalVariables.timestamp;
169
- if (includeByTimestampUpperBound <= blockTimestamp) {
170
- throw new Error(`Include-by timestamp must be greater than the historical block timestamp. Block timestamp: ${blockTimestamp}. Include-by timestamp: ${includeByTimestampUpperBound}.`);
167
+ const anchorBlockTimestamp = previousKernelData.publicInputs.constants.anchorBlockHeader.globalVariables.timestamp;
168
+ if (includeByTimestampUpperBound <= anchorBlockTimestamp) {
169
+ throw new Error(`Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${includeByTimestampUpperBound}.`);
171
170
  }
172
171
  const privateInputs = new PrivateKernelTailCircuitPrivateInputs(previousKernelData, paddedSideEffectAmounts, includeByTimestampUpperBound);
173
- pushTestData('private-kernel-inputs-ordering', privateInputs);
174
172
  const witgenTimer = new Timer();
175
173
  const tailOutput = generateWitnesses ? await this.proofCreator.generateTailOutput(privateInputs) : await this.proofCreator.simulateTail(privateInputs);
176
174
  executionSteps.push({
@@ -228,8 +226,10 @@ const NULL_SIMULATE_OUTPUT = {
228
226
  let provingTime;
229
227
  if (!skipProofGeneration) {
230
228
  const provingTimer = new Timer();
231
- clientIvcProof = await this.proofCreator.createClientIvcProof(executionSteps);
229
+ const proofWithPublicInputs = await this.proofCreator.createClientIvcProof(executionSteps);
232
230
  provingTime = provingTimer.ms();
231
+ this.ensurePublicInputsMatch(proofWithPublicInputs, tailOutput.publicInputs);
232
+ clientIvcProof = proofWithPublicInputs.removePublicInputs();
233
233
  } else {
234
234
  clientIvcProof = ClientIvcProof.random();
235
235
  }
@@ -242,6 +242,21 @@ const NULL_SIMULATE_OUTPUT = {
242
242
  } : undefined
243
243
  };
244
244
  }
245
+ /**
246
+ * Checks that the public inputs of the civc proof match the public inputs of the tail circuit.
247
+ * This can only mismatch if there is a circuit / noir / bb bug.
248
+ * @param civcProof - The civc proof with public inputs.
249
+ * @param tailPublicInputs - The public inputs resulting from witness generation of the tail circuit.
250
+ */ ensurePublicInputsMatch(civcProof, tailPublicInputs) {
251
+ const serializedCivcProofPublicInputs = civcProof.getPublicInputs();
252
+ const serializedTailPublicInputs = tailPublicInputs.publicInputs().toFields();
253
+ if (serializedCivcProofPublicInputs.length !== serializedTailPublicInputs.length) {
254
+ throw new Error(`Public inputs length mismatch: ${serializedCivcProofPublicInputs.length} !== ${serializedTailPublicInputs.length}`);
255
+ }
256
+ if (!serializedCivcProofPublicInputs.every((input, index)=>input.equals(serializedTailPublicInputs[index]))) {
257
+ throw new Error(`Public inputs mismatch between kernel and civc proof`);
258
+ }
259
+ }
245
260
  async getVkData(verificationKey) {
246
261
  const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(verificationKey.keyAsFields);
247
262
  return new VkData(verificationKey, Number(previousVkMembershipWitness.leafIndex), previousVkMembershipWitness.siblingPath);
@@ -253,14 +268,6 @@ const NULL_SIMULATE_OUTPUT = {
253
268
  const { currentContractClassId, publicKeys, saltedInitializationHash } = await this.oracle.getContractAddressPreimage(contractAddress);
254
269
  const functionLeafMembershipWitness = await this.oracle.getFunctionMembershipWitness(currentContractClassId, functionSelector);
255
270
  const { artifactHash: contractClassArtifactHash, publicBytecodeCommitment: contractClassPublicBytecodeCommitment } = await this.oracle.getContractClassIdPreimage(currentContractClassId);
256
- // 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.
257
- // This would only be equal to contractAddress if the currentClassId is equal to the original class id (no update happened).
258
- const computedAddress = await computeContractAddressFromInstance({
259
- originalContractClassId: currentContractClassId,
260
- saltedInitializationHash,
261
- publicKeys
262
- });
263
- const { lowLeaf: protocolContractLeaf, witness: protocolContractMembershipWitness } = await getProtocolContractLeafAndMembershipWitness(contractAddress, computedAddress);
264
271
  const updatedClassIdHints = await this.oracle.getUpdatedClassIdHints(contractAddress);
265
272
  return PrivateCallData.from({
266
273
  publicInputs,
@@ -271,8 +278,6 @@ const NULL_SIMULATE_OUTPUT = {
271
278
  contractClassPublicBytecodeCommitment,
272
279
  saltedInitializationHash,
273
280
  functionLeafMembershipWitness,
274
- protocolContractMembershipWitness,
275
- protocolContractLeaf,
276
281
  updatedClassIdHints
277
282
  })
278
283
  });
@@ -33,8 +33,8 @@ export declare class PrivateKernelOracleImpl implements PrivateKernelOracle {
33
33
  saltedInitializationHash: Fr;
34
34
  }>;
35
35
  getContractClassIdPreimage(contractClassId: Fr): Promise<import("@aztec/stdlib/contract").ContractClassIdPreimage>;
36
- getFunctionMembershipWitness(contractClassId: Fr, selector: FunctionSelector): Promise<MembershipWitness<5>>;
37
- getVkMembershipWitness(vk: VerificationKeyAsFields): Promise<MembershipWitness<6>>;
36
+ getFunctionMembershipWitness(contractClassId: Fr, selector: FunctionSelector): Promise<MembershipWitness<7>>;
37
+ getVkMembershipWitness(vk: VerificationKeyAsFields): Promise<MembershipWitness<7>>;
38
38
  getNoteHashMembershipWitness(leafIndex: bigint): Promise<MembershipWitness<typeof NOTE_HASH_TREE_HEIGHT>>;
39
39
  getNullifierMembershipWitness(nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
40
40
  getNoteHashTreeRoot(): Promise<Fr>;