@aztec/pxe 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dest/bin/check_oracle_version.d.ts +1 -1
- package/dest/bin/check_oracle_version.js +110 -10
- package/dest/block_synchronizer/block_synchronizer.d.ts +39 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
- package/dest/{synchronizer/synchronizer.js → block_synchronizer/block_synchronizer.js} +23 -23
- 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 +9 -17
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +10 -16
- package/dest/config/package_info.d.ts +1 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +44 -15
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +142 -57
- package/dest/contract_function_simulator/execution_note_cache.d.ts +11 -9
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +28 -17
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +16 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +26 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts +2 -2
- package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.d.ts +4 -2
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +2 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +3 -3
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +8 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +6 -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 +12 -3
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +22 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.js +33 -0
- package/dest/contract_function_simulator/oracle/index.d.ts +2 -2
- package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/index.js +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +103 -0
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/interfaces.js +4 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +2 -4
- 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 +10 -4
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +10 -5
- package/dest/contract_function_simulator/oracle/oracle.d.ts +17 -15
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +101 -81
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +11 -12
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +15 -24
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +51 -25
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +103 -27
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +65 -36
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +171 -69
- package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
- package/dest/contract_function_simulator/pick_notes.js +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
- package/dest/contract_function_simulator/proxied_node.d.ts +1 -1
- package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.d.ts +31 -0
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
- package/dest/debug/pxe_debug_utils.js +37 -0
- package/dest/entrypoints/client/bundle/index.d.ts +4 -3
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +2 -2
- package/dest/entrypoints/client/bundle/utils.d.ts +9 -9
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +21 -12
- package/dest/entrypoints/client/lazy/index.d.ts +4 -3
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +2 -2
- package/dest/entrypoints/client/lazy/utils.d.ts +8 -8
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +20 -11
- package/dest/entrypoints/pxe_creation_options.d.ts +5 -2
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +5 -3
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +3 -2
- package/dest/entrypoints/server/utils.d.ts +5 -24
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +17 -45
- package/dest/error_enriching.d.ts +11 -0
- package/dest/error_enriching.d.ts.map +1 -0
- package/dest/{pxe_service/error_enriching.js → error_enriching.js} +9 -6
- package/dest/events/event_service.d.ts +15 -0
- package/dest/events/event_service.d.ts.map +1 -0
- package/dest/events/event_service.js +47 -0
- package/dest/events/index.d.ts +2 -0
- package/dest/events/index.d.ts.map +1 -0
- package/dest/events/index.js +1 -0
- package/dest/events/private_event_filter_validator.d.ts +9 -0
- package/dest/events/private_event_filter_validator.d.ts.map +1 -0
- package/dest/events/private_event_filter_validator.js +39 -0
- package/dest/logs/log_service.d.ts +26 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +120 -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 +48 -0
- package/dest/notes/note_service.d.ts.map +1 -0
- package/dest/notes/note_service.js +152 -0
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.js +2 -2
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +3 -3
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -1
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.js +7 -7
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +1 -1
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +6 -6
- package/dest/private_kernel/hints/index.d.ts +1 -1
- package/dest/private_kernel/index.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +9 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +38 -32
- package/dest/private_kernel/private_kernel_oracle.d.ts +3 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +10 -9
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +7 -7
- package/dest/public_storage/public_storage_service.d.ts +24 -0
- package/dest/public_storage/public_storage_service.d.ts.map +1 -0
- package/dest/public_storage/public_storage_service.js +26 -0
- package/dest/pxe.d.ts +232 -0
- package/dest/pxe.d.ts.map +1 -0
- package/dest/{pxe_service/pxe_service.js → pxe.js} +299 -324
- 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} +1 -4
- 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 +9 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
- package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +2 -12
- 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 +57 -0
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/{capsule_data_provider/capsule_data_provider.js → capsule_store/capsule_store.js} +34 -10
- 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_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +10 -18
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +46 -18
- package/dest/storage/contract_store/index.d.ts +2 -0
- package/dest/storage/contract_store/index.d.ts.map +1 -0
- package/dest/storage/contract_store/index.js +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
- package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +1 -1
- package/dest/storage/index.d.ts +8 -9
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -8
- package/dest/storage/metadata.d.ts +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 +84 -0
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/{note_data_provider/note_data_provider.js → note_store/note_store.js} +144 -82
- package/dest/storage/private_event_store/private_event_store.d.ts +56 -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 +157 -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 +21 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/recipient_tagging_store.js +42 -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 +30 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +67 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_tagging_store.js +196 -0
- package/dest/tagging/index.d.ts +16 -0
- package/dest/tagging/index.d.ts.map +1 -0
- package/dest/tagging/index.js +23 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +29 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +20 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +32 -0
- 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/sender_sync/utils/load_and_store_new_tagging_indexes.js +55 -0
- package/dest/tree_membership/tree_membership_service.d.ts +52 -0
- package/dest/tree_membership/tree_membership_service.d.ts.map +1 -0
- package/dest/tree_membership/tree_membership_service.js +84 -0
- package/package.json +22 -24
- package/src/bin/check_oracle_version.ts +134 -10
- package/src/{synchronizer/synchronizer.ts → block_synchronizer/block_synchronizer.ts} +22 -23
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +18 -32
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +233 -75
- package/src/contract_function_simulator/execution_note_cache.ts +33 -17
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +32 -0
- package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
- package/src/contract_function_simulator/index.ts +3 -1
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +10 -5
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +14 -2
- package/src/contract_function_simulator/noir-structs/utility_context.ts +42 -0
- package/src/contract_function_simulator/oracle/index.ts +1 -1
- package/src/contract_function_simulator/oracle/interfaces.ts +175 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +21 -5
- package/src/contract_function_simulator/oracle/oracle.ts +135 -80
- package/src/contract_function_simulator/oracle/private_execution.ts +22 -28
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +200 -56
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +260 -109
- package/src/contract_function_simulator/pick_notes.ts +1 -1
- package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
- package/src/debug/pxe_debug_utils.ts +48 -0
- package/src/entrypoints/client/bundle/index.ts +3 -2
- package/src/entrypoints/client/bundle/utils.ts +21 -23
- package/src/entrypoints/client/lazy/index.ts +3 -2
- package/src/entrypoints/client/lazy/utils.ts +20 -23
- package/src/entrypoints/pxe_creation_options.ts +4 -1
- package/src/entrypoints/server/index.ts +4 -2
- package/src/entrypoints/server/utils.ts +20 -68
- package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +11 -15
- package/src/events/event_service.ts +77 -0
- package/src/events/index.ts +1 -0
- package/src/events/private_event_filter_validator.ts +48 -0
- package/src/logs/log_service.ts +202 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +200 -0
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +5 -9
- package/src/private_kernel/hints/compute_tx_include_by_timestamp.ts +6 -6
- package/src/private_kernel/private_kernel_execution_prover.ts +51 -43
- package/src/private_kernel/private_kernel_oracle.ts +2 -1
- package/src/private_kernel/private_kernel_oracle_impl.ts +10 -9
- package/src/public_storage/public_storage_service.ts +33 -0
- package/src/{pxe_service/pxe_service.ts → pxe.ts} +349 -410
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -7
- 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} +2 -17
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/{capsule_data_provider/capsule_data_provider.ts → capsule_store/capsule_store.ts} +34 -12
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +67 -28
- package/src/storage/contract_store/index.ts +1 -0
- package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +1 -1
- package/src/storage/index.ts +7 -8
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/{note_data_provider/note_data_provider.ts → note_store/note_store.ts} +173 -111
- package/src/storage/private_event_store/private_event_store.ts +213 -0
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +53 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +42 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +244 -0
- package/src/tagging/index.ts +28 -0
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +129 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +43 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +96 -0
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +44 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +72 -0
- package/src/tree_membership/tree_membership_service.ts +112 -0
- package/dest/bin/index.d.ts +0 -3
- package/dest/bin/index.d.ts.map +0 -1
- package/dest/bin/index.js +0 -48
- package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -285
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
- package/dest/contract_function_simulator/execution_data_provider.js +0 -14
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +0 -87
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +0 -1
- package/dest/contract_function_simulator/oracle/typed_oracle.js +0 -146
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -158
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -701
- package/dest/contract_function_simulator/tagging_utils.d.ts +0 -17
- package/dest/contract_function_simulator/tagging_utils.d.ts.map +0 -1
- package/dest/contract_function_simulator/tagging_utils.js +0 -23
- package/dest/pxe_service/error_enriching.d.ts +0 -11
- package/dest/pxe_service/error_enriching.d.ts.map +0 -1
- package/dest/pxe_service/index.d.ts +0 -3
- package/dest/pxe_service/index.d.ts.map +0 -1
- package/dest/pxe_service/index.js +0 -2
- package/dest/pxe_service/pxe_service.d.ts +0 -100
- package/dest/pxe_service/pxe_service.d.ts.map +0 -1
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -13
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.d.ts +0 -2
- package/dest/storage/address_data_provider/index.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.js +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -27
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/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.map +0 -1
- package/dest/storage/contract_data_provider/index.d.ts +0 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/data_provider.d.ts +0 -4
- package/dest/storage/data_provider.d.ts.map +0 -1
- package/dest/storage/data_provider.js +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_dao.d.ts +0 -100
- package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_dao.js +0 -102
- package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -20
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -37
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -96
- package/dest/storage/sync_data_provider/index.d.ts +0 -2
- package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
- package/dest/storage/sync_data_provider/index.js +0 -1
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -12
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.d.ts +0 -2
- package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.js +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -18
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -82
- package/dest/synchronizer/index.d.ts +0 -2
- package/dest/synchronizer/index.d.ts.map +0 -1
- package/dest/synchronizer/index.js +0 -1
- package/dest/synchronizer/synchronizer.d.ts +0 -35
- package/dest/synchronizer/synchronizer.d.ts.map +0 -1
- package/dest/test/pxe_test_suite.d.ts +0 -3
- package/dest/test/pxe_test_suite.d.ts.map +0 -1
- package/dest/test/pxe_test_suite.js +0 -97
- package/src/bin/index.ts +0 -62
- package/src/contract_function_simulator/execution_data_provider.ts +0 -361
- package/src/contract_function_simulator/oracle/typed_oracle.ts +0 -289
- package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1020
- package/src/contract_function_simulator/tagging_utils.ts +0 -32
- package/src/pxe_service/index.ts +0 -2
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/data_provider.ts +0 -3
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/note_data_provider/note_dao.ts +0 -154
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -134
- package/src/storage/sync_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -123
- package/src/synchronizer/index.ts +0 -1
- package/src/test/pxe_test_suite.ts +0 -113
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS, PRIVATE_CONTEXT_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import { Timer } from '@aztec/foundation/timer';
|
|
5
|
+
import type { KeyStore } from '@aztec/key-store';
|
|
5
6
|
import { type CircuitSimulator, toACVMWitness } from '@aztec/simulator/client';
|
|
6
7
|
import {
|
|
7
8
|
type FunctionAbi,
|
|
8
9
|
type FunctionArtifact,
|
|
10
|
+
type FunctionCall,
|
|
9
11
|
FunctionSelector,
|
|
10
12
|
type NoteSelector,
|
|
11
13
|
countArgumentsSize,
|
|
12
14
|
} from '@aztec/stdlib/abi';
|
|
13
15
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
14
16
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
15
|
-
import { computeUniqueNoteHash, siloNoteHash } from '@aztec/stdlib/hash';
|
|
17
|
+
import { computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
|
|
18
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
16
19
|
import { PrivateContextInputs } from '@aztec/stdlib/kernel';
|
|
17
|
-
import type
|
|
20
|
+
import { type ContractClassLog, DirectionalAppTaggingSecret, type PreTag } from '@aztec/stdlib/logs';
|
|
21
|
+
import { Tag } from '@aztec/stdlib/logs';
|
|
18
22
|
import { Note, type NoteStatus } from '@aztec/stdlib/note';
|
|
19
23
|
import {
|
|
20
24
|
type BlockHeader,
|
|
@@ -26,18 +30,31 @@ import {
|
|
|
26
30
|
type TxContext,
|
|
27
31
|
} from '@aztec/stdlib/tx';
|
|
28
32
|
|
|
29
|
-
import
|
|
33
|
+
import { NoteService } from '../../notes/note_service.js';
|
|
34
|
+
import type { AddressStore } from '../../storage/address_store/address_store.js';
|
|
35
|
+
import type { AnchorBlockStore } from '../../storage/anchor_block_store/anchor_block_store.js';
|
|
36
|
+
import type { CapsuleStore } from '../../storage/capsule_store/capsule_store.js';
|
|
37
|
+
import type { ContractStore } from '../../storage/contract_store/contract_store.js';
|
|
38
|
+
import type { NoteStore } from '../../storage/note_store/note_store.js';
|
|
39
|
+
import type { PrivateEventStore } from '../../storage/private_event_store/private_event_store.js';
|
|
40
|
+
import type { RecipientTaggingStore } from '../../storage/tagging_store/recipient_tagging_store.js';
|
|
41
|
+
import type { SenderAddressBookStore } from '../../storage/tagging_store/sender_address_book_store.js';
|
|
42
|
+
import type { SenderTaggingStore } from '../../storage/tagging_store/sender_tagging_store.js';
|
|
43
|
+
import { syncSenderTaggingIndexes } from '../../tagging/index.js';
|
|
30
44
|
import type { ExecutionNoteCache } from '../execution_note_cache.js';
|
|
45
|
+
import { ExecutionTaggingIndexCache } from '../execution_tagging_index_cache.js';
|
|
31
46
|
import type { HashedValuesCache } from '../hashed_values_cache.js';
|
|
32
47
|
import { pickNotes } from '../pick_notes.js';
|
|
48
|
+
import type { IPrivateExecutionOracle, NoteData } from './interfaces.js';
|
|
33
49
|
import { executePrivateFunction, verifyCurrentClassId } from './private_execution.js';
|
|
34
|
-
import type { NoteData } from './typed_oracle.js';
|
|
35
50
|
import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
36
51
|
|
|
37
52
|
/**
|
|
38
53
|
* The execution oracle for the private part of a transaction.
|
|
39
54
|
*/
|
|
40
|
-
export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
55
|
+
export class PrivateExecutionOracle extends UtilityExecutionOracle implements IPrivateExecutionOracle {
|
|
56
|
+
isPrivate = true as const;
|
|
57
|
+
|
|
41
58
|
/**
|
|
42
59
|
* New notes created during this execution.
|
|
43
60
|
* It's possible that a note in this list has been nullified (in the same or other executions) and doesn't exist in
|
|
@@ -61,29 +78,61 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
61
78
|
private contractClassLogs: CountedContractClassLog[] = [];
|
|
62
79
|
private offchainEffects: { data: Fr[] }[] = [];
|
|
63
80
|
private nestedExecutionResults: PrivateCallExecutionResult[] = [];
|
|
64
|
-
private senderForTags?: AztecAddress;
|
|
65
81
|
|
|
66
82
|
constructor(
|
|
67
83
|
private readonly argsHash: Fr,
|
|
68
84
|
private readonly txContext: TxContext,
|
|
69
85
|
private readonly callContext: CallContext,
|
|
70
86
|
/** Header of a block whose state is used during private execution (not the block the transaction is included in). */
|
|
71
|
-
protected readonly
|
|
87
|
+
protected override readonly anchorBlockHeader: BlockHeader,
|
|
88
|
+
/** Needed to trigger contract synchronization before nested calls */
|
|
89
|
+
private readonly utilityExecutor: (call: FunctionCall) => Promise<void>,
|
|
72
90
|
/** List of transient auth witnesses to be used during this simulation */
|
|
73
91
|
authWitnesses: AuthWitness[],
|
|
74
92
|
capsules: Capsule[],
|
|
75
93
|
private readonly executionCache: HashedValuesCache,
|
|
76
94
|
private readonly noteCache: ExecutionNoteCache,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
95
|
+
private readonly taggingIndexCache: ExecutionTaggingIndexCache,
|
|
96
|
+
contractStore: ContractStore,
|
|
97
|
+
noteStore: NoteStore,
|
|
98
|
+
keyStore: KeyStore,
|
|
99
|
+
addressStore: AddressStore,
|
|
100
|
+
aztecNode: AztecNode,
|
|
101
|
+
anchorBlockStore: AnchorBlockStore,
|
|
102
|
+
private readonly senderTaggingStore: SenderTaggingStore,
|
|
103
|
+
recipientTaggingStore: RecipientTaggingStore,
|
|
104
|
+
senderAddressBookStore: SenderAddressBookStore,
|
|
105
|
+
capsuleStore: CapsuleStore,
|
|
106
|
+
privateEventStore: PrivateEventStore,
|
|
107
|
+
private totalPublicCalldataCount: number = 0,
|
|
80
108
|
protected sideEffectCounter: number = 0,
|
|
81
109
|
log = createLogger('simulator:client_execution_context'),
|
|
82
110
|
scopes?: AztecAddress[],
|
|
83
|
-
senderForTags?: AztecAddress,
|
|
111
|
+
private senderForTags?: AztecAddress,
|
|
112
|
+
private simulator?: CircuitSimulator,
|
|
84
113
|
) {
|
|
85
|
-
super(
|
|
86
|
-
|
|
114
|
+
super(
|
|
115
|
+
callContext.contractAddress,
|
|
116
|
+
authWitnesses,
|
|
117
|
+
capsules,
|
|
118
|
+
anchorBlockHeader,
|
|
119
|
+
contractStore,
|
|
120
|
+
noteStore,
|
|
121
|
+
keyStore,
|
|
122
|
+
addressStore,
|
|
123
|
+
aztecNode,
|
|
124
|
+
anchorBlockStore,
|
|
125
|
+
recipientTaggingStore,
|
|
126
|
+
senderAddressBookStore,
|
|
127
|
+
capsuleStore,
|
|
128
|
+
privateEventStore,
|
|
129
|
+
log,
|
|
130
|
+
scopes,
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
public getPrivateContextInputs(): PrivateContextInputs {
|
|
135
|
+
return new PrivateContextInputs(this.callContext, this.anchorBlockHeader, this.txContext, this.sideEffectCounter);
|
|
87
136
|
}
|
|
88
137
|
|
|
89
138
|
// We still need this function until we can get user-defined ordering of structs for fn arguments
|
|
@@ -102,13 +151,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
102
151
|
throw new Error(`Invalid arguments size: expected ${argumentsSize}, got ${args?.length}`);
|
|
103
152
|
}
|
|
104
153
|
|
|
105
|
-
const
|
|
106
|
-
this.callContext,
|
|
107
|
-
this.historicalHeader,
|
|
108
|
-
this.txContext,
|
|
109
|
-
this.sideEffectCounter,
|
|
110
|
-
);
|
|
111
|
-
const privateContextInputsAsFields = privateContextInputs.toFields();
|
|
154
|
+
const privateContextInputsAsFields = this.getPrivateContextInputs().toFields();
|
|
112
155
|
if (privateContextInputsAsFields.length !== PRIVATE_CONTEXT_INPUTS_LENGTH) {
|
|
113
156
|
throw new Error('Invalid private context inputs size');
|
|
114
157
|
}
|
|
@@ -150,6 +193,13 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
150
193
|
return this.offchainEffects;
|
|
151
194
|
}
|
|
152
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Returns the pre-tags that were used in this execution (and that need to be stored in the db).
|
|
198
|
+
*/
|
|
199
|
+
public getUsedPreTags(): PreTag[] {
|
|
200
|
+
return this.taggingIndexCache.getUsedPreTags();
|
|
201
|
+
}
|
|
202
|
+
|
|
153
203
|
/**
|
|
154
204
|
* Return the nested execution results during this execution.
|
|
155
205
|
*/
|
|
@@ -167,7 +217,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
167
217
|
* The value persists through nested calls, meaning all calls down the stack will use the same
|
|
168
218
|
* 'senderForTags' value (unless it is replaced).
|
|
169
219
|
*/
|
|
170
|
-
public
|
|
220
|
+
public privateGetSenderForTags(): Promise<AztecAddress | undefined> {
|
|
171
221
|
return Promise.resolve(this.senderForTags);
|
|
172
222
|
}
|
|
173
223
|
|
|
@@ -182,17 +232,70 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
182
232
|
* through nested calls, meaning all calls down the stack will use the same 'senderForTags'
|
|
183
233
|
* value (unless it is replaced by another call to this setter).
|
|
184
234
|
*/
|
|
185
|
-
public
|
|
235
|
+
public privateSetSenderForTags(senderForTags: AztecAddress): Promise<void> {
|
|
186
236
|
this.senderForTags = senderForTags;
|
|
187
237
|
return Promise.resolve();
|
|
188
238
|
}
|
|
189
239
|
|
|
240
|
+
/**
|
|
241
|
+
* Returns the next app tag for a given sender and recipient pair.
|
|
242
|
+
* @param sender - The address sending the log
|
|
243
|
+
* @param recipient - The address receiving the log
|
|
244
|
+
* @returns An app tag to be used in a log.
|
|
245
|
+
*/
|
|
246
|
+
public async privateGetNextAppTagAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<Tag> {
|
|
247
|
+
const secret = await this.#calculateDirectionalAppTaggingSecret(this.contractAddress, sender, recipient);
|
|
248
|
+
|
|
249
|
+
const index = await this.#getIndexToUseForSecret(secret);
|
|
250
|
+
this.log.debug(
|
|
251
|
+
`Incrementing tagging index for sender: ${sender}, recipient: ${recipient}, contract: ${this.contractAddress} to ${index}`,
|
|
252
|
+
);
|
|
253
|
+
this.taggingIndexCache.setLastUsedIndex(secret, index);
|
|
254
|
+
|
|
255
|
+
return Tag.compute({ secret, index });
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
async #calculateDirectionalAppTaggingSecret(
|
|
259
|
+
contractAddress: AztecAddress,
|
|
260
|
+
sender: AztecAddress,
|
|
261
|
+
recipient: AztecAddress,
|
|
262
|
+
) {
|
|
263
|
+
const senderCompleteAddress = await this.getCompleteAddress(sender);
|
|
264
|
+
const senderIvsk = await this.keyStore.getMasterIncomingViewingSecretKey(sender);
|
|
265
|
+
return DirectionalAppTaggingSecret.compute(
|
|
266
|
+
senderCompleteAddress,
|
|
267
|
+
senderIvsk,
|
|
268
|
+
recipient,
|
|
269
|
+
contractAddress,
|
|
270
|
+
recipient,
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
async #getIndexToUseForSecret(secret: DirectionalAppTaggingSecret): Promise<number> {
|
|
275
|
+
// If we have the tagging index in the cache, we use it. If not we obtain it from the execution data provider.
|
|
276
|
+
const lastUsedIndexInTx = this.taggingIndexCache.getLastUsedIndex(secret);
|
|
277
|
+
|
|
278
|
+
if (lastUsedIndexInTx !== undefined) {
|
|
279
|
+
return lastUsedIndexInTx + 1;
|
|
280
|
+
} else {
|
|
281
|
+
// This is a tagging secret we've not yet used in this tx, so first sync our store to make sure its indices
|
|
282
|
+
// are up to date. We do this here because this store is not synced as part of the global sync because
|
|
283
|
+
// that'd be wasteful as most tagging secrets are not used in each tx.
|
|
284
|
+
await syncSenderTaggingIndexes(secret, this.contractAddress, this.aztecNode, this.senderTaggingStore);
|
|
285
|
+
|
|
286
|
+
const lastUsedIndex = await this.senderTaggingStore.getLastUsedIndex(secret);
|
|
287
|
+
// If lastUsedIndex is undefined, we've never used this secret, so start from 0
|
|
288
|
+
// Otherwise, the next index to use is one past the last used index
|
|
289
|
+
return lastUsedIndex === undefined ? 0 : lastUsedIndex + 1;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
190
293
|
/**
|
|
191
294
|
* Store values in the execution cache.
|
|
192
295
|
* @param values - Values to store.
|
|
193
296
|
* @returns The hash of the values.
|
|
194
297
|
*/
|
|
195
|
-
public
|
|
298
|
+
public privateStoreInExecutionCache(values: Fr[], hash: Fr) {
|
|
196
299
|
return this.executionCache.store(values, hash);
|
|
197
300
|
}
|
|
198
301
|
|
|
@@ -201,7 +304,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
201
304
|
* @param hash - Hash of the values.
|
|
202
305
|
* @returns The values.
|
|
203
306
|
*/
|
|
204
|
-
public
|
|
307
|
+
public privateLoadFromExecutionCache(hash: Fr): Promise<Fr[]> {
|
|
205
308
|
const preimage = this.executionCache.getPreimage(hash);
|
|
206
309
|
if (!preimage) {
|
|
207
310
|
throw new Error(`Preimage for hash ${hash.toString()} not found in cache`);
|
|
@@ -209,6 +312,23 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
209
312
|
return Promise.resolve(preimage);
|
|
210
313
|
}
|
|
211
314
|
|
|
315
|
+
override async utilityCheckNullifierExists(innerNullifier: Fr): Promise<boolean> {
|
|
316
|
+
// This oracle must be overridden because while utility execution can only meaningfully check if a nullifier exists
|
|
317
|
+
// in the synched block, during private execution there's also the possibility of it being pending, i.e. created
|
|
318
|
+
// in the current transaction.
|
|
319
|
+
|
|
320
|
+
this.log.debug(`Checking existence of inner nullifier ${innerNullifier}`, {
|
|
321
|
+
contractAddress: this.contractAddress,
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
const nullifier = (await siloNullifier(this.contractAddress, innerNullifier)).toBigInt();
|
|
325
|
+
|
|
326
|
+
return (
|
|
327
|
+
this.noteCache.getNullifiers(this.contractAddress).has(nullifier) ||
|
|
328
|
+
(await super.utilityCheckNullifierExists(innerNullifier))
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
|
|
212
332
|
/**
|
|
213
333
|
* Gets some notes for a storage slot.
|
|
214
334
|
*
|
|
@@ -217,6 +337,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
217
337
|
* Real notes coming from DB will have a leafIndex which
|
|
218
338
|
* represents their index in the note hash tree.
|
|
219
339
|
*
|
|
340
|
+
* @param owner - The owner of the notes. If undefined, returns notes for all owners.
|
|
220
341
|
* @param storageSlot - The storage slot.
|
|
221
342
|
* @param numSelects - The number of valid selects in selectBy and selectValues.
|
|
222
343
|
* @param selectBy - An array of indices of the fields to selects.
|
|
@@ -230,6 +351,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
230
351
|
* @returns Array of note data.
|
|
231
352
|
*/
|
|
232
353
|
public override async utilityGetNotes(
|
|
354
|
+
owner: AztecAddress | undefined,
|
|
233
355
|
storageSlot: Fr,
|
|
234
356
|
numSelects: number,
|
|
235
357
|
selectByIndexes: number[],
|
|
@@ -246,11 +368,14 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
246
368
|
status: NoteStatus,
|
|
247
369
|
): Promise<NoteData[]> {
|
|
248
370
|
// Nullified pending notes are already removed from the list.
|
|
249
|
-
const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, storageSlot);
|
|
371
|
+
const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, owner, storageSlot);
|
|
250
372
|
|
|
251
373
|
const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
|
|
252
|
-
|
|
374
|
+
|
|
375
|
+
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockStore);
|
|
376
|
+
const dbNotes = await noteService.getNotes(
|
|
253
377
|
this.callContext.contractAddress,
|
|
378
|
+
owner,
|
|
254
379
|
storageSlot,
|
|
255
380
|
status,
|
|
256
381
|
this.scopes,
|
|
@@ -300,15 +425,18 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
300
425
|
/**
|
|
301
426
|
* Keep track of the new note created during execution.
|
|
302
427
|
* It can be used in subsequent calls (or transactions when chaining txs is possible).
|
|
303
|
-
* @param
|
|
428
|
+
* @param owner - The owner of the note.
|
|
304
429
|
* @param storageSlot - The storage slot.
|
|
430
|
+
* @param randomness - The randomness injected into the note.
|
|
305
431
|
* @param noteTypeId - The type ID of the note.
|
|
306
432
|
* @param noteItems - The items to be included in a Note.
|
|
307
433
|
* @param noteHash - A hash of the new note.
|
|
308
434
|
* @returns
|
|
309
435
|
*/
|
|
310
|
-
public
|
|
436
|
+
public privateNotifyCreatedNote(
|
|
437
|
+
owner: AztecAddress,
|
|
311
438
|
storageSlot: Fr,
|
|
439
|
+
randomness: Fr,
|
|
312
440
|
noteTypeId: NoteSelector,
|
|
313
441
|
noteItems: Fr[],
|
|
314
442
|
noteHash: Fr,
|
|
@@ -317,6 +445,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
317
445
|
this.log.debug(`Notified of new note with inner hash ${noteHash}`, {
|
|
318
446
|
contractAddress: this.callContext.contractAddress,
|
|
319
447
|
storageSlot,
|
|
448
|
+
randomness,
|
|
320
449
|
noteTypeId,
|
|
321
450
|
counter,
|
|
322
451
|
});
|
|
@@ -325,7 +454,9 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
325
454
|
this.noteCache.addNewNote(
|
|
326
455
|
{
|
|
327
456
|
contractAddress: this.callContext.contractAddress,
|
|
457
|
+
owner,
|
|
328
458
|
storageSlot,
|
|
459
|
+
randomness,
|
|
329
460
|
noteNonce: Fr.ZERO, // Nonce cannot be known during private execution.
|
|
330
461
|
note,
|
|
331
462
|
siloedNullifier: undefined, // Siloed nullifier cannot be known for newly created note.
|
|
@@ -333,7 +464,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
333
464
|
},
|
|
334
465
|
counter,
|
|
335
466
|
);
|
|
336
|
-
this.newNotes.push(
|
|
467
|
+
this.newNotes.push(NoteAndSlot.from({ note, storageSlot, randomness, noteTypeId }));
|
|
337
468
|
}
|
|
338
469
|
|
|
339
470
|
/**
|
|
@@ -342,7 +473,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
342
473
|
* @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
|
|
343
474
|
* @param noteHash - A hash of the new note.
|
|
344
475
|
*/
|
|
345
|
-
public
|
|
476
|
+
public async privateNotifyNullifiedNote(innerNullifier: Fr, noteHash: Fr, counter: number) {
|
|
346
477
|
const nullifiedNoteHashCounter = await this.noteCache.nullifyNote(
|
|
347
478
|
this.callContext.contractAddress,
|
|
348
479
|
innerNullifier,
|
|
@@ -359,7 +490,8 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
359
490
|
* @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
|
|
360
491
|
* @param noteHash - A hash of the new note.
|
|
361
492
|
*/
|
|
362
|
-
public
|
|
493
|
+
public privateNotifyCreatedNullifier(innerNullifier: Fr) {
|
|
494
|
+
this.log.debug(`Notified of new inner nullifier ${innerNullifier}`, { contractAddress: this.contractAddress });
|
|
363
495
|
return this.noteCache.nullifierCreated(this.callContext.contractAddress, innerNullifier);
|
|
364
496
|
}
|
|
365
497
|
|
|
@@ -370,7 +502,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
370
502
|
* @param log - The contract class log to be emitted.
|
|
371
503
|
* @param counter - The contract class log's counter.
|
|
372
504
|
*/
|
|
373
|
-
public
|
|
505
|
+
public privateNotifyCreatedContractClassLog(log: ContractClassLog, counter: number) {
|
|
374
506
|
this.contractClassLogs.push(new CountedContractClassLog(log, counter));
|
|
375
507
|
const text = log.toBuffer().toString('hex');
|
|
376
508
|
this.log.verbose(
|
|
@@ -399,13 +531,19 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
399
531
|
* @param isStaticCall - Whether the call is a static call.
|
|
400
532
|
* @returns The execution result.
|
|
401
533
|
*/
|
|
402
|
-
|
|
534
|
+
async privateCallPrivateFunction(
|
|
403
535
|
targetContractAddress: AztecAddress,
|
|
404
536
|
functionSelector: FunctionSelector,
|
|
405
537
|
argsHash: Fr,
|
|
406
538
|
sideEffectCounter: number,
|
|
407
539
|
isStaticCall: boolean,
|
|
408
540
|
) {
|
|
541
|
+
if (!this.simulator) {
|
|
542
|
+
// In practice it is only when creating inline private contexts in a Noir test using TXE that we create an
|
|
543
|
+
// instance of this class without a simulator.
|
|
544
|
+
throw new Error('No simulator provided, cannot perform a nested private call');
|
|
545
|
+
}
|
|
546
|
+
|
|
409
547
|
const simulatorSetupTimer = new Timer();
|
|
410
548
|
this.log.debug(
|
|
411
549
|
`Calling private function ${targetContractAddress}:${functionSelector} from ${this.callContext.contractAddress}`,
|
|
@@ -413,9 +551,11 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
413
551
|
|
|
414
552
|
isStaticCall = isStaticCall || this.callContext.isStaticCall;
|
|
415
553
|
|
|
416
|
-
await verifyCurrentClassId(targetContractAddress, this.
|
|
554
|
+
await verifyCurrentClassId(targetContractAddress, this.aztecNode, this.contractStore, this.anchorBlockHeader);
|
|
555
|
+
|
|
556
|
+
await this.contractStore.syncPrivateState(targetContractAddress, functionSelector, this.utilityExecutor);
|
|
417
557
|
|
|
418
|
-
const targetArtifact = await this.
|
|
558
|
+
const targetArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(
|
|
419
559
|
targetContractAddress,
|
|
420
560
|
functionSelector,
|
|
421
561
|
);
|
|
@@ -428,18 +568,30 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
428
568
|
argsHash,
|
|
429
569
|
derivedTxContext,
|
|
430
570
|
derivedCallContext,
|
|
431
|
-
this.
|
|
571
|
+
this.anchorBlockHeader,
|
|
572
|
+
this.utilityExecutor,
|
|
432
573
|
this.authWitnesses,
|
|
433
574
|
this.capsules,
|
|
434
575
|
this.executionCache,
|
|
435
576
|
this.noteCache,
|
|
436
|
-
this.
|
|
437
|
-
this.
|
|
577
|
+
this.taggingIndexCache,
|
|
578
|
+
this.contractStore,
|
|
579
|
+
this.noteStore,
|
|
580
|
+
this.keyStore,
|
|
581
|
+
this.addressStore,
|
|
582
|
+
this.aztecNode,
|
|
583
|
+
this.anchorBlockStore,
|
|
584
|
+
this.senderTaggingStore,
|
|
585
|
+
this.recipientTaggingStore,
|
|
586
|
+
this.senderAddressBookStore,
|
|
587
|
+
this.capsuleStore,
|
|
588
|
+
this.privateEventStore,
|
|
438
589
|
this.totalPublicCalldataCount,
|
|
439
590
|
sideEffectCounter,
|
|
440
591
|
this.log,
|
|
441
592
|
this.scopes,
|
|
442
593
|
this.senderForTags,
|
|
594
|
+
this.simulator,
|
|
443
595
|
);
|
|
444
596
|
|
|
445
597
|
const setupTime = simulatorSetupTimer.ms();
|
|
@@ -490,7 +642,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
490
642
|
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
491
643
|
* @param isStaticCall - Whether the call is a static call.
|
|
492
644
|
*/
|
|
493
|
-
public
|
|
645
|
+
public privateNotifyEnqueuedPublicFunctionCall(
|
|
494
646
|
_targetContractAddress: AztecAddress,
|
|
495
647
|
calldataHash: Fr,
|
|
496
648
|
_sideEffectCounter: number,
|
|
@@ -507,7 +659,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
507
659
|
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
508
660
|
* @param isStaticCall - Whether the call is a static call.
|
|
509
661
|
*/
|
|
510
|
-
public
|
|
662
|
+
public privateNotifySetPublicTeardownFunctionCall(
|
|
511
663
|
_targetContractAddress: AztecAddress,
|
|
512
664
|
calldataHash: Fr,
|
|
513
665
|
_sideEffectCounter: number,
|
|
@@ -517,12 +669,14 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
517
669
|
return Promise.resolve();
|
|
518
670
|
}
|
|
519
671
|
|
|
520
|
-
public
|
|
521
|
-
minRevertibleSideEffectCounter: number,
|
|
522
|
-
): Promise<void> {
|
|
672
|
+
public privateNotifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void> {
|
|
523
673
|
return this.noteCache.setMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter);
|
|
524
674
|
}
|
|
525
675
|
|
|
676
|
+
public privateIsSideEffectCounterRevertible(sideEffectCounter: number): Promise<boolean> {
|
|
677
|
+
return Promise.resolve(this.noteCache.isSideEffectCounterRevertible(sideEffectCounter));
|
|
678
|
+
}
|
|
679
|
+
|
|
526
680
|
/**
|
|
527
681
|
* Derives the call context for a nested execution.
|
|
528
682
|
* @param targetContractAddress - The address of the contract being called.
|
|
@@ -544,20 +698,10 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
|
544
698
|
}
|
|
545
699
|
|
|
546
700
|
public getDebugFunctionName() {
|
|
547
|
-
return this.
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
public override async privateIncrementAppTaggingSecretIndexAsSender(sender: AztecAddress, recipient: AztecAddress) {
|
|
551
|
-
await this.executionDataProvider.incrementAppTaggingSecretIndexAsSender(this.contractAddress, sender, recipient);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
public override async utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr) {
|
|
555
|
-
await this.executionDataProvider.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
|
|
556
|
-
|
|
557
|
-
await this.executionDataProvider.removeNullifiedNotes(this.contractAddress);
|
|
701
|
+
return this.contractStore.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
|
|
558
702
|
}
|
|
559
703
|
|
|
560
|
-
public
|
|
704
|
+
public utilityEmitOffchainEffect(data: Fr[]): Promise<void> {
|
|
561
705
|
this.offchainEffects.push({ data });
|
|
562
706
|
return Promise.resolve();
|
|
563
707
|
}
|