@aztec/pxe 0.0.1-commit.2f68f620 → 0.0.1-commit.3100065
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 +10 -20
- 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 +26 -1
- package/dest/bin/oracle_version_helpers.d.ts.map +1 -1
- package/dest/bin/oracle_version_helpers.js +162 -1
- 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/config/package_info.js +1 -1
- 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_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 +64 -35
- 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 +7 -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 +21 -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 +50 -0
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts +14 -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 +41 -30
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_registry.js +248 -27
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +123 -40
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +947 -264
- 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 +128 -17
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +73 -33
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +220 -104
- 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/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +8 -3
- 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 +8 -3
- 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 +5 -3
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +3 -2
- 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 +8 -2
- 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 +7 -6
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +79 -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} +8 -8
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.js +5 -5
- 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 +17 -36
- 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 +222 -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 +57 -0
- package/dest/storage/fact_store/origin_state.d.ts.map +1 -0
- package/dest/storage/fact_store/origin_state.js +53 -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/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/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 +2 -2
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +18 -9
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +21 -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 +56 -16
- package/package.json +17 -17
- package/src/bin/check_oracle_version.ts +10 -19
- package/src/bin/index.ts +5 -1
- package/src/bin/oracle_version_helpers.ts +190 -0
- 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/config/package_info.ts +1 -1
- 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_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 +97 -45
- package/src/contract_function_simulator/execution_note_cache.ts +7 -28
- package/src/contract_function_simulator/index.ts +26 -11
- 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 +53 -0
- package/src/contract_function_simulator/noir-structs/tx_effect_data.ts +15 -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 +162 -41
- package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +659 -248
- package/src/contract_function_simulator/oracle/private_execution.ts +2 -3
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +156 -24
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +357 -131
- 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/utils.ts +10 -3
- package/src/entrypoints/client/lazy/utils.ts +10 -3
- package/src/entrypoints/pxe_creation_options.ts +8 -2
- package/src/entrypoints/server/index.ts +5 -2
- package/src/entrypoints/server/utils.ts +10 -2
- 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 +91 -37
- package/src/messages/{message_context_service.ts → tx_resolver_service.ts} +16 -9
- package/src/oracle_version.ts +5 -5
- 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 +22 -52
- package/src/private_kernel/private_kernel_oracle.ts +23 -4
- package/src/pxe.ts +325 -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 +14 -0
- package/src/storage/fact_store/origin_state.ts +75 -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/tagging_store/index.ts +1 -1
- package/src/storage/tagging_store/tagging_secret_sources_store.ts +138 -0
- package/src/tagging/constants.ts +19 -9
- package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +77 -16
- 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
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from './oracle.js';
|
|
1
|
+
export * from './acir_callback.js';
|
|
4
2
|
export * from './interfaces.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A conditional type that takes a type `T` and returns a union of its method names.
|
|
8
|
-
*/
|
|
9
|
-
type MethodNames<T> = {
|
|
10
|
-
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
|
|
11
|
-
}[keyof T];
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Available oracle function names.
|
|
15
|
-
*/
|
|
16
|
-
export type ORACLE_NAMES = MethodNames<Oracle>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { HandlersForPrefix } from './oracle_registry.js';
|
|
2
|
-
import type { ORACLE_REGISTRY } from './oracle_registry.js';
|
|
1
|
+
import type { HandlersForPrefix, ORACLE_REGISTRY } from './oracle_registry.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Miscellaneous oracle methods, not very Aztec-specific and expected to be available in all scenarios in which aztec-nr
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
import { MAX_NOTE_HASHES_PER_TX, PRIVATE_LOG_CIPHERTEXT_LEN, PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec/constants';
|
|
3
|
+
import { computeFeeJuiceMessageNullifier } from '@aztec/stdlib/messaging';
|
|
4
|
+
|
|
5
|
+
import type { EphemeralArray } from '../noir-structs/ephemeral_array.js';
|
|
6
|
+
import type { LogRetrievalResponse } from '../noir-structs/log_retrieval_response.js';
|
|
7
|
+
import { Option } from '../noir-structs/option.js';
|
|
8
|
+
import type { PendingTaggedLog } from '../noir-structs/pending_tagged_log.js';
|
|
9
|
+
import type { ResolvedTx } from '../noir-structs/resolved_tx.js';
|
|
10
|
+
import {
|
|
11
|
+
type InferDeserializedParams,
|
|
12
|
+
ORACLE_REGISTRY,
|
|
13
|
+
type OracleRegistryEntry,
|
|
14
|
+
type ParamTypes,
|
|
15
|
+
type RegistryParam,
|
|
16
|
+
} from './oracle_registry.js';
|
|
17
|
+
import {
|
|
18
|
+
AZTEC_ADDRESS,
|
|
19
|
+
EPHEMERAL_ARRAY,
|
|
20
|
+
FIELD,
|
|
21
|
+
FIXED_BOUNDED_VEC,
|
|
22
|
+
STRUCT,
|
|
23
|
+
TX_HASH,
|
|
24
|
+
type TypeMapping,
|
|
25
|
+
} from './oracle_type_mappings.js';
|
|
26
|
+
|
|
27
|
+
const LEGACY_LOG_RETRIEVAL_RESPONSE: TypeMapping<LegacyLogRetrievalResponse> = STRUCT([
|
|
28
|
+
{ name: 'logPayload', type: FIXED_BOUNDED_VEC(FIELD, PRIVATE_LOG_CIPHERTEXT_LEN) },
|
|
29
|
+
{ name: 'txHash', type: TX_HASH },
|
|
30
|
+
{ name: 'uniqueNoteHashesInTx', type: FIXED_BOUNDED_VEC(FIELD, MAX_NOTE_HASHES_PER_TX) },
|
|
31
|
+
{ name: 'firstNullifierInTx', type: FIELD },
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
// Block-less transaction context: the prefix of `ResolvedTx`'s wire carried by the original `getPendingTaggedLogs`
|
|
35
|
+
// oracle. Known as `MessageContext` in the Aztec.nr versions that call that oracle.
|
|
36
|
+
const LEGACY_MESSAGE_CONTEXT: TypeMapping<LegacyMessageContext> = STRUCT<LegacyMessageContext>([
|
|
37
|
+
{ name: 'txHash', type: TX_HASH },
|
|
38
|
+
{ name: 'uniqueNoteHashesInTx', type: FIXED_BOUNDED_VEC(FIELD, MAX_NOTE_HASHES_PER_TX) },
|
|
39
|
+
{ name: 'firstNullifierInTx', type: FIELD },
|
|
40
|
+
]);
|
|
41
|
+
|
|
42
|
+
const LEGACY_PENDING_TAGGED_LOG: TypeMapping<LegacyPendingTaggedLog> = STRUCT<LegacyPendingTaggedLog>([
|
|
43
|
+
{ name: 'log', type: FIXED_BOUNDED_VEC(FIELD, PRIVATE_LOG_SIZE_IN_FIELDS) },
|
|
44
|
+
{ name: 'context', type: LEGACY_MESSAGE_CONTEXT },
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Wire shapes that already-deployed contracts still call by their original oracle name, keyed by that retired name.
|
|
49
|
+
* New Aztec.nr calls the current name in `ORACLE_REGISTRY`; old bytecode keeps calling the name compiled into it and
|
|
50
|
+
* is served from here, so versioning an oracle's wire (e.g. adding return fields) stops being a breaking change.
|
|
51
|
+
*
|
|
52
|
+
* Append-only. Drop an entry only once the `ORACLE_VERSION_MAJOR` that introduced its successor is retired, since
|
|
53
|
+
* older contracts can no longer run against this environment.
|
|
54
|
+
*/
|
|
55
|
+
export const LEGACY_ORACLE_REGISTRY: Record<string, LegacyOracleEntry> = {
|
|
56
|
+
aztec_utl_getL1ToL2MembershipWitness: legacyOracle({
|
|
57
|
+
modernOracle: 'aztec_utl_getL1ToL2MembershipWitnessV2',
|
|
58
|
+
// The old wire passed the contract address and secret, the modern oracle takes the unsiloed nullifier (plus the
|
|
59
|
+
// address to silo it with) instead. We derive it here so already-deployed contracts that still emit the old call
|
|
60
|
+
// keep working.
|
|
61
|
+
//
|
|
62
|
+
// This is the fee juice message nullifier derivation: only contracts using that scheme call this retired oracle.
|
|
63
|
+
params: {
|
|
64
|
+
legacyType: [
|
|
65
|
+
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
66
|
+
{ name: 'messageHash', type: FIELD },
|
|
67
|
+
{ name: 'secret', type: FIELD },
|
|
68
|
+
],
|
|
69
|
+
mapping: async ([contractAddress, messageHash, secret]) => [
|
|
70
|
+
messageHash,
|
|
71
|
+
Option.some({ contractAddress, nullifier: await computeFeeJuiceMessageNullifier(messageHash, secret) }),
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
75
|
+
aztec_utl_getLogsByTag: legacyOracle({
|
|
76
|
+
modernOracle: 'aztec_utl_getLogsByTagV2',
|
|
77
|
+
returnType: {
|
|
78
|
+
legacyType: EPHEMERAL_ARRAY(EPHEMERAL_ARRAY(LEGACY_LOG_RETRIEVAL_RESPONSE)),
|
|
79
|
+
// We can map this directly, since the new type is a superset of the old type
|
|
80
|
+
mapping: result => result as unknown as EphemeralArray<EphemeralArray<LegacyLogRetrievalResponse>>,
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
aztec_utl_getPendingTaggedLogs: legacyOracle({
|
|
84
|
+
modernOracle: 'aztec_utl_getPendingTaggedLogsV2',
|
|
85
|
+
returnType: {
|
|
86
|
+
legacyType: EPHEMERAL_ARRAY(LEGACY_PENDING_TAGGED_LOG),
|
|
87
|
+
// We can map this directly, since `ResolvedTx` carries the legacy context's fields under the same names
|
|
88
|
+
mapping: result => result as unknown as EphemeralArray<LegacyPendingTaggedLog>,
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
type LegacyLogRetrievalResponse = Pick<
|
|
94
|
+
LogRetrievalResponse,
|
|
95
|
+
'logPayload' | 'txHash' | 'uniqueNoteHashesInTx' | 'firstNullifierInTx'
|
|
96
|
+
>;
|
|
97
|
+
|
|
98
|
+
type LegacyMessageContext = Pick<ResolvedTx, 'txHash' | 'uniqueNoteHashesInTx' | 'firstNullifierInTx'>;
|
|
99
|
+
|
|
100
|
+
type LegacyPendingTaggedLog = {
|
|
101
|
+
log: PendingTaggedLog['log'];
|
|
102
|
+
context: LegacyMessageContext;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
type Registry = typeof ORACLE_REGISTRY;
|
|
106
|
+
|
|
107
|
+
/** The handler return value type of a modern oracle entry. */
|
|
108
|
+
type ReturnValueOf<K extends keyof Registry> = Registry[K] extends OracleRegistryEntry<any, infer R> ? R : never;
|
|
109
|
+
|
|
110
|
+
/** The modern handler's positional argument tuple, derived from the oracle's declared params. */
|
|
111
|
+
type HandlerArgsOf<K extends keyof Registry> = ParamTypes<ReturnType<Registry[K]['deserializeParams']>>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* A legacy oracle adapter, stored under the retired oracle name that already-deployed contracts still call. It reuses
|
|
115
|
+
* the handler of `modernOracle` and overrides only the wire side(s) that changed; an omitted side falls back to that
|
|
116
|
+
* modern entry.
|
|
117
|
+
*/
|
|
118
|
+
export interface LegacyOracleEntry {
|
|
119
|
+
/** The current oracle whose handler this reuses and whose param/return wire it inherits by default. */
|
|
120
|
+
modernOracle: keyof Registry;
|
|
121
|
+
/**
|
|
122
|
+
* Old param wire. `legacyType` deserializes the old wire; `mapping` bridges the deserialized legacy args to the
|
|
123
|
+
* modern handler's args. The mapping may be async. Omit when the param wire is unchanged.
|
|
124
|
+
*/
|
|
125
|
+
params?: {
|
|
126
|
+
legacyType: readonly RegistryParam[];
|
|
127
|
+
mapping: (legacyArgs: any) => readonly unknown[] | Promise<readonly unknown[]>;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Old return wire. `legacyType` serializes the subset the old contract reads; `mapping` bridges the handler's
|
|
131
|
+
* current result to that subset's value type. Omit when the return wire is unchanged.
|
|
132
|
+
*/
|
|
133
|
+
returnType?: { legacyType: TypeMapping; mapping: (result: any) => unknown };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function legacyOracle<K extends keyof Registry, W = never, const TLegacyParams extends RegistryParam[] = []>(entry: {
|
|
137
|
+
modernOracle: K;
|
|
138
|
+
params?: {
|
|
139
|
+
legacyType: [...TLegacyParams];
|
|
140
|
+
mapping: (
|
|
141
|
+
legacyArgs: ParamTypes<InferDeserializedParams<TLegacyParams>>,
|
|
142
|
+
) => HandlerArgsOf<K> | Promise<HandlerArgsOf<K>>;
|
|
143
|
+
};
|
|
144
|
+
returnType?: { legacyType: TypeMapping<W>; mapping: (result: ReturnValueOf<K>) => W };
|
|
145
|
+
}): LegacyOracleEntry {
|
|
146
|
+
return entry;
|
|
147
|
+
}
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
1
|
import type { SiblingPath } from '@aztec/foundation/trees';
|
|
3
2
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
) {}
|
|
11
|
-
|
|
12
|
-
toFields(): Fr[] {
|
|
13
|
-
return [new Fr(this.index), ...this.siblingPath.toFields()];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Returns a representation of the public data witness as expected by intrinsic Noir deserialization.
|
|
18
|
-
*/
|
|
19
|
-
public toNoirRepresentation(): (string | string[])[] {
|
|
20
|
-
// TODO(#12874): remove the stupid as string conversion by modifying ForeignCallOutput type in acvm.js
|
|
21
|
-
return [new Fr(this.index).toString() as string, this.siblingPath.toFields().map(fr => fr.toString()) as string[]];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
3
|
+
export type MessageLoadOracleInputs<N extends number> = {
|
|
4
|
+
/** The index of the message commitment in the merkle tree. */
|
|
5
|
+
index: bigint;
|
|
6
|
+
/** The path in the merkle tree to the message. */
|
|
7
|
+
siblingPath: SiblingPath<N>;
|
|
8
|
+
};
|
|
@@ -3,6 +3,7 @@ import { ARCHIVE_HEIGHT, NOTE_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { FieldReader } from '@aztec/foundation/serialize';
|
|
5
5
|
import { toACVMField } from '@aztec/simulator/client';
|
|
6
|
+
import type { UnsiloedMessageNullifier } from '@aztec/stdlib/messaging';
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
ARRAY,
|
|
@@ -15,11 +16,12 @@ import {
|
|
|
15
16
|
BUFFER,
|
|
16
17
|
BYTE,
|
|
17
18
|
CALL_PRIVATE_RESULT,
|
|
18
|
-
|
|
19
|
+
CONTRACT_CLASS_LOG,
|
|
19
20
|
CONTRACT_INSTANCE,
|
|
20
21
|
DELIVERY_MODE,
|
|
21
22
|
EPHEMERAL_ARRAY,
|
|
22
23
|
EVENT_VALIDATION_REQUEST,
|
|
24
|
+
FACT_COLLECTION,
|
|
23
25
|
FIELD,
|
|
24
26
|
FUNCTION_SELECTOR,
|
|
25
27
|
type InputSlot,
|
|
@@ -27,7 +29,6 @@ import {
|
|
|
27
29
|
LOG_RETRIEVAL_REQUEST,
|
|
28
30
|
LOG_RETRIEVAL_RESPONSE,
|
|
29
31
|
MEMBERSHIP_WITNESS,
|
|
30
|
-
MESSAGE_CONTEXT,
|
|
31
32
|
MESSAGE_LOAD_ORACLE_INPUTS,
|
|
32
33
|
type MaybePromise,
|
|
33
34
|
NOTE,
|
|
@@ -35,19 +36,24 @@ import {
|
|
|
35
36
|
NOTE_VALIDATION_REQUEST,
|
|
36
37
|
NULLIFIER_MEMBERSHIP_WITNESS,
|
|
37
38
|
OPTION,
|
|
39
|
+
ORIGIN_BLOCK,
|
|
38
40
|
type OutputSlot,
|
|
39
41
|
PENDING_TAGGED_LOG,
|
|
40
42
|
POINT,
|
|
41
43
|
PROVIDED_SECRET,
|
|
42
44
|
PUBLIC_DATA_WITNESS,
|
|
43
45
|
PUBLIC_KEYS_AND_PARTIAL_ADDRESS,
|
|
46
|
+
RESOLVED_TAGGING_STRATEGY,
|
|
47
|
+
RESOLVED_TX,
|
|
44
48
|
STR,
|
|
49
|
+
STRUCT,
|
|
45
50
|
TX_EFFECT,
|
|
46
51
|
TX_HASH,
|
|
47
52
|
type TypeMapping,
|
|
48
53
|
U32,
|
|
49
54
|
UTILITY_CONTEXT,
|
|
50
55
|
assertReadersConsumed,
|
|
56
|
+
slotsOf,
|
|
51
57
|
} from './oracle_type_mappings.js';
|
|
52
58
|
|
|
53
59
|
export {
|
|
@@ -59,7 +65,9 @@ export {
|
|
|
59
65
|
BOUNDED_VEC,
|
|
60
66
|
BUFFER,
|
|
61
67
|
BYTE,
|
|
68
|
+
CONTRACT_CLASS_LOG,
|
|
62
69
|
DELIVERY_MODE,
|
|
70
|
+
RESOLVED_TAGGING_STRATEGY,
|
|
63
71
|
EPHEMERAL_ARRAY,
|
|
64
72
|
EVENT_VALIDATION_REQUEST,
|
|
65
73
|
FIELD,
|
|
@@ -67,17 +75,19 @@ export {
|
|
|
67
75
|
LOG_RETRIEVAL_REQUEST,
|
|
68
76
|
LOG_RETRIEVAL_RESPONSE,
|
|
69
77
|
MEMBERSHIP_WITNESS,
|
|
70
|
-
MESSAGE_CONTEXT,
|
|
71
78
|
NOTE_VALIDATION_REQUEST,
|
|
72
79
|
OPTION,
|
|
73
80
|
PENDING_TAGGED_LOG,
|
|
74
81
|
POINT,
|
|
75
82
|
PROVIDED_SECRET,
|
|
83
|
+
RESOLVED_TX,
|
|
76
84
|
STR,
|
|
77
85
|
U32,
|
|
86
|
+
slotsOf,
|
|
78
87
|
type InputSlot,
|
|
79
88
|
type MaybePromise,
|
|
80
89
|
type OutputSlot,
|
|
90
|
+
type SlotShape,
|
|
81
91
|
type TypeMapping,
|
|
82
92
|
} from './oracle_type_mappings.js';
|
|
83
93
|
|
|
@@ -103,7 +113,10 @@ export const ORACLE_REGISTRY = {
|
|
|
103
113
|
aztec_utl_getUtilityContext: makeEntry({ returnType: UTILITY_CONTEXT }),
|
|
104
114
|
|
|
105
115
|
aztec_utl_getKeyValidationRequest: makeEntry({
|
|
106
|
-
params: [
|
|
116
|
+
params: [
|
|
117
|
+
{ name: 'pkMHash', type: FIELD },
|
|
118
|
+
{ name: 'keyIndex', type: FIELD },
|
|
119
|
+
],
|
|
107
120
|
returnType: KEY_VALIDATION_REQUEST,
|
|
108
121
|
}),
|
|
109
122
|
|
|
@@ -128,6 +141,14 @@ export const ORACLE_REGISTRY = {
|
|
|
128
141
|
returnType: OPTION(MEMBERSHIP_WITNESS(ARCHIVE_HEIGHT)),
|
|
129
142
|
}),
|
|
130
143
|
|
|
144
|
+
aztec_utl_areBlockHashesInArchive: makeEntry({
|
|
145
|
+
params: [
|
|
146
|
+
{ name: 'anchorBlockHash', type: BLOCK_HASH },
|
|
147
|
+
{ name: 'blockHashes', type: EPHEMERAL_ARRAY(BLOCK_HASH) },
|
|
148
|
+
],
|
|
149
|
+
returnType: EPHEMERAL_ARRAY(BOOL),
|
|
150
|
+
}),
|
|
151
|
+
|
|
131
152
|
aztec_utl_getNullifierMembershipWitness: makeEntry({
|
|
132
153
|
params: [
|
|
133
154
|
{ name: 'blockHash', type: BLOCK_HASH },
|
|
@@ -172,11 +193,18 @@ export const ORACLE_REGISTRY = {
|
|
|
172
193
|
returnType: BOOL,
|
|
173
194
|
}),
|
|
174
195
|
|
|
175
|
-
|
|
196
|
+
aztec_utl_getL1ToL2MembershipWitnessV2: makeEntry({
|
|
176
197
|
params: [
|
|
177
|
-
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
178
198
|
{ name: 'messageHash', type: FIELD },
|
|
179
|
-
{
|
|
199
|
+
{
|
|
200
|
+
name: 'nullifier',
|
|
201
|
+
type: OPTION(
|
|
202
|
+
STRUCT<UnsiloedMessageNullifier>([
|
|
203
|
+
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
204
|
+
{ name: 'nullifier', type: FIELD },
|
|
205
|
+
]),
|
|
206
|
+
),
|
|
207
|
+
},
|
|
180
208
|
],
|
|
181
209
|
returnType: MESSAGE_LOAD_ORACLE_INPUTS,
|
|
182
210
|
}),
|
|
@@ -214,7 +242,7 @@ export const ORACLE_REGISTRY = {
|
|
|
214
242
|
returnType: BOUNDED_VEC(NOTE),
|
|
215
243
|
}),
|
|
216
244
|
|
|
217
|
-
|
|
245
|
+
aztec_utl_getPendingTaggedLogsV2: makeEntry({
|
|
218
246
|
params: [
|
|
219
247
|
{ name: 'scope', type: AZTEC_ADDRESS },
|
|
220
248
|
{ name: 'providedSecrets', type: EPHEMERAL_ARRAY(PROVIDED_SECRET) },
|
|
@@ -230,14 +258,14 @@ export const ORACLE_REGISTRY = {
|
|
|
230
258
|
],
|
|
231
259
|
}),
|
|
232
260
|
|
|
233
|
-
|
|
261
|
+
aztec_utl_getLogsByTagV2: makeEntry({
|
|
234
262
|
params: [{ name: 'requests', type: EPHEMERAL_ARRAY(LOG_RETRIEVAL_REQUEST) }],
|
|
235
263
|
returnType: EPHEMERAL_ARRAY(EPHEMERAL_ARRAY(LOG_RETRIEVAL_RESPONSE)),
|
|
236
264
|
}),
|
|
237
265
|
|
|
238
|
-
|
|
266
|
+
aztec_utl_getResolvedTxs: makeEntry({
|
|
239
267
|
params: [{ name: 'requests', type: EPHEMERAL_ARRAY(FIELD) }],
|
|
240
|
-
returnType: EPHEMERAL_ARRAY(OPTION(
|
|
268
|
+
returnType: EPHEMERAL_ARRAY(OPTION(RESOLVED_TX)),
|
|
241
269
|
}),
|
|
242
270
|
|
|
243
271
|
aztec_utl_getTxEffect: makeEntry({
|
|
@@ -285,8 +313,8 @@ export const ORACLE_REGISTRY = {
|
|
|
285
313
|
aztec_utl_decryptAes128: makeEntry({
|
|
286
314
|
params: [
|
|
287
315
|
{ name: 'ciphertext', type: BOUNDED_VEC(BYTE) },
|
|
288
|
-
{ name: 'iv', type: BUFFER(8) },
|
|
289
|
-
{ name: 'symKey', type: BUFFER(8) },
|
|
316
|
+
{ name: 'iv', type: BUFFER(8, 16) },
|
|
317
|
+
{ name: 'symKey', type: BUFFER(8, 16) },
|
|
290
318
|
],
|
|
291
319
|
returnType: OPTION(BOUNDED_VEC(BYTE)),
|
|
292
320
|
}),
|
|
@@ -311,6 +339,46 @@ export const ORACLE_REGISTRY = {
|
|
|
311
339
|
params: [{ name: 'data', type: ARRAY(FIELD) }],
|
|
312
340
|
}),
|
|
313
341
|
|
|
342
|
+
aztec_utl_recordFact: makeEntry({
|
|
343
|
+
params: [
|
|
344
|
+
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
345
|
+
{ name: 'scope', type: AZTEC_ADDRESS },
|
|
346
|
+
{ name: 'factCollectionTypeId', type: FIELD },
|
|
347
|
+
{ name: 'factCollectionId', type: FIELD },
|
|
348
|
+
{ name: 'factTypeId', type: FIELD },
|
|
349
|
+
{ name: 'payload', type: EPHEMERAL_ARRAY(FIELD) },
|
|
350
|
+
{ name: 'originBlock', type: OPTION(ORIGIN_BLOCK) },
|
|
351
|
+
],
|
|
352
|
+
}),
|
|
353
|
+
|
|
354
|
+
aztec_utl_deleteFactCollection: makeEntry({
|
|
355
|
+
params: [
|
|
356
|
+
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
357
|
+
{ name: 'scope', type: AZTEC_ADDRESS },
|
|
358
|
+
{ name: 'factCollectionTypeId', type: FIELD },
|
|
359
|
+
{ name: 'factCollectionId', type: FIELD },
|
|
360
|
+
],
|
|
361
|
+
}),
|
|
362
|
+
|
|
363
|
+
aztec_utl_getFactCollection: makeEntry({
|
|
364
|
+
params: [
|
|
365
|
+
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
366
|
+
{ name: 'scope', type: AZTEC_ADDRESS },
|
|
367
|
+
{ name: 'factCollectionTypeId', type: FIELD },
|
|
368
|
+
{ name: 'factCollectionId', type: FIELD },
|
|
369
|
+
],
|
|
370
|
+
returnType: OPTION(FACT_COLLECTION),
|
|
371
|
+
}),
|
|
372
|
+
|
|
373
|
+
aztec_utl_getFactCollectionsByType: makeEntry({
|
|
374
|
+
params: [
|
|
375
|
+
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
376
|
+
{ name: 'scope', type: AZTEC_ADDRESS },
|
|
377
|
+
{ name: 'factCollectionTypeId', type: FIELD },
|
|
378
|
+
],
|
|
379
|
+
returnType: EPHEMERAL_ARRAY(FACT_COLLECTION),
|
|
380
|
+
}),
|
|
381
|
+
|
|
314
382
|
aztec_utl_callUtilityFunction: makeEntry({
|
|
315
383
|
params: [
|
|
316
384
|
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
@@ -365,6 +433,51 @@ export const ORACLE_REGISTRY = {
|
|
|
365
433
|
params: [{ name: 'slot', type: FIELD }],
|
|
366
434
|
}),
|
|
367
435
|
|
|
436
|
+
aztec_utl_pushTransient: makeEntry({
|
|
437
|
+
params: [
|
|
438
|
+
{ name: 'slot', type: FIELD },
|
|
439
|
+
{ name: 'elements', type: ARRAY(FIELD) },
|
|
440
|
+
],
|
|
441
|
+
returnType: U32,
|
|
442
|
+
}),
|
|
443
|
+
|
|
444
|
+
aztec_utl_popTransient: makeEntry({
|
|
445
|
+
params: [{ name: 'slot', type: FIELD }],
|
|
446
|
+
returnType: ARRAY(FIELD),
|
|
447
|
+
}),
|
|
448
|
+
|
|
449
|
+
aztec_utl_getTransient: makeEntry({
|
|
450
|
+
params: [
|
|
451
|
+
{ name: 'slot', type: FIELD },
|
|
452
|
+
{ name: 'index', type: U32 },
|
|
453
|
+
],
|
|
454
|
+
returnType: ARRAY(FIELD),
|
|
455
|
+
}),
|
|
456
|
+
|
|
457
|
+
aztec_utl_setTransient: makeEntry({
|
|
458
|
+
params: [
|
|
459
|
+
{ name: 'slot', type: FIELD },
|
|
460
|
+
{ name: 'index', type: U32 },
|
|
461
|
+
{ name: 'elements', type: ARRAY(FIELD) },
|
|
462
|
+
],
|
|
463
|
+
}),
|
|
464
|
+
|
|
465
|
+
aztec_utl_getTransientLen: makeEntry({
|
|
466
|
+
params: [{ name: 'slot', type: FIELD }],
|
|
467
|
+
returnType: U32,
|
|
468
|
+
}),
|
|
469
|
+
|
|
470
|
+
aztec_utl_removeTransient: makeEntry({
|
|
471
|
+
params: [
|
|
472
|
+
{ name: 'slot', type: FIELD },
|
|
473
|
+
{ name: 'index', type: U32 },
|
|
474
|
+
],
|
|
475
|
+
}),
|
|
476
|
+
|
|
477
|
+
aztec_utl_clearTransient: makeEntry({
|
|
478
|
+
params: [{ name: 'slot', type: FIELD }],
|
|
479
|
+
}),
|
|
480
|
+
|
|
368
481
|
aztec_prv_setHashPreimage: makeEntry({
|
|
369
482
|
params: [
|
|
370
483
|
{ name: 'values', type: ARRAY(FIELD) },
|
|
@@ -411,7 +524,7 @@ export const ORACLE_REGISTRY = {
|
|
|
411
524
|
|
|
412
525
|
aztec_prv_notifyCreatedContractClassLog: makeEntry({
|
|
413
526
|
params: [
|
|
414
|
-
{ name: 'log', type:
|
|
527
|
+
{ name: 'log', type: CONTRACT_CLASS_LOG },
|
|
415
528
|
{ name: 'counter', type: U32 },
|
|
416
529
|
],
|
|
417
530
|
}),
|
|
@@ -457,28 +570,24 @@ export const ORACLE_REGISTRY = {
|
|
|
457
570
|
}),
|
|
458
571
|
|
|
459
572
|
aztec_prv_getSenderForTags: makeEntry({ returnType: OPTION(AZTEC_ADDRESS) }),
|
|
460
|
-
} satisfies Record<string, OracleRegistryEntry>;
|
|
461
573
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
const result = await handler(positional as any);
|
|
480
|
-
return entry.serializeReturn(result);
|
|
481
|
-
}
|
|
574
|
+
aztec_prv_resolveTaggingStrategy: makeEntry({
|
|
575
|
+
params: [
|
|
576
|
+
{ name: 'sender', type: AZTEC_ADDRESS },
|
|
577
|
+
{ name: 'recipient', type: AZTEC_ADDRESS },
|
|
578
|
+
{ name: 'deliveryMode', type: DELIVERY_MODE },
|
|
579
|
+
],
|
|
580
|
+
returnType: RESOLVED_TAGGING_STRATEGY,
|
|
581
|
+
}),
|
|
582
|
+
|
|
583
|
+
aztec_prv_resolveCustomRequest: makeEntry({
|
|
584
|
+
params: [
|
|
585
|
+
{ name: 'kind', type: FIELD },
|
|
586
|
+
{ name: 'payload', type: ARRAY(FIELD) },
|
|
587
|
+
],
|
|
588
|
+
returnType: ARRAY(FIELD),
|
|
589
|
+
}),
|
|
590
|
+
} satisfies Record<string, OracleRegistryEntry>;
|
|
482
591
|
|
|
483
592
|
// ─── Registry Infrastructure ─────────────────────────────────────────────────
|
|
484
593
|
|
|
@@ -496,6 +605,10 @@ export interface OracleRegistryEntry<
|
|
|
496
605
|
deserializeParams(inputs: InputSlot[]): TDeserializedParams;
|
|
497
606
|
/** Serialize a handler return value into ACVM output slots. */
|
|
498
607
|
serializeReturn(result: TReturnValue): OutputSlot[];
|
|
608
|
+
/** The ordered named parameters with their {@link TypeMapping}s. Lets callers introspect the oracle's wire ABI. */
|
|
609
|
+
readonly params: readonly RegistryParam[];
|
|
610
|
+
/** The return {@link TypeMapping}, or `undefined` for oracles that return nothing. */
|
|
611
|
+
readonly returnType?: TypeMapping<TReturnValue>;
|
|
499
612
|
}
|
|
500
613
|
|
|
501
614
|
export function makeEntry<const TParams extends RegistryParam[] = [], TReturnValue = void>({
|
|
@@ -506,16 +619,18 @@ export function makeEntry<const TParams extends RegistryParam[] = [], TReturnVal
|
|
|
506
619
|
returnType?: TypeMapping<TReturnValue>;
|
|
507
620
|
} = {}): OracleRegistryEntry<InferDeserializedParams<TParams>, TReturnValue> {
|
|
508
621
|
return {
|
|
622
|
+
params: params ?? [],
|
|
623
|
+
returnType,
|
|
509
624
|
deserializeParams(inputs: InputSlot[]): InferDeserializedParams<TParams> {
|
|
510
625
|
const resolvedParams: RegistryParam[] = params ?? [];
|
|
511
626
|
// Walk the input slots left-to-right, advancing by each param's slot count.
|
|
512
627
|
let offset = 0;
|
|
513
|
-
|
|
628
|
+
const named = resolvedParams.map(param => {
|
|
514
629
|
if (!param.type.deserialization) {
|
|
515
630
|
throw new Error(`Param '${param.name}' has no deserialization defined`);
|
|
516
631
|
}
|
|
517
632
|
// Collect the slots for this param and wrap each in a FieldReader.
|
|
518
|
-
const slotCount = param.type
|
|
633
|
+
const slotCount = slotsOf(param.type);
|
|
519
634
|
const readers = inputs
|
|
520
635
|
.slice(offset, offset + slotCount)
|
|
521
636
|
.map(slot => new FieldReader(slot.map(hex => Fr.fromString(hex))));
|
|
@@ -525,7 +640,13 @@ export function makeEntry<const TParams extends RegistryParam[] = [], TReturnVal
|
|
|
525
640
|
const value = param.type.deserialization.fn(readers);
|
|
526
641
|
assertReadersConsumed(readers);
|
|
527
642
|
return { name: param.name, value };
|
|
528
|
-
})
|
|
643
|
+
});
|
|
644
|
+
// Every input slot must be specified by a param: oracles whose Noir decl passes an extra field must declare it
|
|
645
|
+
// (the handler can ignore it). Otherwise an under-declared shape would silently drop a field into nothing.
|
|
646
|
+
if (offset !== inputs.length) {
|
|
647
|
+
throw new Error(`Oracle received ${inputs.length} input slot(s) but the registry specifies ${offset}`);
|
|
648
|
+
}
|
|
649
|
+
return named as unknown as InferDeserializedParams<TParams>;
|
|
529
650
|
},
|
|
530
651
|
serializeReturn(result: TReturnValue): OutputSlot[] {
|
|
531
652
|
if (returnType?.serialization === undefined) {
|
|
@@ -539,7 +660,7 @@ export function makeEntry<const TParams extends RegistryParam[] = [], TReturnVal
|
|
|
539
660
|
}
|
|
540
661
|
|
|
541
662
|
/** A named oracle parameter with its TypeMapping. */
|
|
542
|
-
interface RegistryParam<TName extends string = string, T = any> {
|
|
663
|
+
export interface RegistryParam<TName extends string = string, T = any> {
|
|
543
664
|
name: TName;
|
|
544
665
|
type: TypeMapping<T>;
|
|
545
666
|
}
|
|
@@ -565,14 +686,14 @@ export type ParamTypes<T extends readonly NamedValue[]> = {
|
|
|
565
686
|
* @example `InferDeserializedParams<[RegistryParam<'addr', AztecAddress>, RegistryParam<'slot', Fr>]>`
|
|
566
687
|
* → `[NamedValue<'addr', AztecAddress>, NamedValue<'slot', Fr>]`
|
|
567
688
|
*/
|
|
568
|
-
type InferDeserializedParams<T extends RegistryParam[]> = {
|
|
689
|
+
export type InferDeserializedParams<T extends RegistryParam[]> = {
|
|
569
690
|
[K in keyof T]: T[K] extends RegistryParam<infer N, infer V> ? NamedValue<N, V> : never;
|
|
570
691
|
};
|
|
571
692
|
|
|
572
693
|
// ─── Derived Handler Interfaces ─────────────────────────────────────────────
|
|
573
694
|
|
|
574
695
|
/** Strips the `aztec_{scope}_` prefix from an oracle key to get the handler method name. */
|
|
575
|
-
|
|
696
|
+
type StripOraclePrefix<K extends string> = K extends `aztec_${string}_${infer M}` ? M : never;
|
|
576
697
|
|
|
577
698
|
/** Derives the handler function signature from a registry entry's deserialization/serialization types. */
|
|
578
699
|
type HandlerFn<E extends OracleRegistryEntry> = (
|