@aztec/pxe 0.0.1-fake-ceab37513c → 0.0.6-commit.a2d1860fe9
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/access_scopes.d.ts +9 -0
- package/dest/access_scopes.d.ts.map +1 -0
- package/dest/access_scopes.js +6 -0
- package/dest/bin/check_oracle_version.d.ts +1 -1
- package/dest/bin/check_oracle_version.js +110 -10
- package/dest/block_synchronizer/block_synchronizer.d.ts +45 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
- package/dest/block_synchronizer/block_synchronizer.js +153 -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 +11 -17
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +27 -16
- 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 +79 -27
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +287 -87
- package/dest/contract_function_simulator/execution_note_cache.d.ts +26 -15
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +65 -37
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +16 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +26 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts +2 -2
- package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.d.ts +5 -3
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +3 -2
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +7 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +3 -3
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +8 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +7 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +13 -4
- 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 +2 -2
- package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/index.js +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +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 +2 -2
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +14 -8
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +16 -11
- package/dest/contract_function_simulator/oracle/oracle.d.ts +26 -22
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +156 -113
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -27
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +3 -48
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +72 -52
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +173 -68
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +116 -53
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +217 -94
- package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
- package/dest/contract_function_simulator/pick_notes.js +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
- package/dest/contract_logging.d.ts +22 -0
- package/dest/contract_logging.d.ts.map +1 -0
- package/dest/contract_logging.js +23 -0
- package/dest/contract_sync/contract_sync_service.d.ts +43 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +97 -0
- package/dest/contract_sync/helpers.d.ts +29 -0
- package/dest/contract_sync/helpers.d.ts.map +1 -0
- package/dest/contract_sync/helpers.js +55 -0
- package/dest/debug/pxe_debug_utils.d.ts +45 -0
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
- package/dest/debug/pxe_debug_utils.js +48 -0
- package/dest/entrypoints/client/bundle/index.d.ts +7 -3
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +5 -2
- package/dest/entrypoints/client/bundle/utils.d.ts +9 -9
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +40 -17
- package/dest/entrypoints/client/lazy/index.d.ts +7 -3
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +5 -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 +40 -17
- package/dest/entrypoints/pxe_creation_options.d.ts +7 -3
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +9 -3
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +7 -2
- package/dest/entrypoints/server/utils.d.ts +5 -24
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +42 -51
- package/dest/error_enriching.d.ts +11 -0
- package/dest/error_enriching.d.ts.map +1 -0
- package/dest/{pxe_service/error_enriching.js → error_enriching.js} +9 -6
- package/dest/events/event_service.d.ts +15 -0
- package/dest/events/event_service.d.ts.map +1 -0
- package/dest/events/event_service.js +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 +29 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +118 -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 +49 -0
- package/dest/notes/note_service.d.ts.map +1 -0
- package/dest/notes/note_service.js +148 -0
- package/dest/notes_filter.d.ts +25 -0
- package/dest/notes_filter.d.ts.map +1 -0
- package/dest/notes_filter.js +4 -0
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +4 -3
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.js +41 -0
- package/dest/private_kernel/hints/index.d.ts +3 -3
- package/dest/private_kernel/hints/index.d.ts.map +1 -1
- package/dest/private_kernel/hints/index.js +2 -2
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
- package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +22 -16
- package/dest/private_kernel/index.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +11 -3
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +48 -43
- package/dest/private_kernel/private_kernel_oracle.d.ts +26 -25
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +94 -2
- package/dest/pxe.d.ts +250 -0
- package/dest/pxe.d.ts.map +1 -0
- package/dest/pxe.js +774 -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/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +10 -13
- 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 +93 -0
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/contract_store/contract_store.js +309 -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_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
- package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +1 -1
- package/dest/storage/index.d.ts +8 -9
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -8
- package/dest/storage/metadata.d.ts +2 -2
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/index.d.ts +3 -0
- package/dest/storage/note_store/index.d.ts.map +1 -0
- package/dest/storage/note_store/index.js +2 -0
- package/dest/storage/note_store/note_store.d.ts +83 -0
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/note_store/note_store.js +343 -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 +60 -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 +30 -23
- package/src/access_scopes.ts +9 -0
- package/src/bin/check_oracle_version.ts +135 -10
- package/src/block_synchronizer/block_synchronizer.ts +178 -0
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +32 -32
- 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 +505 -140
- package/src/contract_function_simulator/execution_note_cache.ts +67 -32
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +32 -0
- package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
- package/src/contract_function_simulator/index.ts +4 -2
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +7 -3
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +10 -5
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +15 -3
- package/src/contract_function_simulator/noir-structs/utility_context.ts +23 -0
- package/src/contract_function_simulator/oracle/index.ts +1 -1
- package/src/contract_function_simulator/oracle/interfaces.ts +185 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +30 -14
- package/src/contract_function_simulator/oracle/oracle.ts +197 -110
- package/src/contract_function_simulator/oracle/private_execution.ts +4 -78
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +248 -122
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +372 -138
- package/src/contract_function_simulator/pick_notes.ts +1 -1
- package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
- package/src/contract_logging.ts +39 -0
- package/src/contract_sync/contract_sync_service.ts +152 -0
- package/src/contract_sync/helpers.ts +98 -0
- package/src/debug/pxe_debug_utils.ts +93 -0
- package/src/entrypoints/client/bundle/index.ts +6 -2
- package/src/entrypoints/client/bundle/utils.ts +31 -32
- package/src/entrypoints/client/lazy/index.ts +6 -2
- package/src/entrypoints/client/lazy/utils.ts +31 -32
- package/src/entrypoints/pxe_creation_options.ts +6 -2
- package/src/entrypoints/server/index.ts +8 -2
- package/src/entrypoints/server/utils.ts +39 -91
- package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +11 -15
- 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 +208 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +196 -0
- package/src/notes_filter.ts +26 -0
- package/src/oracle_version.ts +4 -3
- package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +16 -16
- package/src/private_kernel/hints/index.ts +2 -2
- package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +44 -37
- package/src/private_kernel/private_kernel_execution_prover.ts +64 -55
- package/src/private_kernel/private_kernel_oracle.ts +118 -37
- package/src/pxe.ts +1137 -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 +429 -0
- package/src/storage/contract_store/index.ts +1 -0
- package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +1 -1
- package/src/storage/index.ts +7 -8
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/note_store/note_store.ts +418 -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 +92 -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 -48
- package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -285
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
- package/dest/contract_function_simulator/execution_data_provider.js +0 -14
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +0 -87
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +0 -1
- package/dest/contract_function_simulator/oracle/typed_oracle.js +0 -146
- package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
- package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
- package/dest/contract_function_simulator/proxied_node.js +0 -27
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -158
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -701
- package/dest/contract_function_simulator/tagging_utils.d.ts +0 -17
- package/dest/contract_function_simulator/tagging_utils.d.ts.map +0 -1
- package/dest/contract_function_simulator/tagging_utils.js +0 -23
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +0 -41
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -45
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
- package/dest/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 -101
- package/dest/pxe_service/pxe_service.d.ts.map +0 -1
- package/dest/pxe_service/pxe_service.js +0 -791
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -13
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.d.ts +0 -2
- package/dest/storage/address_data_provider/index.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.js +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -27
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -122
- 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 -75
- 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 -208
- package/dest/storage/contract_data_provider/index.d.ts +0 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/data_provider.d.ts +0 -4
- package/dest/storage/data_provider.d.ts.map +0 -1
- package/dest/storage/data_provider.js +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_dao.d.ts +0 -100
- package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_dao.js +0 -102
- package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -20
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_data_provider.js +0 -260
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -37
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -96
- package/dest/storage/sync_data_provider/index.d.ts +0 -2
- package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
- package/dest/storage/sync_data_provider/index.js +0 -1
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -12
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.d.ts +0 -2
- package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.js +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -18
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -82
- package/dest/synchronizer/index.d.ts +0 -2
- package/dest/synchronizer/index.d.ts.map +0 -1
- package/dest/synchronizer/index.js +0 -1
- package/dest/synchronizer/synchronizer.d.ts +0 -35
- package/dest/synchronizer/synchronizer.d.ts.map +0 -1
- package/dest/synchronizer/synchronizer.js +0 -102
- package/dest/test/pxe_test_suite.d.ts +0 -3
- package/dest/test/pxe_test_suite.d.ts.map +0 -1
- package/dest/test/pxe_test_suite.js +0 -97
- package/src/bin/index.ts +0 -62
- package/src/contract_function_simulator/execution_data_provider.ts +0 -361
- package/src/contract_function_simulator/oracle/typed_oracle.ts +0 -289
- package/src/contract_function_simulator/proxied_node.ts +0 -33
- package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1020
- package/src/contract_function_simulator/tagging_utils.ts +0 -32
- package/src/private_kernel/private_kernel_oracle_impl.ts +0 -132
- package/src/pxe_service/index.ts +0 -2
- package/src/pxe_service/pxe_service.ts +0 -1139
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -157
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/contract_data_provider.ts +0 -300
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/data_provider.ts +0 -3
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/note_data_provider/note_dao.ts +0 -154
- package/src/storage/note_data_provider/note_data_provider.ts +0 -350
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -134
- package/src/storage/sync_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -123
- package/src/synchronizer/index.ts +0 -1
- package/src/synchronizer/synchronizer.ts +0 -121
- package/src/test/pxe_test_suite.ts +0 -113
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
4
|
-
import type { DataProvider } from '../data_provider.js';
|
|
5
|
-
export declare class AddressDataProvider implements DataProvider {
|
|
6
|
-
#private;
|
|
7
|
-
constructor(store: AztecAsyncKVStore);
|
|
8
|
-
addCompleteAddress(completeAddress: CompleteAddress): Promise<boolean>;
|
|
9
|
-
getCompleteAddress(account: AztecAddress): Promise<CompleteAddress | undefined>;
|
|
10
|
-
getCompleteAddresses(): Promise<CompleteAddress[]>;
|
|
11
|
-
getSize(): Promise<number>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=address_data_provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/address_data_provider/address_data_provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,mBAAoB,YAAW,YAAY;;gBAK1C,KAAK,EAAE,iBAAiB;IAOpC,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAsCtE,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAIzE,oBAAoB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAMlD,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;CAGjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/address_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AddressDataProvider } from './address_data_provider.js';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { type Logger } from '@aztec/foundation/log';
|
|
3
|
-
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
4
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import type { DataProvider } from '../data_provider.js';
|
|
6
|
-
export declare class CapsuleDataProvider implements DataProvider {
|
|
7
|
-
#private;
|
|
8
|
-
logger: Logger;
|
|
9
|
-
constructor(store: AztecAsyncKVStore);
|
|
10
|
-
storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[]): Promise<void>;
|
|
11
|
-
loadCapsule(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null>;
|
|
12
|
-
deleteCapsule(contractAddress: AztecAddress, slot: Fr): Promise<void>;
|
|
13
|
-
copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Appends multiple capsules to a capsule array stored at the base slot.
|
|
16
|
-
* The array length is stored at the base slot, and elements are stored in consecutive slots after it.
|
|
17
|
-
* All operations are performed in a single transaction.
|
|
18
|
-
* @param contractAddress - The contract address that owns the capsule array
|
|
19
|
-
* @param baseSlot - The slot where the array length is stored
|
|
20
|
-
* @param content - Array of capsule data to append
|
|
21
|
-
*/
|
|
22
|
-
appendToCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][]): Promise<void>;
|
|
23
|
-
readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr): Promise<Fr[][]>;
|
|
24
|
-
setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][]): Promise<void>;
|
|
25
|
-
getSize(): Promise<number>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=capsule_data_provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capsule_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/capsule_data_provider/capsule_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,mBAAoB,YAAW,YAAY;;IAMtD,MAAM,EAAE,MAAM,CAAC;gBAEH,KAAK,EAAE,iBAAiB;IAQ9B,YAAY,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAInF,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAa1E,aAAa,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BvG;;;;;;;OAOG;IACH,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBjG,gBAAgB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC;IAwB9E,eAAe,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE;IAqB/D,OAAO;CAMrB"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { toArray } from '@aztec/foundation/iterable';
|
|
3
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
-
export class CapsuleDataProvider {
|
|
5
|
-
#store;
|
|
6
|
-
// Arbitrary data stored by contracts. Key is computed as `${contractAddress}:${key}`
|
|
7
|
-
#capsules;
|
|
8
|
-
logger;
|
|
9
|
-
constructor(store){
|
|
10
|
-
this.#store = store;
|
|
11
|
-
this.#capsules = this.#store.openMap('capsules');
|
|
12
|
-
this.logger = createLogger('pxe:capsule-data-provider');
|
|
13
|
-
}
|
|
14
|
-
async storeCapsule(contractAddress, slot, capsule) {
|
|
15
|
-
await this.#capsules.set(dbSlotToKey(contractAddress, slot), Buffer.concat(capsule.map((value)=>value.toBuffer())));
|
|
16
|
-
}
|
|
17
|
-
async loadCapsule(contractAddress, slot) {
|
|
18
|
-
const dataBuffer = await this.#capsules.getAsync(dbSlotToKey(contractAddress, slot));
|
|
19
|
-
if (!dataBuffer) {
|
|
20
|
-
this.logger.trace(`Data not found for contract ${contractAddress.toString()} and slot ${slot.toString()}`);
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const capsule = [];
|
|
24
|
-
for(let i = 0; i < dataBuffer.length; i += Fr.SIZE_IN_BYTES){
|
|
25
|
-
capsule.push(Fr.fromBuffer(dataBuffer.subarray(i, i + Fr.SIZE_IN_BYTES)));
|
|
26
|
-
}
|
|
27
|
-
return capsule;
|
|
28
|
-
}
|
|
29
|
-
async deleteCapsule(contractAddress, slot) {
|
|
30
|
-
await this.#capsules.delete(dbSlotToKey(contractAddress, slot));
|
|
31
|
-
}
|
|
32
|
-
copyCapsule(contractAddress, srcSlot, dstSlot, numEntries) {
|
|
33
|
-
return this.#store.transactionAsync(async ()=>{
|
|
34
|
-
// In order to support overlapping source and destination regions, we need to check the relative positions of source
|
|
35
|
-
// and destination. If destination is ahead of source, then by the time we overwrite source elements using forward
|
|
36
|
-
// indexes we'll have already read those. On the contrary, if source is ahead of destination we need to use backward
|
|
37
|
-
// indexes to avoid reading elements that've been overwritten.
|
|
38
|
-
const indexes = Array.from(Array(numEntries).keys());
|
|
39
|
-
if (srcSlot.lt(dstSlot)) {
|
|
40
|
-
indexes.reverse();
|
|
41
|
-
}
|
|
42
|
-
for (const i of indexes){
|
|
43
|
-
const currentSrcSlot = dbSlotToKey(contractAddress, srcSlot.add(new Fr(i)));
|
|
44
|
-
const currentDstSlot = dbSlotToKey(contractAddress, dstSlot.add(new Fr(i)));
|
|
45
|
-
const toCopy = await this.#capsules.getAsync(currentSrcSlot);
|
|
46
|
-
if (!toCopy) {
|
|
47
|
-
throw new Error(`Attempted to copy empty slot ${currentSrcSlot} for contract ${contractAddress.toString()}`);
|
|
48
|
-
}
|
|
49
|
-
await this.#capsules.set(currentDstSlot, toCopy);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Appends multiple capsules to a capsule array stored at the base slot.
|
|
55
|
-
* The array length is stored at the base slot, and elements are stored in consecutive slots after it.
|
|
56
|
-
* All operations are performed in a single transaction.
|
|
57
|
-
* @param contractAddress - The contract address that owns the capsule array
|
|
58
|
-
* @param baseSlot - The slot where the array length is stored
|
|
59
|
-
* @param content - Array of capsule data to append
|
|
60
|
-
*/ appendToCapsuleArray(contractAddress, baseSlot, content) {
|
|
61
|
-
return this.#store.transactionAsync(async ()=>{
|
|
62
|
-
// Load current length, defaulting to 0 if not found
|
|
63
|
-
const lengthData = await this.loadCapsule(contractAddress, baseSlot);
|
|
64
|
-
const currentLength = lengthData ? lengthData[0].toNumber() : 0;
|
|
65
|
-
// Store each capsule at consecutive slots after baseSlot + 1 + currentLength
|
|
66
|
-
for(let i = 0; i < content.length; i++){
|
|
67
|
-
const nextSlot = arraySlot(baseSlot, currentLength + i);
|
|
68
|
-
await this.storeCapsule(contractAddress, nextSlot, content[i]);
|
|
69
|
-
}
|
|
70
|
-
// Update length to include all new capsules
|
|
71
|
-
const newLength = currentLength + content.length;
|
|
72
|
-
await this.storeCapsule(contractAddress, baseSlot, [
|
|
73
|
-
new Fr(newLength)
|
|
74
|
-
]);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
readCapsuleArray(contractAddress, baseSlot) {
|
|
78
|
-
return this.#store.transactionAsync(async ()=>{
|
|
79
|
-
// Load length, defaulting to 0 if not found
|
|
80
|
-
const maybeLength = await this.loadCapsule(contractAddress, baseSlot);
|
|
81
|
-
const length = maybeLength ? maybeLength[0].toBigInt() : 0n;
|
|
82
|
-
const values = [];
|
|
83
|
-
// Read each capsule at consecutive slots after baseSlot
|
|
84
|
-
for(let i = 0; i < length; i++){
|
|
85
|
-
const currentValue = await this.loadCapsule(contractAddress, arraySlot(baseSlot, i));
|
|
86
|
-
if (currentValue == undefined) {
|
|
87
|
-
throw new Error(`Expected non-empty value at capsule array in base slot ${baseSlot} at index ${i} for contract ${contractAddress}`);
|
|
88
|
-
}
|
|
89
|
-
values.push(currentValue);
|
|
90
|
-
}
|
|
91
|
-
return values;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
setCapsuleArray(contractAddress, baseSlot, content) {
|
|
95
|
-
return this.#store.transactionAsync(async ()=>{
|
|
96
|
-
// Load current length, defaulting to 0 if not found
|
|
97
|
-
const maybeLength = await this.loadCapsule(contractAddress, baseSlot);
|
|
98
|
-
const originalLength = maybeLength ? maybeLength[0].toNumber() : 0;
|
|
99
|
-
// Set the new length
|
|
100
|
-
await this.storeCapsule(contractAddress, baseSlot, [
|
|
101
|
-
new Fr(content.length)
|
|
102
|
-
]);
|
|
103
|
-
// Store the new content, possibly overwriting existing values
|
|
104
|
-
for(let i = 0; i < content.length; i++){
|
|
105
|
-
await this.storeCapsule(contractAddress, arraySlot(baseSlot, i), content[i]);
|
|
106
|
-
}
|
|
107
|
-
// Clear any stragglers
|
|
108
|
-
for(let i = content.length; i < originalLength; i++){
|
|
109
|
-
await this.deleteCapsule(contractAddress, arraySlot(baseSlot, i));
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
async getSize() {
|
|
114
|
-
return (await toArray(this.#capsules.valuesAsync())).reduce((sum, value)=>sum + value.length * Fr.SIZE_IN_BYTES, 0);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function dbSlotToKey(contractAddress, slot) {
|
|
118
|
-
return `${contractAddress.toString()}:${slot.toString()}`;
|
|
119
|
-
}
|
|
120
|
-
function arraySlot(baseSlot, index) {
|
|
121
|
-
return baseSlot.add(new Fr(1)).add(new Fr(index));
|
|
122
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/capsule_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CapsuleDataProvider } from './capsule_data_provider.js';
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { MembershipWitness } from '@aztec/foundation/trees';
|
|
3
|
-
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
4
|
-
import { type ContractArtifact, type FunctionAbi, type FunctionArtifact, type FunctionArtifactWithContractName, type FunctionDebugMetadata, FunctionSelector } from '@aztec/stdlib/abi';
|
|
5
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import { type ContractClass, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
7
|
-
import type { DataProvider } from '../data_provider.js';
|
|
8
|
-
/**
|
|
9
|
-
* ContractDataProvider serves as a data manager and retriever for Aztec.nr contracts.
|
|
10
|
-
* It provides methods to obtain contract addresses, function ABI, bytecode, and membership witnesses
|
|
11
|
-
* from a given contract address and function selector. The class maintains a cache of ContractTree instances
|
|
12
|
-
* to efficiently serve the requested data. It interacts with the ContractDatabase and AztecNode to fetch
|
|
13
|
-
* the required information and facilitate cryptographic proof generation.
|
|
14
|
-
*/
|
|
15
|
-
export declare class ContractDataProvider implements DataProvider {
|
|
16
|
-
#private;
|
|
17
|
-
constructor(store: AztecAsyncKVStore);
|
|
18
|
-
addContractArtifact(id: Fr, contract: ContractArtifact): Promise<void>;
|
|
19
|
-
addContractInstance(contract: ContractInstanceWithAddress): Promise<void>;
|
|
20
|
-
getContractsAddresses(): Promise<AztecAddress[]>;
|
|
21
|
-
/** Returns a contract instance for a given address. Throws if not found. */
|
|
22
|
-
getContractInstance(contractAddress: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
23
|
-
getContractArtifact(contractClassId: Fr): Promise<ContractArtifact | undefined>;
|
|
24
|
-
/** Returns a contract class for a given class id. Throws if not found. */
|
|
25
|
-
getContractClass(contractClassId: Fr): Promise<ContractClass | undefined>;
|
|
26
|
-
getContract(address: AztecAddress): Promise<(ContractInstanceWithAddress & ContractArtifact) | undefined>;
|
|
27
|
-
/**
|
|
28
|
-
* Retrieves the artifact of a specified function within a given contract.
|
|
29
|
-
* The function is identified by its selector, which is a unique code generated from the function's signature.
|
|
30
|
-
* Throws an error if the contract address or function selector are invalid or not found.
|
|
31
|
-
*
|
|
32
|
-
* @param contractAddress - The AztecAddress representing the contract containing the function.
|
|
33
|
-
* @param selector - The function selector.
|
|
34
|
-
* @returns The corresponding function's artifact as an object.
|
|
35
|
-
*/
|
|
36
|
-
getFunctionArtifact(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionArtifactWithContractName | undefined>;
|
|
37
|
-
getPublicFunctionArtifact(contractAddress: AztecAddress): Promise<FunctionArtifactWithContractName | undefined>;
|
|
38
|
-
/**
|
|
39
|
-
* Retrieves the artifact of a specified function within a given contract.
|
|
40
|
-
* The function is identified by its name, which is unique within a contract.
|
|
41
|
-
* Throws if the contract has not been added to the database.
|
|
42
|
-
*
|
|
43
|
-
* @param contractAddress - The AztecAddress representing the contract containing the function.
|
|
44
|
-
* @param functionName - The name of the function.
|
|
45
|
-
* @returns The corresponding function's artifact as an object
|
|
46
|
-
*/
|
|
47
|
-
getFunctionArtifactByName(contractAddress: AztecAddress, functionName: string): Promise<FunctionArtifact | undefined>;
|
|
48
|
-
getFunctionAbi(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionAbi | undefined>;
|
|
49
|
-
/**
|
|
50
|
-
* Retrieves the debug metadata of a specified function within a given contract.
|
|
51
|
-
* The function is identified by its selector, which is a unique code generated from the function's signature.
|
|
52
|
-
* Returns undefined if the debug metadata for the given function is not found.
|
|
53
|
-
* Throws if the contract has not been added to the database.
|
|
54
|
-
*
|
|
55
|
-
* @param contractAddress - The AztecAddress representing the contract containing the function.
|
|
56
|
-
* @param selector - The function selector.
|
|
57
|
-
* @returns The corresponding function's artifact as an object.
|
|
58
|
-
*/
|
|
59
|
-
getFunctionDebugMetadata(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionDebugMetadata | undefined>;
|
|
60
|
-
getPublicFunctionDebugMetadata(contractAddress: AztecAddress): Promise<FunctionDebugMetadata | undefined>;
|
|
61
|
-
/**
|
|
62
|
-
* Retrieve the function membership witness for the given contract class and function selector.
|
|
63
|
-
* The function membership witness represents a proof that the function belongs to the specified contract.
|
|
64
|
-
* Throws an error if the contract address or function selector is unknown.
|
|
65
|
-
*
|
|
66
|
-
* @param contractClassId - The id of the class.
|
|
67
|
-
* @param selector - The function selector.
|
|
68
|
-
* @returns A promise that resolves with the MembershipWitness instance for the specified contract's function.
|
|
69
|
-
*/
|
|
70
|
-
getFunctionMembershipWitness(contractClassId: Fr, selector: FunctionSelector): Promise<MembershipWitness<5> | undefined>;
|
|
71
|
-
getDebugContractName(contractAddress: AztecAddress): Promise<string | undefined>;
|
|
72
|
-
getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
|
|
73
|
-
getSize(): Promise<number>;
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=contract_data_provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_data_provider/contract_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,gBAAgB,EAKjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAGjC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;;;;;GAMG;AACH,qBAAa,oBAAqB,YAAW,YAAY;;gBAW3C,KAAK,EAAE,iBAAiB;IAOvB,mBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB7E,mBAAmB,CAAC,QAAQ,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmDzE,qBAAqB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAKtD,4EAA4E;IAC/D,mBAAmB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC;IAKpG,mBAAmB,CAAC,eAAe,EAAE,EAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAM5F,0EAA0E;IAC7D,gBAAgB,CAAC,eAAe,EAAE,EAAE,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAKzE,WAAW,CACtB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,CAAC,2BAA2B,GAAG,gBAAgB,CAAC,GAAG,SAAS,CAAC;IAYxE;;;;;;;;OAQG;IACU,mBAAmB,CAC9B,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,gCAAgC,GAAG,SAAS,CAAC;IAM3C,yBAAyB,CACpC,eAAe,EAAE,YAAY,GAC5B,OAAO,CAAC,gCAAgC,GAAG,SAAS,CAAC;IAMxD;;;;;;;;OAQG;IACU,yBAAyB,CACpC,eAAe,EAAE,YAAY,EAC7B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAK3B,cAAc,CACzB,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAKnC;;;;;;;;;OASG;IACU,wBAAwB,CACnC,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAMhC,8BAA8B,CACzC,eAAe,EAAE,YAAY,GAC5B,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAM7C;;;;;;;;OAQG;IACU,4BAA4B,CACvC,eAAe,EAAE,EAAE,EACnB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAK/B,oBAAoB,CAAC,eAAe,EAAE,YAAY;IAKlD,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB;IAM9E,OAAO;CAiCrB"}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { toArray } from '@aztec/foundation/iterable';
|
|
2
|
-
import { FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
|
|
3
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import { SerializableContractInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
5
|
-
import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
6
|
-
/**
|
|
7
|
-
* ContractDataProvider serves as a data manager and retriever for Aztec.nr contracts.
|
|
8
|
-
* It provides methods to obtain contract addresses, function ABI, bytecode, and membership witnesses
|
|
9
|
-
* from a given contract address and function selector. The class maintains a cache of ContractTree instances
|
|
10
|
-
* to efficiently serve the requested data. It interacts with the ContractDatabase and AztecNode to fetch
|
|
11
|
-
* the required information and facilitate cryptographic proof generation.
|
|
12
|
-
*/ export class ContractDataProvider {
|
|
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();
|
|
16
|
-
#contractArtifacts;
|
|
17
|
-
#contractInstances;
|
|
18
|
-
constructor(store){
|
|
19
|
-
this.#contractArtifacts = store.openMap('contract_artifacts');
|
|
20
|
-
this.#contractInstances = store.openMap('contracts_instances');
|
|
21
|
-
}
|
|
22
|
-
// Setters
|
|
23
|
-
async addContractArtifact(id, contract) {
|
|
24
|
-
const privateFunctions = contract.functions.filter((functionArtifact)=>functionArtifact.functionType === FunctionType.PRIVATE);
|
|
25
|
-
const privateSelectors = await Promise.all(privateFunctions.map(async (privateFunctionArtifact)=>(await FunctionSelector.fromNameAndParameters(privateFunctionArtifact.name, privateFunctionArtifact.parameters)).toString()));
|
|
26
|
-
if (privateSelectors.length !== new Set(privateSelectors).size) {
|
|
27
|
-
throw new Error('Repeated function selectors of private functions');
|
|
28
|
-
}
|
|
29
|
-
await this.#contractArtifacts.set(id.toString(), contractArtifactToBuffer(contract));
|
|
30
|
-
}
|
|
31
|
-
async addContractInstance(contract) {
|
|
32
|
-
this.#contractClassIdMap.set(contract.address.toString(), contract.currentContractClassId);
|
|
33
|
-
await this.#contractInstances.set(contract.address.toString(), new SerializableContractInstance(contract).toBuffer());
|
|
34
|
-
}
|
|
35
|
-
// Private getters
|
|
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());
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Retrieve or create a ContractTree instance based on the provided class id.
|
|
48
|
-
* If an existing tree with the same class id is found in the cache, it will be returned.
|
|
49
|
-
* Otherwise, a new ContractTree instance will be created using the contract data from the database
|
|
50
|
-
* and added to the cache before returning.
|
|
51
|
-
*
|
|
52
|
-
* @param classId - The class id of the contract for which the ContractTree is required.
|
|
53
|
-
* @returns A ContractTree instance associated with the specified contract address.
|
|
54
|
-
* @throws An Error if the contract is not found in the ContractDatabase.
|
|
55
|
-
*/ async #getPrivateFunctionTreeForClassId(classId) {
|
|
56
|
-
if (!this.#privateFunctionTrees.has(classId.toString())) {
|
|
57
|
-
const artifact = await this.getContractArtifact(classId);
|
|
58
|
-
if (!artifact) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const tree = await PrivateFunctionsTree.create(artifact);
|
|
62
|
-
this.#privateFunctionTrees.set(classId.toString(), tree);
|
|
63
|
-
}
|
|
64
|
-
return this.#privateFunctionTrees.get(classId.toString());
|
|
65
|
-
}
|
|
66
|
-
async #getContractArtifactByAddress(contractAddress) {
|
|
67
|
-
const contractClassId = await this.#getContractClassId(contractAddress);
|
|
68
|
-
return contractClassId && this.getContractArtifact(contractClassId);
|
|
69
|
-
}
|
|
70
|
-
// Public getters
|
|
71
|
-
async getContractsAddresses() {
|
|
72
|
-
const keys = await toArray(this.#contractInstances.keysAsync());
|
|
73
|
-
return keys.map(AztecAddress.fromString);
|
|
74
|
-
}
|
|
75
|
-
/** Returns a contract instance for a given address. Throws if not found. */ async getContractInstance(contractAddress) {
|
|
76
|
-
const contract = await this.#contractInstances.getAsync(contractAddress.toString());
|
|
77
|
-
return contract && SerializableContractInstance.fromBuffer(contract).withAddress(contractAddress);
|
|
78
|
-
}
|
|
79
|
-
async getContractArtifact(contractClassId) {
|
|
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));
|
|
83
|
-
}
|
|
84
|
-
/** Returns a contract class for a given class id. Throws if not found. */ async getContractClass(contractClassId) {
|
|
85
|
-
const artifact = await this.getContractArtifact(contractClassId);
|
|
86
|
-
return artifact && getContractClassFromArtifact(artifact);
|
|
87
|
-
}
|
|
88
|
-
async getContract(address) {
|
|
89
|
-
const instance = await this.getContractInstance(address);
|
|
90
|
-
if (!instance) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const artifact = await this.getContractArtifact(instance.currentContractClassId);
|
|
94
|
-
if (!artifact) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
...instance,
|
|
99
|
-
...artifact
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Retrieves the artifact of a specified function within a given contract.
|
|
104
|
-
* The function is identified by its selector, which is a unique code generated from the function's signature.
|
|
105
|
-
* Throws an error if the contract address or function selector are invalid or not found.
|
|
106
|
-
*
|
|
107
|
-
* @param contractAddress - The AztecAddress representing the contract containing the function.
|
|
108
|
-
* @param selector - The function selector.
|
|
109
|
-
* @returns The corresponding function's artifact as an object.
|
|
110
|
-
*/ async getFunctionArtifact(contractAddress, selector) {
|
|
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
|
-
};
|
|
117
|
-
}
|
|
118
|
-
async getPublicFunctionArtifact(contractAddress) {
|
|
119
|
-
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
120
|
-
const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
|
|
121
|
-
return fnArtifact && {
|
|
122
|
-
...fnArtifact,
|
|
123
|
-
contractName: artifact.name
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Retrieves the artifact of a specified function within a given contract.
|
|
128
|
-
* The function is identified by its name, which is unique within a contract.
|
|
129
|
-
* Throws if the contract has not been added to the database.
|
|
130
|
-
*
|
|
131
|
-
* @param contractAddress - The AztecAddress representing the contract containing the function.
|
|
132
|
-
* @param functionName - The name of the function.
|
|
133
|
-
* @returns The corresponding function's artifact as an object
|
|
134
|
-
*/ async getFunctionArtifactByName(contractAddress, functionName) {
|
|
135
|
-
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
136
|
-
return artifact?.functions.find((fn)=>fn.name === functionName);
|
|
137
|
-
}
|
|
138
|
-
async getFunctionAbi(contractAddress, selector) {
|
|
139
|
-
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
140
|
-
return artifact && await this.#findFunctionAbiBySelector(artifact, selector);
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Retrieves the debug metadata of a specified function within a given contract.
|
|
144
|
-
* The function is identified by its selector, which is a unique code generated from the function's signature.
|
|
145
|
-
* Returns undefined if the debug metadata for the given function is not found.
|
|
146
|
-
* Throws if the contract has not been added to the database.
|
|
147
|
-
*
|
|
148
|
-
* @param contractAddress - The AztecAddress representing the contract containing the function.
|
|
149
|
-
* @param selector - The function selector.
|
|
150
|
-
* @returns The corresponding function's artifact as an object.
|
|
151
|
-
*/ async getFunctionDebugMetadata(contractAddress, selector) {
|
|
152
|
-
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
153
|
-
const fnArtifact = artifact && await this.#findFunctionArtifactBySelector(artifact, selector);
|
|
154
|
-
return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
|
|
155
|
-
}
|
|
156
|
-
async getPublicFunctionDebugMetadata(contractAddress) {
|
|
157
|
-
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
158
|
-
const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
|
|
159
|
-
return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Retrieve the function membership witness for the given contract class and function selector.
|
|
163
|
-
* The function membership witness represents a proof that the function belongs to the specified contract.
|
|
164
|
-
* Throws an error if the contract address or function selector is unknown.
|
|
165
|
-
*
|
|
166
|
-
* @param contractClassId - The id of the class.
|
|
167
|
-
* @param selector - The function selector.
|
|
168
|
-
* @returns A promise that resolves with the MembershipWitness instance for the specified contract's function.
|
|
169
|
-
*/ async getFunctionMembershipWitness(contractClassId, selector) {
|
|
170
|
-
const tree = await this.#getPrivateFunctionTreeForClassId(contractClassId);
|
|
171
|
-
return tree?.getFunctionMembershipWitness(selector);
|
|
172
|
-
}
|
|
173
|
-
async getDebugContractName(contractAddress) {
|
|
174
|
-
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
175
|
-
return artifact?.name;
|
|
176
|
-
}
|
|
177
|
-
async getDebugFunctionName(contractAddress, selector) {
|
|
178
|
-
const artifact = await this.#getContractArtifactByAddress(contractAddress);
|
|
179
|
-
const fnArtifact = artifact && await this.#findFunctionAbiBySelector(artifact, selector);
|
|
180
|
-
return `${artifact?.name ?? contractAddress}:${fnArtifact?.name ?? selector}`;
|
|
181
|
-
}
|
|
182
|
-
async getSize() {
|
|
183
|
-
return (await toArray(this.#contractInstances.valuesAsync())).concat(await toArray(this.#contractArtifacts.valuesAsync())).reduce((sum, value)=>sum + value.length, 0);
|
|
184
|
-
}
|
|
185
|
-
async #findFunctionArtifactBySelector(artifact, selector) {
|
|
186
|
-
const functions = artifact.functions;
|
|
187
|
-
for(let i = 0; i < functions.length; i++){
|
|
188
|
-
const fn = functions[i];
|
|
189
|
-
const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
|
|
190
|
-
if (fnSelector.equals(selector)) {
|
|
191
|
-
return fn;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
async #findFunctionAbiBySelector(artifact, selector) {
|
|
196
|
-
const functions = [
|
|
197
|
-
...artifact.functions,
|
|
198
|
-
...artifact.nonDispatchPublicFunctions ?? []
|
|
199
|
-
];
|
|
200
|
-
for(let i = 0; i < functions.length; i++){
|
|
201
|
-
const fn = functions[i];
|
|
202
|
-
const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
|
|
203
|
-
if (fnSelector.equals(selector)) {
|
|
204
|
-
return fn;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export { ContractDataProvider } from './contract_data_provider.js';
|
|
@@ -1 +0,0 @@
|
|
|
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;WAEM,MAAM,CAAC,QAAQ,EAAE,gBAAgB;IAS9C;;;;;;;;OAQG;IACU,4BAA4B,CACvC,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,iBAAiB,CAAC,OAAO,oBAAoB,CAAC,CAAC;YAiB5C,OAAO;CAMtB"}
|
|
@@ -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,100 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import { Note } from '@aztec/stdlib/note';
|
|
5
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
6
|
-
import type { NoteData } from '../../contract_function_simulator/oracle/typed_oracle.js';
|
|
7
|
-
/**
|
|
8
|
-
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
9
|
-
* information required to use it during execution and manage its state.
|
|
10
|
-
*/
|
|
11
|
-
export declare class NoteDao implements NoteData {
|
|
12
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
13
|
-
note: Note;
|
|
14
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
15
|
-
contractAddress: AztecAddress;
|
|
16
|
-
/**
|
|
17
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
18
|
-
* since contracts typically make queries based on it.
|
|
19
|
-
*/
|
|
20
|
-
storageSlot: Fr;
|
|
21
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
22
|
-
noteNonce: Fr;
|
|
23
|
-
/**
|
|
24
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
25
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
26
|
-
*/
|
|
27
|
-
noteHash: Fr;
|
|
28
|
-
/**
|
|
29
|
-
* The nullifier of the note, siloed by contract address.
|
|
30
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
31
|
-
*/
|
|
32
|
-
siloedNullifier: Fr;
|
|
33
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
34
|
-
* when searching for txEffects.
|
|
35
|
-
*/
|
|
36
|
-
txHash: TxHash;
|
|
37
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
38
|
-
* reorgs.*/
|
|
39
|
-
l2BlockNumber: number;
|
|
40
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
41
|
-
* reorgs.*/
|
|
42
|
-
l2BlockHash: string;
|
|
43
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
44
|
-
index: bigint;
|
|
45
|
-
/**
|
|
46
|
-
* The address whose public key was used to encrypt the note log during delivery.
|
|
47
|
-
* (This is the x-coordinate of the public key.)
|
|
48
|
-
*/
|
|
49
|
-
recipient: AztecAddress;
|
|
50
|
-
constructor(
|
|
51
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
52
|
-
note: Note,
|
|
53
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
54
|
-
contractAddress: AztecAddress,
|
|
55
|
-
/**
|
|
56
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
57
|
-
* since contracts typically make queries based on it.
|
|
58
|
-
*/
|
|
59
|
-
storageSlot: Fr,
|
|
60
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
61
|
-
noteNonce: Fr,
|
|
62
|
-
/**
|
|
63
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
64
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
65
|
-
*/
|
|
66
|
-
noteHash: Fr,
|
|
67
|
-
/**
|
|
68
|
-
* The nullifier of the note, siloed by contract address.
|
|
69
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
70
|
-
*/
|
|
71
|
-
siloedNullifier: Fr,
|
|
72
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
73
|
-
* when searching for txEffects.
|
|
74
|
-
*/
|
|
75
|
-
txHash: TxHash,
|
|
76
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
77
|
-
* reorgs.*/
|
|
78
|
-
l2BlockNumber: number,
|
|
79
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
80
|
-
* reorgs.*/
|
|
81
|
-
l2BlockHash: string,
|
|
82
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
83
|
-
index: bigint,
|
|
84
|
-
/**
|
|
85
|
-
* The address whose public key was used to encrypt the note log during delivery.
|
|
86
|
-
* (This is the x-coordinate of the public key.)
|
|
87
|
-
*/
|
|
88
|
-
recipient: AztecAddress);
|
|
89
|
-
toBuffer(): Buffer;
|
|
90
|
-
static fromBuffer(buffer: Buffer | BufferReader): NoteDao;
|
|
91
|
-
toString(): string;
|
|
92
|
-
static fromString(str: string): NoteDao;
|
|
93
|
-
/**
|
|
94
|
-
* Returns the size in bytes of the Note Dao.
|
|
95
|
-
* @returns - Its size in bytes.
|
|
96
|
-
*/
|
|
97
|
-
getSize(): number;
|
|
98
|
-
static random({ note, contractAddress, storageSlot, noteNonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, recipient, }?: Partial<NoteDao>): Promise<NoteDao>;
|
|
99
|
-
}
|
|
100
|
-
//# 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,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0DAA0D,CAAC;AAEzF;;;GAGG;AACH,qBAAa,OAAQ,YAAW,QAAQ;IAIpC,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;OAGG;IACI,WAAW,EAAE,EAAE;IACtB,gGAAgG;IACzF,SAAS,EAAE,EAAE;IAGpB;;;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;;;OAGG;IACI,SAAS,EAAE,YAAY;;IAzC9B,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;OAGG;IACI,WAAW,EAAE,EAAE;IACtB,gGAAgG;IACzF,SAAS,EAAE,EAAE;IAGpB;;;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;;;OAGG;IACI,SAAS,EAAE,YAAY;IAGhC,QAAQ,IAAI,MAAM;IAgBlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IA8B/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAK7B;;;OAGG;IACI,OAAO;WAMD,MAAM,CAAC,EAClB,IAAoB,EACpB,eAA2B,EAC3B,WAAyB,EACzB,SAAuB,EACvB,QAAsB,EACtB,eAA6B,EAC7B,MAAwB,EACxB,aAAgD,EAChD,WAAoC,EACpC,KAA8B,EAC9B,SAAqB,GACtB,GAAE,OAAO,CAAC,OAAO,CAAM;CAezB"}
|