@aztec/pxe 0.0.1-commit.b9865e97 → 0.0.1-commit.be03c316
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.js +8 -23
- package/dest/bin/index.d.ts +2 -2
- package/dest/bin/index.d.ts.map +1 -1
- package/dest/bin/index.js +1 -1
- package/dest/bin/oracle_version_helpers.d.ts +16 -8
- package/dest/bin/oracle_version_helpers.d.ts.map +1 -1
- package/dest/bin/oracle_version_helpers.js +22 -69
- package/dest/block_synchronizer/block_stream_source.d.ts +5 -5
- package/dest/block_synchronizer/block_stream_source.d.ts.map +1 -1
- package/dest/block_synchronizer/block_stream_source.js +4 -29
- package/dest/block_synchronizer/block_synchronizer.d.ts +18 -14
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +54 -18
- package/dest/config/index.d.ts +2 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -0
- package/dest/contract/contract_class_service.d.ts +31 -0
- package/dest/contract/contract_class_service.d.ts.map +1 -0
- package/dest/contract/contract_class_service.js +68 -0
- package/dest/contract/contract_sync_service.d.ts +48 -0
- package/dest/contract/contract_sync_service.d.ts.map +1 -0
- package/dest/{contract_sync → contract}/contract_sync_service.js +26 -45
- package/dest/contract/helpers.d.ts +7 -0
- package/dest/contract/helpers.d.ts.map +1 -0
- package/dest/contract/helpers.js +20 -0
- package/dest/contract/skip_sync_contracts.d.ts +11 -0
- package/dest/contract/skip_sync_contracts.d.ts.map +1 -0
- package/dest/contract/skip_sync_contracts.js +18 -0
- package/dest/contract_function_simulator/anchored_contract_data.d.ts +36 -0
- package/dest/contract_function_simulator/anchored_contract_data.d.ts.map +1 -0
- package/dest/contract_function_simulator/anchored_contract_data.js +54 -0
- package/dest/contract_function_simulator/aztec_node_read_cache.d.ts +39 -0
- package/dest/contract_function_simulator/aztec_node_read_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/aztec_node_read_cache.js +60 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +19 -18
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +63 -32
- package/dest/contract_function_simulator/execution_note_cache.d.ts +3 -9
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +8 -28
- package/dest/contract_function_simulator/index.d.ts +19 -10
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +6 -9
- package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts +8 -27
- package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/bounded_vec.js +8 -23
- package/dest/contract_function_simulator/noir-structs/contract_class_log_data.d.ts +9 -0
- package/dest/contract_function_simulator/noir-structs/contract_class_log_data.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/contract_class_log_data.js +1 -0
- package/dest/contract_function_simulator/noir-structs/embedded_curve_point.d.ts +7 -0
- package/dest/contract_function_simulator/noir-structs/embedded_curve_point.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/embedded_curve_point.js +1 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/fact.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/fact.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/fact.js +6 -0
- package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts +27 -0
- package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/fact_collection.js +31 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +11 -12
- 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 +6 -49
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +10 -8
- 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 -60
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +2 -2
- package/dest/contract_function_simulator/noir-structs/option.d.ts +9 -11
- package/dest/contract_function_simulator/noir-structs/option.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/option.js +18 -13
- package/dest/contract_function_simulator/noir-structs/origin_block.d.ts +11 -0
- package/dest/contract_function_simulator/noir-structs/origin_block.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/origin_block.js +5 -0
- package/dest/contract_function_simulator/noir-structs/pending_tagged_log.d.ts +11 -0
- package/dest/contract_function_simulator/noir-structs/pending_tagged_log.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/pending_tagged_log.js +4 -0
- package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts +6 -9
- package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/provided_secret.js +1 -24
- package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts +28 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.js +50 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts +19 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tx.js +9 -0
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts +15 -0
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.js +5 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +6 -11
- 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 -20
- package/dest/contract_function_simulator/oracle/acir_callback.d.ts +21 -0
- package/dest/contract_function_simulator/oracle/acir_callback.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/acir_callback.js +115 -0
- package/dest/contract_function_simulator/oracle/index.d.ts +2 -13
- package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/index.js +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +2 -3
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_registry.d.ts +39 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_registry.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_registry.js +107 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -14
- 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 -24
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +43 -31
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_registry.js +259 -29
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +180 -45
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +1024 -341
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +2 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +21 -8
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +132 -22
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +77 -34
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +247 -106
- package/dest/contract_function_simulator/transient_array_service.d.ts +31 -0
- package/dest/contract_function_simulator/transient_array_service.d.ts.map +1 -0
- package/dest/contract_function_simulator/transient_array_service.js +62 -0
- package/dest/debug/pxe_debug_utils.d.ts +2 -2
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.d.ts +2 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +1 -0
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +17 -6
- package/dest/entrypoints/client/lazy/index.d.ts +2 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +1 -0
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +17 -6
- package/dest/entrypoints/client/store.d.ts +14 -0
- package/dest/entrypoints/client/store.d.ts.map +1 -0
- package/dest/entrypoints/client/store.js +42 -0
- package/dest/entrypoints/pxe_creation_options.d.ts +9 -3
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +6 -3
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +4 -2
- package/dest/entrypoints/server/store.d.ts +18 -0
- package/dest/entrypoints/server/store.d.ts.map +1 -0
- package/dest/entrypoints/server/store.js +28 -0
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +16 -4
- package/dest/error_enriching.d.ts +5 -3
- package/dest/error_enriching.d.ts.map +1 -1
- package/dest/error_enriching.js +13 -11
- package/dest/hooks/execution_hooks.d.ts +31 -11
- package/dest/hooks/execution_hooks.d.ts.map +1 -1
- package/dest/hooks/execution_hooks.js +3 -3
- package/dest/hooks/index.d.ts +4 -3
- package/dest/hooks/index.d.ts.map +1 -1
- package/dest/hooks/index.js +1 -0
- package/dest/hooks/resolve_custom_request.d.ts +23 -0
- package/dest/hooks/resolve_custom_request.d.ts.map +1 -0
- package/dest/hooks/resolve_custom_request.js +3 -0
- package/dest/hooks/resolve_tagging_secret_strategy.d.ts +50 -0
- package/dest/hooks/resolve_tagging_secret_strategy.d.ts.map +1 -0
- package/dest/hooks/resolve_tagging_secret_strategy.js +3 -0
- package/dest/logs/log_service.d.ts +8 -6
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +88 -28
- package/dest/messages/tx_resolver_service.d.ts +17 -0
- package/dest/messages/tx_resolver_service.d.ts.map +1 -0
- package/dest/messages/{message_context_service.js → tx_resolver_service.js} +13 -8
- package/dest/notes/note_service.d.ts +1 -1
- package/dest/notes/note_service.js +1 -1
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.js +5 -5
- package/dest/private_kernel/batch_planner.d.ts +1 -1
- package/dest/private_kernel/batch_planner.d.ts.map +1 -1
- package/dest/private_kernel/batch_planner.js +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +6 -2
- package/dest/private_kernel/hints/test_utils.js +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 +61 -40
- package/dest/private_kernel/private_kernel_oracle.d.ts +4 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +17 -5
- package/dest/pxe.d.ts +114 -48
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +225 -139
- package/dest/storage/allowed_scopes.d.ts +6 -0
- package/dest/storage/allowed_scopes.d.ts.map +1 -0
- package/dest/storage/allowed_scopes.js +7 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -6
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
- package/dest/storage/anchor_block_store/anchor_block_store.js +8 -6
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +1 -1
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -1
- package/dest/storage/backwards_compatibility_tests/schema_tests.js +129 -49
- package/dest/storage/capsule_store/capsule_service.d.ts +1 -1
- package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_service.js +6 -9
- package/dest/storage/contract_store/contract_store.d.ts +27 -24
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +64 -75
- package/dest/storage/fact_store/fact_service.d.ts +22 -0
- package/dest/storage/fact_store/fact_service.d.ts.map +1 -0
- package/dest/storage/fact_store/fact_service.js +45 -0
- package/dest/storage/fact_store/fact_store.d.ts +95 -0
- package/dest/storage/fact_store/fact_store.d.ts.map +1 -0
- package/dest/storage/fact_store/fact_store.js +408 -0
- package/dest/storage/fact_store/fact_store_keys.d.ts +34 -0
- package/dest/storage/fact_store/fact_store_keys.d.ts.map +1 -0
- package/dest/storage/fact_store/fact_store_keys.js +50 -0
- package/dest/storage/fact_store/index.d.ts +6 -0
- package/dest/storage/fact_store/index.d.ts.map +1 -0
- package/dest/storage/fact_store/index.js +4 -0
- package/dest/storage/fact_store/origin_state.d.ts +59 -0
- package/dest/storage/fact_store/origin_state.d.ts.map +1 -0
- package/dest/storage/fact_store/origin_state.js +60 -0
- package/dest/storage/fact_store/stored_fact.d.ts +32 -0
- package/dest/storage/fact_store/stored_fact.d.ts.map +1 -0
- package/dest/storage/fact_store/stored_fact.js +64 -0
- package/dest/storage/index.d.ts +3 -2
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +2 -1
- package/dest/storage/metadata.d.ts +2 -2
- package/dest/storage/metadata.d.ts.map +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/note_store.d.ts +42 -33
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +197 -168
- package/dest/storage/note_store/stored_note.d.ts +3 -8
- package/dest/storage/note_store/stored_note.d.ts.map +1 -1
- package/dest/storage/note_store/stored_note.js +4 -20
- package/dest/storage/open_pxe_stores.d.ts +5 -3
- package/dest/storage/open_pxe_stores.d.ts.map +1 -1
- package/dest/storage/open_pxe_stores.js +5 -3
- package/dest/storage/private_event_store/private_event_store.d.ts +13 -16
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
- package/dest/storage/private_event_store/private_event_store.js +40 -43
- package/dest/storage/store_identity.d.ts +35 -0
- package/dest/storage/store_identity.d.ts.map +1 -0
- package/dest/storage/store_identity.js +44 -0
- package/dest/storage/tagging_store/index.d.ts +2 -2
- package/dest/storage/tagging_store/index.d.ts.map +1 -1
- package/dest/storage/tagging_store/index.js +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +19 -3
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +48 -11
- package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts +51 -0
- package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/tagging_secret_sources_store.js +105 -0
- package/dest/tagging/constants.d.ts +3 -2
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +28 -10
- package/dest/tagging/index.d.ts +2 -2
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +1 -1
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +26 -8
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.js +95 -20
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +6 -2
- package/dest/tagging/testing/tag_query_test_utils.d.ts +6 -0
- package/dest/tagging/testing/tag_query_test_utils.d.ts.map +1 -0
- package/dest/tagging/testing/tag_query_test_utils.js +10 -0
- package/package.json +17 -17
- package/src/bin/check_oracle_version.ts +8 -24
- package/src/bin/index.ts +1 -1
- package/src/bin/oracle_version_helpers.ts +23 -90
- package/src/block_synchronizer/block_stream_source.ts +6 -45
- package/src/block_synchronizer/block_synchronizer.ts +70 -29
- package/src/config/index.ts +1 -0
- package/src/contract/contract_class_service.ts +83 -0
- package/src/{contract_sync → contract}/contract_sync_service.ts +37 -50
- package/src/contract/helpers.ts +35 -0
- package/src/contract/skip_sync_contracts.ts +23 -0
- package/src/contract_function_simulator/anchored_contract_data.ts +74 -0
- package/src/contract_function_simulator/aztec_node_read_cache.ts +89 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +96 -42
- package/src/contract_function_simulator/execution_note_cache.ts +7 -28
- package/src/contract_function_simulator/index.ts +48 -13
- package/src/contract_function_simulator/noir-structs/bounded_vec.ts +12 -24
- package/src/contract_function_simulator/noir-structs/contract_class_log_data.ts +9 -0
- package/src/contract_function_simulator/noir-structs/embedded_curve_point.ts +4 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/fact.ts +13 -0
- package/src/contract_function_simulator/noir-structs/fact_collection.ts +64 -0
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +20 -46
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +13 -60
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +2 -2
- package/src/contract_function_simulator/noir-structs/option.ts +17 -11
- package/src/contract_function_simulator/noir-structs/origin_block.ts +8 -0
- package/src/contract_function_simulator/noir-structs/pending_tagged_log.ts +12 -0
- package/src/contract_function_simulator/noir-structs/provided_secret.ts +4 -26
- package/src/contract_function_simulator/noir-structs/resolved_tagging_strategy.ts +66 -0
- package/src/contract_function_simulator/noir-structs/resolved_tx.ts +19 -0
- package/src/contract_function_simulator/noir-structs/tx_effect_data.ts +16 -0
- package/src/contract_function_simulator/noir-structs/utility_context.ts +5 -17
- package/src/contract_function_simulator/oracle/acir_callback.ts +154 -0
- package/src/contract_function_simulator/oracle/index.ts +1 -15
- package/src/contract_function_simulator/oracle/interfaces.ts +1 -2
- package/src/contract_function_simulator/oracle/legacy_oracle_registry.ts +147 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +6 -21
- package/src/contract_function_simulator/oracle/oracle_registry.ts +172 -47
- package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +814 -315
- package/src/contract_function_simulator/oracle/private_execution.ts +2 -3
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +167 -30
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +399 -135
- package/src/contract_function_simulator/transient_array_service.ts +91 -0
- package/src/debug/pxe_debug_utils.ts +1 -1
- package/src/entrypoints/client/bundle/index.ts +1 -0
- package/src/entrypoints/client/bundle/utils.ts +24 -5
- package/src/entrypoints/client/lazy/index.ts +1 -0
- package/src/entrypoints/client/lazy/utils.ts +24 -5
- package/src/entrypoints/client/store.ts +54 -0
- package/src/entrypoints/pxe_creation_options.ts +8 -2
- package/src/entrypoints/server/index.ts +6 -2
- package/src/entrypoints/server/store.ts +47 -0
- package/src/entrypoints/server/utils.ts +31 -9
- package/src/error_enriching.ts +27 -11
- package/src/hooks/execution_hooks.ts +32 -12
- package/src/hooks/index.ts +8 -2
- package/src/hooks/resolve_custom_request.ts +24 -0
- package/src/hooks/resolve_tagging_secret_strategy.ts +60 -0
- package/src/logs/log_service.ts +100 -37
- package/src/messages/{message_context_service.ts → tx_resolver_service.ts} +16 -9
- package/src/notes/note_service.ts +1 -1
- package/src/oracle_version.ts +5 -5
- package/src/private_kernel/batch_planner.ts +0 -1
- package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +11 -1
- package/src/private_kernel/hints/test_utils.ts +1 -1
- package/src/private_kernel/private_kernel_execution_prover.ts +112 -56
- package/src/private_kernel/private_kernel_oracle.ts +23 -4
- package/src/pxe.ts +328 -159
- package/src/storage/allowed_scopes.ts +14 -0
- package/src/storage/anchor_block_store/anchor_block_store.ts +8 -6
- package/src/storage/backwards_compatibility_tests/__snapshots__/AddressStore.json +6 -6
- package/src/storage/backwards_compatibility_tests/__snapshots__/ContractStore.json +1 -1
- package/src/storage/backwards_compatibility_tests/__snapshots__/FactStore.json +40 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/KeyStore.json +12 -12
- package/src/storage/backwards_compatibility_tests/__snapshots__/L2TipsKVStore.json +9 -15
- package/src/storage/backwards_compatibility_tests/__snapshots__/NoteStore.json +24 -4
- package/src/storage/backwards_compatibility_tests/__snapshots__/RecipientTaggingStore.json +11 -3
- package/src/storage/backwards_compatibility_tests/__snapshots__/SenderTaggingStore.json +12 -4
- package/src/storage/backwards_compatibility_tests/__snapshots__/TaggingSecretSourcesStore.json +30 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +29 -9
- package/src/storage/backwards_compatibility_tests/schema_tests.ts +141 -50
- package/src/storage/capsule_store/capsule_service.ts +8 -13
- package/src/storage/contract_store/contract_store.ts +86 -93
- package/src/storage/fact_store/fact_service.ts +69 -0
- package/src/storage/fact_store/fact_store.ts +487 -0
- package/src/storage/fact_store/fact_store_keys.ts +75 -0
- package/src/storage/fact_store/index.ts +15 -0
- package/src/storage/fact_store/origin_state.ts +84 -0
- package/src/storage/fact_store/stored_fact.ts +80 -0
- package/src/storage/index.ts +2 -1
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +226 -187
- package/src/storage/note_store/stored_note.ts +5 -27
- package/src/storage/open_pxe_stores.ts +6 -3
- package/src/storage/private_event_store/private_event_store.ts +49 -55
- package/src/storage/store_identity.ts +72 -0
- package/src/storage/tagging_store/index.ts +1 -1
- package/src/storage/tagging_store/sender_tagging_store.ts +62 -15
- package/src/storage/tagging_store/tagging_secret_sources_store.ts +138 -0
- package/src/tagging/constants.ts +30 -10
- package/src/tagging/index.ts +1 -1
- package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +148 -30
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +1 -1
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +6 -2
- package/src/tagging/testing/tag_query_test_utils.ts +11 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +0 -89
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +0 -1
- package/dest/contract_function_simulator/oracle/oracle.js +0 -552
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +0 -6
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +0 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +0 -51
- package/dest/contract_sync/contract_sync_service.d.ts +0 -42
- package/dest/contract_sync/contract_sync_service.d.ts.map +0 -1
- package/dest/contract_sync/helpers.d.ts +0 -27
- package/dest/contract_sync/helpers.d.ts.map +0 -1
- package/dest/contract_sync/helpers.js +0 -53
- package/dest/messages/message_context_service.d.ts +0 -17
- package/dest/messages/message_context_service.d.ts.map +0 -1
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +0 -14
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +0 -1
- package/dest/storage/tagging_store/sender_address_book_store.js +0 -36
- package/src/contract_function_simulator/oracle/oracle.ts +0 -711
- package/src/contract_function_simulator/proxied_contract_data_source.ts +0 -60
- package/src/contract_sync/helpers.ts +0 -86
- package/src/storage/backwards_compatibility_tests/__snapshots__/SenderAddressBookStore.json +0 -16
- package/src/storage/tagging_store/sender_address_book_store.ts +0 -48
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* In-memory store for transient arrays.
|
|
6
|
+
*
|
|
7
|
+
* Unlike {@link EphemeralArrayService} (one instance per call frame), a single `TransientArrayService` instance is shared
|
|
8
|
+
* across all frames of one top-level PXE call (a transaction simulation or utility call), so arrays survive across nested
|
|
9
|
+
* private and utility calls. Entries are keyed by `(contract address, slot)`; the contract address is supplied by the
|
|
10
|
+
* oracle from its execution context, so a contract can only ever name its own arrays. The store is purely in-memory and
|
|
11
|
+
* is discarded when the top-level PXE call completes — it is never persisted.
|
|
12
|
+
*/
|
|
13
|
+
export class TransientArrayService {
|
|
14
|
+
/** Maps a `(contract address, slot)` key to the serialized elements stored there. */
|
|
15
|
+
#arrays: Map<string, Fr[][]> = new Map();
|
|
16
|
+
|
|
17
|
+
#key(contractAddress: AztecAddress, slot: Fr): string {
|
|
18
|
+
return `${contractAddress.toString()}:${slot.toString()}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Returns all elements at the given key, or an empty array if uninitialized. */
|
|
22
|
+
readArrayAt(contractAddress: AztecAddress, slot: Fr): Fr[][] {
|
|
23
|
+
return this.#arrays.get(this.#key(contractAddress, slot)) ?? [];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#setArray(contractAddress: AztecAddress, slot: Fr, array: Fr[][]): void {
|
|
27
|
+
this.#arrays.set(this.#key(contractAddress, slot), array);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Returns the number of elements stored at the given key. */
|
|
31
|
+
len(contractAddress: AztecAddress, slot: Fr): number {
|
|
32
|
+
return this.readArrayAt(contractAddress, slot).length;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Appends an element and returns the new length. */
|
|
36
|
+
push(contractAddress: AztecAddress, slot: Fr, elements: Fr[]): number {
|
|
37
|
+
const array = this.readArrayAt(contractAddress, slot);
|
|
38
|
+
array.push(elements);
|
|
39
|
+
this.#setArray(contractAddress, slot, array);
|
|
40
|
+
return array.length;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Removes and returns the last element. Throws if empty. */
|
|
44
|
+
pop(contractAddress: AztecAddress, slot: Fr): Fr[] {
|
|
45
|
+
const array = this.readArrayAt(contractAddress, slot);
|
|
46
|
+
if (array.length === 0) {
|
|
47
|
+
throw new Error(`Transient array at slot ${slot} is empty`);
|
|
48
|
+
}
|
|
49
|
+
const element = array.pop()!;
|
|
50
|
+
this.#setArray(contractAddress, slot, array);
|
|
51
|
+
return element;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Returns the element at the given index. Throws if out of bounds. */
|
|
55
|
+
get(contractAddress: AztecAddress, slot: Fr, index: number): Fr[] {
|
|
56
|
+
const array = this.readArrayAt(contractAddress, slot);
|
|
57
|
+
if (index < 0 || index >= array.length) {
|
|
58
|
+
throw new Error(
|
|
59
|
+
`Transient array index ${index} out of bounds for array of length ${array.length} at slot ${slot}`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return array[index];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Overwrites the element at the given index. Throws if out of bounds. */
|
|
66
|
+
set(contractAddress: AztecAddress, slot: Fr, index: number, value: Fr[]): void {
|
|
67
|
+
const array = this.readArrayAt(contractAddress, slot);
|
|
68
|
+
if (index < 0 || index >= array.length) {
|
|
69
|
+
throw new Error(
|
|
70
|
+
`Transient array index ${index} out of bounds for array of length ${array.length} at slot ${slot}`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
array[index] = value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Removes the element at the given index, shifting subsequent elements backward. Throws if out of bounds. */
|
|
77
|
+
remove(contractAddress: AztecAddress, slot: Fr, index: number): void {
|
|
78
|
+
const array = this.readArrayAt(contractAddress, slot);
|
|
79
|
+
if (index < 0 || index >= array.length) {
|
|
80
|
+
throw new Error(
|
|
81
|
+
`Transient array index ${index} out of bounds for array of length ${array.length} at slot ${slot}`,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
array.splice(index, 1);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Removes all elements at the given key. */
|
|
88
|
+
clear(contractAddress: AztecAddress, slot: Fr): void {
|
|
89
|
+
this.#arrays.delete(this.#key(contractAddress, slot));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -5,8 +5,8 @@ import type { NoteDao } from '@aztec/stdlib/note';
|
|
|
5
5
|
import type { ContractOverrides } from '@aztec/stdlib/tx';
|
|
6
6
|
|
|
7
7
|
import type { BlockSynchronizer } from '../block_synchronizer/block_synchronizer.js';
|
|
8
|
+
import type { ContractSyncService } from '../contract/contract_sync_service.js';
|
|
8
9
|
import type { ContractFunctionSimulator } from '../contract_function_simulator/contract_function_simulator.js';
|
|
9
|
-
import type { ContractSyncService } from '../contract_sync/contract_sync_service.js';
|
|
10
10
|
import type { NotesFilter } from '../notes_filter.js';
|
|
11
11
|
import type { AnchorBlockStore } from '../storage/index.js';
|
|
12
12
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
-
import { createStore } from '@aztec/kv-store/indexeddb';
|
|
4
3
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
5
4
|
import { WASMSimulator } from '@aztec/simulator/client';
|
|
5
|
+
import { getStandardAuthRegistry } from '@aztec/standard-contracts/auth-registry';
|
|
6
|
+
import { getStandardHandshakeRegistry } from '@aztec/standard-contracts/handshake-registry';
|
|
6
7
|
import { getStandardMultiCallEntrypoint } from '@aztec/standard-contracts/multi-call-entrypoint';
|
|
7
8
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
8
9
|
|
|
@@ -10,6 +11,7 @@ import type { PXEConfig } from '../../../config/index.js';
|
|
|
10
11
|
import { PXE } from '../../../pxe.js';
|
|
11
12
|
import { PXE_DATA_SCHEMA_VERSION } from '../../../storage/metadata.js';
|
|
12
13
|
import { type PXECreationOptions, isPrivateKernelProver } from '../../pxe_creation_options.js';
|
|
14
|
+
import { openBrowserStore } from '../store.js';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Create and start an PXE instance with the given AztecNode.
|
|
@@ -29,16 +31,28 @@ export async function createPXE(
|
|
|
29
31
|
const actor = options.loggerActorLabel;
|
|
30
32
|
const loggers = options.loggers ?? {};
|
|
31
33
|
|
|
32
|
-
const l1ContractAddresses = await aztecNode.
|
|
34
|
+
const { l1ChainId, l1ContractAddresses, rollupVersion } = await aztecNode.getNodeInfo();
|
|
33
35
|
const configWithContracts = {
|
|
34
36
|
...config,
|
|
35
37
|
...l1ContractAddresses,
|
|
38
|
+
l1ChainId,
|
|
39
|
+
rollupVersion,
|
|
36
40
|
} as PXEConfig;
|
|
37
41
|
|
|
38
|
-
const storeLogger = loggers.store ?? createLogger('pxe:data
|
|
42
|
+
const storeLogger = loggers.store ?? createLogger('pxe:data', { actor });
|
|
39
43
|
|
|
40
44
|
const store =
|
|
41
|
-
options.store ??
|
|
45
|
+
options.store ??
|
|
46
|
+
(await openBrowserStore(
|
|
47
|
+
'pxe_data',
|
|
48
|
+
PXE_DATA_SCHEMA_VERSION,
|
|
49
|
+
{
|
|
50
|
+
l1ChainId,
|
|
51
|
+
rollupAddress: l1ContractAddresses.rollupAddress,
|
|
52
|
+
dataStoreMapSizeKb: configWithContracts.dataStoreMapSizeKb,
|
|
53
|
+
},
|
|
54
|
+
storeLogger,
|
|
55
|
+
));
|
|
42
56
|
|
|
43
57
|
const simulator = options.simulator ?? new WASMSimulator();
|
|
44
58
|
const proverLogger = loggers.prover ?? createLogger('pxe:bb:wasm:bundle', { actor });
|
|
@@ -51,12 +65,17 @@ export async function createPXE(
|
|
|
51
65
|
}
|
|
52
66
|
const protocolContractsProvider = new BundledProtocolContractsProvider();
|
|
53
67
|
const preloadedContractsProvider = options.preloadedContractsProvider ?? {
|
|
54
|
-
getPreloadedContracts: async () => [
|
|
68
|
+
getPreloadedContracts: async () => [
|
|
69
|
+
await getStandardMultiCallEntrypoint(),
|
|
70
|
+
await getStandardAuthRegistry(),
|
|
71
|
+
await getStandardHandshakeRegistry(),
|
|
72
|
+
],
|
|
55
73
|
};
|
|
56
74
|
|
|
57
75
|
const pxeLogger = loggers.pxe ?? createLogger('pxe:service', { actor });
|
|
58
76
|
const pxe = await PXE.create({
|
|
59
77
|
node: aztecNode,
|
|
78
|
+
nodeDebug: options.nodeDebug,
|
|
60
79
|
store,
|
|
61
80
|
proofCreator: prover,
|
|
62
81
|
simulator,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BBLazyPrivateKernelProver } from '@aztec/bb-prover/client/lazy';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
-
import { createStore } from '@aztec/kv-store/indexeddb';
|
|
4
3
|
import { LazyProtocolContractsProvider } from '@aztec/protocol-contracts/providers/lazy';
|
|
5
4
|
import { WASMSimulator } from '@aztec/simulator/client';
|
|
5
|
+
import { getStandardAuthRegistry } from '@aztec/standard-contracts/auth-registry/lazy';
|
|
6
|
+
import { getStandardHandshakeRegistry } from '@aztec/standard-contracts/handshake-registry/lazy';
|
|
6
7
|
import { getStandardMultiCallEntrypoint } from '@aztec/standard-contracts/multi-call-entrypoint/lazy';
|
|
7
8
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
8
9
|
|
|
@@ -10,6 +11,7 @@ import type { PXEConfig } from '../../../config/index.js';
|
|
|
10
11
|
import { PXE } from '../../../pxe.js';
|
|
11
12
|
import { PXE_DATA_SCHEMA_VERSION } from '../../../storage/metadata.js';
|
|
12
13
|
import { type PXECreationOptions, isPrivateKernelProver } from '../../pxe_creation_options.js';
|
|
14
|
+
import { openBrowserStore } from '../store.js';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Create and start an PXE instance with the given AztecNode.
|
|
@@ -27,18 +29,30 @@ export async function createPXE(
|
|
|
27
29
|
) {
|
|
28
30
|
const actor = options.loggerActorLabel;
|
|
29
31
|
|
|
30
|
-
const l1ContractAddresses = await aztecNode.
|
|
32
|
+
const { l1ChainId, l1ContractAddresses, rollupVersion } = await aztecNode.getNodeInfo();
|
|
31
33
|
const configWithContracts = {
|
|
32
34
|
...config,
|
|
33
35
|
...l1ContractAddresses,
|
|
36
|
+
l1ChainId,
|
|
37
|
+
rollupVersion,
|
|
34
38
|
} as PXEConfig;
|
|
35
39
|
|
|
36
40
|
const loggers = options.loggers ?? {};
|
|
37
41
|
|
|
38
|
-
const storeLogger = loggers.store ?? createLogger('pxe:data
|
|
42
|
+
const storeLogger = loggers.store ?? createLogger('pxe:data', { actor });
|
|
39
43
|
|
|
40
44
|
const store =
|
|
41
|
-
options.store ??
|
|
45
|
+
options.store ??
|
|
46
|
+
(await openBrowserStore(
|
|
47
|
+
'pxe_data',
|
|
48
|
+
PXE_DATA_SCHEMA_VERSION,
|
|
49
|
+
{
|
|
50
|
+
l1ChainId,
|
|
51
|
+
rollupAddress: l1ContractAddresses.rollupAddress,
|
|
52
|
+
dataStoreMapSizeKb: configWithContracts.dataStoreMapSizeKb,
|
|
53
|
+
},
|
|
54
|
+
storeLogger,
|
|
55
|
+
));
|
|
42
56
|
|
|
43
57
|
const simulator = options.simulator ?? new WASMSimulator();
|
|
44
58
|
const proverLogger = loggers.prover ?? createLogger('pxe:bb:wasm:bundle', { actor });
|
|
@@ -51,12 +65,17 @@ export async function createPXE(
|
|
|
51
65
|
}
|
|
52
66
|
const protocolContractsProvider = new LazyProtocolContractsProvider();
|
|
53
67
|
const preloadedContractsProvider = options.preloadedContractsProvider ?? {
|
|
54
|
-
getPreloadedContracts: async () => [
|
|
68
|
+
getPreloadedContracts: async () => [
|
|
69
|
+
await getStandardMultiCallEntrypoint(),
|
|
70
|
+
await getStandardAuthRegistry(),
|
|
71
|
+
await getStandardHandshakeRegistry(),
|
|
72
|
+
],
|
|
55
73
|
};
|
|
56
74
|
|
|
57
75
|
const pxeLogger = loggers.pxe ?? createLogger('pxe:service', { actor });
|
|
58
76
|
const pxe = await PXE.create({
|
|
59
77
|
node: aztecNode,
|
|
78
|
+
nodeDebug: options.nodeDebug,
|
|
60
79
|
store,
|
|
61
80
|
proofCreator: prover,
|
|
62
81
|
simulator,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import {
|
|
4
|
+
AztecSQLiteOPFSStore,
|
|
5
|
+
SqliteCorruptionError,
|
|
6
|
+
deleteStore,
|
|
7
|
+
storePoolDirectory,
|
|
8
|
+
} from '@aztec/kv-store/sqlite-opfs';
|
|
9
|
+
|
|
10
|
+
import { assertStoreIdentity, effectiveStoreName } from '../../storage/store_identity.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Opens the persistent browser (sqlite-opfs) store selected by `name` and identity `(config.l1ChainId,
|
|
14
|
+
* config.rollupAddress, schemaVersion)` triple. A store exists per identity: reopening with the same identity returns
|
|
15
|
+
* the same data, a different identity selects a different (possibly fresh) store.
|
|
16
|
+
*/
|
|
17
|
+
export async function openBrowserStore(
|
|
18
|
+
name: string,
|
|
19
|
+
schemaVersion: number,
|
|
20
|
+
config: { l1ChainId: number; rollupAddress: EthAddress; dataStoreMapSizeKb?: number },
|
|
21
|
+
log: Logger = createLogger('pxe:data'),
|
|
22
|
+
): Promise<AztecSQLiteOPFSStore> {
|
|
23
|
+
const identity = { l1ChainId: config.l1ChainId, rollupAddress: config.rollupAddress, schemaVersion };
|
|
24
|
+
const storeName = effectiveStoreName(name, identity);
|
|
25
|
+
log.info(`Creating ${storeName} SQLite-OPFS data store`, {
|
|
26
|
+
storeName,
|
|
27
|
+
dataStoreMapSizeKb: config.dataStoreMapSizeKb,
|
|
28
|
+
});
|
|
29
|
+
const openStore = () =>
|
|
30
|
+
AztecSQLiteOPFSStore.open(createLogger('kv-store:sqlite-opfs'), storeName, false, storePoolDirectory(storeName));
|
|
31
|
+
|
|
32
|
+
let store: AztecSQLiteOPFSStore;
|
|
33
|
+
try {
|
|
34
|
+
store = await openStore();
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (!(err instanceof SqliteCorruptionError)) {
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
39
|
+
// A corrupt image is unrecoverable — no retry against the same bytes helps. Wipe the store's OPFS directory
|
|
40
|
+
// (safe: the failed open left no SAH-pool lock behind) and reopen a fresh, empty one, so the browser self-heals
|
|
41
|
+
// into a normal first-run rather than dead-ending on "database disk image is malformed" every load.
|
|
42
|
+
log.warn(`${storeName} store is corrupt (${err.message}); wiping and reopening fresh`);
|
|
43
|
+
await deleteStore(storeName);
|
|
44
|
+
store = await openStore();
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
await assertStoreIdentity(store, storeName, identity);
|
|
48
|
+
} catch (err) {
|
|
49
|
+
// The store handle owns a worker and OPFS locks; release them before surfacing the refusal.
|
|
50
|
+
await store.close().catch(() => {});
|
|
51
|
+
throw err;
|
|
52
|
+
}
|
|
53
|
+
return store;
|
|
54
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { BBPrivateKernelProverOptions } from '@aztec/bb-prover/client';
|
|
|
2
2
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
3
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
4
4
|
import type { CircuitSimulator } from '@aztec/simulator/client';
|
|
5
|
-
import type { PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
5
|
+
import type { AztecNodeDebug, PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
6
6
|
|
|
7
7
|
import type { ExecutionHooks } from '../hooks/index.js';
|
|
8
8
|
import type { PreloadedContractsProvider } from '../pxe.js';
|
|
@@ -16,8 +16,14 @@ export type PXECreationOptions = {
|
|
|
16
16
|
simulator?: CircuitSimulator;
|
|
17
17
|
/** Optional hooks to observe and influence contract execution. */
|
|
18
18
|
hooks?: ExecutionHooks;
|
|
19
|
-
/** Contracts to preload
|
|
19
|
+
/** Contracts to preload on startup. Replaces the default when set. */
|
|
20
20
|
preloadedContractsProvider?: PreloadedContractsProvider;
|
|
21
|
+
/**
|
|
22
|
+
* Optional debug API client for the same node. When provided, public function signatures are registered so the
|
|
23
|
+
* node can produce named public-execution stack traces. Only available on nodes started with debug endpoints
|
|
24
|
+
* enabled; omitted in prod-like setups.
|
|
25
|
+
*/
|
|
26
|
+
nodeDebug?: AztecNodeDebug;
|
|
21
27
|
};
|
|
22
28
|
|
|
23
29
|
/** Checks if the given value implements the PrivateKernelProver interface via duck-typing. */
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
export { type AccountPrivacyKeys, type AccountPrivacySecretKeys } from '@aztec/key-store';
|
|
2
|
+
|
|
1
3
|
export * from '../../notes_filter.js';
|
|
2
4
|
export * from '../../pxe.js';
|
|
3
|
-
export * from '../../hooks/index.js';
|
|
4
5
|
export * from '../../config/index.js';
|
|
5
6
|
export * from '../../error_enriching.js';
|
|
6
7
|
export * from '../../storage/index.js';
|
|
7
8
|
export * from './utils.js';
|
|
9
|
+
export * from './store.js';
|
|
8
10
|
export { NoteService } from '../../notes/note_service.js';
|
|
9
11
|
export { ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR } from '../../oracle_version.js';
|
|
10
12
|
export { type PXECreationOptions } from '../pxe_creation_options.js';
|
|
11
13
|
export { JobCoordinator } from '../../job_coordinator/job_coordinator.js';
|
|
12
|
-
export { ContractSyncService } from '../../
|
|
14
|
+
export { ContractSyncService } from '../../contract/contract_sync_service.js';
|
|
15
|
+
export { ContractClassService } from '../../contract/contract_class_service.js';
|
|
16
|
+
export { AnchoredContractData } from '../../contract_function_simulator/anchored_contract_data.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import { type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import { type AztecLMDBStoreV2, openStoreAt } from '@aztec/kv-store/lmdb-v2';
|
|
4
|
+
|
|
5
|
+
import { mkdir } from 'fs/promises';
|
|
6
|
+
import { join } from 'path';
|
|
7
|
+
|
|
8
|
+
import { storeIdentitySlug } from '../../storage/store_identity.js';
|
|
9
|
+
|
|
10
|
+
/** Location and identity inputs for opening an identity-partitioned PXE-side store. */
|
|
11
|
+
export type IdentityStoreConfig = {
|
|
12
|
+
dataDirectory: string;
|
|
13
|
+
/** Maximum LMDB map size in KB. When omitted, the kv-store default map size applies. */
|
|
14
|
+
dataStoreMapSizeKb?: number;
|
|
15
|
+
l1ChainId: number;
|
|
16
|
+
rollupAddress: EthAddress;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Opens the persistent LMDB store selected by `name` and identity triple `(l1ChainId, rollupAddress, schemaVersion)`.
|
|
21
|
+
* A store exists per identity: reopening with the same identity returns the same data, a different identity selects
|
|
22
|
+
* a different (possibly fresh) store. Callers wanting an ephemeral store use `openTmpStore` explicitly instead.
|
|
23
|
+
*/
|
|
24
|
+
export async function openStore(
|
|
25
|
+
name: string,
|
|
26
|
+
schemaVersion: number,
|
|
27
|
+
config: IdentityStoreConfig,
|
|
28
|
+
bindings?: LoggerBindings,
|
|
29
|
+
): Promise<AztecLMDBStoreV2> {
|
|
30
|
+
// Stores live under `<dataDirectory>/<name>-stores/<l1ChainId>-<rollupAddress>-v<schemaVersion>`, a sibling of the
|
|
31
|
+
// legacy `<dataDirectory>/<name>` directory: older binaries reset the legacy directory on a rollup mismatch, so
|
|
32
|
+
// per-identity stores must not nest inside it.
|
|
33
|
+
const subDir = join(
|
|
34
|
+
config.dataDirectory,
|
|
35
|
+
`${name}-stores`,
|
|
36
|
+
storeIdentitySlug({ l1ChainId: config.l1ChainId, rollupAddress: config.rollupAddress, schemaVersion }),
|
|
37
|
+
);
|
|
38
|
+
await mkdir(subDir, { recursive: true });
|
|
39
|
+
|
|
40
|
+
createLogger(`pxe:data:${name}`, bindings).info(`Opening ${name} data store (LMDB v2)`, {
|
|
41
|
+
storeName: name,
|
|
42
|
+
subDir,
|
|
43
|
+
dataStoreMapSizeKb: config.dataStoreMapSizeKb,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return openStoreAt(subDir, config.dataStoreMapSizeKb, undefined, bindings);
|
|
47
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
|
|
2
2
|
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
-
import {
|
|
4
|
+
import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
5
5
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
6
|
-
import {
|
|
6
|
+
import { WASMSimulator } from '@aztec/simulator/client';
|
|
7
|
+
import { MemoryCircuitRecorder, SimulatorRecorderWrapper } from '@aztec/simulator/server';
|
|
7
8
|
import { FileCircuitRecorder } from '@aztec/simulator/testing';
|
|
9
|
+
import { getStandardAuthRegistry } from '@aztec/standard-contracts/auth-registry';
|
|
10
|
+
import { getStandardHandshakeRegistry } from '@aztec/standard-contracts/handshake-registry';
|
|
8
11
|
import { getStandardMultiCallEntrypoint } from '@aztec/standard-contracts/multi-call-entrypoint';
|
|
9
12
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
10
13
|
|
|
@@ -12,6 +15,7 @@ import type { PXEConfig } from '../../config/index.js';
|
|
|
12
15
|
import { PXE } from '../../pxe.js';
|
|
13
16
|
import { PXE_DATA_SCHEMA_VERSION } from '../../storage/index.js';
|
|
14
17
|
import { type PXECreationOptions, isPrivateKernelProver } from '../pxe_creation_options.js';
|
|
18
|
+
import { openStore } from './store.js';
|
|
15
19
|
|
|
16
20
|
type PXEConfigWithoutDefaults = Omit<
|
|
17
21
|
PXEConfig,
|
|
@@ -43,12 +47,25 @@ export async function createPXE(
|
|
|
43
47
|
|
|
44
48
|
if (!options.store) {
|
|
45
49
|
const storeLogger = loggers.store ?? createLogger('pxe:data:lmdb', { actor });
|
|
46
|
-
options.store =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
options.store = configWithContracts.dataDirectory
|
|
51
|
+
? await openStore(
|
|
52
|
+
'pxe_data',
|
|
53
|
+
PXE_DATA_SCHEMA_VERSION,
|
|
54
|
+
{
|
|
55
|
+
dataDirectory: configWithContracts.dataDirectory,
|
|
56
|
+
dataStoreMapSizeKb: configWithContracts.dataStoreMapSizeKb,
|
|
57
|
+
l1ChainId,
|
|
58
|
+
rollupAddress: l1ContractAddresses.rollupAddress,
|
|
59
|
+
},
|
|
60
|
+
storeLogger.getBindings(),
|
|
61
|
+
)
|
|
62
|
+
: await openTmpStore(
|
|
63
|
+
'pxe_data',
|
|
64
|
+
true,
|
|
65
|
+
configWithContracts.dataStoreMapSizeKb,
|
|
66
|
+
undefined,
|
|
67
|
+
storeLogger.getBindings(),
|
|
68
|
+
);
|
|
52
69
|
}
|
|
53
70
|
const proverLogger = loggers.prover ?? createLogger('pxe:bb:native', { actor });
|
|
54
71
|
|
|
@@ -61,12 +78,17 @@ export async function createPXE(
|
|
|
61
78
|
|
|
62
79
|
const protocolContractsProvider = new BundledProtocolContractsProvider();
|
|
63
80
|
const preloadedContractsProvider = options.preloadedContractsProvider ?? {
|
|
64
|
-
getPreloadedContracts: async () => [
|
|
81
|
+
getPreloadedContracts: async () => [
|
|
82
|
+
await getStandardMultiCallEntrypoint(),
|
|
83
|
+
await getStandardAuthRegistry(),
|
|
84
|
+
await getStandardHandshakeRegistry(),
|
|
85
|
+
],
|
|
65
86
|
};
|
|
66
87
|
|
|
67
88
|
const pxeLogger = loggers.pxe ?? createLogger('pxe:service', { actor });
|
|
68
89
|
const pxe = await PXE.create({
|
|
69
90
|
node: aztecNode,
|
|
91
|
+
nodeDebug: options.nodeDebug,
|
|
70
92
|
store: options.store,
|
|
71
93
|
proofCreator: prover,
|
|
72
94
|
simulator,
|
package/src/error_enriching.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { resolveAssertionMessageFromRevertData, resolveOpcodeLocations } from '@
|
|
|
3
3
|
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
5
|
import { type SimulationError, isNoirCallStackUnresolved } from '@aztec/stdlib/errors';
|
|
6
|
+
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
6
7
|
|
|
8
|
+
import type { ContractClassService } from './contract/contract_class_service.js';
|
|
7
9
|
import type { ContractStore } from './storage/contract_store/contract_store.js';
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -11,7 +13,13 @@ import type { ContractStore } from './storage/contract_store/contract_store.js';
|
|
|
11
13
|
* can be found in the PXE database
|
|
12
14
|
* @param err - The error to enrich.
|
|
13
15
|
*/
|
|
14
|
-
export async function enrichSimulationError(
|
|
16
|
+
export async function enrichSimulationError(
|
|
17
|
+
err: SimulationError,
|
|
18
|
+
contractStore: ContractStore,
|
|
19
|
+
contractClassService: ContractClassService,
|
|
20
|
+
anchorHeader: BlockHeader,
|
|
21
|
+
logger: Logger,
|
|
22
|
+
) {
|
|
15
23
|
// Maps contract addresses to the set of function selectors that were in error.
|
|
16
24
|
// Map and Set do reference equality for their keys instead of value equality, so we store the string
|
|
17
25
|
// representation to get e.g. different contract address objects with the same address value to match.
|
|
@@ -29,14 +37,15 @@ export async function enrichSimulationError(err: SimulationError, contractStore:
|
|
|
29
37
|
|
|
30
38
|
await Promise.all(
|
|
31
39
|
[...mentionedFunctions.entries()].map(async ([contractAddress, fnSelectors]) => {
|
|
32
|
-
const parsedContractAddress = AztecAddress.
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
const parsedContractAddress = AztecAddress.fromStringUnsafe(contractAddress);
|
|
41
|
+
const classId = await contractClassService.getCurrentClassId(parsedContractAddress, anchorHeader);
|
|
42
|
+
const artifact = classId && (await contractStore.getContractArtifact(classId));
|
|
43
|
+
if (artifact) {
|
|
44
|
+
err.enrichWithContractName(parsedContractAddress, artifact.name);
|
|
36
45
|
// Map from function selector to function name. It uses a stringified key for the same reason as mentionedFunctions.
|
|
37
46
|
const selectorToNameMap: Map<string, string> = new Map();
|
|
38
47
|
await Promise.all(
|
|
39
|
-
|
|
48
|
+
artifact.functions.map(async fn => {
|
|
40
49
|
const selector = await FunctionSelector.fromNameAndParameters(fn);
|
|
41
50
|
selectorToNameMap.set(selector.toString(), fn.name);
|
|
42
51
|
}),
|
|
@@ -51,7 +60,7 @@ export async function enrichSimulationError(err: SimulationError, contractStore:
|
|
|
51
60
|
);
|
|
52
61
|
} else {
|
|
53
62
|
logger.warn(
|
|
54
|
-
`Could not find function artifact in contract ${
|
|
63
|
+
`Could not find function artifact in contract ${artifact.name} for function '${fnSelector}' when enriching error callstack`,
|
|
55
64
|
);
|
|
56
65
|
}
|
|
57
66
|
}
|
|
@@ -64,7 +73,13 @@ export async function enrichSimulationError(err: SimulationError, contractStore:
|
|
|
64
73
|
);
|
|
65
74
|
}
|
|
66
75
|
|
|
67
|
-
export async function enrichPublicSimulationError(
|
|
76
|
+
export async function enrichPublicSimulationError(
|
|
77
|
+
err: SimulationError,
|
|
78
|
+
contractStore: ContractStore,
|
|
79
|
+
contractClassService: ContractClassService,
|
|
80
|
+
anchorHeader: BlockHeader,
|
|
81
|
+
logger: Logger,
|
|
82
|
+
) {
|
|
68
83
|
const callStack = err.getCallStack();
|
|
69
84
|
const originalFailingFunction = callStack[callStack.length - 1];
|
|
70
85
|
|
|
@@ -72,7 +87,8 @@ export async function enrichPublicSimulationError(err: SimulationError, contract
|
|
|
72
87
|
throw new Error(`Original failing function not found when enriching public simulation, missing callstack`);
|
|
73
88
|
}
|
|
74
89
|
|
|
75
|
-
const
|
|
90
|
+
const classId = await contractClassService.getCurrentClassId(originalFailingFunction.contractAddress, anchorHeader);
|
|
91
|
+
const artifact = classId && (await contractStore.getPublicFunctionArtifact(classId));
|
|
76
92
|
if (!artifact) {
|
|
77
93
|
throw new Error(
|
|
78
94
|
`Artifact not found when enriching public simulation error. Contract address: ${originalFailingFunction.contractAddress}.`,
|
|
@@ -84,7 +100,7 @@ export async function enrichPublicSimulationError(err: SimulationError, contract
|
|
|
84
100
|
err.setOriginalMessage(err.getOriginalMessage() + `${assertionMessage}`);
|
|
85
101
|
}
|
|
86
102
|
|
|
87
|
-
const debugInfo = await contractStore.getPublicFunctionDebugMetadata(
|
|
103
|
+
const debugInfo = await contractStore.getPublicFunctionDebugMetadata(classId);
|
|
88
104
|
|
|
89
105
|
const noirCallStack = err.getNoirCallStack();
|
|
90
106
|
if (debugInfo) {
|
|
@@ -102,6 +118,6 @@ export async function enrichPublicSimulationError(err: SimulationError, contract
|
|
|
102
118
|
);
|
|
103
119
|
}
|
|
104
120
|
}
|
|
105
|
-
await enrichSimulationError(err, contractStore, logger);
|
|
121
|
+
await enrichSimulationError(err, contractStore, contractClassService, anchorHeader, logger);
|
|
106
122
|
}
|
|
107
123
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { AuthorizeUtilityCall } from './authorize_utility_call.js';
|
|
2
|
+
import type { ResolveCustomRequest } from './resolve_custom_request.js';
|
|
3
|
+
import type { ResolveTaggingSecretStrategy } from './resolve_tagging_secret_strategy.js';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
|
-
* Hooks that PXE invokes during client-side simulation to gate operations that the protocol
|
|
6
|
+
* Hooks that PXE invokes during client-side simulation to gate or steer operations that the protocol
|
|
5
7
|
* does not restrict on its own. They give the wallet a chance to apply custom policies (e.g.
|
|
6
8
|
* prompting the user, consulting a dynamic allowlist, or inspecting call arguments) before the
|
|
7
|
-
* execution proceeds.
|
|
9
|
+
* execution proceeds. All hooks are optional, and when a hook is absent PXE applies a safe default.
|
|
8
10
|
*
|
|
9
|
-
* For example, {@link authorizeUtilityCall} is called whenever a utility function makes a
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* For example, {@link authorizeUtilityCall} is called whenever a utility function makes a cross-contract call. A call
|
|
12
|
+
* made by a malicious contract could leak private information, so the hook lets the wallet decide, per-call, whether
|
|
13
|
+
* to allow it. A static allowlist would not work here because neither the app nor the wallet can predict ahead of
|
|
14
|
+
* time which contracts will be invoked during execution. Calls to standard contracts (such as the HandshakeRegistry)
|
|
15
|
+
* bypass this hook and are always authorized. When the hook is absent, cross-contract utility calls are denied.
|
|
14
16
|
*
|
|
15
17
|
* Note: hooks are unrelated to authentication witnesses (authwits). Authwits are an on-chain
|
|
16
18
|
* mechanism where a contract verifies that a caller was authorized by a specific account; hooks
|
|
@@ -27,22 +29,40 @@ import type { AuthorizeUtilityCall } from './authorize_utility_call.js';
|
|
|
27
29
|
* ? { authorized: true }
|
|
28
30
|
* : { authorized: false, reason: 'Unknown target' };
|
|
29
31
|
* },
|
|
32
|
+
* // Apply per-recipient policy: reach a known contact via their address keys (no onchain trace) and use a
|
|
33
|
+
* // non-interactive handshake for everyone else.
|
|
34
|
+
* resolveTaggingSecretStrategy: async ({ recipient }) =>
|
|
35
|
+
* knownContacts.has(recipient.toString())
|
|
36
|
+
* ? { type: 'address-derived' }
|
|
37
|
+
* : { type: 'non-interactive-handshake' },
|
|
30
38
|
* },
|
|
31
39
|
* });
|
|
32
40
|
* ```
|
|
33
41
|
*/
|
|
34
42
|
export interface ExecutionHooks {
|
|
35
|
-
/** Called when a contract attempts a cross-contract utility call. */
|
|
36
|
-
authorizeUtilityCall
|
|
43
|
+
/** Called when a contract attempts a cross-contract utility call. Calls are denied when absent. */
|
|
44
|
+
authorizeUtilityCall?: AuthorizeUtilityCall;
|
|
45
|
+
/**
|
|
46
|
+
* Resolves a message's tagging secret when none is already established for the sender/recipient pair, letting the
|
|
47
|
+
* wallet apply per-recipient policy. PXE applies a default when absent.
|
|
48
|
+
* See {@link ResolveTaggingSecretStrategy} for the request shape and defaults.
|
|
49
|
+
*/
|
|
50
|
+
resolveTaggingSecretStrategy?: ResolveTaggingSecretStrategy;
|
|
51
|
+
/**
|
|
52
|
+
* Resolves a custom, caller-defined request a circuit cannot serve from local state. Any contract can issue one, so
|
|
53
|
+
* an implementor should verify both the request `kind` and the issuing contract (its address and class ID) before
|
|
54
|
+
* fulfilling it. Rejected when absent; see {@link ResolveCustomRequest}.
|
|
55
|
+
*/
|
|
56
|
+
resolveCustomRequest?: ResolveCustomRequest;
|
|
37
57
|
}
|
|
38
58
|
|
|
39
59
|
/**
|
|
40
60
|
* Builds an {@link ExecutionHooks} from individually-constructed hook callbacks. Returns `undefined`
|
|
41
61
|
* when every field is absent, so callers can unconditionally pass the result as `hooks`.
|
|
42
62
|
*/
|
|
43
|
-
export function composeHooks(
|
|
44
|
-
if (Object.values(
|
|
63
|
+
export function composeHooks(hooks: ExecutionHooks): ExecutionHooks | undefined {
|
|
64
|
+
if (Object.values(hooks).every(v => v === undefined)) {
|
|
45
65
|
return undefined;
|
|
46
66
|
}
|
|
47
|
-
return
|
|
67
|
+
return hooks;
|
|
48
68
|
}
|