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