@aztec/pxe 0.0.1-commit.fce3e4f → 0.0.1-commit.ffe5b04ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/access_scopes.d.ts +9 -0
- package/dest/access_scopes.d.ts.map +1 -0
- package/dest/access_scopes.js +6 -0
- package/dest/bin/check_oracle_version.js +105 -15
- package/dest/block_synchronizer/block_synchronizer.d.ts +45 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
- package/dest/block_synchronizer/block_synchronizer.js +153 -0
- package/dest/block_synchronizer/index.d.ts +2 -0
- package/dest/block_synchronizer/index.d.ts.map +1 -0
- package/dest/block_synchronizer/index.js +1 -0
- package/dest/config/index.d.ts +7 -5
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +18 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
- package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/benchmarked_node.js +77 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +76 -24
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +223 -78
- package/dest/contract_function_simulator/execution_note_cache.d.ts +21 -11
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +49 -31
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +6 -6
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +4 -4
- 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 +2 -2
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +7 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +6 -5
- 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 +7 -4
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +61 -50
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +4 -2
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +11 -7
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +14 -10
- package/dest/contract_function_simulator/oracle/oracle.d.ts +44 -42
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +191 -113
- 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 +3 -39
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +69 -60
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +131 -88
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +132 -54
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +231 -102
- package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
- package/dest/contract_function_simulator/pick_notes.js +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
- package/dest/contract_logging.d.ts +22 -0
- package/dest/contract_logging.d.ts.map +1 -0
- package/dest/contract_logging.js +23 -0
- package/dest/contract_sync/contract_sync_service.d.ts +43 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +97 -0
- package/dest/contract_sync/helpers.d.ts +29 -0
- package/dest/contract_sync/helpers.d.ts.map +1 -0
- package/dest/contract_sync/helpers.js +55 -0
- package/dest/debug/pxe_debug_utils.d.ts +45 -0
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
- package/dest/debug/pxe_debug_utils.js +48 -0
- package/dest/entrypoints/client/bundle/index.d.ts +4 -2
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +3 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +32 -9
- package/dest/entrypoints/client/lazy/index.d.ts +4 -2
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +3 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +33 -10
- package/dest/entrypoints/pxe_creation_options.d.ts +7 -3
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +6 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +5 -1
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +39 -16
- package/dest/error_enriching.d.ts +4 -4
- package/dest/error_enriching.d.ts.map +1 -1
- package/dest/error_enriching.js +6 -6
- package/dest/events/event_service.d.ts +15 -0
- package/dest/events/event_service.d.ts.map +1 -0
- package/dest/events/event_service.js +44 -0
- package/dest/events/index.d.ts +2 -0
- package/dest/events/index.d.ts.map +1 -0
- package/dest/events/index.js +1 -0
- package/dest/events/private_event_filter_validator.d.ts +9 -0
- package/dest/events/private_event_filter_validator.d.ts.map +1 -0
- package/dest/events/private_event_filter_validator.js +38 -0
- package/dest/job_coordinator/job_coordinator.d.ts +75 -0
- package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
- package/dest/job_coordinator/job_coordinator.js +94 -0
- package/dest/logs/log_service.d.ts +29 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +118 -0
- package/dest/notes/index.d.ts +2 -0
- package/dest/notes/index.d.ts.map +1 -0
- package/dest/notes/index.js +1 -0
- package/dest/notes/note_service.d.ts +49 -0
- package/dest/notes/note_service.d.ts.map +1 -0
- package/dest/notes/note_service.js +148 -0
- package/dest/notes_filter.d.ts +25 -0
- package/dest/notes_filter.d.ts.map +1 -0
- package/dest/notes_filter.js +4 -0
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +5 -4
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
- package/dest/private_kernel/hints/index.d.ts +3 -3
- package/dest/private_kernel/hints/index.d.ts.map +1 -1
- package/dest/private_kernel/hints/index.js +2 -2
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +29 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
- package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +141 -74
- package/dest/private_kernel/hints/test_utils.d.ts +122 -0
- package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
- package/dest/private_kernel/hints/test_utils.js +203 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +28 -21
- package/dest/private_kernel/private_kernel_oracle.d.ts +26 -25
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +94 -2
- package/dest/pxe.d.ts +114 -103
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +263 -256
- package/dest/storage/address_store/address_store.d.ts +11 -0
- package/dest/storage/address_store/address_store.d.ts.map +1 -0
- package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +13 -12
- package/dest/storage/address_store/index.d.ts +2 -0
- package/dest/storage/address_store/index.d.ts.map +1 -0
- package/dest/storage/address_store/index.js +1 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +17 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
- package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +10 -10
- package/dest/storage/{sync_data_provider → anchor_block_store}/index.d.ts +2 -2
- package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/index.js +1 -0
- package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_store.js +253 -0
- package/dest/storage/capsule_store/index.d.ts +2 -0
- package/dest/storage/capsule_store/index.d.ts.map +1 -0
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/contract_store/contract_store.d.ts +93 -0
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/contract_store/contract_store.js +309 -0
- package/dest/storage/contract_store/index.d.ts +2 -0
- package/dest/storage/contract_store/index.d.ts.map +1 -0
- package/dest/storage/contract_store/index.js +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
- package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +1 -1
- package/dest/storage/index.d.ts +8 -8
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -7
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/index.d.ts +3 -0
- package/dest/storage/note_store/index.d.ts.map +1 -0
- package/dest/storage/note_store/index.js +2 -0
- package/dest/storage/note_store/note_store.d.ts +83 -0
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/note_store/note_store.js +343 -0
- package/dest/storage/note_store/stored_note.d.ts +16 -0
- package/dest/storage/note_store/stored_note.d.ts.map +1 -0
- package/dest/storage/note_store/stored_note.js +43 -0
- package/dest/storage/private_event_store/private_event_store.d.ts +91 -0
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
- package/dest/storage/private_event_store/private_event_store.js +273 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
- package/dest/storage/private_event_store/stored_private_event.js +56 -0
- package/dest/storage/tagging_store/index.d.ts +4 -0
- package/dest/storage/tagging_store/index.d.ts.map +1 -0
- package/dest/storage/tagging_store/index.js +3 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/recipient_tagging_store.js +111 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_address_book_store.js +36 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +77 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_tagging_store.js +348 -0
- package/dest/tagging/constants.d.ts +2 -2
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +10 -2
- package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
- package/dest/tagging/get_all_logs_by_tags.js +60 -0
- package/dest/tagging/index.d.ts +16 -6
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +15 -5
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +33 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +17 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +71 -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 +29 -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 +59 -0
- package/package.json +28 -19
- package/src/access_scopes.ts +9 -0
- package/src/bin/check_oracle_version.ts +131 -20
- package/src/block_synchronizer/block_synchronizer.ts +178 -0
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +18 -4
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/benchmarked_node.ts +103 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +385 -110
- package/src/contract_function_simulator/execution_note_cache.ts +51 -28
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +6 -6
- package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
- package/src/contract_function_simulator/index.ts +1 -1
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +7 -3
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -1
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +6 -3
- package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
- package/src/contract_function_simulator/oracle/interfaces.ts +70 -52
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +27 -13
- package/src/contract_function_simulator/oracle/oracle.ts +213 -131
- package/src/contract_function_simulator/oracle/private_execution.ts +3 -69
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +182 -122
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +366 -114
- package/src/contract_function_simulator/pick_notes.ts +1 -1
- package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
- package/src/contract_logging.ts +39 -0
- package/src/contract_sync/contract_sync_service.ts +152 -0
- package/src/contract_sync/helpers.ts +98 -0
- package/src/debug/pxe_debug_utils.ts +93 -0
- package/src/entrypoints/client/bundle/index.ts +3 -1
- package/src/entrypoints/client/bundle/utils.ts +24 -17
- package/src/entrypoints/client/lazy/index.ts +3 -1
- package/src/entrypoints/client/lazy/utils.ts +25 -18
- package/src/entrypoints/pxe_creation_options.ts +6 -2
- package/src/entrypoints/server/index.ts +5 -1
- package/src/entrypoints/server/utils.ts +33 -41
- package/src/error_enriching.ts +7 -15
- package/src/events/event_service.ts +71 -0
- package/src/events/index.ts +1 -0
- package/src/events/private_event_filter_validator.ts +46 -0
- package/src/job_coordinator/job_coordinator.ts +150 -0
- package/src/logs/log_service.ts +213 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +196 -0
- package/src/notes_filter.ts +26 -0
- package/src/oracle_version.ts +5 -4
- package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
- package/src/private_kernel/hints/index.ts +2 -2
- package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +197 -139
- package/src/private_kernel/hints/test_utils.ts +325 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +32 -23
- package/src/private_kernel/private_kernel_oracle.ts +118 -37
- package/src/pxe.ts +403 -347
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +16 -16
- package/src/storage/address_store/index.ts +1 -0
- package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +10 -11
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/capsule_store/capsule_store.ts +315 -0
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/contract_store/contract_store.ts +429 -0
- package/src/storage/contract_store/index.ts +1 -0
- package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +1 -1
- package/src/storage/index.ts +7 -7
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/note_store/note_store.ts +418 -0
- package/src/storage/note_store/stored_note.ts +48 -0
- package/src/storage/private_event_store/private_event_store.ts +384 -0
- package/src/storage/private_event_store/stored_private_event.ts +73 -0
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +143 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +429 -0
- package/src/tagging/constants.ts +10 -2
- package/src/tagging/get_all_logs_by_tags.ts +92 -0
- package/src/tagging/index.ts +18 -5
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +140 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +44 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +94 -0
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +36 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +75 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -265
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
- package/dest/contract_function_simulator/execution_data_provider.js +0 -14
- package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
- package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
- package/dest/contract_function_simulator/proxied_node.js +0 -27
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -122
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -694
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -45
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.d.ts +0 -2
- package/dest/storage/address_data_provider/index.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.js +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -25
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -118
- package/dest/storage/capsule_data_provider/index.d.ts +0 -2
- package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts +0 -64
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.js +0 -193
- package/dest/storage/contract_data_provider/index.d.ts +0 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -83
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_data_provider.js +0 -311
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -37
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -105
- package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
- package/dest/storage/sync_data_provider/index.js +0 -1
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -10
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.d.ts +0 -2
- package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.js +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -40
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -89
- package/dest/synchronizer/index.d.ts +0 -2
- package/dest/synchronizer/index.d.ts.map +0 -1
- package/dest/synchronizer/index.js +0 -1
- package/dest/synchronizer/synchronizer.d.ts +0 -35
- package/dest/synchronizer/synchronizer.d.ts.map +0 -1
- package/dest/synchronizer/synchronizer.js +0 -101
- package/dest/tagging/siloed_tag.d.ts +0 -14
- package/dest/tagging/siloed_tag.d.ts.map +0 -1
- package/dest/tagging/siloed_tag.js +0 -20
- package/dest/tagging/tag.d.ts +0 -12
- package/dest/tagging/tag.d.ts.map +0 -1
- package/dest/tagging/tag.js +0 -17
- package/dest/tagging/utils.d.ts +0 -18
- package/dest/tagging/utils.d.ts.map +0 -1
- package/dest/tagging/utils.js +0 -24
- package/src/contract_function_simulator/execution_data_provider.ts +0 -333
- package/src/contract_function_simulator/proxied_node.ts +0 -33
- package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1008
- package/src/private_kernel/private_kernel_oracle_impl.ts +0 -132
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -147
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/contract_data_provider.ts +0 -277
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/note_data_provider/note_data_provider.ts +0 -399
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -143
- package/src/storage/sync_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -120
- package/src/synchronizer/index.ts +0 -1
- package/src/synchronizer/synchronizer.ts +0 -120
- package/src/tagging/siloed_tag.ts +0 -22
- package/src/tagging/tag.ts +0 -16
- package/src/tagging/utils.ts +0 -31
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { Point } from '@aztec/foundation/curves/grumpkin';
|
|
2
4
|
import { arrayOfArraysToBoundedVecOfArrays, bufferToBoundedVec, fromUintArray, fromUintBoundedVec, toACVMField } from '@aztec/simulator/client';
|
|
3
5
|
import { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
4
6
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
5
8
|
import { ContractClassLog, ContractClassLogFields } from '@aztec/stdlib/logs';
|
|
6
|
-
import {
|
|
7
|
-
import { packAsRetrievedNote } from './note_packing_utils.js';
|
|
9
|
+
import { packAsHintedNote } from './note_packing_utils.js';
|
|
8
10
|
export class UnavailableOracleError extends Error {
|
|
9
11
|
constructor(oracleName){
|
|
10
12
|
super(`${oracleName} oracles not available with the current handler`);
|
|
@@ -46,11 +48,11 @@ export class UnavailableOracleError extends Error {
|
|
|
46
48
|
];
|
|
47
49
|
// Get all the oracle function names
|
|
48
50
|
const oracleNames = Object.getOwnPropertyNames(Oracle.prototype).filter((name)=>!excludedProps.includes(name));
|
|
49
|
-
// Validate oracle names - these must be prefixed with either "
|
|
51
|
+
// Validate oracle names - these must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate their scope
|
|
50
52
|
// and must correspond to a function on the Oracle class.
|
|
51
53
|
oracleNames.forEach((name)=>{
|
|
52
|
-
if (!name.startsWith('
|
|
53
|
-
throw new Error(`Oracle function "${name}" must be prefixed with either "
|
|
54
|
+
if (!name.startsWith('aztec_prv_') && !name.startsWith('aztec_utl_')) {
|
|
55
|
+
throw new Error(`Oracle function "${name}" must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate its scope`);
|
|
54
56
|
}
|
|
55
57
|
const method = this[name];
|
|
56
58
|
if (typeof method !== 'function') {
|
|
@@ -64,36 +66,43 @@ export class UnavailableOracleError extends Error {
|
|
|
64
66
|
return acc;
|
|
65
67
|
}, {});
|
|
66
68
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
// eslint-disable-next-line camelcase
|
|
70
|
+
aztec_utl_assertCompatibleOracleVersion([version]) {
|
|
71
|
+
this.handlerAsMisc().assertCompatibleOracleVersion(Fr.fromString(version).toNumber());
|
|
69
72
|
return Promise.resolve([]);
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
// eslint-disable-next-line camelcase
|
|
75
|
+
aztec_utl_getRandomField() {
|
|
76
|
+
const val = this.handlerAsMisc().getRandomField();
|
|
73
77
|
return Promise.resolve([
|
|
74
78
|
toACVMField(val)
|
|
75
79
|
]);
|
|
76
80
|
}
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
// eslint-disable-next-line camelcase
|
|
82
|
+
aztec_prv_storeInExecutionCache(values, [hash]) {
|
|
83
|
+
this.handlerAsPrivate().storeInExecutionCache(values.map(Fr.fromString), Fr.fromString(hash));
|
|
79
84
|
return Promise.resolve([]);
|
|
80
85
|
}
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
// eslint-disable-next-line camelcase
|
|
87
|
+
async aztec_prv_loadFromExecutionCache([returnsHash]) {
|
|
88
|
+
const values = await this.handlerAsPrivate().loadFromExecutionCache(Fr.fromString(returnsHash));
|
|
83
89
|
return [
|
|
84
90
|
values.map(toACVMField)
|
|
85
91
|
];
|
|
86
92
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
// eslint-disable-next-line camelcase
|
|
94
|
+
aztec_utl_getUtilityContext() {
|
|
95
|
+
const context = this.handlerAsUtility().getUtilityContext();
|
|
96
|
+
return Promise.resolve(context.toNoirRepresentation());
|
|
90
97
|
}
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
// eslint-disable-next-line camelcase
|
|
99
|
+
async aztec_utl_getKeyValidationRequest([pkMHash]) {
|
|
100
|
+
const keyValidationRequest = await this.handlerAsUtility().getKeyValidationRequest(Fr.fromString(pkMHash));
|
|
93
101
|
return keyValidationRequest.toFields().map(toACVMField);
|
|
94
102
|
}
|
|
95
|
-
|
|
96
|
-
|
|
103
|
+
// eslint-disable-next-line camelcase
|
|
104
|
+
async aztec_utl_getContractInstance([address]) {
|
|
105
|
+
const instance = await this.handlerAsUtility().getContractInstance(AztecAddress.fromField(Fr.fromString(address)));
|
|
97
106
|
return [
|
|
98
107
|
instance.salt,
|
|
99
108
|
instance.deployer,
|
|
@@ -102,57 +111,69 @@ export class UnavailableOracleError extends Error {
|
|
|
102
111
|
...instance.publicKeys.toFields()
|
|
103
112
|
].map(toACVMField);
|
|
104
113
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
const witness = await this.handlerAsUtility().
|
|
114
|
+
// eslint-disable-next-line camelcase
|
|
115
|
+
async aztec_utl_getNoteHashMembershipWitness([anchorBlockHash], [noteHash]) {
|
|
116
|
+
const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
|
|
117
|
+
const parsedNoteHash = Fr.fromString(noteHash);
|
|
118
|
+
const witness = await this.handlerAsUtility().getNoteHashMembershipWitness(parsedAnchorBlockHash, parsedNoteHash);
|
|
110
119
|
if (!witness) {
|
|
111
|
-
throw new Error(`
|
|
120
|
+
throw new Error(`Note hash ${noteHash} not found in the note hash tree at anchor block hash ${parsedAnchorBlockHash.toString()}.`);
|
|
112
121
|
}
|
|
113
|
-
return
|
|
114
|
-
toACVMField(witness[0]),
|
|
115
|
-
witness.slice(1).map(toACVMField)
|
|
116
|
-
];
|
|
122
|
+
return witness.toNoirRepresentation();
|
|
117
123
|
}
|
|
118
|
-
|
|
119
|
-
|
|
124
|
+
// eslint-disable-next-line camelcase
|
|
125
|
+
async aztec_utl_getBlockHashMembershipWitness([anchorBlockHash], [blockHash]) {
|
|
126
|
+
const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
|
|
127
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
128
|
+
const witness = await this.handlerAsUtility().getBlockHashMembershipWitness(parsedAnchorBlockHash, parsedBlockHash);
|
|
129
|
+
if (!witness) {
|
|
130
|
+
throw new Error(`Block hash ${parsedBlockHash.toString()} not found in the archive tree at anchor block ${parsedAnchorBlockHash.toString()}.`);
|
|
131
|
+
}
|
|
132
|
+
return witness.toNoirRepresentation();
|
|
133
|
+
}
|
|
134
|
+
// eslint-disable-next-line camelcase
|
|
135
|
+
async aztec_utl_getNullifierMembershipWitness([blockHash], [nullifier]) {
|
|
136
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
120
137
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
121
|
-
const witness = await this.handlerAsUtility().
|
|
138
|
+
const witness = await this.handlerAsUtility().getNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
122
139
|
if (!witness) {
|
|
123
|
-
throw new Error(`Nullifier witness not found for nullifier ${parsedNullifier} at block ${
|
|
140
|
+
throw new Error(`Nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`);
|
|
124
141
|
}
|
|
125
142
|
return witness.toNoirRepresentation();
|
|
126
143
|
}
|
|
127
|
-
|
|
128
|
-
|
|
144
|
+
// eslint-disable-next-line camelcase
|
|
145
|
+
async aztec_utl_getLowNullifierMembershipWitness([blockHash], [nullifier]) {
|
|
146
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
129
147
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
130
|
-
const witness = await this.handlerAsUtility().
|
|
148
|
+
const witness = await this.handlerAsUtility().getLowNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
131
149
|
if (!witness) {
|
|
132
|
-
throw new Error(`Low nullifier witness not found for nullifier ${parsedNullifier} at block ${
|
|
150
|
+
throw new Error(`Low nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`);
|
|
133
151
|
}
|
|
134
152
|
return witness.toNoirRepresentation();
|
|
135
153
|
}
|
|
136
|
-
|
|
137
|
-
|
|
154
|
+
// eslint-disable-next-line camelcase
|
|
155
|
+
async aztec_utl_getPublicDataWitness([blockHash], [leafSlot]) {
|
|
156
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
138
157
|
const parsedLeafSlot = Fr.fromString(leafSlot);
|
|
139
|
-
const witness = await this.handlerAsUtility().
|
|
158
|
+
const witness = await this.handlerAsUtility().getPublicDataWitness(parsedBlockHash, parsedLeafSlot);
|
|
140
159
|
if (!witness) {
|
|
141
|
-
throw new Error(`Public data witness not found for slot ${parsedLeafSlot} at block ${
|
|
160
|
+
throw new Error(`Public data witness not found for slot ${parsedLeafSlot} at block hash ${parsedBlockHash.toString()}.`);
|
|
142
161
|
}
|
|
143
162
|
return witness.toNoirRepresentation();
|
|
144
163
|
}
|
|
145
|
-
|
|
164
|
+
// eslint-disable-next-line camelcase
|
|
165
|
+
async aztec_utl_getBlockHeader([blockNumber]) {
|
|
146
166
|
const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
|
|
147
|
-
const header = await this.handlerAsUtility().
|
|
167
|
+
const header = await this.handlerAsUtility().getBlockHeader(BlockNumber(parsedBlockNumber));
|
|
148
168
|
if (!header) {
|
|
149
169
|
throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
|
|
150
170
|
}
|
|
151
171
|
return header.toFields().map(toACVMField);
|
|
152
172
|
}
|
|
153
|
-
|
|
173
|
+
// eslint-disable-next-line camelcase
|
|
174
|
+
async aztec_utl_getAuthWitness([messageHash]) {
|
|
154
175
|
const messageHashField = Fr.fromString(messageHash);
|
|
155
|
-
const witness = await this.handlerAsUtility().
|
|
176
|
+
const witness = await this.handlerAsUtility().getAuthWitness(messageHashField);
|
|
156
177
|
if (!witness) {
|
|
157
178
|
throw new Error(`Unknown auth witness for message hash ${messageHashField}`);
|
|
158
179
|
}
|
|
@@ -160,69 +181,109 @@ export class UnavailableOracleError extends Error {
|
|
|
160
181
|
witness.map(toACVMField)
|
|
161
182
|
];
|
|
162
183
|
}
|
|
163
|
-
|
|
184
|
+
// eslint-disable-next-line camelcase
|
|
185
|
+
async aztec_utl_tryGetPublicKeysAndPartialAddress([address]) {
|
|
164
186
|
const parsedAddress = AztecAddress.fromField(Fr.fromString(address));
|
|
165
|
-
const
|
|
166
|
-
return
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
187
|
+
const result = await this.handlerAsUtility().tryGetPublicKeysAndPartialAddress(parsedAddress);
|
|
188
|
+
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
189
|
+
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
190
|
+
if (result === undefined) {
|
|
191
|
+
// No data was found so we set `some` to 0 and pad `value` with zeros get the correct return size.
|
|
192
|
+
return [
|
|
193
|
+
toACVMField(0),
|
|
194
|
+
Array(13).fill(toACVMField(0))
|
|
195
|
+
];
|
|
196
|
+
} else {
|
|
197
|
+
// Data was found so we set `some` to 1 and return it along with `value`.
|
|
198
|
+
return [
|
|
199
|
+
toACVMField(1),
|
|
200
|
+
[
|
|
201
|
+
...result.publicKeys.toFields(),
|
|
202
|
+
result.partialAddress
|
|
203
|
+
].map(toACVMField)
|
|
204
|
+
];
|
|
205
|
+
}
|
|
172
206
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
207
|
+
// eslint-disable-next-line camelcase
|
|
208
|
+
async aztec_utl_getNotes([ownerSome], [ownerValue], [storageSlot], [numSelects], selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, [limit], [offset], [status], [maxNotes], [packedHintedNoteLength]) {
|
|
209
|
+
// Parse Option<AztecAddress>: ownerSome is 0 for None, 1 for Some
|
|
210
|
+
const owner = Fr.fromString(ownerSome).toNumber() === 1 ? AztecAddress.fromString(ownerValue) : undefined;
|
|
211
|
+
const noteDatas = await this.handlerAsUtility().getNotes(owner, Fr.fromString(storageSlot), +numSelects, selectByIndexes.map((s)=>+s), selectByOffsets.map((s)=>+s), selectByLengths.map((s)=>+s), selectValues.map(Fr.fromString), selectComparators.map((s)=>+s), sortByIndexes.map((s)=>+s), sortByOffsets.map((s)=>+s), sortByLengths.map((s)=>+s), sortOrder.map((s)=>+s), +limit, +offset, +status);
|
|
212
|
+
const returnDataAsArrayOfPackedHintedNotes = noteDatas.map((noteData)=>packAsHintedNote({
|
|
213
|
+
contractAddress: noteData.contractAddress,
|
|
214
|
+
owner: noteData.owner,
|
|
215
|
+
randomness: noteData.randomness,
|
|
216
|
+
storageSlot: noteData.storageSlot,
|
|
217
|
+
noteNonce: noteData.noteNonce,
|
|
218
|
+
isPending: noteData.isPending,
|
|
219
|
+
note: noteData.note
|
|
220
|
+
}));
|
|
176
221
|
// Now we convert each sub-array to an array of ACVMField
|
|
177
|
-
const returnDataAsArrayOfACVMFieldArrays =
|
|
222
|
+
const returnDataAsArrayOfACVMFieldArrays = returnDataAsArrayOfPackedHintedNotes.map((subArray)=>subArray.map(toACVMField));
|
|
178
223
|
// At last we convert the array of arrays to a bounded vec of arrays
|
|
179
|
-
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +
|
|
224
|
+
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedHintedNoteLength);
|
|
180
225
|
}
|
|
181
|
-
|
|
182
|
-
|
|
226
|
+
// eslint-disable-next-line camelcase
|
|
227
|
+
aztec_prv_notifyCreatedNote([owner], [storageSlot], [randomness], [noteTypeId], note, [noteHash], [counter]) {
|
|
228
|
+
this.handlerAsPrivate().notifyCreatedNote(AztecAddress.fromString(owner), Fr.fromString(storageSlot), Fr.fromString(randomness), NoteSelector.fromField(Fr.fromString(noteTypeId)), note.map(Fr.fromString), Fr.fromString(noteHash), +counter);
|
|
183
229
|
return Promise.resolve([]);
|
|
184
230
|
}
|
|
185
|
-
|
|
186
|
-
|
|
231
|
+
// eslint-disable-next-line camelcase
|
|
232
|
+
async aztec_prv_notifyNullifiedNote([innerNullifier], [noteHash], [counter]) {
|
|
233
|
+
await this.handlerAsPrivate().notifyNullifiedNote(Fr.fromString(innerNullifier), Fr.fromString(noteHash), +counter);
|
|
187
234
|
return [];
|
|
188
235
|
}
|
|
189
|
-
|
|
190
|
-
|
|
236
|
+
// eslint-disable-next-line camelcase
|
|
237
|
+
async aztec_prv_notifyCreatedNullifier([innerNullifier]) {
|
|
238
|
+
await this.handlerAsPrivate().notifyCreatedNullifier(Fr.fromString(innerNullifier));
|
|
191
239
|
return [];
|
|
192
240
|
}
|
|
193
|
-
|
|
194
|
-
|
|
241
|
+
// eslint-disable-next-line camelcase
|
|
242
|
+
async aztec_prv_isNullifierPending([innerNullifier], [contractAddress]) {
|
|
243
|
+
const isPending = await this.handlerAsPrivate().isNullifierPending(Fr.fromString(innerNullifier), AztecAddress.fromString(contractAddress));
|
|
244
|
+
return [
|
|
245
|
+
toACVMField(isPending)
|
|
246
|
+
];
|
|
247
|
+
}
|
|
248
|
+
// eslint-disable-next-line camelcase
|
|
249
|
+
async aztec_utl_checkNullifierExists([innerNullifier]) {
|
|
250
|
+
const exists = await this.handlerAsUtility().checkNullifierExists(Fr.fromString(innerNullifier));
|
|
195
251
|
return [
|
|
196
252
|
toACVMField(exists)
|
|
197
253
|
];
|
|
198
254
|
}
|
|
199
|
-
|
|
200
|
-
|
|
255
|
+
// eslint-disable-next-line camelcase
|
|
256
|
+
async aztec_utl_getL1ToL2MembershipWitness([contractAddress], [messageHash], [secret]) {
|
|
257
|
+
const message = await this.handlerAsUtility().getL1ToL2MembershipWitness(AztecAddress.fromString(contractAddress), Fr.fromString(messageHash), Fr.fromString(secret));
|
|
201
258
|
return message.toNoirRepresentation();
|
|
202
259
|
}
|
|
203
|
-
|
|
204
|
-
|
|
260
|
+
// eslint-disable-next-line camelcase
|
|
261
|
+
async aztec_utl_storageRead([blockHash], [contractAddress], [startStorageSlot], [numberOfElements]) {
|
|
262
|
+
const values = await this.handlerAsUtility().storageRead(BlockHash.fromString(blockHash), new AztecAddress(Fr.fromString(contractAddress)), Fr.fromString(startStorageSlot), +numberOfElements);
|
|
205
263
|
return [
|
|
206
264
|
values.map(toACVMField)
|
|
207
265
|
];
|
|
208
266
|
}
|
|
209
|
-
|
|
267
|
+
// eslint-disable-next-line camelcase
|
|
268
|
+
aztec_prv_notifyCreatedContractClassLog([contractAddress], message, [length], [counter]) {
|
|
210
269
|
const logFields = new ContractClassLogFields(message.map(Fr.fromString));
|
|
211
270
|
const log = new ContractClassLog(new AztecAddress(Fr.fromString(contractAddress)), logFields, +length);
|
|
212
|
-
this.handlerAsPrivate().
|
|
271
|
+
this.handlerAsPrivate().notifyCreatedContractClassLog(log, +counter);
|
|
213
272
|
return Promise.resolve([]);
|
|
214
273
|
}
|
|
215
|
-
|
|
274
|
+
// eslint-disable-next-line camelcase
|
|
275
|
+
async aztec_utl_log(level, message, _ignoredFieldsSize, fields) {
|
|
216
276
|
const levelFr = Fr.fromString(level[0]);
|
|
217
277
|
const messageStr = message.map((acvmField)=>String.fromCharCode(Fr.fromString(acvmField).toNumber())).join('');
|
|
218
278
|
const fieldsFr = fields.map(Fr.fromString);
|
|
219
|
-
this.handlerAsMisc().
|
|
220
|
-
return
|
|
279
|
+
await this.handlerAsMisc().log(levelFr.toNumber(), messageStr, fieldsFr);
|
|
280
|
+
return [];
|
|
221
281
|
}
|
|
222
282
|
// This function's name is directly hardcoded in `circuit_recorder.ts`. Don't forget to update it there if you
|
|
223
283
|
// change the name here.
|
|
224
|
-
|
|
225
|
-
|
|
284
|
+
// eslint-disable-next-line camelcase
|
|
285
|
+
async aztec_prv_callPrivateFunction([contractAddress], [functionSelector], [argsHash], [sideEffectCounter], [isStaticCall]) {
|
|
286
|
+
const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().callPrivateFunction(AztecAddress.fromField(Fr.fromString(contractAddress)), FunctionSelector.fromField(Fr.fromString(functionSelector)), Fr.fromString(argsHash), Fr.fromString(sideEffectCounter).toNumber(), Fr.fromString(isStaticCall).toBool());
|
|
226
287
|
return [
|
|
227
288
|
[
|
|
228
289
|
endSideEffectCounter,
|
|
@@ -230,48 +291,58 @@ export class UnavailableOracleError extends Error {
|
|
|
230
291
|
].map(toACVMField)
|
|
231
292
|
];
|
|
232
293
|
}
|
|
233
|
-
|
|
234
|
-
|
|
294
|
+
// eslint-disable-next-line camelcase
|
|
295
|
+
async aztec_prv_notifyEnqueuedPublicFunctionCall([contractAddress], [calldataHash], [sideEffectCounter], [isStaticCall]) {
|
|
296
|
+
await this.handlerAsPrivate().notifyEnqueuedPublicFunctionCall(AztecAddress.fromString(contractAddress), Fr.fromString(calldataHash), Fr.fromString(sideEffectCounter).toNumber(), Fr.fromString(isStaticCall).toBool());
|
|
235
297
|
return [];
|
|
236
298
|
}
|
|
237
|
-
|
|
238
|
-
|
|
299
|
+
// eslint-disable-next-line camelcase
|
|
300
|
+
async aztec_prv_notifySetPublicTeardownFunctionCall([contractAddress], [calldataHash], [sideEffectCounter], [isStaticCall]) {
|
|
301
|
+
await this.handlerAsPrivate().notifySetPublicTeardownFunctionCall(AztecAddress.fromString(contractAddress), Fr.fromString(calldataHash), Fr.fromString(sideEffectCounter).toNumber(), Fr.fromString(isStaticCall).toBool());
|
|
239
302
|
return [];
|
|
240
303
|
}
|
|
241
|
-
|
|
242
|
-
|
|
304
|
+
// eslint-disable-next-line camelcase
|
|
305
|
+
async aztec_prv_notifySetMinRevertibleSideEffectCounter([minRevertibleSideEffectCounter]) {
|
|
306
|
+
await this.handlerAsPrivate().notifySetMinRevertibleSideEffectCounter(Fr.fromString(minRevertibleSideEffectCounter).toNumber());
|
|
243
307
|
return Promise.resolve([]);
|
|
244
308
|
}
|
|
245
|
-
|
|
246
|
-
|
|
309
|
+
// eslint-disable-next-line camelcase
|
|
310
|
+
async aztec_prv_isSideEffectCounterRevertible([sideEffectCounter]) {
|
|
311
|
+
const isRevertible = await this.handlerAsPrivate().isSideEffectCounterRevertible(Fr.fromString(sideEffectCounter).toNumber());
|
|
247
312
|
return Promise.resolve([
|
|
248
313
|
toACVMField(isRevertible)
|
|
249
314
|
]);
|
|
250
315
|
}
|
|
251
|
-
|
|
252
|
-
|
|
316
|
+
// eslint-disable-next-line camelcase
|
|
317
|
+
async aztec_prv_getNextAppTagAsSender([sender], [recipient]) {
|
|
318
|
+
const tag = await this.handlerAsPrivate().getNextAppTagAsSender(AztecAddress.fromString(sender), AztecAddress.fromString(recipient));
|
|
253
319
|
return [
|
|
254
320
|
toACVMField(tag.value)
|
|
255
321
|
];
|
|
256
322
|
}
|
|
257
|
-
|
|
258
|
-
|
|
323
|
+
// eslint-disable-next-line camelcase
|
|
324
|
+
async aztec_utl_fetchTaggedLogs([pendingTaggedLogArrayBaseSlot]) {
|
|
325
|
+
await this.handlerAsUtility().fetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
|
|
259
326
|
return [];
|
|
260
327
|
}
|
|
261
|
-
|
|
262
|
-
|
|
328
|
+
// eslint-disable-next-line camelcase
|
|
329
|
+
async aztec_utl_validateAndStoreEnqueuedNotesAndEvents([contractAddress], [noteValidationRequestsArrayBaseSlot], [eventValidationRequestsArrayBaseSlot]) {
|
|
330
|
+
await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEvents(AztecAddress.fromString(contractAddress), Fr.fromString(noteValidationRequestsArrayBaseSlot), Fr.fromString(eventValidationRequestsArrayBaseSlot));
|
|
263
331
|
return [];
|
|
264
332
|
}
|
|
265
|
-
|
|
266
|
-
|
|
333
|
+
// eslint-disable-next-line camelcase
|
|
334
|
+
async aztec_utl_bulkRetrieveLogs([contractAddress], [logRetrievalRequestsArrayBaseSlot], [logRetrievalResponsesArrayBaseSlot]) {
|
|
335
|
+
await this.handlerAsUtility().bulkRetrieveLogs(AztecAddress.fromString(contractAddress), Fr.fromString(logRetrievalRequestsArrayBaseSlot), Fr.fromString(logRetrievalResponsesArrayBaseSlot));
|
|
267
336
|
return [];
|
|
268
337
|
}
|
|
269
|
-
|
|
270
|
-
|
|
338
|
+
// eslint-disable-next-line camelcase
|
|
339
|
+
async aztec_utl_storeCapsule([contractAddress], [slot], capsule) {
|
|
340
|
+
await this.handlerAsUtility().storeCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(slot), capsule.map(Fr.fromString));
|
|
271
341
|
return [];
|
|
272
342
|
}
|
|
273
|
-
|
|
274
|
-
|
|
343
|
+
// eslint-disable-next-line camelcase
|
|
344
|
+
async aztec_utl_loadCapsule([contractAddress], [slot], [tSize]) {
|
|
345
|
+
const values = await this.handlerAsUtility().loadCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(slot));
|
|
275
346
|
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
276
347
|
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
277
348
|
if (values === null) {
|
|
@@ -288,35 +359,41 @@ export class UnavailableOracleError extends Error {
|
|
|
288
359
|
];
|
|
289
360
|
}
|
|
290
361
|
}
|
|
291
|
-
|
|
292
|
-
|
|
362
|
+
// eslint-disable-next-line camelcase
|
|
363
|
+
async aztec_utl_deleteCapsule([contractAddress], [slot]) {
|
|
364
|
+
await this.handlerAsUtility().deleteCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(slot));
|
|
293
365
|
return [];
|
|
294
366
|
}
|
|
295
|
-
|
|
296
|
-
|
|
367
|
+
// eslint-disable-next-line camelcase
|
|
368
|
+
async aztec_utl_copyCapsule([contractAddress], [srcSlot], [dstSlot], [numEntries]) {
|
|
369
|
+
await this.handlerAsUtility().copyCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(srcSlot), Fr.fromString(dstSlot), Fr.fromString(numEntries).toNumber());
|
|
297
370
|
return [];
|
|
298
371
|
}
|
|
299
|
-
|
|
372
|
+
// eslint-disable-next-line camelcase
|
|
373
|
+
async aztec_utl_aes128Decrypt(ciphertextBVecStorage, [ciphertextLength], iv, symKey) {
|
|
300
374
|
const ciphertext = fromUintBoundedVec(ciphertextBVecStorage, ciphertextLength, 8);
|
|
301
375
|
const ivBuffer = fromUintArray(iv, 8);
|
|
302
376
|
const symKeyBuffer = fromUintArray(symKey, 8);
|
|
303
|
-
const plaintext = await this.handlerAsUtility().
|
|
377
|
+
const plaintext = await this.handlerAsUtility().aes128Decrypt(ciphertext, ivBuffer, symKeyBuffer);
|
|
304
378
|
return bufferToBoundedVec(plaintext, ciphertextBVecStorage.length);
|
|
305
379
|
}
|
|
306
|
-
|
|
307
|
-
|
|
380
|
+
// eslint-disable-next-line camelcase
|
|
381
|
+
async aztec_utl_getSharedSecret([address], [ephPKField0], [ephPKField1], [ephPKField2]) {
|
|
382
|
+
const secret = await this.handlerAsUtility().getSharedSecret(AztecAddress.fromField(Fr.fromString(address)), Point.fromFields([
|
|
308
383
|
ephPKField0,
|
|
309
384
|
ephPKField1,
|
|
310
385
|
ephPKField2
|
|
311
386
|
].map(Fr.fromString)));
|
|
312
387
|
return secret.toFields().map(toACVMField);
|
|
313
388
|
}
|
|
314
|
-
|
|
315
|
-
|
|
389
|
+
// eslint-disable-next-line camelcase
|
|
390
|
+
async aztec_utl_emitOffchainEffect(data) {
|
|
391
|
+
await this.handlerAsPrivate().emitOffchainEffect(data.map(Fr.fromString));
|
|
316
392
|
return [];
|
|
317
393
|
}
|
|
318
|
-
|
|
319
|
-
|
|
394
|
+
// eslint-disable-next-line camelcase
|
|
395
|
+
async aztec_prv_getSenderForTags() {
|
|
396
|
+
const sender = await this.handlerAsPrivate().getSenderForTags();
|
|
320
397
|
// Return [1, address] for Some(address), [0, 0] for None
|
|
321
398
|
return sender ? [
|
|
322
399
|
toACVMField(1n),
|
|
@@ -326,8 +403,9 @@ export class UnavailableOracleError extends Error {
|
|
|
326
403
|
toACVMField(0n)
|
|
327
404
|
];
|
|
328
405
|
}
|
|
329
|
-
|
|
330
|
-
|
|
406
|
+
// eslint-disable-next-line camelcase
|
|
407
|
+
async aztec_prv_setSenderForTags([senderForTags]) {
|
|
408
|
+
await this.handlerAsPrivate().setSenderForTags(AztecAddress.fromField(Fr.fromString(senderForTags)));
|
|
331
409
|
return [];
|
|
332
410
|
}
|
|
333
411
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
1
|
import { type ACVMWitness, type CircuitSimulator } from '@aztec/simulator/client';
|
|
3
2
|
import { type FunctionArtifact, type FunctionArtifactWithContractName, type FunctionSelector } from '@aztec/stdlib/abi';
|
|
4
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import type { ContractInstance } from '@aztec/stdlib/contract';
|
|
6
|
-
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
7
4
|
import { PrivateCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
8
|
-
import {
|
|
9
|
-
import type { UInt64 } from '@aztec/stdlib/types';
|
|
10
|
-
import type { ExecutionDataProvider } from '../execution_data_provider.js';
|
|
5
|
+
import { PrivateCallExecutionResult } from '@aztec/stdlib/tx';
|
|
11
6
|
import type { PrivateExecutionOracle } from './private_execution_oracle.js';
|
|
12
7
|
/**
|
|
13
8
|
* Execute a private function and return the execution result.
|
|
@@ -25,24 +20,4 @@ export declare function executePrivateFunction(simulator: CircuitSimulator, priv
|
|
|
25
20
|
* @returns - The public inputs.
|
|
26
21
|
*/
|
|
27
22
|
export declare function extractPrivateCircuitPublicInputs(artifact: FunctionArtifact, partialWitness: ACVMWitness): PrivateCircuitPublicInputs;
|
|
28
|
-
|
|
29
|
-
* Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
|
|
30
|
-
* from the instance is used.
|
|
31
|
-
* @param contractAddress - The address of the contract to read the class id for.
|
|
32
|
-
* @param instance - The instance of the contract.
|
|
33
|
-
* @param executionDataProvider - The execution data provider.
|
|
34
|
-
* @param blockNumber - The block number at which to load the DelayedPublicMutable storing the class id.
|
|
35
|
-
* @param timestamp - The timestamp at which to obtain the class id from the DelayedPublicMutable.
|
|
36
|
-
* @returns The current class id.
|
|
37
|
-
*/
|
|
38
|
-
export declare function readCurrentClassId(contractAddress: AztecAddress, instance: ContractInstance, executionDataProvider: ExecutionDataProvider | AztecNode, blockNumber: number, timestamp: UInt64): Promise<Fr>;
|
|
39
|
-
/**
|
|
40
|
-
* Verify that the current class id of a contract obtained from AztecNode is the same as the one in the execution data
|
|
41
|
-
* provider (i.e. PXE).
|
|
42
|
-
* @param contractAddress - The address of the contract to verify class id for.
|
|
43
|
-
* @param executionDataProvider - The execution data provider.
|
|
44
|
-
* @param header - The header of the block at which to verify the current class id. If not provided, the anchor block
|
|
45
|
-
* header of the execution data provider is used.
|
|
46
|
-
*/
|
|
47
|
-
export declare function verifyCurrentClassId(contractAddress: AztecAddress, executionDataProvider: ExecutionDataProvider, header?: BlockHeader): Promise<void>;
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9leGVjdXRpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb250cmFjdF9mdW5jdGlvbl9zaW11bGF0b3Ivb3JhY2xlL3ByaXZhdGVfZXhlY3V0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUk5QyxPQUFPLEVBQ0wsS0FBSyxXQUFXLEVBQ2hCLEtBQUssZ0JBQWdCLEVBS3RCLE1BQU0seUJBQXlCLENBQUM7QUFDakMsT0FBTyxFQUNMLEtBQUssZ0JBQWdCLEVBQ3JCLEtBQUssZ0NBQWdDLEVBQ3JDLEtBQUssZ0JBQWdCLEVBRXRCLE1BQU0sbUJBQW1CLENBQUM7QUFDM0IsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUUvRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUVsRSxPQUFPLEVBQUUsV0FBVyxFQUFFLDBCQUEwQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDM0UsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFFbEQsT0FBTyxLQUFLLEVBQUUscUJBQXFCLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUUzRSxPQUFPLEtBQUssRUFBRSxzQkFBc0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRTVFOzs7Ozs7O0dBT0c7QUFDSCx3QkFBc0Isc0JBQXNCLENBQzFDLFNBQVMsRUFBRSxnQkFBZ0IsRUFDM0Isc0JBQXNCLEVBQUUsc0JBQXNCLEVBQzlDLFFBQVEsRUFBRSxnQ0FBZ0MsRUFDMUMsZUFBZSxFQUFFLFlBQVksRUFDN0IsZ0JBQWdCLEVBQUUsZ0JBQWdCLEVBQ2xDLEdBQUcseUNBQThDLEdBQ2hELE9BQU8sQ0FBQywwQkFBMEIsQ0FBQyxDQTZFckM7QUFFRDs7Ozs7R0FLRztBQUNILHdCQUFnQixpQ0FBaUMsQ0FDL0MsUUFBUSxFQUFFLGdCQUFnQixFQUMxQixjQUFjLEVBQUUsV0FBVyxHQUMxQiwwQkFBMEIsQ0FhNUI7QUFFRDs7Ozs7Ozs7O0dBU0c7QUFDSCx3QkFBc0Isa0JBQWtCLENBQ3RDLGVBQWUsRUFBRSxZQUFZLEVBQzdCLFFBQVEsRUFBRSxnQkFBZ0IsRUFDMUIscUJBQXFCLEVBQUUscUJBQXFCLEdBQUcsU0FBUyxFQUN4RCxXQUFXLEVBQUUsTUFBTSxFQUNuQixTQUFTLEVBQUUsTUFBTSxlQVdsQjtBQUVEOzs7Ozs7O0dBT0c7QUFDSCx3QkFBc0Isb0JBQW9CLENBQ3hDLGVBQWUsRUFBRSxZQUFZLEVBQzdCLHFCQUFxQixFQUFFLHFCQUFxQixFQUM1QyxNQUFNLENBQUMsRUFBRSxXQUFXLGlCQWlCckIifQ==
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9leGVjdXRpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb250cmFjdF9mdW5jdGlvbl9zaW11bGF0b3Ivb3JhY2xlL3ByaXZhdGVfZXhlY3V0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLE9BQU8sRUFDTCxLQUFLLFdBQVcsRUFDaEIsS0FBSyxnQkFBZ0IsRUFLdEIsTUFBTSx5QkFBeUIsQ0FBQztBQUNqQyxPQUFPLEVBQ0wsS0FBSyxnQkFBZ0IsRUFDckIsS0FBSyxnQ0FBZ0MsRUFDckMsS0FBSyxnQkFBZ0IsRUFFdEIsTUFBTSxtQkFBbUIsQ0FBQztBQUMzQixPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUVsRSxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUc5RCxPQUFPLEtBQUssRUFBRSxzQkFBc0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRTVFOzs7Ozs7O0dBT0c7QUFDSCx3QkFBc0Isc0JBQXNCLENBQzFDLFNBQVMsRUFBRSxnQkFBZ0IsRUFDM0Isc0JBQXNCLEVBQUUsc0JBQXNCLEVBQzlDLFFBQVEsRUFBRSxnQ0FBZ0MsRUFDMUMsZUFBZSxFQUFFLFlBQVksRUFDN0IsZ0JBQWdCLEVBQUUsZ0JBQWdCLEVBQ2xDLEdBQUcseUNBQThDLEdBQ2hELE9BQU8sQ0FBQywwQkFBMEIsQ0FBQyxDQTJFckM7QUFFRDs7Ozs7R0FLRztBQUNILHdCQUFnQixpQ0FBaUMsQ0FDL0MsUUFBUSxFQUFFLGdCQUFnQixFQUMxQixjQUFjLEVBQUUsV0FBVyxHQUMxQiwwQkFBMEIsQ0FhNUIifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_execution.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/private_execution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private_execution.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/private_execution.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAKtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,EACrC,KAAK,gBAAgB,EAEtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAG9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,gBAAgB,EAC3B,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,EAAE,gCAAgC,EAC1C,eAAe,EAAE,YAAY,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,yCAA8C,GAChD,OAAO,CAAC,0BAA0B,CAAC,CA2ErC;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,gBAAgB,EAC1B,cAAc,EAAE,WAAW,GAC1B,0BAA0B,CAa5B"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, 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 { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
6
5
|
import { ExecutionError, extractCallStack, resolveAssertionMessageFromError, witnessMapToFields } from '@aztec/simulator/client';
|
|
7
6
|
import { countArgumentsSize } from '@aztec/stdlib/abi';
|
|
8
|
-
import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '@aztec/stdlib/delayed-public-mutable';
|
|
9
7
|
import { PrivateCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
10
8
|
import { PrivateCallExecutionResult } from '@aztec/stdlib/tx';
|
|
11
9
|
import { Oracle } from './oracle.js';
|
|
@@ -47,8 +45,7 @@ import { Oracle } from './oracle.js';
|
|
|
47
45
|
appCircuitName: functionName
|
|
48
46
|
});
|
|
49
47
|
const contractClassLogs = privateExecutionOracle.getContractClassLogs();
|
|
50
|
-
const rawReturnValues = await privateExecutionOracle.
|
|
51
|
-
const noteHashLeafIndexMap = privateExecutionOracle.getNoteHashLeafIndexMap();
|
|
48
|
+
const rawReturnValues = await privateExecutionOracle.loadFromExecutionCache(publicInputs.returnsHash);
|
|
52
49
|
const newNotes = privateExecutionOracle.getNewNotes();
|
|
53
50
|
const noteHashNullifierCounterMap = privateExecutionOracle.getNoteHashNullifierCounterMap();
|
|
54
51
|
const offchainEffects = privateExecutionOracle.getOffchainEffects();
|
|
@@ -62,7 +59,7 @@ import { Oracle } from './oracle.js';
|
|
|
62
59
|
timerSubtractionList = timerSubtractionList.flatMap((nested)=>nested.nestedExecutionResults ?? []);
|
|
63
60
|
}
|
|
64
61
|
log.debug(`Returning from call to ${contractAddress.toString()}:${functionSelector}`);
|
|
65
|
-
return new PrivateCallExecutionResult(artifact.bytecode, Buffer.from(artifact.verificationKey, 'base64'), partialWitness, publicInputs,
|
|
62
|
+
return new PrivateCallExecutionResult(artifact.bytecode, Buffer.from(artifact.verificationKey, 'base64'), partialWitness, publicInputs, newNotes, noteHashNullifierCounterMap, rawReturnValues, offchainEffects, preTags, nestedExecutionResults, contractClassLogs, {
|
|
66
63
|
timings: {
|
|
67
64
|
witgen: witgenTime,
|
|
68
65
|
oracles: acirExecutionResult.oracles
|
|
@@ -88,36 +85,3 @@ import { Oracle } from './oracle.js';
|
|
|
88
85
|
}
|
|
89
86
|
return PrivateCircuitPublicInputs.fromFields(returnData);
|
|
90
87
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
|
|
93
|
-
* from the instance is used.
|
|
94
|
-
* @param contractAddress - The address of the contract to read the class id for.
|
|
95
|
-
* @param instance - The instance of the contract.
|
|
96
|
-
* @param executionDataProvider - The execution data provider.
|
|
97
|
-
* @param blockNumber - The block number at which to load the DelayedPublicMutable storing the class id.
|
|
98
|
-
* @param timestamp - The timestamp at which to obtain the class id from the DelayedPublicMutable.
|
|
99
|
-
* @returns The current class id.
|
|
100
|
-
*/ export async function readCurrentClassId(contractAddress, instance, executionDataProvider, blockNumber, timestamp) {
|
|
101
|
-
const { delayedPublicMutableSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
|
|
102
|
-
const delayedPublicMutableValues = await DelayedPublicMutableValues.readFromTree(delayedPublicMutableSlot, (slot)=>executionDataProvider.getPublicStorageAt(blockNumber, ProtocolContractAddress.ContractInstanceRegistry, slot));
|
|
103
|
-
let currentClassId = delayedPublicMutableValues.svc.getCurrentAt(timestamp)[0];
|
|
104
|
-
if (currentClassId.isZero()) {
|
|
105
|
-
currentClassId = instance.originalContractClassId;
|
|
106
|
-
}
|
|
107
|
-
return currentClassId;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Verify that the current class id of a contract obtained from AztecNode is the same as the one in the execution data
|
|
111
|
-
* provider (i.e. PXE).
|
|
112
|
-
* @param contractAddress - The address of the contract to verify class id for.
|
|
113
|
-
* @param executionDataProvider - The execution data provider.
|
|
114
|
-
* @param header - The header of the block at which to verify the current class id. If not provided, the anchor block
|
|
115
|
-
* header of the execution data provider is used.
|
|
116
|
-
*/ export async function verifyCurrentClassId(contractAddress, executionDataProvider, header) {
|
|
117
|
-
header = header ?? await executionDataProvider.getAnchorBlockHeader();
|
|
118
|
-
const instance = await executionDataProvider.getContractInstance(contractAddress);
|
|
119
|
-
const currentClassId = await readCurrentClassId(contractAddress, instance, executionDataProvider, header.globalVariables.blockNumber, header.globalVariables.timestamp);
|
|
120
|
-
if (!instance.currentContractClassId.equals(currentClassId)) {
|
|
121
|
-
throw new Error(`Contract ${contractAddress} is outdated, current class id is ${currentClassId}, local class id is ${instance.currentContractClassId}`);
|
|
122
|
-
}
|
|
123
|
-
}
|