@aztec/pxe 0.0.1-commit.fce3e4f → 0.0.1-commit.ff7989d6c
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 +6 -4
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +17 -0
- 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 +218 -73
- 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 +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +1 -1
- 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 +27 -20
- 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 +13 -11
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +86 -51
- 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 +2 -38
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +54 -45
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +105 -62
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +114 -38
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +214 -86
- 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 +4 -3
- 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 +28 -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} +16 -10
- 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 +16 -17
- 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 +112 -102
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +255 -252
- 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 +15 -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 +15 -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 +32 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +21 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +29 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +21 -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 +60 -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 +17 -3
- 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 +380 -104
- package/src/contract_function_simulator/execution_note_cache.ts +51 -28
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +1 -1
- 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 +32 -17
- 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 +101 -47
- package/src/contract_function_simulator/oracle/private_execution.ts +2 -68
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +154 -97
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +350 -91
- 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 +208 -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 +4 -3
- 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} +40 -29
- package/src/private_kernel/private_kernel_execution_prover.ts +20 -18
- package/src/private_kernel/private_kernel_oracle.ts +118 -37
- package/src/pxe.ts +395 -343
- 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 +139 -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 +143 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +49 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +99 -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 +84 -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,44 +1,95 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { KeyStore } from '@aztec/key-store';
|
|
2
3
|
import { type CircuitSimulator } from '@aztec/simulator/client';
|
|
3
4
|
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
4
5
|
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
5
6
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
6
7
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
7
9
|
import { type PrivateKernelExecutionProofOutput, PrivateKernelTailCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
8
|
-
import { PrivateExecutionResult, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
10
|
+
import { BlockHeader, PrivateExecutionResult, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
11
|
+
import type { AccessScopes } from '../access_scopes.js';
|
|
12
|
+
import type { ContractSyncService } from '../contract_sync/contract_sync_service.js';
|
|
13
|
+
import type { AddressStore } from '../storage/address_store/address_store.js';
|
|
14
|
+
import type { CapsuleStore } from '../storage/capsule_store/capsule_store.js';
|
|
15
|
+
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
16
|
+
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
17
|
+
import type { PrivateEventStore } from '../storage/private_event_store/private_event_store.js';
|
|
18
|
+
import type { RecipientTaggingStore } from '../storage/tagging_store/recipient_tagging_store.js';
|
|
19
|
+
import type { SenderAddressBookStore } from '../storage/tagging_store/sender_address_book_store.js';
|
|
20
|
+
import type { SenderTaggingStore } from '../storage/tagging_store/sender_tagging_store.js';
|
|
21
|
+
/** Options for ContractFunctionSimulator.run. */
|
|
22
|
+
export type ContractSimulatorRunOpts = {
|
|
23
|
+
/** The address of the contract (should match request.origin). */
|
|
24
|
+
contractAddress: AztecAddress;
|
|
25
|
+
/** The function selector of the entry point. */
|
|
26
|
+
selector: FunctionSelector;
|
|
27
|
+
/** The address calling the function. Can be replaced to simulate a call from another contract or account. */
|
|
28
|
+
msgSender?: AztecAddress;
|
|
29
|
+
/** The block header to use as base state for this run. */
|
|
30
|
+
anchorBlockHeader: BlockHeader;
|
|
31
|
+
/** The address used as a tagging sender when emitting private logs. */
|
|
32
|
+
senderForTags?: AztecAddress;
|
|
33
|
+
/** The accounts whose notes we can access in this call. */
|
|
34
|
+
scopes: AccessScopes;
|
|
35
|
+
/** The job ID for staged writes. */
|
|
36
|
+
jobId: string;
|
|
37
|
+
};
|
|
38
|
+
/** Args for ContractFunctionSimulator constructor. */
|
|
39
|
+
export type ContractFunctionSimulatorArgs = {
|
|
40
|
+
contractStore: ContractStore;
|
|
41
|
+
noteStore: NoteStore;
|
|
42
|
+
keyStore: KeyStore;
|
|
43
|
+
addressStore: AddressStore;
|
|
44
|
+
aztecNode: AztecNode;
|
|
45
|
+
senderTaggingStore: SenderTaggingStore;
|
|
46
|
+
recipientTaggingStore: RecipientTaggingStore;
|
|
47
|
+
senderAddressBookStore: SenderAddressBookStore;
|
|
48
|
+
capsuleStore: CapsuleStore;
|
|
49
|
+
privateEventStore: PrivateEventStore;
|
|
50
|
+
simulator: CircuitSimulator;
|
|
51
|
+
contractSyncService: ContractSyncService;
|
|
52
|
+
};
|
|
11
53
|
/**
|
|
12
54
|
* The contract function simulator.
|
|
13
55
|
*/
|
|
14
56
|
export declare class ContractFunctionSimulator {
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
|
|
57
|
+
private readonly log;
|
|
58
|
+
private readonly contractStore;
|
|
59
|
+
private readonly noteStore;
|
|
60
|
+
private readonly keyStore;
|
|
61
|
+
private readonly addressStore;
|
|
62
|
+
private readonly aztecNode;
|
|
63
|
+
private readonly senderTaggingStore;
|
|
64
|
+
private readonly recipientTaggingStore;
|
|
65
|
+
private readonly senderAddressBookStore;
|
|
66
|
+
private readonly capsuleStore;
|
|
67
|
+
private readonly privateEventStore;
|
|
68
|
+
private readonly simulator;
|
|
69
|
+
private readonly contractSyncService;
|
|
70
|
+
constructor(args: ContractFunctionSimulatorArgs);
|
|
19
71
|
/**
|
|
20
72
|
* Runs a private function.
|
|
21
73
|
* @param request - The transaction request.
|
|
22
|
-
* @param entryPointArtifact - The artifact of the entry point function.
|
|
23
|
-
* @param contractAddress - The address of the contract (should match request.origin)
|
|
24
|
-
* @param msgSender - The address calling the function. This can be replaced to simulate a call from another contract
|
|
25
|
-
* or a specific account.
|
|
26
|
-
* @param senderForTags - The address that is used as a tagging sender when emitting private logs. Returned from
|
|
27
|
-
* the `privateGetSenderForTags` oracle.
|
|
28
|
-
* @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
29
|
-
* @returns The result of the execution.
|
|
30
74
|
*/
|
|
31
|
-
run(request: TxExecutionRequest, contractAddress
|
|
75
|
+
run(request: TxExecutionRequest, { contractAddress, selector, msgSender, anchorBlockHeader, senderForTags, scopes, jobId }: ContractSimulatorRunOpts): Promise<PrivateExecutionResult>;
|
|
32
76
|
/**
|
|
33
77
|
* Runs a utility function.
|
|
34
78
|
* @param call - The function call to execute.
|
|
35
79
|
* @param authwits - Authentication witnesses required for the function call.
|
|
80
|
+
* @param anchorBlockHeader - The block header to use as base state for this run.
|
|
36
81
|
* @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
|
|
37
82
|
* accounts if not specified.
|
|
38
83
|
* @returns A return value of the utility function in a form as returned by the simulator (Noir fields)
|
|
39
84
|
*/
|
|
40
|
-
runUtility(call: FunctionCall, authwits: AuthWitness[], scopes
|
|
41
|
-
|
|
85
|
+
runUtility(call: FunctionCall, authwits: AuthWitness[], anchorBlockHeader: BlockHeader, scopes: AccessScopes, jobId: string): Promise<Fr[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the execution statistics collected during the simulator run.
|
|
88
|
+
* @returns The execution statistics.
|
|
89
|
+
*/
|
|
90
|
+
getStats(): {
|
|
91
|
+
nodeRPCCalls: import("@aztec/stdlib/tx").NodeStats;
|
|
92
|
+
};
|
|
42
93
|
}
|
|
43
94
|
/**
|
|
44
95
|
* Generates the final public inputs of the tail kernel circuit, an empty Chonk proof
|
|
@@ -47,10 +98,11 @@ export declare class ContractFunctionSimulator {
|
|
|
47
98
|
* (allowing state overrides) and is much faster, while still generating a valid
|
|
48
99
|
* output that can be sent to the node for public simulation
|
|
49
100
|
* @param privateExecutionResult - The result of the private execution.
|
|
50
|
-
* @param
|
|
51
|
-
*
|
|
52
|
-
* @param
|
|
101
|
+
* @param debugFunctionNameGetter - A provider for contract data in order to get function names and debug info.
|
|
102
|
+
* @param node - AztecNode for verifying settled read requests against the note hash and nullifier trees.
|
|
103
|
+
* @param minRevertibleSideEffectCounterOverride - Optional override for the min revertible side effect counter.
|
|
104
|
+
* Used by TXE to simulate account contract behavior (setting the counter before app execution).
|
|
53
105
|
* @returns The simulated proving result.
|
|
54
106
|
*/
|
|
55
|
-
export declare function generateSimulatedProvingResult(privateExecutionResult: PrivateExecutionResult,
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
107
|
+
export declare function generateSimulatedProvingResult(privateExecutionResult: PrivateExecutionResult, debugFunctionNameGetter: (contractAddress: AztecAddress, functionSelector: FunctionSelector) => Promise<string>, node: AztecNode, minRevertibleSideEffectCounterOverride?: number): Promise<PrivateKernelExecutionProofOutput<PrivateKernelTailCircuitPublicInputs>>;
|
|
108
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLC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function_simulator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contract_function_simulator.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/contract_function_simulator.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAW3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAKL,KAAK,iCAAiC,EACtC,oCAAoC,EAarC,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,WAAW,EAGX,sBAAsB,EAEtB,kBAAkB,EAInB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC/F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,KAAK,EAAE,sBAAsB,EAAE,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OL1MSG_BASE_L2_GAS,
|
|
1
|
+
import { AVM_EMITNOTEHASH_BASE_L2_GAS, AVM_EMITNULLIFIER_BASE_L2_GAS, AVM_SENDL2TOL1MSG_BASE_L2_GAS, DA_GAS_PER_FIELD, FIXED_AVM_STARTUP_L2_GAS, FIXED_DA_GAS, FIXED_L2_GAS, L2_GAS_PER_CONTRACT_CLASS_LOG, L2_GAS_PER_L2_TO_L1_MSG, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, L2_GAS_PER_PRIVATE_LOG, MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_ENQUEUED_CALLS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PRIVATE_LOGS_PER_TX } from '@aztec/constants';
|
|
2
2
|
import { arrayNonEmptyLength, padArrayEnd } from '@aztec/foundation/collection';
|
|
3
|
-
import {
|
|
4
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
6
5
|
import { Timer } from '@aztec/foundation/timer';
|
|
7
6
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
@@ -10,46 +9,56 @@ import { ExecutionError, createSimulationError, extractCallStack, resolveAsserti
|
|
|
10
9
|
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
11
10
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
11
|
import { Gas } from '@aztec/stdlib/gas';
|
|
13
|
-
import { computeNoteHashNonce, computeProtocolNullifier, computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
|
|
14
|
-
import { PartialPrivateTailPublicInputsForPublic, PartialPrivateTailPublicInputsForRollup, PrivateKernelTailCircuitPublicInputs, PrivateToPublicAccumulatedData, PrivateToRollupAccumulatedData, PublicCallRequest, ScopedLogHash } from '@aztec/stdlib/kernel';
|
|
12
|
+
import { computeNoteHashNonce, computeProtocolNullifier, computeSiloedPrivateLogFirstField, computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
|
|
13
|
+
import { ClaimedLengthArray, PartialPrivateTailPublicInputsForPublic, PartialPrivateTailPublicInputsForRollup, PrivateKernelTailCircuitPublicInputs, PrivateToPublicAccumulatedData, PrivateToRollupAccumulatedData, PublicCallRequest, ReadRequestActionEnum, ScopedLogHash, ScopedNoteHash, ScopedNullifier, ScopedReadRequest, buildTransientDataHints, getNoteHashReadRequestResetActions, getNullifierReadRequestResetActions } from '@aztec/stdlib/kernel';
|
|
15
14
|
import { PrivateLog } from '@aztec/stdlib/logs';
|
|
16
15
|
import { ScopedL2ToL1Message } from '@aztec/stdlib/messaging';
|
|
17
16
|
import { ChonkProof } from '@aztec/stdlib/proofs';
|
|
18
|
-
import { CallContext, HashedValues, PrivateExecutionResult, TxConstantData, collectNested, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
|
|
17
|
+
import { CallContext, HashedValues, PrivateExecutionResult, TxConstantData, collectNested, collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
|
|
19
18
|
import { ExecutionNoteCache } from './execution_note_cache.js';
|
|
20
19
|
import { ExecutionTaggingIndexCache } from './execution_tagging_index_cache.js';
|
|
21
20
|
import { HashedValuesCache } from './hashed_values_cache.js';
|
|
22
21
|
import { Oracle } from './oracle/oracle.js';
|
|
23
|
-
import { executePrivateFunction
|
|
22
|
+
import { executePrivateFunction } from './oracle/private_execution.js';
|
|
24
23
|
import { PrivateExecutionOracle } from './oracle/private_execution_oracle.js';
|
|
25
24
|
import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
26
25
|
/**
|
|
27
26
|
* The contract function simulator.
|
|
28
27
|
*/ export class ContractFunctionSimulator {
|
|
29
|
-
executionDataProvider;
|
|
30
|
-
simulator;
|
|
31
28
|
log;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
contractStore;
|
|
30
|
+
noteStore;
|
|
31
|
+
keyStore;
|
|
32
|
+
addressStore;
|
|
33
|
+
aztecNode;
|
|
34
|
+
senderTaggingStore;
|
|
35
|
+
recipientTaggingStore;
|
|
36
|
+
senderAddressBookStore;
|
|
37
|
+
capsuleStore;
|
|
38
|
+
privateEventStore;
|
|
39
|
+
simulator;
|
|
40
|
+
contractSyncService;
|
|
41
|
+
constructor(args){
|
|
42
|
+
this.contractStore = args.contractStore;
|
|
43
|
+
this.noteStore = args.noteStore;
|
|
44
|
+
this.keyStore = args.keyStore;
|
|
45
|
+
this.addressStore = args.addressStore;
|
|
46
|
+
this.aztecNode = args.aztecNode;
|
|
47
|
+
this.senderTaggingStore = args.senderTaggingStore;
|
|
48
|
+
this.recipientTaggingStore = args.recipientTaggingStore;
|
|
49
|
+
this.senderAddressBookStore = args.senderAddressBookStore;
|
|
50
|
+
this.capsuleStore = args.capsuleStore;
|
|
51
|
+
this.privateEventStore = args.privateEventStore;
|
|
52
|
+
this.simulator = args.simulator;
|
|
53
|
+
this.contractSyncService = args.contractSyncService;
|
|
35
54
|
this.log = createLogger('simulator');
|
|
36
55
|
}
|
|
37
56
|
/**
|
|
38
57
|
* Runs a private function.
|
|
39
58
|
* @param request - The transaction request.
|
|
40
|
-
|
|
41
|
-
* @param contractAddress - The address of the contract (should match request.origin)
|
|
42
|
-
* @param msgSender - The address calling the function. This can be replaced to simulate a call from another contract
|
|
43
|
-
* or a specific account.
|
|
44
|
-
* @param senderForTags - The address that is used as a tagging sender when emitting private logs. Returned from
|
|
45
|
-
* the `privateGetSenderForTags` oracle.
|
|
46
|
-
* @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
47
|
-
* @returns The result of the execution.
|
|
48
|
-
*/ async run(request, contractAddress, selector, msgSender = AztecAddress.fromField(Fr.MAX_FIELD_VALUE), senderForTags, scopes) {
|
|
59
|
+
*/ async run(request, { contractAddress, selector, msgSender = AztecAddress.fromField(Fr.MAX_FIELD_VALUE), anchorBlockHeader, senderForTags, scopes, jobId }) {
|
|
49
60
|
const simulatorSetupTimer = new Timer();
|
|
50
|
-
const
|
|
51
|
-
await verifyCurrentClassId(contractAddress, this.executionDataProvider);
|
|
52
|
-
const entryPointArtifact = await this.executionDataProvider.getFunctionArtifact(contractAddress, selector);
|
|
61
|
+
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(contractAddress, selector);
|
|
53
62
|
if (entryPointArtifact.functionType !== FunctionType.PRIVATE) {
|
|
54
63
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as private`);
|
|
55
64
|
}
|
|
@@ -62,7 +71,37 @@ import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
|
62
71
|
const protocolNullifier = await computeProtocolNullifier(await request.toTxRequest().hash());
|
|
63
72
|
const noteCache = new ExecutionNoteCache(protocolNullifier);
|
|
64
73
|
const taggingIndexCache = new ExecutionTaggingIndexCache();
|
|
65
|
-
const privateExecutionOracle = new PrivateExecutionOracle(
|
|
74
|
+
const privateExecutionOracle = new PrivateExecutionOracle({
|
|
75
|
+
argsHash: request.firstCallArgsHash,
|
|
76
|
+
txContext: request.txContext,
|
|
77
|
+
callContext,
|
|
78
|
+
anchorBlockHeader,
|
|
79
|
+
utilityExecutor: async (call, execScopes)=>{
|
|
80
|
+
await this.runUtility(call, [], anchorBlockHeader, execScopes, jobId);
|
|
81
|
+
},
|
|
82
|
+
authWitnesses: request.authWitnesses,
|
|
83
|
+
capsules: request.capsules,
|
|
84
|
+
executionCache: HashedValuesCache.create(request.argsOfCalls),
|
|
85
|
+
noteCache,
|
|
86
|
+
taggingIndexCache,
|
|
87
|
+
contractStore: this.contractStore,
|
|
88
|
+
noteStore: this.noteStore,
|
|
89
|
+
keyStore: this.keyStore,
|
|
90
|
+
addressStore: this.addressStore,
|
|
91
|
+
aztecNode: this.aztecNode,
|
|
92
|
+
senderTaggingStore: this.senderTaggingStore,
|
|
93
|
+
recipientTaggingStore: this.recipientTaggingStore,
|
|
94
|
+
senderAddressBookStore: this.senderAddressBookStore,
|
|
95
|
+
capsuleStore: this.capsuleStore,
|
|
96
|
+
privateEventStore: this.privateEventStore,
|
|
97
|
+
contractSyncService: this.contractSyncService,
|
|
98
|
+
jobId,
|
|
99
|
+
totalPublicCalldataCount: 0,
|
|
100
|
+
sideEffectCounter: startSideEffectCounter,
|
|
101
|
+
scopes,
|
|
102
|
+
senderForTags,
|
|
103
|
+
simulator: this.simulator
|
|
104
|
+
});
|
|
66
105
|
const setupTime = simulatorSetupTimer.ms();
|
|
67
106
|
try {
|
|
68
107
|
// Note: any nested private function calls are made recursively within this
|
|
@@ -71,8 +110,8 @@ import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
|
71
110
|
// within executionResult.nestedExecutionResults).
|
|
72
111
|
const executionResult = await executePrivateFunction(this.simulator, privateExecutionOracle, entryPointArtifact, contractAddress, request.functionSelector);
|
|
73
112
|
const simulatorTeardownTimer = new Timer();
|
|
74
|
-
|
|
75
|
-
const firstNullifierHint =
|
|
113
|
+
noteCache.finish();
|
|
114
|
+
const firstNullifierHint = noteCache.getNonceGenerator();
|
|
76
115
|
const publicCallRequests = collectNested([
|
|
77
116
|
executionResult
|
|
78
117
|
], (r)=>r.publicInputs.publicCallRequests.getActiveItems().map((r)=>r.inner).concat(r.publicInputs.publicTeardownCallRequest.isEmpty() ? [] : [
|
|
@@ -100,16 +139,32 @@ import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
|
100
139
|
* Runs a utility function.
|
|
101
140
|
* @param call - The function call to execute.
|
|
102
141
|
* @param authwits - Authentication witnesses required for the function call.
|
|
142
|
+
* @param anchorBlockHeader - The block header to use as base state for this run.
|
|
103
143
|
* @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
|
|
104
144
|
* accounts if not specified.
|
|
105
145
|
* @returns A return value of the utility function in a form as returned by the simulator (Noir fields)
|
|
106
|
-
*/ async runUtility(call, authwits, scopes) {
|
|
107
|
-
await
|
|
108
|
-
const entryPointArtifact = await this.executionDataProvider.getFunctionArtifact(call.to, call.selector);
|
|
146
|
+
*/ async runUtility(call, authwits, anchorBlockHeader, scopes, jobId) {
|
|
147
|
+
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
109
148
|
if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
|
|
110
149
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
111
150
|
}
|
|
112
|
-
const oracle = new UtilityExecutionOracle(
|
|
151
|
+
const oracle = new UtilityExecutionOracle({
|
|
152
|
+
contractAddress: call.to,
|
|
153
|
+
authWitnesses: authwits,
|
|
154
|
+
capsules: [],
|
|
155
|
+
anchorBlockHeader,
|
|
156
|
+
contractStore: this.contractStore,
|
|
157
|
+
noteStore: this.noteStore,
|
|
158
|
+
keyStore: this.keyStore,
|
|
159
|
+
addressStore: this.addressStore,
|
|
160
|
+
aztecNode: this.aztecNode,
|
|
161
|
+
recipientTaggingStore: this.recipientTaggingStore,
|
|
162
|
+
senderAddressBookStore: this.senderAddressBookStore,
|
|
163
|
+
capsuleStore: this.capsuleStore,
|
|
164
|
+
privateEventStore: this.privateEventStore,
|
|
165
|
+
jobId,
|
|
166
|
+
scopes
|
|
167
|
+
});
|
|
113
168
|
try {
|
|
114
169
|
this.log.verbose(`Executing utility function ${entryPointArtifact.name}`, {
|
|
115
170
|
contract: call.to,
|
|
@@ -125,15 +180,29 @@ import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
|
125
180
|
cause: err
|
|
126
181
|
});
|
|
127
182
|
});
|
|
128
|
-
this.log.verbose(`Utility
|
|
183
|
+
this.log.verbose(`Utility execution for ${call.to}.${call.selector} completed`);
|
|
129
184
|
return witnessMapToFields(acirExecutionResult.returnWitness);
|
|
130
185
|
} catch (err) {
|
|
131
186
|
throw createSimulationError(err instanceof Error ? err : new Error('Unknown error during private execution'));
|
|
132
187
|
}
|
|
133
188
|
}
|
|
134
189
|
// docs:end:execute_utility_function
|
|
135
|
-
|
|
136
|
-
|
|
190
|
+
/**
|
|
191
|
+
* Returns the execution statistics collected during the simulator run.
|
|
192
|
+
* @returns The execution statistics.
|
|
193
|
+
*/ getStats() {
|
|
194
|
+
const nodeRPCCalls = typeof this.aztecNode.getStats === 'function' ? this.aztecNode.getStats() : {
|
|
195
|
+
perMethod: {},
|
|
196
|
+
roundTrips: {
|
|
197
|
+
roundTrips: 0,
|
|
198
|
+
totalBlockingTime: 0,
|
|
199
|
+
roundTripDurations: [],
|
|
200
|
+
roundTripMethods: []
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
return {
|
|
204
|
+
nodeRPCCalls
|
|
205
|
+
};
|
|
137
206
|
}
|
|
138
207
|
}
|
|
139
208
|
class OrderedSideEffect {
|
|
@@ -151,18 +220,24 @@ class OrderedSideEffect {
|
|
|
151
220
|
* (allowing state overrides) and is much faster, while still generating a valid
|
|
152
221
|
* output that can be sent to the node for public simulation
|
|
153
222
|
* @param privateExecutionResult - The result of the private execution.
|
|
154
|
-
* @param
|
|
155
|
-
*
|
|
156
|
-
* @param
|
|
223
|
+
* @param debugFunctionNameGetter - A provider for contract data in order to get function names and debug info.
|
|
224
|
+
* @param node - AztecNode for verifying settled read requests against the note hash and nullifier trees.
|
|
225
|
+
* @param minRevertibleSideEffectCounterOverride - Optional override for the min revertible side effect counter.
|
|
226
|
+
* Used by TXE to simulate account contract behavior (setting the counter before app execution).
|
|
157
227
|
* @returns The simulated proving result.
|
|
158
|
-
*/ export async function generateSimulatedProvingResult(privateExecutionResult,
|
|
159
|
-
const siloedNoteHashes = [];
|
|
160
|
-
const nullifiers = [];
|
|
228
|
+
*/ export async function generateSimulatedProvingResult(privateExecutionResult, debugFunctionNameGetter, node, minRevertibleSideEffectCounterOverride) {
|
|
161
229
|
const taggedPrivateLogs = [];
|
|
162
230
|
const l2ToL1Messages = [];
|
|
163
231
|
const contractClassLogsHashes = [];
|
|
164
232
|
const publicCallRequests = [];
|
|
165
233
|
const executionSteps = [];
|
|
234
|
+
// Unsiloed scoped arrays — used for squashing, read request verification,
|
|
235
|
+
// and siloed at the end only for the surviving items
|
|
236
|
+
const scopedNoteHashes = [];
|
|
237
|
+
const scopedNullifiers = [];
|
|
238
|
+
// Read requests for verification
|
|
239
|
+
const noteHashReadRequests = [];
|
|
240
|
+
const nullifierReadRequests = [];
|
|
166
241
|
let publicTeardownCallRequest;
|
|
167
242
|
const executions = [
|
|
168
243
|
privateExecutionResult.entrypoint
|
|
@@ -171,18 +246,14 @@ class OrderedSideEffect {
|
|
|
171
246
|
const execution = executions.shift();
|
|
172
247
|
executions.unshift(...execution.nestedExecutionResults);
|
|
173
248
|
const { contractAddress } = execution.publicInputs.callContext;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
metadata.log.fields[0] = await
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}));
|
|
183
|
-
siloedNoteHashes.push(...noteHashesFromExecution);
|
|
184
|
-
taggedPrivateLogs.push(...privateLogsFromExecution);
|
|
185
|
-
nullifiers.push(...nullifiersFromExecution);
|
|
249
|
+
scopedNoteHashes.push(...execution.publicInputs.noteHashes.getActiveItems().filter((nh)=>!nh.isEmpty()).map((nh)=>nh.scope(contractAddress)));
|
|
250
|
+
scopedNullifiers.push(...execution.publicInputs.nullifiers.getActiveItems().map((n)=>n.scope(contractAddress)));
|
|
251
|
+
taggedPrivateLogs.push(...await Promise.all(execution.publicInputs.privateLogs.getActiveItems().map(async (metadata)=>{
|
|
252
|
+
metadata.log.fields[0] = await computeSiloedPrivateLogFirstField(contractAddress, metadata.log.fields[0]);
|
|
253
|
+
return new OrderedSideEffect(metadata, metadata.counter);
|
|
254
|
+
})));
|
|
255
|
+
noteHashReadRequests.push(...execution.publicInputs.noteHashReadRequests.getActiveItems());
|
|
256
|
+
nullifierReadRequests.push(...execution.publicInputs.nullifierReadRequests.getActiveItems());
|
|
186
257
|
l2ToL1Messages.push(...execution.publicInputs.l2ToL1Msgs.getActiveItems().map((message)=>new OrderedSideEffect(message.message.scope(contractAddress), message.counter)));
|
|
187
258
|
contractClassLogsHashes.push(...execution.publicInputs.contractClassLogsHashes.getActiveItems().map((contractClassLogHash)=>new OrderedSideEffect(contractClassLogHash.logHash.scope(contractAddress), contractClassLogHash.counter)));
|
|
188
259
|
publicCallRequests.push(...execution.publicInputs.publicCallRequests.getActiveItems().map((callRequest)=>new OrderedSideEffect(callRequest.inner, callRequest.counter)));
|
|
@@ -191,7 +262,7 @@ class OrderedSideEffect {
|
|
|
191
262
|
}
|
|
192
263
|
publicTeardownCallRequest = execution.publicInputs.publicTeardownCallRequest.isEmpty() ? publicTeardownCallRequest : execution.publicInputs.publicTeardownCallRequest;
|
|
193
264
|
executionSteps.push({
|
|
194
|
-
functionName: await
|
|
265
|
+
functionName: await debugFunctionNameGetter(execution.publicInputs.callContext.contractAddress, execution.publicInputs.callContext.functionSelector),
|
|
195
266
|
timings: execution.profileResult?.timings ?? {
|
|
196
267
|
witgen: 0,
|
|
197
268
|
oracles: {}
|
|
@@ -201,6 +272,14 @@ class OrderedSideEffect {
|
|
|
201
272
|
witness: execution.partialWitness
|
|
202
273
|
});
|
|
203
274
|
}
|
|
275
|
+
const noteHashNullifierCounterMap = collectNoteHashNullifierCounterMap(privateExecutionResult);
|
|
276
|
+
const minRevertibleSideEffectCounter = minRevertibleSideEffectCounterOverride ?? getFinalMinRevertibleSideEffectCounter(privateExecutionResult);
|
|
277
|
+
const scopedNoteHashesCLA = new ClaimedLengthArray(padArrayEnd(scopedNoteHashes, ScopedNoteHash.empty(), MAX_NOTE_HASHES_PER_TX), scopedNoteHashes.length);
|
|
278
|
+
const scopedNullifiersCLA = new ClaimedLengthArray(padArrayEnd(scopedNullifiers, ScopedNullifier.empty(), MAX_NULLIFIERS_PER_TX), scopedNullifiers.length);
|
|
279
|
+
const { filteredNoteHashes, filteredNullifiers, filteredPrivateLogs } = squashTransientSideEffects(taggedPrivateLogs, scopedNoteHashesCLA, scopedNullifiersCLA, noteHashNullifierCounterMap, minRevertibleSideEffectCounter);
|
|
280
|
+
await verifyReadRequests(node, await privateExecutionResult.entrypoint.publicInputs.anchorBlockHeader.hash(), noteHashReadRequests, nullifierReadRequests, scopedNoteHashesCLA, scopedNullifiersCLA);
|
|
281
|
+
const siloedNoteHashes = await Promise.all(filteredNoteHashes.sort((a, b)=>a.counter - b.counter).map(async (nh)=>new OrderedSideEffect(await siloNoteHash(nh.contractAddress, nh.value), nh.counter)));
|
|
282
|
+
const siloedNullifiers = await Promise.all(filteredNullifiers.sort((a, b)=>a.counter - b.counter).map(async (n)=>new OrderedSideEffect(await siloNullifier(n.contractAddress, n.value), n.counter)));
|
|
204
283
|
const constantData = new TxConstantData(privateExecutionResult.entrypoint.publicInputs.anchorBlockHeader, privateExecutionResult.entrypoint.publicInputs.txContext, getVKTreeRoot(), protocolContractsHash);
|
|
205
284
|
const hasPublicCalls = privateExecutionResult.publicFunctionCalldata.length !== 0;
|
|
206
285
|
let inputsForRollup;
|
|
@@ -209,54 +288,117 @@ class OrderedSideEffect {
|
|
|
209
288
|
const sortByCounter = (a, b)=>a.counter - b.counter;
|
|
210
289
|
const getEffect = (orderedSideEffect)=>orderedSideEffect.sideEffect;
|
|
211
290
|
const isPrivateOnlyTx = privateExecutionResult.publicFunctionCalldata.length === 0;
|
|
212
|
-
const
|
|
213
|
-
const
|
|
214
|
-
if (nonRevertibleNullifiers.length
|
|
291
|
+
const [nonRevertibleNullifiers, revertibleNullifiers] = splitOrderedSideEffects(siloedNullifiers, minRevertibleSideEffectCounter);
|
|
292
|
+
const nonceGenerator = privateExecutionResult.firstNullifier;
|
|
293
|
+
if (nonRevertibleNullifiers.length === 0) {
|
|
294
|
+
nonRevertibleNullifiers.push(nonceGenerator);
|
|
295
|
+
} else if (!nonRevertibleNullifiers[0].equals(nonceGenerator)) {
|
|
215
296
|
throw new Error('The first non revertible nullifier should be equal to the nonce generator. This is a bug!');
|
|
216
|
-
} else {
|
|
217
|
-
nonRevertibleNullifiers.unshift(nonceGenerator);
|
|
218
297
|
}
|
|
219
298
|
if (isPrivateOnlyTx) {
|
|
220
299
|
// We must make the note hashes unique by using the
|
|
221
300
|
// nonce generator and their index in the tx.
|
|
222
|
-
const uniqueNoteHashes = await Promise.all(siloedNoteHashes.
|
|
301
|
+
const uniqueNoteHashes = await Promise.all(siloedNoteHashes.map(async (orderedSideEffect, i)=>{
|
|
223
302
|
const siloedNoteHash = orderedSideEffect.sideEffect;
|
|
224
303
|
const nonce = await computeNoteHashNonce(nonceGenerator, i);
|
|
225
304
|
const uniqueNoteHash = await computeUniqueNoteHash(nonce, siloedNoteHash);
|
|
226
305
|
return uniqueNoteHash;
|
|
227
306
|
}));
|
|
228
|
-
const accumulatedDataForRollup = new PrivateToRollupAccumulatedData(padArrayEnd(uniqueNoteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX), padArrayEnd(nonRevertibleNullifiers.concat(revertibleNullifiers), Fr.ZERO, MAX_NULLIFIERS_PER_TX), padArrayEnd(l2ToL1Messages.sort(sortByCounter).map(getEffect), ScopedL2ToL1Message.empty(), MAX_L2_TO_L1_MSGS_PER_TX), padArrayEnd(
|
|
229
|
-
gasUsed = meterGasUsed(accumulatedDataForRollup);
|
|
307
|
+
const accumulatedDataForRollup = new PrivateToRollupAccumulatedData(padArrayEnd(uniqueNoteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX), padArrayEnd(nonRevertibleNullifiers.concat(revertibleNullifiers), Fr.ZERO, MAX_NULLIFIERS_PER_TX), padArrayEnd(l2ToL1Messages.sort(sortByCounter).map(getEffect), ScopedL2ToL1Message.empty(), MAX_L2_TO_L1_MSGS_PER_TX), padArrayEnd(filteredPrivateLogs.sort(sortByCounter).map(getEffect), PrivateLog.empty(), MAX_PRIVATE_LOGS_PER_TX), padArrayEnd(contractClassLogsHashes.sort(sortByCounter).map(getEffect), ScopedLogHash.empty(), MAX_CONTRACT_CLASS_LOGS_PER_TX));
|
|
308
|
+
gasUsed = meterGasUsed(accumulatedDataForRollup, isPrivateOnlyTx);
|
|
230
309
|
inputsForRollup = new PartialPrivateTailPublicInputsForRollup(accumulatedDataForRollup);
|
|
231
310
|
} else {
|
|
232
|
-
const [nonRevertibleNoteHashes, revertibleNoteHashes] = splitOrderedSideEffects(siloedNoteHashes
|
|
311
|
+
const [nonRevertibleNoteHashes, revertibleNoteHashes] = splitOrderedSideEffects(siloedNoteHashes, minRevertibleSideEffectCounter);
|
|
312
|
+
const nonRevertibleUniqueNoteHashes = await Promise.all(nonRevertibleNoteHashes.map(async (noteHash, i)=>{
|
|
313
|
+
const nonce = await computeNoteHashNonce(nonceGenerator, i);
|
|
314
|
+
return await computeUniqueNoteHash(nonce, noteHash);
|
|
315
|
+
}));
|
|
233
316
|
const [nonRevertibleL2ToL1Messages, revertibleL2ToL1Messages] = splitOrderedSideEffects(l2ToL1Messages.sort(sortByCounter), minRevertibleSideEffectCounter);
|
|
234
|
-
const [nonRevertibleTaggedPrivateLogs, revertibleTaggedPrivateLogs] = splitOrderedSideEffects(
|
|
317
|
+
const [nonRevertibleTaggedPrivateLogs, revertibleTaggedPrivateLogs] = splitOrderedSideEffects(filteredPrivateLogs, minRevertibleSideEffectCounter);
|
|
235
318
|
const [nonRevertibleContractClassLogHashes, revertibleContractClassLogHashes] = splitOrderedSideEffects(contractClassLogsHashes.sort(sortByCounter), minRevertibleSideEffectCounter);
|
|
236
319
|
const [nonRevertiblePublicCallRequests, revertiblePublicCallRequests] = splitOrderedSideEffects(publicCallRequests.sort(sortByCounter), minRevertibleSideEffectCounter);
|
|
237
|
-
const nonRevertibleData = new PrivateToPublicAccumulatedData(padArrayEnd(
|
|
320
|
+
const nonRevertibleData = new PrivateToPublicAccumulatedData(padArrayEnd(nonRevertibleUniqueNoteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX), padArrayEnd(nonRevertibleNullifiers, Fr.ZERO, MAX_NULLIFIERS_PER_TX), padArrayEnd(nonRevertibleL2ToL1Messages, ScopedL2ToL1Message.empty(), MAX_L2_TO_L1_MSGS_PER_TX), padArrayEnd(nonRevertibleTaggedPrivateLogs, PrivateLog.empty(), MAX_PRIVATE_LOGS_PER_TX), padArrayEnd(nonRevertibleContractClassLogHashes, ScopedLogHash.empty(), MAX_CONTRACT_CLASS_LOGS_PER_TX), padArrayEnd(nonRevertiblePublicCallRequests, PublicCallRequest.empty(), MAX_ENQUEUED_CALLS_PER_TX));
|
|
238
321
|
const revertibleData = new PrivateToPublicAccumulatedData(padArrayEnd(revertibleNoteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX), padArrayEnd(revertibleNullifiers, Fr.ZERO, MAX_NULLIFIERS_PER_TX), padArrayEnd(revertibleL2ToL1Messages, ScopedL2ToL1Message.empty(), MAX_L2_TO_L1_MSGS_PER_TX), padArrayEnd(revertibleTaggedPrivateLogs, PrivateLog.empty(), MAX_PRIVATE_LOGS_PER_TX), padArrayEnd(revertibleContractClassLogHashes, ScopedLogHash.empty(), MAX_CONTRACT_CLASS_LOGS_PER_TX), padArrayEnd(revertiblePublicCallRequests, PublicCallRequest.empty(), MAX_ENQUEUED_CALLS_PER_TX));
|
|
239
|
-
gasUsed = meterGasUsed(revertibleData).add(meterGasUsed(nonRevertibleData));
|
|
322
|
+
gasUsed = meterGasUsed(revertibleData, isPrivateOnlyTx).add(meterGasUsed(nonRevertibleData, isPrivateOnlyTx));
|
|
240
323
|
if (publicTeardownCallRequest) {
|
|
241
|
-
gasUsed.add(privateExecutionResult.entrypoint.publicInputs.txContext.gasSettings.teardownGasLimits);
|
|
324
|
+
gasUsed = gasUsed.add(privateExecutionResult.entrypoint.publicInputs.txContext.gasSettings.teardownGasLimits);
|
|
242
325
|
}
|
|
243
326
|
inputsForPublic = new PartialPrivateTailPublicInputsForPublic(nonRevertibleData, revertibleData, publicTeardownCallRequest ?? PublicCallRequest.empty());
|
|
244
327
|
}
|
|
245
328
|
const publicInputs = new PrivateKernelTailCircuitPublicInputs(constantData, /*gasUsed=*/ gasUsed.add(Gas.from({
|
|
246
329
|
l2Gas: FIXED_L2_GAS,
|
|
247
330
|
daGas: FIXED_DA_GAS
|
|
248
|
-
})), /*feePayer=*/ AztecAddress.zero(), /*
|
|
331
|
+
})), /*feePayer=*/ AztecAddress.zero(), /*expirationTimestamp=*/ 0n, hasPublicCalls ? inputsForPublic : undefined, !hasPublicCalls ? inputsForRollup : undefined);
|
|
249
332
|
return {
|
|
250
333
|
publicInputs,
|
|
251
334
|
chonkProof: ChonkProof.empty(),
|
|
252
335
|
executionSteps
|
|
253
336
|
};
|
|
254
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Squashes transient note hashes and nullifiers, mimicking the behavior
|
|
340
|
+
* of the reset kernels. Returns the filtered (surviving) scoped items and private logs.
|
|
341
|
+
*/ function squashTransientSideEffects(taggedPrivateLogs, scopedNoteHashesCLA, scopedNullifiersCLA, noteHashNullifierCounterMap, minRevertibleSideEffectCounter) {
|
|
342
|
+
const { numTransientData, hints: transientDataHints } = buildTransientDataHints(scopedNoteHashesCLA, scopedNullifiersCLA, /*futureNoteHashReads=*/ [], /*futureNullifierReads=*/ [], noteHashNullifierCounterMap, minRevertibleSideEffectCounter);
|
|
343
|
+
const squashedNoteHashCounters = new Set();
|
|
344
|
+
const squashedNullifierCounters = new Set();
|
|
345
|
+
for(let i = 0; i < numTransientData; i++){
|
|
346
|
+
const hint = transientDataHints[i];
|
|
347
|
+
squashedNoteHashCounters.add(scopedNoteHashesCLA.array[hint.noteHashIndex].counter);
|
|
348
|
+
squashedNullifierCounters.add(scopedNullifiersCLA.array[hint.nullifierIndex].counter);
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
filteredNoteHashes: scopedNoteHashesCLA.getActiveItems().filter((nh)=>!squashedNoteHashCounters.has(nh.counter)),
|
|
352
|
+
filteredNullifiers: scopedNullifiersCLA.getActiveItems().filter((n)=>!squashedNullifierCounters.has(n.counter)),
|
|
353
|
+
filteredPrivateLogs: taggedPrivateLogs.filter((item)=>!squashedNoteHashCounters.has(item.sideEffect.noteHashCounter)).map((item)=>new OrderedSideEffect(item.sideEffect.log, item.counter))
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Verifies settled read requests by checking membership in the note hash and nullifier trees
|
|
358
|
+
* at the tx's anchor block, mimicking the behavior of the kernels
|
|
359
|
+
*/ async function verifyReadRequests(node, anchorBlockHash, noteHashReadRequests, nullifierReadRequests, scopedNoteHashesCLA, scopedNullifiersCLA) {
|
|
360
|
+
const noteHashReadRequestsCLA = new ClaimedLengthArray(padArrayEnd(noteHashReadRequests, ScopedReadRequest.empty(), MAX_NOTE_HASH_READ_REQUESTS_PER_TX), noteHashReadRequests.length);
|
|
361
|
+
const nullifierReadRequestsCLA = new ClaimedLengthArray(padArrayEnd(nullifierReadRequests, ScopedReadRequest.empty(), MAX_NULLIFIER_READ_REQUESTS_PER_TX), nullifierReadRequests.length);
|
|
362
|
+
const noteHashResetActions = getNoteHashReadRequestResetActions(noteHashReadRequestsCLA, scopedNoteHashesCLA, /*futureNoteHashes=*/ []);
|
|
363
|
+
const nullifierResetActions = getNullifierReadRequestResetActions(nullifierReadRequestsCLA, scopedNullifiersCLA, /*futureNullifiers=*/ []);
|
|
364
|
+
const settledNoteHashReads = [];
|
|
365
|
+
for(let i = 0; i < noteHashResetActions.actions.length; i++){
|
|
366
|
+
if (noteHashResetActions.actions[i] === ReadRequestActionEnum.READ_AS_SETTLED) {
|
|
367
|
+
settledNoteHashReads.push({
|
|
368
|
+
index: i,
|
|
369
|
+
value: noteHashReadRequests[i].value
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
const settledNullifierReads = [];
|
|
374
|
+
for(let i = 0; i < nullifierResetActions.actions.length; i++){
|
|
375
|
+
if (nullifierResetActions.actions[i] === ReadRequestActionEnum.READ_AS_SETTLED) {
|
|
376
|
+
settledNullifierReads.push({
|
|
377
|
+
index: i,
|
|
378
|
+
value: nullifierReadRequests[i].value
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const [noteHashWitnesses, nullifierWitnesses] = await Promise.all([
|
|
383
|
+
Promise.all(settledNoteHashReads.map(({ value })=>node.getNoteHashMembershipWitness(anchorBlockHash, value))),
|
|
384
|
+
Promise.all(settledNullifierReads.map(({ value })=>node.getNullifierMembershipWitness(anchorBlockHash, value)))
|
|
385
|
+
]);
|
|
386
|
+
for(let i = 0; i < settledNoteHashReads.length; i++){
|
|
387
|
+
if (!noteHashWitnesses[i]) {
|
|
388
|
+
throw new Error(`Note hash read request at index ${settledNoteHashReads[i].index} is reading an unknown note hash: ${settledNoteHashReads[i].value}`);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
for(let i = 0; i < settledNullifierReads.length; i++){
|
|
392
|
+
if (!nullifierWitnesses[i]) {
|
|
393
|
+
throw new Error(`Nullifier read request at index ${settledNullifierReads[i].index} is reading an unknown nullifier: ${settledNullifierReads[i].value}`);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
255
397
|
function splitOrderedSideEffects(effects, minRevertibleSideEffectCounter) {
|
|
256
398
|
const revertibleSideEffects = [];
|
|
257
399
|
const nonRevertibleSideEffects = [];
|
|
258
400
|
effects.forEach((effect)=>{
|
|
259
|
-
if (effect.counter < minRevertibleSideEffectCounter) {
|
|
401
|
+
if (minRevertibleSideEffectCounter === 0 || effect.counter < minRevertibleSideEffectCounter) {
|
|
260
402
|
nonRevertibleSideEffects.push(effect.sideEffect);
|
|
261
403
|
} else {
|
|
262
404
|
revertibleSideEffects.push(effect.sideEffect);
|
|
@@ -267,18 +409,21 @@ function splitOrderedSideEffects(effects, minRevertibleSideEffectCounter) {
|
|
|
267
409
|
revertibleSideEffects
|
|
268
410
|
];
|
|
269
411
|
}
|
|
270
|
-
function meterGasUsed(data) {
|
|
412
|
+
function meterGasUsed(data, isPrivateOnlyTx) {
|
|
271
413
|
let meteredDAFields = 0;
|
|
272
414
|
let meteredL2Gas = 0;
|
|
273
415
|
const numNoteHashes = arrayNonEmptyLength(data.noteHashes, (hash)=>hash.isEmpty());
|
|
274
416
|
meteredDAFields += numNoteHashes;
|
|
275
|
-
|
|
417
|
+
const noteHashBaseGas = isPrivateOnlyTx ? L2_GAS_PER_NOTE_HASH : AVM_EMITNOTEHASH_BASE_L2_GAS;
|
|
418
|
+
meteredL2Gas += numNoteHashes * noteHashBaseGas;
|
|
276
419
|
const numNullifiers = arrayNonEmptyLength(data.nullifiers, (nullifier)=>nullifier.isEmpty());
|
|
277
420
|
meteredDAFields += numNullifiers;
|
|
278
|
-
|
|
421
|
+
const nullifierBaseGas = isPrivateOnlyTx ? L2_GAS_PER_NULLIFIER : AVM_EMITNULLIFIER_BASE_L2_GAS;
|
|
422
|
+
meteredL2Gas += numNullifiers * nullifierBaseGas;
|
|
279
423
|
const numL2toL1Messages = arrayNonEmptyLength(data.l2ToL1Msgs, (msg)=>msg.isEmpty());
|
|
280
424
|
meteredDAFields += numL2toL1Messages;
|
|
281
|
-
|
|
425
|
+
const l2ToL1MessageBaseGas = isPrivateOnlyTx ? L2_GAS_PER_L2_TO_L1_MSG : AVM_SENDL2TOL1MSG_BASE_L2_GAS;
|
|
426
|
+
meteredL2Gas += numL2toL1Messages * l2ToL1MessageBaseGas;
|
|
282
427
|
const numPrivatelogs = arrayNonEmptyLength(data.privateLogs, (log)=>log.isEmpty());
|
|
283
428
|
// Every private log emits its length as an additional field
|
|
284
429
|
meteredDAFields += data.privateLogs.reduce((acc, log)=>!log.isEmpty() ? acc + log.emittedLength + 1 : acc, 0);
|
|
@@ -287,7 +432,7 @@ function meterGasUsed(data) {
|
|
|
287
432
|
// Every contract class log emits its length and contract address as additional fields
|
|
288
433
|
meteredDAFields += data.contractClassLogsHashes.reduce((acc, log)=>!log.isEmpty() ? acc + log.logHash.length + 2 : acc, 0);
|
|
289
434
|
meteredL2Gas += numContractClassLogs * L2_GAS_PER_CONTRACT_CLASS_LOG;
|
|
290
|
-
const meteredDAGas = meteredDAFields *
|
|
435
|
+
const meteredDAGas = meteredDAFields * DA_GAS_PER_FIELD;
|
|
291
436
|
if (data.publicCallRequests) {
|
|
292
437
|
const dataForPublic = data;
|
|
293
438
|
const numPublicCallRequests = arrayNonEmptyLength(dataForPublic.publicCallRequests, (req)=>req.isEmpty());
|