@aztec/pxe 0.0.1-commit.24de95ac → 0.0.1-commit.2606882
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/bin/check_oracle_version.d.ts +1 -1
- package/dest/bin/check_oracle_version.js +54 -20
- package/dest/bin/index.d.ts +2 -0
- package/dest/bin/index.d.ts.map +1 -0
- package/dest/bin/index.js +1 -0
- package/dest/bin/oracle_version_helpers.d.ts +26 -0
- package/dest/bin/oracle_version_helpers.d.ts.map +1 -0
- package/dest/bin/oracle_version_helpers.js +93 -0
- package/dest/block_synchronizer/block_stream_source.d.ts +10 -0
- package/dest/block_synchronizer/block_stream_source.d.ts.map +1 -0
- package/dest/block_synchronizer/block_stream_source.js +62 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts +49 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
- package/dest/block_synchronizer/block_synchronizer.js +173 -0
- package/dest/block_synchronizer/index.d.ts +2 -0
- package/dest/block_synchronizer/index.d.ts.map +1 -0
- package/dest/block_synchronizer/index.js +1 -0
- package/dest/config/index.d.ts +13 -13
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +24 -15
- 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 +89 -26
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +267 -88
- package/dest/contract_function_simulator/ephemeral_array_service.d.ts +28 -0
- package/dest/contract_function_simulator/ephemeral_array_service.d.ts.map +1 -0
- package/dest/contract_function_simulator/ephemeral_array_service.js +78 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts +26 -15
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +59 -34
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +7 -11
- 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 -15
- 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 +15 -3
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +12 -1
- package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts +48 -0
- package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/bounded_vec.js +45 -0
- package/dest/contract_function_simulator/noir-structs/ephemeral_array.d.ts +37 -0
- package/dest/contract_function_simulator/noir-structs/ephemeral_array.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/ephemeral_array.js +59 -0
- 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 +12 -10
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +16 -5
- 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 +39 -7
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +4 -4
- 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 +3 -5
- package/dest/contract_function_simulator/noir-structs/note_data.d.ts +27 -0
- package/dest/contract_function_simulator/noir-structs/note_data.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/note_data.js +3 -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 +15 -10
- package/dest/contract_function_simulator/noir-structs/option.d.ts +61 -0
- package/dest/contract_function_simulator/noir-structs/option.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/option.js +62 -0
- package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts +11 -0
- package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/provided_secret.js +24 -0
- 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 +16 -88
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.js +2 -2
- 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 +17 -12
- package/dest/contract_function_simulator/oracle/oracle.d.ts +75 -43
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +475 -251
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +127 -0
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle_registry.js +786 -0
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +139 -0
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +560 -0
- 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 +78 -102
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +177 -137
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +189 -60
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +507 -118
- 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 +21 -4
- 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 +39 -50
- package/dest/contract_logging.d.ts +27 -0
- package/dest/contract_logging.d.ts.map +1 -0
- package/dest/contract_logging.js +38 -0
- package/dest/contract_sync/contract_sync_service.d.ts +42 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +135 -0
- package/dest/contract_sync/helpers.d.ts +27 -0
- package/dest/contract_sync/helpers.d.ts.map +1 -0
- package/dest/contract_sync/helpers.js +53 -0
- package/dest/debug/pxe_debug_utils.d.ts +40 -0
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
- package/dest/debug/pxe_debug_utils.js +42 -0
- package/dest/entrypoints/client/bundle/index.d.ts +3 -2
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +2 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +2 -2
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +43 -12
- package/dest/entrypoints/client/lazy/index.d.ts +3 -2
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +2 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +3 -3
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +44 -13
- package/dest/entrypoints/pxe_creation_options.d.ts +15 -3
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/pxe_creation_options.js +3 -1
- package/dest/entrypoints/server/index.d.ts +7 -3
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +6 -2
- package/dest/entrypoints/server/utils.d.ts +4 -3
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +50 -30
- 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 +24 -0
- package/dest/events/event_service.d.ts.map +1 -0
- package/dest/events/event_service.js +77 -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 +10 -0
- package/dest/events/private_event_filter_validator.d.ts.map +1 -0
- package/dest/events/private_event_filter_validator.js +53 -0
- package/dest/hooks/authorize_utility_call.d.ts +41 -0
- package/dest/hooks/authorize_utility_call.d.ts.map +1 -0
- package/dest/hooks/authorize_utility_call.js +4 -0
- package/dest/hooks/execution_hooks.d.ts +42 -0
- package/dest/hooks/execution_hooks.d.ts.map +1 -0
- package/dest/hooks/execution_hooks.js +9 -0
- package/dest/hooks/index.d.ts +4 -0
- package/dest/hooks/index.d.ts.map +1 -0
- package/dest/hooks/index.js +1 -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 +172 -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 +55 -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 +70 -0
- package/dest/notes/note_service.d.ts.map +1 -0
- package/dest/notes/note_service.js +172 -0
- package/dest/notes_filter.d.ts +24 -0
- package/dest/notes_filter.d.ts.map +1 -0
- package/dest/notes_filter.js +4 -0
- package/dest/oracle_version.d.ts +4 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +20 -9
- package/dest/private_kernel/batch_planner.d.ts +47 -0
- package/dest/private_kernel/batch_planner.d.ts.map +1 -0
- package/dest/private_kernel/batch_planner.js +104 -0
- 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} +145 -78
- 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 +202 -0
- package/dest/private_kernel/index.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +7 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +177 -76
- package/dest/private_kernel/private_kernel_oracle.d.ts +30 -29
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +96 -2
- package/dest/pxe.d.ts +170 -103
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +356 -306
- 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_store/anchor_block_store.js +26 -0
- package/dest/storage/anchor_block_store/index.d.ts +2 -0
- package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/index.js +1 -0
- package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts +42 -0
- package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts.map +1 -0
- package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.js +93 -0
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +15 -0
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -0
- package/dest/storage/backwards_compatibility_tests/schema_tests.js +591 -0
- package/dest/storage/backwards_compatibility_tests/store_spy.d.ts +19 -0
- package/dest/storage/backwards_compatibility_tests/store_spy.d.ts.map +1 -0
- package/dest/storage/backwards_compatibility_tests/store_spy.js +63 -0
- package/dest/storage/capsule_store/capsule_service.d.ts +21 -0
- package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_service.js +50 -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 +261 -0
- package/dest/storage/capsule_store/index.d.ts +3 -0
- package/dest/storage/capsule_store/index.d.ts.map +1 -0
- package/dest/storage/capsule_store/index.js +2 -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 +292 -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/open_pxe_stores.d.ts +33 -0
- package/dest/storage/open_pxe_stores.d.ts.map +1 -0
- package/dest/storage/open_pxe_stores.js +27 -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 +276 -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 +48 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
- package/dest/tagging/get_all_logs_by_tags.js +59 -0
- package/dest/tagging/index.d.ts +18 -7
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +16 -5
- package/dest/tagging/persist_sender_tagging_index_ranges.d.ts +29 -0
- package/dest/tagging/persist_sender_tagging_index_ranges.d.ts.map +1 -0
- package/dest/tagging/persist_sender_tagging_index_ranges.js +42 -0
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +56 -0
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.js +163 -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/reconcile_tagging_index_ranges.d.ts +36 -0
- package/dest/tagging/reconcile_tagging_index_ranges.d.ts.map +1 -0
- package/dest/tagging/reconcile_tagging_index_ranges.js +74 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +16 -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 +92 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +17 -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 +60 -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 +33 -20
- package/src/bin/check_oracle_version.ts +63 -25
- package/src/bin/index.ts +1 -0
- package/src/bin/oracle_version_helpers.ts +121 -0
- package/src/block_synchronizer/block_stream_source.ts +81 -0
- package/src/block_synchronizer/block_synchronizer.ts +200 -0
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +31 -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 +462 -122
- package/src/contract_function_simulator/ephemeral_array_service.ts +110 -0
- package/src/contract_function_simulator/execution_note_cache.ts +59 -29
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -18
- package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
- package/src/contract_function_simulator/index.ts +52 -2
- package/src/contract_function_simulator/noir-structs/bounded_vec.ts +55 -0
- package/src/contract_function_simulator/noir-structs/ephemeral_array.ts +66 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +15 -10
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +40 -6
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +4 -7
- package/src/contract_function_simulator/noir-structs/note_data.ts +27 -0
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +17 -10
- package/src/contract_function_simulator/noir-structs/option.ts +69 -0
- package/src/contract_function_simulator/noir-structs/provided_secret.ts +27 -0
- package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
- package/src/contract_function_simulator/oracle/interfaces.ts +12 -151
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +31 -15
- package/src/contract_function_simulator/oracle/oracle.ts +570 -434
- package/src/contract_function_simulator/oracle/oracle_registry.ts +585 -0
- package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +553 -0
- package/src/contract_function_simulator/oracle/private_execution.ts +6 -72
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +230 -188
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +751 -142
- package/src/contract_function_simulator/pick_notes.ts +23 -4
- package/src/contract_function_simulator/proxied_contract_data_source.ts +47 -53
- package/src/contract_logging.ts +52 -0
- package/src/contract_sync/contract_sync_service.ts +189 -0
- package/src/contract_sync/helpers.ts +86 -0
- package/src/debug/pxe_debug_utils.ts +85 -0
- package/src/entrypoints/client/bundle/index.ts +2 -1
- package/src/entrypoints/client/bundle/utils.ts +33 -21
- package/src/entrypoints/client/lazy/index.ts +2 -1
- package/src/entrypoints/client/lazy/utils.ts +35 -23
- package/src/entrypoints/pxe_creation_options.ts +20 -2
- package/src/entrypoints/server/index.ts +6 -2
- package/src/entrypoints/server/utils.ts +47 -60
- package/src/error_enriching.ts +7 -15
- package/src/events/event_service.ts +119 -0
- package/src/events/index.ts +1 -0
- package/src/events/private_event_filter_validator.ts +66 -0
- package/src/hooks/authorize_utility_call.ts +44 -0
- package/src/hooks/execution_hooks.ts +48 -0
- package/src/hooks/index.ts +7 -0
- package/src/job_coordinator/job_coordinator.ts +150 -0
- package/src/logs/log_service.ts +237 -0
- package/src/messages/message_context_service.ts +62 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +230 -0
- package/src/notes_filter.ts +24 -0
- package/src/oracle_version.ts +20 -9
- package/src/private_kernel/batch_planner.ts +169 -0
- 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} +200 -146
- package/src/private_kernel/hints/test_utils.ts +318 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +272 -110
- package/src/private_kernel/private_kernel_oracle.ts +130 -39
- package/src/pxe.ts +606 -414
- 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} +11 -12
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/AddressStore.json +22 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/AnchorBlockStore.json +3 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/CapsuleStore.json +16 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/ContractStore.json +28 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/KeyStore.json +52 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/L2TipsKVStore.json +46 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/NoteStore.json +36 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/PrivateEventStore.json +44 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/RecipientTaggingStore.json +18 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/SenderAddressBookStore.json +16 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/SenderTaggingStore.json +22 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +97 -0
- package/src/storage/backwards_compatibility_tests/kv_store_snapshot.ts +122 -0
- package/src/storage/backwards_compatibility_tests/schema_tests.ts +712 -0
- package/src/storage/backwards_compatibility_tests/store_spy.ts +73 -0
- package/src/storage/capsule_store/capsule_service.ts +90 -0
- package/src/storage/capsule_store/capsule_store.ts +333 -0
- package/src/storage/capsule_store/index.ts +2 -0
- package/src/storage/contract_store/contract_store.ts +408 -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 +415 -0
- package/src/storage/note_store/stored_note.ts +48 -0
- package/src/storage/open_pxe_stores.ts +49 -0
- package/src/storage/private_event_store/private_event_store.ts +388 -0
- package/src/storage/private_event_store/stored_private_event.ts +73 -0
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +139 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +476 -0
- package/src/tagging/constants.ts +10 -2
- package/src/tagging/get_all_logs_by_tags.ts +120 -0
- package/src/tagging/index.ts +20 -6
- package/src/tagging/persist_sender_tagging_index_ranges.ts +57 -0
- package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +240 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/reconcile_tagging_index_ranges.ts +102 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +134 -0
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +66 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +84 -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/sync_data_provider/sync_data_provider.js +0 -26
- 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,16 +1,13 @@
|
|
|
1
1
|
import { MAX_NOTE_HASHES_PER_TX, PRIVATE_LOG_CIPHERTEXT_LEN } from '@aztec/constants';
|
|
2
2
|
import { range } from '@aztec/foundation/array';
|
|
3
|
-
import { Fr } from '@aztec/foundation/
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import type { TxHash } from '@aztec/stdlib/tx';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const MAX_PUBLIC_LOG_LEN_FOR_NOTE_COMPLETION = MAX_NOTE_PACKED_LEN;
|
|
9
|
-
const MAX_LOG_CONTENT_LEN = Math.max(MAX_PUBLIC_LOG_LEN_FOR_NOTE_COMPLETION, PRIVATE_LOG_CIPHERTEXT_LEN);
|
|
6
|
+
const MAX_LOG_CONTENT_LEN = PRIVATE_LOG_CIPHERTEXT_LEN;
|
|
10
7
|
|
|
11
8
|
/**
|
|
12
9
|
* Intermediate struct used to perform batch log retrieval by PXE. The `utilityBulkRetrieveLogs` oracle stores values of this
|
|
13
|
-
* type in a `
|
|
10
|
+
* type in a `EphemeralArray`.
|
|
14
11
|
*/
|
|
15
12
|
export class LogRetrievalResponse {
|
|
16
13
|
constructor(
|
|
@@ -42,7 +39,7 @@ export class LogRetrievalResponse {
|
|
|
42
39
|
return range(serializationLen).map(_ => Fr.zero());
|
|
43
40
|
}
|
|
44
41
|
|
|
45
|
-
static toSerializedOption(response
|
|
42
|
+
static toSerializedOption(response: LogRetrievalResponse | null): Fr[] {
|
|
46
43
|
if (response) {
|
|
47
44
|
return [new Fr(1), ...response.toFields()];
|
|
48
45
|
} else {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
import type { Note } from '@aztec/stdlib/note';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Information about a note needed during execution.
|
|
7
|
+
*/
|
|
8
|
+
export interface NoteData {
|
|
9
|
+
/** The actual note content (the fields of the Noir #[note] struct). */
|
|
10
|
+
note: Note;
|
|
11
|
+
/** The address of the contract that owns the note. */
|
|
12
|
+
contractAddress: AztecAddress;
|
|
13
|
+
/** The owner of the note. */
|
|
14
|
+
owner: AztecAddress;
|
|
15
|
+
/** The storage slot of the note. */
|
|
16
|
+
storageSlot: Fr;
|
|
17
|
+
/** The randomness injected to the note */
|
|
18
|
+
randomness: Fr;
|
|
19
|
+
/** The nonce injected into the note hash preimage by kernels. */
|
|
20
|
+
noteNonce: Fr;
|
|
21
|
+
/** A hash of the note as it gets stored in the note hash tree. */
|
|
22
|
+
noteHash: Fr;
|
|
23
|
+
/** True if the note is pending, false if settled. */
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
/** The corresponding nullifier of the note. Undefined for pending notes. */
|
|
26
|
+
siloedNullifier?: Fr;
|
|
27
|
+
}
|
|
@@ -1,52 +1,59 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { FieldReader } from '@aztec/foundation/serialize';
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
5
5
|
|
|
6
|
-
// TODO(#14617): should we compute this from constants? This value is aztec-nr specific.
|
|
7
|
-
export const MAX_NOTE_PACKED_LEN = 12;
|
|
8
|
-
|
|
9
6
|
/**
|
|
10
|
-
* Intermediate struct used to perform batch note validation by PXE. The `
|
|
11
|
-
* expects for values of this type to be stored in a `
|
|
7
|
+
* Intermediate struct used to perform batch note validation by PXE. The `utilityValidateAndStoreEnqueuedNotesAndEvents` oracle
|
|
8
|
+
* expects for values of this type to be stored in a `EphemeralArray`.
|
|
12
9
|
*/
|
|
13
10
|
export class NoteValidationRequest {
|
|
14
11
|
constructor(
|
|
15
12
|
public contractAddress: AztecAddress,
|
|
13
|
+
public owner: AztecAddress,
|
|
16
14
|
public storageSlot: Fr,
|
|
15
|
+
public randomness: Fr,
|
|
17
16
|
public noteNonce: Fr,
|
|
18
17
|
public content: Fr[],
|
|
19
18
|
public noteHash: Fr,
|
|
20
19
|
public nullifier: Fr,
|
|
21
20
|
public txHash: TxHash,
|
|
22
|
-
public recipient: AztecAddress,
|
|
23
21
|
) {}
|
|
24
22
|
|
|
25
23
|
static fromFields(fields: Fr[] | FieldReader): NoteValidationRequest {
|
|
26
24
|
const reader = FieldReader.asReader(fields);
|
|
27
25
|
|
|
28
26
|
const contractAddress = AztecAddress.fromField(reader.readField());
|
|
27
|
+
const owner = AztecAddress.fromField(reader.readField());
|
|
29
28
|
const storageSlot = reader.readField();
|
|
29
|
+
const randomness = reader.readField();
|
|
30
30
|
const noteNonce = reader.readField();
|
|
31
31
|
|
|
32
|
-
const
|
|
32
|
+
const maxNotePackedLen = reader.readField().toNumber();
|
|
33
|
+
const contentStorage = reader.readFieldArray(maxNotePackedLen);
|
|
33
34
|
const contentLen = reader.readField().toNumber();
|
|
34
35
|
const content = contentStorage.slice(0, contentLen);
|
|
35
36
|
|
|
36
37
|
const noteHash = reader.readField();
|
|
37
38
|
const nullifier = reader.readField();
|
|
38
39
|
const txHash = TxHash.fromField(reader.readField());
|
|
39
|
-
|
|
40
|
+
|
|
41
|
+
if (reader.remainingFields() !== 0) {
|
|
42
|
+
throw new Error(
|
|
43
|
+
`Error converting array of fields to NoteValidationRequest: expected ${reader.cursor} fields but received ${reader.cursor + reader.remainingFields()} (maxNotePackedLen=${maxNotePackedLen}).`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
40
46
|
|
|
41
47
|
return new NoteValidationRequest(
|
|
42
48
|
contractAddress,
|
|
49
|
+
owner,
|
|
43
50
|
storageSlot,
|
|
51
|
+
randomness,
|
|
44
52
|
noteNonce,
|
|
45
53
|
content,
|
|
46
54
|
noteHash,
|
|
47
55
|
nullifier,
|
|
48
56
|
txHash,
|
|
49
|
-
recipient,
|
|
50
57
|
);
|
|
51
58
|
}
|
|
52
59
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript counterpart of Noir's `Option<T>`.
|
|
3
|
+
*
|
|
4
|
+
* Wraps a value that may or may not be present. Use {@link Option.some} to wrap a present value and
|
|
5
|
+
* {@link Option.none} for an absent one. The type guards {@link isSome} and {@link isNone} narrow
|
|
6
|
+
* `value` in conditional branches.
|
|
7
|
+
*/
|
|
8
|
+
export class Option<T> {
|
|
9
|
+
private constructor(
|
|
10
|
+
public readonly value: T | undefined,
|
|
11
|
+
public readonly template: T | undefined,
|
|
12
|
+
) {}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Wrap a present value.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* return Option.some(values);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
static some<T>(value: T): Option<T> {
|
|
23
|
+
return new Option<T>(value, undefined);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Construct an absent Option.
|
|
28
|
+
*
|
|
29
|
+
* When serialized back to ACVM, the `None` case must produce the same number of fields as `Some`.
|
|
30
|
+
* For types whose wire size varies per call site (`BoundedVec`, `FixedArray`), pass a `template` so the
|
|
31
|
+
* serializer knows how many zero fields to emit. Omit the template when the Option will not be
|
|
32
|
+
* re-serialized (e.g. deserialized input params).
|
|
33
|
+
*
|
|
34
|
+
* @param template - A representative empty `T` whose serialization determines the zero-filled wire format.
|
|
35
|
+
*
|
|
36
|
+
* @example None for a fixed-size type:
|
|
37
|
+
* ```ts
|
|
38
|
+
* return Option.none(AztecAddress.ZERO);
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example None for a dynamic-size type:
|
|
42
|
+
* ```ts
|
|
43
|
+
* return Option.none(BoundedVec.empty<number>({ maxLength: ciphertext.maxLength }));
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
static none<T>(template?: T): Option<T> {
|
|
47
|
+
return new Option<T>(undefined, template);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Type guard: narrows `value` to `T` in the truthy branch.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const opt = await handler.getSenderForTags();
|
|
56
|
+
* if (opt.isSome()) {
|
|
57
|
+
* console.log(opt.value); // narrowed to T
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
isSome(): this is Option<T> & { value: T } {
|
|
62
|
+
return this.value !== undefined;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Type guard: narrows `value` to `undefined` in the truthy branch. */
|
|
66
|
+
isNone(): this is Option<T> & { value: undefined } {
|
|
67
|
+
return this.value === undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { FieldReader } from '@aztec/foundation/serialize';
|
|
3
|
+
import { AppTaggingSecretKind } from '@aztec/stdlib/logs';
|
|
4
|
+
|
|
5
|
+
/** A tagging secret an app supplies explicitly to `getPendingTaggedLogs` when PXE cannot derive it internally. */
|
|
6
|
+
export class ProvidedSecret {
|
|
7
|
+
constructor(
|
|
8
|
+
public secret: Fr,
|
|
9
|
+
public mode: AppTaggingSecretKind,
|
|
10
|
+
) {}
|
|
11
|
+
|
|
12
|
+
static fromFields(fields: Fr[] | FieldReader): ProvidedSecret {
|
|
13
|
+
const reader = FieldReader.asReader(fields);
|
|
14
|
+
return new ProvidedSecret(reader.readField(), kindFromField(reader.readField()));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function kindFromField(mode: Fr): AppTaggingSecretKind {
|
|
19
|
+
switch (mode.toBigInt()) {
|
|
20
|
+
case 0n:
|
|
21
|
+
return AppTaggingSecretKind.UNCONSTRAINED;
|
|
22
|
+
case 1n:
|
|
23
|
+
return AppTaggingSecretKind.CONSTRAINED;
|
|
24
|
+
default:
|
|
25
|
+
throw new Error(`Invalid app tagging secret kind: ${mode.toString()}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,42 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { FieldsOf } from '@aztec/foundation/types';
|
|
1
|
+
import { toACVMField } from '@aztec/simulator/client';
|
|
3
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import type {
|
|
3
|
+
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* TypeScript counterpart of utility_context.nr. Used only as a return value for the utilityGetUtilityContext oracle.
|
|
8
7
|
*/
|
|
9
8
|
export class UtilityContext {
|
|
10
|
-
|
|
11
|
-
public readonly
|
|
12
|
-
public readonly timestamp: UInt64,
|
|
9
|
+
constructor(
|
|
10
|
+
public readonly blockHeader: BlockHeader,
|
|
13
11
|
public readonly contractAddress: AztecAddress,
|
|
14
|
-
public readonly version: Fr,
|
|
15
|
-
public readonly chainId: Fr,
|
|
16
12
|
) {}
|
|
17
13
|
|
|
18
|
-
static from(fields: FieldsOf<UtilityContext>) {
|
|
19
|
-
return new UtilityContext(
|
|
20
|
-
fields.blockNumber,
|
|
21
|
-
fields.timestamp,
|
|
22
|
-
fields.contractAddress,
|
|
23
|
-
fields.version,
|
|
24
|
-
fields.chainId,
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
14
|
/**
|
|
29
15
|
* Returns a representation of the utility context as expected by intrinsic Noir deserialization.
|
|
30
16
|
* The order of the fields has to be the same as the order of the fields in the utility_context.nr.
|
|
31
17
|
*/
|
|
32
18
|
public toNoirRepresentation(): (string | string[])[] {
|
|
33
19
|
// TODO(#12874): remove the stupid as string conversion by modifying ForeignCallOutput type in acvm.js
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
new Fr(this.timestamp).toString() as string,
|
|
37
|
-
this.contractAddress.toString() as string,
|
|
38
|
-
this.version.toString() as string,
|
|
39
|
-
this.chainId.toString() as string,
|
|
40
|
-
];
|
|
20
|
+
const blockHeaderFields = this.blockHeader.toFields().map(toACVMField);
|
|
21
|
+
return [...blockHeaderFields, this.contractAddress.toString() as string];
|
|
41
22
|
}
|
|
42
23
|
}
|
|
@@ -1,160 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import type { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
4
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
|
|
6
|
-
import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
|
|
7
|
-
import type { ContractClassLog } from '@aztec/stdlib/logs';
|
|
8
|
-
import type { Note, NoteStatus } from '@aztec/stdlib/note';
|
|
9
|
-
import { type MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
|
|
10
|
-
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
11
|
-
|
|
12
|
-
import type { Tag } from '../../tagging/tag.js';
|
|
13
|
-
import type { UtilityContext } from '../noir-structs/utility_context.js';
|
|
14
|
-
import type { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Information about a note needed during execution.
|
|
18
|
-
*/
|
|
19
|
-
export interface NoteData {
|
|
20
|
-
/** The actual note content (the fields of the Noir #[note] struct). */
|
|
21
|
-
note: Note;
|
|
22
|
-
/** The address of the contract that owns the note. */
|
|
23
|
-
contractAddress: AztecAddress;
|
|
24
|
-
/** The storage slot of the note. */
|
|
25
|
-
storageSlot: Fr;
|
|
26
|
-
/** The nonce injected into the note hash preimage by kernels. */
|
|
27
|
-
noteNonce: Fr;
|
|
28
|
-
/** A hash of the note as it gets stored in the note hash tree. */
|
|
29
|
-
noteHash: Fr;
|
|
30
|
-
/** The corresponding nullifier of the note. Undefined for pending notes. */
|
|
31
|
-
siloedNullifier?: Fr;
|
|
32
|
-
/** The note's leaf index in the note hash tree. Undefined for pending notes. */
|
|
33
|
-
index?: bigint;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// These interfaces contain the list of oracles required by aztec-nr in order to simulate and execute transactions, i.e.
|
|
37
|
-
// in order to call #[external("utility")] and #[external("private")] contract functions.
|
|
38
|
-
// The full list of aztec-nr oracles is larger and includes the oracles also required to run Noir tests - these reside
|
|
39
|
-
// in the TXE package.
|
|
1
|
+
import type { HandlersForPrefix } from './oracle_registry.js';
|
|
2
|
+
import type { ORACLE_REGISTRY } from './oracle_registry.js';
|
|
40
3
|
|
|
41
4
|
/**
|
|
42
|
-
* Miscellaneous oracle methods, not very Aztec-specific and expected to be available all scenarios in which aztec-nr
|
|
43
|
-
* code runs, except #[external("public")] functions (since those are transpiled to AVM bytecode, where there are no
|
|
5
|
+
* Miscellaneous oracle methods, not very Aztec-specific and expected to be available in all scenarios in which aztec-nr
|
|
6
|
+
* code runs, except #[external("public")] functions (since those are transpiled to AVM bytecode, where there are no
|
|
7
|
+
* oracles).
|
|
44
8
|
*/
|
|
45
|
-
export
|
|
46
|
-
isMisc: true;
|
|
47
|
-
|
|
48
|
-
utilityGetRandomField(): Fr;
|
|
49
|
-
utilityAssertCompatibleOracleVersion(version: number): void;
|
|
50
|
-
utilityDebugLog(level: number, message: string, fields: Fr[]): void;
|
|
51
|
-
}
|
|
9
|
+
export type IMiscOracle = HandlersForPrefix<typeof ORACLE_REGISTRY, 'misc'> & { isMisc: true };
|
|
52
10
|
|
|
53
11
|
/**
|
|
54
|
-
* Oracle methods associated with the execution of an Aztec #[external("utility")] function. Note that the
|
|
55
|
-
* expected to be available in these contexts.
|
|
12
|
+
* Oracle methods associated with the execution of an Aztec #[external("utility")] function. Note that the IMiscOracle
|
|
13
|
+
* methods are also expected to be available in these contexts.
|
|
56
14
|
*/
|
|
57
|
-
export
|
|
58
|
-
isUtility: true;
|
|
59
|
-
|
|
60
|
-
utilityGetUtilityContext(): Promise<UtilityContext>;
|
|
61
|
-
utilityGetKeyValidationRequest(pkMHash: Fr): Promise<KeyValidationRequest>;
|
|
62
|
-
utilityGetContractInstance(address: AztecAddress): Promise<ContractInstance>;
|
|
63
|
-
utilityGetMembershipWitness(blockNumber: number, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[] | undefined>;
|
|
64
|
-
utilityGetNullifierMembershipWitness(
|
|
65
|
-
blockNumber: number,
|
|
66
|
-
nullifier: Fr,
|
|
67
|
-
): Promise<NullifierMembershipWitness | undefined>;
|
|
68
|
-
utilityGetPublicDataWitness(blockNumber: number, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
|
|
69
|
-
utilityGetLowNullifierMembershipWitness(
|
|
70
|
-
blockNumber: number,
|
|
71
|
-
nullifier: Fr,
|
|
72
|
-
): Promise<NullifierMembershipWitness | undefined>;
|
|
73
|
-
utilityGetBlockHeader(blockNumber: number): Promise<BlockHeader | undefined>;
|
|
74
|
-
utilityGetPublicKeysAndPartialAddress(account: AztecAddress): Promise<CompleteAddress>;
|
|
75
|
-
utilityGetAuthWitness(messageHash: Fr): Promise<Fr[] | undefined>;
|
|
76
|
-
utilityGetNotes(
|
|
77
|
-
storageSlot: Fr,
|
|
78
|
-
numSelects: number,
|
|
79
|
-
selectByIndexes: number[],
|
|
80
|
-
selectByOffsets: number[],
|
|
81
|
-
selectByLengths: number[],
|
|
82
|
-
selectValues: Fr[],
|
|
83
|
-
selectComparators: number[],
|
|
84
|
-
sortByIndexes: number[],
|
|
85
|
-
sortByOffsets: number[],
|
|
86
|
-
sortByLengths: number[],
|
|
87
|
-
sortOrder: number[],
|
|
88
|
-
limit: number,
|
|
89
|
-
offset: number,
|
|
90
|
-
status: NoteStatus,
|
|
91
|
-
): Promise<NoteData[]>;
|
|
92
|
-
utilityCheckNullifierExists(innerNullifier: Fr): Promise<boolean>;
|
|
93
|
-
utilityGetL1ToL2MembershipWitness(
|
|
94
|
-
contractAddress: AztecAddress,
|
|
95
|
-
messageHash: Fr,
|
|
96
|
-
secret: Fr,
|
|
97
|
-
): Promise<MessageLoadOracleInputs<typeof L1_TO_L2_MSG_TREE_HEIGHT>>;
|
|
98
|
-
utilityStorageRead(
|
|
99
|
-
contractAddress: AztecAddress,
|
|
100
|
-
startStorageSlot: Fr,
|
|
101
|
-
blockNumber: number,
|
|
102
|
-
numberOfElements: number,
|
|
103
|
-
): Promise<Fr[]>;
|
|
104
|
-
utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr): Promise<void>;
|
|
105
|
-
utilityValidateEnqueuedNotesAndEvents(
|
|
106
|
-
contractAddress: AztecAddress,
|
|
107
|
-
noteValidationRequestsArrayBaseSlot: Fr,
|
|
108
|
-
eventValidationRequestsArrayBaseSlot: Fr,
|
|
109
|
-
): Promise<void>;
|
|
110
|
-
utilityBulkRetrieveLogs(
|
|
111
|
-
contractAddress: AztecAddress,
|
|
112
|
-
logRetrievalRequestsArrayBaseSlot: Fr,
|
|
113
|
-
logRetrievalResponsesArrayBaseSlot: Fr,
|
|
114
|
-
): Promise<void>;
|
|
115
|
-
utilityStoreCapsule(contractAddress: AztecAddress, key: Fr, capsule: Fr[]): Promise<void>;
|
|
116
|
-
utilityLoadCapsule(contractAddress: AztecAddress, key: Fr): Promise<Fr[] | null>;
|
|
117
|
-
utilityDeleteCapsule(contractAddress: AztecAddress, key: Fr): Promise<void>;
|
|
118
|
-
utilityCopyCapsule(contractAddress: AztecAddress, srcKey: Fr, dstKey: Fr, numEntries: number): Promise<void>;
|
|
119
|
-
utilityAes128Decrypt(ciphertext: Buffer, iv: Buffer, symKey: Buffer): Promise<Buffer>;
|
|
120
|
-
utilityGetSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
|
|
121
|
-
}
|
|
15
|
+
export type IUtilityExecutionOracle = HandlersForPrefix<typeof ORACLE_REGISTRY, 'utl'> & { isUtility: true };
|
|
122
16
|
|
|
123
17
|
/**
|
|
124
|
-
* Oracle methods associated with the execution of an Aztec #[external("private")] function. Note that both the
|
|
125
|
-
* IUtilityExecutionOracle are also expected to be available in these contexts.
|
|
18
|
+
* Oracle methods associated with the execution of an Aztec #[external("private")] function. Note that both the
|
|
19
|
+
* IMiscOracle and IUtilityExecutionOracle methods are also expected to be available in these contexts.
|
|
126
20
|
*/
|
|
127
|
-
export
|
|
128
|
-
isPrivate: true;
|
|
129
|
-
|
|
130
|
-
privateStoreInExecutionCache(values: Fr[], hash: Fr): void;
|
|
131
|
-
privateLoadFromExecutionCache(hash: Fr): Promise<Fr[]>;
|
|
132
|
-
privateNotifyCreatedNote(storageSlot: Fr, noteTypeId: NoteSelector, note: Fr[], noteHash: Fr, counter: number): void;
|
|
133
|
-
privateNotifyNullifiedNote(innerNullifier: Fr, noteHash: Fr, counter: number): Promise<void>;
|
|
134
|
-
privateNotifyCreatedNullifier(innerNullifier: Fr): Promise<void>;
|
|
135
|
-
privateNotifyCreatedContractClassLog(log: ContractClassLog, counter: number): void;
|
|
136
|
-
privateCallPrivateFunction(
|
|
137
|
-
targetContractAddress: AztecAddress,
|
|
138
|
-
functionSelector: FunctionSelector,
|
|
139
|
-
argsHash: Fr,
|
|
140
|
-
sideEffectCounter: number,
|
|
141
|
-
isStaticCall: boolean,
|
|
142
|
-
): Promise<{ endSideEffectCounter: Fr; returnsHash: Fr }>;
|
|
143
|
-
privateNotifyEnqueuedPublicFunctionCall(
|
|
144
|
-
targetContractAddress: AztecAddress,
|
|
145
|
-
calldataHash: Fr,
|
|
146
|
-
sideEffectCounter: number,
|
|
147
|
-
isStaticCall: boolean,
|
|
148
|
-
): Promise<void>;
|
|
149
|
-
privateNotifySetPublicTeardownFunctionCall(
|
|
150
|
-
targetContractAddress: AztecAddress,
|
|
151
|
-
calldataHash: Fr,
|
|
152
|
-
sideEffectCounter: number,
|
|
153
|
-
isStaticCall: boolean,
|
|
154
|
-
): Promise<void>;
|
|
155
|
-
privateNotifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void>;
|
|
156
|
-
privateGetSenderForTags(): Promise<AztecAddress | undefined>;
|
|
157
|
-
privateSetSenderForTags(senderForTags: AztecAddress): Promise<void>;
|
|
158
|
-
privateGetNextAppTagAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<Tag>;
|
|
159
|
-
utilityEmitOffchainEffect(data: Fr[]): Promise<void>;
|
|
160
|
-
}
|
|
21
|
+
export type IPrivateExecutionOracle = HandlersForPrefix<typeof ORACLE_REGISTRY, 'prv'> & { isPrivate: true };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
3
|
import type { Note } from '@aztec/stdlib/note';
|
|
4
4
|
|
|
@@ -18,35 +18,51 @@ function fromRawData(nonzeroNoteHashCounter: boolean, maybeNoteNonce: Fr): { sta
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Packs a note in a format that is compatible with the default Packable implementation of the
|
|
21
|
+
* Packs a note in a format that is compatible with the default Packable implementation of the hinted note.
|
|
22
22
|
*
|
|
23
23
|
* @dev Unlike the default Packable implementation, this function first constructs the note metadata from the inputs
|
|
24
|
-
* and only after that it packs the
|
|
24
|
+
* and only after that it packs the hinted note. Hence it doesn't map one to one with `HintedNote::pack()`.
|
|
25
25
|
*
|
|
26
26
|
* @param contractAddress - The address of the contract that owns the note
|
|
27
|
+
* @param owner - The owner of the note
|
|
28
|
+
* @param randomness - The randomness injected into the note to get the hiding property of commitments
|
|
29
|
+
* @param storageSlot - The storage slot of the note
|
|
27
30
|
* @param noteNonce - The nonce injected into the note hash preimage by kernels.
|
|
28
|
-
* @param
|
|
31
|
+
* @param isPending - True if the note is pending, false if settled
|
|
29
32
|
* @param note - The note content containing the actual note data
|
|
30
33
|
* @returns The packed note as an array of field elements
|
|
31
34
|
*/
|
|
32
|
-
export function
|
|
35
|
+
export function packAsHintedNote({
|
|
33
36
|
contractAddress,
|
|
37
|
+
owner,
|
|
38
|
+
randomness,
|
|
39
|
+
storageSlot,
|
|
34
40
|
noteNonce,
|
|
35
|
-
|
|
41
|
+
isPending,
|
|
36
42
|
note,
|
|
37
43
|
}: {
|
|
38
44
|
contractAddress: AztecAddress;
|
|
45
|
+
owner: AztecAddress;
|
|
46
|
+
randomness: Fr;
|
|
47
|
+
storageSlot: Fr;
|
|
39
48
|
noteNonce: Fr;
|
|
40
|
-
|
|
49
|
+
isPending: boolean;
|
|
41
50
|
note: Note;
|
|
42
|
-
}) {
|
|
43
|
-
// If
|
|
44
|
-
const
|
|
45
|
-
const nonzeroNoteHashCounter = noteIsTransient ? true : false;
|
|
51
|
+
}): Fr[] {
|
|
52
|
+
// If the note is pending it means it has a non-zero note hash counter associated with it.
|
|
53
|
+
const nonZeroNoteHashCounter = isPending;
|
|
46
54
|
|
|
47
|
-
// To pack the note as
|
|
48
|
-
const noteMetadata = fromRawData(
|
|
55
|
+
// To pack the note as hinted note we first need to reconstruct the note metadata.
|
|
56
|
+
const noteMetadata = fromRawData(nonZeroNoteHashCounter, noteNonce);
|
|
49
57
|
|
|
50
|
-
// Pack
|
|
51
|
-
return [
|
|
58
|
+
// Pack in order: note, contract_address, owner, randomness, storage_slot, metadata (stage, maybe_note_nonce)
|
|
59
|
+
return [
|
|
60
|
+
...note.items,
|
|
61
|
+
contractAddress.toField(),
|
|
62
|
+
owner.toField(),
|
|
63
|
+
randomness,
|
|
64
|
+
storageSlot,
|
|
65
|
+
new Fr(noteMetadata.stage),
|
|
66
|
+
noteMetadata.maybeNoteNonce,
|
|
67
|
+
];
|
|
52
68
|
}
|