@aztec/pxe 0.0.1-commit.9b94fc1 → 0.0.1-commit.9ee6fcc6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/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.js +105 -15
- 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 +7 -5
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +18 -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 -24
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +246 -79
- package/dest/contract_function_simulator/execution_note_cache.d.ts +21 -11
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +49 -31
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +7 -7
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +19 -11
- 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 +3 -2
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +2 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +6 -6
- 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 +11 -7
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +2 -4
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.js +57 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +6 -7
- 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 +9 -8
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +62 -50
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +9 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +42 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +4 -2
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +11 -7
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +14 -10
- package/dest/contract_function_simulator/oracle/oracle.d.ts +45 -42
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +222 -118
- 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 +6 -40
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +66 -82
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +129 -118
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +149 -55
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +290 -104
- 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 +45 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +114 -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 +4 -2
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +3 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +32 -9
- package/dest/entrypoints/client/lazy/index.d.ts +4 -2
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +3 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +33 -10
- 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 +6 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +5 -1
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +39 -16
- package/dest/error_enriching.d.ts +4 -4
- package/dest/error_enriching.d.ts.map +1 -1
- package/dest/error_enriching.js +6 -6
- package/dest/events/event_service.d.ts +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/messages/message_context_service.d.ts +17 -0
- package/dest/messages/message_context_service.d.ts.map +1 -0
- package/dest/messages/message_context_service.js +36 -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 +5 -4
- 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_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
- 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 +29 -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} +141 -74
- package/dest/private_kernel/hints/test_utils.d.ts +122 -0
- package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
- package/dest/private_kernel/hints/test_utils.js +203 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +28 -21
- 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 +117 -103
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +283 -262
- 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 -12
- 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 -10
- package/dest/storage/{sync_data_provider → anchor_block_store}/index.d.ts +2 -2
- package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/index.js +1 -0
- package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_store.js +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 -8
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -7
- package/dest/storage/metadata.d.ts +1 -1
- 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 +78 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_tagging_store.js +374 -0
- package/dest/tagging/constants.d.ts +2 -2
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +10 -2
- package/dest/tagging/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 -7
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +15 -5
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +33 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +17 -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 +80 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +12 -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 +39 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +19 -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 +72 -0
- package/package.json +28 -19
- package/src/access_scopes.ts +9 -0
- package/src/bin/check_oracle_version.ts +131 -20
- package/src/block_synchronizer/block_synchronizer.ts +178 -0
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +18 -4
- 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 +418 -111
- package/src/contract_function_simulator/execution_note_cache.ts +51 -28
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -14
- package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
- package/src/contract_function_simulator/index.ts +2 -1
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +14 -7
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +2 -5
- package/src/contract_function_simulator/noir-structs/message_tx_context.ts +55 -0
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +8 -8
- package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
- package/src/contract_function_simulator/oracle/interfaces.ts +77 -62
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +135 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +27 -13
- package/src/contract_function_simulator/oracle/oracle.ts +254 -162
- package/src/contract_function_simulator/oracle/private_execution.ts +6 -72
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +180 -168
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +457 -115
- 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 +181 -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 +3 -1
- package/src/entrypoints/client/bundle/utils.ts +24 -17
- package/src/entrypoints/client/lazy/index.ts +3 -1
- package/src/entrypoints/client/lazy/utils.ts +25 -18
- package/src/entrypoints/pxe_creation_options.ts +6 -2
- package/src/entrypoints/server/index.ts +5 -1
- package/src/entrypoints/server/utils.ts +33 -41
- package/src/error_enriching.ts +7 -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 +213 -0
- package/src/messages/message_context_service.ts +45 -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 +5 -4
- package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
- 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} +197 -139
- package/src/private_kernel/hints/test_utils.ts +325 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +32 -23
- package/src/private_kernel/private_kernel_oracle.ts +118 -37
- package/src/pxe.ts +443 -354
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +16 -16
- 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 -11
- 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 -7
- 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 +143 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +476 -0
- package/src/tagging/constants.ts +10 -2
- package/src/tagging/get_all_logs_by_tags.ts +92 -0
- package/src/tagging/index.ts +19 -6
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +140 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +44 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +112 -0
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +51 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +85 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -265
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
- package/dest/contract_function_simulator/execution_data_provider.js +0 -14
- package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
- package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
- package/dest/contract_function_simulator/proxied_node.js +0 -27
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -122
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -694
- 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/private_kernel_oracle_impl.d.ts +0 -45
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.d.ts +0 -2
- package/dest/storage/address_data_provider/index.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.js +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -25
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -118
- package/dest/storage/capsule_data_provider/index.d.ts +0 -2
- package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts +0 -64
- 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 -193
- package/dest/storage/contract_data_provider/index.d.ts +0 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -83
- 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 -311
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -37
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -105
- package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
- package/dest/storage/sync_data_provider/index.js +0 -1
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -10
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.d.ts +0 -2
- package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.js +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -40
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -89
- package/dest/synchronizer/index.d.ts +0 -2
- package/dest/synchronizer/index.d.ts.map +0 -1
- package/dest/synchronizer/index.js +0 -1
- package/dest/synchronizer/synchronizer.d.ts +0 -35
- package/dest/synchronizer/synchronizer.d.ts.map +0 -1
- package/dest/synchronizer/synchronizer.js +0 -101
- package/dest/tagging/siloed_tag.d.ts +0 -14
- package/dest/tagging/siloed_tag.d.ts.map +0 -1
- package/dest/tagging/siloed_tag.js +0 -20
- package/dest/tagging/tag.d.ts +0 -12
- package/dest/tagging/tag.d.ts.map +0 -1
- package/dest/tagging/tag.js +0 -17
- package/dest/tagging/utils.d.ts +0 -18
- package/dest/tagging/utils.d.ts.map +0 -1
- package/dest/tagging/utils.js +0 -24
- package/src/contract_function_simulator/execution_data_provider.ts +0 -333
- package/src/contract_function_simulator/proxied_node.ts +0 -33
- package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1008
- package/src/private_kernel/private_kernel_oracle_impl.ts +0 -132
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -147
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/contract_data_provider.ts +0 -277
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/note_data_provider/note_data_provider.ts +0 -399
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -143
- package/src/storage/sync_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -120
- package/src/synchronizer/index.ts +0 -1
- package/src/synchronizer/synchronizer.ts +0 -120
- package/src/tagging/siloed_tag.ts +0 -22
- package/src/tagging/tag.ts +0 -16
- package/src/tagging/utils.ts +0 -31
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { Point } from '@aztec/foundation/curves/grumpkin';
|
|
2
4
|
import {
|
|
3
5
|
type ACIRCallback,
|
|
4
6
|
type ACVMField,
|
|
@@ -10,11 +12,12 @@ import {
|
|
|
10
12
|
} from '@aztec/simulator/client';
|
|
11
13
|
import { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
12
14
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
15
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
13
16
|
import { ContractClassLog, ContractClassLogFields } from '@aztec/stdlib/logs';
|
|
14
|
-
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
15
17
|
|
|
16
18
|
import type { IMiscOracle, IPrivateExecutionOracle, IUtilityExecutionOracle } from './interfaces.js';
|
|
17
|
-
import {
|
|
19
|
+
import { buildLegacyOracleCallbacks } from './legacy_oracle_mappings.js';
|
|
20
|
+
import { packAsHintedNote } from './note_packing_utils.js';
|
|
18
21
|
|
|
19
22
|
export class UnavailableOracleError extends Error {
|
|
20
23
|
constructor(oracleName: string) {
|
|
@@ -67,12 +70,12 @@ export class Oracle {
|
|
|
67
70
|
name => !excludedProps.includes(name as (typeof excludedProps)[number]),
|
|
68
71
|
);
|
|
69
72
|
|
|
70
|
-
// Validate oracle names - these must be prefixed with either "
|
|
73
|
+
// Validate oracle names - these must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate their scope
|
|
71
74
|
// and must correspond to a function on the Oracle class.
|
|
72
75
|
oracleNames.forEach(name => {
|
|
73
|
-
if (!name.startsWith('
|
|
76
|
+
if (!name.startsWith('aztec_prv_') && !name.startsWith('aztec_utl_')) {
|
|
74
77
|
throw new Error(
|
|
75
|
-
`Oracle function "${name}" must be prefixed with either "
|
|
78
|
+
`Oracle function "${name}" must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate its scope`,
|
|
76
79
|
);
|
|
77
80
|
}
|
|
78
81
|
|
|
@@ -83,48 +86,55 @@ export class Oracle {
|
|
|
83
86
|
});
|
|
84
87
|
|
|
85
88
|
// Build callback object and return it
|
|
86
|
-
|
|
89
|
+
const callback = oracleNames.reduce((acc, name) => {
|
|
87
90
|
const method = this[name as keyof Omit<Oracle, (typeof excludedProps)[number]>];
|
|
88
91
|
acc[name] = method.bind(this);
|
|
89
92
|
return acc;
|
|
90
93
|
}, {} as ACIRCallback);
|
|
94
|
+
|
|
95
|
+
return { ...callback, ...buildLegacyOracleCallbacks(this) };
|
|
91
96
|
}
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
// eslint-disable-next-line camelcase
|
|
99
|
+
aztec_utl_assertCompatibleOracleVersion([version]: ACVMField[]) {
|
|
100
|
+
this.handlerAsMisc().assertCompatibleOracleVersion(Fr.fromString(version).toNumber());
|
|
95
101
|
return Promise.resolve([]);
|
|
96
102
|
}
|
|
97
103
|
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
// eslint-disable-next-line camelcase
|
|
105
|
+
aztec_utl_getRandomField(): Promise<ACVMField[]> {
|
|
106
|
+
const val = this.handlerAsMisc().getRandomField();
|
|
100
107
|
return Promise.resolve([toACVMField(val)]);
|
|
101
108
|
}
|
|
102
109
|
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
// eslint-disable-next-line camelcase
|
|
111
|
+
aztec_prv_storeInExecutionCache(values: ACVMField[], [hash]: ACVMField[]): Promise<ACVMField[]> {
|
|
112
|
+
this.handlerAsPrivate().storeInExecutionCache(values.map(Fr.fromString), Fr.fromString(hash));
|
|
105
113
|
return Promise.resolve([]);
|
|
106
114
|
}
|
|
107
115
|
|
|
108
|
-
|
|
109
|
-
|
|
116
|
+
// eslint-disable-next-line camelcase
|
|
117
|
+
async aztec_prv_loadFromExecutionCache([returnsHash]: ACVMField[]): Promise<ACVMField[][]> {
|
|
118
|
+
const values = await this.handlerAsPrivate().loadFromExecutionCache(Fr.fromString(returnsHash));
|
|
110
119
|
return [values.map(toACVMField)];
|
|
111
120
|
}
|
|
112
121
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
// eslint-disable-next-line camelcase
|
|
123
|
+
aztec_utl_getUtilityContext(): Promise<(ACVMField | ACVMField[])[]> {
|
|
124
|
+
const context = this.handlerAsUtility().getUtilityContext();
|
|
125
|
+
return Promise.resolve(context.toNoirRepresentation());
|
|
116
126
|
}
|
|
117
127
|
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
// eslint-disable-next-line camelcase
|
|
129
|
+
async aztec_utl_getKeyValidationRequest([pkMHash]: ACVMField[]): Promise<ACVMField[]> {
|
|
130
|
+
const keyValidationRequest = await this.handlerAsUtility().getKeyValidationRequest(Fr.fromString(pkMHash));
|
|
120
131
|
|
|
121
132
|
return keyValidationRequest.toFields().map(toACVMField);
|
|
122
133
|
}
|
|
123
134
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
);
|
|
135
|
+
// eslint-disable-next-line camelcase
|
|
136
|
+
async aztec_utl_getContractInstance([address]: ACVMField[]): Promise<ACVMField[]> {
|
|
137
|
+
const instance = await this.handlerAsUtility().getContractInstance(AztecAddress.fromField(Fr.fromString(address)));
|
|
128
138
|
|
|
129
139
|
return [
|
|
130
140
|
instance.salt,
|
|
@@ -135,106 +145,132 @@ export class Oracle {
|
|
|
135
145
|
].map(toACVMField);
|
|
136
146
|
}
|
|
137
147
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
[
|
|
141
|
-
[
|
|
148
|
+
// eslint-disable-next-line camelcase
|
|
149
|
+
async aztec_utl_getNoteHashMembershipWitness(
|
|
150
|
+
[anchorBlockHash]: ACVMField[],
|
|
151
|
+
[noteHash]: ACVMField[],
|
|
142
152
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
const parsedLeafValue = Fr.fromString(leafValue);
|
|
153
|
+
const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
|
|
154
|
+
const parsedNoteHash = Fr.fromString(noteHash);
|
|
146
155
|
|
|
147
|
-
const witness = await this.handlerAsUtility().
|
|
148
|
-
parsedBlockNumber,
|
|
149
|
-
parsedTreeId,
|
|
150
|
-
parsedLeafValue,
|
|
151
|
-
);
|
|
156
|
+
const witness = await this.handlerAsUtility().getNoteHashMembershipWitness(parsedAnchorBlockHash, parsedNoteHash);
|
|
152
157
|
if (!witness) {
|
|
153
158
|
throw new Error(
|
|
154
|
-
`
|
|
159
|
+
`Note hash ${noteHash} not found in the note hash tree at anchor block hash ${parsedAnchorBlockHash.toString()}.`,
|
|
155
160
|
);
|
|
156
161
|
}
|
|
157
|
-
return
|
|
162
|
+
return witness.toNoirRepresentation();
|
|
158
163
|
}
|
|
159
164
|
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
// eslint-disable-next-line camelcase
|
|
166
|
+
async aztec_utl_getBlockHashMembershipWitness(
|
|
167
|
+
[anchorBlockHash]: ACVMField[],
|
|
168
|
+
[blockHash]: ACVMField[],
|
|
169
|
+
): Promise<(ACVMField | ACVMField[])[]> {
|
|
170
|
+
const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
|
|
171
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
172
|
+
|
|
173
|
+
const witness = await this.handlerAsUtility().getBlockHashMembershipWitness(parsedAnchorBlockHash, parsedBlockHash);
|
|
174
|
+
if (!witness) {
|
|
175
|
+
throw new Error(
|
|
176
|
+
`Block hash ${parsedBlockHash.toString()} not found in the archive tree at anchor block ${parsedAnchorBlockHash.toString()}.`,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
return witness.toNoirRepresentation();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// eslint-disable-next-line camelcase
|
|
183
|
+
async aztec_utl_getNullifierMembershipWitness(
|
|
184
|
+
[blockHash]: ACVMField[],
|
|
162
185
|
[nullifier]: ACVMField[], // nullifier, we try to find the witness for (to prove inclusion)
|
|
163
186
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
164
|
-
const
|
|
187
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
165
188
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
166
189
|
|
|
167
|
-
const witness = await this.handlerAsUtility().
|
|
168
|
-
parsedBlockNumber,
|
|
169
|
-
parsedNullifier,
|
|
170
|
-
);
|
|
190
|
+
const witness = await this.handlerAsUtility().getNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
171
191
|
if (!witness) {
|
|
172
|
-
throw new Error(
|
|
192
|
+
throw new Error(
|
|
193
|
+
`Nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
|
|
194
|
+
);
|
|
173
195
|
}
|
|
174
196
|
return witness.toNoirRepresentation();
|
|
175
197
|
}
|
|
176
198
|
|
|
177
|
-
|
|
178
|
-
|
|
199
|
+
// eslint-disable-next-line camelcase
|
|
200
|
+
async aztec_utl_getLowNullifierMembershipWitness(
|
|
201
|
+
[blockHash]: ACVMField[],
|
|
179
202
|
[nullifier]: ACVMField[], // nullifier, we try to find the low nullifier witness for (to prove non-inclusion)
|
|
180
203
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
181
|
-
const
|
|
204
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
182
205
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
183
206
|
|
|
184
|
-
const witness = await this.handlerAsUtility().
|
|
185
|
-
parsedBlockNumber,
|
|
186
|
-
parsedNullifier,
|
|
187
|
-
);
|
|
207
|
+
const witness = await this.handlerAsUtility().getLowNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
188
208
|
if (!witness) {
|
|
189
209
|
throw new Error(
|
|
190
|
-
`Low nullifier witness not found for nullifier ${parsedNullifier} at block ${
|
|
210
|
+
`Low nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
|
|
191
211
|
);
|
|
192
212
|
}
|
|
193
213
|
return witness.toNoirRepresentation();
|
|
194
214
|
}
|
|
195
215
|
|
|
196
|
-
|
|
197
|
-
|
|
216
|
+
// eslint-disable-next-line camelcase
|
|
217
|
+
async aztec_utl_getPublicDataWitness(
|
|
218
|
+
[blockHash]: ACVMField[],
|
|
198
219
|
[leafSlot]: ACVMField[],
|
|
199
220
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
200
|
-
const
|
|
221
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
201
222
|
const parsedLeafSlot = Fr.fromString(leafSlot);
|
|
202
223
|
|
|
203
|
-
const witness = await this.handlerAsUtility().
|
|
224
|
+
const witness = await this.handlerAsUtility().getPublicDataWitness(parsedBlockHash, parsedLeafSlot);
|
|
204
225
|
if (!witness) {
|
|
205
|
-
throw new Error(
|
|
226
|
+
throw new Error(
|
|
227
|
+
`Public data witness not found for slot ${parsedLeafSlot} at block hash ${parsedBlockHash.toString()}.`,
|
|
228
|
+
);
|
|
206
229
|
}
|
|
207
230
|
return witness.toNoirRepresentation();
|
|
208
231
|
}
|
|
209
232
|
|
|
210
|
-
|
|
233
|
+
// eslint-disable-next-line camelcase
|
|
234
|
+
async aztec_utl_getBlockHeader([blockNumber]: ACVMField[]): Promise<ACVMField[]> {
|
|
211
235
|
const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
|
|
212
236
|
|
|
213
|
-
const header = await this.handlerAsUtility().
|
|
237
|
+
const header = await this.handlerAsUtility().getBlockHeader(BlockNumber(parsedBlockNumber));
|
|
214
238
|
if (!header) {
|
|
215
239
|
throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
|
|
216
240
|
}
|
|
217
241
|
return header.toFields().map(toACVMField);
|
|
218
242
|
}
|
|
219
243
|
|
|
220
|
-
|
|
244
|
+
// eslint-disable-next-line camelcase
|
|
245
|
+
async aztec_utl_getAuthWitness([messageHash]: ACVMField[]): Promise<ACVMField[][]> {
|
|
221
246
|
const messageHashField = Fr.fromString(messageHash);
|
|
222
|
-
const witness = await this.handlerAsUtility().
|
|
247
|
+
const witness = await this.handlerAsUtility().getAuthWitness(messageHashField);
|
|
223
248
|
if (!witness) {
|
|
224
249
|
throw new Error(`Unknown auth witness for message hash ${messageHashField}`);
|
|
225
250
|
}
|
|
226
251
|
return [witness.map(toACVMField)];
|
|
227
252
|
}
|
|
228
253
|
|
|
229
|
-
|
|
254
|
+
// eslint-disable-next-line camelcase
|
|
255
|
+
async aztec_utl_tryGetPublicKeysAndPartialAddress([address]: ACVMField[]): Promise<(ACVMField | ACVMField[])[]> {
|
|
230
256
|
const parsedAddress = AztecAddress.fromField(Fr.fromString(address));
|
|
231
|
-
const
|
|
232
|
-
await this.handlerAsUtility().utilityGetPublicKeysAndPartialAddress(parsedAddress);
|
|
257
|
+
const result = await this.handlerAsUtility().tryGetPublicKeysAndPartialAddress(parsedAddress);
|
|
233
258
|
|
|
234
|
-
return
|
|
259
|
+
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
260
|
+
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
261
|
+
if (result === undefined) {
|
|
262
|
+
// No data was found so we set `some` to 0 and pad `value` with zeros get the correct return size.
|
|
263
|
+
return [toACVMField(0), Array(13).fill(toACVMField(0))];
|
|
264
|
+
} else {
|
|
265
|
+
// Data was found so we set `some` to 1 and return it along with `value`.
|
|
266
|
+
return [toACVMField(1), [...result.publicKeys.toFields(), result.partialAddress].map(toACVMField)];
|
|
267
|
+
}
|
|
235
268
|
}
|
|
236
269
|
|
|
237
|
-
|
|
270
|
+
// eslint-disable-next-line camelcase
|
|
271
|
+
async aztec_utl_getNotes(
|
|
272
|
+
[ownerSome]: ACVMField[],
|
|
273
|
+
[ownerValue]: ACVMField[],
|
|
238
274
|
[storageSlot]: ACVMField[],
|
|
239
275
|
[numSelects]: ACVMField[],
|
|
240
276
|
selectByIndexes: ACVMField[],
|
|
@@ -250,9 +286,12 @@ export class Oracle {
|
|
|
250
286
|
[offset]: ACVMField[],
|
|
251
287
|
[status]: ACVMField[],
|
|
252
288
|
[maxNotes]: ACVMField[],
|
|
253
|
-
[
|
|
289
|
+
[packedHintedNoteLength]: ACVMField[],
|
|
254
290
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
255
|
-
|
|
291
|
+
// Parse Option<AztecAddress>: ownerSome is 0 for None, 1 for Some
|
|
292
|
+
const owner = Fr.fromString(ownerSome).toNumber() === 1 ? AztecAddress.fromString(ownerValue) : undefined;
|
|
293
|
+
const noteDatas = await this.handlerAsUtility().getNotes(
|
|
294
|
+
owner,
|
|
256
295
|
Fr.fromString(storageSlot),
|
|
257
296
|
+numSelects,
|
|
258
297
|
selectByIndexes.map(s => +s),
|
|
@@ -269,18 +308,30 @@ export class Oracle {
|
|
|
269
308
|
+status,
|
|
270
309
|
);
|
|
271
310
|
|
|
272
|
-
const
|
|
311
|
+
const returnDataAsArrayOfPackedHintedNotes = noteDatas.map(noteData =>
|
|
312
|
+
packAsHintedNote({
|
|
313
|
+
contractAddress: noteData.contractAddress,
|
|
314
|
+
owner: noteData.owner,
|
|
315
|
+
randomness: noteData.randomness,
|
|
316
|
+
storageSlot: noteData.storageSlot,
|
|
317
|
+
noteNonce: noteData.noteNonce,
|
|
318
|
+
isPending: noteData.isPending,
|
|
319
|
+
note: noteData.note,
|
|
320
|
+
}),
|
|
321
|
+
);
|
|
273
322
|
|
|
274
323
|
// Now we convert each sub-array to an array of ACVMField
|
|
275
|
-
const returnDataAsArrayOfACVMFieldArrays =
|
|
324
|
+
const returnDataAsArrayOfACVMFieldArrays = returnDataAsArrayOfPackedHintedNotes.map(subArray =>
|
|
276
325
|
subArray.map(toACVMField),
|
|
277
326
|
);
|
|
278
327
|
|
|
279
328
|
// At last we convert the array of arrays to a bounded vec of arrays
|
|
280
|
-
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +
|
|
329
|
+
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedHintedNoteLength);
|
|
281
330
|
}
|
|
282
331
|
|
|
283
|
-
|
|
332
|
+
// eslint-disable-next-line camelcase
|
|
333
|
+
aztec_prv_notifyCreatedNote(
|
|
334
|
+
[owner]: ACVMField[],
|
|
284
335
|
[storageSlot]: ACVMField[],
|
|
285
336
|
[randomness]: ACVMField[],
|
|
286
337
|
[noteTypeId]: ACVMField[],
|
|
@@ -288,7 +339,8 @@ export class Oracle {
|
|
|
288
339
|
[noteHash]: ACVMField[],
|
|
289
340
|
[counter]: ACVMField[],
|
|
290
341
|
): Promise<ACVMField[]> {
|
|
291
|
-
this.handlerAsPrivate().
|
|
342
|
+
this.handlerAsPrivate().notifyCreatedNote(
|
|
343
|
+
AztecAddress.fromString(owner),
|
|
292
344
|
Fr.fromString(storageSlot),
|
|
293
345
|
Fr.fromString(randomness),
|
|
294
346
|
NoteSelector.fromField(Fr.fromString(noteTypeId)),
|
|
@@ -299,35 +351,47 @@ export class Oracle {
|
|
|
299
351
|
return Promise.resolve([]);
|
|
300
352
|
}
|
|
301
353
|
|
|
302
|
-
|
|
354
|
+
// eslint-disable-next-line camelcase
|
|
355
|
+
async aztec_prv_notifyNullifiedNote(
|
|
303
356
|
[innerNullifier]: ACVMField[],
|
|
304
357
|
[noteHash]: ACVMField[],
|
|
305
358
|
[counter]: ACVMField[],
|
|
306
359
|
): Promise<ACVMField[]> {
|
|
307
|
-
await this.handlerAsPrivate().
|
|
308
|
-
Fr.fromString(innerNullifier),
|
|
309
|
-
Fr.fromString(noteHash),
|
|
310
|
-
+counter,
|
|
311
|
-
);
|
|
360
|
+
await this.handlerAsPrivate().notifyNullifiedNote(Fr.fromString(innerNullifier), Fr.fromString(noteHash), +counter);
|
|
312
361
|
return [];
|
|
313
362
|
}
|
|
314
363
|
|
|
315
|
-
|
|
316
|
-
|
|
364
|
+
// eslint-disable-next-line camelcase
|
|
365
|
+
async aztec_prv_notifyCreatedNullifier([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
|
|
366
|
+
await this.handlerAsPrivate().notifyCreatedNullifier(Fr.fromString(innerNullifier));
|
|
317
367
|
return [];
|
|
318
368
|
}
|
|
319
369
|
|
|
320
|
-
|
|
321
|
-
|
|
370
|
+
// eslint-disable-next-line camelcase
|
|
371
|
+
async aztec_prv_isNullifierPending(
|
|
372
|
+
[innerNullifier]: ACVMField[],
|
|
373
|
+
[contractAddress]: ACVMField[],
|
|
374
|
+
): Promise<ACVMField[]> {
|
|
375
|
+
const isPending = await this.handlerAsPrivate().isNullifierPending(
|
|
376
|
+
Fr.fromString(innerNullifier),
|
|
377
|
+
AztecAddress.fromString(contractAddress),
|
|
378
|
+
);
|
|
379
|
+
return [toACVMField(isPending)];
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// eslint-disable-next-line camelcase
|
|
383
|
+
async aztec_utl_checkNullifierExists([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
|
|
384
|
+
const exists = await this.handlerAsUtility().checkNullifierExists(Fr.fromString(innerNullifier));
|
|
322
385
|
return [toACVMField(exists)];
|
|
323
386
|
}
|
|
324
387
|
|
|
325
|
-
|
|
388
|
+
// eslint-disable-next-line camelcase
|
|
389
|
+
async aztec_utl_getL1ToL2MembershipWitness(
|
|
326
390
|
[contractAddress]: ACVMField[],
|
|
327
391
|
[messageHash]: ACVMField[],
|
|
328
392
|
[secret]: ACVMField[],
|
|
329
393
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
330
|
-
const message = await this.handlerAsUtility().
|
|
394
|
+
const message = await this.handlerAsUtility().getL1ToL2MembershipWitness(
|
|
331
395
|
AztecAddress.fromString(contractAddress),
|
|
332
396
|
Fr.fromString(messageHash),
|
|
333
397
|
Fr.fromString(secret),
|
|
@@ -335,22 +399,24 @@ export class Oracle {
|
|
|
335
399
|
return message.toNoirRepresentation();
|
|
336
400
|
}
|
|
337
401
|
|
|
338
|
-
|
|
402
|
+
// eslint-disable-next-line camelcase
|
|
403
|
+
async aztec_utl_storageRead(
|
|
404
|
+
[blockHash]: ACVMField[],
|
|
339
405
|
[contractAddress]: ACVMField[],
|
|
340
406
|
[startStorageSlot]: ACVMField[],
|
|
341
|
-
[blockNumber]: ACVMField[],
|
|
342
407
|
[numberOfElements]: ACVMField[],
|
|
343
408
|
): Promise<ACVMField[][]> {
|
|
344
|
-
const values = await this.handlerAsUtility().
|
|
409
|
+
const values = await this.handlerAsUtility().storageRead(
|
|
410
|
+
BlockHash.fromString(blockHash),
|
|
345
411
|
new AztecAddress(Fr.fromString(contractAddress)),
|
|
346
412
|
Fr.fromString(startStorageSlot),
|
|
347
|
-
+blockNumber,
|
|
348
413
|
+numberOfElements,
|
|
349
414
|
);
|
|
350
415
|
return [values.map(toACVMField)];
|
|
351
416
|
}
|
|
352
417
|
|
|
353
|
-
|
|
418
|
+
// eslint-disable-next-line camelcase
|
|
419
|
+
aztec_prv_notifyCreatedContractClassLog(
|
|
354
420
|
[contractAddress]: ACVMField[],
|
|
355
421
|
message: ACVMField[],
|
|
356
422
|
[length]: ACVMField[],
|
|
@@ -359,11 +425,12 @@ export class Oracle {
|
|
|
359
425
|
const logFields = new ContractClassLogFields(message.map(Fr.fromString));
|
|
360
426
|
const log = new ContractClassLog(new AztecAddress(Fr.fromString(contractAddress)), logFields, +length);
|
|
361
427
|
|
|
362
|
-
this.handlerAsPrivate().
|
|
428
|
+
this.handlerAsPrivate().notifyCreatedContractClassLog(log, +counter);
|
|
363
429
|
return Promise.resolve([]);
|
|
364
430
|
}
|
|
365
431
|
|
|
366
|
-
|
|
432
|
+
// eslint-disable-next-line camelcase
|
|
433
|
+
async aztec_utl_log(
|
|
367
434
|
level: ACVMField[],
|
|
368
435
|
message: ACVMField[],
|
|
369
436
|
_ignoredFieldsSize: ACVMField[],
|
|
@@ -372,20 +439,21 @@ export class Oracle {
|
|
|
372
439
|
const levelFr = Fr.fromString(level[0]);
|
|
373
440
|
const messageStr = message.map(acvmField => String.fromCharCode(Fr.fromString(acvmField).toNumber())).join('');
|
|
374
441
|
const fieldsFr = fields.map(Fr.fromString);
|
|
375
|
-
this.handlerAsMisc().
|
|
376
|
-
return
|
|
442
|
+
await this.handlerAsMisc().log(levelFr.toNumber(), messageStr, fieldsFr);
|
|
443
|
+
return [];
|
|
377
444
|
}
|
|
378
445
|
|
|
379
446
|
// This function's name is directly hardcoded in `circuit_recorder.ts`. Don't forget to update it there if you
|
|
380
447
|
// change the name here.
|
|
381
|
-
|
|
448
|
+
// eslint-disable-next-line camelcase
|
|
449
|
+
async aztec_prv_callPrivateFunction(
|
|
382
450
|
[contractAddress]: ACVMField[],
|
|
383
451
|
[functionSelector]: ACVMField[],
|
|
384
452
|
[argsHash]: ACVMField[],
|
|
385
453
|
[sideEffectCounter]: ACVMField[],
|
|
386
454
|
[isStaticCall]: ACVMField[],
|
|
387
455
|
): Promise<ACVMField[][]> {
|
|
388
|
-
const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().
|
|
456
|
+
const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().callPrivateFunction(
|
|
389
457
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
390
458
|
FunctionSelector.fromField(Fr.fromString(functionSelector)),
|
|
391
459
|
Fr.fromString(argsHash),
|
|
@@ -395,85 +463,65 @@ export class Oracle {
|
|
|
395
463
|
return [[endSideEffectCounter, returnsHash].map(toACVMField)];
|
|
396
464
|
}
|
|
397
465
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
[sideEffectCounter]: ACVMField[],
|
|
402
|
-
[isStaticCall]: ACVMField[],
|
|
403
|
-
): Promise<ACVMField[]> {
|
|
404
|
-
await this.handlerAsPrivate().privateNotifyEnqueuedPublicFunctionCall(
|
|
405
|
-
AztecAddress.fromString(contractAddress),
|
|
406
|
-
Fr.fromString(calldataHash),
|
|
407
|
-
Fr.fromString(sideEffectCounter).toNumber(),
|
|
408
|
-
Fr.fromString(isStaticCall).toBool(),
|
|
409
|
-
);
|
|
466
|
+
// eslint-disable-next-line camelcase
|
|
467
|
+
async aztec_prv_validatePublicCalldata([calldataHash]: ACVMField[]): Promise<ACVMField[]> {
|
|
468
|
+
await this.handlerAsPrivate().validatePublicCalldata(Fr.fromString(calldataHash));
|
|
410
469
|
return [];
|
|
411
470
|
}
|
|
412
471
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
[sideEffectCounter]: ACVMField[],
|
|
417
|
-
[isStaticCall]: ACVMField[],
|
|
418
|
-
): Promise<ACVMField[]> {
|
|
419
|
-
await this.handlerAsPrivate().privateNotifySetPublicTeardownFunctionCall(
|
|
420
|
-
AztecAddress.fromString(contractAddress),
|
|
421
|
-
Fr.fromString(calldataHash),
|
|
422
|
-
Fr.fromString(sideEffectCounter).toNumber(),
|
|
423
|
-
Fr.fromString(isStaticCall).toBool(),
|
|
424
|
-
);
|
|
425
|
-
return [];
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
async privateNotifySetMinRevertibleSideEffectCounter([minRevertibleSideEffectCounter]: ACVMField[]): Promise<
|
|
429
|
-
ACVMField[]
|
|
430
|
-
> {
|
|
431
|
-
await this.handlerAsPrivate().privateNotifySetMinRevertibleSideEffectCounter(
|
|
432
|
-
Fr.fromString(minRevertibleSideEffectCounter).toNumber(),
|
|
433
|
-
);
|
|
472
|
+
// eslint-disable-next-line camelcase
|
|
473
|
+
async aztec_prv_notifyRevertiblePhaseStart([minRevertibleSideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
|
|
474
|
+
await this.handlerAsPrivate().notifyRevertiblePhaseStart(Fr.fromString(minRevertibleSideEffectCounter).toNumber());
|
|
434
475
|
return Promise.resolve([]);
|
|
435
476
|
}
|
|
436
477
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
);
|
|
478
|
+
// eslint-disable-next-line camelcase
|
|
479
|
+
async aztec_prv_inRevertiblePhase([sideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
|
|
480
|
+
const isRevertible = await this.handlerAsPrivate().inRevertiblePhase(Fr.fromString(sideEffectCounter).toNumber());
|
|
441
481
|
return Promise.resolve([toACVMField(isRevertible)]);
|
|
442
482
|
}
|
|
443
483
|
|
|
444
|
-
|
|
445
|
-
|
|
484
|
+
// eslint-disable-next-line camelcase
|
|
485
|
+
async aztec_prv_getNextAppTagAsSender([sender]: ACVMField[], [recipient]: ACVMField[]): Promise<ACVMField[]> {
|
|
486
|
+
const tag = await this.handlerAsPrivate().getNextAppTagAsSender(
|
|
446
487
|
AztecAddress.fromString(sender),
|
|
447
488
|
AztecAddress.fromString(recipient),
|
|
448
489
|
);
|
|
449
490
|
return [toACVMField(tag.value)];
|
|
450
491
|
}
|
|
451
492
|
|
|
452
|
-
|
|
453
|
-
|
|
493
|
+
// eslint-disable-next-line camelcase
|
|
494
|
+
async aztec_utl_fetchTaggedLogs([pendingTaggedLogArrayBaseSlot]: ACVMField[]): Promise<ACVMField[]> {
|
|
495
|
+
await this.handlerAsUtility().fetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
|
|
454
496
|
return [];
|
|
455
497
|
}
|
|
456
498
|
|
|
457
|
-
|
|
499
|
+
// eslint-disable-next-line camelcase
|
|
500
|
+
async aztec_utl_validateAndStoreEnqueuedNotesAndEvents(
|
|
458
501
|
[contractAddress]: ACVMField[],
|
|
459
502
|
[noteValidationRequestsArrayBaseSlot]: ACVMField[],
|
|
460
503
|
[eventValidationRequestsArrayBaseSlot]: ACVMField[],
|
|
504
|
+
[maxNotePackedLen]: ACVMField[],
|
|
505
|
+
[maxEventSerializedLen]: ACVMField[],
|
|
461
506
|
): Promise<ACVMField[]> {
|
|
462
|
-
await this.handlerAsUtility().
|
|
507
|
+
await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEvents(
|
|
463
508
|
AztecAddress.fromString(contractAddress),
|
|
464
509
|
Fr.fromString(noteValidationRequestsArrayBaseSlot),
|
|
465
510
|
Fr.fromString(eventValidationRequestsArrayBaseSlot),
|
|
511
|
+
Fr.fromString(maxNotePackedLen).toNumber(),
|
|
512
|
+
Fr.fromString(maxEventSerializedLen).toNumber(),
|
|
466
513
|
);
|
|
467
514
|
|
|
468
515
|
return [];
|
|
469
516
|
}
|
|
470
517
|
|
|
471
|
-
|
|
518
|
+
// eslint-disable-next-line camelcase
|
|
519
|
+
async aztec_utl_bulkRetrieveLogs(
|
|
472
520
|
[contractAddress]: ACVMField[],
|
|
473
521
|
[logRetrievalRequestsArrayBaseSlot]: ACVMField[],
|
|
474
522
|
[logRetrievalResponsesArrayBaseSlot]: ACVMField[],
|
|
475
523
|
): Promise<ACVMField[]> {
|
|
476
|
-
await this.handlerAsUtility().
|
|
524
|
+
await this.handlerAsUtility().bulkRetrieveLogs(
|
|
477
525
|
AztecAddress.fromString(contractAddress),
|
|
478
526
|
Fr.fromString(logRetrievalRequestsArrayBaseSlot),
|
|
479
527
|
Fr.fromString(logRetrievalResponsesArrayBaseSlot),
|
|
@@ -481,12 +529,27 @@ export class Oracle {
|
|
|
481
529
|
return [];
|
|
482
530
|
}
|
|
483
531
|
|
|
484
|
-
|
|
532
|
+
// eslint-disable-next-line camelcase
|
|
533
|
+
async aztec_utl_utilityResolveMessageContexts(
|
|
534
|
+
[contractAddress]: ACVMField[],
|
|
535
|
+
[messageContextRequestsArrayBaseSlot]: ACVMField[],
|
|
536
|
+
[messageContextResponsesArrayBaseSlot]: ACVMField[],
|
|
537
|
+
): Promise<ACVMField[]> {
|
|
538
|
+
await this.handlerAsUtility().utilityResolveMessageContexts(
|
|
539
|
+
AztecAddress.fromString(contractAddress),
|
|
540
|
+
Fr.fromString(messageContextRequestsArrayBaseSlot),
|
|
541
|
+
Fr.fromString(messageContextResponsesArrayBaseSlot),
|
|
542
|
+
);
|
|
543
|
+
return [];
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// eslint-disable-next-line camelcase
|
|
547
|
+
async aztec_utl_storeCapsule(
|
|
485
548
|
[contractAddress]: ACVMField[],
|
|
486
549
|
[slot]: ACVMField[],
|
|
487
550
|
capsule: ACVMField[],
|
|
488
551
|
): Promise<ACVMField[]> {
|
|
489
|
-
await this.handlerAsUtility().
|
|
552
|
+
await this.handlerAsUtility().storeCapsule(
|
|
490
553
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
491
554
|
Fr.fromString(slot),
|
|
492
555
|
capsule.map(Fr.fromString),
|
|
@@ -494,12 +557,13 @@ export class Oracle {
|
|
|
494
557
|
return [];
|
|
495
558
|
}
|
|
496
559
|
|
|
497
|
-
|
|
560
|
+
// eslint-disable-next-line camelcase
|
|
561
|
+
async aztec_utl_loadCapsule(
|
|
498
562
|
[contractAddress]: ACVMField[],
|
|
499
563
|
[slot]: ACVMField[],
|
|
500
564
|
[tSize]: ACVMField[],
|
|
501
565
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
502
|
-
const values = await this.handlerAsUtility().
|
|
566
|
+
const values = await this.handlerAsUtility().loadCapsule(
|
|
503
567
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
504
568
|
Fr.fromString(slot),
|
|
505
569
|
);
|
|
@@ -515,21 +579,23 @@ export class Oracle {
|
|
|
515
579
|
}
|
|
516
580
|
}
|
|
517
581
|
|
|
518
|
-
|
|
519
|
-
|
|
582
|
+
// eslint-disable-next-line camelcase
|
|
583
|
+
async aztec_utl_deleteCapsule([contractAddress]: ACVMField[], [slot]: ACVMField[]): Promise<ACVMField[]> {
|
|
584
|
+
await this.handlerAsUtility().deleteCapsule(
|
|
520
585
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
521
586
|
Fr.fromString(slot),
|
|
522
587
|
);
|
|
523
588
|
return [];
|
|
524
589
|
}
|
|
525
590
|
|
|
526
|
-
|
|
591
|
+
// eslint-disable-next-line camelcase
|
|
592
|
+
async aztec_utl_copyCapsule(
|
|
527
593
|
[contractAddress]: ACVMField[],
|
|
528
594
|
[srcSlot]: ACVMField[],
|
|
529
595
|
[dstSlot]: ACVMField[],
|
|
530
596
|
[numEntries]: ACVMField[],
|
|
531
597
|
): Promise<ACVMField[]> {
|
|
532
|
-
await this.handlerAsUtility().
|
|
598
|
+
await this.handlerAsUtility().copyCapsule(
|
|
533
599
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
534
600
|
Fr.fromString(srcSlot),
|
|
535
601
|
Fr.fromString(dstSlot),
|
|
@@ -538,7 +604,8 @@ export class Oracle {
|
|
|
538
604
|
return [];
|
|
539
605
|
}
|
|
540
606
|
|
|
541
|
-
|
|
607
|
+
// eslint-disable-next-line camelcase
|
|
608
|
+
async aztec_utl_tryAes128Decrypt(
|
|
542
609
|
ciphertextBVecStorage: ACVMField[],
|
|
543
610
|
[ciphertextLength]: ACVMField[],
|
|
544
611
|
iv: ACVMField[],
|
|
@@ -548,36 +615,61 @@ export class Oracle {
|
|
|
548
615
|
const ivBuffer = fromUintArray(iv, 8);
|
|
549
616
|
const symKeyBuffer = fromUintArray(symKey, 8);
|
|
550
617
|
|
|
551
|
-
|
|
552
|
-
|
|
618
|
+
// Noir Option<BoundedVec> is encoded as [is_some: Field, storage: Field[], length: Field].
|
|
619
|
+
try {
|
|
620
|
+
const plaintext = await this.handlerAsUtility().aes128Decrypt(ciphertext, ivBuffer, symKeyBuffer);
|
|
621
|
+
const [storage, length] = bufferToBoundedVec(plaintext, ciphertextBVecStorage.length);
|
|
622
|
+
return [toACVMField(1), storage, length];
|
|
623
|
+
} catch {
|
|
624
|
+
const zeroStorage = Array(ciphertextBVecStorage.length).fill(toACVMField(0));
|
|
625
|
+
return [toACVMField(0), zeroStorage, toACVMField(0)];
|
|
626
|
+
}
|
|
553
627
|
}
|
|
554
628
|
|
|
555
|
-
|
|
629
|
+
// eslint-disable-next-line camelcase
|
|
630
|
+
async aztec_utl_getSharedSecret(
|
|
556
631
|
[address]: ACVMField[],
|
|
557
632
|
[ephPKField0]: ACVMField[],
|
|
558
633
|
[ephPKField1]: ACVMField[],
|
|
559
634
|
[ephPKField2]: ACVMField[],
|
|
560
635
|
): Promise<ACVMField[]> {
|
|
561
|
-
const secret = await this.handlerAsUtility().
|
|
636
|
+
const secret = await this.handlerAsUtility().getSharedSecret(
|
|
562
637
|
AztecAddress.fromField(Fr.fromString(address)),
|
|
563
638
|
Point.fromFields([ephPKField0, ephPKField1, ephPKField2].map(Fr.fromString)),
|
|
564
639
|
);
|
|
565
640
|
return secret.toFields().map(toACVMField);
|
|
566
641
|
}
|
|
567
642
|
|
|
568
|
-
|
|
569
|
-
|
|
643
|
+
// eslint-disable-next-line camelcase
|
|
644
|
+
aztec_utl_invalidateContractSyncCache(
|
|
645
|
+
[contractAddress]: ACVMField[],
|
|
646
|
+
scopes: ACVMField[],
|
|
647
|
+
[scopeCount]: ACVMField[],
|
|
648
|
+
): Promise<ACVMField[]> {
|
|
649
|
+
const scopeAddresses = scopes.slice(0, +scopeCount).map(s => AztecAddress.fromField(Fr.fromString(s)));
|
|
650
|
+
this.handlerAsUtility().invalidateContractSyncCache(
|
|
651
|
+
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
652
|
+
scopeAddresses,
|
|
653
|
+
);
|
|
654
|
+
return Promise.resolve([]);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// eslint-disable-next-line camelcase
|
|
658
|
+
async aztec_utl_emitOffchainEffect(data: ACVMField[]) {
|
|
659
|
+
await this.handlerAsUtility().emitOffchainEffect(data.map(Fr.fromString));
|
|
570
660
|
return [];
|
|
571
661
|
}
|
|
572
662
|
|
|
573
|
-
|
|
574
|
-
|
|
663
|
+
// eslint-disable-next-line camelcase
|
|
664
|
+
async aztec_prv_getSenderForTags(): Promise<ACVMField[]> {
|
|
665
|
+
const sender = await this.handlerAsPrivate().getSenderForTags();
|
|
575
666
|
// Return [1, address] for Some(address), [0, 0] for None
|
|
576
667
|
return sender ? [toACVMField(1n), toACVMField(sender)] : [toACVMField(0n), toACVMField(0n)];
|
|
577
668
|
}
|
|
578
669
|
|
|
579
|
-
|
|
580
|
-
|
|
670
|
+
// eslint-disable-next-line camelcase
|
|
671
|
+
async aztec_prv_setSenderForTags([senderForTags]: ACVMField[]): Promise<ACVMField[]> {
|
|
672
|
+
await this.handlerAsPrivate().setSenderForTags(AztecAddress.fromField(Fr.fromString(senderForTags)));
|
|
581
673
|
return [];
|
|
582
674
|
}
|
|
583
675
|
}
|