@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
package/dest/pxe.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { Point } from '@aztec/foundation/curves/grumpkin';
|
|
2
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
4
|
import { SerialQueue } from '@aztec/foundation/queue';
|
|
4
5
|
import { Timer } from '@aztec/foundation/timer';
|
|
5
6
|
import { protocolContractNames } from '@aztec/protocol-contracts';
|
|
6
7
|
import { FunctionType, decodeFunctionSignature } from '@aztec/stdlib/abi';
|
|
7
8
|
import { GENESIS_BLOCK_HEADER_HASH } from '@aztec/stdlib/block';
|
|
8
|
-
import { computeContractAddressFromInstance
|
|
9
|
+
import { computeContractAddressFromInstance } from '@aztec/stdlib/contract';
|
|
9
10
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
11
|
+
import { computeAddressSecret } from '@aztec/stdlib/keys';
|
|
12
|
+
import { deriveEcdhSharedSecretPoint, protectFromForgery } from '@aztec/stdlib/logs';
|
|
10
13
|
import { PrivateSimulationResult, TxProfileResult, TxProvingResult, TxSimulationResult } from '@aztec/stdlib/tx';
|
|
11
14
|
import { inspect } from 'util';
|
|
12
15
|
import { BlockSynchronizer } from './block_synchronizer/index.js';
|
|
16
|
+
import { ContractClassService } from './contract/contract_class_service.js';
|
|
17
|
+
import { ContractSyncService } from './contract/contract_sync_service.js';
|
|
13
18
|
import { BenchmarkedNodeFactory } from './contract_function_simulator/benchmarked_node.js';
|
|
14
19
|
import { ContractFunctionSimulator, generateSimulatedProvingResult } from './contract_function_simulator/contract_function_simulator.js';
|
|
15
|
-
import { ProxiedContractStoreFactory } from './contract_function_simulator/proxied_contract_data_source.js';
|
|
16
20
|
import { displayDebugLogs } from './contract_logging.js';
|
|
17
|
-
import { ContractSyncService } from './contract_sync/contract_sync_service.js';
|
|
18
|
-
import { readCurrentClassId } from './contract_sync/helpers.js';
|
|
19
21
|
import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
|
|
20
22
|
import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
|
|
21
23
|
import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
|
|
22
24
|
import { JobCoordinator } from './job_coordinator/job_coordinator.js';
|
|
23
|
-
import {
|
|
25
|
+
import { TxResolverService } from './messages/tx_resolver_service.js';
|
|
24
26
|
import { PrivateKernelExecutionProver } from './private_kernel/private_kernel_execution_prover.js';
|
|
25
27
|
import { PrivateKernelOracle } from './private_kernel/private_kernel_oracle.js';
|
|
26
28
|
import { openPxeStores } from './storage/open_pxe_stores.js';
|
|
@@ -30,20 +32,23 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
30
32
|
* manage private state of users.
|
|
31
33
|
*/ export class PXE {
|
|
32
34
|
node;
|
|
35
|
+
nodeDebug;
|
|
33
36
|
db;
|
|
34
37
|
blockStateSynchronizer;
|
|
35
38
|
keyStore;
|
|
36
39
|
contractStore;
|
|
37
40
|
noteStore;
|
|
38
41
|
capsuleStore;
|
|
42
|
+
factStore;
|
|
39
43
|
anchorBlockStore;
|
|
40
44
|
senderTaggingStore;
|
|
41
|
-
|
|
45
|
+
taggingSecretSourcesStore;
|
|
42
46
|
recipientTaggingStore;
|
|
43
47
|
addressStore;
|
|
44
48
|
privateEventStore;
|
|
45
49
|
contractSyncService;
|
|
46
|
-
|
|
50
|
+
contractClassService;
|
|
51
|
+
txResolver;
|
|
47
52
|
l2TipsStore;
|
|
48
53
|
simulator;
|
|
49
54
|
proverEnabled;
|
|
@@ -56,22 +61,25 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
56
61
|
jobCoordinator;
|
|
57
62
|
debug;
|
|
58
63
|
hooks;
|
|
59
|
-
constructor(node, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore,
|
|
64
|
+
constructor(node, nodeDebug, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, factStore, anchorBlockStore, senderTaggingStore, taggingSecretSourcesStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, contractClassService, txResolver, l2TipsStore, simulator, proverEnabled, autoSync, proofCreator, protocolContractsProvider, preloadedContractsProvider, log, jobQueue, jobCoordinator, debug, hooks){
|
|
60
65
|
this.node = node;
|
|
66
|
+
this.nodeDebug = nodeDebug;
|
|
61
67
|
this.db = db;
|
|
62
68
|
this.blockStateSynchronizer = blockStateSynchronizer;
|
|
63
69
|
this.keyStore = keyStore;
|
|
64
70
|
this.contractStore = contractStore;
|
|
65
71
|
this.noteStore = noteStore;
|
|
66
72
|
this.capsuleStore = capsuleStore;
|
|
73
|
+
this.factStore = factStore;
|
|
67
74
|
this.anchorBlockStore = anchorBlockStore;
|
|
68
75
|
this.senderTaggingStore = senderTaggingStore;
|
|
69
|
-
this.
|
|
76
|
+
this.taggingSecretSourcesStore = taggingSecretSourcesStore;
|
|
70
77
|
this.recipientTaggingStore = recipientTaggingStore;
|
|
71
78
|
this.addressStore = addressStore;
|
|
72
79
|
this.privateEventStore = privateEventStore;
|
|
73
80
|
this.contractSyncService = contractSyncService;
|
|
74
|
-
this.
|
|
81
|
+
this.contractClassService = contractClassService;
|
|
82
|
+
this.txResolver = txResolver;
|
|
75
83
|
this.l2TipsStore = l2TipsStore;
|
|
76
84
|
this.simulator = simulator;
|
|
77
85
|
this.proverEnabled = proverEnabled;
|
|
@@ -91,7 +99,7 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
91
99
|
* can be contacted.
|
|
92
100
|
*
|
|
93
101
|
* @returns A promise that resolves PXE is ready to be used.
|
|
94
|
-
*/ static async create({ node, store, proofCreator, simulator, protocolContractsProvider, preloadedContractsProvider, config, loggerOrSuffix, hooks }) {
|
|
102
|
+
*/ static async create({ node, nodeDebug, store, proofCreator, simulator, protocolContractsProvider, preloadedContractsProvider, config, loggerOrSuffix, hooks }) {
|
|
95
103
|
// Extract bindings from the logger, or use empty bindings if a string suffix is provided.
|
|
96
104
|
const bindings = loggerOrSuffix && typeof loggerOrSuffix !== 'string' ? loggerOrSuffix.getBindings() : undefined;
|
|
97
105
|
const log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:service:${loggerOrSuffix}` : `pxe:service`) : loggerOrSuffix;
|
|
@@ -104,10 +112,11 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
104
112
|
// not return a genesis block (older node or test fixture) we fall back to the static constant.
|
|
105
113
|
const initialBlockHash = (await node.getBlock(BlockNumber.ZERO))?.hash ?? GENESIS_BLOCK_HEADER_HASH;
|
|
106
114
|
const proverEnabled = config.proverEnabled !== undefined ? config.proverEnabled : info.realProofs;
|
|
107
|
-
const { addressStore, privateEventStore, contractStore, noteStore, anchorBlockStore, senderTaggingStore,
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
const
|
|
115
|
+
const { addressStore, privateEventStore, contractStore, noteStore, anchorBlockStore, senderTaggingStore, taggingSecretSourcesStore, recipientTaggingStore, capsuleStore, keyStore, l2TipsStore, factStore } = openPxeStores(store, initialBlockHash);
|
|
116
|
+
const contractClassService = new ContractClassService(node, contractStore);
|
|
117
|
+
const contractSyncService = new ContractSyncService(node, contractStore, contractClassService, noteStore, createLogger('pxe:contract_sync', bindings));
|
|
118
|
+
const txResolver = new TxResolverService(node);
|
|
119
|
+
const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, factStore, l2TipsStore, contractSyncService, contractClassService, config, bindings);
|
|
111
120
|
const jobCoordinator = new JobCoordinator(store, bindings);
|
|
112
121
|
jobCoordinator.registerStores([
|
|
113
122
|
capsuleStore,
|
|
@@ -115,11 +124,12 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
115
124
|
recipientTaggingStore,
|
|
116
125
|
privateEventStore,
|
|
117
126
|
noteStore,
|
|
127
|
+
factStore,
|
|
118
128
|
contractSyncService
|
|
119
129
|
]);
|
|
120
130
|
const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
|
|
121
131
|
const jobQueue = new SerialQueue();
|
|
122
|
-
const pxe = new PXE(node, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore,
|
|
132
|
+
const pxe = new PXE(node, nodeDebug, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, factStore, anchorBlockStore, senderTaggingStore, taggingSecretSourcesStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, contractClassService, txResolver, l2TipsStore, simulator, proverEnabled, config.autoSync, proofCreator, protocolContractsProvider, preloadedContractsProvider, log, jobQueue, jobCoordinator, debugUtils, hooks);
|
|
123
133
|
debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#executeUtility.bind(pxe));
|
|
124
134
|
pxe.jobQueue.start();
|
|
125
135
|
await Promise.all([
|
|
@@ -131,9 +141,10 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
131
141
|
}
|
|
132
142
|
// Internal methods
|
|
133
143
|
#getSimulatorForTx(overrides) {
|
|
134
|
-
const proxyContractStore = ProxiedContractStoreFactory.create(this.contractStore, overrides?.contracts);
|
|
135
144
|
return new ContractFunctionSimulator({
|
|
136
|
-
contractStore:
|
|
145
|
+
contractStore: this.contractStore,
|
|
146
|
+
contractClassService: this.contractClassService,
|
|
147
|
+
overrides: overrides?.contracts,
|
|
137
148
|
noteStore: this.noteStore,
|
|
138
149
|
keyStore: this.keyStore,
|
|
139
150
|
addressStore: this.addressStore,
|
|
@@ -141,15 +152,32 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
141
152
|
l2TipsStore: this.l2TipsStore,
|
|
142
153
|
senderTaggingStore: this.senderTaggingStore,
|
|
143
154
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
144
|
-
|
|
155
|
+
taggingSecretSourcesStore: this.taggingSecretSourcesStore,
|
|
145
156
|
capsuleStore: this.capsuleStore,
|
|
157
|
+
factStore: this.factStore,
|
|
146
158
|
privateEventStore: this.privateEventStore,
|
|
147
159
|
simulator: this.simulator,
|
|
148
160
|
contractSyncService: this.contractSyncService,
|
|
149
|
-
|
|
161
|
+
txResolver: this.txResolver,
|
|
150
162
|
hooks: this.hooks
|
|
151
163
|
});
|
|
152
164
|
}
|
|
165
|
+
/** Best-effort debug function name for the class `address` runs at `anchorBlockHeader`. Used for log display only. */ async #getDebugFunctionName(address, selector, anchorBlockHeader) {
|
|
166
|
+
try {
|
|
167
|
+
const classId = await this.contractClassService.getCurrentClassId(address, anchorBlockHeader);
|
|
168
|
+
return classId ? await this.contractStore.getDebugFunctionName(classId, selector) : `${address}:${selector}`;
|
|
169
|
+
} catch {
|
|
170
|
+
return `${address}:${selector}`;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/** Best-effort debug contract name for the class `address` runs at `anchorBlockHeader`. Used for log display only. */ async #getDebugContractName(address, anchorBlockHeader) {
|
|
174
|
+
try {
|
|
175
|
+
const classId = await this.contractClassService.getCurrentClassId(address, anchorBlockHeader);
|
|
176
|
+
return classId ? await this.contractStore.getDebugContractName(classId) : undefined;
|
|
177
|
+
} catch {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
153
181
|
#contextualizeError(err, ...context) {
|
|
154
182
|
let contextStr = '';
|
|
155
183
|
if (context.length > 0) {
|
|
@@ -202,10 +230,12 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
202
230
|
}
|
|
203
231
|
async #registerPreloadedContracts() {
|
|
204
232
|
const contracts = await this.preloadedContractsProvider.getPreloadedContracts();
|
|
205
|
-
await Promise.all(contracts.map(({ instance, artifact })=>
|
|
206
|
-
|
|
207
|
-
artifact
|
|
208
|
-
}
|
|
233
|
+
await Promise.all(contracts.map(async ({ instance, artifact })=>{
|
|
234
|
+
if (artifact) {
|
|
235
|
+
await this.registerContractClass(artifact);
|
|
236
|
+
}
|
|
237
|
+
await this.registerContract(instance);
|
|
238
|
+
}));
|
|
209
239
|
this.log.verbose(`Registered preloaded contracts in pxe`, {
|
|
210
240
|
contracts: contracts.map(({ instance })=>instance.address.toString())
|
|
211
241
|
});
|
|
@@ -217,8 +247,6 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
217
247
|
try {
|
|
218
248
|
await this.contractSyncService.ensureContractSynced(contractAddress, functionSelector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
|
|
219
249
|
const result = await contractFunctionSimulator.run(txRequest, {
|
|
220
|
-
contractAddress,
|
|
221
|
-
selector: functionSelector,
|
|
222
250
|
anchorBlockHeader,
|
|
223
251
|
scopes,
|
|
224
252
|
jobId,
|
|
@@ -228,7 +256,7 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
228
256
|
return result;
|
|
229
257
|
} catch (err) {
|
|
230
258
|
if (err instanceof SimulationError) {
|
|
231
|
-
await enrichSimulationError(err, this.contractStore, this.log);
|
|
259
|
+
await enrichSimulationError(err, this.contractStore, this.contractClassService, anchorBlockHeader, this.log);
|
|
232
260
|
}
|
|
233
261
|
throw err;
|
|
234
262
|
}
|
|
@@ -252,7 +280,8 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
252
280
|
};
|
|
253
281
|
} catch (err) {
|
|
254
282
|
if (err instanceof SimulationError) {
|
|
255
|
-
|
|
283
|
+
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
284
|
+
await enrichSimulationError(err, this.contractStore, this.contractClassService, anchorBlockHeader, this.log);
|
|
256
285
|
}
|
|
257
286
|
throw err;
|
|
258
287
|
}
|
|
@@ -274,7 +303,8 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
274
303
|
} catch (err) {
|
|
275
304
|
if (err instanceof SimulationError) {
|
|
276
305
|
try {
|
|
277
|
-
|
|
306
|
+
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
307
|
+
await enrichPublicSimulationError(err, this.contractStore, this.contractClassService, anchorBlockHeader, this.log);
|
|
278
308
|
} catch (enrichErr) {
|
|
279
309
|
this.log.error(`Failed to enrich public simulation error: ${enrichErr}`);
|
|
280
310
|
}
|
|
@@ -293,7 +323,7 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
293
323
|
* @param config - The configuration for the kernel execution prover.
|
|
294
324
|
* @returns An object that contains the output of the kernel execution, including the ChonkProof if proving is enabled.
|
|
295
325
|
*/ async #prove(txExecutionRequest, proofCreator, privateExecutionResult, anchorBlockHeader, config) {
|
|
296
|
-
const kernelOracle = new PrivateKernelOracle(this.contractStore, this.keyStore, this.node, anchorBlockHeader);
|
|
326
|
+
const kernelOracle = new PrivateKernelOracle(this.contractStore, this.contractClassService, this.keyStore, this.node, anchorBlockHeader);
|
|
297
327
|
const kernelTraceProver = new PrivateKernelExecutionProver(kernelOracle, proofCreator, !this.proverEnabled, this.log.getBindings());
|
|
298
328
|
this.log.debug(`Executing kernel trace prover (${JSON.stringify(config)})...`);
|
|
299
329
|
return await kernelTraceProver.proveWithKernels(txExecutionRequest.toTxRequest(), privateExecutionResult, config);
|
|
@@ -324,9 +354,9 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
324
354
|
});
|
|
325
355
|
}
|
|
326
356
|
/**
|
|
327
|
-
* Returns the contract instance
|
|
357
|
+
* Returns the address preimage of the contract instance at a given address, if it's registered in the PXE.
|
|
328
358
|
* @param address - The contract address.
|
|
329
|
-
* @returns The contract instance if found, undefined otherwise.
|
|
359
|
+
* @returns The contract instance address preimage if found, undefined otherwise.
|
|
330
360
|
*/ getContractInstance(address) {
|
|
331
361
|
return this.contractStore.getContractInstance(address);
|
|
332
362
|
}
|
|
@@ -338,17 +368,21 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
338
368
|
return await this.contractStore.getContractArtifact(id);
|
|
339
369
|
}
|
|
340
370
|
/**
|
|
341
|
-
* Registers a user account in PXE
|
|
342
|
-
*
|
|
343
|
-
* the
|
|
344
|
-
*
|
|
371
|
+
* Registers a user account in PXE.
|
|
372
|
+
*
|
|
373
|
+
* PXE holds the account's four privacy secret keys but only the *public* message-signing and fallback keys: their
|
|
374
|
+
* secret keys are withheld, since PXE is not trusted to hold them.
|
|
375
|
+
*
|
|
376
|
+
* Does nothing if the account is already registered.
|
|
345
377
|
*
|
|
346
|
-
*
|
|
378
|
+
* The four privacy secret keys can be retrieved later with {@link getAccountSecretKeys}.
|
|
379
|
+
*
|
|
380
|
+
* @param keys - The account's privacy keys: four secret keys plus the message-signing and fallback public keys.
|
|
347
381
|
* @param partialAddress - The partial address of the account contract corresponding to the account being registered.
|
|
348
382
|
* @returns The complete address of the account.
|
|
349
|
-
*/ async registerAccount(
|
|
383
|
+
*/ async registerAccount(keys, partialAddress) {
|
|
350
384
|
const accounts = await this.keyStore.getAccounts();
|
|
351
|
-
const accountCompleteAddress = await this.keyStore.addAccount(
|
|
385
|
+
const accountCompleteAddress = await this.keyStore.addAccount(keys, partialAddress);
|
|
352
386
|
if (accounts.some((a)=>a.equals(accountCompleteAddress.address))) {
|
|
353
387
|
this.log.info(`Account:\n "${accountCompleteAddress.address.toString()}"\n already registered.`);
|
|
354
388
|
return accountCompleteAddress;
|
|
@@ -360,50 +394,144 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
360
394
|
return accountCompleteAddress;
|
|
361
395
|
}
|
|
362
396
|
/**
|
|
363
|
-
*
|
|
397
|
+
* Retrieves the four privacy secret keys PXE holds for a registered account (nullifier-hiding, incoming-viewing,
|
|
398
|
+
* outgoing-viewing, tagging).
|
|
364
399
|
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
400
|
+
* These do NOT grant control over an account's assets, e.g. they are insufficient to impersonate the account or to
|
|
401
|
+
* spend notes, but they _do_ guard the account's privacy. Parties that have knowledge of these keys can decrypt all
|
|
402
|
+
* messages sent to the account, discover all of their on-chain activity, including notes, events, etc.
|
|
367
403
|
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
404
|
+
* Security is paramount when handling these keys, which should itself be a very rare occurrence. Other than exporting
|
|
405
|
+
* and then importing an account into a separate PXE/wallet, there is typically no need for a wallet to ever access
|
|
406
|
+
* these keys. Applications should NEVER be given access to them.
|
|
407
|
+
*
|
|
408
|
+
* @throws If the account is not registered.
|
|
409
|
+
*/ getAccountSecretKeys(account) {
|
|
410
|
+
return this.keyStore.getAccountSecretKeys(account);
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Registers a source from which this PXE derives the tagging secrets it scans for to discover incoming private logs.
|
|
414
|
+
* See {@link TaggingSecretSource} for the meaning of each variant. Does nothing if the source is already registered.
|
|
415
|
+
*
|
|
416
|
+
* After a new source is added we clear the cache tracking which contracts have finished syncing, so every contract
|
|
417
|
+
* re-syncs against the new source's logs (whose notes/events could belong to any contract). Already-discovered
|
|
418
|
+
* notes/events are not discarded.
|
|
419
|
+
*/ async registerTaggingSecretSource(source) {
|
|
420
|
+
let wasAdded;
|
|
421
|
+
switch(source.kind){
|
|
422
|
+
case 'address-derived':
|
|
423
|
+
wasAdded = await this.#registerSender(source.sender);
|
|
424
|
+
break;
|
|
425
|
+
case 'arbitrary-secret':
|
|
426
|
+
wasAdded = await this.#registerSharedSecret(source.recipient, 'arbitrary-secret', source.secret);
|
|
427
|
+
break;
|
|
428
|
+
case 'handshake':
|
|
429
|
+
wasAdded = await this.#registerSharedSecret(source.recipient, 'handshake', await this.#deriveHandshakeSecret(source.recipient, source.ephPk));
|
|
430
|
+
break;
|
|
431
|
+
default:
|
|
432
|
+
{
|
|
433
|
+
const _ = source;
|
|
434
|
+
throw new Error('Unhandled tagging secret source kind');
|
|
435
|
+
}
|
|
379
436
|
}
|
|
380
|
-
const wasAdded = await this.senderAddressBookStore.addSender(sender);
|
|
381
437
|
if (wasAdded) {
|
|
382
|
-
|
|
383
|
-
// Wipe the entire sync cache: the new sender's tagged logs could contain notes/events for any contract, so
|
|
384
|
-
// all contracts must re-sync to discover them. Queued to avoid wiping while a job is in flight.
|
|
438
|
+
// Queued to avoid wiping while a job is in flight.
|
|
385
439
|
await this.#putInJobQueue(()=>Promise.resolve(this.contractSyncService.wipe()));
|
|
386
|
-
} else {
|
|
387
|
-
this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
|
|
388
440
|
}
|
|
389
|
-
return sender;
|
|
390
441
|
}
|
|
391
442
|
/**
|
|
392
|
-
*
|
|
393
|
-
* @
|
|
394
|
-
*/
|
|
395
|
-
|
|
443
|
+
* Removes a previously registered tagging secret source, identified by its registered form (see
|
|
444
|
+
* {@link getTaggingSecretSources}). Does nothing if it was not registered.
|
|
445
|
+
*/ async removeTaggingSecretSource(source) {
|
|
446
|
+
switch(source.kind){
|
|
447
|
+
case 'address-derived':
|
|
448
|
+
{
|
|
449
|
+
const { sender } = source;
|
|
450
|
+
const wasRemoved = await this.taggingSecretSourcesStore.removeSender(sender);
|
|
451
|
+
this.log.info(wasRemoved ? `Removed sender:\n ${sender.toString()}` : `Sender:\n "${sender.toString()}"\n not registered in PXE.`);
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
case 'arbitrary-secret':
|
|
455
|
+
case 'handshake':
|
|
456
|
+
{
|
|
457
|
+
const { kind, recipient, secret } = source;
|
|
458
|
+
const wasRemoved = await this.taggingSecretSourcesStore.removeSharedSecret(recipient, kind, secret);
|
|
459
|
+
this.log.info(wasRemoved ? `Removed ${kind} shared secret for recipient:\n ${recipient.toString()}` : `No ${kind} shared secret registered for recipient:\n ${recipient.toString()}`);
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
default:
|
|
463
|
+
{
|
|
464
|
+
const _ = source;
|
|
465
|
+
throw new Error('Unhandled tagging secret source kind');
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
async getTaggingSecretSources(filter) {
|
|
470
|
+
const [senders, secrets] = await Promise.all([
|
|
471
|
+
this.taggingSecretSourcesStore.getSenders(),
|
|
472
|
+
this.taggingSecretSourcesStore.getAllSharedSecrets()
|
|
473
|
+
]);
|
|
474
|
+
const sources = [
|
|
475
|
+
...senders.map((sender)=>({
|
|
476
|
+
kind: 'address-derived',
|
|
477
|
+
sender
|
|
478
|
+
})),
|
|
479
|
+
...secrets.map(({ recipient, kind, secret })=>({
|
|
480
|
+
kind,
|
|
481
|
+
recipient,
|
|
482
|
+
secret
|
|
483
|
+
}))
|
|
484
|
+
];
|
|
485
|
+
return filter?.kind ? sources.filter((source)=>source.kind === filter.kind) : sources;
|
|
486
|
+
}
|
|
487
|
+
/** Registers a sender, skipping addresses that belong to a local account. Returns whether it was newly added. */ async #registerSender(address) {
|
|
488
|
+
if (!await address.isValid()) {
|
|
489
|
+
throw new Error(`Address ${address} is not valid: it does not correspond to a point on the Grumpkin curve. Cannot register it as a sender.`);
|
|
490
|
+
}
|
|
491
|
+
const accounts = await this.keyStore.getAccounts();
|
|
492
|
+
if (accounts.some((a)=>a.equals(address))) {
|
|
493
|
+
this.log.info(`Sender:\n "${address.toString()}"\n already registered.`);
|
|
494
|
+
return false;
|
|
495
|
+
}
|
|
496
|
+
const wasAdded = await this.taggingSecretSourcesStore.addSender(address);
|
|
497
|
+
this.log.info(wasAdded ? `Added sender:\n ${address.toString()}` : `Sender:\n "${address.toString()}"\n already registered.`);
|
|
498
|
+
return wasAdded;
|
|
396
499
|
}
|
|
397
500
|
/**
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
501
|
+
* Derives the shared secret of a handshake from its ephemeral public key: the raw ECDH secret
|
|
502
|
+
* `S = addressSecret(recipient) * ephPk` with the forgery protection applied,
|
|
503
|
+
* matching the protected secret the registry stores and the derivation the recipient-side scan uses for
|
|
504
|
+
* handshakes discovered onchain. The ephemeral key is reconstructed from its x-coordinate with a positive y,
|
|
505
|
+
* matching how the protocol generates it.
|
|
506
|
+
*
|
|
507
|
+
* @throws If `ephPk` is not the x-coordinate of a Grumpkin curve point, or if `recipient` is not an account of
|
|
508
|
+
* this PXE, since the derivation needs its keys.
|
|
509
|
+
*/ async #deriveHandshakeSecret(recipient, ephPk) {
|
|
510
|
+
let ephPkPoint;
|
|
511
|
+
try {
|
|
512
|
+
ephPkPoint = await Point.fromXAndSign(ephPk, true);
|
|
513
|
+
} catch {
|
|
514
|
+
throw new Error(`Ephemeral public key x-coordinate ${ephPk} does not correspond to a Grumpkin curve point.`);
|
|
515
|
+
}
|
|
516
|
+
const completeAddress = await this.addressStore.getCompleteAddress(recipient);
|
|
517
|
+
if (!completeAddress || !await this.keyStore.hasAccount(recipient)) {
|
|
518
|
+
throw new Error(`Recipient ${recipient} is not an account of this PXE. A handshake's shared secret can only be derived for an account whose keys are held.`);
|
|
406
519
|
}
|
|
520
|
+
const ivskM = await this.keyStore.getMasterIncomingViewingSecretKey(recipient);
|
|
521
|
+
const addressSecret = await computeAddressSecret(await completeAddress.getPreaddress(), ivskM);
|
|
522
|
+
const rawSecret = await deriveEcdhSharedSecretPoint(addressSecret, ephPkPoint);
|
|
523
|
+
return protectFromForgery(rawSecret, ephPkPoint, await recipient.toAddressPoint());
|
|
524
|
+
}
|
|
525
|
+
/** Registers a resolved shared secret scoped to a recipient. Returns whether it was newly added. */ async #registerSharedSecret(recipient, kind, secret) {
|
|
526
|
+
if (!await recipient.isValid()) {
|
|
527
|
+
throw new Error(`Recipient ${recipient} is not valid: it does not correspond to a point on the Grumpkin curve. Cannot register a shared secret for it.`);
|
|
528
|
+
}
|
|
529
|
+
if (secret.isZero() || !secret.isOnCurve()) {
|
|
530
|
+
throw new Error(`Shared secret ${secret} is not a valid non-zero point on the Grumpkin curve.`);
|
|
531
|
+
}
|
|
532
|
+
const wasAdded = await this.taggingSecretSourcesStore.addSharedSecret(recipient, kind, secret);
|
|
533
|
+
this.log.info(wasAdded ? `Added ${kind} shared secret for recipient:\n ${recipient.toString()}` : `${kind} shared secret already registered for recipient:\n ${recipient.toString()}`);
|
|
534
|
+
return wasAdded;
|
|
407
535
|
}
|
|
408
536
|
/**
|
|
409
537
|
* Retrieves the user accounts registered on this PXE.
|
|
@@ -421,76 +549,34 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
421
549
|
* @param artifact - The build artifact for the contract class.
|
|
422
550
|
*/ async registerContractClass(artifact) {
|
|
423
551
|
const contractClassId = await this.contractStore.addContractArtifact(artifact);
|
|
552
|
+
// Publishing the artifact's public function signatures to the node is part of "registering a class", so that
|
|
553
|
+
// node-side debugging works regardless of which entrypoint (registerContractClass or registerContract) was used.
|
|
554
|
+
const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
|
|
555
|
+
if (publicFunctionSignatures.length > 0) {
|
|
556
|
+
await this.nodeDebug?.registerContractFunctionSignatures(publicFunctionSignatures);
|
|
557
|
+
}
|
|
424
558
|
this.log.info(`Added contract class ${artifact.name} with id ${contractClassId}`);
|
|
425
559
|
}
|
|
426
560
|
/**
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
561
|
+
* Registers a deployed contract instance so its private state can be synced and its functions simulated. The
|
|
562
|
+
* artifact for the class the instance runs must be registered separately via {@link registerContractClass}, before
|
|
563
|
+
* or after this call; registration performs no validation, so a missing or mismatched artifact only surfaces when
|
|
564
|
+
* the contract is later simulated. This is automatically called by aztec.js when deploying a contract.
|
|
431
565
|
*
|
|
432
|
-
* @param
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
if (artifact) {
|
|
437
|
-
// If the user provides an artifact, validate it against the expected class id and register it
|
|
438
|
-
const contractClass = await getContractClassFromArtifact(artifact);
|
|
439
|
-
if (!contractClass.id.equals(instance.currentContractClassId)) {
|
|
440
|
-
throw new Error(`Artifact does not match expected class id (computed ${contractClass.id} but instance refers to ${instance.currentContractClassId})`);
|
|
441
|
-
}
|
|
442
|
-
const computedAddress = await computeContractAddressFromInstance(instance);
|
|
443
|
-
if (!computedAddress.equals(instance.address)) {
|
|
444
|
-
throw new Error('Added a contract in which the address does not match the contract instance.');
|
|
445
|
-
}
|
|
446
|
-
await this.contractStore.addContractArtifact(artifact, contractClass);
|
|
447
|
-
const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
|
|
448
|
-
if (publicFunctionSignatures.length > 0) {
|
|
449
|
-
await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
|
|
450
|
-
}
|
|
451
|
-
} else {
|
|
452
|
-
// Otherwise, make sure there is an artifact already registered for that class id
|
|
453
|
-
artifact = await this.contractStore.getContractArtifact(instance.currentContractClassId);
|
|
454
|
-
if (!artifact) {
|
|
455
|
-
throw new Error(`Artifact not found when registering an instance. Contract class: ${instance.currentContractClassId}.`);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
await this.contractStore.addContractInstance(instance);
|
|
459
|
-
this.log.info(`Added contract ${artifact.name} at ${instance.address.toString()} with class ${instance.currentContractClassId}`);
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* Updates a deployed contract in the PXE. This is used to update the contract artifact when
|
|
463
|
-
* an update has happened, so the new code can be used in the simulation of local transactions.
|
|
464
|
-
* This is called by aztec.js when instantiating a contract in a given address with a mismatching artifact.
|
|
465
|
-
* @param contractAddress - The address of the contract to update.
|
|
466
|
-
* @param artifact - The updated artifact for the contract.
|
|
467
|
-
* @throws If the artifact's contract class is not found in the PXE or if the contract class is different from
|
|
468
|
-
* the current one (current one from the point of view of the node to which the PXE is connected).
|
|
469
|
-
*/ updateContract(contractAddress, artifact) {
|
|
470
|
-
// We disable concurrently updating contracts to avoid concurrently syncing with the node, or changing a contract's
|
|
471
|
-
// class while we're simulating it.
|
|
566
|
+
* @param instance - The address preimage of the contract instance to register. The address is derived from it.
|
|
567
|
+
* @returns The address of the registered instance.
|
|
568
|
+
*/ registerContract(instance) {
|
|
569
|
+
// Run inside the job queue so we can't race a concurrent simulation while writing the instance to the store.
|
|
472
570
|
return this.#putInJobQueue(async ()=>{
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
throw new Error('Could not update contract to a class different from the current one.');
|
|
483
|
-
}
|
|
484
|
-
const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
|
|
485
|
-
if (publicFunctionSignatures.length > 0) {
|
|
486
|
-
await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
|
|
487
|
-
}
|
|
488
|
-
currentInstance.currentContractClassId = contractClass.id;
|
|
489
|
-
await Promise.all([
|
|
490
|
-
this.contractStore.addContractArtifact(artifact, contractClass),
|
|
491
|
-
this.contractStore.addContractInstance(currentInstance)
|
|
492
|
-
]);
|
|
493
|
-
this.log.info(`Updated contract ${artifact.name} at ${contractAddress.toString()} to class ${contractClass.id}`);
|
|
571
|
+
const address = await computeContractAddressFromInstance(instance);
|
|
572
|
+
await this.contractStore.addContractInstance({
|
|
573
|
+
...instance,
|
|
574
|
+
address
|
|
575
|
+
});
|
|
576
|
+
this.log.info(`Added contract at ${address}`, {
|
|
577
|
+
address
|
|
578
|
+
});
|
|
579
|
+
return address;
|
|
494
580
|
});
|
|
495
581
|
}
|
|
496
582
|
/**
|
|
@@ -684,7 +770,7 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
684
770
|
let publicInputs;
|
|
685
771
|
let executionSteps = [];
|
|
686
772
|
if (skipKernels) {
|
|
687
|
-
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this
|
|
773
|
+
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.#getDebugFunctionName(addr, sel, anchorBlockHeader), this.node));
|
|
688
774
|
} else {
|
|
689
775
|
// Kernel logic, plus proving of all private functions and kernels.
|
|
690
776
|
({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, anchorBlockHeader, {
|
|
@@ -702,7 +788,7 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
702
788
|
publicOutput = await this.#simulatePublicCalls(simulatedTx, skipFeeEnforcement, overrides);
|
|
703
789
|
publicSimulationTime = publicSimulationTimer.ms();
|
|
704
790
|
if (publicOutput?.debugLogs?.length) {
|
|
705
|
-
await displayDebugLogs(publicOutput.debugLogs, (addr)=>this
|
|
791
|
+
await displayDebugLogs(publicOutput.debugLogs, (addr)=>this.#getDebugContractName(addr, anchorBlockHeader));
|
|
706
792
|
}
|
|
707
793
|
}
|
|
708
794
|
let validationTime;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
|
+
/**
|
|
3
|
+
* Asserts that `scope` is one of `allowedScopes`, throwing otherwise.
|
|
4
|
+
*/
|
|
5
|
+
export declare function assertAllowedScope(scope: AztecAddress, allowedScopes: AztecAddress[]): void;
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxsb3dlZF9zY29wZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL2FsbG93ZWRfc2NvcGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUUzRDs7R0FFRztBQUNILHdCQUFnQixrQkFBa0IsQ0FBQyxLQUFLLEVBQUUsWUFBWSxFQUFFLGFBQWEsRUFBRSxZQUFZLEVBQUUsR0FBRyxJQUFJLENBUTNGIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed_scopes.d.ts","sourceRoot":"","sources":["../../src/storage/allowed_scopes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,IAAI,CAQ3F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that `scope` is one of `allowedScopes`, throwing otherwise.
|
|
3
|
+
*/ export function assertAllowedScope(scope, allowedScopes) {
|
|
4
|
+
if (!allowedScopes.some((allowed)=>allowed.equals(scope))) {
|
|
5
|
+
throw new Error(`Scope ${scope.toString()} is not in the allowed scopes list: [${allowedScopes.map((s)=>s.toString()).join(', ')}]. See https://docs.aztec.network/errors/10`);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
2
|
import { BlockHeader } from '@aztec/stdlib/tx';
|
|
3
|
+
/**
|
|
4
|
+
* Holds the block header that PXE's private execution is anchored to. Updated by the BlockSynchronizer as the chain
|
|
5
|
+
* advances or reorgs.
|
|
6
|
+
*/
|
|
3
7
|
export declare class AnchorBlockStore {
|
|
4
8
|
#private;
|
|
5
9
|
constructor(store: AztecAsyncKVStore);
|
|
6
10
|
/**
|
|
7
|
-
* Sets the currently synchronized block
|
|
8
|
-
*
|
|
9
|
-
* Important: this method is only called from BlockSynchronizer, and since we need it to run atomically with other
|
|
10
|
-
* stores in the case of a reorg, it MUST NOT be wrapped in a `transactionAsync` call. Doing so would result in a
|
|
11
|
-
* deadlock when the backend is IndexedDB, because `transactionAsync` is not designed to support reentrancy.
|
|
11
|
+
* Sets the currently synchronized block header.
|
|
12
12
|
*
|
|
13
|
+
* Important: only called from BlockSynchronizer, and since it must run atomically with other stores in a reorg, it
|
|
14
|
+
* MUST NOT be wrapped in `transactionAsync`: doing so deadlocks when the kv-store backend is IndexedDB (no
|
|
15
|
+
* support for reentrancy).
|
|
13
16
|
*/
|
|
14
17
|
setHeader(header: BlockHeader): Promise<void>;
|
|
15
18
|
getBlockHeader(): Promise<BlockHeader>;
|
|
16
19
|
}
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5jaG9yX2Jsb2NrX3N0b3JlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9hbmNob3JfYmxvY2tfc3RvcmUvYW5jaG9yX2Jsb2NrX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUF1QixNQUFNLGlCQUFpQixDQUFDO0FBQzlFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUUvQzs7O0dBR0c7QUFDSCxxQkFBYSxnQkFBZ0I7O0lBSTNCLFlBQVksS0FBSyxFQUFFLGlCQUFpQixFQUduQztJQUVEOzs7Ozs7T0FNRztJQUNHLFNBQVMsQ0FBQyxNQUFNLEVBQUUsV0FBVyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FFbEQ7SUFFSyxjQUFjLElBQUksT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQU0zQztDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor_block_store.d.ts","sourceRoot":"","sources":["../../../src/storage/anchor_block_store/anchor_block_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,qBAAa,gBAAgB;;IAI3B,YAAY,KAAK,EAAE,iBAAiB,EAGnC;IAED
|
|
1
|
+
{"version":3,"file":"anchor_block_store.d.ts","sourceRoot":"","sources":["../../../src/storage/anchor_block_store/anchor_block_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;GAGG;AACH,qBAAa,gBAAgB;;IAI3B,YAAY,KAAK,EAAE,iBAAiB,EAGnC;IAED;;;;;;OAMG;IACG,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAElD;IAEK,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAM3C;CACF"}
|