@aztec/pxe 0.0.1-commit.d3ec352c → 0.0.1-commit.d431d1c
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.
- package/dest/bin/check_oracle_version.js +105 -15
- package/dest/block_synchronizer/block_synchronizer.d.ts +41 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
- package/dest/{synchronizer/synchronizer.js → block_synchronizer/block_synchronizer.js} +35 -30
- package/dest/block_synchronizer/index.d.ts +2 -0
- package/dest/block_synchronizer/index.d.ts.map +1 -0
- package/dest/block_synchronizer/index.js +1 -0
- package/dest/config/index.d.ts +4 -4
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
- package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/benchmarked_node.js +77 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +42 -14
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +73 -29
- package/dest/contract_function_simulator/execution_note_cache.d.ts +21 -12
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +48 -31
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +1 -1
- package/dest/contract_function_simulator/hashed_values_cache.d.ts +2 -2
- package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.d.ts +2 -2
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -3
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +5 -2
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +14 -13
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +4 -2
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +11 -7
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +14 -10
- package/dest/contract_function_simulator/oracle/oracle.d.ts +7 -7
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +40 -28
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +10 -16
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +19 -18
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +25 -25
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +29 -44
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +63 -21
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +162 -54
- package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
- package/dest/contract_function_simulator/pick_notes.js +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
- package/dest/debug/pxe_debug_utils.d.ts +31 -0
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
- package/dest/debug/pxe_debug_utils.js +37 -0
- package/dest/entrypoints/client/bundle/index.d.ts +1 -2
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +0 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +12 -3
- package/dest/entrypoints/client/lazy/index.d.ts +1 -2
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +0 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +12 -3
- package/dest/entrypoints/pxe_creation_options.d.ts +5 -2
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +3 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +2 -1
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +12 -8
- package/dest/error_enriching.d.ts +4 -4
- package/dest/error_enriching.d.ts.map +1 -1
- package/dest/error_enriching.js +6 -6
- package/dest/events/event_service.d.ts +16 -0
- package/dest/events/event_service.d.ts.map +1 -0
- package/dest/events/event_service.js +45 -0
- package/dest/events/index.d.ts +2 -0
- package/dest/events/index.d.ts.map +1 -0
- package/dest/events/index.js +1 -0
- package/dest/events/private_event_filter_validator.d.ts +9 -0
- package/dest/events/private_event_filter_validator.d.ts.map +1 -0
- package/dest/events/private_event_filter_validator.js +38 -0
- package/dest/job_coordinator/job_coordinator.d.ts +74 -0
- package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
- package/dest/job_coordinator/job_coordinator.js +93 -0
- package/dest/logs/log_service.d.ts +27 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +122 -0
- package/dest/notes/index.d.ts +2 -0
- package/dest/notes/index.d.ts.map +1 -0
- package/dest/notes/index.js +1 -0
- package/dest/notes/note_service.d.ts +48 -0
- package/dest/notes/note_service.d.ts.map +1 -0
- package/dest/notes/note_service.js +147 -0
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +2 -2
- package/dest/private_kernel/hints/index.d.ts +2 -2
- package/dest/private_kernel/hints/index.d.ts.map +1 -1
- package/dest/private_kernel/hints/index.js +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
- package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +13 -7
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +8 -9
- package/dest/private_kernel/private_kernel_oracle.d.ts +26 -29
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +90 -2
- package/dest/pxe.d.ts +45 -81
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +182 -215
- package/dest/storage/address_store/address_store.d.ts +11 -0
- package/dest/storage/address_store/address_store.d.ts.map +1 -0
- package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +1 -1
- package/dest/storage/address_store/index.d.ts +2 -0
- package/dest/storage/address_store/index.d.ts.map +1 -0
- package/dest/storage/address_store/index.js +1 -0
- package/dest/storage/{sync_data_provider/sync_data_provider.d.ts → anchor_block_store/anchor_block_store.d.ts} +2 -4
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
- package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +2 -9
- package/dest/storage/{sync_data_provider → anchor_block_store}/index.d.ts +2 -2
- package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/index.js +1 -0
- package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_store.js +255 -0
- package/dest/storage/capsule_store/index.d.ts +2 -0
- package/dest/storage/capsule_store/index.d.ts.map +1 -0
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +8 -5
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +46 -3
- package/dest/storage/contract_store/index.d.ts +2 -0
- package/dest/storage/contract_store/index.d.ts.map +1 -0
- package/dest/storage/contract_store/index.js +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
- package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +1 -1
- package/dest/storage/index.d.ts +8 -8
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -7
- package/dest/storage/note_store/index.d.ts +3 -0
- package/dest/storage/note_store/index.d.ts.map +1 -0
- package/dest/storage/note_store/index.js +2 -0
- package/dest/storage/{note_data_provider/note_data_provider.d.ts → note_store/note_store.d.ts} +15 -13
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/{note_data_provider/note_data_provider.js → note_store/note_store.js} +105 -102
- package/dest/storage/private_event_store/private_event_store.d.ts +78 -0
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
- package/dest/storage/private_event_store/private_event_store.js +222 -0
- package/dest/storage/tagging_store/index.d.ts +4 -0
- package/dest/storage/tagging_store/index.d.ts.map +1 -0
- package/dest/storage/tagging_store/index.js +3 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/recipient_tagging_store.js +99 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_address_book_store.js +30 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +77 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_tagging_store.js +278 -0
- package/dest/tagging/constants.d.ts +2 -2
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +10 -2
- package/dest/tagging/index.d.ts +15 -6
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +14 -5
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +29 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +20 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +32 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +20 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +57 -0
- package/dest/tree_membership/tree_membership_service.d.ts +50 -0
- package/dest/tree_membership/tree_membership_service.d.ts.map +1 -0
- package/dest/tree_membership/tree_membership_service.js +75 -0
- package/package.json +18 -18
- package/src/bin/check_oracle_version.ts +130 -20
- package/src/{synchronizer/synchronizer.ts → block_synchronizer/block_synchronizer.ts} +44 -30
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +3 -3
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/benchmarked_node.ts +103 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +118 -30
- package/src/contract_function_simulator/execution_note_cache.ts +51 -29
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +1 -1
- package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
- package/src/contract_function_simulator/index.ts +1 -1
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +5 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -1
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
- package/src/contract_function_simulator/oracle/interfaces.ts +13 -12
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +27 -13
- package/src/contract_function_simulator/oracle/oracle.ts +48 -32
- package/src/contract_function_simulator/oracle/private_execution.ts +22 -30
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +97 -58
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +233 -63
- package/src/contract_function_simulator/pick_notes.ts +1 -1
- package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
- package/src/debug/pxe_debug_utils.ts +48 -0
- package/src/entrypoints/client/bundle/index.ts +0 -1
- package/src/entrypoints/client/bundle/utils.ts +9 -3
- package/src/entrypoints/client/lazy/index.ts +0 -1
- package/src/entrypoints/client/lazy/utils.ts +9 -4
- package/src/entrypoints/pxe_creation_options.ts +4 -1
- package/src/entrypoints/server/index.ts +2 -1
- package/src/entrypoints/server/utils.ts +12 -16
- package/src/error_enriching.ts +7 -15
- package/src/events/event_service.ts +73 -0
- package/src/events/index.ts +1 -0
- package/src/events/private_event_filter_validator.ts +46 -0
- package/src/job_coordinator/job_coordinator.ts +149 -0
- package/src/logs/log_service.ts +204 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +194 -0
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/hints/index.ts +1 -1
- package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +34 -23
- package/src/private_kernel/private_kernel_execution_prover.ts +7 -9
- package/src/private_kernel/private_kernel_oracle.ts +118 -37
- package/src/pxe.ts +233 -279
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -1
- package/src/storage/address_store/index.ts +1 -0
- package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +2 -12
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/capsule_store/capsule_store.ts +315 -0
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +65 -3
- package/src/storage/contract_store/index.ts +1 -0
- package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +1 -1
- package/src/storage/index.ts +7 -7
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/{note_data_provider/note_data_provider.ts → note_store/note_store.ts} +117 -105
- package/src/storage/private_event_store/private_event_store.ts +324 -0
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +129 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +42 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +345 -0
- package/src/tagging/constants.ts +10 -2
- package/src/tagging/index.ts +17 -5
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +133 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +43 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +97 -0
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +48 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +75 -0
- package/src/tree_membership/tree_membership_service.ts +97 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -267
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
- package/dest/contract_function_simulator/execution_data_provider.js +0 -14
- package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
- package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
- package/dest/contract_function_simulator/proxied_node.js +0 -27
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -123
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -696
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -45
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.d.ts +0 -2
- package/dest/storage/address_data_provider/index.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.js +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -25
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -118
- package/dest/storage/capsule_data_provider/index.d.ts +0 -2
- package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.d.ts +0 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -37
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -105
- package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
- package/dest/storage/sync_data_provider/index.js +0 -1
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.d.ts +0 -2
- package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.js +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -40
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -89
- package/dest/synchronizer/index.d.ts +0 -2
- package/dest/synchronizer/index.d.ts.map +0 -1
- package/dest/synchronizer/index.js +0 -1
- package/dest/synchronizer/synchronizer.d.ts +0 -36
- package/dest/synchronizer/synchronizer.d.ts.map +0 -1
- package/dest/tagging/siloed_tag.d.ts +0 -14
- package/dest/tagging/siloed_tag.d.ts.map +0 -1
- package/dest/tagging/siloed_tag.js +0 -20
- package/dest/tagging/tag.d.ts +0 -12
- package/dest/tagging/tag.d.ts.map +0 -1
- package/dest/tagging/tag.js +0 -17
- package/dest/tagging/utils.d.ts +0 -18
- package/dest/tagging/utils.d.ts.map +0 -1
- package/dest/tagging/utils.js +0 -24
- package/src/contract_function_simulator/execution_data_provider.ts +0 -342
- package/src/contract_function_simulator/proxied_node.ts +0 -33
- package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1023
- package/src/private_kernel/private_kernel_oracle_impl.ts +0 -132
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -147
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -143
- package/src/storage/sync_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -120
- package/src/synchronizer/index.ts +0 -1
- package/src/tagging/siloed_tag.ts +0 -22
- package/src/tagging/tag.ts +0 -16
- package/src/tagging/utils.ts +0 -31
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BBPrivateKernelProver } from '@aztec/bb-prover/client';
|
|
1
2
|
import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
|
|
2
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
3
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
5
|
import { createStore } from '@aztec/kv-store/indexeddb';
|
|
5
6
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
@@ -26,9 +27,17 @@ import { PXE } from '../../../pxe.js';
|
|
|
26
27
|
};
|
|
27
28
|
const storeLogger = loggers.store ? loggers.store : createLogger('pxe:data:idb' + (logSuffix ? `:${logSuffix}` : ''));
|
|
28
29
|
const store = options.store ?? await createStore('pxe_data', configWithContracts, storeLogger);
|
|
29
|
-
const simulator = new WASMSimulator();
|
|
30
|
+
const simulator = options.simulator ?? new WASMSimulator();
|
|
30
31
|
const proverLogger = loggers.prover ? loggers.prover : createLogger('pxe:bb:wasm:bundle' + (logSuffix ? `:${logSuffix}` : ''));
|
|
31
|
-
|
|
32
|
+
let prover;
|
|
33
|
+
if (options.proverOrOptions instanceof BBPrivateKernelProver) {
|
|
34
|
+
prover = options.proverOrOptions;
|
|
35
|
+
} else {
|
|
36
|
+
prover = new BBBundlePrivateKernelProver(simulator, {
|
|
37
|
+
...options.proverOrOptions,
|
|
38
|
+
logger: proverLogger
|
|
39
|
+
});
|
|
40
|
+
}
|
|
32
41
|
const protocolContractsProvider = new BundledProtocolContractsProvider();
|
|
33
42
|
const pxeLogger = loggers.pxe ? loggers.pxe : createLogger('pxe:service' + (logSuffix ? `:${logSuffix}` : ''));
|
|
34
43
|
const pxe = await PXE.create(aztecNode, store, prover, simulator, protocolContractsProvider, config, pxeLogger);
|
|
@@ -3,6 +3,5 @@ export * from '../../../config/index.js';
|
|
|
3
3
|
export * from '../../../storage/index.js';
|
|
4
4
|
export * from '../../../error_enriching.js';
|
|
5
5
|
export * from './utils.js';
|
|
6
|
-
export { PXEOracleInterface } from '../../../contract_function_simulator/pxe_oracle_interface.js';
|
|
7
6
|
export { type PXECreationOptions } from '../../pxe_creation_options.js';
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvbGF6eS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsWUFBWSxDQUFDO0FBQzNCLE9BQU8sRUFBRSxLQUFLLGtCQUFrQixFQUFFLE1BQU0sK0JBQStCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -12,4 +12,4 @@ import type { PXECreationOptions } from '../../pxe_creation_options.js';
|
|
|
12
12
|
* @returns A Promise that resolves to the started PXE instance.
|
|
13
13
|
*/
|
|
14
14
|
export declare function createPXE(aztecNode: AztecNode, config: PXEConfig, options?: PXECreationOptions): Promise<PXE>;
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvbGF6eS91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVqRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsR0FBRyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDdEMsT0FBTyxLQUFLLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUV4RTs7Ozs7Ozs7R0FRRztBQUNILHdCQUFzQixTQUFTLENBQzdCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLE1BQU0sRUFBRSxTQUFTLEVBQ2pCLE9BQU8sR0FBRSxrQkFBb0MsZ0JBcUM5QyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/utils.ts"],"names":[],"mappings":"AAOA,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,gBAqC9C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BBPrivateKernelProver } from '@aztec/bb-prover/client';
|
|
1
2
|
import { BBLazyPrivateKernelProver } from '@aztec/bb-prover/client/lazy';
|
|
2
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
3
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
5
|
import { createStore } from '@aztec/kv-store/indexeddb';
|
|
5
6
|
import { LazyProtocolContractsProvider } from '@aztec/protocol-contracts/providers/lazy';
|
|
@@ -25,9 +26,17 @@ import { PXE } from '../../../pxe.js';
|
|
|
25
26
|
const loggers = options.loggers ?? {};
|
|
26
27
|
const storeLogger = loggers.store ? loggers.store : createLogger('pxe:data:idb' + (logSuffix ? `:${logSuffix}` : ''));
|
|
27
28
|
const store = options.store ?? await createStore('pxe_data', configWithContracts, storeLogger);
|
|
28
|
-
const simulator = new WASMSimulator();
|
|
29
|
+
const simulator = options.simulator ?? new WASMSimulator();
|
|
29
30
|
const proverLogger = loggers.prover ? loggers.prover : createLogger('pxe:bb:wasm:bundle' + (logSuffix ? `:${logSuffix}` : ''));
|
|
30
|
-
|
|
31
|
+
let prover;
|
|
32
|
+
if (options.proverOrOptions instanceof BBPrivateKernelProver) {
|
|
33
|
+
prover = options.proverOrOptions;
|
|
34
|
+
} else {
|
|
35
|
+
prover = new BBLazyPrivateKernelProver(simulator, {
|
|
36
|
+
...options.proverOrOptions,
|
|
37
|
+
logger: proverLogger
|
|
38
|
+
});
|
|
39
|
+
}
|
|
31
40
|
const protocolContractsProvider = new LazyProtocolContractsProvider();
|
|
32
41
|
const pxeLogger = loggers.pxe ? loggers.pxe : createLogger('pxe:service' + (logSuffix ? `:${logSuffix}` : ''));
|
|
33
42
|
const pxe = await PXE.create(aztecNode, store, prover, simulator, protocolContractsProvider, config, pxeLogger);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { BBPrivateKernelProverOptions } from '@aztec/bb-prover/client';
|
|
1
2
|
import type { Logger } from '@aztec/foundation/log';
|
|
2
3
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
4
|
+
import type { CircuitSimulator } from '@aztec/simulator/client';
|
|
3
5
|
import type { PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
4
6
|
export type PXECreationOptions = {
|
|
5
7
|
loggers?: {
|
|
@@ -8,7 +10,8 @@ export type PXECreationOptions = {
|
|
|
8
10
|
prover?: Logger;
|
|
9
11
|
};
|
|
10
12
|
useLogSuffix?: boolean | string;
|
|
11
|
-
|
|
13
|
+
proverOrOptions?: PrivateKernelProver | BBPrivateKernelProverOptions;
|
|
12
14
|
store?: AztecAsyncKVStore;
|
|
15
|
+
simulator?: CircuitSimulator;
|
|
13
16
|
};
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlX2NyZWF0aW9uX29wdGlvbnMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lbnRyeXBvaW50cy9weGVfY3JlYXRpb25fb3B0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSw0QkFBNEIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzVFLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRTNFLE1BQU0sTUFBTSxrQkFBa0IsR0FBRztJQUMvQixPQUFPLENBQUMsRUFBRTtRQUFFLEtBQUssQ0FBQyxFQUFFLE1BQU0sQ0FBQztRQUFDLEdBQUcsQ0FBQyxFQUFFLE1BQU0sQ0FBQztRQUFDLE1BQU0sQ0FBQyxFQUFFLE1BQU0sQ0FBQTtLQUFFLENBQUM7SUFDNUQsWUFBWSxDQUFDLEVBQUUsT0FBTyxHQUFHLE1BQU0sQ0FBQztJQUNoQyxlQUFlLENBQUMsRUFBRSxtQkFBbUIsR0FBRyw0QkFBNEIsQ0FBQztJQUNyRSxLQUFLLENBQUMsRUFBRSxpQkFBaUIsQ0FBQztJQUMxQixTQUFTLENBQUMsRUFBRSxnQkFBZ0IsQ0FBQztDQUM5QixDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_creation_options.d.ts","sourceRoot":"","sources":["../../src/entrypoints/pxe_creation_options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAChC,
|
|
1
|
+
{"version":3,"file":"pxe_creation_options.d.ts","sourceRoot":"","sources":["../../src/entrypoints/pxe_creation_options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAChC,eAAe,CAAC,EAAE,mBAAmB,GAAG,4BAA4B,CAAC;IACrE,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B,CAAC"}
|
|
@@ -3,7 +3,8 @@ export * from '../../config/index.js';
|
|
|
3
3
|
export * from '../../error_enriching.js';
|
|
4
4
|
export * from '../../storage/index.js';
|
|
5
5
|
export * from './utils.js';
|
|
6
|
-
export {
|
|
6
|
+
export { NoteService } from '../../notes/note_service.js';
|
|
7
7
|
export { ORACLE_VERSION } from '../../oracle_version.js';
|
|
8
8
|
export { type PXECreationOptions } from '../pxe_creation_options.js';
|
|
9
|
-
|
|
9
|
+
export { JobCoordinator } from '../../job_coordinator/job_coordinator.js';
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9zZXJ2ZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxZQUFZLENBQUM7QUFDM0IsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQzFELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN6RCxPQUFPLEVBQUUsS0FBSyxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ3JFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSwwQ0FBMEMsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC"}
|
|
@@ -3,5 +3,6 @@ export * from '../../config/index.js';
|
|
|
3
3
|
export * from '../../error_enriching.js';
|
|
4
4
|
export * from '../../storage/index.js';
|
|
5
5
|
export * from './utils.js';
|
|
6
|
-
export {
|
|
6
|
+
export { NoteService } from '../../notes/note_service.js';
|
|
7
7
|
export { ORACLE_VERSION } from '../../oracle_version.js';
|
|
8
|
+
export { JobCoordinator } from '../../job_coordinator/job_coordinator.js';
|
|
@@ -5,4 +5,4 @@ import type { PXECreationOptions } from '../pxe_creation_options.js';
|
|
|
5
5
|
type PXEConfigWithoutDefaults = Omit<PXEConfig, 'l1Contracts' | 'l1ChainId' | 'l2BlockBatchSize' | 'rollupVersion'>;
|
|
6
6
|
export declare function createPXE(aztecNode: AztecNode, config: PXEConfigWithoutDefaults, options?: PXECreationOptions): Promise<PXE>;
|
|
7
7
|
export {};
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9zZXJ2ZXIvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUUEsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFakUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDdkQsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUVuQyxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBRXJFLEtBQUssd0JBQXdCLEdBQUcsSUFBSSxDQUFDLFNBQVMsRUFBRSxhQUFhLEdBQUcsV0FBVyxHQUFHLGtCQUFrQixHQUFHLGVBQWUsQ0FBQyxDQUFDO0FBRXBILHdCQUFzQixTQUFTLENBQzdCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLE1BQU0sRUFBRSx3QkFBd0IsRUFDaEMsT0FBTyxHQUFFLGtCQUFvQyxnQkFzRDlDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"AAQA,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,gBAsD9C"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { BBPrivateKernelProver } from '@aztec/bb-prover/client';
|
|
1
2
|
import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
|
|
2
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
3
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
+
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
4
6
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
5
7
|
import { MemoryCircuitRecorder, SimulatorRecorderWrapper, WASMSimulator } from '@aztec/simulator/client';
|
|
6
8
|
import { FileCircuitRecorder } from '@aztec/simulator/testing';
|
|
@@ -22,19 +24,21 @@ export async function createPXE(aztecNode, config, options = {
|
|
|
22
24
|
l2BlockBatchSize: 50
|
|
23
25
|
};
|
|
24
26
|
if (!options.store) {
|
|
25
|
-
// TODO once https://github.com/AztecProtocol/aztec-packages/issues/13656 is fixed, we can remove this and always
|
|
26
|
-
// import the lmdb-v2 version
|
|
27
|
-
const { createStore } = await import('@aztec/kv-store/lmdb-v2');
|
|
28
27
|
const storeLogger = loggers.store ? loggers.store : createLogger('pxe:data:lmdb' + (logSuffix ? `:${logSuffix}` : ''));
|
|
29
28
|
options.store = await createStore('pxe_data', PXE_DATA_SCHEMA_VERSION, configWithContracts, storeLogger);
|
|
30
29
|
}
|
|
31
30
|
const proverLogger = loggers.prover ? loggers.prover : createLogger('pxe:bb:native' + (logSuffix ? `:${logSuffix}` : ''));
|
|
32
|
-
|
|
31
|
+
let prover;
|
|
32
|
+
if (options.proverOrOptions instanceof BBPrivateKernelProver) {
|
|
33
|
+
prover = options.proverOrOptions;
|
|
34
|
+
} else {
|
|
35
|
+
prover = new BBBundlePrivateKernelProver(simulator, {
|
|
36
|
+
...options.proverOrOptions,
|
|
37
|
+
logger: proverLogger
|
|
38
|
+
});
|
|
39
|
+
}
|
|
33
40
|
const protocolContractsProvider = new BundledProtocolContractsProvider();
|
|
34
41
|
const pxeLogger = loggers.pxe ? loggers.pxe : createLogger('pxe:service' + (logSuffix ? `:${logSuffix}` : ''));
|
|
35
42
|
const pxe = await PXE.create(aztecNode, options.store, prover, simulator, protocolContractsProvider, configWithContracts, pxeLogger);
|
|
36
43
|
return pxe;
|
|
37
44
|
}
|
|
38
|
-
function createProver(simulator, logger) {
|
|
39
|
-
return new BBBundlePrivateKernelProver(simulator, logger);
|
|
40
|
-
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Logger } from '@aztec/foundation/log';
|
|
2
2
|
import { type SimulationError } from '@aztec/stdlib/errors';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ContractStore } from './storage/contract_store/contract_store.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
|
|
7
7
|
* @param err - The error to enrich.
|
|
8
8
|
*/
|
|
9
|
-
export declare function enrichSimulationError(err: SimulationError,
|
|
10
|
-
export declare function enrichPublicSimulationError(err: SimulationError,
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
export declare function enrichSimulationError(err: SimulationError, contractStore: ContractStore, logger: Logger): Promise<void>;
|
|
10
|
+
export declare function enrichPublicSimulationError(err: SimulationError, contractStore: ContractStore, logger: Logger): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JfZW5yaWNoaW5nLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZXJyb3JfZW5yaWNoaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBSXBELE9BQU8sRUFBRSxLQUFLLGVBQWUsRUFBNkIsTUFBTSxzQkFBc0IsQ0FBQztBQUV2RixPQUFPLEtBQUssRUFBRSxhQUFhLEVBQUUsTUFBTSw0Q0FBNEMsQ0FBQztBQUVoRjs7OztHQUlHO0FBQ0gsd0JBQXNCLHFCQUFxQixDQUFDLEdBQUcsRUFBRSxlQUFlLEVBQUUsYUFBYSxFQUFFLGFBQWEsRUFBRSxNQUFNLEVBQUUsTUFBTSxpQkFtRDdHO0FBRUQsd0JBQXNCLDJCQUEyQixDQUFDLEdBQUcsRUFBRSxlQUFlLEVBQUUsYUFBYSxFQUFFLGFBQWEsRUFBRSxNQUFNLEVBQUUsTUFBTSxpQkF3Q25IIn0=
|
|
@@ -1 +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,
|
|
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,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAmD7G;AAED,wBAAsB,2BAA2B,CAAC,GAAG,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAwCnH"}
|
package/dest/error_enriching.js
CHANGED
|
@@ -6,7 +6,7 @@ import { isNoirCallStackUnresolved } from '@aztec/stdlib/errors';
|
|
|
6
6
|
* Adds contract and function names to a simulation error, if they
|
|
7
7
|
* can be found in the PXE database
|
|
8
8
|
* @param err - The error to enrich.
|
|
9
|
-
*/ export async function enrichSimulationError(err,
|
|
9
|
+
*/ export async function enrichSimulationError(err, contractStore, logger) {
|
|
10
10
|
// Maps contract addresses to the set of function selectors that were in error.
|
|
11
11
|
// Map and Set do reference equality for their keys instead of value equality, so we store the string
|
|
12
12
|
// representation to get e.g. different contract address objects with the same address value to match.
|
|
@@ -24,7 +24,7 @@ import { isNoirCallStackUnresolved } from '@aztec/stdlib/errors';
|
|
|
24
24
|
...mentionedFunctions.entries()
|
|
25
25
|
].map(async ([contractAddress, fnSelectors])=>{
|
|
26
26
|
const parsedContractAddress = AztecAddress.fromString(contractAddress);
|
|
27
|
-
const contract = await
|
|
27
|
+
const contract = await contractStore.getContract(parsedContractAddress);
|
|
28
28
|
if (contract) {
|
|
29
29
|
err.enrichWithContractName(parsedContractAddress, contract.name);
|
|
30
30
|
// Map from function selector to function name. It uses a stringified key for the same reason as mentionedFunctions.
|
|
@@ -45,13 +45,13 @@ import { isNoirCallStackUnresolved } from '@aztec/stdlib/errors';
|
|
|
45
45
|
}
|
|
46
46
|
}));
|
|
47
47
|
}
|
|
48
|
-
export async function enrichPublicSimulationError(err,
|
|
48
|
+
export async function enrichPublicSimulationError(err, contractStore, logger) {
|
|
49
49
|
const callStack = err.getCallStack();
|
|
50
50
|
const originalFailingFunction = callStack[callStack.length - 1];
|
|
51
51
|
if (!originalFailingFunction) {
|
|
52
52
|
throw new Error(`Original failing function not found when enriching public simulation, missing callstack`);
|
|
53
53
|
}
|
|
54
|
-
const artifact = await
|
|
54
|
+
const artifact = await contractStore.getPublicFunctionArtifact(originalFailingFunction.contractAddress);
|
|
55
55
|
if (!artifact) {
|
|
56
56
|
throw new Error(`Artifact not found when enriching public simulation error. Contract address: ${originalFailingFunction.contractAddress}.`);
|
|
57
57
|
}
|
|
@@ -59,7 +59,7 @@ export async function enrichPublicSimulationError(err, contractDataProvider, log
|
|
|
59
59
|
if (assertionMessage) {
|
|
60
60
|
err.setOriginalMessage(err.getOriginalMessage() + `${assertionMessage}`);
|
|
61
61
|
}
|
|
62
|
-
const debugInfo = await
|
|
62
|
+
const debugInfo = await contractStore.getPublicFunctionDebugMetadata(originalFailingFunction.contractAddress);
|
|
63
63
|
const noirCallStack = err.getNoirCallStack();
|
|
64
64
|
if (debugInfo) {
|
|
65
65
|
if (isNoirCallStackUnresolved(noirCallStack)) {
|
|
@@ -72,6 +72,6 @@ export async function enrichPublicSimulationError(err, contractDataProvider, log
|
|
|
72
72
|
logger.warn(`Could not resolve noir call stack for ${originalFailingFunction.contractAddress.toString()}:${originalFailingFunction.functionName?.toString() ?? ''}: ${err}`);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
await enrichSimulationError(err,
|
|
75
|
+
await enrichSimulationError(err, contractStore, logger);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { EventSelector } from '@aztec/stdlib/abi';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
5
|
+
import type { TxHash } from '@aztec/stdlib/tx';
|
|
6
|
+
import { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
|
|
7
|
+
import { PrivateEventStore } from '../storage/private_event_store/private_event_store.js';
|
|
8
|
+
export declare class EventService {
|
|
9
|
+
private readonly anchorBlockStore;
|
|
10
|
+
private readonly aztecNode;
|
|
11
|
+
private readonly privateEventStore;
|
|
12
|
+
private readonly jobId;
|
|
13
|
+
constructor(anchorBlockStore: AnchorBlockStore, aztecNode: AztecNode, privateEventStore: PrivateEventStore, jobId: string);
|
|
14
|
+
storeEvent(contractAddress: AztecAddress, selector: EventSelector, randomness: Fr, content: Fr[], eventCommitment: Fr, txHash: TxHash, scope: AztecAddress): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRfc2VydmljZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2V2ZW50cy9ldmVudF9zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3pELE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ3ZELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBRWhFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRS9DLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBQ3ZGLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHVEQUF1RCxDQUFDO0FBRTFGLHFCQUFhLFlBQVk7SUFFckIsT0FBTyxDQUFDLFFBQVEsQ0FBQyxnQkFBZ0I7SUFDakMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxTQUFTO0lBQzFCLE9BQU8sQ0FBQyxRQUFRLENBQUMsaUJBQWlCO0lBQ2xDLE9BQU8sQ0FBQyxRQUFRLENBQUMsS0FBSztJQUp4QixZQUNtQixnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFDbEMsU0FBUyxFQUFFLFNBQVMsRUFDcEIsaUJBQWlCLEVBQUUsaUJBQWlCLEVBQ3BDLEtBQUssRUFBRSxNQUFNLEVBQzVCO0lBRVMsVUFBVSxDQUNyQixlQUFlLEVBQUUsWUFBWSxFQUM3QixRQUFRLEVBQUUsYUFBYSxFQUN2QixVQUFVLEVBQUUsRUFBRSxFQUNkLE9BQU8sRUFBRSxFQUFFLEVBQUUsRUFDYixlQUFlLEVBQUUsRUFBRSxFQUNuQixNQUFNLEVBQUUsTUFBTSxFQUNkLEtBQUssRUFBRSxZQUFZLEdBQ2xCLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0E2Q2Y7Q0FDRiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event_service.d.ts","sourceRoot":"","sources":["../../src/events/event_service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE1F,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,YACmB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,KAAK,EAAE,MAAM,EAC5B;IAES,UAAU,CACrB,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,aAAa,EACvB,UAAU,EAAE,EAAE,EACd,OAAO,EAAE,EAAE,EAAE,EACb,eAAe,EAAE,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CA6Cf;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
2
|
+
export class EventService {
|
|
3
|
+
anchorBlockStore;
|
|
4
|
+
aztecNode;
|
|
5
|
+
privateEventStore;
|
|
6
|
+
jobId;
|
|
7
|
+
constructor(anchorBlockStore, aztecNode, privateEventStore, jobId){
|
|
8
|
+
this.anchorBlockStore = anchorBlockStore;
|
|
9
|
+
this.aztecNode = aztecNode;
|
|
10
|
+
this.privateEventStore = privateEventStore;
|
|
11
|
+
this.jobId = jobId;
|
|
12
|
+
}
|
|
13
|
+
async storeEvent(contractAddress, selector, randomness, content, eventCommitment, txHash, scope) {
|
|
14
|
+
// While using 'latest' block number would be fine for private events since they cannot be accessed from Aztec.nr
|
|
15
|
+
// (and thus we're less concerned about being ahead of the synced block), we use the synced block number to
|
|
16
|
+
// maintain consistent behavior in the PXE. Additionally, events should never be ahead of the synced block here
|
|
17
|
+
// since `fetchTaggedLogs` only processes logs up to the synced block.
|
|
18
|
+
const [anchorBlockHeader, siloedEventCommitment, txEffect] = await Promise.all([
|
|
19
|
+
this.anchorBlockStore.getBlockHeader(),
|
|
20
|
+
siloNullifier(contractAddress, eventCommitment),
|
|
21
|
+
this.aztecNode.getTxEffect(txHash)
|
|
22
|
+
]);
|
|
23
|
+
const anchorBlockNumber = anchorBlockHeader.getBlockNumber();
|
|
24
|
+
if (!txEffect) {
|
|
25
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash}`);
|
|
26
|
+
}
|
|
27
|
+
if (txEffect.l2BlockNumber > anchorBlockNumber) {
|
|
28
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${anchorBlockNumber}`);
|
|
29
|
+
}
|
|
30
|
+
// Find the index of the event commitment in the nullifiers array to determine event ordering within the tx
|
|
31
|
+
const eventIndexInTx = txEffect.data.nullifiers.findIndex((n)=>n.equals(siloedEventCommitment));
|
|
32
|
+
if (eventIndexInTx === -1) {
|
|
33
|
+
throw new Error(`Event commitment ${eventCommitment} (siloed as ${siloedEventCommitment}) is not present in tx ${txHash}`);
|
|
34
|
+
}
|
|
35
|
+
return this.privateEventStore.storePrivateEventLog(selector, randomness, content, siloedEventCommitment, {
|
|
36
|
+
contractAddress,
|
|
37
|
+
scope,
|
|
38
|
+
txHash,
|
|
39
|
+
l2BlockNumber: txEffect.l2BlockNumber,
|
|
40
|
+
l2BlockHash: txEffect.l2BlockHash,
|
|
41
|
+
txIndexInBlock: txEffect.txIndexInBlock,
|
|
42
|
+
eventIndexInTx
|
|
43
|
+
}, this.jobId);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from './private_event_filter_validator.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ldmVudHMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxxQ0FBcUMsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './private_event_filter_validator.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PrivateEventFilter } from '@aztec/aztec.js/wallet';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import type { PrivateEventStoreFilter } from '../storage/private_event_store/private_event_store.js';
|
|
4
|
+
export declare class PrivateEventFilterValidator {
|
|
5
|
+
private lastBlock;
|
|
6
|
+
constructor(lastBlock: BlockNumber);
|
|
7
|
+
validate(filter: PrivateEventFilter): PrivateEventStoreFilter;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9ldmVudF9maWx0ZXJfdmFsaWRhdG9yLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZXZlbnRzL3ByaXZhdGVfZXZlbnRfZmlsdGVyX3ZhbGlkYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRWpFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUU5RCxPQUFPLEtBQUssRUFBRSx1QkFBdUIsRUFBRSxNQUFNLHVEQUF1RCxDQUFDO0FBRXJHLHFCQUFhLDJCQUEyQjtJQUMxQixPQUFPLENBQUMsU0FBUztJQUE3QixZQUFvQixTQUFTLEVBQUUsV0FBVyxFQUFJO0lBRTlDLFFBQVEsQ0FBQyxNQUFNLEVBQUUsa0JBQWtCLEdBQUcsdUJBQXVCLENBbUM1RDtDQUNGIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private_event_filter_validator.d.ts","sourceRoot":"","sources":["../../src/events/private_event_filter_validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAErG,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,SAAS;IAA7B,YAAoB,SAAS,EAAE,WAAW,EAAI;IAE9C,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,uBAAuB,CAmC5D;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
export class PrivateEventFilterValidator {
|
|
4
|
+
lastBlock;
|
|
5
|
+
constructor(lastBlock){
|
|
6
|
+
this.lastBlock = lastBlock;
|
|
7
|
+
}
|
|
8
|
+
validate(filter) {
|
|
9
|
+
let { fromBlock, toBlock } = filter;
|
|
10
|
+
// Block range filters in Aztec Node are defined as closed-open intervals [fromBlock, toBlock), so
|
|
11
|
+
// we respect that convention here for consistency.
|
|
12
|
+
// We then default to [INITIAL_L2_BLOCK_NUM, latestKnownBlock + 1), ie: by default return events from
|
|
13
|
+
// the first block to the latest known block.
|
|
14
|
+
if (!fromBlock || !toBlock) {
|
|
15
|
+
fromBlock = fromBlock ?? BlockNumber(INITIAL_L2_BLOCK_NUM);
|
|
16
|
+
toBlock = toBlock ?? BlockNumber(this.lastBlock + 1);
|
|
17
|
+
}
|
|
18
|
+
if (filter.scopes.length === 0) {
|
|
19
|
+
throw new Error('At least one scope is required to get private events');
|
|
20
|
+
}
|
|
21
|
+
if (fromBlock < 1) {
|
|
22
|
+
throw new Error('fromBlock must be greater than or equal to 1');
|
|
23
|
+
}
|
|
24
|
+
if (toBlock < 1) {
|
|
25
|
+
throw new Error('toBlock must be greater than or equal to 1');
|
|
26
|
+
}
|
|
27
|
+
if (fromBlock >= toBlock) {
|
|
28
|
+
throw new Error('toBlock must be strictly greater than fromBlock');
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
contractAddress: filter.contractAddress,
|
|
32
|
+
scopes: filter.scopes,
|
|
33
|
+
txHash: filter.txHash,
|
|
34
|
+
toBlock,
|
|
35
|
+
fromBlock
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
|
+
/**
|
|
3
|
+
* Interface that stores must implement to support staged writes.
|
|
4
|
+
*/
|
|
5
|
+
export interface StagedStore {
|
|
6
|
+
/** Unique name identifying this store (used for tracking staged stores from JobCoordinator) */
|
|
7
|
+
readonly storeName: string;
|
|
8
|
+
/**
|
|
9
|
+
* Commits staged data to main storage.
|
|
10
|
+
* Should be called within a transaction for atomicity.
|
|
11
|
+
*
|
|
12
|
+
* @param jobId - The job identifier
|
|
13
|
+
*/
|
|
14
|
+
commit(jobId: string): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Discards staged data without committing.
|
|
17
|
+
* Called on abort.
|
|
18
|
+
*
|
|
19
|
+
* @param jobId - The job identifier
|
|
20
|
+
*/
|
|
21
|
+
discardStaged(jobId: string): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* JobCoordinator manages job lifecycle and provides crash resilience for PXE operations.
|
|
25
|
+
*
|
|
26
|
+
* It uses a staged writes pattern:
|
|
27
|
+
* 1. When a job begins, a unique job ID is created
|
|
28
|
+
* 2. During the job, all writes go to staging (keyed by job ID)
|
|
29
|
+
* 3. On commit, staging is promoted to main storage
|
|
30
|
+
* 4. On abort, staged data is discarded
|
|
31
|
+
*
|
|
32
|
+
* Note: PXE should only rely on a single JobCoordinator instance, so it can eventually
|
|
33
|
+
* orchestrate concurrent jobs. Right now it doesn't make a difference because we're
|
|
34
|
+
* using a job queue with concurrency=1.
|
|
35
|
+
*/
|
|
36
|
+
export declare class JobCoordinator {
|
|
37
|
+
#private;
|
|
38
|
+
private readonly log;
|
|
39
|
+
/** The underlying KV store */
|
|
40
|
+
kvStore: AztecAsyncKVStore;
|
|
41
|
+
constructor(kvStore: AztecAsyncKVStore);
|
|
42
|
+
/**
|
|
43
|
+
* Registers a staged store.
|
|
44
|
+
* Must be called during initialization for all stores that need staging support.
|
|
45
|
+
*/
|
|
46
|
+
registerStore(store: StagedStore): void;
|
|
47
|
+
/**
|
|
48
|
+
* Registers multiple staged stores.
|
|
49
|
+
*/
|
|
50
|
+
registerStores(stores: StagedStore[]): void;
|
|
51
|
+
/**
|
|
52
|
+
* Begins a new job and returns a job ID for staged writes.
|
|
53
|
+
*
|
|
54
|
+
* @returns Job ID to pass to store operations
|
|
55
|
+
*/
|
|
56
|
+
beginJob(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Commits a job by promoting all staged data to main storage.
|
|
59
|
+
*
|
|
60
|
+
* @param jobId - The job ID returned from beginJob
|
|
61
|
+
*/
|
|
62
|
+
commitJob(jobId: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Aborts a job by discarding all staged data.
|
|
65
|
+
*
|
|
66
|
+
* @param jobId - The job ID returned from beginJob
|
|
67
|
+
*/
|
|
68
|
+
abortJob(jobId: string): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Checks if there's a job currently in progress.
|
|
71
|
+
*/
|
|
72
|
+
hasJobInProgress(): boolean;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiam9iX2Nvb3JkaW5hdG9yLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvam9iX2Nvb3JkaW5hdG9yL2pvYl9jb29yZGluYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRXpEOztHQUVHO0FBQ0gsTUFBTSxXQUFXLFdBQVc7SUFDMUIsK0ZBQStGO0lBQy9GLFFBQVEsQ0FBQyxTQUFTLEVBQUUsTUFBTSxDQUFDO0lBRTNCOzs7OztPQUtHO0lBQ0gsTUFBTSxDQUFDLEtBQUssRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0lBRXJDOzs7OztPQUtHO0lBQ0gsYUFBYSxDQUFDLEtBQUssRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0NBQzdDO0FBRUQ7Ozs7Ozs7Ozs7OztHQVlHO0FBQ0gscUJBQWEsY0FBYzs7SUFDekIsT0FBTyxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQXVDO0lBRTNELDhCQUE4QjtJQUM5QixPQUFPLEVBQUUsaUJBQWlCLENBQUM7SUFLM0IsWUFBWSxPQUFPLEVBQUUsaUJBQWlCLEVBRXJDO0lBRUQ7OztPQUdHO0lBQ0gsYUFBYSxDQUFDLEtBQUssRUFBRSxXQUFXLEdBQUcsSUFBSSxDQU10QztJQUVEOztPQUVHO0lBQ0gsY0FBYyxDQUFDLE1BQU0sRUFBRSxXQUFXLEVBQUUsR0FBRyxJQUFJLENBSTFDO0lBRUQ7Ozs7T0FJRztJQUNILFFBQVEsSUFBSSxNQUFNLENBYWpCO0lBRUQ7Ozs7T0FJRztJQUNHLFNBQVMsQ0FBQyxLQUFLLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FtQjVDO0lBRUQ7Ozs7T0FJRztJQUNHLFFBQVEsQ0FBQyxLQUFLLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FjM0M7SUFFRDs7T0FFRztJQUNILGdCQUFnQixJQUFJLE9BQU8sQ0FFMUI7Q0FDRiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job_coordinator.d.ts","sourceRoot":"","sources":["../../src/job_coordinator/job_coordinator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,+FAA+F;IAC/F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC;;;;;OAKG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAc;;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAuC;IAE3D,8BAA8B;IAC9B,OAAO,EAAE,iBAAiB,CAAC;IAK3B,YAAY,OAAO,EAAE,iBAAiB,EAErC;IAED;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAMtC;IAED;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAI1C;IAED;;;;OAIG;IACH,QAAQ,IAAI,MAAM,CAajB;IAED;;;;OAIG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB5C;IAED;;;;OAIG;IACG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAc3C;IAED;;OAEG;IACH,gBAAgB,IAAI,OAAO,CAE1B;CACF"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
2
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
+
/**
|
|
4
|
+
* JobCoordinator manages job lifecycle and provides crash resilience for PXE operations.
|
|
5
|
+
*
|
|
6
|
+
* It uses a staged writes pattern:
|
|
7
|
+
* 1. When a job begins, a unique job ID is created
|
|
8
|
+
* 2. During the job, all writes go to staging (keyed by job ID)
|
|
9
|
+
* 3. On commit, staging is promoted to main storage
|
|
10
|
+
* 4. On abort, staged data is discarded
|
|
11
|
+
*
|
|
12
|
+
* Note: PXE should only rely on a single JobCoordinator instance, so it can eventually
|
|
13
|
+
* orchestrate concurrent jobs. Right now it doesn't make a difference because we're
|
|
14
|
+
* using a job queue with concurrency=1.
|
|
15
|
+
*/ export class JobCoordinator {
|
|
16
|
+
log = createLogger('pxe:job_coordinator');
|
|
17
|
+
/** The underlying KV store */ kvStore;
|
|
18
|
+
#currentJobId;
|
|
19
|
+
#stores = new Map();
|
|
20
|
+
constructor(kvStore){
|
|
21
|
+
this.kvStore = kvStore;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Registers a staged store.
|
|
25
|
+
* Must be called during initialization for all stores that need staging support.
|
|
26
|
+
*/ registerStore(store) {
|
|
27
|
+
if (this.#stores.has(store.storeName)) {
|
|
28
|
+
throw new Error(`Store "${store.storeName}" is already registered`);
|
|
29
|
+
}
|
|
30
|
+
this.#stores.set(store.storeName, store);
|
|
31
|
+
this.log.debug(`Registered staged store: ${store.storeName}`);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Registers multiple staged stores.
|
|
35
|
+
*/ registerStores(stores) {
|
|
36
|
+
for (const store of stores){
|
|
37
|
+
this.registerStore(store);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Begins a new job and returns a job ID for staged writes.
|
|
42
|
+
*
|
|
43
|
+
* @returns Job ID to pass to store operations
|
|
44
|
+
*/ beginJob() {
|
|
45
|
+
if (this.#currentJobId) {
|
|
46
|
+
throw new Error(`Cannot begin job: job ${this.#currentJobId} is already in progress. ` + `This should not happen - ensure jobs are properly committed or aborted.`);
|
|
47
|
+
}
|
|
48
|
+
const jobId = randomBytes(8).toString('hex');
|
|
49
|
+
this.#currentJobId = jobId;
|
|
50
|
+
this.log.debug(`Started job ${jobId}`);
|
|
51
|
+
return jobId;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Commits a job by promoting all staged data to main storage.
|
|
55
|
+
*
|
|
56
|
+
* @param jobId - The job ID returned from beginJob
|
|
57
|
+
*/ async commitJob(jobId) {
|
|
58
|
+
if (!this.#currentJobId || this.#currentJobId !== jobId) {
|
|
59
|
+
throw new Error(`Cannot commit job ${jobId}: no matching job in progress. ` + `Current job: ${this.#currentJobId ?? 'none'}`);
|
|
60
|
+
}
|
|
61
|
+
this.log.debug(`Committing job ${jobId}`);
|
|
62
|
+
// Commit all stores atomically in a single transaction.
|
|
63
|
+
// Each store's commit is a no-op if it has no staged data (but that's up to each store to handle).
|
|
64
|
+
await this.kvStore.transactionAsync(async ()=>{
|
|
65
|
+
for (const store of this.#stores.values()){
|
|
66
|
+
await store.commit(jobId);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
this.#currentJobId = undefined;
|
|
70
|
+
this.log.debug(`Job ${jobId} committed successfully`);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Aborts a job by discarding all staged data.
|
|
74
|
+
*
|
|
75
|
+
* @param jobId - The job ID returned from beginJob
|
|
76
|
+
*/ async abortJob(jobId) {
|
|
77
|
+
if (!this.#currentJobId || this.#currentJobId !== jobId) {
|
|
78
|
+
// Job may have already been aborted or never started properly
|
|
79
|
+
this.log.warn(`Abort called for job ${jobId} but current job is ${this.#currentJobId ?? 'none'}`);
|
|
80
|
+
}
|
|
81
|
+
this.log.debug(`Aborting job ${jobId}`);
|
|
82
|
+
for (const store of this.#stores.values()){
|
|
83
|
+
await store.discardStaged(jobId);
|
|
84
|
+
}
|
|
85
|
+
this.#currentJobId = undefined;
|
|
86
|
+
this.log.debug(`Job ${jobId} aborted`);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Checks if there's a job currently in progress.
|
|
90
|
+
*/ hasJobInProgress() {
|
|
91
|
+
return this.#currentJobId !== undefined;
|
|
92
|
+
}
|
|
93
|
+
}
|