@aztec/pxe 0.0.0-test.1 → 0.0.1-commit.03f7ef2
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 +2 -0
- package/dest/bin/check_oracle_version.d.ts.map +1 -0
- package/dest/bin/check_oracle_version.js +129 -0
- 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} +36 -32
- 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 +11 -24
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +18 -33
- 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 +83 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -0
- package/dest/contract_function_simulator/contract_function_simulator.js +325 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts +95 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_note_cache.js +191 -0
- 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 +28 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/hashed_values_cache.js +36 -0
- package/dest/contract_function_simulator/index.d.ts +14 -0
- package/dest/contract_function_simulator/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/index.js +12 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +20 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +37 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +26 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +17 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +65 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +24 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +51 -0
- 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 +14 -0
- package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/index.js +2 -0
- 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 +17 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +24 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +28 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +54 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +58 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle.js +345 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +47 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution.js +123 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +240 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +439 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +195 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +372 -0
- package/dest/contract_function_simulator/pick_notes.d.ts +85 -0
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -0
- package/dest/contract_function_simulator/pick_notes.js +51 -0
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +6 -0
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -0
- package/dest/contract_function_simulator/proxied_contract_data_source.js +80 -0
- package/dest/contract_function_simulator/proxied_node.d.ts +9 -0
- package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/proxied_node.js +27 -0
- 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 +10 -10
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +18 -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 +9 -9
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +17 -11
- package/dest/entrypoints/pxe_creation_options.d.ts +16 -0
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -0
- package/dest/entrypoints/server/index.d.ts +6 -4
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +4 -3
- package/dest/entrypoints/server/utils.d.ts +8 -16
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +31 -36
- 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} +26 -18
- 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 +43 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +239 -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 -0
- package/dest/oracle_version.d.ts.map +1 -0
- package/dest/oracle_version.js +10 -0
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +28 -0
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -0
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.js +271 -0
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +41 -0
- package/dest/private_kernel/hints/index.d.ts +3 -0
- package/dest/private_kernel/hints/index.d.ts.map +1 -0
- package/dest/{kernel_prover → private_kernel}/hints/index.js +1 -0
- package/dest/private_kernel/index.d.ts +3 -0
- package/dest/private_kernel/index.d.ts.map +1 -0
- package/dest/private_kernel/index.js +2 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +44 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -0
- package/dest/private_kernel/private_kernel_execution_prover.js +286 -0
- package/dest/private_kernel/private_kernel_oracle.d.ts +63 -0
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -0
- package/dest/private_kernel/private_kernel_oracle.js +4 -0
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +46 -0
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -0
- package/dest/{kernel_oracle/index.js → private_kernel/private_kernel_oracle_impl.js} +19 -9
- 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 +231 -0
- package/dest/pxe.d.ts.map +1 -0
- package/dest/pxe.js +756 -0
- package/dest/storage/address_data_provider/address_data_provider.d.ts +2 -4
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +1 -1
- package/dest/storage/address_data_provider/address_data_provider.js +0 -3
- package/dest/storage/address_data_provider/index.d.ts +1 -1
- package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts +9 -0
- package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts.map +1 -0
- package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_data_provider/anchor_block_data_provider.js} +2 -12
- package/dest/storage/anchor_block_data_provider/index.d.ts +2 -0
- package/dest/storage/anchor_block_data_provider/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_data_provider/index.js +1 -0
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +48 -7
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +1 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +117 -28
- package/dest/storage/capsule_data_provider/index.d.ts +1 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts +16 -59
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +1 -1
- package/dest/storage/contract_data_provider/contract_data_provider.js +121 -80
- package/dest/storage/contract_data_provider/index.d.ts +1 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +1 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts +3 -42
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +1 -1
- package/dest/storage/contract_data_provider/private_functions_tree.js +10 -62
- package/dest/storage/index.d.ts +4 -5
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +3 -4
- package/dest/storage/metadata.d.ts +2 -0
- package/dest/storage/metadata.d.ts.map +1 -0
- package/dest/storage/metadata.js +1 -0
- package/dest/storage/note_data_provider/index.d.ts +2 -2
- package/dest/storage/note_data_provider/index.d.ts.map +1 -1
- package/dest/storage/note_data_provider/index.js +1 -1
- package/dest/storage/note_data_provider/note_data_provider.d.ts +75 -11
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +1 -1
- package/dest/storage/note_data_provider/note_data_provider.js +155 -82
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +51 -0
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +1 -0
- package/dest/storage/private_event_data_provider/private_event_data_provider.js +115 -0
- package/dest/storage/tagging_data_provider/index.d.ts +3 -2
- package/dest/storage/tagging_data_provider/index.d.ts.map +1 -1
- package/dest/storage/tagging_data_provider/index.js +2 -1
- package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts +31 -0
- package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts.map +1 -0
- package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.js +65 -0
- package/dest/storage/tagging_data_provider/sender_tagging_data_provider.d.ts +67 -0
- package/dest/storage/tagging_data_provider/sender_tagging_data_provider.d.ts.map +1 -0
- package/dest/storage/tagging_data_provider/sender_tagging_data_provider.js +196 -0
- package/dest/tagging/constants.d.ts +2 -0
- package/dest/tagging/constants.d.ts.map +1 -0
- package/dest/tagging/constants.js +3 -0
- package/dest/tagging/index.d.ts +5 -0
- package/dest/tagging/index.d.ts.map +1 -0
- package/dest/tagging/index.js +3 -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/new_recipient_tagging_data_provider.d.ts +21 -0
- package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.js +42 -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/sync/sync_sender_tagging_indexes.d.ts +21 -0
- package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sync/sync_sender_tagging_indexes.js +89 -0
- package/dest/tagging/sync/utils/get_status_change_of_pending.d.ts +11 -0
- package/dest/tagging/sync/utils/get_status_change_of_pending.d.ts.map +1 -0
- package/dest/tagging/sync/utils/get_status_change_of_pending.js +32 -0
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts +18 -0
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.js +55 -0
- package/dest/tagging/utils.d.ts +18 -0
- package/dest/tagging/utils.d.ts.map +1 -0
- package/dest/tagging/utils.js +25 -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 +37 -34
- package/src/bin/check_oracle_version.ts +160 -0
- package/src/{synchronizer/synchronizer.ts → block_synchronizer/block_synchronizer.ts} +39 -35
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +27 -55
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +618 -0
- package/src/contract_function_simulator/execution_note_cache.ts +233 -0
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +32 -0
- package/src/contract_function_simulator/hashed_values_cache.ts +47 -0
- package/src/contract_function_simulator/index.ts +13 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +47 -0
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +28 -0
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +69 -0
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +64 -0
- package/src/contract_function_simulator/noir-structs/utility_context.ts +42 -0
- package/src/contract_function_simulator/oracle/index.ts +16 -0
- package/src/contract_function_simulator/oracle/interfaces.ts +175 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +23 -0
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +68 -0
- package/src/contract_function_simulator/oracle/oracle.ts +605 -0
- package/src/contract_function_simulator/oracle/private_execution.ts +209 -0
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +704 -0
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +532 -0
- package/src/contract_function_simulator/pick_notes.ts +141 -0
- package/src/contract_function_simulator/proxied_contract_data_source.ts +83 -0
- package/src/contract_function_simulator/proxied_node.ts +33 -0
- 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 +36 -36
- package/src/entrypoints/client/lazy/index.ts +3 -2
- package/src/entrypoints/client/lazy/utils.ts +36 -31
- package/src/entrypoints/pxe_creation_options.ts +12 -0
- package/src/entrypoints/server/index.ts +5 -3
- package/src/entrypoints/server/utils.ts +59 -51
- package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +36 -27
- 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 +364 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +200 -0
- package/src/oracle_version.ts +11 -0
- package/src/{kernel_prover → private_kernel}/hints/build_private_kernel_reset_private_inputs.ts +159 -147
- package/src/private_kernel/hints/compute_tx_include_by_timestamp.ts +58 -0
- package/src/{kernel_prover → private_kernel}/hints/index.ts +1 -0
- package/src/private_kernel/index.ts +2 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +432 -0
- package/src/{kernel_prover/proving_data_oracle.ts → private_kernel/private_kernel_oracle.ts} +19 -30
- package/src/{kernel_oracle/index.ts → private_kernel/private_kernel_oracle_impl.ts} +33 -17
- package/src/public_storage/public_storage_service.ts +33 -0
- package/src/pxe.ts +1063 -0
- package/src/storage/address_data_provider/address_data_provider.ts +1 -7
- package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_data_provider/anchor_block_data_provider.ts} +2 -17
- package/src/storage/anchor_block_data_provider/index.ts +1 -0
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +130 -31
- package/src/storage/contract_data_provider/contract_data_provider.ts +152 -94
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/private_functions_tree.ts +12 -76
- package/src/storage/index.ts +3 -5
- package/src/storage/metadata.ts +1 -0
- package/src/storage/note_data_provider/index.ts +1 -1
- package/src/storage/note_data_provider/note_data_provider.ts +188 -121
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +162 -0
- package/src/storage/tagging_data_provider/index.ts +2 -1
- package/src/storage/tagging_data_provider/recipient_tagging_data_provider.ts +86 -0
- package/src/storage/tagging_data_provider/sender_tagging_data_provider.ts +244 -0
- package/src/tagging/constants.ts +3 -0
- package/src/tagging/index.ts +4 -0
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +129 -0
- package/src/tagging/recipient_sync/new_recipient_tagging_data_provider.ts +53 -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/sync/sync_sender_tagging_indexes.ts +112 -0
- package/src/tagging/sync/utils/get_status_change_of_pending.ts +44 -0
- package/src/tagging/sync/utils/load_and_store_new_tagging_indexes.ts +72 -0
- package/src/tagging/utils.ts +32 -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 -28
- package/dest/entrypoints/client/pxe_creation_options.d.ts +0 -11
- package/dest/entrypoints/client/pxe_creation_options.d.ts.map +0 -1
- package/dest/kernel_oracle/index.d.ts +0 -45
- package/dest/kernel_oracle/index.d.ts.map +0 -1
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.js +0 -270
- package/dest/kernel_prover/hints/index.d.ts +0 -2
- package/dest/kernel_prover/hints/index.d.ts.map +0 -1
- package/dest/kernel_prover/index.d.ts +0 -3
- package/dest/kernel_prover/index.d.ts.map +0 -1
- package/dest/kernel_prover/index.js +0 -2
- package/dest/kernel_prover/kernel_prover.d.ts +0 -38
- package/dest/kernel_prover/kernel_prover.d.ts.map +0 -1
- package/dest/kernel_prover/kernel_prover.js +0 -217
- package/dest/kernel_prover/proving_data_oracle.d.ts +0 -73
- package/dest/kernel_prover/proving_data_oracle.d.ts.map +0 -1
- package/dest/kernel_prover/proving_data_oracle.js +0 -4
- package/dest/note_decryption_utils/add_public_values_to_payload.d.ts +0 -11
- package/dest/note_decryption_utils/add_public_values_to_payload.d.ts.map +0 -1
- package/dest/note_decryption_utils/add_public_values_to_payload.js +0 -47
- package/dest/pxe_http/index.d.ts +0 -2
- package/dest/pxe_http/index.d.ts.map +0 -1
- package/dest/pxe_http/index.js +0 -1
- package/dest/pxe_http/pxe_http_server.d.ts +0 -16
- package/dest/pxe_http/pxe_http_server.d.ts.map +0 -1
- package/dest/pxe_http/pxe_http_server.js +0 -27
- package/dest/pxe_oracle_interface/index.d.ts +0 -159
- package/dest/pxe_oracle_interface/index.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/index.js +0 -692
- package/dest/pxe_oracle_interface/tagging_utils.d.ts +0 -17
- package/dest/pxe_oracle_interface/tagging_utils.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/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 -111
- package/dest/pxe_service/pxe_service.d.ts.map +0 -1
- package/dest/pxe_service/pxe_service.js +0 -664
- package/dest/storage/auth_witness_data_provider/auth_witness_data_provider.d.ts +0 -11
- package/dest/storage/auth_witness_data_provider/auth_witness_data_provider.d.ts.map +0 -1
- package/dest/storage/auth_witness_data_provider/auth_witness_data_provider.js +0 -20
- package/dest/storage/auth_witness_data_provider/index.d.ts +0 -2
- package/dest/storage/auth_witness_data_provider/index.d.ts.map +0 -1
- package/dest/storage/auth_witness_data_provider/index.js +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/note_dao.d.ts +0 -106
- package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_dao.js +0 -106
- 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/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 -65
- 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 -37
- 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 -38
- package/src/entrypoints/client/pxe_creation_options.ts +0 -7
- package/src/kernel_prover/index.ts +0 -2
- package/src/kernel_prover/kernel_prover.ts +0 -351
- package/src/note_decryption_utils/add_public_values_to_payload.ts +0 -64
- package/src/pxe_http/index.ts +0 -1
- package/src/pxe_http/pxe_http_server.ts +0 -29
- package/src/pxe_oracle_interface/index.ts +0 -925
- package/src/pxe_oracle_interface/tagging_utils.ts +0 -32
- package/src/pxe_service/index.ts +0 -2
- package/src/pxe_service/pxe_service.ts +0 -949
- package/src/storage/auth_witness_data_provider/auth_witness_data_provider.ts +0 -34
- package/src/storage/auth_witness_data_provider/index.ts +0 -1
- package/src/storage/data_provider.ts +0 -3
- package/src/storage/note_data_provider/note_dao.ts +0 -162
- package/src/storage/sync_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -92
- package/src/synchronizer/index.ts +0 -1
- package/src/test/pxe_test_suite.ts +0 -111
- /package/dest/entrypoints/{client/pxe_creation_options.js → pxe_creation_options.js} +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { toArray } from '@aztec/foundation/iterable';
|
|
2
|
-
import {
|
|
3
|
-
import { FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
|
|
2
|
+
import { FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
|
|
4
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import { SerializableContractInstance } from '@aztec/stdlib/contract';
|
|
4
|
+
import { SerializableContractInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
6
5
|
import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
7
6
|
/**
|
|
8
7
|
* ContractDataProvider serves as a data manager and retriever for Aztec.nr contracts.
|
|
@@ -11,7 +10,9 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
|
11
10
|
* to efficiently serve the requested data. It interacts with the ContractDatabase and AztecNode to fetch
|
|
12
11
|
* the required information and facilitate cryptographic proof generation.
|
|
13
12
|
*/ export class ContractDataProvider {
|
|
14
|
-
/** Map from contract class id to private function tree. */
|
|
13
|
+
/** Map from contract class id to private function tree. */ // TODO: Update it to be LRU cache so that it doesn't keep all the data all the time.
|
|
14
|
+
#privateFunctionTrees = new Map();
|
|
15
|
+
/** Map from contract address to contract class id */ #contractClassIdMap = new Map();
|
|
15
16
|
#contractArtifacts;
|
|
16
17
|
#contractInstances;
|
|
17
18
|
constructor(store){
|
|
@@ -28,17 +29,19 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
|
28
29
|
await this.#contractArtifacts.set(id.toString(), contractArtifactToBuffer(contract));
|
|
29
30
|
}
|
|
30
31
|
async addContractInstance(contract) {
|
|
32
|
+
this.#contractClassIdMap.set(contract.address.toString(), contract.currentContractClassId);
|
|
31
33
|
await this.#contractInstances.set(contract.address.toString(), new SerializableContractInstance(contract).toBuffer());
|
|
32
34
|
}
|
|
33
35
|
// Private getters
|
|
34
|
-
async #
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
async #getContractClassId(contractAddress) {
|
|
37
|
+
if (!this.#contractClassIdMap.has(contractAddress.toString())) {
|
|
38
|
+
const instance = await this.getContractInstance(contractAddress);
|
|
39
|
+
if (!instance) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.#contractClassIdMap.set(contractAddress.toString(), instance.currentContractClassId);
|
|
43
|
+
}
|
|
44
|
+
return this.#contractClassIdMap.get(contractAddress.toString());
|
|
42
45
|
}
|
|
43
46
|
/**
|
|
44
47
|
* Retrieve or create a ContractTree instance based on the provided class id.
|
|
@@ -49,29 +52,20 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
|
49
52
|
* @param classId - The class id of the contract for which the ContractTree is required.
|
|
50
53
|
* @returns A ContractTree instance associated with the specified contract address.
|
|
51
54
|
* @throws An Error if the contract is not found in the ContractDatabase.
|
|
52
|
-
*/ async
|
|
53
|
-
if (!this.
|
|
54
|
-
const artifact = await this
|
|
55
|
+
*/ async #getPrivateFunctionTreeForClassId(classId) {
|
|
56
|
+
if (!this.#privateFunctionTrees.has(classId.toString())) {
|
|
57
|
+
const artifact = await this.getContractArtifact(classId);
|
|
55
58
|
if (!artifact) {
|
|
56
|
-
|
|
59
|
+
return;
|
|
57
60
|
}
|
|
58
61
|
const tree = await PrivateFunctionsTree.create(artifact);
|
|
59
|
-
this.
|
|
62
|
+
this.#privateFunctionTrees.set(classId.toString(), tree);
|
|
60
63
|
}
|
|
61
|
-
return this.
|
|
64
|
+
return this.#privateFunctionTrees.get(classId.toString());
|
|
62
65
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
* Otherwise, a new ContractTree instance will be created using the contract data from the database
|
|
67
|
-
* and added to the cache before returning.
|
|
68
|
-
*
|
|
69
|
-
* @param contractAddress - The AztecAddress of the contract for which the ContractTree is required.
|
|
70
|
-
* @returns A ContractTree instance associated with the specified contract address.
|
|
71
|
-
* @throws An Error if the contract is not found in the ContractDatabase.
|
|
72
|
-
*/ async getTreeForAddress(contractAddress) {
|
|
73
|
-
const instance = await this.getContractInstance(contractAddress);
|
|
74
|
-
return this.getTreeForClassId(instance.currentContractClassId);
|
|
66
|
+
async #getContractArtifactByAddress(contractAddress) {
|
|
67
|
+
const contractClassId = await this.#getContractClassId(contractAddress);
|
|
68
|
+
return contractClassId && this.getContractArtifact(contractClassId);
|
|
75
69
|
}
|
|
76
70
|
// Public getters
|
|
77
71
|
async getContractsAddresses() {
|
|
@@ -79,25 +73,26 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
|
79
73
|
return keys.map(AztecAddress.fromString);
|
|
80
74
|
}
|
|
81
75
|
/** Returns a contract instance for a given address. Throws if not found. */ async getContractInstance(contractAddress) {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
throw new ContractNotFoundError(contractAddress.toString());
|
|
85
|
-
}
|
|
86
|
-
return instance;
|
|
76
|
+
const contract = await this.#contractInstances.getAsync(contractAddress.toString());
|
|
77
|
+
return contract && SerializableContractInstance.fromBuffer(contract).withAddress(contractAddress);
|
|
87
78
|
}
|
|
88
79
|
async getContractArtifact(contractClassId) {
|
|
89
|
-
const
|
|
90
|
-
|
|
80
|
+
const contract = await this.#contractArtifacts.getAsync(contractClassId.toString());
|
|
81
|
+
// TODO(@spalladino): AztecAsyncMap lies and returns Uint8Arrays instead of Buffers, hence the extra Buffer.from.
|
|
82
|
+
return contract && contractArtifactFromBuffer(Buffer.from(contract));
|
|
91
83
|
}
|
|
92
84
|
/** Returns a contract class for a given class id. Throws if not found. */ async getContractClass(contractClassId) {
|
|
93
|
-
const
|
|
94
|
-
return
|
|
85
|
+
const artifact = await this.getContractArtifact(contractClassId);
|
|
86
|
+
return artifact && getContractClassFromArtifact(artifact);
|
|
95
87
|
}
|
|
96
88
|
async getContract(address) {
|
|
97
89
|
const instance = await this.getContractInstance(address);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
if (!instance) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const artifact = await this.getContractArtifact(instance.currentContractClassId);
|
|
94
|
+
if (!artifact) {
|
|
95
|
+
return;
|
|
101
96
|
}
|
|
102
97
|
return {
|
|
103
98
|
...instance,
|
|
@@ -113,20 +108,35 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
|
113
108
|
* @param selector - The function selector.
|
|
114
109
|
* @returns The corresponding function's artifact as an object.
|
|
115
110
|
*/ async getFunctionArtifact(contractAddress, selector) {
|
|
116
|
-
const
|
|
117
|
-
|
|
111
|
+
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
112
|
+
const fnArtifact = artifact && await this.#findFunctionArtifactBySelector(artifact, selector);
|
|
113
|
+
return fnArtifact && {
|
|
114
|
+
...fnArtifact,
|
|
115
|
+
contractName: artifact.name
|
|
116
|
+
};
|
|
118
117
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
118
|
+
async getFunctionArtifactWithDebugMetadata(contractAddress, selector) {
|
|
119
|
+
const artifact = await this.getFunctionArtifact(contractAddress, selector);
|
|
120
|
+
if (!artifact) {
|
|
121
|
+
throw new Error(`Function artifact not found for contract ${contractAddress} and selector ${selector}.`);
|
|
122
|
+
}
|
|
123
|
+
const debug = await this.getFunctionDebugMetadata(contractAddress, selector);
|
|
124
|
+
return {
|
|
125
|
+
...artifact,
|
|
126
|
+
debug
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
async getPublicFunctionArtifact(contractAddress) {
|
|
130
|
+
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
131
|
+
const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
|
|
132
|
+
return fnArtifact && {
|
|
133
|
+
...fnArtifact,
|
|
134
|
+
contractName: artifact.name
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
async getFunctionAbi(contractAddress, selector) {
|
|
138
|
+
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
139
|
+
return artifact && await this.#findFunctionAbiBySelector(artifact, selector);
|
|
130
140
|
}
|
|
131
141
|
/**
|
|
132
142
|
* Retrieves the debug metadata of a specified function within a given contract.
|
|
@@ -138,22 +148,14 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
|
138
148
|
* @param selector - The function selector.
|
|
139
149
|
* @returns The corresponding function's artifact as an object.
|
|
140
150
|
*/ async getFunctionDebugMetadata(contractAddress, selector) {
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
return getFunctionDebugMetadata(
|
|
151
|
+
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
152
|
+
const fnArtifact = artifact && await this.#findFunctionArtifactBySelector(artifact, selector);
|
|
153
|
+
return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
|
|
144
154
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*
|
|
150
|
-
* @param contractAddress - The contract's address.
|
|
151
|
-
* @param selector - The function selector.
|
|
152
|
-
* @returns A Promise that resolves to a Buffer containing the bytecode of the specified function.
|
|
153
|
-
* @throws Error if the contract address is unknown or not found.
|
|
154
|
-
*/ async getBytecode(contractAddress, selector) {
|
|
155
|
-
const tree = await this.getTreeForAddress(contractAddress);
|
|
156
|
-
return tree.getBytecode(selector);
|
|
155
|
+
async getPublicFunctionDebugMetadata(contractAddress) {
|
|
156
|
+
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
157
|
+
const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
|
|
158
|
+
return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
|
|
157
159
|
}
|
|
158
160
|
/**
|
|
159
161
|
* Retrieve the function membership witness for the given contract class and function selector.
|
|
@@ -164,20 +166,59 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
|
164
166
|
* @param selector - The function selector.
|
|
165
167
|
* @returns A promise that resolves with the MembershipWitness instance for the specified contract's function.
|
|
166
168
|
*/ async getFunctionMembershipWitness(contractClassId, selector) {
|
|
167
|
-
const tree = await this
|
|
168
|
-
return tree
|
|
169
|
+
const tree = await this.#getPrivateFunctionTreeForClassId(contractClassId);
|
|
170
|
+
return tree?.getFunctionMembershipWitness(selector);
|
|
169
171
|
}
|
|
170
172
|
async getDebugContractName(contractAddress) {
|
|
171
|
-
const
|
|
172
|
-
return
|
|
173
|
+
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
174
|
+
return artifact?.name;
|
|
173
175
|
}
|
|
174
176
|
async getDebugFunctionName(contractAddress, selector) {
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
178
|
+
const fnArtifact = artifact && await this.#findFunctionAbiBySelector(artifact, selector);
|
|
179
|
+
return `${artifact?.name ?? contractAddress}:${fnArtifact?.name ?? selector}`;
|
|
180
|
+
}
|
|
181
|
+
async #findFunctionArtifactBySelector(artifact, selector) {
|
|
182
|
+
const functions = artifact.functions;
|
|
183
|
+
for(let i = 0; i < functions.length; i++){
|
|
184
|
+
const fn = functions[i];
|
|
185
|
+
const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
|
|
186
|
+
if (fnSelector.equals(selector)) {
|
|
187
|
+
return fn;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async #findFunctionAbiBySelector(artifact, selector) {
|
|
192
|
+
const functions = [
|
|
193
|
+
...artifact.functions,
|
|
194
|
+
...artifact.nonDispatchPublicFunctions ?? []
|
|
195
|
+
];
|
|
196
|
+
for(let i = 0; i < functions.length; i++){
|
|
197
|
+
const fn = functions[i];
|
|
198
|
+
const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
|
|
199
|
+
if (fnSelector.equals(selector)) {
|
|
200
|
+
return fn;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
179
203
|
}
|
|
180
|
-
async
|
|
181
|
-
|
|
204
|
+
async getFunctionCall(functionName, args, to) {
|
|
205
|
+
const contract = await this.getContract(to);
|
|
206
|
+
if (!contract) {
|
|
207
|
+
throw new Error(`Unknown contract ${to}: add it to PXE by calling server.addContracts(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#unknown-contract-0x0-add-it-to-pxe-by-calling-serveraddcontracts`);
|
|
208
|
+
}
|
|
209
|
+
const functionDao = contract.functions.find((f)=>f.name === functionName);
|
|
210
|
+
if (!functionDao) {
|
|
211
|
+
throw new Error(`Unknown function ${functionName} in contract ${contract.name}.`);
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
name: functionDao.name,
|
|
215
|
+
args: encodeArguments(functionDao, args),
|
|
216
|
+
selector: await FunctionSelector.fromNameAndParameters(functionDao.name, functionDao.parameters),
|
|
217
|
+
type: functionDao.functionType,
|
|
218
|
+
to,
|
|
219
|
+
hideMsgSender: false,
|
|
220
|
+
isStatic: functionDao.isStatic,
|
|
221
|
+
returnTypes: functionDao.returnTypes
|
|
222
|
+
};
|
|
182
223
|
}
|
|
183
224
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { ContractDataProvider } from './contract_data_provider.js';
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2NvbnRyYWN0X2RhdGFfcHJvdmlkZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sNkJBQTZCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { FUNCTION_TREE_HEIGHT } from '@aztec/constants';
|
|
4
|
-
import {
|
|
5
|
-
import { MembershipWitness, type MerkleTree } from '@aztec/foundation/trees';
|
|
2
|
+
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
6
3
|
import { type ContractArtifact, FunctionSelector } from '@aztec/stdlib/abi';
|
|
7
|
-
import { type ContractClassWithId } from '@aztec/stdlib/contract';
|
|
8
4
|
/**
|
|
9
5
|
* Represents a Merkle tree of functions for a particular Contract Class.
|
|
10
6
|
* It manages the construction of the function tree, computes its root, and generates membership witnesses
|
|
@@ -12,45 +8,10 @@ import { type ContractClassWithId } from '@aztec/stdlib/contract';
|
|
|
12
8
|
* It is used in combination with the AztecNode to compute various data for executing private transactions.
|
|
13
9
|
*/
|
|
14
10
|
export declare class PrivateFunctionsTree {
|
|
15
|
-
private readonly
|
|
16
|
-
private contractClass;
|
|
11
|
+
private readonly privateFunctions;
|
|
17
12
|
private tree?;
|
|
18
13
|
private constructor();
|
|
19
14
|
static create(artifact: ContractArtifact): Promise<PrivateFunctionsTree>;
|
|
20
|
-
/**
|
|
21
|
-
* Retrieve the artifact of a given function.
|
|
22
|
-
* The function is identified by its selector, which represents a unique identifier for the function's signature.
|
|
23
|
-
* Throws an error if the function with the provided selector is not found in the contract.
|
|
24
|
-
*
|
|
25
|
-
* @param selector - The function selector.
|
|
26
|
-
* @returns The artifact object containing relevant information about the targeted function.
|
|
27
|
-
*/
|
|
28
|
-
getFunctionArtifact(selector: FunctionSelector): Promise<import("@aztec/stdlib/abi").FunctionArtifact>;
|
|
29
|
-
/**
|
|
30
|
-
* Retrieve the bytecode of a function in the contract by its function selector.
|
|
31
|
-
* The function selector is a unique identifier for each function in a contract.
|
|
32
|
-
* Throws an error if the function with the given selector is not found in the contract.
|
|
33
|
-
*
|
|
34
|
-
* @param selector - The selector of a function to get bytecode for.
|
|
35
|
-
* @returns The bytecode of the function as a string.
|
|
36
|
-
*/
|
|
37
|
-
getBytecode(selector: FunctionSelector): Promise<Buffer>;
|
|
38
|
-
/**
|
|
39
|
-
* Calculate and return the root of the function tree for the current contract.
|
|
40
|
-
* This root is a cryptographic commitment to the set of constrained functions within the contract,
|
|
41
|
-
* which is used in the Aztec node's proof system. The root will be cached after the first call.
|
|
42
|
-
*
|
|
43
|
-
* @returns A promise that resolves to the Fr (finite field element) representation of the function tree root.
|
|
44
|
-
*/
|
|
45
|
-
getFunctionTreeRoot(): Promise<MerkleTree>;
|
|
46
|
-
/** Returns the contract class object. */
|
|
47
|
-
getContractClass(): ContractClassWithId;
|
|
48
|
-
/** Returns the contract artifact. */
|
|
49
|
-
getArtifact(): ContractArtifact;
|
|
50
|
-
/**
|
|
51
|
-
* Returns the contract class identifier for the given artifact.
|
|
52
|
-
*/
|
|
53
|
-
getContractClassId(): Fr;
|
|
54
15
|
/**
|
|
55
16
|
* Retrieve the membership witness of a function within a contract's function tree.
|
|
56
17
|
* A membership witness represents the position and authentication path of a target function
|
|
@@ -63,4 +24,4 @@ export declare class PrivateFunctionsTree {
|
|
|
63
24
|
getFunctionMembershipWitness(selector: FunctionSelector): Promise<MembershipWitness<typeof FUNCTION_TREE_HEIGHT>>;
|
|
64
25
|
private getTree;
|
|
65
26
|
}
|
|
66
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9mdW5jdGlvbnNfdHJlZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvY29udHJhY3RfZGF0YV9wcm92aWRlci9wcml2YXRlX2Z1bmN0aW9uc190cmVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBR3hELE9BQU8sRUFBRSxpQkFBaUIsRUFBbUIsTUFBTSx5QkFBeUIsQ0FBQztBQUM3RSxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFBZ0IsTUFBTSxtQkFBbUIsQ0FBQztBQVExRjs7Ozs7R0FLRztBQUNILHFCQUFhLG9CQUFvQjtJQUdYLE9BQU8sQ0FBQyxRQUFRLENBQUMsZ0JBQWdCO0lBRnJELE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBYTtJQUUxQixPQUFPLGVBQXFFO0lBRTVFLE9BQWEsTUFBTSxDQUFDLFFBQVEsRUFBRSxnQkFBZ0IsaUNBTzdDO0lBRUQ7Ozs7Ozs7O09BUUc7SUFDVSw0QkFBNEIsQ0FDdkMsUUFBUSxFQUFFLGdCQUFnQixHQUN6QixPQUFPLENBQUMsaUJBQWlCLENBQUMsT0FBTyxvQkFBb0IsQ0FBQyxDQUFDLENBZXpEO1lBRWEsT0FBTztDQU10QiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_functions_tree.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_data_provider/private_functions_tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private_functions_tree.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_data_provider/private_functions_tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAgB,MAAM,mBAAmB,CAAC;AAQ1F;;;;;GAKG;AACH,qBAAa,oBAAoB;IAGX,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAFrD,OAAO,CAAC,IAAI,CAAC,CAAa;IAE1B,OAAO,eAAqE;IAE5E,OAAa,MAAM,CAAC,QAAQ,EAAE,gBAAgB,iCAO7C;IAED;;;;;;;;OAQG;IACU,4BAA4B,CACvC,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,iBAAiB,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAezD;YAEa,OAAO;CAMtB"}
|
|
@@ -1,74 +1,23 @@
|
|
|
1
1
|
import { FUNCTION_TREE_HEIGHT } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { assertLength } from '@aztec/foundation/serialize';
|
|
4
4
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
5
|
-
import {
|
|
6
|
-
import { computePrivateFunctionLeaf, computePrivateFunctionsTree,
|
|
5
|
+
import { FunctionType } from '@aztec/stdlib/abi';
|
|
6
|
+
import { computePrivateFunctionLeaf, computePrivateFunctionsTree, getContractClassPrivateFunctionFromArtifact } from '@aztec/stdlib/contract';
|
|
7
7
|
/**
|
|
8
8
|
* Represents a Merkle tree of functions for a particular Contract Class.
|
|
9
9
|
* It manages the construction of the function tree, computes its root, and generates membership witnesses
|
|
10
10
|
* for constrained functions. This class also enables lookup of specific function artifact using selectors.
|
|
11
11
|
* It is used in combination with the AztecNode to compute various data for executing private transactions.
|
|
12
12
|
*/ export class PrivateFunctionsTree {
|
|
13
|
-
|
|
14
|
-
contractClass;
|
|
13
|
+
privateFunctions;
|
|
15
14
|
tree;
|
|
16
|
-
constructor(
|
|
17
|
-
this.
|
|
18
|
-
this.contractClass = contractClass;
|
|
15
|
+
constructor(privateFunctions){
|
|
16
|
+
this.privateFunctions = privateFunctions;
|
|
19
17
|
}
|
|
20
18
|
static async create(artifact) {
|
|
21
|
-
const
|
|
22
|
-
return new PrivateFunctionsTree(
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Retrieve the artifact of a given function.
|
|
26
|
-
* The function is identified by its selector, which represents a unique identifier for the function's signature.
|
|
27
|
-
* Throws an error if the function with the provided selector is not found in the contract.
|
|
28
|
-
*
|
|
29
|
-
* @param selector - The function selector.
|
|
30
|
-
* @returns The artifact object containing relevant information about the targeted function.
|
|
31
|
-
*/ async getFunctionArtifact(selector) {
|
|
32
|
-
const functionsAndSelectors = await Promise.all(this.artifact.functions.map(async (f)=>({
|
|
33
|
-
f,
|
|
34
|
-
selector: await FunctionSelector.fromNameAndParameters(f.name, f.parameters)
|
|
35
|
-
})));
|
|
36
|
-
const artifact = functionsAndSelectors.find((f)=>selector.equals(f.selector))?.f;
|
|
37
|
-
if (!artifact) {
|
|
38
|
-
throw new Error(`Unknown function. Selector ${selector.toString()} not found in the artifact ${this.artifact.name} with class ${this.getContractClassId().toString()}.`);
|
|
39
|
-
}
|
|
40
|
-
return artifact;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Retrieve the bytecode of a function in the contract by its function selector.
|
|
44
|
-
* The function selector is a unique identifier for each function in a contract.
|
|
45
|
-
* Throws an error if the function with the given selector is not found in the contract.
|
|
46
|
-
*
|
|
47
|
-
* @param selector - The selector of a function to get bytecode for.
|
|
48
|
-
* @returns The bytecode of the function as a string.
|
|
49
|
-
*/ async getBytecode(selector) {
|
|
50
|
-
const artifact = await this.getFunctionArtifact(selector);
|
|
51
|
-
return artifact.bytecode;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Calculate and return the root of the function tree for the current contract.
|
|
55
|
-
* This root is a cryptographic commitment to the set of constrained functions within the contract,
|
|
56
|
-
* which is used in the Aztec node's proof system. The root will be cached after the first call.
|
|
57
|
-
*
|
|
58
|
-
* @returns A promise that resolves to the Fr (finite field element) representation of the function tree root.
|
|
59
|
-
*/ getFunctionTreeRoot() {
|
|
60
|
-
return this.getTree();
|
|
61
|
-
}
|
|
62
|
-
/** Returns the contract class object. */ getContractClass() {
|
|
63
|
-
return this.contractClass;
|
|
64
|
-
}
|
|
65
|
-
/** Returns the contract artifact. */ getArtifact() {
|
|
66
|
-
return this.artifact;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Returns the contract class identifier for the given artifact.
|
|
70
|
-
*/ getContractClassId() {
|
|
71
|
-
return this.getContractClass().id;
|
|
19
|
+
const privateFunctions = await Promise.all(artifact.functions.filter((fn)=>fn.functionType === FunctionType.PRIVATE).map(getContractClassPrivateFunctionFromArtifact));
|
|
20
|
+
return new PrivateFunctionsTree(privateFunctions);
|
|
72
21
|
}
|
|
73
22
|
/**
|
|
74
23
|
* Retrieve the membership witness of a function within a contract's function tree.
|
|
@@ -79,7 +28,7 @@ import { computePrivateFunctionLeaf, computePrivateFunctionsTree, getContractCla
|
|
|
79
28
|
* @param selector - The function selector.
|
|
80
29
|
* @returns A MembershipWitness instance representing the position and authentication path of the function in the function tree.
|
|
81
30
|
*/ async getFunctionMembershipWitness(selector) {
|
|
82
|
-
const fn = this.
|
|
31
|
+
const fn = this.privateFunctions.find((f)=>f.selector.equals(selector));
|
|
83
32
|
if (!fn) {
|
|
84
33
|
throw new Error(`Private function with selector ${selector.toString()} not found in contract class.`);
|
|
85
34
|
}
|
|
@@ -91,8 +40,7 @@ import { computePrivateFunctionLeaf, computePrivateFunctionsTree, getContractCla
|
|
|
91
40
|
}
|
|
92
41
|
async getTree() {
|
|
93
42
|
if (!this.tree) {
|
|
94
|
-
|
|
95
|
-
this.tree = await computePrivateFunctionsTree(fns);
|
|
43
|
+
this.tree = await computePrivateFunctionsTree(this.privateFunctions);
|
|
96
44
|
}
|
|
97
45
|
return this.tree;
|
|
98
46
|
}
|
package/dest/storage/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export * from './address_data_provider/index.js';
|
|
2
|
-
export * from './auth_witness_data_provider/index.js';
|
|
3
2
|
export * from './capsule_data_provider/index.js';
|
|
4
3
|
export * from './contract_data_provider/index.js';
|
|
5
4
|
export * from './note_data_provider/index.js';
|
|
6
|
-
export * from './
|
|
5
|
+
export * from './anchor_block_data_provider/index.js';
|
|
7
6
|
export * from './tagging_data_provider/index.js';
|
|
8
|
-
export * from './
|
|
9
|
-
export
|
|
10
|
-
//# sourceMappingURL=
|
|
7
|
+
export * from './metadata.js';
|
|
8
|
+
export * from './private_event_data_provider/private_event_data_provider.js';
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsa0NBQWtDLENBQUM7QUFDakQsY0FBYyxrQ0FBa0MsQ0FBQztBQUNqRCxjQUFjLG1DQUFtQyxDQUFDO0FBQ2xELGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYyx1Q0FBdUMsQ0FBQztBQUN0RCxjQUFjLGtDQUFrQyxDQUFDO0FBQ2pELGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsOERBQThELENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,eAAe,CAAC;AAC9B,cAAc,8DAA8D,CAAC"}
|
package/dest/storage/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from './address_data_provider/index.js';
|
|
2
|
-
export * from './auth_witness_data_provider/index.js';
|
|
3
2
|
export * from './capsule_data_provider/index.js';
|
|
4
3
|
export * from './contract_data_provider/index.js';
|
|
5
4
|
export * from './note_data_provider/index.js';
|
|
6
|
-
export * from './
|
|
5
|
+
export * from './anchor_block_data_provider/index.js';
|
|
7
6
|
export * from './tagging_data_provider/index.js';
|
|
8
|
-
export * from './
|
|
9
|
-
export
|
|
7
|
+
export * from './metadata.js';
|
|
8
|
+
export * from './private_event_data_provider/private_event_data_provider.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const PXE_DATA_SCHEMA_VERSION = 2;
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0YWRhdGEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL21ldGFkYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQU8sTUFBTSx1QkFBdUIsSUFBSSxDQUFDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/storage/metadata.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PXE_DATA_SCHEMA_VERSION = 2;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { NoteDao } from '
|
|
1
|
+
export { NoteDao } from '@aztec/stdlib/note';
|
|
2
2
|
export { NoteDataProvider } from './note_data_provider.js';
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL25vdGVfZGF0YV9wcm92aWRlci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDN0MsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0seUJBQXlCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { NoteDao } from '
|
|
1
|
+
export { NoteDao } from '@aztec/stdlib/note';
|
|
2
2
|
export { NoteDataProvider } from './note_data_provider.js';
|
|
@@ -1,20 +1,84 @@
|
|
|
1
|
-
import type { Fr
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import type {
|
|
4
|
+
import type { DataInBlock } from '@aztec/stdlib/block';
|
|
5
5
|
import { type NotesFilter } from '@aztec/stdlib/note';
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { NoteDao } from '@aztec/stdlib/note';
|
|
7
|
+
/**
|
|
8
|
+
* NoteDataProvider manages the storage and retrieval of notes.
|
|
9
|
+
*
|
|
10
|
+
* Notes can be active or nullified. This class processes new notes, nullifications,
|
|
11
|
+
* and performs rollback handling in the case of a reorg.
|
|
12
|
+
**/
|
|
13
|
+
export declare class NoteDataProvider {
|
|
9
14
|
#private;
|
|
10
15
|
private constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Creates and initializes a new NoteDataProvider instance.
|
|
18
|
+
*
|
|
19
|
+
* This factory method creates a NoteDataProvider and restores any existing
|
|
20
|
+
* scope-specific indexes from the database.
|
|
21
|
+
*
|
|
22
|
+
* @param store - The key-value store to use for persistence
|
|
23
|
+
* @returns Promise resolving to a fully initialized NoteDataProvider instance
|
|
24
|
+
*/
|
|
11
25
|
static create(store: AztecAsyncKVStore): Promise<NoteDataProvider>;
|
|
26
|
+
/**
|
|
27
|
+
* Adds a new scope to the note data provider.
|
|
28
|
+
*
|
|
29
|
+
* Scopes provide privacy isolation by creating separate indexes for each user.
|
|
30
|
+
* Each scope gets its own set of indexes for efficient note retrieval by various criteria.
|
|
31
|
+
*
|
|
32
|
+
* @param scope - The AztecAddress representing the scope/user to add
|
|
33
|
+
* @returns Promise resolving to true if scope was added, false if it already existed
|
|
34
|
+
*/
|
|
12
35
|
addScope(scope: AztecAddress): Promise<boolean>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Adds multiple notes to the data provider under the specified scope.
|
|
38
|
+
*
|
|
39
|
+
* Notes are stored using their index from the notes hash tree as the key, which provides
|
|
40
|
+
* uniqueness and maintains creation order. Each note is indexed by multiple criteria
|
|
41
|
+
* for efficient retrieval.
|
|
42
|
+
*
|
|
43
|
+
* @param notes - Notes to store
|
|
44
|
+
* @param scope - The scope (user/account) under which to store the notes
|
|
45
|
+
*/
|
|
46
|
+
addNotes(notes: NoteDao[], scope: AztecAddress): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Synchronizes notes and nullifiers to a specific block number.
|
|
49
|
+
*
|
|
50
|
+
* This method ensures that the state of notes and nullifiers is consistent with the
|
|
51
|
+
* specified block number. It restores any notes that were nullified after the given block
|
|
52
|
+
* and deletes any active notes created after that block.
|
|
53
|
+
*
|
|
54
|
+
* @param blockNumber - The new chain tip after a reorg
|
|
55
|
+
* @param synchedBlockNumber - The block number up to which PXE managed to sync before the reorg happened.
|
|
56
|
+
*/
|
|
57
|
+
rollbackNotesAndNullifiers(blockNumber: number, synchedBlockNumber: number): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves notes based on the provided filter criteria.
|
|
60
|
+
*
|
|
61
|
+
* This method queries both active and optionally nullified notes based on the filter
|
|
62
|
+
* parameters.
|
|
63
|
+
*
|
|
64
|
+
* @param filter - Filter criteria including contractAddress (required), and optional
|
|
65
|
+
* owner, storageSlot, status, scopes, and siloedNullifier.
|
|
66
|
+
* @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
|
|
67
|
+
* returned once if this is the case)
|
|
68
|
+
* @throws If filtering by an empty scopes array. Scopes have to be set to undefined or to a non-empty array.
|
|
69
|
+
*/
|
|
16
70
|
getNotes(filter: NotesFilter): Promise<NoteDao[]>;
|
|
17
|
-
|
|
18
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Transitions notes from "active" to "nullified" state.
|
|
73
|
+
*
|
|
74
|
+
* This operation processes a batch of nullifiers to mark the corresponding notes
|
|
75
|
+
* as spent/nullified. The operation is atomic - if any nullifier is not found,
|
|
76
|
+
* the entire operation fails and no notes are modified.
|
|
77
|
+
*
|
|
78
|
+
* @param nullifiers - Array of nullifiers with their block numbers to process
|
|
79
|
+
* @returns Promise resolving to array of nullified NoteDao objects
|
|
80
|
+
* @throws Error if any nullifier is not found in the active notes
|
|
81
|
+
*/
|
|
82
|
+
applyNullifiers(nullifiers: DataInBlock<Fr>[]): Promise<NoteDao[]>;
|
|
19
83
|
}
|
|
20
|
-
//# sourceMappingURL=
|
|
84
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9kYXRhX3Byb3ZpZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9ub3RlX2RhdGFfcHJvdmlkZXIvbm90ZV9kYXRhX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRXpELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFxQyxNQUFNLGlCQUFpQixDQUFDO0FBQzVGLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUMzRCxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUN2RCxPQUFPLEVBQWMsS0FBSyxXQUFXLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNsRSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFN0M7Ozs7O0lBS0k7QUFDSixxQkFBYSxnQkFBZ0I7O0lBaUIzQixPQUFPLGVBZ0JOO0lBRUQ7Ozs7Ozs7O09BUUc7SUFDSCxPQUFvQixNQUFNLENBQUMsS0FBSyxFQUFFLGlCQUFpQixHQUFHLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQU85RTtJQUVEOzs7Ozs7OztPQVFHO0lBQ1UsUUFBUSxDQUFDLEtBQUssRUFBRSxZQUFZLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQVkzRDtJQUVEOzs7Ozs7Ozs7T0FTRztJQUNILFFBQVEsQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLEVBQUUsS0FBSyxFQUFFLFlBQVksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBZ0I3RDtJQUVEOzs7Ozs7Ozs7T0FTRztJQUNVLDBCQUEwQixDQUFDLFdBQVcsRUFBRSxNQUFNLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FHdEc7SUF1RkQ7Ozs7Ozs7Ozs7O09BV0c7SUFDRyxRQUFRLENBQUMsTUFBTSxFQUFFLFdBQVcsR0FBRyxPQUFPLENBQUMsT0FBTyxFQUFFLENBQUMsQ0F3R3REO0lBRUQ7Ozs7Ozs7Ozs7T0FVRztJQUNILGVBQWUsQ0FBQyxVQUFVLEVBQUUsV0FBVyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEdBQUcsT0FBTyxDQUFDLE9BQU8sRUFBRSxDQUFDLENBOERqRTtDQUNGIn0=
|