@aztec/pxe 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107
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/README.md +5 -5
- package/dest/bin/check_oracle_version.d.ts +1 -1
- package/dest/bin/check_oracle_version.js +110 -10
- package/dest/block_synchronizer/block_synchronizer.d.ts +39 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
- package/dest/{synchronizer/synchronizer.js → block_synchronizer/block_synchronizer.js} +23 -23
- 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 +9 -17
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +10 -16
- package/dest/config/package_info.d.ts +1 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +44 -15
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +142 -57
- package/dest/contract_function_simulator/execution_note_cache.d.ts +11 -9
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +28 -17
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +16 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +26 -0
- 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 +4 -2
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +2 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- 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 +3 -3
- 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 +8 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +6 -3
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +12 -3
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +22 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.js +33 -0
- package/dest/contract_function_simulator/oracle/index.d.ts +2 -2
- package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/index.js +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +103 -0
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/interfaces.js +4 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +2 -4
- 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 +10 -4
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +10 -5
- package/dest/contract_function_simulator/oracle/oracle.d.ts +17 -15
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +101 -81
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +11 -12
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +15 -24
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +51 -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 +103 -27
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +65 -36
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +171 -69
- 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/contract_function_simulator/proxied_node.d.ts +1 -1
- package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -1
- 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 +4 -3
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +2 -2
- package/dest/entrypoints/client/bundle/utils.d.ts +9 -9
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +21 -12
- package/dest/entrypoints/client/lazy/index.d.ts +4 -3
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +2 -2
- package/dest/entrypoints/client/lazy/utils.d.ts +8 -8
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +20 -11
- 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 +5 -3
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +3 -2
- package/dest/entrypoints/server/utils.d.ts +5 -24
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +17 -45
- package/dest/error_enriching.d.ts +11 -0
- package/dest/error_enriching.d.ts.map +1 -0
- package/dest/{pxe_service/error_enriching.js → error_enriching.js} +9 -6
- package/dest/events/event_service.d.ts +15 -0
- package/dest/events/event_service.d.ts.map +1 -0
- package/dest/events/event_service.js +47 -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 +39 -0
- package/dest/logs/log_service.d.ts +26 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +120 -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 +152 -0
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.js +2 -2
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +3 -3
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -1
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.js +7 -7
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +1 -1
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +6 -6
- package/dest/private_kernel/hints/index.d.ts +1 -1
- package/dest/private_kernel/index.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +9 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +38 -32
- package/dest/private_kernel/private_kernel_oracle.d.ts +3 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +10 -9
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +7 -7
- package/dest/public_storage/public_storage_service.d.ts +24 -0
- package/dest/public_storage/public_storage_service.d.ts.map +1 -0
- package/dest/public_storage/public_storage_service.js +26 -0
- package/dest/pxe.d.ts +232 -0
- package/dest/pxe.d.ts.map +1 -0
- package/dest/{pxe_service/pxe_service.js → pxe.js} +299 -324
- 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 -4
- 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/anchor_block_store/anchor_block_store.d.ts +9 -0
- 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 -12
- package/dest/storage/anchor_block_store/index.d.ts +2 -0
- 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 +57 -0
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/{capsule_data_provider/capsule_data_provider.js → capsule_store/capsule_store.js} +34 -10
- 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} +10 -18
- 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 -18
- 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 -9
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -8
- package/dest/storage/metadata.d.ts +1 -1
- 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_store/note_store.d.ts +84 -0
- 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} +144 -82
- package/dest/storage/private_event_store/private_event_store.d.ts +56 -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 +157 -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 +21 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/recipient_tagging_store.js +42 -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 +67 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_tagging_store.js +196 -0
- package/dest/tagging/index.d.ts +16 -0
- package/dest/tagging/index.d.ts.map +1 -0
- package/dest/tagging/index.js +23 -0
- 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 +18 -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 +55 -0
- package/dest/tree_membership/tree_membership_service.d.ts +52 -0
- package/dest/tree_membership/tree_membership_service.d.ts.map +1 -0
- package/dest/tree_membership/tree_membership_service.js +84 -0
- package/package.json +22 -24
- package/src/bin/check_oracle_version.ts +134 -10
- package/src/{synchronizer/synchronizer.ts → block_synchronizer/block_synchronizer.ts} +22 -23
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +18 -32
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +233 -75
- package/src/contract_function_simulator/execution_note_cache.ts +33 -17
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +32 -0
- package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
- package/src/contract_function_simulator/index.ts +3 -1
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -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 +10 -5
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +14 -2
- package/src/contract_function_simulator/noir-structs/utility_context.ts +42 -0
- package/src/contract_function_simulator/oracle/index.ts +1 -1
- package/src/contract_function_simulator/oracle/interfaces.ts +175 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +21 -5
- package/src/contract_function_simulator/oracle/oracle.ts +135 -80
- package/src/contract_function_simulator/oracle/private_execution.ts +22 -28
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +200 -56
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +260 -109
- 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 +3 -2
- package/src/entrypoints/client/bundle/utils.ts +21 -23
- package/src/entrypoints/client/lazy/index.ts +3 -2
- package/src/entrypoints/client/lazy/utils.ts +20 -23
- package/src/entrypoints/pxe_creation_options.ts +4 -1
- package/src/entrypoints/server/index.ts +4 -2
- package/src/entrypoints/server/utils.ts +20 -68
- package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +11 -15
- package/src/events/event_service.ts +77 -0
- package/src/events/index.ts +1 -0
- package/src/events/private_event_filter_validator.ts +48 -0
- package/src/logs/log_service.ts +202 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +200 -0
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +5 -9
- package/src/private_kernel/hints/compute_tx_include_by_timestamp.ts +6 -6
- package/src/private_kernel/private_kernel_execution_prover.ts +51 -43
- package/src/private_kernel/private_kernel_oracle.ts +2 -1
- package/src/private_kernel/private_kernel_oracle_impl.ts +10 -9
- package/src/public_storage/public_storage_service.ts +33 -0
- package/src/{pxe_service/pxe_service.ts → pxe.ts} +349 -410
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -7
- 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 -17
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/{capsule_data_provider/capsule_data_provider.ts → capsule_store/capsule_store.ts} +34 -12
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +67 -28
- 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 -8
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/{note_data_provider/note_data_provider.ts → note_store/note_store.ts} +173 -111
- package/src/storage/private_event_store/private_event_store.ts +213 -0
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +53 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +42 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +244 -0
- package/src/tagging/index.ts +28 -0
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +129 -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 +96 -0
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +44 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +72 -0
- package/src/tree_membership/tree_membership_service.ts +112 -0
- package/dest/bin/index.d.ts +0 -3
- package/dest/bin/index.d.ts.map +0 -1
- package/dest/bin/index.js +0 -48
- package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -285
- 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/oracle/typed_oracle.d.ts +0 -87
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +0 -1
- package/dest/contract_function_simulator/oracle/typed_oracle.js +0 -146
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -158
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -701
- package/dest/contract_function_simulator/tagging_utils.d.ts +0 -17
- package/dest/contract_function_simulator/tagging_utils.d.ts.map +0 -1
- package/dest/contract_function_simulator/tagging_utils.js +0 -23
- package/dest/pxe_service/error_enriching.d.ts +0 -11
- package/dest/pxe_service/error_enriching.d.ts.map +0 -1
- package/dest/pxe_service/index.d.ts +0 -3
- package/dest/pxe_service/index.d.ts.map +0 -1
- package/dest/pxe_service/index.js +0 -2
- package/dest/pxe_service/pxe_service.d.ts +0 -100
- package/dest/pxe_service/pxe_service.d.ts.map +0 -1
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -13
- 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 -27
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- 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/data_provider.d.ts +0 -4
- package/dest/storage/data_provider.d.ts.map +0 -1
- package/dest/storage/data_provider.js +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_dao.d.ts +0 -100
- package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_dao.js +0 -102
- package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -20
- 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 -96
- package/dest/storage/sync_data_provider/index.d.ts +0 -2
- 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 +0 -12
- 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 -18
- 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 -82
- 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 -35
- package/dest/synchronizer/synchronizer.d.ts.map +0 -1
- package/dest/test/pxe_test_suite.d.ts +0 -3
- package/dest/test/pxe_test_suite.d.ts.map +0 -1
- package/dest/test/pxe_test_suite.js +0 -97
- package/src/bin/index.ts +0 -62
- package/src/contract_function_simulator/execution_data_provider.ts +0 -361
- package/src/contract_function_simulator/oracle/typed_oracle.ts +0 -289
- package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1020
- package/src/contract_function_simulator/tagging_utils.ts +0 -32
- package/src/pxe_service/index.ts +0 -2
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/data_provider.ts +0 -3
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/note_data_provider/note_dao.ts +0 -154
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -134
- 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 -123
- package/src/synchronizer/index.ts +0 -1
- package/src/test/pxe_test_suite.ts +0 -113
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# PXE
|
|
1
|
+
# PXE & PXE
|
|
2
2
|
|
|
3
|
-
`PXE
|
|
3
|
+
`PXE` (pronounced "pixie service") is a server-side software that provides a set of apis for interacting with the Aztec network. It acts as a bridge between the network and client applications by exposing methods to manage accounts, deploy contracts, create transactions, and retrieve public and account-specific information. It provides a secure environment for the execution of sensitive operations, ensuring private information and decrypted data are not accessible to unauthorized applications. The PXE is a critical component of the Aztec network, and its security and reliability are essential to the overall trustworthiness of user's data.
|
|
4
4
|
|
|
5
|
-
`PXE` is the interface the PXE
|
|
5
|
+
`PXE` is the interface the PXE and every client-side instance implement. Various implementations of the client-side can exist, including those for different platforms such as mobile apps and web browsers. It is a relay between the dApps and the actual PXE.
|
|
6
6
|
|
|
7
|
-
### Main Components in an PXE
|
|
7
|
+
### Main Components in an PXE
|
|
8
8
|
|
|
9
9
|
- [Simulator](../simulator/)
|
|
10
10
|
- [Key Store](../key-store/)
|
|
11
11
|
- [Account State](./src/account_state/account_state.ts): It coordinates other components to synchronize and decrypt data, simulate transactions, and generate kernel proofs, for a specific account.
|
|
12
12
|
|
|
13
|
-

|
|
13
|
+

|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2tfb3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iaW4vY2hlY2tfb3JhY2xlX3ZlcnNpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { keccak256String } from '@aztec/foundation/crypto';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { keccak256String } from '@aztec/foundation/crypto/keccak';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
|
+
import { dirname, join } from 'path';
|
|
4
|
+
import ts from 'typescript';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
5
6
|
import { ORACLE_INTERFACE_HASH } from '../oracle_version.js';
|
|
6
|
-
// Create a minimal mock implementation of TypedOracle to instantiate the Oracle class for interface verification.
|
|
7
|
-
class OracleMock extends TypedOracle {
|
|
8
|
-
}
|
|
9
7
|
/**
|
|
10
8
|
* Verifies that the Oracle interface matches the expected interface hash.
|
|
11
9
|
*
|
|
@@ -18,12 +16,114 @@ class OracleMock extends TypedOracle {
|
|
|
18
16
|
* oracles. Ensure this checks TXE oracles as well. This hasn't been implemented yet since we don't have a clean TXE
|
|
19
17
|
* oracle interface like we do in PXE (i.e., there is no single Oracle class that contains only the oracles).
|
|
20
18
|
*/ function assertOracleInterfaceMatches() {
|
|
21
|
-
const
|
|
19
|
+
const oracleInterfaceSignature = getOracleInterfaceSignature();
|
|
22
20
|
// We use keccak256 here just because we already have it in the dependencies.
|
|
23
|
-
const oracleInterfaceHash = keccak256String(
|
|
21
|
+
const oracleInterfaceHash = keccak256String(oracleInterfaceSignature);
|
|
24
22
|
if (oracleInterfaceHash !== ORACLE_INTERFACE_HASH) {
|
|
25
23
|
// This check exists only to notify you when you need to update the ORACLE_VERSION constant.
|
|
26
|
-
throw new Error(`The
|
|
24
|
+
throw new Error(`The Oracle interface has changed, which implies a breaking change in the aztec.nr/PXE oracle interface. Update ORACLE_INTERFACE_HASH to ${oracleInterfaceHash} and bump ORACLE_VERSION in pxe/src/oracle_version.ts.`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Constructs a signature of the Oracle interface while ignoring methods that are not foreign call handlers.
|
|
29
|
+
*/ function getOracleInterfaceSignature() {
|
|
30
|
+
const excludedProps = [
|
|
31
|
+
'handler',
|
|
32
|
+
'constructor',
|
|
33
|
+
'toACIRCallback',
|
|
34
|
+
'handlerAsMisc',
|
|
35
|
+
'handlerAsUtility',
|
|
36
|
+
'handlerAsPrivate'
|
|
37
|
+
];
|
|
38
|
+
// Get the path to Oracle.ts source file
|
|
39
|
+
// The script runs from dest/bin/ after compilation, so we need to go up to the package root
|
|
40
|
+
// then into src/ to find the source file
|
|
41
|
+
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
42
|
+
// Go up from dest/bin/ or src/bin/ to the package root (pxe/), then into src/
|
|
43
|
+
const packageRoot = dirname(dirname(currentDir)); // Go up from bin/ to pxe/
|
|
44
|
+
const oracleSourcePath = join(packageRoot, 'src/contract_function_simulator/oracle/oracle.ts');
|
|
45
|
+
// Read and parse the TypeScript source file
|
|
46
|
+
const sourceCode = readFileSync(oracleSourcePath, 'utf-8');
|
|
47
|
+
const sourceFile = ts.createSourceFile('oracle.ts', sourceCode, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
48
|
+
// Extract method signatures from the Oracle class
|
|
49
|
+
const methodSignatures = [];
|
|
50
|
+
function visit(node) {
|
|
51
|
+
// Look for class declaration named "Oracle"
|
|
52
|
+
if (ts.isClassDeclaration(node) && node.name?.text === 'Oracle') {
|
|
53
|
+
// Visit all members of the class
|
|
54
|
+
node.members.forEach((member)=>{
|
|
55
|
+
if (ts.isMethodDeclaration(member) && member.name && ts.isIdentifier(member.name)) {
|
|
56
|
+
const methodName = member.name.text;
|
|
57
|
+
// Skip excluded methods
|
|
58
|
+
if (excludedProps.includes(methodName)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// Extract parameter signatures
|
|
62
|
+
const paramSignatures = [];
|
|
63
|
+
member.parameters.forEach((param)=>{
|
|
64
|
+
const paramName = extractParameterName(param, sourceFile);
|
|
65
|
+
const paramType = extractTypeString(param.type, sourceFile);
|
|
66
|
+
paramSignatures.push(`${paramName}: ${paramType}`);
|
|
67
|
+
});
|
|
68
|
+
// Extract return type
|
|
69
|
+
const returnType = extractTypeString(member.type, sourceFile);
|
|
70
|
+
// Build full signature: methodName(param1: Type1, param2: Type2): ReturnType
|
|
71
|
+
const signature = `${methodName}(${paramSignatures.join(', ')}): ${returnType}`;
|
|
72
|
+
methodSignatures.push(signature);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
ts.forEachChild(node, visit);
|
|
77
|
+
}
|
|
78
|
+
visit(sourceFile);
|
|
79
|
+
// Sort signatures alphabetically for consistent hashing
|
|
80
|
+
methodSignatures.sort();
|
|
81
|
+
// Create a hashable representation by concatenating all signatures
|
|
82
|
+
return methodSignatures.join('');
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Extracts the parameter name from a parameter node, handling destructured parameters.
|
|
86
|
+
*/ function extractParameterName(param, sourceFile) {
|
|
87
|
+
const name = param.name;
|
|
88
|
+
if (ts.isIdentifier(name)) {
|
|
89
|
+
return name.text;
|
|
90
|
+
}
|
|
91
|
+
if (ts.isArrayBindingPattern(name)) {
|
|
92
|
+
// Handle destructured parameters like [blockNumber]: ACVMField[]
|
|
93
|
+
// Extract the first element name
|
|
94
|
+
if (name.elements.length > 0) {
|
|
95
|
+
const element = name.elements[0];
|
|
96
|
+
if (ts.isBindingElement(element)) {
|
|
97
|
+
const elementName = element.name;
|
|
98
|
+
if (ts.isIdentifier(elementName)) {
|
|
99
|
+
return elementName.text;
|
|
100
|
+
}
|
|
101
|
+
// Nested destructuring - use text representation
|
|
102
|
+
if (ts.isArrayBindingPattern(elementName) || ts.isObjectBindingPattern(elementName)) {
|
|
103
|
+
return elementName.getText(sourceFile);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Fallback: return the text representation
|
|
108
|
+
return name.getText(sourceFile);
|
|
109
|
+
}
|
|
110
|
+
if (ts.isObjectBindingPattern(name)) {
|
|
111
|
+
// Handle object destructuring
|
|
112
|
+
return name.getText(sourceFile);
|
|
113
|
+
}
|
|
114
|
+
// Fallback for any other case - this should never happen but TypeScript needs it
|
|
115
|
+
return name.getText(sourceFile);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Extracts the type string from a type node, normalizing whitespace.
|
|
119
|
+
*/ function extractTypeString(typeNode, sourceFile) {
|
|
120
|
+
if (!typeNode) {
|
|
121
|
+
return 'void';
|
|
27
122
|
}
|
|
123
|
+
// Get the type text and normalize whitespace
|
|
124
|
+
let typeText = typeNode.getText(sourceFile);
|
|
125
|
+
// Normalize whitespace: remove extra spaces, newlines, and tabs
|
|
126
|
+
typeText = typeText.replace(/\s+/g, ' ').trim();
|
|
127
|
+
return typeText;
|
|
28
128
|
}
|
|
29
129
|
assertOracleInterfaceMatches();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Logger } from '@aztec/foundation/log';
|
|
2
|
+
import type { L2TipsKVStore } from '@aztec/kv-store/stores';
|
|
3
|
+
import { L2BlockStream, type L2BlockStreamEvent, type L2BlockStreamEventHandler } from '@aztec/stdlib/block';
|
|
4
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
|
+
import type { PXEConfig } from '../config/index.js';
|
|
6
|
+
import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
|
|
7
|
+
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
8
|
+
import type { PrivateEventStore } from '../storage/private_event_store/private_event_store.js';
|
|
9
|
+
/**
|
|
10
|
+
* The BlockSynchronizer class orchestrates synchronization between PXE and Aztec node, maintaining an up-to-date
|
|
11
|
+
* view of the L2 chain state. It handles block header retrieval, chain reorganizations, and provides an interface
|
|
12
|
+
* for querying sync status.
|
|
13
|
+
*/
|
|
14
|
+
export declare class BlockSynchronizer implements L2BlockStreamEventHandler {
|
|
15
|
+
private node;
|
|
16
|
+
private anchorBlockStore;
|
|
17
|
+
private noteStore;
|
|
18
|
+
private privateEventStore;
|
|
19
|
+
private l2TipsStore;
|
|
20
|
+
private log;
|
|
21
|
+
private isSyncing;
|
|
22
|
+
protected readonly blockStream: L2BlockStream;
|
|
23
|
+
constructor(node: AztecNode, anchorBlockStore: AnchorBlockStore, noteStore: NoteStore, privateEventStore: PrivateEventStore, l2TipsStore: L2TipsKVStore, config?: Partial<Pick<PXEConfig, 'l2BlockBatchSize'>>, loggerOrSuffix?: string | Logger);
|
|
24
|
+
protected createBlockStream(config: Partial<Pick<PXEConfig, 'l2BlockBatchSize'>>): L2BlockStream;
|
|
25
|
+
/** Handle events emitted by the block stream. */
|
|
26
|
+
handleBlockStreamEvent(event: L2BlockStreamEvent): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Syncs PXE and the node by downloading the metadata of the latest blocks, allowing simulations to use
|
|
29
|
+
* recent data (e.g. notes), and handling any reorgs that might have occurred.
|
|
30
|
+
*
|
|
31
|
+
* Note this BlockSynchronizer is designed to let its users control when a synchronization is run,
|
|
32
|
+
* so this component doesn't proactively stay up to date with the blockchain.
|
|
33
|
+
*
|
|
34
|
+
* We do this so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EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE/F;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,yBAAyB;IAM/D,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,WAAW;IATrB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,SAAS,CAA4B;IAC7C,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;IAE9C,YACU,IAAI,EAAE,SAAS,EACf,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,aAAa,EAClC,MAAM,GAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAM,EACzD,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAOjC;IAED,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC,iBAO/E;IAED,iDAAiD;IACpC,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B5E;IAED;;;;;;;;OAQG;IACU,IAAI,kBAehB;YAEa,MAAM;CAcrB"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
3
|
import { L2BlockStream } from '@aztec/stdlib/block';
|
|
3
4
|
/**
|
|
4
|
-
* The
|
|
5
|
+
* The BlockSynchronizer class orchestrates synchronization between PXE and Aztec node, maintaining an up-to-date
|
|
5
6
|
* view of the L2 chain state. It handles block header retrieval, chain reorganizations, and provides an interface
|
|
6
7
|
* for querying sync status.
|
|
7
|
-
*/ export class
|
|
8
|
+
*/ export class BlockSynchronizer {
|
|
8
9
|
node;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
anchorBlockStore;
|
|
11
|
+
noteStore;
|
|
12
|
+
privateEventStore;
|
|
12
13
|
l2TipsStore;
|
|
13
14
|
log;
|
|
14
15
|
isSyncing;
|
|
15
16
|
blockStream;
|
|
16
|
-
constructor(node,
|
|
17
|
+
constructor(node, anchorBlockStore, noteStore, privateEventStore, l2TipsStore, config = {}, loggerOrSuffix){
|
|
17
18
|
this.node = node;
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
19
|
+
this.anchorBlockStore = anchorBlockStore;
|
|
20
|
+
this.noteStore = noteStore;
|
|
21
|
+
this.privateEventStore = privateEventStore;
|
|
21
22
|
this.l2TipsStore = l2TipsStore;
|
|
22
|
-
this.log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:
|
|
23
|
+
this.log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:block_synchronizer:${loggerOrSuffix}` : `pxe:block_synchronizer`) : loggerOrSuffix;
|
|
23
24
|
this.blockStream = this.createBlockStream(config);
|
|
24
25
|
}
|
|
25
26
|
createBlockStream(config) {
|
|
@@ -41,25 +42,22 @@ import { L2BlockStream } from '@aztec/stdlib/block';
|
|
|
41
42
|
archive: lastBlock.archive.root.toString(),
|
|
42
43
|
header: lastBlock.header.toInspect()
|
|
43
44
|
});
|
|
44
|
-
await this.
|
|
45
|
+
await this.anchorBlockStore.setHeader(lastBlock.getBlockHeader());
|
|
45
46
|
break;
|
|
46
47
|
}
|
|
47
48
|
case 'chain-pruned':
|
|
48
49
|
{
|
|
49
50
|
this.log.warn(`Pruning data after block ${event.block.number} due to reorg`);
|
|
50
51
|
// We first unnullify and then remove so that unnullified notes that were created after the block number end up deleted.
|
|
51
|
-
const lastSynchedBlockNumber = await this.
|
|
52
|
-
await this.
|
|
53
|
-
await this.
|
|
54
|
-
// Remove all note tagging indexes to force a full resync. This is suboptimal, but unless we track the
|
|
55
|
-
// block number in which each index is used it's all we can do.
|
|
56
|
-
await this.taggingDataProvider.resetNoteSyncData();
|
|
52
|
+
const lastSynchedBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
|
|
53
|
+
await this.noteStore.rollbackNotesAndNullifiers(event.block.number, lastSynchedBlockNumber);
|
|
54
|
+
await this.privateEventStore.rollbackEventsAfterBlock(event.block.number, lastSynchedBlockNumber);
|
|
57
55
|
// Update the header to the last block.
|
|
58
56
|
const newHeader = await this.node.getBlockHeader(event.block.number);
|
|
59
57
|
if (!newHeader) {
|
|
60
58
|
this.log.error(`Block header not found for block number ${event.block.number} during chain prune`);
|
|
61
59
|
} else {
|
|
62
|
-
await this.
|
|
60
|
+
await this.anchorBlockStore.setHeader(newHeader);
|
|
63
61
|
}
|
|
64
62
|
break;
|
|
65
63
|
}
|
|
@@ -68,6 +66,11 @@ import { L2BlockStream } from '@aztec/stdlib/block';
|
|
|
68
66
|
/**
|
|
69
67
|
* Syncs PXE and the node by downloading the metadata of the latest blocks, allowing simulations to use
|
|
70
68
|
* recent data (e.g. notes), and handling any reorgs that might have occurred.
|
|
69
|
+
*
|
|
70
|
+
* Note this BlockSynchronizer is designed to let its users control when a synchronization is run,
|
|
71
|
+
* so this component doesn't proactively stay up to date with the blockchain.
|
|
72
|
+
*
|
|
73
|
+
* We do this so PXE can ensure data consistency.
|
|
71
74
|
*/ async sync() {
|
|
72
75
|
if (this.isSyncing !== undefined) {
|
|
73
76
|
this.log.debug(`Waiting for the ongoing sync to finish`);
|
|
@@ -86,17 +89,14 @@ import { L2BlockStream } from '@aztec/stdlib/block';
|
|
|
86
89
|
async doSync() {
|
|
87
90
|
let currentHeader;
|
|
88
91
|
try {
|
|
89
|
-
currentHeader = await this.
|
|
92
|
+
currentHeader = await this.anchorBlockStore.getBlockHeader();
|
|
90
93
|
} catch {
|
|
91
94
|
this.log.debug('Header is not set, requesting from the node');
|
|
92
95
|
}
|
|
93
96
|
if (!currentHeader) {
|
|
94
97
|
// REFACTOR: We should know the header of the genesis block without having to request it from the node.
|
|
95
|
-
await this.
|
|
98
|
+
await this.anchorBlockStore.setHeader(await this.node.getBlockHeader(BlockNumber.ZERO));
|
|
96
99
|
}
|
|
97
100
|
await this.blockStream.sync();
|
|
98
101
|
}
|
|
99
|
-
getSynchedBlockNumber() {
|
|
100
|
-
return this.syncDataProvider.getBlockNumber();
|
|
101
|
-
}
|
|
102
102
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from './block_synchronizer.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ibG9ja19zeW5jaHJvbml6ZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx5QkFBeUIsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/block_synchronizer/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './block_synchronizer.js';
|
package/dest/config/index.d.ts
CHANGED
|
@@ -2,14 +2,6 @@ import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
|
2
2
|
import { type DataStoreConfig } from '@aztec/kv-store/config';
|
|
3
3
|
import { type ChainConfig } from '@aztec/stdlib/config';
|
|
4
4
|
export { getPackageInfo } from './package_info.js';
|
|
5
|
-
/**
|
|
6
|
-
* Temporary configuration until WASM can be used instead of native
|
|
7
|
-
*/
|
|
8
|
-
export interface BBProverConfig {
|
|
9
|
-
bbWorkingDirectory?: string;
|
|
10
|
-
bbBinaryPath?: string;
|
|
11
|
-
bbSkipCleanup?: boolean;
|
|
12
|
-
}
|
|
13
5
|
/**
|
|
14
6
|
* Configuration settings for the prover factory
|
|
15
7
|
*/
|
|
@@ -18,26 +10,26 @@ export interface KernelProverConfig {
|
|
|
18
10
|
proverEnabled?: boolean;
|
|
19
11
|
}
|
|
20
12
|
/**
|
|
21
|
-
* Configuration settings for the
|
|
13
|
+
* Configuration settings for the block synchronizer.
|
|
22
14
|
*/
|
|
23
|
-
export interface
|
|
15
|
+
export interface BlockSynchronizerConfig {
|
|
24
16
|
/** Maximum amount of blocks to pull from the stream in one request when synchronizing */
|
|
25
17
|
l2BlockBatchSize: number;
|
|
26
18
|
}
|
|
27
|
-
export type
|
|
19
|
+
export type PXEConfig = KernelProverConfig & DataStoreConfig & ChainConfig & BlockSynchronizerConfig;
|
|
28
20
|
export type CliPXEOptions = {
|
|
29
21
|
/** Custom Aztec Node URL to connect to */
|
|
30
22
|
nodeUrl?: string;
|
|
31
23
|
};
|
|
32
|
-
export declare const pxeConfigMappings: ConfigMappingsType<
|
|
24
|
+
export declare const pxeConfigMappings: ConfigMappingsType<PXEConfig>;
|
|
33
25
|
/**
|
|
34
|
-
* Creates an instance of
|
|
26
|
+
* Creates an instance of PXEConfig out of environment variables using sensible defaults for integration testing if not set.
|
|
35
27
|
*/
|
|
36
|
-
export declare function
|
|
28
|
+
export declare function getPXEConfig(): PXEConfig;
|
|
37
29
|
export declare const pxeCliConfigMappings: ConfigMappingsType<CliPXEOptions>;
|
|
38
|
-
export declare const allPxeConfigMappings: ConfigMappingsType<CliPXEOptions &
|
|
30
|
+
export declare const allPxeConfigMappings: ConfigMappingsType<CliPXEOptions & PXEConfig>;
|
|
39
31
|
/**
|
|
40
32
|
* Creates an instance of CliPxeOptions out of environment variables
|
|
41
33
|
*/
|
|
42
|
-
export declare function getCliPXEOptions(): CliPXEOptions &
|
|
43
|
-
//# sourceMappingURL=
|
|
34
|
+
export declare function getCliPXEOptions(): CliPXEOptions & PXEConfig;
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb25maWcvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLEtBQUssa0JBQWtCLEVBS3hCLE1BQU0sMEJBQTBCLENBQUM7QUFDbEMsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUFzQixNQUFNLHdCQUF3QixDQUFDO0FBQ2xGLE9BQU8sRUFBRSxLQUFLLFdBQVcsRUFBdUIsTUFBTSxzQkFBc0IsQ0FBQztBQUU3RSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFbkQ7O0dBRUc7QUFDSCxNQUFNLFdBQVcsa0JBQWtCO0lBQ2pDLDhDQUE4QztJQUM5QyxhQUFhLENBQUMsRUFBRSxPQUFPLENBQUM7Q0FDekI7QUFFRDs7R0FFRztBQUNILE1BQU0sV0FBVyx1QkFBdUI7SUFDdEMseUZBQXlGO0lBQ3pGLGdCQUFnQixFQUFFLE1BQU0sQ0FBQztDQUMxQjtBQUVELE1BQU0sTUFBTSxTQUFTLEdBQUcsa0JBQWtCLEdBQUcsZUFBZSxHQUFHLFdBQVcsR0FBRyx1QkFBdUIsQ0FBQztBQUVyRyxNQUFNLE1BQU0sYUFBYSxHQUFHO0lBQzFCLDJDQUEyQztJQUMzQyxPQUFPLENBQUMsRUFBRSxNQUFNLENBQUM7Q0FDbEIsQ0FBQztBQUVGLGVBQU8sTUFBTSxpQkFBaUIsRUFBRSxrQkFBa0IsQ0FBQyxTQUFTLENBb0IzRCxDQUFDO0FBRUY7O0dBRUc7QUFDSCx3QkFBZ0IsWUFBWSxJQUFJLFNBQVMsQ0FFeEM7QUFFRCxlQUFPLE1BQU0sb0JBQW9CLEVBQUUsa0JBQWtCLENBQUMsYUFBYSxDQUtsRSxDQUFDO0FBRUYsZUFBTyxNQUFNLG9CQUFvQixFQUFFLGtCQUFrQixDQUFDLGFBQWEsR0FBRyxTQUFTLENBVzlFLENBQUM7QUFFRjs7R0FFRztBQUNILHdCQUFnQixnQkFBZ0IsSUFBSSxhQUFhLEdBQUcsU0FBUyxDQVE1RCJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,yFAAyF;IACzF,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,SAAS,GAAG,kBAAkB,GAAG,eAAe,GAAG,WAAW,GAAG,uBAAuB,CAAC;AAErG,MAAM,MAAM,aAAa,GAAG;IAC1B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,SAAS,CAoB3D,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAED,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,aAAa,CAKlE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,aAAa,GAAG,SAAS,CAW9E,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAQ5D"}
|
package/dest/config/index.js
CHANGED
|
@@ -10,19 +10,13 @@ export const pxeConfigMappings = {
|
|
|
10
10
|
...numberConfigHelper(50),
|
|
11
11
|
description: 'Maximum amount of blocks to pull from the stream in one request when synchronizing'
|
|
12
12
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
bbSkipCleanup: {
|
|
22
|
-
env: 'BB_SKIP_CLEANUP',
|
|
23
|
-
description: 'True to skip cleanup of temporary files for debugging purposes',
|
|
24
|
-
...booleanConfigHelper()
|
|
25
|
-
},
|
|
13
|
+
// TODO: We're losing this feature in moving to bb.js api.
|
|
14
|
+
// Reimplement it as a setting that dumps the msgpack data on the bb.js backend if needed.
|
|
15
|
+
// bbSkipCleanup: {
|
|
16
|
+
// env: 'BB_SKIP_CLEANUP',
|
|
17
|
+
// description: 'True to skip cleanup of temporary files for debugging purposes',
|
|
18
|
+
// ...booleanConfigHelper(),
|
|
19
|
+
// },
|
|
26
20
|
proverEnabled: {
|
|
27
21
|
env: 'PXE_PROVER_ENABLED',
|
|
28
22
|
description: 'Enable real proofs',
|
|
@@ -30,8 +24,8 @@ export const pxeConfigMappings = {
|
|
|
30
24
|
}
|
|
31
25
|
};
|
|
32
26
|
/**
|
|
33
|
-
* Creates an instance of
|
|
34
|
-
*/ export function
|
|
27
|
+
* Creates an instance of PXEConfig out of environment variables using sensible defaults for integration testing if not set.
|
|
28
|
+
*/ export function getPXEConfig() {
|
|
35
29
|
return getConfigFromMappings(pxeConfigMappings);
|
|
36
30
|
}
|
|
37
31
|
export const pxeCliConfigMappings = {
|
|
@@ -55,7 +49,7 @@ export const allPxeConfigMappings = {
|
|
|
55
49
|
/**
|
|
56
50
|
* Creates an instance of CliPxeOptions out of environment variables
|
|
57
51
|
*/ export function getCliPXEOptions() {
|
|
58
|
-
const pxeConfig =
|
|
52
|
+
const pxeConfig = getPXEConfig();
|
|
59
53
|
const cliOptions = getConfigFromMappings(pxeCliConfigMappings);
|
|
60
54
|
return {
|
|
61
55
|
...pxeConfig,
|
|
@@ -2,4 +2,4 @@ export declare function getPackageInfo(): {
|
|
|
2
2
|
version: string;
|
|
3
3
|
name: string;
|
|
4
4
|
};
|
|
5
|
-
//# sourceMappingURL=
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZV9pbmZvLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uZmlnL3BhY2thZ2VfaW5mby50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx3QkFBZ0IsY0FBYzs7O0VBRTdCIn0=
|
|
@@ -1,21 +1,40 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { KeyStore } from '@aztec/key-store';
|
|
2
3
|
import { type CircuitSimulator } from '@aztec/simulator/client';
|
|
3
|
-
import type {
|
|
4
|
+
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
4
5
|
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
5
6
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
6
7
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
7
9
|
import { type PrivateKernelExecutionProofOutput, PrivateKernelTailCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
8
|
-
import { PrivateExecutionResult, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
10
|
+
import { BlockHeader, PrivateExecutionResult, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
11
|
+
import type { AddressStore } from '../storage/address_store/address_store.js';
|
|
12
|
+
import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
|
|
13
|
+
import type { CapsuleStore } from '../storage/capsule_store/capsule_store.js';
|
|
14
|
+
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
15
|
+
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
16
|
+
import type { PrivateEventStore } from '../storage/private_event_store/private_event_store.js';
|
|
17
|
+
import type { RecipientTaggingStore } from '../storage/tagging_store/recipient_tagging_store.js';
|
|
18
|
+
import type { SenderAddressBookStore } from '../storage/tagging_store/sender_address_book_store.js';
|
|
19
|
+
import type { SenderTaggingStore } from '../storage/tagging_store/sender_tagging_store.js';
|
|
11
20
|
/**
|
|
12
21
|
* The contract function simulator.
|
|
13
22
|
*/
|
|
14
23
|
export declare class ContractFunctionSimulator {
|
|
15
|
-
private
|
|
24
|
+
private contractStore;
|
|
25
|
+
private noteStore;
|
|
26
|
+
private keyStore;
|
|
27
|
+
private addressStore;
|
|
28
|
+
private aztecNode;
|
|
29
|
+
private anchorBlockStore;
|
|
30
|
+
private senderTaggingStore;
|
|
31
|
+
private recipientTaggingStore;
|
|
32
|
+
private senderAddressBookStore;
|
|
33
|
+
private capsuleStore;
|
|
34
|
+
private privateEventStore;
|
|
16
35
|
private simulator;
|
|
17
36
|
private log;
|
|
18
|
-
constructor(
|
|
37
|
+
constructor(contractStore: ContractStore, noteStore: NoteStore, keyStore: KeyStore, addressStore: AddressStore, aztecNode: AztecNode, anchorBlockStore: AnchorBlockStore, senderTaggingStore: SenderTaggingStore, recipientTaggingStore: RecipientTaggingStore, senderAddressBookStore: SenderAddressBookStore, capsuleStore: CapsuleStore, privateEventStore: PrivateEventStore, simulator: CircuitSimulator);
|
|
19
38
|
/**
|
|
20
39
|
* Runs a private function.
|
|
21
40
|
* @param request - The transaction request.
|
|
@@ -23,25 +42,35 @@ export declare class ContractFunctionSimulator {
|
|
|
23
42
|
* @param contractAddress - The address of the contract (should match request.origin)
|
|
24
43
|
* @param msgSender - The address calling the function. This can be replaced to simulate a call from another contract
|
|
25
44
|
* or a specific account.
|
|
45
|
+
* @param anchorBlockHeader - The block header to use as base state for this run.
|
|
26
46
|
* @param senderForTags - The address that is used as a tagging sender when emitting private logs. Returned from
|
|
27
47
|
* the `privateGetSenderForTags` oracle.
|
|
28
48
|
* @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
29
49
|
* @returns The result of the execution.
|
|
30
50
|
*/
|
|
31
|
-
run(request: TxExecutionRequest, contractAddress: AztecAddress, selector: FunctionSelector, msgSender
|
|
51
|
+
run(request: TxExecutionRequest, contractAddress: AztecAddress, selector: FunctionSelector, msgSender: AztecAddress | undefined, anchorBlockHeader: BlockHeader, senderForTags?: AztecAddress, scopes?: AztecAddress[]): Promise<PrivateExecutionResult>;
|
|
32
52
|
/**
|
|
33
53
|
* Runs a utility function.
|
|
34
54
|
* @param call - The function call to execute.
|
|
35
55
|
* @param authwits - Authentication witnesses required for the function call.
|
|
56
|
+
* @param anchorBlockHeader - The block header to use as base state for this run.
|
|
36
57
|
* @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
|
|
37
58
|
* accounts if not specified.
|
|
38
|
-
* @returns A
|
|
59
|
+
* @returns A return value of the utility function in a form as returned by the simulator (Noir fields)
|
|
39
60
|
*/
|
|
40
|
-
runUtility(call: FunctionCall, authwits: AuthWitness[], scopes?: AztecAddress[]): Promise<
|
|
41
|
-
|
|
61
|
+
runUtility(call: FunctionCall, authwits: AuthWitness[], anchorBlockHeader: BlockHeader, scopes?: AztecAddress[]): Promise<Fr[]>;
|
|
62
|
+
/**
|
|
63
|
+
* Returns the execution statistics collected during the simulator run.
|
|
64
|
+
* @returns The execution statistics.
|
|
65
|
+
*/
|
|
66
|
+
getStats(): {
|
|
67
|
+
nodeRPCCalls: Partial<Record<keyof AztecNode, {
|
|
68
|
+
times: number[];
|
|
69
|
+
}>>;
|
|
70
|
+
};
|
|
42
71
|
}
|
|
43
72
|
/**
|
|
44
|
-
* Generates the final public inputs of the tail kernel circuit, an empty
|
|
73
|
+
* Generates the final public inputs of the tail kernel circuit, an empty Chonk proof
|
|
45
74
|
* and the execution steps for a `PrivateExecutionResult` as if it had been
|
|
46
75
|
* processed by the private kernel prover. This skips many of the checks performed by the kernels
|
|
47
76
|
* (allowing state overrides) and is much faster, while still generating a valid
|
|
@@ -49,8 +78,8 @@ export declare class ContractFunctionSimulator {
|
|
|
49
78
|
* @param privateExecutionResult - The result of the private execution.
|
|
50
79
|
* @param nonceGenerator - A nonce generator for note hashes. According to the protocol rules,
|
|
51
80
|
* it can either be the first nullifier in the tx or the hash of the initial tx request if there are none.
|
|
52
|
-
* @param
|
|
81
|
+
* @param contractStore - A provider for contract data in order to get function names and debug info.
|
|
53
82
|
* @returns The simulated proving result.
|
|
54
83
|
*/
|
|
55
|
-
export declare function generateSimulatedProvingResult(privateExecutionResult: PrivateExecutionResult, nonceGenerator: Fr,
|
|
56
|
-
//# sourceMappingURL=
|
|
84
|
+
export declare function generateSimulatedProvingResult(privateExecutionResult: PrivateExecutionResult, nonceGenerator: Fr, contractStore: ContractStore): Promise<PrivateKernelExecutionProofOutput<PrivateKernelTailCircuitPublicInputs>>;
|
|
85
|
+
//# sourceMapping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
{"version":3,"file":"contract_function_simulator.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/contract_function_simulator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contract_function_simulator.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/contract_function_simulator.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAS3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAIL,KAAK,iCAAiC,EACtC,oCAAoC,EAKrC,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,WAAW,EAGX,sBAAsB,EAEtB,kBAAkB,EAGnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC/F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,KAAK,EAAE,sB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