@aztec/pxe 0.0.1-commit.e3c1de76 → 0.0.1-commit.e57c76e

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 (347) hide show
  1. package/dest/bin/check_oracle_version.js +43 -99
  2. package/dest/bin/index.d.ts +2 -0
  3. package/dest/bin/index.d.ts.map +1 -0
  4. package/dest/bin/index.js +1 -0
  5. package/dest/bin/oracle_version_helpers.d.ts +26 -0
  6. package/dest/bin/oracle_version_helpers.d.ts.map +1 -0
  7. package/dest/bin/oracle_version_helpers.js +93 -0
  8. package/dest/block_synchronizer/block_stream_source.d.ts +10 -0
  9. package/dest/block_synchronizer/block_stream_source.d.ts.map +1 -0
  10. package/dest/block_synchronizer/block_stream_source.js +62 -0
  11. package/dest/block_synchronizer/block_synchronizer.d.ts +9 -3
  12. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  13. package/dest/block_synchronizer/block_synchronizer.js +37 -11
  14. package/dest/config/index.d.ts +8 -2
  15. package/dest/config/index.d.ts.map +1 -1
  16. package/dest/config/index.js +13 -15
  17. package/dest/config/package_info.js +1 -1
  18. package/dest/contract_function_simulator/contract_function_simulator.d.ts +66 -29
  19. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/contract_function_simulator.js +216 -75
  21. package/dest/contract_function_simulator/ephemeral_array_service.d.ts +28 -0
  22. package/dest/contract_function_simulator/ephemeral_array_service.d.ts.map +1 -0
  23. package/dest/contract_function_simulator/ephemeral_array_service.js +78 -0
  24. package/dest/contract_function_simulator/execution_note_cache.d.ts +2 -2
  25. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  26. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +7 -11
  27. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/execution_tagging_index_cache.js +19 -15
  29. package/dest/contract_function_simulator/index.d.ts +14 -2
  30. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  31. package/dest/contract_function_simulator/index.js +11 -0
  32. package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts +48 -0
  33. package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts.map +1 -0
  34. package/dest/contract_function_simulator/noir-structs/bounded_vec.js +45 -0
  35. package/dest/contract_function_simulator/noir-structs/ephemeral_array.d.ts +37 -0
  36. package/dest/contract_function_simulator/noir-structs/ephemeral_array.d.ts.map +1 -0
  37. package/dest/contract_function_simulator/noir-structs/ephemeral_array.js +59 -0
  38. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +3 -4
  39. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  40. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +8 -9
  41. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +13 -3
  42. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
  43. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +35 -4
  44. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +2 -2
  45. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  46. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +2 -4
  47. package/dest/contract_function_simulator/noir-structs/note_data.d.ts +27 -0
  48. package/dest/contract_function_simulator/noir-structs/note_data.d.ts.map +1 -0
  49. package/dest/contract_function_simulator/noir-structs/note_data.js +3 -0
  50. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +3 -5
  51. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  52. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +6 -10
  53. package/dest/contract_function_simulator/noir-structs/option.d.ts +61 -0
  54. package/dest/contract_function_simulator/noir-structs/option.d.ts.map +1 -0
  55. package/dest/contract_function_simulator/noir-structs/option.js +62 -0
  56. package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts +11 -0
  57. package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts.map +1 -0
  58. package/dest/contract_function_simulator/noir-structs/provided_secret.js +24 -0
  59. package/dest/contract_function_simulator/oracle/interfaces.d.ts +16 -98
  60. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  61. package/dest/contract_function_simulator/oracle/interfaces.js +2 -2
  62. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +2 -2
  63. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  64. package/dest/contract_function_simulator/oracle/note_packing_utils.js +2 -2
  65. package/dest/contract_function_simulator/oracle/oracle.d.ts +75 -46
  66. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  67. package/dest/contract_function_simulator/oracle/oracle.js +471 -275
  68. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +127 -0
  69. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -0
  70. package/dest/contract_function_simulator/oracle/oracle_registry.js +786 -0
  71. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +139 -0
  72. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -0
  73. package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +560 -0
  74. package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
  75. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +68 -95
  76. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  77. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +141 -110
  78. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +156 -76
  79. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  80. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +450 -166
  81. package/dest/contract_function_simulator/pick_notes.d.ts +1 -1
  82. package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
  83. package/dest/contract_function_simulator/pick_notes.js +20 -3
  84. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +1 -1
  85. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  86. package/dest/contract_function_simulator/proxied_contract_data_source.js +35 -64
  87. package/dest/contract_logging.d.ts +27 -0
  88. package/dest/contract_logging.d.ts.map +1 -0
  89. package/dest/contract_logging.js +38 -0
  90. package/dest/contract_sync/contract_sync_service.d.ts +42 -0
  91. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  92. package/dest/contract_sync/contract_sync_service.js +135 -0
  93. package/dest/contract_sync/helpers.d.ts +27 -0
  94. package/dest/contract_sync/helpers.d.ts.map +1 -0
  95. package/dest/contract_sync/{index.js → helpers.js} +16 -17
  96. package/dest/debug/pxe_debug_utils.d.ts +14 -15
  97. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  98. package/dest/debug/pxe_debug_utils.js +16 -21
  99. package/dest/entrypoints/client/bundle/index.d.ts +3 -1
  100. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  101. package/dest/entrypoints/client/bundle/index.js +2 -0
  102. package/dest/entrypoints/client/bundle/utils.d.ts +2 -2
  103. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  104. package/dest/entrypoints/client/bundle/utils.js +21 -5
  105. package/dest/entrypoints/client/lazy/index.d.ts +3 -1
  106. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  107. package/dest/entrypoints/client/lazy/index.js +2 -0
  108. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  109. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  110. package/dest/entrypoints/client/lazy/utils.js +21 -5
  111. package/dest/entrypoints/pxe_creation_options.d.ts +9 -1
  112. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  113. package/dest/entrypoints/pxe_creation_options.js +3 -1
  114. package/dest/entrypoints/server/index.d.ts +5 -3
  115. package/dest/entrypoints/server/index.d.ts.map +1 -1
  116. package/dest/entrypoints/server/index.js +4 -2
  117. package/dest/entrypoints/server/utils.d.ts +4 -3
  118. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  119. package/dest/entrypoints/server/utils.js +21 -5
  120. package/dest/events/event_service.d.ts +15 -6
  121. package/dest/events/event_service.d.ts.map +1 -1
  122. package/dest/events/event_service.js +44 -11
  123. package/dest/events/private_event_filter_validator.d.ts +3 -2
  124. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  125. package/dest/events/private_event_filter_validator.js +15 -0
  126. package/dest/hooks/authorize_utility_call.d.ts +41 -0
  127. package/dest/hooks/authorize_utility_call.d.ts.map +1 -0
  128. package/dest/hooks/authorize_utility_call.js +4 -0
  129. package/dest/hooks/execution_hooks.d.ts +42 -0
  130. package/dest/hooks/execution_hooks.d.ts.map +1 -0
  131. package/dest/hooks/execution_hooks.js +9 -0
  132. package/dest/hooks/index.d.ts +4 -0
  133. package/dest/hooks/index.d.ts.map +1 -0
  134. package/dest/hooks/index.js +1 -0
  135. package/dest/logs/log_service.d.ts +9 -8
  136. package/dest/logs/log_service.d.ts.map +1 -1
  137. package/dest/logs/log_service.js +131 -84
  138. package/dest/messages/message_context_service.d.ts +17 -0
  139. package/dest/messages/message_context_service.d.ts.map +1 -0
  140. package/dest/messages/message_context_service.js +55 -0
  141. package/dest/notes/note_service.d.ts +27 -5
  142. package/dest/notes/note_service.d.ts.map +1 -1
  143. package/dest/notes/note_service.js +83 -58
  144. package/dest/notes_filter.d.ts +24 -0
  145. package/dest/notes_filter.d.ts.map +1 -0
  146. package/dest/notes_filter.js +4 -0
  147. package/dest/oracle_version.d.ts +4 -3
  148. package/dest/oracle_version.d.ts.map +1 -1
  149. package/dest/oracle_version.js +20 -10
  150. package/dest/private_kernel/batch_planner.d.ts +47 -0
  151. package/dest/private_kernel/batch_planner.d.ts.map +1 -0
  152. package/dest/private_kernel/batch_planner.js +104 -0
  153. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  154. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  155. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  156. package/dest/private_kernel/hints/index.d.ts +1 -1
  157. package/dest/private_kernel/hints/index.js +1 -1
  158. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +4 -3
  159. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
  160. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +130 -69
  161. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  162. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  163. package/dest/private_kernel/hints/test_utils.js +202 -0
  164. package/dest/private_kernel/private_kernel_execution_prover.d.ts +6 -2
  165. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  166. package/dest/private_kernel/private_kernel_execution_prover.js +166 -65
  167. package/dest/private_kernel/private_kernel_oracle.d.ts +15 -11
  168. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  169. package/dest/private_kernel/private_kernel_oracle.js +31 -25
  170. package/dest/pxe.d.ts +120 -24
  171. package/dest/pxe.d.ts.map +1 -1
  172. package/dest/pxe.js +231 -134
  173. package/dest/storage/anchor_block_store/anchor_block_store.js +1 -1
  174. package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts +42 -0
  175. package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts.map +1 -0
  176. package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.js +93 -0
  177. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +15 -0
  178. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -0
  179. package/dest/storage/backwards_compatibility_tests/schema_tests.js +591 -0
  180. package/dest/storage/backwards_compatibility_tests/store_spy.d.ts +19 -0
  181. package/dest/storage/backwards_compatibility_tests/store_spy.d.ts.map +1 -0
  182. package/dest/storage/backwards_compatibility_tests/store_spy.js +63 -0
  183. package/dest/storage/capsule_store/capsule_service.d.ts +21 -0
  184. package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -0
  185. package/dest/storage/capsule_store/capsule_service.js +50 -0
  186. package/dest/storage/capsule_store/capsule_store.d.ts +9 -9
  187. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
  188. package/dest/storage/capsule_store/capsule_store.js +36 -28
  189. package/dest/storage/capsule_store/index.d.ts +2 -1
  190. package/dest/storage/capsule_store/index.d.ts.map +1 -1
  191. package/dest/storage/capsule_store/index.js +1 -0
  192. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  193. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  194. package/dest/storage/contract_store/contract_store.js +146 -87
  195. package/dest/storage/metadata.d.ts +1 -1
  196. package/dest/storage/metadata.js +1 -1
  197. package/dest/storage/note_store/note_store.d.ts +3 -3
  198. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  199. package/dest/storage/note_store/note_store.js +6 -4
  200. package/dest/storage/open_pxe_stores.d.ts +33 -0
  201. package/dest/storage/open_pxe_stores.d.ts.map +1 -0
  202. package/dest/storage/open_pxe_stores.js +27 -0
  203. package/dest/storage/private_event_store/private_event_store.d.ts +1 -1
  204. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  205. package/dest/storage/private_event_store/private_event_store.js +3 -0
  206. package/dest/storage/private_event_store/stored_private_event.js +1 -1
  207. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
  208. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  209. package/dest/storage/tagging_store/sender_tagging_store.d.ts +29 -28
  210. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  211. package/dest/storage/tagging_store/sender_tagging_store.js +141 -115
  212. package/dest/tagging/get_all_logs_by_tags.d.ts +34 -10
  213. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
  214. package/dest/tagging/get_all_logs_by_tags.js +45 -32
  215. package/dest/tagging/index.d.ts +6 -5
  216. package/dest/tagging/index.d.ts.map +1 -1
  217. package/dest/tagging/index.js +4 -3
  218. package/dest/tagging/persist_sender_tagging_index_ranges.d.ts +29 -0
  219. package/dest/tagging/persist_sender_tagging_index_ranges.d.ts.map +1 -0
  220. package/dest/tagging/persist_sender_tagging_index_ranges.js +42 -0
  221. package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +56 -0
  222. package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts.map +1 -0
  223. package/dest/tagging/recipient_sync/sync_tagged_private_logs.js +163 -0
  224. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +3 -3
  225. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -1
  226. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  227. package/dest/tagging/reconcile_tagging_index_ranges.d.ts +36 -0
  228. package/dest/tagging/reconcile_tagging_index_ranges.d.ts.map +1 -0
  229. package/dest/tagging/reconcile_tagging_index_ranges.js +74 -0
  230. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -9
  231. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  232. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +32 -14
  233. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +13 -7
  234. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  235. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +41 -10
  236. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -7
  237. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  238. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +37 -25
  239. package/package.json +29 -17
  240. package/src/bin/check_oracle_version.ts +49 -122
  241. package/src/bin/index.ts +1 -0
  242. package/src/bin/oracle_version_helpers.ts +121 -0
  243. package/src/block_synchronizer/block_stream_source.ts +81 -0
  244. package/src/block_synchronizer/block_synchronizer.ts +39 -11
  245. package/src/config/index.ts +15 -9
  246. package/src/config/package_info.ts +1 -1
  247. package/src/contract_function_simulator/contract_function_simulator.ts +391 -136
  248. package/src/contract_function_simulator/ephemeral_array_service.ts +110 -0
  249. package/src/contract_function_simulator/execution_note_cache.ts +1 -1
  250. package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -18
  251. package/src/contract_function_simulator/index.ts +51 -1
  252. package/src/contract_function_simulator/noir-structs/bounded_vec.ts +55 -0
  253. package/src/contract_function_simulator/noir-structs/ephemeral_array.ts +66 -0
  254. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +9 -8
  255. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +36 -3
  256. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +2 -5
  257. package/src/contract_function_simulator/noir-structs/note_data.ts +27 -0
  258. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +4 -9
  259. package/src/contract_function_simulator/noir-structs/option.ts +69 -0
  260. package/src/contract_function_simulator/noir-structs/provided_secret.ts +27 -0
  261. package/src/contract_function_simulator/oracle/interfaces.ts +12 -176
  262. package/src/contract_function_simulator/oracle/note_packing_utils.ts +3 -3
  263. package/src/contract_function_simulator/oracle/oracle.ts +564 -473
  264. package/src/contract_function_simulator/oracle/oracle_registry.ts +585 -0
  265. package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +553 -0
  266. package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
  267. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +173 -205
  268. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +664 -245
  269. package/src/contract_function_simulator/pick_notes.ts +22 -3
  270. package/src/contract_function_simulator/proxied_contract_data_source.ts +41 -64
  271. package/src/contract_logging.ts +52 -0
  272. package/src/contract_sync/contract_sync_service.ts +189 -0
  273. package/src/contract_sync/{index.ts → helpers.ts} +17 -29
  274. package/src/debug/pxe_debug_utils.ts +47 -25
  275. package/src/entrypoints/client/bundle/index.ts +2 -0
  276. package/src/entrypoints/client/bundle/utils.ts +19 -6
  277. package/src/entrypoints/client/lazy/index.ts +2 -0
  278. package/src/entrypoints/client/lazy/utils.ts +19 -6
  279. package/src/entrypoints/pxe_creation_options.ts +14 -0
  280. package/src/entrypoints/server/index.ts +4 -2
  281. package/src/entrypoints/server/utils.ts +22 -13
  282. package/src/events/event_service.ts +69 -21
  283. package/src/events/private_event_filter_validator.ts +21 -1
  284. package/src/hooks/authorize_utility_call.ts +44 -0
  285. package/src/hooks/execution_hooks.ts +48 -0
  286. package/src/hooks/index.ts +7 -0
  287. package/src/logs/log_service.ts +162 -145
  288. package/src/messages/message_context_service.ts +62 -0
  289. package/src/notes/note_service.ts +120 -85
  290. package/src/notes_filter.ts +24 -0
  291. package/src/oracle_version.ts +20 -10
  292. package/src/private_kernel/batch_planner.ts +169 -0
  293. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  294. package/src/private_kernel/hints/index.ts +1 -1
  295. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +165 -118
  296. package/src/private_kernel/hints/test_utils.ts +318 -0
  297. package/src/private_kernel/private_kernel_execution_prover.ts +254 -89
  298. package/src/private_kernel/private_kernel_oracle.ts +42 -32
  299. package/src/pxe.ts +416 -181
  300. package/src/storage/anchor_block_store/anchor_block_store.ts +1 -1
  301. package/src/storage/backwards_compatibility_tests/__snapshots__/AddressStore.json +22 -0
  302. package/src/storage/backwards_compatibility_tests/__snapshots__/AnchorBlockStore.json +3 -0
  303. package/src/storage/backwards_compatibility_tests/__snapshots__/CapsuleStore.json +16 -0
  304. package/src/storage/backwards_compatibility_tests/__snapshots__/ContractStore.json +28 -0
  305. package/src/storage/backwards_compatibility_tests/__snapshots__/KeyStore.json +52 -0
  306. package/src/storage/backwards_compatibility_tests/__snapshots__/L2TipsKVStore.json +46 -0
  307. package/src/storage/backwards_compatibility_tests/__snapshots__/NoteStore.json +36 -0
  308. package/src/storage/backwards_compatibility_tests/__snapshots__/PrivateEventStore.json +44 -0
  309. package/src/storage/backwards_compatibility_tests/__snapshots__/RecipientTaggingStore.json +18 -0
  310. package/src/storage/backwards_compatibility_tests/__snapshots__/SenderAddressBookStore.json +16 -0
  311. package/src/storage/backwards_compatibility_tests/__snapshots__/SenderTaggingStore.json +22 -0
  312. package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +97 -0
  313. package/src/storage/backwards_compatibility_tests/kv_store_snapshot.ts +122 -0
  314. package/src/storage/backwards_compatibility_tests/schema_tests.ts +712 -0
  315. package/src/storage/backwards_compatibility_tests/store_spy.ts +73 -0
  316. package/src/storage/capsule_store/capsule_service.ts +90 -0
  317. package/src/storage/capsule_store/capsule_store.ts +44 -26
  318. package/src/storage/capsule_store/index.ts +1 -0
  319. package/src/storage/contract_store/contract_store.ts +182 -104
  320. package/src/storage/metadata.ts +1 -1
  321. package/src/storage/note_store/note_store.ts +9 -5
  322. package/src/storage/open_pxe_stores.ts +49 -0
  323. package/src/storage/private_event_store/private_event_store.ts +4 -0
  324. package/src/storage/private_event_store/stored_private_event.ts +1 -1
  325. package/src/storage/tagging_store/recipient_tagging_store.ts +5 -5
  326. package/src/storage/tagging_store/sender_tagging_store.ts +185 -138
  327. package/src/tagging/get_all_logs_by_tags.ts +87 -35
  328. package/src/tagging/index.ts +5 -4
  329. package/src/tagging/persist_sender_tagging_index_ranges.ts +57 -0
  330. package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +240 -0
  331. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +4 -4
  332. package/src/tagging/reconcile_tagging_index_ranges.ts +102 -0
  333. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +52 -17
  334. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +44 -14
  335. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +27 -27
  336. package/dest/contract_sync/index.d.ts +0 -23
  337. package/dest/contract_sync/index.d.ts.map +0 -1
  338. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  339. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
  340. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +0 -15
  341. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +0 -1
  342. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +0 -99
  343. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +0 -15
  344. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +0 -1
  345. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +0 -32
  346. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +0 -143
  347. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +0 -49
@@ -0,0 +1,202 @@
1
+ import { MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_CALL, MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_CALL, MAX_NULLIFIERS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PRIVATE_LOGS_PER_CALL, MAX_PRIVATE_LOGS_PER_TX } from '@aztec/constants';
2
+ import { makeTuple } from '@aztec/foundation/array';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import { ClaimedLengthArray, KeyValidationRequest, KeyValidationRequestAndSeparator, NoteHash, Nullifier, PrivateCircuitPublicInputs, PrivateKernelCircuitPublicInputs, ReadRequest, ScopedKeyValidationRequestAndSeparator, ScopedNoteHash, ScopedNullifier, ScopedReadRequest } from '@aztec/stdlib/kernel';
6
+ import { PrivateLogData, ScopedPrivateLogData } from '@aztec/stdlib/kernel';
7
+ import { PrivateLog } from '@aztec/stdlib/logs';
8
+ import { PrivateCallExecutionResult } from '@aztec/stdlib/tx';
9
+ import { VerificationKeyData } from '@aztec/stdlib/vks';
10
+ const DEFAULT_CONTRACT_ADDRESS = AztecAddress.fromBigInt(987654n);
11
+ /**
12
+ * Builds a ClaimedLengthArray from a list of items, padding to the required size.
13
+ */ function makeClaimed(items, emptyFactory, maxSize) {
14
+ const padded = makeTuple(maxSize, (i)=>items[i] ?? emptyFactory.empty());
15
+ return new ClaimedLengthArray(padded, items.length);
16
+ }
17
+ /** Builder for PrivateKernelCircuitPublicInputs with fluent API for adding side effects. */ export class PrivateKernelCircuitPublicInputsBuilder {
18
+ contractAddress;
19
+ noteHashes;
20
+ nullifiers;
21
+ noteHashReadRequests;
22
+ nullifierReadRequests;
23
+ keyValidationRequests;
24
+ privateLogs;
25
+ nextCounter;
26
+ constructor(contractAddress = DEFAULT_CONTRACT_ADDRESS, startCounter = 1){
27
+ this.contractAddress = contractAddress;
28
+ this.noteHashes = [];
29
+ this.nullifiers = [];
30
+ this.noteHashReadRequests = [];
31
+ this.nullifierReadRequests = [];
32
+ this.keyValidationRequests = [];
33
+ this.privateLogs = [];
34
+ this.nextCounter = startCounter;
35
+ }
36
+ getCounter(sideEffectCounter) {
37
+ if (sideEffectCounter !== undefined) {
38
+ this.nextCounter = sideEffectCounter + 1;
39
+ return sideEffectCounter;
40
+ }
41
+ return this.nextCounter++;
42
+ }
43
+ /** Adds a note hash to the accumulated data. Defaults are generated randomly. */ addNoteHash(opts) {
44
+ const value = opts?.value ?? Fr.random();
45
+ const counter = this.getCounter(opts?.counter);
46
+ const addr = opts?.contractAddress ?? this.contractAddress;
47
+ this.noteHashes.push(new NoteHash(value, counter).scope(addr));
48
+ return this;
49
+ }
50
+ /** Adds a nullifier to the accumulated data. Defaults are generated randomly. */ addNullifier(opts) {
51
+ const value = opts?.value ?? Fr.random();
52
+ const noteHash = opts?.noteHash ?? Fr.ZERO;
53
+ const counter = this.getCounter(opts?.counter);
54
+ const addr = opts?.contractAddress ?? this.contractAddress;
55
+ this.nullifiers.push(new Nullifier(value, noteHash, counter).scope(addr));
56
+ return this;
57
+ }
58
+ /** Adds a pending note hash read request (non-empty contract address, can match a pending note hash). */ addPendingNoteHashReadRequest(opts) {
59
+ const value = opts?.value ?? Fr.random();
60
+ const counter = this.getCounter(opts?.counter);
61
+ const addr = opts?.contractAddress ?? this.contractAddress;
62
+ this.noteHashReadRequests.push(new ScopedReadRequest(new ReadRequest(value, counter), addr));
63
+ return this;
64
+ }
65
+ /** Adds a settled note hash read request (empty contract address, resolved against the note hash tree). */ addSettledNoteHashReadRequest(opts) {
66
+ const value = opts?.value ?? Fr.random();
67
+ const counter = this.getCounter(opts?.counter);
68
+ this.noteHashReadRequests.push(new ScopedReadRequest(new ReadRequest(value, counter), AztecAddress.ZERO));
69
+ return this;
70
+ }
71
+ /** Adds a pending nullifier read request (non-empty contract address, can match a pending nullifier). */ addPendingNullifierReadRequest(opts) {
72
+ const value = opts?.value ?? Fr.random();
73
+ const counter = this.getCounter(opts?.counter);
74
+ const addr = opts?.contractAddress ?? this.contractAddress;
75
+ this.nullifierReadRequests.push(new ScopedReadRequest(new ReadRequest(value, counter), addr));
76
+ return this;
77
+ }
78
+ /** Adds a settled nullifier read request (empty contract address, resolved against the nullifier tree). */ addSettledNullifierReadRequest(opts) {
79
+ const value = opts?.value ?? Fr.random();
80
+ const counter = this.getCounter(opts?.counter);
81
+ this.nullifierReadRequests.push(new ScopedReadRequest(new ReadRequest(value, counter), AztecAddress.ZERO));
82
+ return this;
83
+ }
84
+ /** Adds a key validation request to validation requests. */ addKeyValidationRequest(opts) {
85
+ const addr = opts?.contractAddress ?? this.contractAddress;
86
+ this.keyValidationRequests.push(new ScopedKeyValidationRequestAndSeparator(new KeyValidationRequestAndSeparator(new KeyValidationRequest(Fr.random(), Fr.random()), Fr.random()), addr));
87
+ return this;
88
+ }
89
+ /** Adds a private log to the accumulated data. Defaults are generated randomly. */ addPrivateLog(opts) {
90
+ const noteHashCounter = opts?.noteHashCounter ?? 0;
91
+ const counter = this.getCounter(opts?.counter);
92
+ const addr = opts?.contractAddress ?? this.contractAddress;
93
+ this.privateLogs.push(new ScopedPrivateLogData(new PrivateLogData(PrivateLog.empty(), noteHashCounter, counter), addr));
94
+ return this;
95
+ }
96
+ /** Builds the PrivateKernelCircuitPublicInputs with all added side effects. */ build() {
97
+ const publicInputs = PrivateKernelCircuitPublicInputs.empty();
98
+ publicInputs.end.noteHashes = makeClaimed(this.noteHashes, ScopedNoteHash, MAX_NOTE_HASHES_PER_TX);
99
+ publicInputs.end.nullifiers = makeClaimed(this.nullifiers, ScopedNullifier, MAX_NULLIFIERS_PER_TX);
100
+ publicInputs.end.privateLogs = makeClaimed(this.privateLogs, ScopedPrivateLogData, MAX_PRIVATE_LOGS_PER_TX);
101
+ publicInputs.validationRequests.noteHashReadRequests = makeClaimed(this.noteHashReadRequests, ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_TX);
102
+ publicInputs.validationRequests.nullifierReadRequests = makeClaimed(this.nullifierReadRequests, ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_TX);
103
+ publicInputs.validationRequests.scopedKeyValidationRequestsAndSeparators = makeClaimed(this.keyValidationRequests, ScopedKeyValidationRequestAndSeparator, MAX_KEY_VALIDATION_REQUESTS_PER_TX);
104
+ return publicInputs;
105
+ }
106
+ }
107
+ /** Builder for PrivateCircuitPublicInputs (call-level) with fluent API for adding side effects. */ export class PrivateCircuitPublicInputsBuilder {
108
+ contractAddress;
109
+ noteHashes;
110
+ nullifiers;
111
+ noteHashReadRequests;
112
+ nullifierReadRequests;
113
+ keyValidationRequests;
114
+ privateLogs;
115
+ nextCounter;
116
+ constructor(contractAddress = DEFAULT_CONTRACT_ADDRESS, startCounter = 1){
117
+ this.contractAddress = contractAddress;
118
+ this.noteHashes = [];
119
+ this.nullifiers = [];
120
+ this.noteHashReadRequests = [];
121
+ this.nullifierReadRequests = [];
122
+ this.keyValidationRequests = [];
123
+ this.privateLogs = [];
124
+ this.nextCounter = startCounter;
125
+ }
126
+ getCounter(sideEffectCounter) {
127
+ if (sideEffectCounter !== undefined) {
128
+ this.nextCounter = sideEffectCounter + 1;
129
+ return sideEffectCounter;
130
+ }
131
+ return this.nextCounter++;
132
+ }
133
+ /** Adds a note hash. Defaults are generated randomly. */ addNoteHash(opts) {
134
+ const value = opts?.value ?? Fr.random();
135
+ const counter = this.getCounter(opts?.counter);
136
+ this.noteHashes.push(new NoteHash(value, counter));
137
+ return this;
138
+ }
139
+ /** Adds a nullifier. Defaults are generated randomly. */ addNullifier(opts) {
140
+ const value = opts?.value ?? Fr.random();
141
+ const noteHash = opts?.noteHash ?? Fr.ZERO;
142
+ const counter = this.getCounter(opts?.counter);
143
+ this.nullifiers.push(new Nullifier(value, noteHash, counter));
144
+ return this;
145
+ }
146
+ /** Adds a pending note hash read request (non-empty contract address, can match a pending note hash). */ addPendingNoteHashReadRequest(opts) {
147
+ const value = opts?.value ?? Fr.random();
148
+ const counter = this.getCounter(opts?.counter);
149
+ this.noteHashReadRequests.push(new ScopedReadRequest(new ReadRequest(value, counter), this.contractAddress));
150
+ return this;
151
+ }
152
+ /** Adds a settled note hash read request (empty contract address, resolved against the note hash tree). */ addSettledNoteHashReadRequest(opts) {
153
+ const value = opts?.value ?? Fr.random();
154
+ const counter = this.getCounter(opts?.counter);
155
+ this.noteHashReadRequests.push(new ScopedReadRequest(new ReadRequest(value, counter), AztecAddress.ZERO));
156
+ return this;
157
+ }
158
+ /** Adds a pending nullifier read request (non-empty contract address, can match a pending nullifier). */ addPendingNullifierReadRequest(opts) {
159
+ const value = opts?.value ?? Fr.random();
160
+ const counter = this.getCounter(opts?.counter);
161
+ this.nullifierReadRequests.push(new ScopedReadRequest(new ReadRequest(value, counter), this.contractAddress));
162
+ return this;
163
+ }
164
+ /** Adds a settled nullifier read request (empty contract address, resolved against the nullifier tree). */ addSettledNullifierReadRequest(opts) {
165
+ const value = opts?.value ?? Fr.random();
166
+ const counter = this.getCounter(opts?.counter);
167
+ this.nullifierReadRequests.push(new ScopedReadRequest(new ReadRequest(value, counter), AztecAddress.ZERO));
168
+ return this;
169
+ }
170
+ /** Adds a key validation request. */ addKeyValidationRequest() {
171
+ this.keyValidationRequests.push(new KeyValidationRequestAndSeparator(new KeyValidationRequest(Fr.random(), Fr.random()), Fr.random()));
172
+ return this;
173
+ }
174
+ /** Adds a private log. Defaults are generated randomly. */ addPrivateLog(opts) {
175
+ const noteHashCounter = opts?.noteHashCounter ?? 0;
176
+ const counter = this.getCounter(opts?.counter);
177
+ this.privateLogs.push(new PrivateLogData(PrivateLog.empty(), noteHashCounter, counter));
178
+ return this;
179
+ }
180
+ /** Builds the PrivateCircuitPublicInputs with all added side effects. */ build() {
181
+ const publicInputs = PrivateCircuitPublicInputs.empty();
182
+ publicInputs.callContext.contractAddress = this.contractAddress;
183
+ publicInputs.noteHashes = makeClaimed(this.noteHashes, NoteHash, MAX_NOTE_HASHES_PER_CALL);
184
+ publicInputs.nullifiers = makeClaimed(this.nullifiers, Nullifier, MAX_NULLIFIERS_PER_CALL);
185
+ publicInputs.privateLogs = makeClaimed(this.privateLogs, PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL);
186
+ publicInputs.noteHashReadRequests = makeClaimed(this.noteHashReadRequests, ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL);
187
+ publicInputs.nullifierReadRequests = makeClaimed(this.nullifierReadRequests, ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL);
188
+ publicInputs.keyValidationRequestsAndSeparators = makeClaimed(this.keyValidationRequests, KeyValidationRequestAndSeparator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL);
189
+ return publicInputs;
190
+ }
191
+ }
192
+ /** Wraps a PrivateKernelCircuitPublicInputs in a PrivateKernelSimulateOutput. */ export function makeKernelOutput(publicInputs) {
193
+ return {
194
+ publicInputs: publicInputs ?? PrivateKernelCircuitPublicInputs.empty(),
195
+ verificationKey: VerificationKeyData.empty(),
196
+ outputWitness: new Map(),
197
+ bytecode: Buffer.from([])
198
+ };
199
+ }
200
+ /** Wraps a PrivateCircuitPublicInputs in a PrivateCallExecutionResult. */ export function makeExecutionResult(publicInputs) {
201
+ return new PrivateCallExecutionResult(Buffer.alloc(0), Buffer.alloc(0), new Map(), publicInputs ?? PrivateCircuitPublicInputs.empty(), [], new Map(), [], [], [], [], []);
202
+ }
@@ -18,8 +18,9 @@ export declare class PrivateKernelExecutionProver {
18
18
  private oracle;
19
19
  private proofCreator;
20
20
  private fakeProofs;
21
+ private maxBatchSize;
21
22
  private log;
22
- constructor(oracle: PrivateKernelOracle, proofCreator: PrivateKernelProver, fakeProofs?: boolean, bindings?: LoggerBindings);
23
+ constructor(oracle: PrivateKernelOracle, proofCreator: PrivateKernelProver, fakeProofs?: boolean, bindings?: LoggerBindings, maxBatchSize?: number);
23
24
  /**
24
25
  * Generate a proof for a given transaction request and execution result.
25
26
  * The function iterates through the nested executions in the execution result, creates private call data,
@@ -40,6 +41,9 @@ export declare class PrivateKernelExecutionProver {
40
41
  */
41
42
  private ensurePublicInputsMatch;
42
43
  private getVkData;
44
+ private consumeNextApp;
45
+ private prefetchUpdatedClassIdHints;
43
46
  private createPrivateCallData;
47
+ private runBatchedKernel;
44
48
  }
45
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfZXhlY3V0aW9uX3Byb3Zlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL3ByaXZhdGVfa2VybmVsX2V4ZWN1dGlvbl9wcm92ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFlLEtBQUssY0FBYyxFQU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,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,CAAS;IAEpB,YACU,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ,EAC1B,QAAQ,CAAC,EAAE,cAAc,EAG1B;IAED;;;;;;;;;;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,CAoRlF;IAED;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;YAoBjB,SAAS;YAST,qBAAqB;CA+BpC"}
1
+ {"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAMvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAQL,KAAK,iCAAiC,EAStC,KAAK,oCAAoC,EAG1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAM1B,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;IAElB,OAAO,CAAC,YAAY;IAPtB,OAAO,CAAC,GAAG,CAAS;IAEpB,YACU,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ,EAC1B,QAAQ,CAAC,EAAE,cAAc,EACjB,YAAY,GAAE,MAA4B,EAGnD;IAED;;;;;;;;;;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,CAoOlF;IAED;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;YAoBjB,SAAS;YAcT,cAAc;YA4Bd,2BAA2B;YAiB3B,qBAAqB;YAuCrB,gBAAgB;CAgJ/B"}
@@ -1,3 +1,5 @@
1
+ import { MAX_APPS_PER_KERNEL } from '@aztec/constants';
2
+ import { uniqueBy } from '@aztec/foundation/collection';
1
3
  import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto/keys';
2
4
  import { Fr } from '@aztec/foundation/curves/bn254';
3
5
  import { createLogger } from '@aztec/foundation/log';
@@ -6,10 +8,12 @@ import { Timer } from '@aztec/foundation/timer';
6
8
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
7
9
  import { ProtocolContractsList } from '@aztec/protocol-contracts';
8
10
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
9
- import { HidingKernelToPublicPrivateInputs, HidingKernelToRollupPrivateInputs, PaddedSideEffectAmounts, PrivateCallData, PrivateKernelCircuitPublicInputs, PrivateKernelData, PrivateKernelInitCircuitPrivateInputs, PrivateKernelInnerCircuitPrivateInputs, PrivateKernelTailCircuitPrivateInputs, PrivateVerificationKeyHints } from '@aztec/stdlib/kernel';
11
+ import { HidingKernelToPublicPrivateInputs, HidingKernelToRollupPrivateInputs, PaddedSideEffectAmounts, PrivateCallData, PrivateKernelCircuitPublicInputs, PrivateKernelData, PrivateKernelInit2CircuitPrivateInputs, PrivateKernelInit3CircuitPrivateInputs, PrivateKernelInitCircuitPrivateInputs, PrivateKernelInner2CircuitPrivateInputs, PrivateKernelInner3CircuitPrivateInputs, PrivateKernelInnerCircuitPrivateInputs, PrivateKernelTailCircuitPrivateInputs, PrivateVerificationKeyHints } from '@aztec/stdlib/kernel';
10
12
  import { ChonkProof } from '@aztec/stdlib/proofs';
11
- import { collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
13
+ import { collectNested, collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
12
14
  import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';
15
+ import { BatchPlanner } from './batch_planner.js';
16
+ import { computeTxExpirationTimestamp } from './hints/compute_tx_expiration_timestamp.js';
13
17
  import { PrivateKernelResetPrivateInputsBuilder } from './hints/private_kernel_reset_private_inputs_builder.js';
14
18
  const NULL_SIMULATE_OUTPUT = {
15
19
  publicInputs: PrivateKernelCircuitPublicInputs.empty(),
@@ -26,11 +30,13 @@ const NULL_SIMULATE_OUTPUT = {
26
30
  oracle;
27
31
  proofCreator;
28
32
  fakeProofs;
33
+ maxBatchSize;
29
34
  log;
30
- constructor(oracle, proofCreator, fakeProofs = false, bindings){
35
+ constructor(oracle, proofCreator, fakeProofs = false, bindings, maxBatchSize = MAX_APPS_PER_KERNEL){
31
36
  this.oracle = oracle;
32
37
  this.proofCreator = proofCreator;
33
38
  this.fakeProofs = fakeProofs;
39
+ this.maxBatchSize = maxBatchSize;
34
40
  this.log = createLogger('pxe:private-kernel-execution-prover', bindings);
35
41
  }
36
42
  /**
@@ -63,10 +69,16 @@ const NULL_SIMULATE_OUTPUT = {
63
69
  const noteHashNullifierCounterMap = collectNoteHashNullifierCounterMap(executionResult);
64
70
  const minRevertibleSideEffectCounter = getFinalMinRevertibleSideEffectCounter(executionResult);
65
71
  const splitCounter = isPrivateOnlyTx ? 0 : minRevertibleSideEffectCounter;
72
+ // Each kernel iteration absorbs up to `maxBatchSize` apps. The planner walks the upcoming
73
+ // apps and decides where the next reset must fall by using an accumulator and
74
+ // reusing the existing single-app `needsReset()` check.
75
+ const planner = new BatchPlanner(noteHashNullifierCounterMap, splitCounter, this.maxBatchSize);
76
+ const updatedClassIdHintsMap = await this.prefetchUpdatedClassIdHints(executionResult);
66
77
  while(executionStack.length){
67
78
  if (!firstIteration) {
68
79
  let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, splitCounter);
69
80
  while(resetBuilder.needsReset()){
81
+ // Inner reset: without siloing.
70
82
  const witgenTimer = new Timer();
71
83
  const privateInputs = await resetBuilder.build(this.oracle);
72
84
  output = generateWitnesses ? await this.proofCreator.generateResetOutput(privateInputs) : await this.proofCreator.simulateReset(privateInputs);
@@ -82,61 +94,37 @@ const NULL_SIMULATE_OUTPUT = {
82
94
  resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, splitCounter);
83
95
  }
84
96
  }
85
- const currentExecution = executionStack.pop();
86
- executionStack.push(...[
87
- ...currentExecution.nestedExecutionResults
88
- ].reverse());
89
- const functionName = await this.oracle.getDebugFunctionName(currentExecution.publicInputs.callContext.contractAddress, currentExecution.publicInputs.callContext.functionSelector);
90
- executionSteps.push({
91
- functionName: functionName,
92
- bytecode: currentExecution.acir,
93
- witness: currentExecution.partialWitness,
94
- vk: currentExecution.vk,
95
- timings: {
96
- witgen: currentExecution.profileResult?.timings.witgen ?? 0,
97
- oracles: currentExecution.profileResult?.timings.oracles
98
- }
99
- });
100
- const privateCallData = await this.createPrivateCallData(currentExecution);
101
- if (firstIteration) {
102
- const witgenTimer = new Timer();
103
- const proofInput = new PrivateKernelInitCircuitPrivateInputs(txRequest, getVKTreeRoot(), ProtocolContractsList, privateCallData, isPrivateOnlyTx, executionResult.firstNullifier, minRevertibleSideEffectCounter);
104
- this.log.debug(`Calling private kernel init with isPrivateOnly ${isPrivateOnlyTx} and firstNullifierHint ${proofInput.firstNullifierHint}`);
105
- pushTestData('private-kernel-inputs-init', proofInput);
106
- output = generateWitnesses ? await this.proofCreator.generateInitOutput(proofInput) : await this.proofCreator.simulateInit(proofInput);
107
- executionSteps.push({
108
- functionName: 'private_kernel_init',
109
- bytecode: output.bytecode,
110
- witness: output.outputWitness,
111
- vk: output.verificationKey.keyAsBytes,
112
- timings: {
113
- witgen: witgenTimer.ms()
114
- }
115
- });
116
- } else {
117
- const witgenTimer = new Timer();
118
- const vkData = await this.getVkData(output.verificationKey);
119
- const previousKernelData = new PrivateKernelData(output.publicInputs, vkData);
120
- const proofInput = new PrivateKernelInnerCircuitPrivateInputs(previousKernelData, privateCallData);
121
- pushTestData('private-kernel-inputs-inner', proofInput);
122
- output = generateWitnesses ? await this.proofCreator.generateInnerOutput(proofInput) : await this.proofCreator.simulateInner(proofInput);
123
- executionSteps.push({
124
- functionName: 'private_kernel_inner',
125
- bytecode: output.bytecode,
126
- witness: output.outputWitness,
127
- vk: output.verificationKey.keyAsBytes,
128
- timings: {
129
- witgen: witgenTimer.ms()
130
- }
131
- });
97
+ const batchSize = planner.decideBatchSize(output.publicInputs, executionStack);
98
+ const apps = [];
99
+ for(let i = 0; i < batchSize; i++){
100
+ apps.push(await this.consumeNextApp(executionStack, executionSteps, updatedClassIdHintsMap));
132
101
  }
102
+ output = await this.runBatchedKernel({
103
+ apps,
104
+ firstIteration,
105
+ previousOutput: output,
106
+ txRequest,
107
+ isPrivateOnlyTx,
108
+ firstNullifierHint: executionResult.firstNullifier,
109
+ minRevertibleSideEffectCounter,
110
+ executionSteps,
111
+ generateWitnesses
112
+ });
133
113
  firstIteration = false;
134
114
  }
135
- // Reset.
136
- let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, splitCounter);
137
- while(resetBuilder.needsReset()){
115
+ // Final reset: include siloing of note hashes, nullifiers and private logs.
116
+ const finalResetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, splitCounter);
117
+ if (!finalResetBuilder.needsReset()) {
118
+ // The final reset must be performed exactly once, because each tx has at least one nullifier that requires
119
+ // siloing, and siloing cannot be done multiple times.
120
+ // While, in theory, it might be possible to silo note hashes first and then run another reset to silo nullifiers
121
+ // and/or private logs, we currently don't have standalone dimensions for the arrays that require siloing. As a
122
+ // result, all necessary siloing must be done together in a single reset.
123
+ // Refer to the possible combinations of dimensions in private_kernel_reset_config.json.
124
+ throw new Error('Nothing to reset for the final reset.');
125
+ } else {
138
126
  const witgenTimer = new Timer();
139
- const privateInputs = await resetBuilder.build(this.oracle);
127
+ const privateInputs = await finalResetBuilder.build(this.oracle);
140
128
  output = generateWitnesses ? await this.proofCreator.generateResetOutput(privateInputs) : await this.proofCreator.simulateReset(privateInputs);
141
129
  executionSteps.push({
142
130
  functionName: 'private_kernel_reset',
@@ -147,7 +135,6 @@ const NULL_SIMULATE_OUTPUT = {
147
135
  witgen: witgenTimer.ms()
148
136
  }
149
137
  });
150
- resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, splitCounter);
151
138
  }
152
139
  if (output.publicInputs.feePayer.isZero() && skipFeeEnforcement) {
153
140
  if (!skipProofGeneration) {
@@ -161,14 +148,10 @@ const NULL_SIMULATE_OUTPUT = {
161
148
  this.log.debug(`Calling private kernel tail with hwm ${previousKernelData.publicInputs.minRevertibleSideEffectCounter}`);
162
149
  // TODO: Enable padding once we better understand the final amounts to pad to.
163
150
  const paddedSideEffectAmounts = PaddedSideEffectAmounts.empty();
164
- // Use the aggregated includeByTimestamp set throughout the tx execution.
165
- // TODO: Call `computeTxIncludeByTimestamp` to round the value down and reduce precision, improving privacy.
166
- const includeByTimestampUpperBound = previousKernelData.publicInputs.includeByTimestamp;
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}.`);
170
- }
171
- const privateInputs = new PrivateKernelTailCircuitPrivateInputs(previousKernelData, paddedSideEffectAmounts, includeByTimestampUpperBound);
151
+ // Round the aggregated expirationTimestamp down to reduce precision and avoid leaking which private
152
+ // functions were called via their exact expiration offsets.
153
+ const expirationTimestampUpperBound = computeTxExpirationTimestamp(previousKernelData.publicInputs);
154
+ const privateInputs = new PrivateKernelTailCircuitPrivateInputs(previousKernelData, paddedSideEffectAmounts, expirationTimestampUpperBound);
172
155
  const witgenTimer = new Timer();
173
156
  const tailOutput = generateWitnesses ? await this.proofCreator.generateTailOutput(privateInputs) : await this.proofCreator.simulateTail(privateInputs);
174
157
  executionSteps.push({
@@ -261,14 +244,48 @@ const NULL_SIMULATE_OUTPUT = {
261
244
  const previousVkMembershipWitness = await this.oracle.getVkMembershipWitness(verificationKey.keyAsFields);
262
245
  return new VkData(verificationKey, Number(previousVkMembershipWitness.leafIndex), previousVkMembershipWitness.siblingPath);
263
246
  }
264
- async createPrivateCallData({ publicInputs, vk: vkAsBuffer }) {
247
+ /**
248
+ * Pops the next app off the execution stack, pushes its nested calls back on (preserving DFS
249
+ * order), records the app's execution step, and returns its constructed `PrivateCallData`.
250
+ * Caller is responsible for ensuring the stack is non-empty.
251
+ */ async consumeNextApp(executionStack, executionSteps, updatedClassIdHintsMap) {
252
+ const next = executionStack.pop();
253
+ executionStack.push(...[
254
+ ...next.nestedExecutionResults
255
+ ].reverse());
256
+ const functionName = await this.oracle.getDebugFunctionName(next.publicInputs.callContext.contractAddress, next.publicInputs.callContext.functionSelector);
257
+ executionSteps.push({
258
+ functionName: functionName,
259
+ bytecode: next.acir,
260
+ witness: next.partialWitness,
261
+ vk: next.vk,
262
+ timings: {
263
+ witgen: next.profileResult?.timings.witgen ?? 0,
264
+ oracles: next.profileResult?.timings.oracles
265
+ }
266
+ });
267
+ return await this.createPrivateCallData(next, updatedClassIdHintsMap);
268
+ }
269
+ /** Prefetches updated class id hints for all unique contracts in the execution tree in parallel. */ async prefetchUpdatedClassIdHints(executionResult) {
270
+ const allAddresses = collectNested([
271
+ executionResult.entrypoint
272
+ ], (exec)=>[
273
+ exec.publicInputs.callContext.contractAddress
274
+ ]);
275
+ const uniqueAddresses = uniqueBy(allAddresses, (a)=>a.toString());
276
+ return new Map(await Promise.all(uniqueAddresses.map(async (addr)=>[
277
+ addr.toString(),
278
+ await this.oracle.getUpdatedClassIdHints(addr)
279
+ ])));
280
+ }
281
+ async createPrivateCallData({ publicInputs, vk: vkAsBuffer }, updatedClassIdHintsMap) {
265
282
  const { contractAddress, functionSelector } = publicInputs.callContext;
266
283
  const vkAsFields = await vkAsFieldsMegaHonk(vkAsBuffer);
267
284
  const vk = await VerificationKeyAsFields.fromKey(vkAsFields);
268
285
  const { currentContractClassId, publicKeys, saltedInitializationHash } = await this.oracle.getContractAddressPreimage(contractAddress);
269
286
  const functionLeafMembershipWitness = await this.oracle.getFunctionMembershipWitness(currentContractClassId, functionSelector);
270
287
  const { artifactHash: contractClassArtifactHash, publicBytecodeCommitment: contractClassPublicBytecodeCommitment } = await this.oracle.getContractClassIdPreimage(currentContractClassId);
271
- const updatedClassIdHints = await this.oracle.getUpdatedClassIdHints(contractAddress);
288
+ const updatedClassIdHints = updatedClassIdHintsMap.get(contractAddress.toString());
272
289
  return PrivateCallData.from({
273
290
  publicInputs,
274
291
  vk,
@@ -282,4 +299,88 @@ const NULL_SIMULATE_OUTPUT = {
282
299
  })
283
300
  });
284
301
  }
302
+ /**
303
+ * Runs one batched kernel iteration. Picks the right circuit variant based on whether this is
304
+ * the first iteration or a later one and the size of the batch.
305
+ */ async runBatchedKernel(args) {
306
+ const { apps, firstIteration, previousOutput, txRequest, isPrivateOnlyTx, firstNullifierHint, minRevertibleSideEffectCounter, executionSteps, generateWitnesses } = args;
307
+ const witgenTimer = new Timer();
308
+ let output;
309
+ let functionName;
310
+ if (firstIteration) {
311
+ const vkTreeRoot = getVKTreeRoot();
312
+ switch(apps.length){
313
+ case 1:
314
+ {
315
+ const proofInput = new PrivateKernelInitCircuitPrivateInputs(txRequest, vkTreeRoot, ProtocolContractsList, apps[0], isPrivateOnlyTx, firstNullifierHint, minRevertibleSideEffectCounter);
316
+ this.log.debug(`Calling private kernel init with isPrivateOnly ${isPrivateOnlyTx} and firstNullifierHint ${proofInput.firstNullifierHint}`);
317
+ pushTestData('private-kernel-inputs-init', proofInput);
318
+ output = generateWitnesses ? await this.proofCreator.generateInitOutput(proofInput) : await this.proofCreator.simulateInit(proofInput);
319
+ functionName = 'private_kernel_init';
320
+ break;
321
+ }
322
+ case 2:
323
+ {
324
+ const proofInput = new PrivateKernelInit2CircuitPrivateInputs(txRequest, vkTreeRoot, ProtocolContractsList, apps[0], apps[1], isPrivateOnlyTx, firstNullifierHint, minRevertibleSideEffectCounter);
325
+ this.log.debug(`Calling private kernel init_2 with isPrivateOnly ${isPrivateOnlyTx} and firstNullifierHint ${proofInput.firstNullifierHint}`);
326
+ pushTestData('private-kernel-inputs-init-2', proofInput);
327
+ output = generateWitnesses ? await this.proofCreator.generateInit2Output(proofInput) : await this.proofCreator.simulateInit2(proofInput);
328
+ functionName = 'private_kernel_init_2';
329
+ break;
330
+ }
331
+ case 3:
332
+ {
333
+ const proofInput = new PrivateKernelInit3CircuitPrivateInputs(txRequest, vkTreeRoot, ProtocolContractsList, apps[0], apps[1], apps[2], isPrivateOnlyTx, firstNullifierHint, minRevertibleSideEffectCounter);
334
+ this.log.debug(`Calling private kernel init_3 with isPrivateOnly ${isPrivateOnlyTx} and firstNullifierHint ${proofInput.firstNullifierHint}`);
335
+ pushTestData('private-kernel-inputs-init-3', proofInput);
336
+ output = generateWitnesses ? await this.proofCreator.generateInit3Output(proofInput) : await this.proofCreator.simulateInit3(proofInput);
337
+ functionName = 'private_kernel_init_3';
338
+ break;
339
+ }
340
+ default:
341
+ throw new Error(`Unsupported init kernel batch size: ${apps.length}`);
342
+ }
343
+ } else {
344
+ const vkData = await this.getVkData(previousOutput.verificationKey);
345
+ const previousKernelData = new PrivateKernelData(previousOutput.publicInputs, vkData);
346
+ switch(apps.length){
347
+ case 1:
348
+ {
349
+ const proofInput = new PrivateKernelInnerCircuitPrivateInputs(previousKernelData, apps[0]);
350
+ pushTestData('private-kernel-inputs-inner', proofInput);
351
+ output = generateWitnesses ? await this.proofCreator.generateInnerOutput(proofInput) : await this.proofCreator.simulateInner(proofInput);
352
+ functionName = 'private_kernel_inner';
353
+ break;
354
+ }
355
+ case 2:
356
+ {
357
+ const proofInput = new PrivateKernelInner2CircuitPrivateInputs(previousKernelData, apps[0], apps[1]);
358
+ pushTestData('private-kernel-inputs-inner-2', proofInput);
359
+ output = generateWitnesses ? await this.proofCreator.generateInner2Output(proofInput) : await this.proofCreator.simulateInner2(proofInput);
360
+ functionName = 'private_kernel_inner_2';
361
+ break;
362
+ }
363
+ case 3:
364
+ {
365
+ const proofInput = new PrivateKernelInner3CircuitPrivateInputs(previousKernelData, apps[0], apps[1], apps[2]);
366
+ pushTestData('private-kernel-inputs-inner-3', proofInput);
367
+ output = generateWitnesses ? await this.proofCreator.generateInner3Output(proofInput) : await this.proofCreator.simulateInner3(proofInput);
368
+ functionName = 'private_kernel_inner_3';
369
+ break;
370
+ }
371
+ default:
372
+ throw new Error(`Unsupported inner kernel batch size: ${apps.length}`);
373
+ }
374
+ }
375
+ executionSteps.push({
376
+ functionName,
377
+ bytecode: output.bytecode,
378
+ witness: output.outputWitness,
379
+ vk: output.verificationKey.keyAsBytes,
380
+ timings: {
381
+ witgen: witgenTimer.ms()
382
+ }
383
+ });
384
+ return output;
385
+ }
285
386
  }
@@ -1,15 +1,15 @@
1
1
  import { FUNCTION_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT, VK_TREE_HEIGHT } from '@aztec/constants';
2
2
  import type { Fr } from '@aztec/foundation/curves/bn254';
3
- import type { GrumpkinScalar, Point } from '@aztec/foundation/curves/grumpkin';
3
+ import type { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
4
4
  import { MembershipWitness } from '@aztec/foundation/trees';
5
5
  import type { KeyStore } from '@aztec/key-store';
6
6
  import type { FunctionSelector } from '@aztec/stdlib/abi';
7
7
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
8
- import { BlockHash } from '@aztec/stdlib/block';
9
8
  import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
10
9
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
11
10
  import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
12
11
  import type { NullifierMembershipWitness } from '@aztec/stdlib/trees';
12
+ import type { BlockHeader } from '@aztec/stdlib/tx';
13
13
  import type { VerificationKeyAsFields } from '@aztec/stdlib/vks';
14
14
  import type { ContractStore } from '../storage/contract_store/contract_store.js';
15
15
  /**
@@ -19,14 +19,18 @@ export declare class PrivateKernelOracle {
19
19
  private contractStore;
20
20
  private keyStore;
21
21
  private node;
22
- private blockHash;
23
- constructor(contractStore: ContractStore, keyStore: KeyStore, node: AztecNode, blockHash: BlockHash);
22
+ private blockHeader;
23
+ constructor(contractStore: ContractStore, keyStore: KeyStore, node: AztecNode, blockHeader: BlockHeader);
24
24
  /** Retrieves the preimage of a contract address from the registered contract instances db. */
25
25
  getContractAddressPreimage(address: AztecAddress): Promise<ContractInstanceWithAddress & {
26
26
  saltedInitializationHash: Fr;
27
27
  }>;
28
28
  /** Retrieves the preimage of a contract class id from the contract classes db. */
29
- getContractClassIdPreimage(contractClassId: Fr): Promise<import("@aztec/stdlib/contract").ContractClassIdPreimage>;
29
+ getContractClassIdPreimage(contractClassId: Fr): Promise<{
30
+ artifactHash: Fr;
31
+ privateFunctionsRoot: Fr;
32
+ publicBytecodeCommitment: Fr;
33
+ }>;
30
34
  /** Returns a membership witness with the sibling path and leaf index in our private functions tree. */
31
35
  getFunctionMembershipWitness(contractClassId: Fr, selector: FunctionSelector): Promise<MembershipWitness<typeof FUNCTION_TREE_HEIGHT>>;
32
36
  /**
@@ -39,15 +43,15 @@ export declare class PrivateKernelOracle {
39
43
  /** Returns a membership witness with the sibling path and leaf index in our nullifier indexed merkle tree. */
40
44
  getNullifierMembershipWitness(nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
41
45
  /** Returns the root of our note hash merkle tree. */
42
- getNoteHashTreeRoot(): Promise<Fr>;
46
+ getNoteHashTreeRoot(): Fr;
43
47
  /**
44
- * Retrieves the sk_m corresponding to the pk_m.
45
- * @throws If the provided public key is not associated with any of the registered accounts.
46
- * @param masterPublicKey - The master public key to get secret key for.
48
+ * Retrieves the sk_m corresponding to the pk_m hash.
49
+ * @throws If the provided hash is not associated with any of the registered accounts.
50
+ * @param masterPublicKeyHash - The master public key hash to get secret key for.
47
51
  * @returns A Promise that resolves to sk_m.
48
52
  * @dev Used when feeding the sk_m to the kernel circuit for keys verification.
49
53
  */
50
- getMasterSecretKey(masterPublicKey: Point): Promise<GrumpkinScalar>;
54
+ getMasterSecretKey(masterPublicKeyHash: Fr): Promise<GrumpkinScalar>;
51
55
  /** Use debug data to get the function name corresponding to a selector. */
52
56
  getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
53
57
  /**
@@ -56,4 +60,4 @@ export declare class PrivateKernelOracle {
56
60
  */
57
61
  getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints>;
58
62
  }
59
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfb3JhY2xlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJpd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