@aztec/pxe 0.0.1-commit.b655e406 → 0.0.1-commit.b6e433891
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.d.ts +1 -1
- 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 -13
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +25 -14
- 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 +84 -26
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +251 -85
- package/dest/contract_function_simulator/execution_note_cache.d.ts +25 -14
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +59 -34
- 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 +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 +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 +7 -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 +14 -7
- 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/index.d.ts +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +64 -49
- 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 +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 +45 -41
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +226 -117
- 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 +67 -88
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +140 -118
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +149 -56
- 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 +33 -10
- 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 +34 -11
- 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 +40 -28
- 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} +144 -77
- 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/index.d.ts +1 -1
- 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 +33 -25
- 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 +124 -103
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +288 -285
- 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/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 -8
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -7
- 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 +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 +29 -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 +25 -26
- 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 +431 -119
- package/src/contract_function_simulator/execution_note_cache.ts +58 -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 +3 -6
- package/src/contract_function_simulator/noir-structs/message_tx_context.ts +55 -0
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +16 -7
- package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
- package/src/contract_function_simulator/oracle/interfaces.ts +86 -61
- 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 +30 -14
- package/src/contract_function_simulator/oracle/oracle.ts +258 -158
- package/src/contract_function_simulator/oracle/private_execution.ts +6 -72
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +187 -167
- 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 +25 -18
- package/src/entrypoints/client/lazy/index.ts +3 -1
- package/src/entrypoints/client/lazy/utils.ts +26 -19
- package/src/entrypoints/pxe_creation_options.ts +6 -2
- package/src/entrypoints/server/index.ts +5 -1
- package/src/entrypoints/server/utils.ts +34 -56
- 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} +199 -145
- package/src/private_kernel/hints/test_utils.ts +325 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +38 -34
- package/src/private_kernel/private_kernel_oracle.ts +118 -37
- package/src/pxe.ts +450 -389
- 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 -274
- 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 -701
- 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 -74
- 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 -205
- 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_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 -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 -308
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -43
- 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 -104
- 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 -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 -343
- package/src/contract_function_simulator/proxied_node.ts +0 -33
- package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1019
- 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 -294
- 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_dao.ts +0 -154
- package/src/storage/note_data_provider/note_data_provider.ts +0 -393
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -148
- 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,49 +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
|
-
|
|
105
|
-
this.handlerAsPrivate().
|
|
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));
|
|
106
113
|
return Promise.resolve([]);
|
|
107
114
|
}
|
|
108
115
|
|
|
109
|
-
|
|
110
|
-
|
|
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));
|
|
111
119
|
return [values.map(toACVMField)];
|
|
112
120
|
}
|
|
113
121
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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());
|
|
117
126
|
}
|
|
118
127
|
|
|
119
|
-
|
|
120
|
-
|
|
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));
|
|
121
131
|
|
|
122
132
|
return keyValidationRequest.toFields().map(toACVMField);
|
|
123
133
|
}
|
|
124
134
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
);
|
|
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)));
|
|
129
138
|
|
|
130
139
|
return [
|
|
131
140
|
instance.salt,
|
|
@@ -136,106 +145,132 @@ export class Oracle {
|
|
|
136
145
|
].map(toACVMField);
|
|
137
146
|
}
|
|
138
147
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
[
|
|
142
|
-
[
|
|
148
|
+
// eslint-disable-next-line camelcase
|
|
149
|
+
async aztec_utl_getNoteHashMembershipWitness(
|
|
150
|
+
[anchorBlockHash]: ACVMField[],
|
|
151
|
+
[noteHash]: ACVMField[],
|
|
143
152
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
const parsedLeafValue = Fr.fromString(leafValue);
|
|
153
|
+
const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
|
|
154
|
+
const parsedNoteHash = Fr.fromString(noteHash);
|
|
147
155
|
|
|
148
|
-
const witness = await this.handlerAsUtility().
|
|
149
|
-
parsedBlockNumber,
|
|
150
|
-
parsedTreeId,
|
|
151
|
-
parsedLeafValue,
|
|
152
|
-
);
|
|
156
|
+
const witness = await this.handlerAsUtility().getNoteHashMembershipWitness(parsedAnchorBlockHash, parsedNoteHash);
|
|
153
157
|
if (!witness) {
|
|
154
158
|
throw new Error(
|
|
155
|
-
`
|
|
159
|
+
`Note hash ${noteHash} not found in the note hash tree at anchor block hash ${parsedAnchorBlockHash.toString()}.`,
|
|
156
160
|
);
|
|
157
161
|
}
|
|
158
|
-
return
|
|
162
|
+
return witness.toNoirRepresentation();
|
|
159
163
|
}
|
|
160
164
|
|
|
161
|
-
|
|
162
|
-
|
|
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[],
|
|
163
185
|
[nullifier]: ACVMField[], // nullifier, we try to find the witness for (to prove inclusion)
|
|
164
186
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
165
|
-
const
|
|
187
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
166
188
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
167
189
|
|
|
168
|
-
const witness = await this.handlerAsUtility().
|
|
169
|
-
parsedBlockNumber,
|
|
170
|
-
parsedNullifier,
|
|
171
|
-
);
|
|
190
|
+
const witness = await this.handlerAsUtility().getNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
172
191
|
if (!witness) {
|
|
173
|
-
throw new Error(
|
|
192
|
+
throw new Error(
|
|
193
|
+
`Nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
|
|
194
|
+
);
|
|
174
195
|
}
|
|
175
196
|
return witness.toNoirRepresentation();
|
|
176
197
|
}
|
|
177
198
|
|
|
178
|
-
|
|
179
|
-
|
|
199
|
+
// eslint-disable-next-line camelcase
|
|
200
|
+
async aztec_utl_getLowNullifierMembershipWitness(
|
|
201
|
+
[blockHash]: ACVMField[],
|
|
180
202
|
[nullifier]: ACVMField[], // nullifier, we try to find the low nullifier witness for (to prove non-inclusion)
|
|
181
203
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
182
|
-
const
|
|
204
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
183
205
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
184
206
|
|
|
185
|
-
const witness = await this.handlerAsUtility().
|
|
186
|
-
parsedBlockNumber,
|
|
187
|
-
parsedNullifier,
|
|
188
|
-
);
|
|
207
|
+
const witness = await this.handlerAsUtility().getLowNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
189
208
|
if (!witness) {
|
|
190
209
|
throw new Error(
|
|
191
|
-
`Low nullifier witness not found for nullifier ${parsedNullifier} at block ${
|
|
210
|
+
`Low nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
|
|
192
211
|
);
|
|
193
212
|
}
|
|
194
213
|
return witness.toNoirRepresentation();
|
|
195
214
|
}
|
|
196
215
|
|
|
197
|
-
|
|
198
|
-
|
|
216
|
+
// eslint-disable-next-line camelcase
|
|
217
|
+
async aztec_utl_getPublicDataWitness(
|
|
218
|
+
[blockHash]: ACVMField[],
|
|
199
219
|
[leafSlot]: ACVMField[],
|
|
200
220
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
201
|
-
const
|
|
221
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
202
222
|
const parsedLeafSlot = Fr.fromString(leafSlot);
|
|
203
223
|
|
|
204
|
-
const witness = await this.handlerAsUtility().
|
|
224
|
+
const witness = await this.handlerAsUtility().getPublicDataWitness(parsedBlockHash, parsedLeafSlot);
|
|
205
225
|
if (!witness) {
|
|
206
|
-
throw new Error(
|
|
226
|
+
throw new Error(
|
|
227
|
+
`Public data witness not found for slot ${parsedLeafSlot} at block hash ${parsedBlockHash.toString()}.`,
|
|
228
|
+
);
|
|
207
229
|
}
|
|
208
230
|
return witness.toNoirRepresentation();
|
|
209
231
|
}
|
|
210
232
|
|
|
211
|
-
|
|
233
|
+
// eslint-disable-next-line camelcase
|
|
234
|
+
async aztec_utl_getBlockHeader([blockNumber]: ACVMField[]): Promise<ACVMField[]> {
|
|
212
235
|
const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
|
|
213
236
|
|
|
214
|
-
const header = await this.handlerAsUtility().
|
|
237
|
+
const header = await this.handlerAsUtility().getBlockHeader(BlockNumber(parsedBlockNumber));
|
|
215
238
|
if (!header) {
|
|
216
239
|
throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
|
|
217
240
|
}
|
|
218
241
|
return header.toFields().map(toACVMField);
|
|
219
242
|
}
|
|
220
243
|
|
|
221
|
-
|
|
244
|
+
// eslint-disable-next-line camelcase
|
|
245
|
+
async aztec_utl_getAuthWitness([messageHash]: ACVMField[]): Promise<ACVMField[][]> {
|
|
222
246
|
const messageHashField = Fr.fromString(messageHash);
|
|
223
|
-
const witness = await this.handlerAsUtility().
|
|
247
|
+
const witness = await this.handlerAsUtility().getAuthWitness(messageHashField);
|
|
224
248
|
if (!witness) {
|
|
225
249
|
throw new Error(`Unknown auth witness for message hash ${messageHashField}`);
|
|
226
250
|
}
|
|
227
251
|
return [witness.map(toACVMField)];
|
|
228
252
|
}
|
|
229
253
|
|
|
230
|
-
|
|
254
|
+
// eslint-disable-next-line camelcase
|
|
255
|
+
async aztec_utl_tryGetPublicKeysAndPartialAddress([address]: ACVMField[]): Promise<(ACVMField | ACVMField[])[]> {
|
|
231
256
|
const parsedAddress = AztecAddress.fromField(Fr.fromString(address));
|
|
232
|
-
const
|
|
233
|
-
await this.handlerAsUtility().utilityGetPublicKeysAndPartialAddress(parsedAddress);
|
|
257
|
+
const result = await this.handlerAsUtility().tryGetPublicKeysAndPartialAddress(parsedAddress);
|
|
234
258
|
|
|
235
|
-
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
|
+
}
|
|
236
268
|
}
|
|
237
269
|
|
|
238
|
-
|
|
270
|
+
// eslint-disable-next-line camelcase
|
|
271
|
+
async aztec_utl_getNotes(
|
|
272
|
+
[ownerSome]: ACVMField[],
|
|
273
|
+
[ownerValue]: ACVMField[],
|
|
239
274
|
[storageSlot]: ACVMField[],
|
|
240
275
|
[numSelects]: ACVMField[],
|
|
241
276
|
selectByIndexes: ACVMField[],
|
|
@@ -251,9 +286,12 @@ export class Oracle {
|
|
|
251
286
|
[offset]: ACVMField[],
|
|
252
287
|
[status]: ACVMField[],
|
|
253
288
|
[maxNotes]: ACVMField[],
|
|
254
|
-
[
|
|
289
|
+
[packedHintedNoteLength]: ACVMField[],
|
|
255
290
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
256
|
-
|
|
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,
|
|
257
295
|
Fr.fromString(storageSlot),
|
|
258
296
|
+numSelects,
|
|
259
297
|
selectByIndexes.map(s => +s),
|
|
@@ -270,26 +308,41 @@ export class Oracle {
|
|
|
270
308
|
+status,
|
|
271
309
|
);
|
|
272
310
|
|
|
273
|
-
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
|
+
);
|
|
274
322
|
|
|
275
323
|
// Now we convert each sub-array to an array of ACVMField
|
|
276
|
-
const returnDataAsArrayOfACVMFieldArrays =
|
|
324
|
+
const returnDataAsArrayOfACVMFieldArrays = returnDataAsArrayOfPackedHintedNotes.map(subArray =>
|
|
277
325
|
subArray.map(toACVMField),
|
|
278
326
|
);
|
|
279
327
|
|
|
280
328
|
// At last we convert the array of arrays to a bounded vec of arrays
|
|
281
|
-
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +
|
|
329
|
+
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedHintedNoteLength);
|
|
282
330
|
}
|
|
283
331
|
|
|
284
|
-
|
|
332
|
+
// eslint-disable-next-line camelcase
|
|
333
|
+
aztec_prv_notifyCreatedNote(
|
|
334
|
+
[owner]: ACVMField[],
|
|
285
335
|
[storageSlot]: ACVMField[],
|
|
336
|
+
[randomness]: ACVMField[],
|
|
286
337
|
[noteTypeId]: ACVMField[],
|
|
287
338
|
note: ACVMField[],
|
|
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),
|
|
345
|
+
Fr.fromString(randomness),
|
|
293
346
|
NoteSelector.fromField(Fr.fromString(noteTypeId)),
|
|
294
347
|
note.map(Fr.fromString),
|
|
295
348
|
Fr.fromString(noteHash),
|
|
@@ -298,35 +351,47 @@ export class Oracle {
|
|
|
298
351
|
return Promise.resolve([]);
|
|
299
352
|
}
|
|
300
353
|
|
|
301
|
-
|
|
354
|
+
// eslint-disable-next-line camelcase
|
|
355
|
+
async aztec_prv_notifyNullifiedNote(
|
|
302
356
|
[innerNullifier]: ACVMField[],
|
|
303
357
|
[noteHash]: ACVMField[],
|
|
304
358
|
[counter]: ACVMField[],
|
|
305
359
|
): Promise<ACVMField[]> {
|
|
306
|
-
await this.handlerAsPrivate().
|
|
307
|
-
Fr.fromString(innerNullifier),
|
|
308
|
-
Fr.fromString(noteHash),
|
|
309
|
-
+counter,
|
|
310
|
-
);
|
|
360
|
+
await this.handlerAsPrivate().notifyNullifiedNote(Fr.fromString(innerNullifier), Fr.fromString(noteHash), +counter);
|
|
311
361
|
return [];
|
|
312
362
|
}
|
|
313
363
|
|
|
314
|
-
|
|
315
|
-
|
|
364
|
+
// eslint-disable-next-line camelcase
|
|
365
|
+
async aztec_prv_notifyCreatedNullifier([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
|
|
366
|
+
await this.handlerAsPrivate().notifyCreatedNullifier(Fr.fromString(innerNullifier));
|
|
316
367
|
return [];
|
|
317
368
|
}
|
|
318
369
|
|
|
319
|
-
|
|
320
|
-
|
|
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));
|
|
321
385
|
return [toACVMField(exists)];
|
|
322
386
|
}
|
|
323
387
|
|
|
324
|
-
|
|
388
|
+
// eslint-disable-next-line camelcase
|
|
389
|
+
async aztec_utl_getL1ToL2MembershipWitness(
|
|
325
390
|
[contractAddress]: ACVMField[],
|
|
326
391
|
[messageHash]: ACVMField[],
|
|
327
392
|
[secret]: ACVMField[],
|
|
328
393
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
329
|
-
const message = await this.handlerAsUtility().
|
|
394
|
+
const message = await this.handlerAsUtility().getL1ToL2MembershipWitness(
|
|
330
395
|
AztecAddress.fromString(contractAddress),
|
|
331
396
|
Fr.fromString(messageHash),
|
|
332
397
|
Fr.fromString(secret),
|
|
@@ -334,22 +399,24 @@ export class Oracle {
|
|
|
334
399
|
return message.toNoirRepresentation();
|
|
335
400
|
}
|
|
336
401
|
|
|
337
|
-
|
|
402
|
+
// eslint-disable-next-line camelcase
|
|
403
|
+
async aztec_utl_storageRead(
|
|
404
|
+
[blockHash]: ACVMField[],
|
|
338
405
|
[contractAddress]: ACVMField[],
|
|
339
406
|
[startStorageSlot]: ACVMField[],
|
|
340
|
-
[blockNumber]: ACVMField[],
|
|
341
407
|
[numberOfElements]: ACVMField[],
|
|
342
408
|
): Promise<ACVMField[][]> {
|
|
343
|
-
const values = await this.handlerAsUtility().
|
|
409
|
+
const values = await this.handlerAsUtility().storageRead(
|
|
410
|
+
BlockHash.fromString(blockHash),
|
|
344
411
|
new AztecAddress(Fr.fromString(contractAddress)),
|
|
345
412
|
Fr.fromString(startStorageSlot),
|
|
346
|
-
+blockNumber,
|
|
347
413
|
+numberOfElements,
|
|
348
414
|
);
|
|
349
415
|
return [values.map(toACVMField)];
|
|
350
416
|
}
|
|
351
417
|
|
|
352
|
-
|
|
418
|
+
// eslint-disable-next-line camelcase
|
|
419
|
+
aztec_prv_notifyCreatedContractClassLog(
|
|
353
420
|
[contractAddress]: ACVMField[],
|
|
354
421
|
message: ACVMField[],
|
|
355
422
|
[length]: ACVMField[],
|
|
@@ -358,11 +425,12 @@ export class Oracle {
|
|
|
358
425
|
const logFields = new ContractClassLogFields(message.map(Fr.fromString));
|
|
359
426
|
const log = new ContractClassLog(new AztecAddress(Fr.fromString(contractAddress)), logFields, +length);
|
|
360
427
|
|
|
361
|
-
this.handlerAsPrivate().
|
|
428
|
+
this.handlerAsPrivate().notifyCreatedContractClassLog(log, +counter);
|
|
362
429
|
return Promise.resolve([]);
|
|
363
430
|
}
|
|
364
431
|
|
|
365
|
-
|
|
432
|
+
// eslint-disable-next-line camelcase
|
|
433
|
+
async aztec_utl_log(
|
|
366
434
|
level: ACVMField[],
|
|
367
435
|
message: ACVMField[],
|
|
368
436
|
_ignoredFieldsSize: ACVMField[],
|
|
@@ -371,20 +439,21 @@ export class Oracle {
|
|
|
371
439
|
const levelFr = Fr.fromString(level[0]);
|
|
372
440
|
const messageStr = message.map(acvmField => String.fromCharCode(Fr.fromString(acvmField).toNumber())).join('');
|
|
373
441
|
const fieldsFr = fields.map(Fr.fromString);
|
|
374
|
-
this.handlerAsMisc().
|
|
375
|
-
return
|
|
442
|
+
await this.handlerAsMisc().log(levelFr.toNumber(), messageStr, fieldsFr);
|
|
443
|
+
return [];
|
|
376
444
|
}
|
|
377
445
|
|
|
378
446
|
// This function's name is directly hardcoded in `circuit_recorder.ts`. Don't forget to update it there if you
|
|
379
447
|
// change the name here.
|
|
380
|
-
|
|
448
|
+
// eslint-disable-next-line camelcase
|
|
449
|
+
async aztec_prv_callPrivateFunction(
|
|
381
450
|
[contractAddress]: ACVMField[],
|
|
382
451
|
[functionSelector]: ACVMField[],
|
|
383
452
|
[argsHash]: ACVMField[],
|
|
384
453
|
[sideEffectCounter]: ACVMField[],
|
|
385
454
|
[isStaticCall]: ACVMField[],
|
|
386
455
|
): Promise<ACVMField[][]> {
|
|
387
|
-
const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().
|
|
456
|
+
const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().callPrivateFunction(
|
|
388
457
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
389
458
|
FunctionSelector.fromField(Fr.fromString(functionSelector)),
|
|
390
459
|
Fr.fromString(argsHash),
|
|
@@ -394,78 +463,65 @@ export class Oracle {
|
|
|
394
463
|
return [[endSideEffectCounter, returnsHash].map(toACVMField)];
|
|
395
464
|
}
|
|
396
465
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
[sideEffectCounter]: ACVMField[],
|
|
401
|
-
[isStaticCall]: ACVMField[],
|
|
402
|
-
): Promise<ACVMField[]> {
|
|
403
|
-
await this.handlerAsPrivate().privateNotifyEnqueuedPublicFunctionCall(
|
|
404
|
-
AztecAddress.fromString(contractAddress),
|
|
405
|
-
Fr.fromString(calldataHash),
|
|
406
|
-
Fr.fromString(sideEffectCounter).toNumber(),
|
|
407
|
-
Fr.fromString(isStaticCall).toBool(),
|
|
408
|
-
);
|
|
466
|
+
// eslint-disable-next-line camelcase
|
|
467
|
+
async aztec_prv_validatePublicCalldata([calldataHash]: ACVMField[]): Promise<ACVMField[]> {
|
|
468
|
+
await this.handlerAsPrivate().validatePublicCalldata(Fr.fromString(calldataHash));
|
|
409
469
|
return [];
|
|
410
470
|
}
|
|
411
471
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
[isStaticCall]: ACVMField[],
|
|
417
|
-
): Promise<ACVMField[]> {
|
|
418
|
-
await this.handlerAsPrivate().privateNotifySetPublicTeardownFunctionCall(
|
|
419
|
-
AztecAddress.fromString(contractAddress),
|
|
420
|
-
Fr.fromString(calldataHash),
|
|
421
|
-
Fr.fromString(sideEffectCounter).toNumber(),
|
|
422
|
-
Fr.fromString(isStaticCall).toBool(),
|
|
423
|
-
);
|
|
424
|
-
return [];
|
|
472
|
+
// eslint-disable-next-line camelcase
|
|
473
|
+
async aztec_prv_notifyRevertiblePhaseStart([minRevertibleSideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
|
|
474
|
+
await this.handlerAsPrivate().notifyRevertiblePhaseStart(Fr.fromString(minRevertibleSideEffectCounter).toNumber());
|
|
475
|
+
return Promise.resolve([]);
|
|
425
476
|
}
|
|
426
477
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
Fr.fromString(minRevertibleSideEffectCounter).toNumber(),
|
|
432
|
-
);
|
|
433
|
-
return Promise.resolve([]);
|
|
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());
|
|
481
|
+
return Promise.resolve([toACVMField(isRevertible)]);
|
|
434
482
|
}
|
|
435
483
|
|
|
436
|
-
|
|
437
|
-
|
|
484
|
+
// eslint-disable-next-line camelcase
|
|
485
|
+
async aztec_prv_getNextAppTagAsSender([sender]: ACVMField[], [recipient]: ACVMField[]): Promise<ACVMField[]> {
|
|
486
|
+
const tag = await this.handlerAsPrivate().getNextAppTagAsSender(
|
|
438
487
|
AztecAddress.fromString(sender),
|
|
439
488
|
AztecAddress.fromString(recipient),
|
|
440
489
|
);
|
|
441
490
|
return [toACVMField(tag.value)];
|
|
442
491
|
}
|
|
443
492
|
|
|
444
|
-
|
|
445
|
-
|
|
493
|
+
// eslint-disable-next-line camelcase
|
|
494
|
+
async aztec_utl_fetchTaggedLogs([pendingTaggedLogArrayBaseSlot]: ACVMField[]): Promise<ACVMField[]> {
|
|
495
|
+
await this.handlerAsUtility().fetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
|
|
446
496
|
return [];
|
|
447
497
|
}
|
|
448
498
|
|
|
449
|
-
|
|
499
|
+
// eslint-disable-next-line camelcase
|
|
500
|
+
async aztec_utl_validateAndStoreEnqueuedNotesAndEvents(
|
|
450
501
|
[contractAddress]: ACVMField[],
|
|
451
502
|
[noteValidationRequestsArrayBaseSlot]: ACVMField[],
|
|
452
503
|
[eventValidationRequestsArrayBaseSlot]: ACVMField[],
|
|
504
|
+
[maxNotePackedLen]: ACVMField[],
|
|
505
|
+
[maxEventSerializedLen]: ACVMField[],
|
|
453
506
|
): Promise<ACVMField[]> {
|
|
454
|
-
await this.handlerAsUtility().
|
|
507
|
+
await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEvents(
|
|
455
508
|
AztecAddress.fromString(contractAddress),
|
|
456
509
|
Fr.fromString(noteValidationRequestsArrayBaseSlot),
|
|
457
510
|
Fr.fromString(eventValidationRequestsArrayBaseSlot),
|
|
511
|
+
Fr.fromString(maxNotePackedLen).toNumber(),
|
|
512
|
+
Fr.fromString(maxEventSerializedLen).toNumber(),
|
|
458
513
|
);
|
|
459
514
|
|
|
460
515
|
return [];
|
|
461
516
|
}
|
|
462
517
|
|
|
463
|
-
|
|
518
|
+
// eslint-disable-next-line camelcase
|
|
519
|
+
async aztec_utl_bulkRetrieveLogs(
|
|
464
520
|
[contractAddress]: ACVMField[],
|
|
465
521
|
[logRetrievalRequestsArrayBaseSlot]: ACVMField[],
|
|
466
522
|
[logRetrievalResponsesArrayBaseSlot]: ACVMField[],
|
|
467
523
|
): Promise<ACVMField[]> {
|
|
468
|
-
await this.handlerAsUtility().
|
|
524
|
+
await this.handlerAsUtility().bulkRetrieveLogs(
|
|
469
525
|
AztecAddress.fromString(contractAddress),
|
|
470
526
|
Fr.fromString(logRetrievalRequestsArrayBaseSlot),
|
|
471
527
|
Fr.fromString(logRetrievalResponsesArrayBaseSlot),
|
|
@@ -473,12 +529,27 @@ export class Oracle {
|
|
|
473
529
|
return [];
|
|
474
530
|
}
|
|
475
531
|
|
|
476
|
-
|
|
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(
|
|
477
548
|
[contractAddress]: ACVMField[],
|
|
478
549
|
[slot]: ACVMField[],
|
|
479
550
|
capsule: ACVMField[],
|
|
480
551
|
): Promise<ACVMField[]> {
|
|
481
|
-
await this.handlerAsUtility().
|
|
552
|
+
await this.handlerAsUtility().storeCapsule(
|
|
482
553
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
483
554
|
Fr.fromString(slot),
|
|
484
555
|
capsule.map(Fr.fromString),
|
|
@@ -486,12 +557,13 @@ export class Oracle {
|
|
|
486
557
|
return [];
|
|
487
558
|
}
|
|
488
559
|
|
|
489
|
-
|
|
560
|
+
// eslint-disable-next-line camelcase
|
|
561
|
+
async aztec_utl_loadCapsule(
|
|
490
562
|
[contractAddress]: ACVMField[],
|
|
491
563
|
[slot]: ACVMField[],
|
|
492
564
|
[tSize]: ACVMField[],
|
|
493
565
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
494
|
-
const values = await this.handlerAsUtility().
|
|
566
|
+
const values = await this.handlerAsUtility().loadCapsule(
|
|
495
567
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
496
568
|
Fr.fromString(slot),
|
|
497
569
|
);
|
|
@@ -507,21 +579,23 @@ export class Oracle {
|
|
|
507
579
|
}
|
|
508
580
|
}
|
|
509
581
|
|
|
510
|
-
|
|
511
|
-
|
|
582
|
+
// eslint-disable-next-line camelcase
|
|
583
|
+
async aztec_utl_deleteCapsule([contractAddress]: ACVMField[], [slot]: ACVMField[]): Promise<ACVMField[]> {
|
|
584
|
+
await this.handlerAsUtility().deleteCapsule(
|
|
512
585
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
513
586
|
Fr.fromString(slot),
|
|
514
587
|
);
|
|
515
588
|
return [];
|
|
516
589
|
}
|
|
517
590
|
|
|
518
|
-
|
|
591
|
+
// eslint-disable-next-line camelcase
|
|
592
|
+
async aztec_utl_copyCapsule(
|
|
519
593
|
[contractAddress]: ACVMField[],
|
|
520
594
|
[srcSlot]: ACVMField[],
|
|
521
595
|
[dstSlot]: ACVMField[],
|
|
522
596
|
[numEntries]: ACVMField[],
|
|
523
597
|
): Promise<ACVMField[]> {
|
|
524
|
-
await this.handlerAsUtility().
|
|
598
|
+
await this.handlerAsUtility().copyCapsule(
|
|
525
599
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
526
600
|
Fr.fromString(srcSlot),
|
|
527
601
|
Fr.fromString(dstSlot),
|
|
@@ -530,7 +604,8 @@ export class Oracle {
|
|
|
530
604
|
return [];
|
|
531
605
|
}
|
|
532
606
|
|
|
533
|
-
|
|
607
|
+
// eslint-disable-next-line camelcase
|
|
608
|
+
async aztec_utl_tryAes128Decrypt(
|
|
534
609
|
ciphertextBVecStorage: ACVMField[],
|
|
535
610
|
[ciphertextLength]: ACVMField[],
|
|
536
611
|
iv: ACVMField[],
|
|
@@ -540,36 +615,61 @@ export class Oracle {
|
|
|
540
615
|
const ivBuffer = fromUintArray(iv, 8);
|
|
541
616
|
const symKeyBuffer = fromUintArray(symKey, 8);
|
|
542
617
|
|
|
543
|
-
|
|
544
|
-
|
|
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
|
+
}
|
|
545
627
|
}
|
|
546
628
|
|
|
547
|
-
|
|
629
|
+
// eslint-disable-next-line camelcase
|
|
630
|
+
async aztec_utl_getSharedSecret(
|
|
548
631
|
[address]: ACVMField[],
|
|
549
632
|
[ephPKField0]: ACVMField[],
|
|
550
633
|
[ephPKField1]: ACVMField[],
|
|
551
634
|
[ephPKField2]: ACVMField[],
|
|
552
635
|
): Promise<ACVMField[]> {
|
|
553
|
-
const secret = await this.handlerAsUtility().
|
|
636
|
+
const secret = await this.handlerAsUtility().getSharedSecret(
|
|
554
637
|
AztecAddress.fromField(Fr.fromString(address)),
|
|
555
638
|
Point.fromFields([ephPKField0, ephPKField1, ephPKField2].map(Fr.fromString)),
|
|
556
639
|
);
|
|
557
640
|
return secret.toFields().map(toACVMField);
|
|
558
641
|
}
|
|
559
642
|
|
|
560
|
-
|
|
561
|
-
|
|
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));
|
|
562
660
|
return [];
|
|
563
661
|
}
|
|
564
662
|
|
|
565
|
-
|
|
566
|
-
|
|
663
|
+
// eslint-disable-next-line camelcase
|
|
664
|
+
async aztec_prv_getSenderForTags(): Promise<ACVMField[]> {
|
|
665
|
+
const sender = await this.handlerAsPrivate().getSenderForTags();
|
|
567
666
|
// Return [1, address] for Some(address), [0, 0] for None
|
|
568
667
|
return sender ? [toACVMField(1n), toACVMField(sender)] : [toACVMField(0n), toACVMField(0n)];
|
|
569
668
|
}
|
|
570
669
|
|
|
571
|
-
|
|
572
|
-
|
|
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)));
|
|
573
673
|
return [];
|
|
574
674
|
}
|
|
575
675
|
}
|