@aztec/pxe 0.0.1-commit.03f7ef2 → 0.0.1-commit.04852196a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/access_scopes.d.ts +9 -0
- package/dest/access_scopes.d.ts.map +1 -0
- package/dest/access_scopes.js +6 -0
- package/dest/bin/check_oracle_version.js +1 -1
- package/dest/block_synchronizer/block_synchronizer.d.ts +17 -11
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +80 -34
- package/dest/config/index.d.ts +4 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +18 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
- package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/benchmarked_node.js +77 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +65 -40
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +212 -92
- package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +45 -28
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +5 -5
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +3 -3
- package/dest/contract_function_simulator/index.d.ts +2 -2
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -3
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +7 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +3 -3
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +2 -2
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +55 -47
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
- package/dest/contract_function_simulator/oracle/oracle.d.ts +44 -42
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +178 -112
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -26
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +2 -38
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +63 -63
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +120 -88
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +106 -70
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +167 -145
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +5 -5
- package/dest/contract_logging.d.ts +22 -0
- package/dest/contract_logging.d.ts.map +1 -0
- package/dest/contract_logging.js +23 -0
- package/dest/contract_sync/contract_sync_service.d.ts +43 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +97 -0
- package/dest/contract_sync/helpers.d.ts +29 -0
- package/dest/contract_sync/helpers.d.ts.map +1 -0
- package/dest/contract_sync/helpers.js +55 -0
- package/dest/debug/pxe_debug_utils.d.ts +26 -12
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +30 -19
- package/dest/entrypoints/client/bundle/index.d.ts +4 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +3 -0
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +31 -8
- package/dest/entrypoints/client/lazy/index.d.ts +4 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +3 -0
- package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +32 -9
- package/dest/entrypoints/pxe_creation_options.d.ts +5 -3
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +5 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +4 -0
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +39 -16
- package/dest/error_enriching.d.ts +4 -4
- package/dest/error_enriching.d.ts.map +1 -1
- package/dest/error_enriching.js +6 -6
- package/dest/events/event_service.d.ts +8 -8
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +21 -24
- package/dest/events/private_event_filter_validator.d.ts +6 -6
- package/dest/events/private_event_filter_validator.d.ts.map +1 -1
- package/dest/events/private_event_filter_validator.js +5 -6
- package/dest/job_coordinator/job_coordinator.d.ts +75 -0
- package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
- package/dest/job_coordinator/job_coordinator.js +94 -0
- package/dest/logs/log_service.d.ts +18 -32
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +76 -197
- package/dest/notes/note_service.d.ts +13 -12
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +42 -46
- package/dest/notes_filter.d.ts +25 -0
- package/dest/notes_filter.d.ts.map +1 -0
- package/dest/notes_filter.js +4 -0
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +5 -4
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
- package/dest/private_kernel/hints/index.d.ts +3 -3
- package/dest/private_kernel/hints/index.d.ts.map +1 -1
- package/dest/private_kernel/hints/index.js +2 -2
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +29 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
- package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +141 -74
- package/dest/private_kernel/hints/test_utils.d.ts +122 -0
- package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
- package/dest/private_kernel/hints/test_utils.js +203 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +24 -17
- package/dest/private_kernel/private_kernel_oracle.d.ts +24 -24
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +94 -2
- package/dest/pxe.d.ts +87 -67
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +211 -189
- package/dest/storage/address_store/address_store.d.ts +11 -0
- package/dest/storage/address_store/address_store.d.ts.map +1 -0
- package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +13 -12
- package/dest/storage/address_store/index.d.ts +2 -0
- package/dest/storage/address_store/index.d.ts.map +1 -0
- package/dest/storage/address_store/index.js +1 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +17 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
- package/dest/storage/{anchor_block_data_provider/anchor_block_data_provider.js → anchor_block_store/anchor_block_store.js} +9 -2
- package/dest/storage/anchor_block_store/index.d.ts +2 -0
- package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/index.js +1 -0
- package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_store.js +253 -0
- package/dest/storage/capsule_store/index.d.ts +2 -0
- package/dest/storage/capsule_store/index.d.ts.map +1 -0
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/contract_store/contract_store.d.ts +93 -0
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/contract_store/contract_store.js +309 -0
- package/dest/storage/contract_store/index.d.ts +2 -0
- package/dest/storage/contract_store/index.d.ts.map +1 -0
- package/dest/storage/contract_store/index.js +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
- package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
- package/dest/storage/index.d.ts +8 -8
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -7
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/index.d.ts +3 -0
- package/dest/storage/note_store/index.d.ts.map +1 -0
- package/dest/storage/note_store/index.js +2 -0
- package/dest/storage/note_store/note_store.d.ts +83 -0
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/note_store/note_store.js +343 -0
- package/dest/storage/note_store/stored_note.d.ts +16 -0
- package/dest/storage/note_store/stored_note.d.ts.map +1 -0
- package/dest/storage/note_store/stored_note.js +43 -0
- package/dest/storage/private_event_store/private_event_store.d.ts +91 -0
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
- package/dest/storage/private_event_store/private_event_store.js +273 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
- package/dest/storage/private_event_store/stored_private_event.js +56 -0
- package/dest/storage/tagging_store/index.d.ts +4 -0
- package/dest/storage/tagging_store/index.d.ts.map +1 -0
- package/dest/storage/tagging_store/index.js +3 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/recipient_tagging_store.js +111 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_address_book_store.js +36 -0
- package/dest/storage/{tagging_data_provider/sender_tagging_data_provider.d.ts → tagging_store/sender_tagging_store.d.ts} +20 -10
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_tagging_store.js +348 -0
- package/dest/tagging/constants.d.ts +2 -2
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +10 -3
- package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
- package/dest/tagging/get_all_logs_by_tags.js +60 -0
- package/dest/tagging/index.d.ts +16 -4
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +15 -3
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +6 -6
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +13 -13
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +7 -7
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +16 -12
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +17 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.js +9 -27
- package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.d.ts +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
- package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.js +5 -8
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +18 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.js +25 -21
- package/package.json +27 -18
- package/src/access_scopes.ts +9 -0
- package/src/bin/check_oracle_version.ts +1 -0
- package/src/block_synchronizer/block_synchronizer.ts +99 -46
- package/src/config/index.ts +15 -1
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/benchmarked_node.ts +103 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +366 -156
- package/src/contract_function_simulator/execution_note_cache.ts +44 -25
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +5 -5
- package/src/contract_function_simulator/index.ts +1 -1
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +6 -2
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +2 -2
- package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
- package/src/contract_function_simulator/oracle/interfaces.ts +62 -49
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
- package/src/contract_function_simulator/oracle/oracle.ts +194 -134
- package/src/contract_function_simulator/oracle/private_execution.ts +2 -70
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +157 -168
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +245 -167
- package/src/contract_function_simulator/proxied_contract_data_source.ts +7 -7
- package/src/contract_logging.ts +39 -0
- package/src/contract_sync/contract_sync_service.ts +152 -0
- package/src/contract_sync/helpers.ts +98 -0
- package/src/debug/pxe_debug_utils.ts +65 -20
- package/src/entrypoints/client/bundle/index.ts +3 -0
- package/src/entrypoints/client/bundle/utils.ts +23 -16
- package/src/entrypoints/client/lazy/index.ts +3 -0
- package/src/entrypoints/client/lazy/utils.ts +24 -17
- package/src/entrypoints/pxe_creation_options.ts +4 -2
- package/src/entrypoints/server/index.ts +4 -0
- package/src/entrypoints/server/utils.ts +33 -41
- package/src/error_enriching.ts +7 -15
- package/src/events/event_service.ts +22 -28
- package/src/events/private_event_filter_validator.ts +4 -6
- package/src/job_coordinator/job_coordinator.ts +150 -0
- package/src/logs/log_service.ts +122 -273
- package/src/notes/note_service.ts +45 -49
- package/src/notes_filter.ts +26 -0
- package/src/oracle_version.ts +5 -4
- package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
- package/src/private_kernel/hints/index.ts +2 -2
- package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +196 -138
- package/src/private_kernel/hints/test_utils.ts +325 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +27 -19
- package/src/private_kernel/private_kernel_oracle.ts +116 -36
- package/src/pxe.ts +339 -261
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +16 -16
- package/src/storage/address_store/index.ts +1 -0
- package/src/storage/{anchor_block_data_provider/anchor_block_data_provider.ts → anchor_block_store/anchor_block_store.ts} +9 -1
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/capsule_store/capsule_store.ts +315 -0
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/contract_store/contract_store.ts +429 -0
- package/src/storage/contract_store/index.ts +1 -0
- package/src/storage/index.ts +7 -7
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/note_store/note_store.ts +418 -0
- package/src/storage/note_store/stored_note.ts +48 -0
- package/src/storage/private_event_store/private_event_store.ts +384 -0
- package/src/storage/private_event_store/stored_private_event.ts +73 -0
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +143 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +429 -0
- package/src/tagging/constants.ts +10 -3
- package/src/tagging/get_all_logs_by_tags.ts +92 -0
- package/src/tagging/index.ts +18 -3
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +29 -18
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +17 -16
- package/src/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.ts +15 -33
- package/src/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.ts +5 -13
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +75 -0
- package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
- package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
- package/dest/contract_function_simulator/proxied_node.js +0 -27
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
- package/dest/public_storage/public_storage_service.d.ts +0 -24
- package/dest/public_storage/public_storage_service.d.ts.map +0 -1
- package/dest/public_storage/public_storage_service.js +0 -26
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.d.ts +0 -2
- package/dest/storage/address_data_provider/index.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.js +0 -1
- package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts +0 -9
- package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts.map +0 -1
- package/dest/storage/anchor_block_data_provider/index.d.ts +0 -2
- package/dest/storage/anchor_block_data_provider/index.d.ts.map +0 -1
- package/dest/storage/anchor_block_data_provider/index.js +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -57
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -146
- package/dest/storage/capsule_data_provider/index.d.ts +0 -2
- package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts +0 -66
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.js +0 -224
- package/dest/storage/contract_data_provider/index.d.ts +0 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -84
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_data_provider.js +0 -322
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -51
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -115
- package/dest/storage/tagging_data_provider/index.d.ts +0 -3
- package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.js +0 -2
- package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts +0 -31
- package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.js +0 -65
- package/dest/storage/tagging_data_provider/sender_tagging_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/sender_tagging_data_provider.js +0 -196
- package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts +0 -21
- package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts.map +0 -1
- package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.js +0 -42
- package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts +0 -21
- package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts.map +0 -1
- package/dest/tagging/sync/utils/get_status_change_of_pending.d.ts.map +0 -1
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts +0 -18
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts.map +0 -1
- package/dest/tagging/utils.d.ts +0 -18
- package/dest/tagging/utils.d.ts.map +0 -1
- package/dest/tagging/utils.js +0 -25
- package/dest/tree_membership/tree_membership_service.d.ts +0 -52
- package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
- package/dest/tree_membership/tree_membership_service.js +0 -84
- package/src/contract_function_simulator/proxied_node.ts +0 -33
- package/src/private_kernel/private_kernel_oracle_impl.ts +0 -133
- package/src/public_storage/public_storage_service.ts +0 -33
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/anchor_block_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -179
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/contract_data_provider.ts +0 -319
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/note_data_provider/note_data_provider.ts +0 -412
- package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -162
- package/src/storage/tagging_data_provider/index.ts +0 -2
- package/src/storage/tagging_data_provider/recipient_tagging_data_provider.ts +0 -86
- package/src/storage/tagging_data_provider/sender_tagging_data_provider.ts +0 -244
- package/src/tagging/recipient_sync/new_recipient_tagging_data_provider.ts +0 -53
- package/src/tagging/sync/utils/load_and_store_new_tagging_indexes.ts +0 -72
- package/src/tagging/utils.ts +0 -32
- package/src/tree_membership/tree_membership_service.ts +0 -112
- /package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +0 -0
- /package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +0 -0
|
@@ -4,9 +4,9 @@ import { Point } from '@aztec/foundation/curves/grumpkin';
|
|
|
4
4
|
import { arrayOfArraysToBoundedVecOfArrays, bufferToBoundedVec, fromUintArray, fromUintBoundedVec, toACVMField } from '@aztec/simulator/client';
|
|
5
5
|
import { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
6
6
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
7
8
|
import { ContractClassLog, ContractClassLogFields } from '@aztec/stdlib/logs';
|
|
8
|
-
import {
|
|
9
|
-
import { packAsRetrievedNote } from './note_packing_utils.js';
|
|
9
|
+
import { packAsHintedNote } from './note_packing_utils.js';
|
|
10
10
|
export class UnavailableOracleError extends Error {
|
|
11
11
|
constructor(oracleName){
|
|
12
12
|
super(`${oracleName} oracles not available with the current handler`);
|
|
@@ -48,11 +48,11 @@ export class UnavailableOracleError extends Error {
|
|
|
48
48
|
];
|
|
49
49
|
// Get all the oracle function names
|
|
50
50
|
const oracleNames = Object.getOwnPropertyNames(Oracle.prototype).filter((name)=>!excludedProps.includes(name));
|
|
51
|
-
// 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
|
|
52
52
|
// and must correspond to a function on the Oracle class.
|
|
53
53
|
oracleNames.forEach((name)=>{
|
|
54
|
-
if (!name.startsWith('
|
|
55
|
-
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`);
|
|
56
56
|
}
|
|
57
57
|
const method = this[name];
|
|
58
58
|
if (typeof method !== 'function') {
|
|
@@ -66,36 +66,43 @@ export class UnavailableOracleError extends Error {
|
|
|
66
66
|
return acc;
|
|
67
67
|
}, {});
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
// eslint-disable-next-line camelcase
|
|
70
|
+
aztec_utl_assertCompatibleOracleVersion([version]) {
|
|
71
|
+
this.handlerAsMisc().assertCompatibleOracleVersion(Fr.fromString(version).toNumber());
|
|
71
72
|
return Promise.resolve([]);
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
// eslint-disable-next-line camelcase
|
|
75
|
+
aztec_utl_getRandomField() {
|
|
76
|
+
const val = this.handlerAsMisc().getRandomField();
|
|
75
77
|
return Promise.resolve([
|
|
76
78
|
toACVMField(val)
|
|
77
79
|
]);
|
|
78
80
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
// eslint-disable-next-line camelcase
|
|
82
|
+
aztec_prv_storeInExecutionCache(values, [hash]) {
|
|
83
|
+
this.handlerAsPrivate().storeInExecutionCache(values.map(Fr.fromString), Fr.fromString(hash));
|
|
81
84
|
return Promise.resolve([]);
|
|
82
85
|
}
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
// eslint-disable-next-line camelcase
|
|
87
|
+
async aztec_prv_loadFromExecutionCache([returnsHash]) {
|
|
88
|
+
const values = await this.handlerAsPrivate().loadFromExecutionCache(Fr.fromString(returnsHash));
|
|
85
89
|
return [
|
|
86
90
|
values.map(toACVMField)
|
|
87
91
|
];
|
|
88
92
|
}
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
// eslint-disable-next-line camelcase
|
|
94
|
+
aztec_utl_getUtilityContext() {
|
|
95
|
+
const context = this.handlerAsUtility().getUtilityContext();
|
|
91
96
|
return Promise.resolve(context.toNoirRepresentation());
|
|
92
97
|
}
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
// eslint-disable-next-line camelcase
|
|
99
|
+
async aztec_utl_getKeyValidationRequest([pkMHash]) {
|
|
100
|
+
const keyValidationRequest = await this.handlerAsUtility().getKeyValidationRequest(Fr.fromString(pkMHash));
|
|
95
101
|
return keyValidationRequest.toFields().map(toACVMField);
|
|
96
102
|
}
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
// eslint-disable-next-line camelcase
|
|
104
|
+
async aztec_utl_getContractInstance([address]) {
|
|
105
|
+
const instance = await this.handlerAsUtility().getContractInstance(AztecAddress.fromField(Fr.fromString(address)));
|
|
99
106
|
return [
|
|
100
107
|
instance.salt,
|
|
101
108
|
instance.deployer,
|
|
@@ -104,57 +111,69 @@ export class UnavailableOracleError extends Error {
|
|
|
104
111
|
...instance.publicKeys.toFields()
|
|
105
112
|
].map(toACVMField);
|
|
106
113
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
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);
|
|
112
119
|
if (!witness) {
|
|
113
|
-
throw new Error(`
|
|
120
|
+
throw new Error(`Note hash ${noteHash} not found in the note hash tree at anchor block hash ${parsedAnchorBlockHash.toString()}.`);
|
|
114
121
|
}
|
|
115
|
-
return
|
|
116
|
-
toACVMField(witness[0]),
|
|
117
|
-
witness.slice(1).map(toACVMField)
|
|
118
|
-
];
|
|
122
|
+
return witness.toNoirRepresentation();
|
|
119
123
|
}
|
|
120
|
-
|
|
121
|
-
|
|
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);
|
|
122
137
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
123
|
-
const witness = await this.handlerAsUtility().
|
|
138
|
+
const witness = await this.handlerAsUtility().getNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
124
139
|
if (!witness) {
|
|
125
|
-
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()}.`);
|
|
126
141
|
}
|
|
127
142
|
return witness.toNoirRepresentation();
|
|
128
143
|
}
|
|
129
|
-
|
|
130
|
-
|
|
144
|
+
// eslint-disable-next-line camelcase
|
|
145
|
+
async aztec_utl_getLowNullifierMembershipWitness([blockHash], [nullifier]) {
|
|
146
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
131
147
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
132
|
-
const witness = await this.handlerAsUtility().
|
|
148
|
+
const witness = await this.handlerAsUtility().getLowNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
133
149
|
if (!witness) {
|
|
134
|
-
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()}.`);
|
|
135
151
|
}
|
|
136
152
|
return witness.toNoirRepresentation();
|
|
137
153
|
}
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
// eslint-disable-next-line camelcase
|
|
155
|
+
async aztec_utl_getPublicDataWitness([blockHash], [leafSlot]) {
|
|
156
|
+
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
140
157
|
const parsedLeafSlot = Fr.fromString(leafSlot);
|
|
141
|
-
const witness = await this.handlerAsUtility().
|
|
158
|
+
const witness = await this.handlerAsUtility().getPublicDataWitness(parsedBlockHash, parsedLeafSlot);
|
|
142
159
|
if (!witness) {
|
|
143
|
-
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()}.`);
|
|
144
161
|
}
|
|
145
162
|
return witness.toNoirRepresentation();
|
|
146
163
|
}
|
|
147
|
-
|
|
164
|
+
// eslint-disable-next-line camelcase
|
|
165
|
+
async aztec_utl_getBlockHeader([blockNumber]) {
|
|
148
166
|
const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
|
|
149
|
-
const header = await this.handlerAsUtility().
|
|
167
|
+
const header = await this.handlerAsUtility().getBlockHeader(BlockNumber(parsedBlockNumber));
|
|
150
168
|
if (!header) {
|
|
151
169
|
throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
|
|
152
170
|
}
|
|
153
171
|
return header.toFields().map(toACVMField);
|
|
154
172
|
}
|
|
155
|
-
|
|
173
|
+
// eslint-disable-next-line camelcase
|
|
174
|
+
async aztec_utl_getAuthWitness([messageHash]) {
|
|
156
175
|
const messageHashField = Fr.fromString(messageHash);
|
|
157
|
-
const witness = await this.handlerAsUtility().
|
|
176
|
+
const witness = await this.handlerAsUtility().getAuthWitness(messageHashField);
|
|
158
177
|
if (!witness) {
|
|
159
178
|
throw new Error(`Unknown auth witness for message hash ${messageHashField}`);
|
|
160
179
|
}
|
|
@@ -162,79 +181,109 @@ export class UnavailableOracleError extends Error {
|
|
|
162
181
|
witness.map(toACVMField)
|
|
163
182
|
];
|
|
164
183
|
}
|
|
165
|
-
|
|
184
|
+
// eslint-disable-next-line camelcase
|
|
185
|
+
async aztec_utl_tryGetPublicKeysAndPartialAddress([address]) {
|
|
166
186
|
const parsedAddress = AztecAddress.fromField(Fr.fromString(address));
|
|
167
|
-
const
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
+
}
|
|
174
206
|
}
|
|
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]) {
|
|
176
209
|
// Parse Option<AztecAddress>: ownerSome is 0 for None, 1 for Some
|
|
177
210
|
const owner = Fr.fromString(ownerSome).toNumber() === 1 ? AztecAddress.fromString(ownerValue) : undefined;
|
|
178
|
-
const noteDatas = await this.handlerAsUtility().
|
|
179
|
-
const
|
|
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({
|
|
180
213
|
contractAddress: noteData.contractAddress,
|
|
181
214
|
owner: noteData.owner,
|
|
182
215
|
randomness: noteData.randomness,
|
|
183
216
|
storageSlot: noteData.storageSlot,
|
|
184
217
|
noteNonce: noteData.noteNonce,
|
|
185
|
-
|
|
218
|
+
isPending: noteData.isPending,
|
|
186
219
|
note: noteData.note
|
|
187
220
|
}));
|
|
188
221
|
// Now we convert each sub-array to an array of ACVMField
|
|
189
|
-
const returnDataAsArrayOfACVMFieldArrays =
|
|
222
|
+
const returnDataAsArrayOfACVMFieldArrays = returnDataAsArrayOfPackedHintedNotes.map((subArray)=>subArray.map(toACVMField));
|
|
190
223
|
// At last we convert the array of arrays to a bounded vec of arrays
|
|
191
|
-
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +
|
|
224
|
+
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedHintedNoteLength);
|
|
192
225
|
}
|
|
193
|
-
|
|
194
|
-
|
|
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);
|
|
195
229
|
return Promise.resolve([]);
|
|
196
230
|
}
|
|
197
|
-
|
|
198
|
-
|
|
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);
|
|
199
234
|
return [];
|
|
200
235
|
}
|
|
201
|
-
|
|
202
|
-
|
|
236
|
+
// eslint-disable-next-line camelcase
|
|
237
|
+
async aztec_prv_notifyCreatedNullifier([innerNullifier]) {
|
|
238
|
+
await this.handlerAsPrivate().notifyCreatedNullifier(Fr.fromString(innerNullifier));
|
|
203
239
|
return [];
|
|
204
240
|
}
|
|
205
|
-
|
|
206
|
-
|
|
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));
|
|
207
251
|
return [
|
|
208
252
|
toACVMField(exists)
|
|
209
253
|
];
|
|
210
254
|
}
|
|
211
|
-
|
|
212
|
-
|
|
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));
|
|
213
258
|
return message.toNoirRepresentation();
|
|
214
259
|
}
|
|
215
|
-
|
|
216
|
-
|
|
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);
|
|
217
263
|
return [
|
|
218
264
|
values.map(toACVMField)
|
|
219
265
|
];
|
|
220
266
|
}
|
|
221
|
-
|
|
267
|
+
// eslint-disable-next-line camelcase
|
|
268
|
+
aztec_prv_notifyCreatedContractClassLog([contractAddress], message, [length], [counter]) {
|
|
222
269
|
const logFields = new ContractClassLogFields(message.map(Fr.fromString));
|
|
223
270
|
const log = new ContractClassLog(new AztecAddress(Fr.fromString(contractAddress)), logFields, +length);
|
|
224
|
-
this.handlerAsPrivate().
|
|
271
|
+
this.handlerAsPrivate().notifyCreatedContractClassLog(log, +counter);
|
|
225
272
|
return Promise.resolve([]);
|
|
226
273
|
}
|
|
227
|
-
|
|
274
|
+
// eslint-disable-next-line camelcase
|
|
275
|
+
async aztec_utl_log(level, message, _ignoredFieldsSize, fields) {
|
|
228
276
|
const levelFr = Fr.fromString(level[0]);
|
|
229
277
|
const messageStr = message.map((acvmField)=>String.fromCharCode(Fr.fromString(acvmField).toNumber())).join('');
|
|
230
278
|
const fieldsFr = fields.map(Fr.fromString);
|
|
231
|
-
this.handlerAsMisc().
|
|
232
|
-
return
|
|
279
|
+
await this.handlerAsMisc().log(levelFr.toNumber(), messageStr, fieldsFr);
|
|
280
|
+
return [];
|
|
233
281
|
}
|
|
234
282
|
// This function's name is directly hardcoded in `circuit_recorder.ts`. Don't forget to update it there if you
|
|
235
283
|
// change the name here.
|
|
236
|
-
|
|
237
|
-
|
|
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());
|
|
238
287
|
return [
|
|
239
288
|
[
|
|
240
289
|
endSideEffectCounter,
|
|
@@ -242,48 +291,58 @@ export class UnavailableOracleError extends Error {
|
|
|
242
291
|
].map(toACVMField)
|
|
243
292
|
];
|
|
244
293
|
}
|
|
245
|
-
|
|
246
|
-
|
|
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());
|
|
247
297
|
return [];
|
|
248
298
|
}
|
|
249
|
-
|
|
250
|
-
|
|
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());
|
|
251
302
|
return [];
|
|
252
303
|
}
|
|
253
|
-
|
|
254
|
-
|
|
304
|
+
// eslint-disable-next-line camelcase
|
|
305
|
+
async aztec_prv_notifySetMinRevertibleSideEffectCounter([minRevertibleSideEffectCounter]) {
|
|
306
|
+
await this.handlerAsPrivate().notifySetMinRevertibleSideEffectCounter(Fr.fromString(minRevertibleSideEffectCounter).toNumber());
|
|
255
307
|
return Promise.resolve([]);
|
|
256
308
|
}
|
|
257
|
-
|
|
258
|
-
|
|
309
|
+
// eslint-disable-next-line camelcase
|
|
310
|
+
async aztec_prv_isSideEffectCounterRevertible([sideEffectCounter]) {
|
|
311
|
+
const isRevertible = await this.handlerAsPrivate().isSideEffectCounterRevertible(Fr.fromString(sideEffectCounter).toNumber());
|
|
259
312
|
return Promise.resolve([
|
|
260
313
|
toACVMField(isRevertible)
|
|
261
314
|
]);
|
|
262
315
|
}
|
|
263
|
-
|
|
264
|
-
|
|
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));
|
|
265
319
|
return [
|
|
266
320
|
toACVMField(tag.value)
|
|
267
321
|
];
|
|
268
322
|
}
|
|
269
|
-
|
|
270
|
-
|
|
323
|
+
// eslint-disable-next-line camelcase
|
|
324
|
+
async aztec_utl_fetchTaggedLogs([pendingTaggedLogArrayBaseSlot]) {
|
|
325
|
+
await this.handlerAsUtility().fetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
|
|
271
326
|
return [];
|
|
272
327
|
}
|
|
273
|
-
|
|
274
|
-
|
|
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));
|
|
275
331
|
return [];
|
|
276
332
|
}
|
|
277
|
-
|
|
278
|
-
|
|
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));
|
|
279
336
|
return [];
|
|
280
337
|
}
|
|
281
|
-
|
|
282
|
-
|
|
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));
|
|
283
341
|
return [];
|
|
284
342
|
}
|
|
285
|
-
|
|
286
|
-
|
|
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));
|
|
287
346
|
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
288
347
|
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
289
348
|
if (values === null) {
|
|
@@ -300,35 +359,41 @@ export class UnavailableOracleError extends Error {
|
|
|
300
359
|
];
|
|
301
360
|
}
|
|
302
361
|
}
|
|
303
|
-
|
|
304
|
-
|
|
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));
|
|
305
365
|
return [];
|
|
306
366
|
}
|
|
307
|
-
|
|
308
|
-
|
|
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());
|
|
309
370
|
return [];
|
|
310
371
|
}
|
|
311
|
-
|
|
372
|
+
// eslint-disable-next-line camelcase
|
|
373
|
+
async aztec_utl_aes128Decrypt(ciphertextBVecStorage, [ciphertextLength], iv, symKey) {
|
|
312
374
|
const ciphertext = fromUintBoundedVec(ciphertextBVecStorage, ciphertextLength, 8);
|
|
313
375
|
const ivBuffer = fromUintArray(iv, 8);
|
|
314
376
|
const symKeyBuffer = fromUintArray(symKey, 8);
|
|
315
|
-
const plaintext = await this.handlerAsUtility().
|
|
377
|
+
const plaintext = await this.handlerAsUtility().aes128Decrypt(ciphertext, ivBuffer, symKeyBuffer);
|
|
316
378
|
return bufferToBoundedVec(plaintext, ciphertextBVecStorage.length);
|
|
317
379
|
}
|
|
318
|
-
|
|
319
|
-
|
|
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([
|
|
320
383
|
ephPKField0,
|
|
321
384
|
ephPKField1,
|
|
322
385
|
ephPKField2
|
|
323
386
|
].map(Fr.fromString)));
|
|
324
387
|
return secret.toFields().map(toACVMField);
|
|
325
388
|
}
|
|
326
|
-
|
|
327
|
-
|
|
389
|
+
// eslint-disable-next-line camelcase
|
|
390
|
+
async aztec_utl_emitOffchainEffect(data) {
|
|
391
|
+
await this.handlerAsPrivate().emitOffchainEffect(data.map(Fr.fromString));
|
|
328
392
|
return [];
|
|
329
393
|
}
|
|
330
|
-
|
|
331
|
-
|
|
394
|
+
// eslint-disable-next-line camelcase
|
|
395
|
+
async aztec_prv_getSenderForTags() {
|
|
396
|
+
const sender = await this.handlerAsPrivate().getSenderForTags();
|
|
332
397
|
// Return [1, address] for Some(address), [0, 0] for None
|
|
333
398
|
return sender ? [
|
|
334
399
|
toACVMField(1n),
|
|
@@ -338,8 +403,9 @@ export class UnavailableOracleError extends Error {
|
|
|
338
403
|
toACVMField(0n)
|
|
339
404
|
];
|
|
340
405
|
}
|
|
341
|
-
|
|
342
|
-
|
|
406
|
+
// eslint-disable-next-line camelcase
|
|
407
|
+
async aztec_prv_setSenderForTags([senderForTags]) {
|
|
408
|
+
await this.handlerAsPrivate().setSenderForTags(AztecAddress.fromField(Fr.fromString(senderForTags)));
|
|
343
409
|
return [];
|
|
344
410
|
}
|
|
345
411
|
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
1
|
import { type ACVMWitness, type CircuitSimulator } from '@aztec/simulator/client';
|
|
4
2
|
import { type FunctionArtifact, type FunctionArtifactWithContractName, type FunctionSelector } from '@aztec/stdlib/abi';
|
|
5
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import type { ContractInstance } from '@aztec/stdlib/contract';
|
|
7
|
-
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
8
4
|
import { PrivateCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
9
|
-
import {
|
|
10
|
-
import type { UInt64 } from '@aztec/stdlib/types';
|
|
11
|
-
import { ContractDataProvider } from '../../storage/contract_data_provider/index.js';
|
|
5
|
+
import { PrivateCallExecutionResult } from '@aztec/stdlib/tx';
|
|
12
6
|
import type { PrivateExecutionOracle } from './private_execution_oracle.js';
|
|
13
7
|
/**
|
|
14
8
|
* Execute a private function and return the execution result.
|
|
@@ -26,22 +20,4 @@ export declare function executePrivateFunction(simulator: CircuitSimulator, priv
|
|
|
26
20
|
* @returns - The public inputs.
|
|
27
21
|
*/
|
|
28
22
|
export declare function extractPrivateCircuitPublicInputs(artifact: FunctionArtifact, partialWitness: ACVMWitness): PrivateCircuitPublicInputs;
|
|
29
|
-
|
|
30
|
-
* Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
|
|
31
|
-
* from the instance is used.
|
|
32
|
-
* @param contractAddress - The address of the contract to read the class id for.
|
|
33
|
-
* @param instance - The instance of the contract.
|
|
34
|
-
* @param executionDataProvider - The execution data provider.
|
|
35
|
-
* @param blockNumber - The block number at which to load the DelayedPublicMutable storing the class id.
|
|
36
|
-
* @param timestamp - The timestamp at which to obtain the class id from the DelayedPublicMutable.
|
|
37
|
-
* @returns The current class id.
|
|
38
|
-
*/
|
|
39
|
-
export declare function readCurrentClassId(contractAddress: AztecAddress, instance: ContractInstance, aztecNode: AztecNode, blockNumber: BlockNumber, timestamp: UInt64): Promise<Fr>;
|
|
40
|
-
/**
|
|
41
|
-
* Verify that the current class id of a contract obtained from AztecNode is the same as the one in contract data
|
|
42
|
-
* provider (i.e. PXE's own storage).
|
|
43
|
-
* @param header - The header of the block at which to verify the current class id. If not provided, the anchor block
|
|
44
|
-
* header of the execution data provider is used.
|
|
45
|
-
*/
|
|
46
|
-
export declare function verifyCurrentClassId(contractAddress: AztecAddress, aztecNode: AztecNode, contractDataProvider: ContractDataProvider, header: BlockHeader): Promise<void>;
|
|
47
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9leGVjdXRpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb250cmFjdF9mdW5jdGlvbl9zaW11bGF0b3Ivb3JhY2xlL3ByaXZhdGVfZXhlY3V0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUM5RCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFJcEQsT0FBTyxFQUNMLEtBQUssV0FBVyxFQUNoQixLQUFLLGdCQUFnQixFQUt0QixNQUFNLHlCQUF5QixDQUFDO0FBQ2pDLE9BQU8sRUFDTCxLQUFLLGdCQUFnQixFQUNyQixLQUFLLGdDQUFnQyxFQUNyQyxLQUFLLGdCQUFnQixFQUV0QixNQUFNLG1CQUFtQixDQUFDO0FBQzNCLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFL0QsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxFQUFFLDBCQUEwQixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFbEUsT0FBTyxFQUFFLFdBQVcsRUFBRSwwQkFBMEIsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQzNFLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRWxELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLCtDQUErQyxDQUFDO0FBRXJGLE9BQU8sS0FBSyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFNUU7Ozs7Ozs7R0FPRztBQUNILHdCQUFzQixzQkFBc0IsQ0FDMUMsU0FBUyxFQUFFLGdCQUFnQixFQUMzQixzQkFBc0IsRUFBRSxzQkFBc0IsRUFDOUMsUUFBUSxFQUFFLGdDQUFnQyxFQUMxQyxlQUFlLEVBQUUsWUFBWSxFQUM3QixnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFDbEMsR0FBRyx5Q0FBOEMsR0FDaEQsT0FBTyxDQUFDLDBCQUEwQixDQUFDLENBNkVyQztBQUVEOzs7OztHQUtHO0FBQ0gsd0JBQWdCLGlDQUFpQyxDQUMvQyxRQUFRLEVBQUUsZ0JBQWdCLEVBQzFCLGNBQWMsRUFBRSxXQUFXLEdBQzFCLDBCQUEwQixDQWE1QjtBQUVEOzs7Ozs7Ozs7R0FTRztBQUNILHdCQUFzQixrQkFBa0IsQ0FDdEMsZUFBZSxFQUFFLFlBQVksRUFDN0IsUUFBUSxFQUFFLGdCQUFnQixFQUMxQixTQUFTLEVBQUUsU0FBUyxFQUNwQixXQUFXLEVBQUUsV0FBVyxFQUN4QixTQUFTLEVBQUUsTUFBTSxlQVdsQjtBQUVEOzs7OztHQUtHO0FBQ0gsd0JBQXNCLG9CQUFvQixDQUN4QyxlQUFlLEVBQUUsWUFBWSxFQUM3QixTQUFTLEVBQUUsU0FBUyxFQUNwQixvQkFBb0IsRUFBRSxvQkFBb0IsRUFDMUMsTUFBTSxFQUFFLFdBQVcsaUJBbUJwQiJ9
|
|
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"}
|
|
@@ -2,10 +2,8 @@ import { PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, PRIVATE_CONTEXT_INPUTS_LENGTH } f
|
|
|
2
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, aztecNode, blockNumber, timestamp) {
|
|
101
|
-
const { delayedPublicMutableSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
|
|
102
|
-
const delayedPublicMutableValues = await DelayedPublicMutableValues.readFromTree(delayedPublicMutableSlot, (slot)=>aztecNode.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 contract data
|
|
111
|
-
* provider (i.e. PXE's own storage).
|
|
112
|
-
* @param header - The header of the block at which to verify the current class id. If not provided, the anchor block
|
|
113
|
-
* header of the execution data provider is used.
|
|
114
|
-
*/ export async function verifyCurrentClassId(contractAddress, aztecNode, contractDataProvider, header) {
|
|
115
|
-
const instance = await contractDataProvider.getContractInstance(contractAddress);
|
|
116
|
-
if (!instance) {
|
|
117
|
-
throw new Error(`No contract instance found for address ${contractAddress.toString()}`);
|
|
118
|
-
}
|
|
119
|
-
const currentClassId = await readCurrentClassId(contractAddress, instance, aztecNode, 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
|
-
}
|