@aztec/pxe 0.0.1-commit.b655e406 → 0.0.1-commit.c7c42ec
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bin/check_oracle_version.d.ts +1 -1
- package/dest/bin/check_oracle_version.js +105 -15
- package/dest/block_synchronizer/block_synchronizer.d.ts +37 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
- package/dest/{synchronizer/synchronizer.js → block_synchronizer/block_synchronizer.js} +20 -22
- 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 +4 -12
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +7 -13
- package/dest/config/package_info.d.ts +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +43 -14
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +55 -29
- package/dest/contract_function_simulator/execution_note_cache.d.ts +9 -7
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +21 -13
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +2 -2
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +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 +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +3 -3
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +6 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +12 -3
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/utility_context.js +1 -1
- package/dest/contract_function_simulator/oracle/index.d.ts +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +19 -13
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +2 -4
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +10 -4
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +10 -5
- package/dest/contract_function_simulator/oracle/oracle.d.ts +5 -4
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +34 -17
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +9 -10
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +12 -12
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +24 -18
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +41 -18
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +58 -17
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +147 -40
- package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
- package/dest/contract_function_simulator/pick_notes.js +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
- package/dest/contract_function_simulator/proxied_node.d.ts +1 -1
- package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.d.ts +31 -0
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
- package/dest/debug/pxe_debug_utils.js +37 -0
- package/dest/entrypoints/client/bundle/index.d.ts +1 -2
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +0 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.js +4 -4
- package/dest/entrypoints/client/lazy/index.d.ts +1 -2
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +0 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.js +4 -4
- package/dest/entrypoints/pxe_creation_options.d.ts +3 -1
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +2 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -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 +5 -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 +47 -0
- package/dest/events/index.d.ts +2 -0
- package/dest/events/index.d.ts.map +1 -0
- package/dest/events/index.js +1 -0
- package/dest/events/private_event_filter_validator.d.ts +9 -0
- package/dest/events/private_event_filter_validator.d.ts.map +1 -0
- package/dest/events/private_event_filter_validator.js +39 -0
- package/dest/logs/log_service.d.ts +26 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +120 -0
- package/dest/notes/index.d.ts +2 -0
- package/dest/notes/index.d.ts.map +1 -0
- package/dest/notes/index.js +1 -0
- package/dest/notes/note_service.d.ts +48 -0
- package/dest/notes/note_service.d.ts.map +1 -0
- package/dest/notes/note_service.js +152 -0
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.js +2 -2
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +3 -3
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -1
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.js +7 -7
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +1 -1
- package/dest/private_kernel/hints/index.d.ts +1 -1
- package/dest/private_kernel/index.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +11 -10
- package/dest/private_kernel/private_kernel_oracle.d.ts +3 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +8 -7
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +7 -7
- package/dest/public_storage/public_storage_service.d.ts +24 -0
- package/dest/public_storage/public_storage_service.d.ts.map +1 -0
- package/dest/public_storage/public_storage_service.js +26 -0
- package/dest/pxe.d.ts +47 -48
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +142 -171
- package/dest/storage/address_store/address_store.d.ts +11 -0
- package/dest/storage/address_store/address_store.d.ts.map +1 -0
- package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +1 -1
- package/dest/storage/address_store/index.d.ts +2 -0
- package/dest/storage/address_store/index.d.ts.map +1 -0
- package/dest/storage/address_store/index.js +1 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
- package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +2 -9
- package/dest/storage/anchor_block_store/index.d.ts +2 -0
- package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/index.js +1 -0
- package/dest/storage/capsule_store/capsule_store.d.ts +57 -0
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/{capsule_data_provider/capsule_data_provider.js → capsule_store/capsule_store.js} +34 -6
- package/dest/storage/capsule_store/index.d.ts +2 -0
- package/dest/storage/capsule_store/index.d.ts.map +1 -0
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +7 -15
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +34 -15
- 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/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_data_provider/note_data_provider.d.ts → note_store/note_store.d.ts} +14 -13
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/{note_data_provider/note_data_provider.js → note_store/note_store.js} +33 -19
- package/dest/storage/private_event_store/private_event_store.d.ts +51 -0
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
- package/dest/storage/{private_event_data_provider/private_event_data_provider.js → private_event_store/private_event_store.js} +39 -28
- package/dest/storage/tagging_store/index.d.ts +4 -0
- package/dest/storage/tagging_store/index.d.ts.map +1 -0
- package/dest/storage/tagging_store/index.js +3 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +21 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/recipient_tagging_store.js +42 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_address_book_store.js +30 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +67 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_tagging_store.js +196 -0
- package/dest/tagging/index.d.ts +15 -6
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +23 -5
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +29 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +20 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +32 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +18 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +55 -0
- package/dest/tree_membership/tree_membership_service.d.ts +52 -0
- package/dest/tree_membership/tree_membership_service.d.ts.map +1 -0
- package/dest/tree_membership/tree_membership_service.js +84 -0
- package/package.json +20 -19
- package/src/bin/check_oracle_version.ts +130 -20
- package/src/{synchronizer/synchronizer.ts → block_synchronizer/block_synchronizer.ts} +19 -22
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +10 -25
- package/src/contract_function_simulator/contract_function_simulator.ts +95 -28
- package/src/contract_function_simulator/execution_note_cache.ts +22 -11
- 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/noir-structs/event_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +2 -2
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +14 -2
- package/src/contract_function_simulator/noir-structs/utility_context.ts +1 -1
- package/src/contract_function_simulator/oracle/interfaces.ts +26 -11
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +21 -5
- package/src/contract_function_simulator/oracle/oracle.ts +43 -13
- package/src/contract_function_simulator/oracle/private_execution.ts +17 -15
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +100 -23
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +223 -47
- package/src/contract_function_simulator/pick_notes.ts +1 -1
- package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
- package/src/debug/pxe_debug_utils.ts +48 -0
- package/src/entrypoints/client/bundle/index.ts +0 -1
- package/src/entrypoints/client/bundle/utils.ts +4 -4
- package/src/entrypoints/client/lazy/index.ts +0 -1
- package/src/entrypoints/client/lazy/utils.ts +4 -4
- package/src/entrypoints/pxe_creation_options.ts +2 -0
- package/src/entrypoints/server/index.ts +1 -1
- package/src/entrypoints/server/utils.ts +5 -19
- package/src/error_enriching.ts +7 -15
- package/src/events/event_service.ts +77 -0
- package/src/events/index.ts +1 -0
- package/src/events/private_event_filter_validator.ts +48 -0
- package/src/logs/log_service.ts +202 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +200 -0
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +5 -9
- package/src/private_kernel/private_kernel_execution_prover.ts +12 -16
- package/src/private_kernel/private_kernel_oracle.ts +2 -1
- package/src/private_kernel/private_kernel_oracle_impl.ts +10 -9
- package/src/public_storage/public_storage_service.ts +33 -0
- package/src/pxe.ts +167 -223
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -1
- package/src/storage/address_store/index.ts +1 -0
- package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +2 -11
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/{capsule_data_provider/capsule_data_provider.ts → capsule_store/capsule_store.ts} +34 -2
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +45 -20
- 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/note_store/index.ts +2 -0
- package/src/storage/{note_data_provider/note_data_provider.ts → note_store/note_store.ts} +41 -22
- package/src/storage/{private_event_data_provider/private_event_data_provider.ts → private_event_store/private_event_store.ts} +61 -47
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +53 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +42 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +244 -0
- package/src/tagging/index.ts +27 -5
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +129 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +43 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +96 -0
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +44 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +72 -0
- package/src/tree_membership/tree_membership_service.ts +112 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -274
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
- package/dest/contract_function_simulator/execution_data_provider.js +0 -14
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -122
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -701
- package/dest/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/index.d.ts +0 -2
- package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.d.ts +0 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_dao.d.ts +0 -100
- package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_dao.js +0 -102
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -43
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
- package/dest/storage/sync_data_provider/index.d.ts +0 -2
- package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
- package/dest/storage/sync_data_provider/index.js +0 -1
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -10
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
- package/dest/storage/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/tagging/constants.d.ts +0 -2
- package/dest/tagging/constants.d.ts.map +0 -1
- package/dest/tagging/constants.js +0 -2
- package/dest/tagging/siloed_tag.d.ts +0 -14
- package/dest/tagging/siloed_tag.d.ts.map +0 -1
- package/dest/tagging/siloed_tag.js +0 -20
- package/dest/tagging/tag.d.ts +0 -12
- package/dest/tagging/tag.d.ts.map +0 -1
- package/dest/tagging/tag.js +0 -17
- package/dest/tagging/utils.d.ts +0 -18
- package/dest/tagging/utils.d.ts.map +0 -1
- package/dest/tagging/utils.js +0 -24
- package/src/contract_function_simulator/execution_data_provider.ts +0 -343
- package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1019
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/note_data_provider/note_dao.ts +0 -154
- 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/tagging/constants.ts +0 -2
- package/src/tagging/siloed_tag.ts +0 -22
- package/src/tagging/tag.ts +0 -16
- package/src/tagging/utils.ts +0 -31
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
|
|
2
|
+
import { MAX_RPC_LEN } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
import { Note, NoteDao } from '@aztec/stdlib/note';
|
|
4
|
+
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
5
|
+
export class NoteService {
|
|
6
|
+
noteStore;
|
|
7
|
+
aztecNode;
|
|
8
|
+
anchorBlockStore;
|
|
9
|
+
constructor(noteStore, aztecNode, anchorBlockStore){
|
|
10
|
+
this.noteStore = noteStore;
|
|
11
|
+
this.aztecNode = aztecNode;
|
|
12
|
+
this.anchorBlockStore = anchorBlockStore;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves a set of notes stored in the database for a given contract address and storage slot.
|
|
16
|
+
* The query result is paginated using 'limit' and 'offset' values.
|
|
17
|
+
* Returns an object containing an array of note data.
|
|
18
|
+
*
|
|
19
|
+
* @param owner - The owner of the notes. If undefined, returns notes for all known owners.
|
|
20
|
+
* @param status - The status of notes to fetch.
|
|
21
|
+
* @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
22
|
+
*/ async getNotes(contractAddress, owner, storageSlot, status, scopes) {
|
|
23
|
+
const noteDaos = await this.noteStore.getNotes({
|
|
24
|
+
contractAddress,
|
|
25
|
+
owner,
|
|
26
|
+
storageSlot,
|
|
27
|
+
status,
|
|
28
|
+
scopes
|
|
29
|
+
});
|
|
30
|
+
return noteDaos.map(({ contractAddress, owner, storageSlot, randomness, noteNonce, note, noteHash, siloedNullifier, index })=>({
|
|
31
|
+
contractAddress,
|
|
32
|
+
owner,
|
|
33
|
+
storageSlot,
|
|
34
|
+
randomness,
|
|
35
|
+
noteNonce,
|
|
36
|
+
note,
|
|
37
|
+
noteHash,
|
|
38
|
+
siloedNullifier,
|
|
39
|
+
// PXE can use this index to get full MembershipWitness
|
|
40
|
+
index
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Looks for nullifiers of active contract notes and marks them as nullified if a nullifier is found.
|
|
45
|
+
*
|
|
46
|
+
* Fetches notes from the NoteStore and checks which nullifiers are present in the
|
|
47
|
+
* onchain nullifier Merkle tree - up to the latest locally synced block. We use the
|
|
48
|
+
* locally synced block instead of querying the chain's 'latest' block to ensure correctness:
|
|
49
|
+
* notes are only marked nullified once their corresponding nullifier has been included in a
|
|
50
|
+
* block up to which the PXE has synced.
|
|
51
|
+
* This allows recent nullifications to be processed even if the node is not an archive node.
|
|
52
|
+
*
|
|
53
|
+
* @param contractAddress - The contract whose notes should be checked and nullified.
|
|
54
|
+
*/ async syncNoteNullifiers(contractAddress) {
|
|
55
|
+
const syncedBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
|
|
56
|
+
const contractNotes = await this.noteStore.getNotes({
|
|
57
|
+
contractAddress
|
|
58
|
+
});
|
|
59
|
+
if (contractNotes.length === 0) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const nullifiersToCheck = contractNotes.map((note)=>note.siloedNullifier);
|
|
63
|
+
const nullifierBatches = nullifiersToCheck.reduce((acc, nullifier)=>{
|
|
64
|
+
if (acc[acc.length - 1].length < MAX_RPC_LEN) {
|
|
65
|
+
acc[acc.length - 1].push(nullifier);
|
|
66
|
+
} else {
|
|
67
|
+
acc.push([
|
|
68
|
+
nullifier
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
return acc;
|
|
72
|
+
}, [
|
|
73
|
+
[]
|
|
74
|
+
]);
|
|
75
|
+
const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
|
|
76
|
+
const foundNullifiers = nullifiersToCheck.map((nullifier, i)=>{
|
|
77
|
+
if (nullifierIndexes[i] !== undefined) {
|
|
78
|
+
return {
|
|
79
|
+
...nullifierIndexes[i],
|
|
80
|
+
...{
|
|
81
|
+
data: nullifier
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}).filter((nullifier)=>nullifier !== undefined);
|
|
86
|
+
await this.noteStore.applyNullifiers(foundNullifiers);
|
|
87
|
+
}
|
|
88
|
+
async deliverNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash, recipient) {
|
|
89
|
+
// We are going to store the new note in the NoteStore, which will let us later return it via `getNotes`.
|
|
90
|
+
// There's two things we need to check before we do this however:
|
|
91
|
+
// - we must make sure the note does actually exist in the note hash tree
|
|
92
|
+
// - we need to check if the note has already been nullified
|
|
93
|
+
//
|
|
94
|
+
// Failing to do either of the above would result in circuits getting either non-existent notes and failing to
|
|
95
|
+
// produce inclusion proofs for them, or getting nullified notes and producing duplicate nullifiers, both of which
|
|
96
|
+
// are catastrophic failure modes.
|
|
97
|
+
//
|
|
98
|
+
// Note that adding a note and removing it is *not* equivalent to never adding it in the first place. A nullifier
|
|
99
|
+
// emitted in a block that comes after note creation might result in the note being de-nullified by a chain reorg,
|
|
100
|
+
// so we must store both the note hash and nullifier block information.
|
|
101
|
+
// We avoid making node queries at 'latest' since we don't want to process notes or nullifiers that only exist ahead
|
|
102
|
+
// in time of the locally synced state.
|
|
103
|
+
// Note that while this technically results in historical queries, we perform it at the latest locally synced block
|
|
104
|
+
// number which *should* be recent enough to be available, even for non-archive nodes.
|
|
105
|
+
// Also note that the note should never be ahead of the synced block here since `fetchTaggedLogs` only processes
|
|
106
|
+
// logs up to the synced block making this only an additional safety check.
|
|
107
|
+
const syncedBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
|
|
108
|
+
// By computing siloed and unique note hashes ourselves we prevent contracts from interfering with the note storage
|
|
109
|
+
// of other contracts, which would constitute a security breach.
|
|
110
|
+
const uniqueNoteHash = await computeUniqueNoteHash(noteNonce, await siloNoteHash(contractAddress, noteHash));
|
|
111
|
+
const siloedNullifier = await siloNullifier(contractAddress, nullifier);
|
|
112
|
+
const txEffect = await this.aztecNode.getTxEffect(txHash);
|
|
113
|
+
if (!txEffect) {
|
|
114
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash}`);
|
|
115
|
+
}
|
|
116
|
+
if (txEffect.l2BlockNumber > syncedBlockNumber) {
|
|
117
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${syncedBlockNumber}`);
|
|
118
|
+
}
|
|
119
|
+
const noteInTx = txEffect.data.noteHashes.some((nh)=>nh.equals(uniqueNoteHash));
|
|
120
|
+
if (!noteInTx) {
|
|
121
|
+
throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present in tx ${txHash}`);
|
|
122
|
+
}
|
|
123
|
+
// We store notes by their index in the global note hash tree, which has the convenient side effect of validating
|
|
124
|
+
// note existence in said tree. We concurrently also check if the note's nullifier exists, performing all node
|
|
125
|
+
// queries in a single round-trip.
|
|
126
|
+
const [[uniqueNoteHashTreeIndexInBlock], [nullifierIndex]] = await Promise.all([
|
|
127
|
+
this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NOTE_HASH_TREE, [
|
|
128
|
+
uniqueNoteHash
|
|
129
|
+
]),
|
|
130
|
+
this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, [
|
|
131
|
+
siloedNullifier
|
|
132
|
+
])
|
|
133
|
+
]);
|
|
134
|
+
if (uniqueNoteHashTreeIndexInBlock === undefined) {
|
|
135
|
+
throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present on the tree at block ${syncedBlockNumber} (from tx ${txHash})`);
|
|
136
|
+
}
|
|
137
|
+
const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, uniqueNoteHashTreeIndexInBlock.l2BlockNumber, uniqueNoteHashTreeIndexInBlock.l2BlockHash.toString(), uniqueNoteHashTreeIndexInBlock.data);
|
|
138
|
+
// The note was found by `recipient`, so we use that as the scope when storing the note.
|
|
139
|
+
await this.noteStore.addNotes([
|
|
140
|
+
noteDao
|
|
141
|
+
], recipient);
|
|
142
|
+
if (nullifierIndex !== undefined) {
|
|
143
|
+
const { data: _, ...blockHashAndNum } = nullifierIndex;
|
|
144
|
+
await this.noteStore.applyNullifiers([
|
|
145
|
+
{
|
|
146
|
+
data: siloedNullifier,
|
|
147
|
+
...blockHashAndNum
|
|
148
|
+
}
|
|
149
|
+
]);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
package/dest/oracle_version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const ORACLE_VERSION =
|
|
2
|
-
export declare const ORACLE_INTERFACE_HASH = "
|
|
3
|
-
//# sourceMappingURL=
|
|
1
|
+
export declare const ORACLE_VERSION = 5;
|
|
2
|
+
export declare const ORACLE_INTERFACE_HASH = "d603c17a97034d978ca453d2bce3aacae139539dee28bbc46e8f8c7177a348ec";
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxlQUFPLE1BQU0sY0FBYyxJQUFJLENBQUM7QUFJaEMsZUFBTyxNQUFNLHFCQUFxQixxRUFBcUUsQ0FBQyJ9
|
package/dest/oracle_version.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
///
|
|
5
5
|
/// @dev Whenever a contract function or Noir test is run, the `utilityAssertCompatibleOracleVersion` oracle is called
|
|
6
6
|
/// and if the oracle version is incompatible an error is thrown.
|
|
7
|
-
export const ORACLE_VERSION =
|
|
7
|
+
export const ORACLE_VERSION = 5;
|
|
8
8
|
/// This hash is computed as by hashing the Oracle interface and it is used to detect when the Oracle interface changes,
|
|
9
9
|
/// which in turn implies that you need to update the ORACLE_VERSION constant.
|
|
10
|
-
export const ORACLE_INTERFACE_HASH = '
|
|
10
|
+
export const ORACLE_INTERFACE_HASH = 'd603c17a97034d978ca453d2bce3aacae139539dee28bbc46e8f8c7177a348ec';
|
|
@@ -5,7 +5,7 @@ export declare class PrivateKernelResetPrivateInputsBuilder {
|
|
|
5
5
|
private previousKernelOutput;
|
|
6
6
|
private executionStack;
|
|
7
7
|
private noteHashNullifierCounterMap;
|
|
8
|
-
private
|
|
8
|
+
private splitCounter;
|
|
9
9
|
private previousKernel;
|
|
10
10
|
private nextIteration?;
|
|
11
11
|
private noteHashResetActions;
|
|
@@ -13,7 +13,7 @@ export declare class PrivateKernelResetPrivateInputsBuilder {
|
|
|
13
13
|
private numTransientData?;
|
|
14
14
|
private transientDataSquashingHints;
|
|
15
15
|
private requestedDimensions;
|
|
16
|
-
constructor(previousKernelOutput: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>, executionStack: PrivateCallExecutionResult[], noteHashNullifierCounterMap: Map<number, number>,
|
|
16
|
+
constructor(previousKernelOutput: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>, executionStack: PrivateCallExecutionResult[], noteHashNullifierCounterMap: Map<number, number>, splitCounter: number);
|
|
17
17
|
needsReset(): boolean;
|
|
18
18
|
build(oracle: PrivateKernelOracle, noteHashLeafIndexMap: Map<bigint, bigint>): Promise<PrivateKernelResetCircuitPrivateInputs>;
|
|
19
19
|
private reduceReadRequestActions;
|
|
@@ -25,4 +25,4 @@ export declare class PrivateKernelResetPrivateInputsBuilder {
|
|
|
25
25
|
private needsSiloNullifiers;
|
|
26
26
|
private needsSiloPrivateLogs;
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGRfcHJpdmF0ZV9rZXJuZWxfcmVzZXRfcHJpdmF0ZV9pbnB1dHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9idWlsZF9wcml2YXRlX2tlcm5lbF9yZXNldF9wcml2YXRlX2lucHV0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFlQSxPQUFPLEVBS0wsS0FBSyxnQ0FBZ0MsRUFFckMsc0NBQXNDLEVBR3RDLEtBQUssMkJBQTJCLEVBZWpDLE1BQU0sc0JBQXNCLENBQUM7QUFDOUI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Q0FBQyx1QkFBdUI7SUFzRS9CLE9BQU8sQ0FBQyxtQkFBbUI7SUFjM0IsT0FBTyxDQUFDLG1CQUFtQjtJQWtCM0IsT0FBTyxDQUFDLG9CQUFvQjtDQXFCN0IifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_private_kernel_reset_private_inputs.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts"],"names":[],"mappings":"AAeA,OAAO,EAKL,KAAK,gCAAgC,EAErC,sCAAsC,EAGtC,KAAK,2BAA2B,
|
|
1
|
+
{"version":3,"file":"build_private_kernel_reset_private_inputs.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts"],"names":[],"mappings":"AAeA,OAAO,EAKL,KAAK,gCAAgC,EAErC,sCAAsC,EAGtC,KAAK,2BAA2B,EAejC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,0BAA0B,EAAiB,MAAM,kBAAkB,CAAC;AAGlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA4CvE,qBAAa,sCAAsC;IAY/C,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,2BAA2B;IACnC,OAAO,CAAC,YAAY;IAdtB,OAAO,CAAC,cAAc,CAAmC;IAEzD,OAAO,CAAC,aAAa,CAAC,CAA6B;IAEnD,OAAO,CAAC,oBAAoB,CAAqE;IACjG,OAAO,CAAC,qBAAqB,CAAqE;IAClG,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,2BAA2B,CAAkE;IACrG,OAAO,CAAC,mBAAmB,CAA+B;IAE1D,YACU,oBAAoB,EAAE,2BAA2B,CAAC,gCAAgC,CAAC,EACnF,cAAc,EAAE,0BAA0B,EAAE,EAC5C,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,YAAY,EAAE,MAAM,EAW7B;IAED,UAAU,IAAI,OAAO,CAsBpB;IAEK,KAAK,CAAC,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,mDAoEjF;IAED,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,8BAA8B;IAuDtC,OAAO,CAAC,+BAA+B;IAuDvC,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,uBAAuB;IAsE/B,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,oBAAoB;CAqB7B"}
|
|
@@ -4,12 +4,12 @@ import { padArrayEnd } from '@aztec/foundation/collection';
|
|
|
4
4
|
import { assertLength } from '@aztec/foundation/serialize';
|
|
5
5
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
6
6
|
import { privateKernelResetDimensionsConfig } from '@aztec/noir-protocol-circuits-types/client';
|
|
7
|
-
import { KeyValidationHint, PaddedSideEffects, PrivateKernelData, PrivateKernelResetCircuitPrivateInputs, PrivateKernelResetDimensions, PrivateKernelResetHints, ReadRequestActionEnum, ReadRequestResetActions, ScopedNoteHash, ScopedNullifier,
|
|
7
|
+
import { KeyValidationHint, PaddedSideEffects, PrivateKernelData, PrivateKernelResetCircuitPrivateInputs, PrivateKernelResetDimensions, PrivateKernelResetHints, ReadRequestActionEnum, ReadRequestResetActions, ScopedNoteHash, ScopedNullifier, TransientDataSquashingHint, buildNoteHashReadRequestHintsFromResetActions, buildNullifierReadRequestHintsFromResetActions, buildTransientDataHints, findPrivateKernelResetDimensions, getNoteHashReadRequestResetActions, getNullifierReadRequestResetActions, privateKernelResetDimensionNames } from '@aztec/stdlib/kernel';
|
|
8
8
|
import { collectNested } from '@aztec/stdlib/tx';
|
|
9
9
|
import { VkData } from '@aztec/stdlib/vks';
|
|
10
10
|
function collectNestedReadRequests(executionStack, extractReadRequests) {
|
|
11
11
|
return collectNested(executionStack, (executionResult)=>{
|
|
12
|
-
return extractReadRequests(executionResult).getActiveItems()
|
|
12
|
+
return extractReadRequests(executionResult).getActiveItems();
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
function getNullifierMembershipWitnessResolver(oracle) {
|
|
@@ -37,7 +37,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
37
37
|
previousKernelOutput;
|
|
38
38
|
executionStack;
|
|
39
39
|
noteHashNullifierCounterMap;
|
|
40
|
-
|
|
40
|
+
splitCounter;
|
|
41
41
|
previousKernel;
|
|
42
42
|
// If there's no next iteration, it's the final reset.
|
|
43
43
|
nextIteration;
|
|
@@ -46,11 +46,11 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
46
46
|
numTransientData;
|
|
47
47
|
transientDataSquashingHints;
|
|
48
48
|
requestedDimensions;
|
|
49
|
-
constructor(previousKernelOutput, executionStack, noteHashNullifierCounterMap,
|
|
49
|
+
constructor(previousKernelOutput, executionStack, noteHashNullifierCounterMap, splitCounter){
|
|
50
50
|
this.previousKernelOutput = previousKernelOutput;
|
|
51
51
|
this.executionStack = executionStack;
|
|
52
52
|
this.noteHashNullifierCounterMap = noteHashNullifierCounterMap;
|
|
53
|
-
this.
|
|
53
|
+
this.splitCounter = splitCounter;
|
|
54
54
|
this.previousKernel = previousKernelOutput.publicInputs;
|
|
55
55
|
this.requestedDimensions = PrivateKernelResetDimensions.empty();
|
|
56
56
|
this.noteHashResetActions = ReadRequestResetActions.empty(MAX_NOTE_HASH_READ_REQUESTS_PER_TX);
|
|
@@ -101,7 +101,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
101
101
|
const paddedSideEffects = PaddedSideEffects.empty();
|
|
102
102
|
return new PrivateKernelResetCircuitPrivateInputs(previousKernelData, paddedSideEffects, new PrivateKernelResetHints(await buildNoteHashReadRequestHintsFromResetActions(oracle, this.previousKernel.validationRequests.noteHashReadRequests, this.previousKernel.end.noteHashes, this.noteHashResetActions, noteHashLeafIndexMap), await buildNullifierReadRequestHintsFromResetActions({
|
|
103
103
|
getNullifierMembershipWitness: getNullifierMembershipWitnessResolver(oracle)
|
|
104
|
-
}, this.previousKernel.validationRequests.nullifierReadRequests, this.nullifierResetActions), await getMasterSecretKeysAndAppKeyGenerators(this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators, dimensions.KEY_VALIDATION, oracle), this.transientDataSquashingHints
|
|
104
|
+
}, this.previousKernel.validationRequests.nullifierReadRequests, this.nullifierResetActions), await getMasterSecretKeysAndAppKeyGenerators(this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators, dimensions.KEY_VALIDATION, oracle), this.transientDataSquashingHints), dimensions);
|
|
105
105
|
}
|
|
106
106
|
reduceReadRequestActions(resetActions, maxPending, maxSettled) {
|
|
107
107
|
let numPending = 0;
|
|
@@ -216,7 +216,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
|
|
|
216
216
|
futureNoteHashReads.push(...this.previousKernel.validationRequests.noteHashReadRequests.getActiveItems());
|
|
217
217
|
futureNullifierReads.push(...this.previousKernel.validationRequests.nullifierReadRequests.getActiveItems());
|
|
218
218
|
}
|
|
219
|
-
const { numTransientData, hints: transientDataSquashingHints } = buildTransientDataHints(this.previousKernel.end.noteHashes, this.previousKernel.end.nullifiers, futureNoteHashReads, futureNullifierReads, this.noteHashNullifierCounterMap, this.
|
|
219
|
+
const { numTransientData, hints: transientDataSquashingHints } = buildTransientDataHints(this.previousKernel.end.noteHashes, this.previousKernel.end.nullifiers, futureNoteHashReads, futureNullifierReads, this.noteHashNullifierCounterMap, this.splitCounter);
|
|
220
220
|
if (this.nextIteration && !numTransientData) {
|
|
221
221
|
const forceResetAll = true;
|
|
222
222
|
const canClearReadRequests = noteHashWillOverflow && this.needsResetNoteHashReadRequests(forceResetAll) || nullifierWillOverflow && this.needsResetNullifierReadRequests(forceResetAll) || logsWillOverflow && this.needsResetNoteHashReadRequests(forceResetAll);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PrivateKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
2
2
|
import type { UInt64 } from '@aztec/stdlib/types';
|
|
3
3
|
export declare function computeTxIncludeByTimestamp(previousKernel: PrivateKernelCircuitPublicInputs, maxDuration?: number): UInt64;
|
|
4
|
-
//# sourceMappingURL=
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZV90eF9pbmNsdWRlX2J5X3RpbWVzdGFtcC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL2hpbnRzL2NvbXB1dGVfdHhfaW5jbHVkZV9ieV90aW1lc3RhbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsZ0NBQWdDLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUM3RSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQXFCbEQsd0JBQWdCLDJCQUEyQixDQUN6QyxjQUFjLEVBQUUsZ0NBQWdDLEVBQ2hELFdBQVcsU0FBb0MsR0FDOUMsTUFBTSxDQStCUiJ9
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './build_private_kernel_reset_private_inputs.js';
|
|
2
2
|
export * from './compute_tx_include_by_timestamp.js';
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGdEQUFnRCxDQUFDO0FBQy9ELGNBQWMsc0NBQXNDLENBQUMifQ==
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './private_kernel_execution_prover.js';
|
|
2
2
|
export * from './private_kernel_oracle.js';
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHNDQUFzQyxDQUFDO0FBQ3JELGNBQWMsNEJBQTRCLENBQUMifQ==
|
|
@@ -41,4 +41,4 @@ export declare class PrivateKernelExecutionProver {
|
|
|
41
41
|
private getVkData;
|
|
42
42
|
private createPrivateCallData;
|
|
43
43
|
}
|
|
44
|
-
//# sourceMappingURL=
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfZXhlY3V0aW9uX3Byb3Zlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL3ByaXZhdGVfa2VybmVsX2V4ZWN1dGlvbl9wcm92ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUUEsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUMzRSxPQUFPLEVBUUwsS0FBSyxpQ0FBaUMsRUFLdEMsS0FBSyxvQ0FBb0MsRUFFMUMsTUFBTSxzQkFBc0IsQ0FBQztBQUU5QixPQUFPLEVBRUwsS0FBSyxzQkFBc0IsRUFDM0IsU0FBUyxFQUlWLE1BQU0sa0JBQWtCLENBQUM7QUFJMUIsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQVN0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AsB,EAC3B,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAuD;
|
|
1
|
+
{"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAQL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAuD;IAElE,YACU,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ,EACxB;IAEJ;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,sBAAsB,EACvC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAE,kCAI9C,GACA,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC,CAqRlF;IAED;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;YAoBjB,SAAS;YAST,qBAAqB;CA+BpC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto/keys';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import { pushTestData } from '@aztec/foundation/testing';
|
|
5
5
|
import { Timer } from '@aztec/foundation/timer';
|
|
@@ -62,10 +62,11 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
62
62
|
const executionSteps = [];
|
|
63
63
|
const noteHashLeafIndexMap = collectNoteHashLeafIndexMap(executionResult);
|
|
64
64
|
const noteHashNullifierCounterMap = collectNoteHashNullifierCounterMap(executionResult);
|
|
65
|
-
const
|
|
65
|
+
const minRevertibleSideEffectCounter = getFinalMinRevertibleSideEffectCounter(executionResult);
|
|
66
|
+
const splitCounter = isPrivateOnlyTx ? 0 : minRevertibleSideEffectCounter;
|
|
66
67
|
while(executionStack.length){
|
|
67
68
|
if (!firstIteration) {
|
|
68
|
-
let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap,
|
|
69
|
+
let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, splitCounter);
|
|
69
70
|
while(resetBuilder.needsReset()){
|
|
70
71
|
const witgenTimer = new Timer();
|
|
71
72
|
const privateInputs = await resetBuilder.build(this.oracle, noteHashLeafIndexMap);
|
|
@@ -79,7 +80,7 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
79
80
|
witgen: witgenTimer.ms()
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
|
-
resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap,
|
|
83
|
+
resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, splitCounter);
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
const currentExecution = executionStack.pop();
|
|
@@ -100,7 +101,7 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
100
101
|
const privateCallData = await this.createPrivateCallData(currentExecution);
|
|
101
102
|
if (firstIteration) {
|
|
102
103
|
const witgenTimer = new Timer();
|
|
103
|
-
const proofInput = new PrivateKernelInitCircuitPrivateInputs(txRequest, getVKTreeRoot(), ProtocolContractsList, privateCallData, isPrivateOnlyTx, executionResult.firstNullifier);
|
|
104
|
+
const proofInput = new PrivateKernelInitCircuitPrivateInputs(txRequest, getVKTreeRoot(), ProtocolContractsList, privateCallData, isPrivateOnlyTx, executionResult.firstNullifier, minRevertibleSideEffectCounter);
|
|
104
105
|
this.log.debug(`Calling private kernel init with isPrivateOnly ${isPrivateOnlyTx} and firstNullifierHint ${proofInput.firstNullifierHint}`);
|
|
105
106
|
pushTestData('private-kernel-inputs-init', proofInput);
|
|
106
107
|
output = generateWitnesses ? await this.proofCreator.generateInitOutput(proofInput) : await this.proofCreator.simulateInit(proofInput);
|
|
@@ -133,7 +134,7 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
133
134
|
firstIteration = false;
|
|
134
135
|
}
|
|
135
136
|
// Reset.
|
|
136
|
-
let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap,
|
|
137
|
+
let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, splitCounter);
|
|
137
138
|
while(resetBuilder.needsReset()){
|
|
138
139
|
const witgenTimer = new Timer();
|
|
139
140
|
const privateInputs = await resetBuilder.build(this.oracle, noteHashLeafIndexMap);
|
|
@@ -147,7 +148,7 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
147
148
|
witgen: witgenTimer.ms()
|
|
148
149
|
}
|
|
149
150
|
});
|
|
150
|
-
resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap,
|
|
151
|
+
resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, splitCounter);
|
|
151
152
|
}
|
|
152
153
|
if (output.publicInputs.feePayer.isZero() && skipFeeEnforcement) {
|
|
153
154
|
if (!skipProofGeneration) {
|
|
@@ -180,8 +181,8 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
180
181
|
witgen: witgenTimer.ms()
|
|
181
182
|
}
|
|
182
183
|
});
|
|
183
|
-
// Hiding
|
|
184
|
-
// For simulation, we can end with the tail, since the
|
|
184
|
+
// Hiding kernel is only executed if we are generating witnesses.
|
|
185
|
+
// For simulation, we can end with the tail, since the Hiding kernel will simply return the same tail output.
|
|
185
186
|
if (generateWitnesses) {
|
|
186
187
|
const previousKernelVkData = await this.getVkData(tailOutput.verificationKey);
|
|
187
188
|
const witgenTimer = new Timer();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FUNCTION_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT, VK_TREE_HEIGHT } from '@aztec/constants';
|
|
2
|
-
import type { Fr
|
|
2
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import type { GrumpkinScalar, Point } from '@aztec/foundation/curves/grumpkin';
|
|
3
4
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
4
5
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
5
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
@@ -59,4 +60,4 @@ export interface PrivateKernelOracle {
|
|
|
59
60
|
* along with an associated DelayedPublicMutable containing the class ID to update. */
|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ksT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBRW5DOzs7Ozs7T0FNRztJQUNILGtCQUFrQixDQUFDLGVBQWUsRUFBRSxLQUFLLEdBQUcsT0FBTyxDQUFDLGNBQWMsQ0FBQyxDQUFDO0lBRXBFLDJFQUEyRTtJQUMzRSxvQkFBb0IsQ0FBQyxlQUFlLEVBQUUsWUFBWSxFQUFFLFFBQVEsRUFBRSxnQkFBZ0IsR0FBRyxPQUFPLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQyxDQUFDO0lBRTdHOzBGQUNzRjtJQUN0RixzQkFBc0IsQ0FBQyxlQUFlLEVBQUUsWUFBWSxHQUFHLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDO0NBQ3JGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_oracle.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_oracle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"private_kernel_oracle.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_oracle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;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;;;OAMG;IACH,kBAAkB,CAAC,eAAe,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEpE,2EAA2E;IAC3E,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAE7G;0FACsF;IACtF,sBAAsB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACrF"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { NOTE_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
2
|
-
import type { Fr
|
|
2
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import type { GrumpkinScalar, Point } from '@aztec/foundation/curves/grumpkin';
|
|
3
4
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
4
5
|
import type { KeyStore } from '@aztec/key-store';
|
|
5
6
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
6
7
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import type {
|
|
8
|
+
import type { BlockParameter } from '@aztec/stdlib/block';
|
|
8
9
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
9
10
|
import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
10
11
|
import type { NullifierMembershipWitness } from '@aztec/stdlib/trees';
|
|
11
12
|
import type { VerificationKeyAsFields } from '@aztec/stdlib/vks';
|
|
12
|
-
import type {
|
|
13
|
+
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
13
14
|
import type { PrivateKernelOracle } from './private_kernel_oracle.js';
|
|
14
15
|
/**
|
|
15
16
|
* A data oracle that provides information needed for simulating a transaction.
|
|
16
17
|
*/
|
|
17
18
|
export declare class PrivateKernelOracleImpl implements PrivateKernelOracle {
|
|
18
|
-
private
|
|
19
|
+
private contractStore;
|
|
19
20
|
private keyStore;
|
|
20
21
|
private node;
|
|
21
22
|
private blockNumber;
|
|
22
23
|
private log;
|
|
23
|
-
constructor(
|
|
24
|
+
constructor(contractStore: ContractStore, keyStore: KeyStore, node: AztecNode, blockNumber?: BlockParameter, log?: import("@aztec/foundation/log").Logger);
|
|
24
25
|
getContractAddressPreimage(address: AztecAddress): Promise<{
|
|
25
26
|
version: 1;
|
|
26
27
|
salt: Fr;
|
|
@@ -28,7 +29,7 @@ export declare class PrivateKernelOracleImpl implements PrivateKernelOracle {
|
|
|
28
29
|
currentContractClassId: Fr;
|
|
29
30
|
originalContractClassId: Fr;
|
|
30
31
|
initializationHash: Fr;
|
|
31
|
-
publicKeys: import("
|
|
32
|
+
publicKeys: import("../../../stdlib/dest/keys/public_keys.js").PublicKeys;
|
|
32
33
|
address: AztecAddress;
|
|
33
34
|
saltedInitializationHash: Fr;
|
|
34
35
|
}>;
|
|
@@ -42,4 +43,4 @@ export declare class PrivateKernelOracleImpl implements PrivateKernelOracle {
|
|
|
42
43
|
getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
|
|
43
44
|
getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints>;
|
|
44
45
|
}
|
|
45
|
-
//# sourceMappingURL=
|
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfb3JhY2xlX2ltcGwuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9wcml2YXRlX2tlcm5lbF9vcmFjbGVfaW1wbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUscUJBQXFCLEVBQTJDLE1BQU0sa0JBQWtCLENBQUM7QUFDbEcsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDekQsT0FBTyxLQUFLLEV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,EACf,WAAW,GAAE,cAAyB,EACtC,GAAG,yCAAoC,EAC7C;IAES,0BAA0B,CAAC,OAAO,EAAE,YAAY;;;;;;;;;;OAS5D;IAEY,0BAA0B,CAAC,eAAe,EAAE,EAAE,qEAM1D;IAEY,4BAA4B,CAAC,eAAe,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,iCAQxF;IAEM,sBAAsB,CAAC,EAAE,EAAE,uBAAuB,iCAGxD;IAEK,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAO9G;IAED,6BAA6B,CAAC,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAE5F;IAEK,mBAAmB,IAAI,OAAO,CAAC,EAAE,CAAC,CAMvC;IAEM,kBAAkB,CAAC,eAAe,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,CAEzE;IAEM,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtG;IAEY,sBAAsB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA8B/F;CACF"}
|
|
@@ -12,20 +12,20 @@ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
|
12
12
|
/**
|
|
13
13
|
* A data oracle that provides information needed for simulating a transaction.
|
|
14
14
|
*/ export class PrivateKernelOracleImpl {
|
|
15
|
-
|
|
15
|
+
contractStore;
|
|
16
16
|
keyStore;
|
|
17
17
|
node;
|
|
18
18
|
blockNumber;
|
|
19
19
|
log;
|
|
20
|
-
constructor(
|
|
21
|
-
this.
|
|
20
|
+
constructor(contractStore, keyStore, node, blockNumber = 'latest', log = createLogger('pxe:kernel_oracle')){
|
|
21
|
+
this.contractStore = contractStore;
|
|
22
22
|
this.keyStore = keyStore;
|
|
23
23
|
this.node = node;
|
|
24
24
|
this.blockNumber = blockNumber;
|
|
25
25
|
this.log = log;
|
|
26
26
|
}
|
|
27
27
|
async getContractAddressPreimage(address) {
|
|
28
|
-
const instance = await this.
|
|
28
|
+
const instance = await this.contractStore.getContractInstance(address);
|
|
29
29
|
if (!instance) {
|
|
30
30
|
throw new Error(`Contract instance not found when getting address preimage. Contract address: ${address}.`);
|
|
31
31
|
}
|
|
@@ -35,14 +35,14 @@ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
async getContractClassIdPreimage(contractClassId) {
|
|
38
|
-
const contractClass = await this.
|
|
38
|
+
const contractClass = await this.contractStore.getContractClass(contractClassId);
|
|
39
39
|
if (!contractClass) {
|
|
40
40
|
throw new Error(`Contract class not found when getting class id preimage. Class id: ${contractClassId}.`);
|
|
41
41
|
}
|
|
42
42
|
return computeContractClassIdPreimage(contractClass);
|
|
43
43
|
}
|
|
44
44
|
async getFunctionMembershipWitness(contractClassId, selector) {
|
|
45
|
-
const membershipWitness = await this.
|
|
45
|
+
const membershipWitness = await this.contractStore.getFunctionMembershipWitness(contractClassId, selector);
|
|
46
46
|
if (!membershipWitness) {
|
|
47
47
|
throw new Error(`Membership witness not found for contract class id ${contractClassId} and selector ${selector}.`);
|
|
48
48
|
}
|
|
@@ -70,7 +70,7 @@ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
|
70
70
|
return this.keyStore.getMasterSecretKey(masterPublicKey);
|
|
71
71
|
}
|
|
72
72
|
getDebugFunctionName(contractAddress, selector) {
|
|
73
|
-
return this.
|
|
73
|
+
return this.contractStore.getDebugFunctionName(contractAddress, selector);
|
|
74
74
|
}
|
|
75
75
|
async getUpdatedClassIdHints(contractAddress) {
|
|
76
76
|
const { delayedPublicMutableSlot, delayedPublicMutableHashSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
import type { BlockParameter } from '@aztec/stdlib/block';
|
|
4
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
5
|
+
import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
|
|
6
|
+
export declare class PublicStorageService {
|
|
7
|
+
private readonly anchorBlockStore;
|
|
8
|
+
private readonly aztecNode;
|
|
9
|
+
constructor(anchorBlockStore: AnchorBlockStore, aztecNode: AztecNode);
|
|
10
|
+
/**
|
|
11
|
+
* Gets the storage value at the given contract storage slot.
|
|
12
|
+
*
|
|
13
|
+
* @remarks The storage slot here refers to the slot as it is defined in Noir not the index in the merkle tree.
|
|
14
|
+
* Aztec's version of `eth_getStorageAt`.
|
|
15
|
+
*
|
|
16
|
+
* @param blockNumber - The block number at which to get the data.
|
|
17
|
+
* @param contract - Address of the contract to query.
|
|
18
|
+
* @param slot - Slot to query.
|
|
19
|
+
* @returns Storage value at the given contract slot.
|
|
20
|
+
* @throws If the contract is not deployed.
|
|
21
|
+
*/
|
|
22
|
+
getPublicStorageAt(blockNumber: BlockParameter, contract: AztecAddress, slot: Fr): Promise<Fr>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX3N0b3JhZ2Vfc2VydmljZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3B1YmxpY19zdG9yYWdlL3B1YmxpY19zdG9yYWdlX3NlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLE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U,kBAAkB,CAAC,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAM1G;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export class PublicStorageService {
|
|
2
|
+
anchorBlockStore;
|
|
3
|
+
aztecNode;
|
|
4
|
+
constructor(anchorBlockStore, aztecNode){
|
|
5
|
+
this.anchorBlockStore = anchorBlockStore;
|
|
6
|
+
this.aztecNode = aztecNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Gets the storage value at the given contract storage slot.
|
|
10
|
+
*
|
|
11
|
+
* @remarks The storage slot here refers to the slot as it is defined in Noir not the index in the merkle tree.
|
|
12
|
+
* Aztec's version of `eth_getStorageAt`.
|
|
13
|
+
*
|
|
14
|
+
* @param blockNumber - The block number at which to get the data.
|
|
15
|
+
* @param contract - Address of the contract to query.
|
|
16
|
+
* @param slot - Slot to query.
|
|
17
|
+
* @returns Storage value at the given contract slot.
|
|
18
|
+
* @throws If the contract is not deployed.
|
|
19
|
+
*/ async getPublicStorageAt(blockNumber, contract, slot) {
|
|
20
|
+
const anchorBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
|
|
21
|
+
if (blockNumber !== 'latest' && blockNumber > anchorBlockNumber) {
|
|
22
|
+
throw new Error(`Block number ${blockNumber} is higher than current block ${anchorBlockNumber}`);
|
|
23
|
+
}
|
|
24
|
+
return await this.aztecNode.getPublicStorageAt(blockNumber, contract, slot);
|
|
25
|
+
}
|
|
26
|
+
}
|