@aztec/pxe 0.0.0-test.0 → 0.0.1-commit.0208eb9
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 +43 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
- package/dest/block_synchronizer/block_synchronizer.js +147 -0
- 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 +13 -24
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +35 -33
- package/dest/config/package_info.d.ts +1 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
- package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/benchmarked_node.js +77 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +82 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -0
- package/dest/contract_function_simulator/contract_function_simulator.js +339 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts +104 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_note_cache.js +208 -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 +21 -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 +40 -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 +16 -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 +22 -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 +107 -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 +19 -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 +60 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle.js +368 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +23 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution.js +87 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +239 -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 +426 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +208 -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 +367 -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_sync/index.d.ts +24 -0
- package/dest/contract_sync/index.d.ts.map +1 -0
- package/dest/contract_sync/index.js +61 -0
- package/dest/debug/pxe_debug_utils.d.ts +41 -0
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
- package/dest/debug/pxe_debug_utils.js +47 -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 +33 -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 +10 -10
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +33 -12
- package/dest/entrypoints/pxe_creation_options.d.ts +18 -0
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -0
- package/dest/entrypoints/server/index.d.ts +8 -4
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +6 -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 +46 -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} +30 -22
- 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 +44 -0
- package/dest/events/index.d.ts +2 -0
- package/dest/events/index.d.ts.map +1 -0
- package/dest/events/index.js +1 -0
- package/dest/events/private_event_filter_validator.d.ts +9 -0
- package/dest/events/private_event_filter_validator.d.ts.map +1 -0
- package/dest/events/private_event_filter_validator.js +38 -0
- package/dest/job_coordinator/job_coordinator.d.ts +75 -0
- package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
- package/dest/job_coordinator/job_coordinator.js +94 -0
- package/dest/logs/log_service.d.ts +28 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +123 -0
- package/dest/notes/index.d.ts +2 -0
- package/dest/notes/index.d.ts.map +1 -0
- package/dest/notes/index.js +1 -0
- package/dest/notes/note_service.d.ts +48 -0
- package/dest/notes/note_service.d.ts.map +1 -0
- package/dest/notes/note_service.js +147 -0
- package/dest/oracle_version.d.ts +3 -0
- package/dest/oracle_version.d.ts.map +1 -0
- package/dest/oracle_version.js +11 -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/private_kernel/hints/index.js +2 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +277 -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 +45 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -0
- package/dest/private_kernel/private_kernel_execution_prover.js +285 -0
- package/dest/private_kernel/private_kernel_oracle.d.ts +59 -0
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -0
- package/dest/private_kernel/private_kernel_oracle.js +92 -0
- package/dest/pxe.d.ts +204 -0
- package/dest/pxe.d.ts.map +1 -0
- package/dest/pxe.js +742 -0
- 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} +13 -15
- 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 +17 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/anchor_block_store.js +26 -0
- 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 +72 -0
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_store.js +253 -0
- package/dest/storage/capsule_store/index.d.ts +2 -0
- package/dest/storage/capsule_store/index.d.ts.map +1 -0
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/contract_store/contract_store.d.ts +66 -0
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/contract_store/contract_store.js +233 -0
- 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_store/private_functions_tree.d.ts +27 -0
- package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
- package/dest/storage/contract_store/private_functions_tree.js +47 -0
- package/dest/storage/index.d.ts +9 -10
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +8 -9
- 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_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 +83 -0
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/note_store/note_store.js +341 -0
- package/dest/storage/note_store/stored_note.d.ts +16 -0
- package/dest/storage/note_store/stored_note.d.ts.map +1 -0
- package/dest/storage/note_store/stored_note.js +43 -0
- package/dest/storage/private_event_store/private_event_store.d.ts +91 -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 +273 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
- package/dest/storage/private_event_store/stored_private_event.js +56 -0
- package/dest/storage/tagging_store/index.d.ts +4 -0
- package/dest/storage/tagging_store/index.d.ts.map +1 -0
- package/dest/storage/tagging_store/index.js +3 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/recipient_tagging_store.js +111 -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 +36 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +77 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_tagging_store.js +348 -0
- package/dest/tagging/constants.d.ts +2 -0
- package/dest/tagging/constants.d.ts.map +1 -0
- package/dest/tagging/constants.js +10 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
- package/dest/tagging/get_all_logs_by_tags.js +46 -0
- package/dest/tagging/index.d.ts +17 -0
- package/dest/tagging/index.d.ts.map +1 -0
- package/dest/tagging/index.js +15 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +15 -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 +15 -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 +32 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +21 -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 +29 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +21 -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 +60 -0
- package/package.json +37 -34
- package/src/bin/check_oracle_version.ts +161 -0
- package/src/block_synchronizer/block_synchronizer.ts +172 -0
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +41 -55
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/benchmarked_node.ts +103 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +633 -0
- package/src/contract_function_simulator/execution_note_cache.ts +252 -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 +51 -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 +23 -0
- package/src/contract_function_simulator/oracle/index.ts +16 -0
- package/src/contract_function_simulator/oracle/interfaces.ts +185 -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 +637 -0
- package/src/contract_function_simulator/oracle/private_execution.ts +141 -0
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +701 -0
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +544 -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_sync/index.ts +119 -0
- package/src/debug/pxe_debug_utils.ts +63 -0
- package/src/entrypoints/client/bundle/index.ts +3 -2
- package/src/entrypoints/client/bundle/utils.ts +35 -36
- package/src/entrypoints/client/lazy/index.ts +3 -2
- package/src/entrypoints/client/lazy/utils.ts +36 -32
- package/src/entrypoints/pxe_creation_options.ts +14 -0
- package/src/entrypoints/server/index.ts +7 -3
- package/src/entrypoints/server/utils.ts +52 -52
- package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +40 -39
- package/src/events/event_service.ts +71 -0
- package/src/events/index.ts +1 -0
- package/src/events/private_event_filter_validator.ts +46 -0
- package/src/job_coordinator/job_coordinator.ts +150 -0
- package/src/logs/log_service.ts +220 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +195 -0
- package/src/oracle_version.ts +12 -0
- package/src/private_kernel/hints/compute_tx_include_by_timestamp.ts +58 -0
- package/src/private_kernel/hints/index.ts +2 -0
- package/src/{kernel_prover/hints/build_private_kernel_reset_private_inputs.ts → private_kernel/hints/private_kernel_reset_private_inputs_builder.ts} +179 -156
- package/src/private_kernel/index.ts +2 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +433 -0
- package/src/private_kernel/private_kernel_oracle.ts +152 -0
- package/src/pxe.ts +1076 -0
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +15 -21
- 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} +10 -17
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/capsule_store/capsule_store.ts +315 -0
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/contract_store/contract_store.ts +330 -0
- package/src/storage/contract_store/index.ts +1 -0
- package/src/storage/contract_store/private_functions_tree.ts +67 -0
- package/src/storage/index.ts +8 -10
- package/src/storage/metadata.ts +1 -0
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/note_store/note_store.ts +411 -0
- package/src/storage/note_store/stored_note.ts +48 -0
- package/src/storage/private_event_store/private_event_store.ts +384 -0
- package/src/storage/private_event_store/stored_private_event.ts +73 -0
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +139 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +429 -0
- package/src/tagging/constants.ts +10 -0
- package/src/tagging/get_all_logs_by_tags.ts +68 -0
- package/src/tagging/index.ts +19 -0
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +143 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +49 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +99 -0
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +36 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +84 -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_oracle/index.js +0 -76
- 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/hints/index.js +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/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/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/capsule_data_provider/capsule_data_provider.d.ts +0 -16
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -57
- 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 +0 -109
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.js +0 -183
- package/dest/storage/contract_data_provider/index.d.ts +0 -3
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -2
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts +0 -66
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.js +0 -99
- 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 -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/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/note_data_provider/note_data_provider.js +0 -249
- 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/sync_data_provider/sync_data_provider.js +0 -29
- 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 -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/synchronizer/synchronizer.js +0 -103
- 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_oracle/index.ts +0 -117
- package/src/kernel_prover/hints/index.ts +0 -1
- package/src/kernel_prover/index.ts +0 -2
- package/src/kernel_prover/kernel_prover.ts +0 -351
- package/src/kernel_prover/proving_data_oracle.ts +0 -83
- 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/address_data_provider/index.ts +0 -1
- 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/capsule_data_provider/capsule_data_provider.ts +0 -80
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/contract_data_provider.ts +0 -261
- package/src/storage/contract_data_provider/index.ts +0 -2
- package/src/storage/contract_data_provider/private_functions_tree.ts +0 -131
- 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 -162
- package/src/storage/note_data_provider/note_data_provider.ts +0 -345
- 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 -92
- package/src/synchronizer/index.ts +0 -1
- package/src/synchronizer/synchronizer.ts +0 -121
- package/src/test/pxe_test_suite.ts +0 -111
- /package/dest/entrypoints/{client/pxe_creation_options.js → pxe_creation_options.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data_provider.d.ts","sourceRoot":"","sources":["../../src/storage/data_provider.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
5
|
-
import type { NoteData } from '@aztec/simulator/client';
|
|
6
|
-
import { NoteSelector } from '@aztec/stdlib/abi';
|
|
7
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
-
import type { PublicKey } from '@aztec/stdlib/keys';
|
|
9
|
-
import { Note } from '@aztec/stdlib/note';
|
|
10
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
11
|
-
/**
|
|
12
|
-
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
13
|
-
* information required to use it during execution and manage its state.
|
|
14
|
-
*/
|
|
15
|
-
export declare class NoteDao implements NoteData {
|
|
16
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
17
|
-
note: Note;
|
|
18
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
19
|
-
contractAddress: AztecAddress;
|
|
20
|
-
/**
|
|
21
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
22
|
-
* since contracts typically make queries based on it.
|
|
23
|
-
* */
|
|
24
|
-
storageSlot: Fr;
|
|
25
|
-
/** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */
|
|
26
|
-
nonce: Fr;
|
|
27
|
-
/**
|
|
28
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
29
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
30
|
-
*/
|
|
31
|
-
noteHash: Fr;
|
|
32
|
-
/**
|
|
33
|
-
* The nullifier of the note, siloed by contract address.
|
|
34
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
35
|
-
*/
|
|
36
|
-
siloedNullifier: Fr;
|
|
37
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
38
|
-
* when searching for txEffects.
|
|
39
|
-
*/
|
|
40
|
-
txHash: TxHash;
|
|
41
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
42
|
-
* reorgs.*/
|
|
43
|
-
l2BlockNumber: number;
|
|
44
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
45
|
-
* reorgs.*/
|
|
46
|
-
l2BlockHash: string;
|
|
47
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
48
|
-
index: bigint;
|
|
49
|
-
/** The public key with which the note log was encrypted during delivery. */
|
|
50
|
-
addressPoint: PublicKey;
|
|
51
|
-
/** The note type identifier for the contract.
|
|
52
|
-
* TODO(#12013): remove
|
|
53
|
-
*/
|
|
54
|
-
noteTypeId: NoteSelector;
|
|
55
|
-
constructor(
|
|
56
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
57
|
-
note: Note,
|
|
58
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
59
|
-
contractAddress: AztecAddress,
|
|
60
|
-
/**
|
|
61
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
62
|
-
* since contracts typically make queries based on it.
|
|
63
|
-
* */
|
|
64
|
-
storageSlot: Fr,
|
|
65
|
-
/** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */
|
|
66
|
-
nonce: Fr,
|
|
67
|
-
/**
|
|
68
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
69
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
70
|
-
*/
|
|
71
|
-
noteHash: Fr,
|
|
72
|
-
/**
|
|
73
|
-
* The nullifier of the note, siloed by contract address.
|
|
74
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
75
|
-
*/
|
|
76
|
-
siloedNullifier: Fr,
|
|
77
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
78
|
-
* when searching for txEffects.
|
|
79
|
-
*/
|
|
80
|
-
txHash: TxHash,
|
|
81
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
82
|
-
* reorgs.*/
|
|
83
|
-
l2BlockNumber: number,
|
|
84
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
85
|
-
* reorgs.*/
|
|
86
|
-
l2BlockHash: string,
|
|
87
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
88
|
-
index: bigint,
|
|
89
|
-
/** The public key with which the note log was encrypted during delivery. */
|
|
90
|
-
addressPoint: PublicKey,
|
|
91
|
-
/** The note type identifier for the contract.
|
|
92
|
-
* TODO(#12013): remove
|
|
93
|
-
*/
|
|
94
|
-
noteTypeId: NoteSelector);
|
|
95
|
-
toBuffer(): Buffer;
|
|
96
|
-
static fromBuffer(buffer: Buffer | BufferReader): NoteDao;
|
|
97
|
-
toString(): string;
|
|
98
|
-
static fromString(str: string): NoteDao;
|
|
99
|
-
/**
|
|
100
|
-
* Returns the size in bytes of the Note Dao.
|
|
101
|
-
* @returns - Its size in bytes.
|
|
102
|
-
*/
|
|
103
|
-
getSize(): number;
|
|
104
|
-
static random({ note, contractAddress, storageSlot, nonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, addressPoint, noteTypeId, }?: Partial<NoteDao>): Promise<NoteDao>;
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=note_dao.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note_dao.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/note_dao.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAS,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;GAGG;AACH,qBAAa,OAAQ,YAAW,QAAQ;IAIpC,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;SAGK;IACE,WAAW,EAAE,EAAE;IACtB,qFAAqF;IAC9E,KAAK,EAAE,EAAE;IAGhB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB;;;OAGG;IACI,eAAe,EAAE,EAAE;IAG1B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;gBACY;IACL,aAAa,EAAE,MAAM;IAC5B;gBACY;IACL,WAAW,EAAE,MAAM;IAC1B,+EAA+E;IACxE,KAAK,EAAE,MAAM;IACpB,4EAA4E;IACrE,YAAY,EAAE,SAAS;IAE9B;;OAEG;IACI,UAAU,EAAE,YAAY;;IA3C/B,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;SAGK;IACE,WAAW,EAAE,EAAE;IACtB,qFAAqF;IAC9E,KAAK,EAAE,EAAE;IAGhB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB;;;OAGG;IACI,eAAe,EAAE,EAAE;IAG1B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;gBACY;IACL,aAAa,EAAE,MAAM;IAC5B;gBACY;IACL,WAAW,EAAE,MAAM;IAC1B,+EAA+E;IACxE,KAAK,EAAE,MAAM;IACpB,4EAA4E;IACrE,YAAY,EAAE,SAAS;IAE9B;;OAEG;IACI,UAAU,EAAE,YAAY;IAGjC,QAAQ,IAAI,MAAM;IAiBlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAgC/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAK7B;;;OAGG;IACI,OAAO;WAMD,MAAM,CAAC,EAClB,IAAoB,EACpB,eAA2B,EAC3B,WAAyB,EACzB,KAAmB,EACnB,QAAsB,EACtB,eAA6B,EAC7B,MAAwB,EACxB,aAAgD,EAChD,WAAoC,EACpC,KAA8B,EAC9B,YAAwB,EACxB,UAAkC,GACnC,GAAE,OAAO,CAAC,OAAO,CAAM;CAgBzB"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
-
import { Fr, Point } from '@aztec/foundation/fields';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import { NoteSelector } from '@aztec/stdlib/abi';
|
|
5
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import { Note } from '@aztec/stdlib/note';
|
|
7
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
8
|
-
/**
|
|
9
|
-
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
10
|
-
* information required to use it during execution and manage its state.
|
|
11
|
-
*/ export class NoteDao {
|
|
12
|
-
note;
|
|
13
|
-
contractAddress;
|
|
14
|
-
storageSlot;
|
|
15
|
-
nonce;
|
|
16
|
-
noteHash;
|
|
17
|
-
siloedNullifier;
|
|
18
|
-
txHash;
|
|
19
|
-
l2BlockNumber;
|
|
20
|
-
l2BlockHash;
|
|
21
|
-
index;
|
|
22
|
-
addressPoint;
|
|
23
|
-
noteTypeId;
|
|
24
|
-
constructor(// Note information
|
|
25
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */ note, /** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */ contractAddress, /**
|
|
26
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
27
|
-
* since contracts typically make queries based on it.
|
|
28
|
-
* */ storageSlot, /** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */ nonce, // Computed values
|
|
29
|
-
/**
|
|
30
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
31
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
32
|
-
*/ noteHash, /**
|
|
33
|
-
* The nullifier of the note, siloed by contract address.
|
|
34
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
35
|
-
*/ siloedNullifier, // Metadata
|
|
36
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
37
|
-
* when searching for txEffects.
|
|
38
|
-
*/ txHash, /** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
39
|
-
* reorgs.*/ l2BlockNumber, /** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
40
|
-
* reorgs.*/ l2BlockHash, /** The index of the leaf in the global note hash tree the note is stored at */ index, /** The public key with which the note log was encrypted during delivery. */ addressPoint, /** The note type identifier for the contract.
|
|
41
|
-
* TODO(#12013): remove
|
|
42
|
-
*/ noteTypeId){
|
|
43
|
-
this.note = note;
|
|
44
|
-
this.contractAddress = contractAddress;
|
|
45
|
-
this.storageSlot = storageSlot;
|
|
46
|
-
this.nonce = nonce;
|
|
47
|
-
this.noteHash = noteHash;
|
|
48
|
-
this.siloedNullifier = siloedNullifier;
|
|
49
|
-
this.txHash = txHash;
|
|
50
|
-
this.l2BlockNumber = l2BlockNumber;
|
|
51
|
-
this.l2BlockHash = l2BlockHash;
|
|
52
|
-
this.index = index;
|
|
53
|
-
this.addressPoint = addressPoint;
|
|
54
|
-
this.noteTypeId = noteTypeId;
|
|
55
|
-
}
|
|
56
|
-
toBuffer() {
|
|
57
|
-
return serializeToBuffer([
|
|
58
|
-
this.note,
|
|
59
|
-
this.contractAddress,
|
|
60
|
-
this.storageSlot,
|
|
61
|
-
this.nonce,
|
|
62
|
-
this.noteHash,
|
|
63
|
-
this.siloedNullifier,
|
|
64
|
-
this.txHash,
|
|
65
|
-
this.l2BlockNumber,
|
|
66
|
-
Fr.fromHexString(this.l2BlockHash),
|
|
67
|
-
this.index,
|
|
68
|
-
this.addressPoint,
|
|
69
|
-
this.noteTypeId
|
|
70
|
-
]);
|
|
71
|
-
}
|
|
72
|
-
static fromBuffer(buffer) {
|
|
73
|
-
const reader = BufferReader.asReader(buffer);
|
|
74
|
-
const note = Note.fromBuffer(reader);
|
|
75
|
-
const contractAddress = AztecAddress.fromBuffer(reader);
|
|
76
|
-
const storageSlot = Fr.fromBuffer(reader);
|
|
77
|
-
const nonce = Fr.fromBuffer(reader);
|
|
78
|
-
const noteHash = Fr.fromBuffer(reader);
|
|
79
|
-
const siloedNullifier = Fr.fromBuffer(reader);
|
|
80
|
-
const txHash = reader.readObject(TxHash);
|
|
81
|
-
const l2BlockNumber = reader.readNumber();
|
|
82
|
-
const l2BlockHash = Fr.fromBuffer(reader).toString();
|
|
83
|
-
const index = toBigIntBE(reader.readBytes(32));
|
|
84
|
-
const publicKey = Point.fromBuffer(reader);
|
|
85
|
-
const noteTypeId = reader.readObject(NoteSelector);
|
|
86
|
-
return new NoteDao(note, contractAddress, storageSlot, nonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, publicKey, noteTypeId);
|
|
87
|
-
}
|
|
88
|
-
toString() {
|
|
89
|
-
return '0x' + this.toBuffer().toString('hex');
|
|
90
|
-
}
|
|
91
|
-
static fromString(str) {
|
|
92
|
-
const hex = str.replace(/^0x/, '');
|
|
93
|
-
return NoteDao.fromBuffer(Buffer.from(hex, 'hex'));
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Returns the size in bytes of the Note Dao.
|
|
97
|
-
* @returns - Its size in bytes.
|
|
98
|
-
*/ getSize() {
|
|
99
|
-
const indexSize = Math.ceil(Math.log2(Number(this.index)));
|
|
100
|
-
const noteSize = 4 + this.note.items.length * Fr.SIZE_IN_BYTES;
|
|
101
|
-
return noteSize + AztecAddress.SIZE_IN_BYTES + Fr.SIZE_IN_BYTES * 4 + TxHash.SIZE + Point.SIZE_IN_BYTES + indexSize;
|
|
102
|
-
}
|
|
103
|
-
static async random({ note = Note.random(), contractAddress = undefined, storageSlot = Fr.random(), nonce = Fr.random(), noteHash = Fr.random(), siloedNullifier = Fr.random(), txHash = TxHash.random(), l2BlockNumber = Math.floor(Math.random() * 1000), l2BlockHash = Fr.random().toString(), index = Fr.random().toBigInt(), addressPoint = undefined, noteTypeId = NoteSelector.random() } = {}) {
|
|
104
|
-
return new NoteDao(note, contractAddress ?? await AztecAddress.random(), storageSlot, nonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, addressPoint ?? await Point.random(), noteTypeId);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Fr, Point } from '@aztec/foundation/fields';
|
|
2
|
-
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
3
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import type { InBlock } from '@aztec/stdlib/block';
|
|
5
|
-
import { type NotesFilter } from '@aztec/stdlib/note';
|
|
6
|
-
import type { DataProvider } from '../data_provider.js';
|
|
7
|
-
import { NoteDao } from './note_dao.js';
|
|
8
|
-
export declare class NoteDataProvider implements DataProvider {
|
|
9
|
-
#private;
|
|
10
|
-
private constructor();
|
|
11
|
-
static create(store: AztecAsyncKVStore): Promise<NoteDataProvider>;
|
|
12
|
-
addScope(scope: AztecAddress): Promise<boolean>;
|
|
13
|
-
addNotes(notes: NoteDao[], scope?: AztecAddress): Promise<void>;
|
|
14
|
-
removeNotesAfter(blockNumber: number): Promise<void>;
|
|
15
|
-
unnullifyNotesAfter(blockNumber: number, synchedBlockNumber?: number): Promise<void>;
|
|
16
|
-
getNotes(filter: NotesFilter): Promise<NoteDao[]>;
|
|
17
|
-
removeNullifiedNotes(nullifiers: InBlock<Fr>[], accountAddressPoint: Point): Promise<NoteDao[]>;
|
|
18
|
-
getSize(): Promise<number>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=note_data_provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/note_data_provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,qBAAa,gBAAiB,YAAW,YAAY;;IAsBnD,OAAO;WAsBa,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWlE,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBtD,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,GAAE,YAAgC,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBjF,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB9C,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkD3F,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAkGvD,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,mBAAmB,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IA6DzF,OAAO;CAGd"}
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { toBufferBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
-
import { toArray } from '@aztec/foundation/iterable';
|
|
3
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import { NoteStatus } from '@aztec/stdlib/note';
|
|
5
|
-
import { NoteDao } from './note_dao.js';
|
|
6
|
-
export class NoteDataProvider {
|
|
7
|
-
#store;
|
|
8
|
-
#notes;
|
|
9
|
-
#nullifiedNotes;
|
|
10
|
-
#nullifierToNoteId;
|
|
11
|
-
#nullifiersByBlockNumber;
|
|
12
|
-
#nullifiedNotesToScope;
|
|
13
|
-
#nullifiedNotesByContract;
|
|
14
|
-
#nullifiedNotesByStorageSlot;
|
|
15
|
-
#nullifiedNotesByTxHash;
|
|
16
|
-
#nullifiedNotesByAddressPoint;
|
|
17
|
-
#nullifiedNotesByNullifier;
|
|
18
|
-
#scopes;
|
|
19
|
-
#notesToScope;
|
|
20
|
-
#notesByContractAndScope;
|
|
21
|
-
#notesByStorageSlotAndScope;
|
|
22
|
-
#notesByTxHashAndScope;
|
|
23
|
-
#notesByAddressPointAndScope;
|
|
24
|
-
constructor(store){
|
|
25
|
-
this.#store = store;
|
|
26
|
-
this.#notes = store.openMap('notes');
|
|
27
|
-
this.#nullifiedNotes = store.openMap('nullified_notes');
|
|
28
|
-
this.#nullifierToNoteId = store.openMap('nullifier_to_note');
|
|
29
|
-
this.#nullifiersByBlockNumber = store.openMultiMap('nullifier_to_block_number');
|
|
30
|
-
this.#nullifiedNotesToScope = store.openMultiMap('nullified_notes_to_scope');
|
|
31
|
-
this.#nullifiedNotesByContract = store.openMultiMap('nullified_notes_by_contract');
|
|
32
|
-
this.#nullifiedNotesByStorageSlot = store.openMultiMap('nullified_notes_by_storage_slot');
|
|
33
|
-
this.#nullifiedNotesByTxHash = store.openMultiMap('nullified_notes_by_tx_hash');
|
|
34
|
-
this.#nullifiedNotesByAddressPoint = store.openMultiMap('nullified_notes_by_address_point');
|
|
35
|
-
this.#nullifiedNotesByNullifier = store.openMap('nullified_notes_by_nullifier');
|
|
36
|
-
this.#scopes = store.openMap('scopes');
|
|
37
|
-
this.#notesToScope = store.openMultiMap('notes_to_scope');
|
|
38
|
-
this.#notesByContractAndScope = new Map();
|
|
39
|
-
this.#notesByStorageSlotAndScope = new Map();
|
|
40
|
-
this.#notesByTxHashAndScope = new Map();
|
|
41
|
-
this.#notesByAddressPointAndScope = new Map();
|
|
42
|
-
}
|
|
43
|
-
static async create(store) {
|
|
44
|
-
const pxeDB = new NoteDataProvider(store);
|
|
45
|
-
for await (const scope of pxeDB.#scopes.keysAsync()){
|
|
46
|
-
pxeDB.#notesByContractAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_contract`));
|
|
47
|
-
pxeDB.#notesByStorageSlotAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_storage_slot`));
|
|
48
|
-
pxeDB.#notesByTxHashAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_tx_hash`));
|
|
49
|
-
pxeDB.#notesByAddressPointAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_address_point`));
|
|
50
|
-
}
|
|
51
|
-
return pxeDB;
|
|
52
|
-
}
|
|
53
|
-
async addScope(scope) {
|
|
54
|
-
const scopeString = scope.toString();
|
|
55
|
-
if (await this.#scopes.hasAsync(scopeString)) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
await this.#scopes.set(scopeString, true);
|
|
59
|
-
this.#notesByContractAndScope.set(scopeString, this.#store.openMultiMap(`${scopeString}:notes_by_contract`));
|
|
60
|
-
this.#notesByStorageSlotAndScope.set(scopeString, this.#store.openMultiMap(`${scopeString}:notes_by_storage_slot`));
|
|
61
|
-
this.#notesByTxHashAndScope.set(scopeString, this.#store.openMultiMap(`${scopeString}:notes_by_tx_hash`));
|
|
62
|
-
this.#notesByAddressPointAndScope.set(scopeString, this.#store.openMultiMap(`${scopeString}:notes_by_address_point`));
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
async addNotes(notes, scope = AztecAddress.ZERO) {
|
|
66
|
-
if (!await this.#scopes.hasAsync(scope.toString())) {
|
|
67
|
-
await this.addScope(scope);
|
|
68
|
-
}
|
|
69
|
-
return this.#store.transactionAsync(async ()=>{
|
|
70
|
-
for (const dao of notes){
|
|
71
|
-
// store notes by their index in the notes hash tree
|
|
72
|
-
// this provides the uniqueness we need to store individual notes
|
|
73
|
-
// and should also return notes in the order that they were created.
|
|
74
|
-
// Had we stored them by their nullifier, they would be returned in random order
|
|
75
|
-
const noteIndex = toBufferBE(dao.index, 32).toString('hex');
|
|
76
|
-
await this.#notes.set(noteIndex, dao.toBuffer());
|
|
77
|
-
await this.#notesToScope.set(noteIndex, scope.toString());
|
|
78
|
-
await this.#nullifierToNoteId.set(dao.siloedNullifier.toString(), noteIndex);
|
|
79
|
-
await this.#notesByContractAndScope.get(scope.toString()).set(dao.contractAddress.toString(), noteIndex);
|
|
80
|
-
await this.#notesByStorageSlotAndScope.get(scope.toString()).set(dao.storageSlot.toString(), noteIndex);
|
|
81
|
-
await this.#notesByTxHashAndScope.get(scope.toString()).set(dao.txHash.toString(), noteIndex);
|
|
82
|
-
await this.#notesByAddressPointAndScope.get(scope.toString()).set(dao.addressPoint.toString(), noteIndex);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
removeNotesAfter(blockNumber) {
|
|
87
|
-
return this.#store.transactionAsync(async ()=>{
|
|
88
|
-
const notes = await toArray(this.#notes.valuesAsync());
|
|
89
|
-
for (const note of notes){
|
|
90
|
-
const noteDao = NoteDao.fromBuffer(note);
|
|
91
|
-
if (noteDao.l2BlockNumber > blockNumber) {
|
|
92
|
-
const noteIndex = toBufferBE(noteDao.index, 32).toString('hex');
|
|
93
|
-
await this.#notes.delete(noteIndex);
|
|
94
|
-
await this.#notesToScope.delete(noteIndex);
|
|
95
|
-
await this.#nullifierToNoteId.delete(noteDao.siloedNullifier.toString());
|
|
96
|
-
const scopes = await toArray(this.#scopes.keysAsync());
|
|
97
|
-
for (const scope of scopes){
|
|
98
|
-
await this.#notesByAddressPointAndScope.get(scope).deleteValue(noteDao.addressPoint.toString(), noteIndex);
|
|
99
|
-
await this.#notesByTxHashAndScope.get(scope).deleteValue(noteDao.txHash.toString(), noteIndex);
|
|
100
|
-
await this.#notesByContractAndScope.get(scope).deleteValue(noteDao.contractAddress.toString(), noteIndex);
|
|
101
|
-
await this.#notesByStorageSlotAndScope.get(scope).deleteValue(noteDao.storageSlot.toString(), noteIndex);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
async unnullifyNotesAfter(blockNumber, synchedBlockNumber) {
|
|
108
|
-
const nullifiersToUndo = [];
|
|
109
|
-
const currentBlockNumber = blockNumber + 1;
|
|
110
|
-
const maxBlockNumber = synchedBlockNumber ?? currentBlockNumber;
|
|
111
|
-
for(let i = currentBlockNumber; i <= maxBlockNumber; i++){
|
|
112
|
-
nullifiersToUndo.push(...await toArray(this.#nullifiersByBlockNumber.getValuesAsync(i)));
|
|
113
|
-
}
|
|
114
|
-
const notesIndexesToReinsert = await Promise.all(nullifiersToUndo.map((nullifier)=>this.#nullifiedNotesByNullifier.getAsync(nullifier)));
|
|
115
|
-
const notNullNoteIndexes = notesIndexesToReinsert.filter((noteIndex)=>noteIndex != undefined);
|
|
116
|
-
const nullifiedNoteBuffers = await Promise.all(notNullNoteIndexes.map((noteIndex)=>this.#nullifiedNotes.getAsync(noteIndex)));
|
|
117
|
-
const noteDaos = nullifiedNoteBuffers.filter((buffer)=>buffer != undefined).map((buffer)=>NoteDao.fromBuffer(buffer));
|
|
118
|
-
await this.#store.transactionAsync(async ()=>{
|
|
119
|
-
for (const dao of noteDaos){
|
|
120
|
-
const noteIndex = toBufferBE(dao.index, 32).toString('hex');
|
|
121
|
-
await this.#notes.set(noteIndex, dao.toBuffer());
|
|
122
|
-
await this.#nullifierToNoteId.set(dao.siloedNullifier.toString(), noteIndex);
|
|
123
|
-
let scopes = await toArray(this.#nullifiedNotesToScope.getValuesAsync(noteIndex)) ?? [];
|
|
124
|
-
if (scopes.length === 0) {
|
|
125
|
-
scopes = [
|
|
126
|
-
new AztecAddress(dao.addressPoint.x).toString()
|
|
127
|
-
];
|
|
128
|
-
}
|
|
129
|
-
for (const scope of scopes){
|
|
130
|
-
await this.#notesByContractAndScope.get(scope.toString()).set(dao.contractAddress.toString(), noteIndex);
|
|
131
|
-
await this.#notesByStorageSlotAndScope.get(scope.toString()).set(dao.storageSlot.toString(), noteIndex);
|
|
132
|
-
await this.#notesByTxHashAndScope.get(scope.toString()).set(dao.txHash.toString(), noteIndex);
|
|
133
|
-
await this.#notesByAddressPointAndScope.get(scope.toString()).set(dao.addressPoint.toString(), noteIndex);
|
|
134
|
-
await this.#notesToScope.set(noteIndex, scope);
|
|
135
|
-
}
|
|
136
|
-
await this.#nullifiedNotes.delete(noteIndex);
|
|
137
|
-
await this.#nullifiedNotesToScope.delete(noteIndex);
|
|
138
|
-
await this.#nullifiersByBlockNumber.deleteValue(dao.l2BlockNumber, dao.siloedNullifier.toString());
|
|
139
|
-
await this.#nullifiedNotesByContract.deleteValue(dao.contractAddress.toString(), noteIndex);
|
|
140
|
-
await this.#nullifiedNotesByStorageSlot.deleteValue(dao.storageSlot.toString(), noteIndex);
|
|
141
|
-
await this.#nullifiedNotesByTxHash.deleteValue(dao.txHash.toString(), noteIndex);
|
|
142
|
-
await this.#nullifiedNotesByAddressPoint.deleteValue(dao.addressPoint.toString(), noteIndex);
|
|
143
|
-
await this.#nullifiedNotesByNullifier.delete(dao.siloedNullifier.toString());
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
async getNotes(filter) {
|
|
148
|
-
const publicKey = filter.owner ? await filter.owner.toAddressPoint() : undefined;
|
|
149
|
-
filter.status = filter.status ?? NoteStatus.ACTIVE;
|
|
150
|
-
const candidateNoteSources = [];
|
|
151
|
-
filter.scopes ??= (await toArray(this.#scopes.keysAsync())).map((addressString)=>AztecAddress.fromString(addressString));
|
|
152
|
-
const activeNoteIdsPerScope = [];
|
|
153
|
-
for (const scope of new Set(filter.scopes)){
|
|
154
|
-
const formattedScopeString = scope.toString();
|
|
155
|
-
if (!await this.#scopes.hasAsync(formattedScopeString)) {
|
|
156
|
-
throw new Error('Trying to get incoming notes of an scope that is not in the PXE database');
|
|
157
|
-
}
|
|
158
|
-
activeNoteIdsPerScope.push(publicKey ? await toArray(this.#notesByAddressPointAndScope.get(formattedScopeString).getValuesAsync(publicKey.toString())) : filter.txHash ? await toArray(this.#notesByTxHashAndScope.get(formattedScopeString).getValuesAsync(filter.txHash.toString())) : filter.contractAddress ? await toArray(this.#notesByContractAndScope.get(formattedScopeString).getValuesAsync(filter.contractAddress.toString())) : filter.storageSlot ? await toArray(this.#notesByStorageSlotAndScope.get(formattedScopeString).getValuesAsync(filter.storageSlot.toString())) : await toArray(this.#notesByAddressPointAndScope.get(formattedScopeString).valuesAsync()));
|
|
159
|
-
}
|
|
160
|
-
candidateNoteSources.push({
|
|
161
|
-
ids: new Set(activeNoteIdsPerScope.flat()),
|
|
162
|
-
notes: this.#notes
|
|
163
|
-
});
|
|
164
|
-
if (filter.status == NoteStatus.ACTIVE_OR_NULLIFIED) {
|
|
165
|
-
candidateNoteSources.push({
|
|
166
|
-
ids: publicKey ? await toArray(this.#nullifiedNotesByAddressPoint.getValuesAsync(publicKey.toString())) : filter.txHash ? await toArray(this.#nullifiedNotesByTxHash.getValuesAsync(filter.txHash.toString())) : filter.contractAddress ? await toArray(this.#nullifiedNotesByContract.getValuesAsync(filter.contractAddress.toString())) : filter.storageSlot ? await toArray(this.#nullifiedNotesByStorageSlot.getValuesAsync(filter.storageSlot.toString())) : await toArray(this.#nullifiedNotes.keysAsync()),
|
|
167
|
-
notes: this.#nullifiedNotes
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
const result = [];
|
|
171
|
-
for (const { ids, notes } of candidateNoteSources){
|
|
172
|
-
for (const id of ids){
|
|
173
|
-
const serializedNote = await notes.getAsync(id);
|
|
174
|
-
if (!serializedNote) {
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
const note = NoteDao.fromBuffer(serializedNote);
|
|
178
|
-
if (filter.contractAddress && !note.contractAddress.equals(filter.contractAddress)) {
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
if (filter.txHash && !note.txHash.equals(filter.txHash)) {
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
if (filter.storageSlot && !note.storageSlot.equals(filter.storageSlot)) {
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
if (publicKey && !note.addressPoint.equals(publicKey)) {
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
if (filter.siloedNullifier && !note.siloedNullifier.equals(filter.siloedNullifier)) {
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
193
|
-
result.push(note);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return result;
|
|
197
|
-
}
|
|
198
|
-
removeNullifiedNotes(nullifiers, accountAddressPoint) {
|
|
199
|
-
if (nullifiers.length === 0) {
|
|
200
|
-
return Promise.resolve([]);
|
|
201
|
-
}
|
|
202
|
-
return this.#store.transactionAsync(async ()=>{
|
|
203
|
-
const nullifiedNotes = [];
|
|
204
|
-
for (const blockScopedNullifier of nullifiers){
|
|
205
|
-
const { data: nullifier, l2BlockNumber: blockNumber } = blockScopedNullifier;
|
|
206
|
-
const noteIndex = await this.#nullifierToNoteId.getAsync(nullifier.toString());
|
|
207
|
-
if (!noteIndex) {
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
const noteBuffer = noteIndex ? await this.#notes.getAsync(noteIndex) : undefined;
|
|
211
|
-
if (!noteBuffer) {
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
const noteScopes = await toArray(this.#notesToScope.getValuesAsync(noteIndex)) ?? [];
|
|
215
|
-
const note = NoteDao.fromBuffer(noteBuffer);
|
|
216
|
-
if (!note.addressPoint.equals(accountAddressPoint)) {
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
nullifiedNotes.push(note);
|
|
220
|
-
await this.#notes.delete(noteIndex);
|
|
221
|
-
await this.#notesToScope.delete(noteIndex);
|
|
222
|
-
const scopes = await toArray(this.#scopes.keysAsync());
|
|
223
|
-
for (const scope of scopes){
|
|
224
|
-
await this.#notesByAddressPointAndScope.get(scope).deleteValue(accountAddressPoint.toString(), noteIndex);
|
|
225
|
-
await this.#notesByTxHashAndScope.get(scope).deleteValue(note.txHash.toString(), noteIndex);
|
|
226
|
-
await this.#notesByContractAndScope.get(scope).deleteValue(note.contractAddress.toString(), noteIndex);
|
|
227
|
-
await this.#notesByStorageSlotAndScope.get(scope).deleteValue(note.storageSlot.toString(), noteIndex);
|
|
228
|
-
}
|
|
229
|
-
if (noteScopes !== undefined) {
|
|
230
|
-
for (const scope of noteScopes){
|
|
231
|
-
await this.#nullifiedNotesToScope.set(noteIndex, scope);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
await this.#nullifiedNotes.set(noteIndex, note.toBuffer());
|
|
235
|
-
await this.#nullifiersByBlockNumber.set(blockNumber, nullifier.toString());
|
|
236
|
-
await this.#nullifiedNotesByContract.set(note.contractAddress.toString(), noteIndex);
|
|
237
|
-
await this.#nullifiedNotesByStorageSlot.set(note.storageSlot.toString(), noteIndex);
|
|
238
|
-
await this.#nullifiedNotesByTxHash.set(note.txHash.toString(), noteIndex);
|
|
239
|
-
await this.#nullifiedNotesByAddressPoint.set(note.addressPoint.toString(), noteIndex);
|
|
240
|
-
await this.#nullifiedNotesByNullifier.set(nullifier.toString(), noteIndex);
|
|
241
|
-
await this.#nullifierToNoteId.delete(nullifier.toString());
|
|
242
|
-
}
|
|
243
|
-
return nullifiedNotes;
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
async getSize() {
|
|
247
|
-
return (await this.getNotes({})).reduce((sum, note)=>sum + note.getSize(), 0);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/sync_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SyncDataProvider } from './sync_data_provider.js';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
|
-
import { BlockHeader } from '@aztec/stdlib/tx';
|
|
3
|
-
import type { DataProvider } from '../data_provider.js';
|
|
4
|
-
export declare class SyncDataProvider implements DataProvider {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(store: AztecAsyncKVStore);
|
|
7
|
-
setHeader(header: BlockHeader): Promise<void>;
|
|
8
|
-
getBlockNumber(): Promise<number | undefined>;
|
|
9
|
-
getBlockHeader(): Promise<BlockHeader>;
|
|
10
|
-
getSize(): Promise<number>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=sync_data_provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/sync_data_provider/sync_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,gBAAiB,YAAW,YAAY;;gBAIvC,KAAK,EAAE,iBAAiB;IAK9B,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAS7C,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAStC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;CAGjC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { BlockHeader } from '@aztec/stdlib/tx';
|
|
2
|
-
export class SyncDataProvider {
|
|
3
|
-
#store;
|
|
4
|
-
#synchronizedHeader;
|
|
5
|
-
constructor(store){
|
|
6
|
-
this.#store = store;
|
|
7
|
-
this.#synchronizedHeader = this.#store.openSingleton('header');
|
|
8
|
-
}
|
|
9
|
-
async setHeader(header) {
|
|
10
|
-
await this.#synchronizedHeader.set(header.toBuffer());
|
|
11
|
-
}
|
|
12
|
-
async getBlockNumber() {
|
|
13
|
-
const headerBuffer = await this.#synchronizedHeader.getAsync();
|
|
14
|
-
if (!headerBuffer) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
return Number(BlockHeader.fromBuffer(headerBuffer).globalVariables.blockNumber.toBigInt());
|
|
18
|
-
}
|
|
19
|
-
async getBlockHeader() {
|
|
20
|
-
const headerBuffer = await this.#synchronizedHeader.getAsync();
|
|
21
|
-
if (!headerBuffer) {
|
|
22
|
-
throw new Error(`Header not set`);
|
|
23
|
-
}
|
|
24
|
-
return BlockHeader.fromBuffer(headerBuffer);
|
|
25
|
-
}
|
|
26
|
-
async getSize() {
|
|
27
|
-
return (await this.#synchronizedHeader.getAsync())?.length ?? 0;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TaggingDataProvider } from './tagging_data_provider.js';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
3
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import type { IndexedTaggingSecret } from '@aztec/stdlib/logs';
|
|
5
|
-
export declare class TaggingDataProvider {
|
|
6
|
-
#private;
|
|
7
|
-
constructor(store: AztecAsyncKVStore);
|
|
8
|
-
setTaggingSecretsIndexesAsSender(indexedSecrets: IndexedTaggingSecret[]): Promise<void>;
|
|
9
|
-
setTaggingSecretsIndexesAsRecipient(indexedSecrets: IndexedTaggingSecret[]): Promise<void>;
|
|
10
|
-
getTaggingSecretsIndexesAsRecipient(appTaggingSecrets: Fr[]): Promise<number[]>;
|
|
11
|
-
getTaggingSecretsIndexesAsSender(appTaggingSecrets: Fr[]): Promise<number[]>;
|
|
12
|
-
resetNoteSyncData(): Promise<void>;
|
|
13
|
-
addSenderAddress(address: AztecAddress): Promise<boolean>;
|
|
14
|
-
getSenderAddresses(): Promise<AztecAddress[]>;
|
|
15
|
-
removeSenderAddress(address: AztecAddress): Promise<boolean>;
|
|
16
|
-
getSize(): Promise<number>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=tagging_data_provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tagging_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_data_provider/tagging_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,qBAAa,mBAAmB;;gBAUlB,KAAK,EAAE,iBAAiB;IAS9B,gCAAgC,CAAC,cAAc,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvF,mCAAmC,CAAC,cAAc,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAY1F,mCAAmC,CAAC,iBAAiB,EAAE,EAAE,EAAE;IAI3D,gCAAgC,CAAC,iBAAiB,EAAE,EAAE,EAAE;IAQ9D,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAS5B,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAUzD,kBAAkB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAI7C,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAU5D,OAAO;CAKd"}
|