@aztec/pxe 0.0.1-commit.9ef841308 → 0.0.1-commit.a4600f49
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 +45 -111
- package/dest/bin/index.d.ts +2 -0
- package/dest/bin/index.d.ts.map +1 -0
- package/dest/bin/index.js +1 -0
- package/dest/bin/oracle_version_helpers.d.ts +51 -0
- package/dest/bin/oracle_version_helpers.d.ts.map +1 -0
- package/dest/bin/oracle_version_helpers.js +254 -0
- package/dest/block_synchronizer/block_stream_source.d.ts +10 -0
- package/dest/block_synchronizer/block_stream_source.d.ts.map +1 -0
- package/dest/block_synchronizer/block_stream_source.js +37 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts +23 -15
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +78 -28
- package/dest/config/index.d.ts +8 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +13 -14
- 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/contract_sync_service.js +116 -0
- 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/contract_function_simulator.d.ts +27 -21
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +82 -39
- package/dest/contract_function_simulator/ephemeral_array_service.d.ts +28 -0
- package/dest/contract_function_simulator/ephemeral_array_service.d.ts.map +1 -0
- package/dest/contract_function_simulator/ephemeral_array_service.js +78 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts +4 -10
- 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/execution_tagging_index_cache.d.ts +5 -9
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +3 -7
- package/dest/contract_function_simulator/index.d.ts +26 -6
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +12 -4
- package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts +29 -0
- package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/bounded_vec.js +30 -0
- 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/ephemeral_array.d.ts +37 -0
- package/dest/contract_function_simulator/noir-structs/ephemeral_array.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/ephemeral_array.js +59 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -3
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +5 -4
- 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 +19 -10
- 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 +12 -24
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +11 -9
- 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 +2 -61
- package/dest/contract_function_simulator/noir-structs/note_data.d.ts +27 -0
- package/dest/contract_function_simulator/noir-structs/note_data.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/note_data.js +3 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +4 -3
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +6 -5
- package/dest/contract_function_simulator/noir-structs/option.d.ts +59 -0
- package/dest/contract_function_simulator/noir-structs/option.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/option.js +67 -0
- 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 +8 -0
- package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/provided_secret.js +1 -0
- 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 +43 -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 +15 -103
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.js +2 -2
- 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 +74 -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/note_packing_utils.d.ts +2 -2
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +2 -2
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +136 -0
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle_registry.js +989 -0
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +222 -0
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +1243 -0
- 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 +47 -37
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +186 -55
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +136 -65
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +448 -170
- package/dest/contract_function_simulator/pick_notes.d.ts +1 -1
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
- package/dest/contract_function_simulator/pick_notes.js +20 -3
- 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 +4 -9
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +0 -6
- package/dest/entrypoints/client/bundle/index.d.ts +1 -2
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +0 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +2 -2
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +20 -7
- package/dest/entrypoints/client/lazy/index.d.ts +1 -2
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +0 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +20 -7
- package/dest/entrypoints/pxe_creation_options.d.ts +16 -2
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/pxe_creation_options.js +3 -1
- package/dest/entrypoints/server/index.d.ts +6 -4
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +4 -3
- package/dest/entrypoints/server/utils.d.ts +4 -3
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +20 -6
- 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/events/event_service.d.ts +13 -5
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +30 -9
- package/dest/events/private_event_filter_validator.d.ts +3 -2
- package/dest/events/private_event_filter_validator.d.ts.map +1 -1
- package/dest/events/private_event_filter_validator.js +15 -0
- package/dest/hooks/authorize_utility_call.d.ts +41 -0
- package/dest/hooks/authorize_utility_call.d.ts.map +1 -0
- package/dest/hooks/authorize_utility_call.js +4 -0
- package/dest/hooks/execution_hooks.d.ts +62 -0
- package/dest/hooks/execution_hooks.d.ts.map +1 -0
- package/dest/hooks/execution_hooks.js +9 -0
- package/dest/hooks/index.d.ts +5 -0
- package/dest/hooks/index.d.ts.map +1 -0
- 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 +48 -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 +13 -11
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +181 -72
- package/dest/messages/tx_resolver_service.d.ts +17 -0
- package/dest/messages/tx_resolver_service.d.ts.map +1 -0
- package/dest/messages/tx_resolver_service.js +55 -0
- package/dest/notes/note_service.d.ts +27 -6
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +80 -65
- package/dest/notes_filter.d.ts +2 -3
- package/dest/notes_filter.d.ts.map +1 -1
- package/dest/oracle_version.d.ts +4 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +20 -10
- package/dest/private_kernel/batch_planner.d.ts +47 -0
- package/dest/private_kernel/batch_planner.d.ts.map +1 -0
- package/dest/private_kernel/batch_planner.js +104 -0
- 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 +7 -3
- package/dest/private_kernel/hints/test_utils.d.ts +1 -1
- package/dest/private_kernel/hints/test_utils.d.ts.map +1 -1
- package/dest/private_kernel/hints/test_utils.js +3 -4
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +6 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +203 -89
- package/dest/private_kernel/private_kernel_oracle.d.ts +12 -10
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +40 -26
- package/dest/pxe.d.ts +167 -55
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +334 -206
- 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 +9 -7
- package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts +42 -0
- package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.d.ts.map +1 -0
- package/dest/storage/backwards_compatibility_tests/kv_store_snapshot.js +93 -0
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +15 -0
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -0
- package/dest/storage/backwards_compatibility_tests/schema_tests.js +647 -0
- package/dest/storage/backwards_compatibility_tests/store_spy.d.ts +19 -0
- package/dest/storage/backwards_compatibility_tests/store_spy.d.ts.map +1 -0
- package/dest/storage/backwards_compatibility_tests/store_spy.js +63 -0
- package/dest/storage/capsule_store/capsule_service.d.ts +2 -3
- 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/capsule_store/capsule_store.d.ts +1 -1
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_store.js +8 -5
- 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 +70 -98
- 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 +199 -170
- 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 +35 -0
- package/dest/storage/open_pxe_stores.d.ts.map +1 -0
- package/dest/storage/open_pxe_stores.js +29 -0
- 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 +43 -43
- package/dest/storage/private_event_store/stored_private_event.js +1 -1
- 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/recipient_tagging_store.d.ts +6 -6
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +5 -5
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +3 -3
- 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 +5 -8
- package/dest/tagging/get_all_logs_by_tags.d.ts +34 -10
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
- package/dest/tagging/get_all_logs_by_tags.js +36 -37
- package/dest/tagging/index.d.ts +5 -4
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +4 -3
- package/dest/tagging/persist_sender_tagging_index_ranges.d.ts +29 -0
- package/dest/tagging/persist_sender_tagging_index_ranges.d.ts.map +1 -0
- package/dest/tagging/persist_sender_tagging_index_ranges.js +42 -0
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +69 -0
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.js +203 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +3 -3
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -1
- package/dest/tagging/reconcile_tagging_index_ranges.d.ts +36 -0
- package/dest/tagging/reconcile_tagging_index_ranges.d.ts.map +1 -0
- package/dest/tagging/reconcile_tagging_index_ranges.js +74 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -5
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +26 -14
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -6
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +21 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +4 -4
- 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 +2 -2
- package/package.json +20 -17
- package/src/bin/check_oracle_version.ts +51 -133
- package/src/bin/index.ts +5 -0
- package/src/bin/oracle_version_helpers.ts +311 -0
- package/src/block_synchronizer/block_stream_source.ts +42 -0
- package/src/block_synchronizer/block_synchronizer.ts +96 -39
- package/src/config/index.ts +15 -8
- package/src/config/package_info.ts +1 -1
- package/src/contract/contract_class_service.ts +83 -0
- package/src/contract/contract_sync_service.ts +176 -0
- package/src/contract/helpers.ts +35 -0
- package/src/contract_function_simulator/anchored_contract_data.ts +74 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +136 -55
- package/src/contract_function_simulator/ephemeral_array_service.ts +110 -0
- package/src/contract_function_simulator/execution_note_cache.ts +8 -29
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +5 -9
- package/src/contract_function_simulator/index.ts +69 -5
- package/src/contract_function_simulator/noir-structs/bounded_vec.ts +43 -0
- 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/ephemeral_array.ts +66 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +5 -4
- 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 +27 -20
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +14 -61
- package/src/contract_function_simulator/noir-structs/note_data.ts +27 -0
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +6 -5
- package/src/contract_function_simulator/noir-structs/option.ts +75 -0
- 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 +5 -0
- package/src/contract_function_simulator/noir-structs/resolved_tagging_strategy.ts +58 -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 +11 -185
- package/src/contract_function_simulator/oracle/legacy_oracle_registry.ts +120 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +6 -21
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +3 -3
- package/src/contract_function_simulator/oracle/oracle_registry.ts +689 -0
- package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +964 -0
- package/src/contract_function_simulator/oracle/private_execution.ts +2 -3
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +233 -79
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +681 -320
- package/src/contract_function_simulator/pick_notes.ts +22 -3
- package/src/contract_function_simulator/transient_array_service.ts +91 -0
- package/src/debug/pxe_debug_utils.ts +4 -12
- package/src/entrypoints/client/bundle/index.ts +0 -1
- package/src/entrypoints/client/bundle/utils.ts +19 -7
- package/src/entrypoints/client/lazy/index.ts +0 -1
- package/src/entrypoints/client/lazy/utils.ts +19 -7
- package/src/entrypoints/pxe_creation_options.ts +21 -1
- package/src/entrypoints/server/index.ts +6 -3
- package/src/entrypoints/server/utils.ts +24 -7
- package/src/error_enriching.ts +27 -11
- package/src/events/event_service.ts +54 -19
- package/src/events/private_event_filter_validator.ts +21 -1
- package/src/hooks/authorize_utility_call.ts +44 -0
- package/src/hooks/execution_hooks.ts +68 -0
- package/src/hooks/index.ts +12 -0
- package/src/hooks/resolve_custom_request.ts +24 -0
- package/src/hooks/resolve_tagging_secret_strategy.ts +57 -0
- package/src/logs/log_service.ts +212 -139
- package/src/messages/tx_resolver_service.ts +69 -0
- package/src/notes/note_service.ts +117 -94
- package/src/notes_filter.ts +1 -3
- package/src/oracle_version.ts +20 -10
- package/src/private_kernel/batch_planner.ts +168 -0
- package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +12 -2
- package/src/private_kernel/hints/test_utils.ts +3 -10
- package/src/private_kernel/private_kernel_execution_prover.ts +335 -121
- package/src/private_kernel/private_kernel_oracle.ts +58 -29
- package/src/pxe.ts +530 -236
- package/src/storage/allowed_scopes.ts +14 -0
- package/src/storage/anchor_block_store/anchor_block_store.ts +9 -7
- package/src/storage/backwards_compatibility_tests/__snapshots__/AddressStore.json +22 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/AnchorBlockStore.json +3 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/CapsuleStore.json +16 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/ContractStore.json +28 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/FactStore.json +40 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/KeyStore.json +52 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/L2TipsKVStore.json +40 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/NoteStore.json +56 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/PrivateEventStore.json +44 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/RecipientTaggingStore.json +18 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/SenderTaggingStore.json +22 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/TaggingSecretSourcesStore.json +30 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +117 -0
- package/src/storage/backwards_compatibility_tests/kv_store_snapshot.ts +122 -0
- package/src/storage/backwards_compatibility_tests/schema_tests.ts +774 -0
- package/src/storage/backwards_compatibility_tests/store_spy.ts +73 -0
- package/src/storage/capsule_store/capsule_service.ts +8 -14
- package/src/storage/capsule_store/capsule_store.ts +15 -5
- package/src/storage/contract_store/contract_store.ts +96 -124
- 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 +228 -192
- package/src/storage/note_store/stored_note.ts +5 -27
- package/src/storage/open_pxe_stores.ts +52 -0
- package/src/storage/private_event_store/private_event_store.ts +52 -54
- package/src/storage/private_event_store/stored_private_event.ts +1 -1
- package/src/storage/tagging_store/index.ts +1 -1
- package/src/storage/tagging_store/recipient_tagging_store.ts +5 -9
- package/src/storage/tagging_store/sender_tagging_store.ts +6 -6
- package/src/storage/tagging_store/tagging_secret_sources_store.ts +138 -0
- package/src/tagging/constants.ts +6 -8
- package/src/tagging/get_all_logs_by_tags.ts +78 -50
- package/src/tagging/index.ts +4 -3
- package/src/tagging/persist_sender_tagging_index_ranges.ts +57 -0
- package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +301 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
- package/src/tagging/reconcile_tagging_index_ranges.ts +102 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +41 -19
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +23 -8
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +4 -5
- package/dest/access_scopes.d.ts +0 -9
- package/dest/access_scopes.d.ts.map +0 -1
- package/dest/access_scopes.js +0 -6
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +0 -9
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +0 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +0 -38
- package/dest/contract_function_simulator/oracle/oracle.d.ts +0 -80
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +0 -1
- package/dest/contract_function_simulator/oracle/oracle.js +0 -458
- 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 -80
- package/dest/contract_sync/contract_sync_service.d.ts +0 -46
- package/dest/contract_sync/contract_sync_service.d.ts.map +0 -1
- package/dest/contract_sync/contract_sync_service.js +0 -124
- package/dest/contract_sync/helpers.d.ts +0 -29
- package/dest/contract_sync/helpers.d.ts.map +0 -1
- package/dest/contract_sync/helpers.js +0 -60
- package/dest/messages/message_context_service.d.ts +0 -17
- package/dest/messages/message_context_service.d.ts.map +0 -1
- package/dest/messages/message_context_service.js +0 -36
- 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/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +0 -14
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +0 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +0 -99
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +0 -14
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +0 -1
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +0 -33
- package/src/access_scopes.ts +0 -9
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +0 -98
- package/src/contract_function_simulator/oracle/oracle.ts +0 -721
- package/src/contract_function_simulator/proxied_contract_data_source.ts +0 -83
- package/src/contract_sync/contract_sync_service.ts +0 -192
- package/src/contract_sync/helpers.ts +0 -99
- package/src/messages/message_context_service.ts +0 -44
- package/src/storage/tagging_store/sender_address_book_store.ts +0 -48
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +0 -140
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +0 -44
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
/** Facts are always tied to a real scope; the zero address is not a valid fact scope. */ function assertNonZeroScope(scope) {
|
|
4
|
+
if (scope.equals(AztecAddress.ZERO)) {
|
|
5
|
+
throw new Error('scope must not be the zero address');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Identifies all fact collections of one type within a contract, for one scope. */ export class FactCollectionTypeKey {
|
|
9
|
+
contractAddress;
|
|
10
|
+
scope;
|
|
11
|
+
factCollectionTypeId;
|
|
12
|
+
constructor(contractAddress, scope, factCollectionTypeId){
|
|
13
|
+
this.contractAddress = contractAddress;
|
|
14
|
+
this.scope = scope;
|
|
15
|
+
this.factCollectionTypeId = factCollectionTypeId;
|
|
16
|
+
assertNonZeroScope(scope);
|
|
17
|
+
}
|
|
18
|
+
static from(fields) {
|
|
19
|
+
return new FactCollectionTypeKey(fields.contractAddress, fields.scope, fields.factCollectionTypeId);
|
|
20
|
+
}
|
|
21
|
+
toString() {
|
|
22
|
+
return `${this.contractAddress}:${this.scope}:${this.factCollectionTypeId}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Uniquely identifies a single fact collection, isolated by scope; all its facts share this key. */ export class FactCollectionKey {
|
|
26
|
+
contractAddress;
|
|
27
|
+
scope;
|
|
28
|
+
factCollectionTypeId;
|
|
29
|
+
factCollectionId;
|
|
30
|
+
constructor(contractAddress, scope, factCollectionTypeId, factCollectionId){
|
|
31
|
+
this.contractAddress = contractAddress;
|
|
32
|
+
this.scope = scope;
|
|
33
|
+
this.factCollectionTypeId = factCollectionTypeId;
|
|
34
|
+
this.factCollectionId = factCollectionId;
|
|
35
|
+
assertNonZeroScope(scope);
|
|
36
|
+
}
|
|
37
|
+
static from(fields) {
|
|
38
|
+
return new FactCollectionKey(fields.contractAddress, fields.scope, fields.factCollectionTypeId, fields.factCollectionId);
|
|
39
|
+
}
|
|
40
|
+
/** Inverse of toString */ static fromString(str) {
|
|
41
|
+
const [contractAddress, scope, factCollectionTypeId, factCollectionId] = str.split(':');
|
|
42
|
+
return new FactCollectionKey(AztecAddress.fromStringUnsafe(contractAddress), AztecAddress.fromStringUnsafe(scope), Fr.fromString(factCollectionTypeId), Fr.fromString(factCollectionId));
|
|
43
|
+
}
|
|
44
|
+
/** The key grouping this collection with the other collections of its type within the same contract and scope. */ factCollectionTypeKey() {
|
|
45
|
+
return new FactCollectionTypeKey(this.contractAddress, this.scope, this.factCollectionTypeId);
|
|
46
|
+
}
|
|
47
|
+
toString() {
|
|
48
|
+
return `${this.contractAddress}:${this.scope}:${this.factCollectionTypeId}:${this.factCollectionId}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { FactStore, type FactCollection } from './fact_store.js';
|
|
2
|
+
export { FactService } from './fact_service.js';
|
|
3
|
+
export { FactCollectionKey, FactCollectionTypeKey, type OriginBlock } from './fact_store_keys.js';
|
|
4
|
+
export type { Fact } from './stored_fact.js';
|
|
5
|
+
export { OriginBlockState, classifyOriginBlockState, anchoredTipBlockNumbers, toFactWithOriginState, type TipBlockNumbers, type RetractableFactOrigin, type FactWithOriginState, type FactCollectionWithOriginState, } from './origin_state.js';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2ZhY3Rfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLGNBQWMsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ2pFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNoRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUscUJBQXFCLEVBQUUsS0FBSyxXQUFXLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRyxZQUFZLEVBQUUsSUFBSSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDN0MsT0FBTyxFQUNMLGdCQUFnQixFQUNoQix3QkFBd0IsRUFDeEIsdUJBQXVCLEVBQ3ZCLHFCQUFxQixFQUNyQixLQUFLLGVBQWUsRUFDcEIsS0FBSyxxQkFBcUIsRUFDMUIsS0FBSyxtQkFBbUIsRUFDeEIsS0FBSyw2QkFBNkIsR0FDbkMsTUFBTSxtQkFBbUIsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/fact_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAClG,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,GACnC,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { FactStore } from './fact_store.js';
|
|
2
|
+
export { FactService } from './fact_service.js';
|
|
3
|
+
export { FactCollectionKey, FactCollectionTypeKey } from './fact_store_keys.js';
|
|
4
|
+
export { OriginBlockState, classifyOriginBlockState, anchoredTipBlockNumbers, toFactWithOriginState } from './origin_state.js';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { L2Tips } from '@aztec/stdlib/block';
|
|
3
|
+
import type { FactCollectionKey, OriginBlock } from './fact_store_keys.js';
|
|
4
|
+
import type { Fact } from './stored_fact.js';
|
|
5
|
+
/**
|
|
6
|
+
* Chain state of a retractable fact's origin block, mirroring the L2 chain tips.
|
|
7
|
+
*
|
|
8
|
+
* - `Pending`: above the proven tip.
|
|
9
|
+
* - `Proven`: proof on L1 but not yet finalized.
|
|
10
|
+
* - `Finalized`: L1-finalized.
|
|
11
|
+
*
|
|
12
|
+
* The numeric discriminants must stay in sync with the Noir `OriginBlockState` in
|
|
13
|
+
* `noir-projects/aztec-nr/aztec/src/facts/origin_state.nr`: PXE serializes this value into the `Fact` oracle response
|
|
14
|
+
* and Noir deserializes it via `from_u8`, which rejects any value outside this set.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum OriginBlockState {
|
|
17
|
+
Pending = 1,
|
|
18
|
+
Proven = 2,
|
|
19
|
+
Finalized = 3
|
|
20
|
+
}
|
|
21
|
+
/** The two chain-tip block numbers needed to classify an origin block (`finalized <= proven` always holds). */
|
|
22
|
+
export type TipBlockNumbers = {
|
|
23
|
+
provenBlockNumber: number;
|
|
24
|
+
finalizedBlockNumber: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Projects the live chain tips to the block numbers used for classification, capped at the anchor block.
|
|
28
|
+
*
|
|
29
|
+
* A utility execution reads against a fixed anchor block, and every other node query in the oracle is bounded by it.
|
|
30
|
+
* Capping the proven/finalized tips at the anchor keeps origin-state consistent with that view and deterministic
|
|
31
|
+
* across runs: an origin block at or before the anchor classifies exactly as it would against the live tips, while an
|
|
32
|
+
* origin block above the anchor is reported `Pending` rather than trusting tips that look past the anchor.
|
|
33
|
+
*/
|
|
34
|
+
export declare function anchoredTipBlockNumbers(tips: L2Tips, anchorBlockNumber: number): TipBlockNumbers;
|
|
35
|
+
/** A retractable fact's origin block annotated with that block's current chain state. */
|
|
36
|
+
export type RetractableFactOrigin = OriginBlock & {
|
|
37
|
+
blockState: OriginBlockState;
|
|
38
|
+
};
|
|
39
|
+
/** A fact enriched with origin-block state. `originBlock` is undefined for a non-retractable fact. */
|
|
40
|
+
export type FactWithOriginState = {
|
|
41
|
+
factTypeId: Fr;
|
|
42
|
+
payload: Fr[];
|
|
43
|
+
originBlock: RetractableFactOrigin | undefined;
|
|
44
|
+
};
|
|
45
|
+
/** A fact collection whose facts carry origin-block state. */
|
|
46
|
+
export type FactCollectionWithOriginState = {
|
|
47
|
+
key: FactCollectionKey;
|
|
48
|
+
facts: FactWithOriginState[];
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Classifies an origin block by number against the chain tips. A surviving retractable fact's origin block is
|
|
52
|
+
* guaranteed canonical (a reorg would have pruned the fact), so a number comparison is sufficient.
|
|
53
|
+
*/
|
|
54
|
+
export declare function classifyOriginBlockState(blockNumber: number, tips: TipBlockNumbers): OriginBlockState;
|
|
55
|
+
/** Enriches a stored fact with the chain state of its origin block (when retractable). */
|
|
56
|
+
export declare function toFactWithOriginState(fact: Fact, tips: TipBlockNumbers): FactWithOriginState;
|
|
57
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JpZ2luX3N0YXRlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9mYWN0X3N0b3JlL29yaWdpbl9zdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUVsRCxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBRSxXQUFXLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUMzRSxPQUFPLEtBQUssRUFBRSxJQU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WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,gBAAgB,CAQrG;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,GAAG,mBAAmB,CAS5F"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chain state of a retractable fact's origin block, mirroring the L2 chain tips.
|
|
3
|
+
*
|
|
4
|
+
* - `Pending`: above the proven tip.
|
|
5
|
+
* - `Proven`: proof on L1 but not yet finalized.
|
|
6
|
+
* - `Finalized`: L1-finalized.
|
|
7
|
+
*
|
|
8
|
+
* The numeric discriminants must stay in sync with the Noir `OriginBlockState` in
|
|
9
|
+
* `noir-projects/aztec-nr/aztec/src/facts/origin_state.nr`: PXE serializes this value into the `Fact` oracle response
|
|
10
|
+
* and Noir deserializes it via `from_u8`, which rejects any value outside this set.
|
|
11
|
+
*/ export var OriginBlockState = /*#__PURE__*/ function(OriginBlockState) {
|
|
12
|
+
OriginBlockState[OriginBlockState["Pending"] = 1] = "Pending";
|
|
13
|
+
OriginBlockState[OriginBlockState["Proven"] = 2] = "Proven";
|
|
14
|
+
OriginBlockState[OriginBlockState["Finalized"] = 3] = "Finalized";
|
|
15
|
+
return OriginBlockState;
|
|
16
|
+
}({});
|
|
17
|
+
/**
|
|
18
|
+
* Projects the live chain tips to the block numbers used for classification, capped at the anchor block.
|
|
19
|
+
*
|
|
20
|
+
* A utility execution reads against a fixed anchor block, and every other node query in the oracle is bounded by it.
|
|
21
|
+
* Capping the proven/finalized tips at the anchor keeps origin-state consistent with that view and deterministic
|
|
22
|
+
* across runs: an origin block at or before the anchor classifies exactly as it would against the live tips, while an
|
|
23
|
+
* origin block above the anchor is reported `Pending` rather than trusting tips that look past the anchor.
|
|
24
|
+
*/ export function anchoredTipBlockNumbers(tips, anchorBlockNumber) {
|
|
25
|
+
return {
|
|
26
|
+
provenBlockNumber: Math.min(tips.proven.block.number, anchorBlockNumber),
|
|
27
|
+
finalizedBlockNumber: Math.min(tips.finalized.block.number, anchorBlockNumber)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Classifies an origin block by number against the chain tips. A surviving retractable fact's origin block is
|
|
32
|
+
* guaranteed canonical (a reorg would have pruned the fact), so a number comparison is sufficient.
|
|
33
|
+
*/ export function classifyOriginBlockState(blockNumber, tips) {
|
|
34
|
+
if (blockNumber <= tips.finalizedBlockNumber) {
|
|
35
|
+
return 3;
|
|
36
|
+
}
|
|
37
|
+
if (blockNumber <= tips.provenBlockNumber) {
|
|
38
|
+
return 2;
|
|
39
|
+
}
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
/** Enriches a stored fact with the chain state of its origin block (when retractable). */ export function toFactWithOriginState(fact, tips) {
|
|
43
|
+
const originBlock = fact.originBlock ? {
|
|
44
|
+
blockNumber: fact.originBlock.blockNumber,
|
|
45
|
+
blockHash: fact.originBlock.blockHash,
|
|
46
|
+
blockState: classifyOriginBlockState(fact.originBlock.blockNumber, tips)
|
|
47
|
+
} : undefined;
|
|
48
|
+
return {
|
|
49
|
+
factTypeId: fact.factTypeId,
|
|
50
|
+
payload: fact.payload,
|
|
51
|
+
originBlock
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
+
import { FactCollectionKey, type OriginBlock } from './fact_store_keys.js';
|
|
4
|
+
/** A fact as returned by the fact store. */
|
|
5
|
+
export type Fact = {
|
|
6
|
+
factTypeId: Fr;
|
|
7
|
+
payload: Fr[];
|
|
8
|
+
originBlock: OriginBlock | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A single immutable fact belonging to a fact collection.
|
|
12
|
+
*/
|
|
13
|
+
export declare class StoredFact {
|
|
14
|
+
readonly factCollectionKey: FactCollectionKey;
|
|
15
|
+
readonly factTypeId: Fr;
|
|
16
|
+
readonly payload: Fr[];
|
|
17
|
+
readonly originBlock: OriginBlock | undefined;
|
|
18
|
+
constructor(factCollectionKey: FactCollectionKey, factTypeId: Fr, payload: Fr[], originBlock: OriginBlock | undefined);
|
|
19
|
+
/** Whether this fact is deleted on block pruning (true) or survives reorgs (false). */
|
|
20
|
+
get isRetractable(): boolean;
|
|
21
|
+
/** Stable digest of the payload, used for fact idempotency. */
|
|
22
|
+
payloadHash(): Fr;
|
|
23
|
+
/** Returns the externally facing view of this fact. */
|
|
24
|
+
toFact(): Fact;
|
|
25
|
+
toBuffer(): Buffer;
|
|
26
|
+
static fromBuffer(buffer: Buffer | BufferReader): StoredFact;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Builds the serialized key that identifies a fact in the store.
|
|
30
|
+
*/
|
|
31
|
+
export declare function factKeyStrOf(fact: StoredFact): string;
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmVkX2ZhY3QuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2ZhY3Rfc3RvcmUvc3RvcmVkX2ZhY3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxZQUFZLEVBQXFCLE1BQU0sNkJBQTZCLENBQUM7QUFHOUUsT0FBTyxFQUFFLGlCQUFpQixFQUFFLEtBQUssV0FBVyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFM0UsNENBQTRDO0FBQzVDLE1BQU0sTUFBTSxJQUFJLEdBQUc7SUFBRSxVQUFVLEVBQUUsRUFBRSxDQUFDO0lBQUMsT0FBTyxFQUFFLEVBQUUsRUFBRSxDQUFDO0lBQUMs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G;IAAE,UAAU,EAAE,EAAE,CAAC;IAAC,OAAO,EAAE,EAAE,EAAE,CAAC;IAAC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,CAAC;AAE3F;;GAEG;AACH,qBAAa,UAAU;aAEH,iBAAiB,EAAE,iBAAiB;aACpC,UAAU,EAAE,EAAE;aACd,OAAO,EAAE,EAAE,EAAE;aACb,WAAW,EAAE,WAAW,GAAG,SAAS;IAJtD,YACkB,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,EAAE,EACd,OAAO,EAAE,EAAE,EAAE,EACb,WAAW,EAAE,WAAW,GAAG,SAAS,EAClD;IAEJ,uFAAuF;IACvF,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,+DAA+D;IAC/D,WAAW,IAAI,EAAE,CAEhB;IAED,uDAAuD;IACvD,MAAM,IAAI,IAAI,CAEb;IAED,QAAQ,IAAI,MAAM,CAajB;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU,CAmB3D;CACF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAGrD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { sha256ToField } from '@aztec/foundation/crypto/sha256';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { FactCollectionKey } from './fact_store_keys.js';
|
|
6
|
+
/**
|
|
7
|
+
* A single immutable fact belonging to a fact collection.
|
|
8
|
+
*/ export class StoredFact {
|
|
9
|
+
factCollectionKey;
|
|
10
|
+
factTypeId;
|
|
11
|
+
payload;
|
|
12
|
+
originBlock;
|
|
13
|
+
constructor(factCollectionKey, factTypeId, payload, originBlock){
|
|
14
|
+
this.factCollectionKey = factCollectionKey;
|
|
15
|
+
this.factTypeId = factTypeId;
|
|
16
|
+
this.payload = payload;
|
|
17
|
+
this.originBlock = originBlock;
|
|
18
|
+
}
|
|
19
|
+
/** Whether this fact is deleted on block pruning (true) or survives reorgs (false). */ get isRetractable() {
|
|
20
|
+
return this.originBlock !== undefined;
|
|
21
|
+
}
|
|
22
|
+
/** Stable digest of the payload, used for fact idempotency. */ payloadHash() {
|
|
23
|
+
return sha256ToField([
|
|
24
|
+
this.payload.length,
|
|
25
|
+
...this.payload
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
/** Returns the externally facing view of this fact. */ toFact() {
|
|
29
|
+
return {
|
|
30
|
+
factTypeId: this.factTypeId,
|
|
31
|
+
payload: this.payload,
|
|
32
|
+
originBlock: this.originBlock
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
toBuffer() {
|
|
36
|
+
return serializeToBuffer(this.factCollectionKey.contractAddress, this.factCollectionKey.scope, this.factCollectionKey.factCollectionTypeId, this.factCollectionKey.factCollectionId, this.factTypeId, this.payload.length, ...this.payload, this.originBlock !== undefined, this.originBlock ? this.originBlock.blockNumber : 0, this.originBlock ? this.originBlock.blockHash : Fr.ZERO);
|
|
37
|
+
}
|
|
38
|
+
static fromBuffer(buffer) {
|
|
39
|
+
const reader = BufferReader.asReader(buffer);
|
|
40
|
+
const contractAddress = reader.readObject(AztecAddress);
|
|
41
|
+
const scope = reader.readObject(AztecAddress);
|
|
42
|
+
const factCollectionTypeId = reader.readObject(Fr);
|
|
43
|
+
const factCollectionId = reader.readObject(Fr);
|
|
44
|
+
const factTypeId = reader.readObject(Fr);
|
|
45
|
+
const payloadLen = reader.readNumber();
|
|
46
|
+
const payload = reader.readArray(payloadLen, Fr);
|
|
47
|
+
const hasOriginBlock = reader.readBoolean();
|
|
48
|
+
const blockNumber = reader.readNumber();
|
|
49
|
+
const blockHash = reader.readObject(Fr);
|
|
50
|
+
const originBlock = hasOriginBlock ? {
|
|
51
|
+
blockNumber,
|
|
52
|
+
blockHash
|
|
53
|
+
} : undefined;
|
|
54
|
+
return new StoredFact(new FactCollectionKey(contractAddress, scope, factCollectionTypeId, factCollectionId), factTypeId, [
|
|
55
|
+
...payload
|
|
56
|
+
], originBlock);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Builds the serialized key that identifies a fact in the store.
|
|
61
|
+
*/ export function factKeyStrOf(fact) {
|
|
62
|
+
const origin = fact.originBlock ? `${fact.originBlock.blockNumber}:${fact.originBlock.blockHash}` : 'none';
|
|
63
|
+
return `${fact.factCollectionKey}:${fact.factTypeId}:${fact.payloadHash()}:${origin}`;
|
|
64
|
+
}
|
package/dest/storage/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export * from './address_store/index.js';
|
|
2
|
+
export * from './anchor_block_store/index.js';
|
|
2
3
|
export * from './capsule_store/index.js';
|
|
3
4
|
export * from './contract_store/index.js';
|
|
5
|
+
export * from './fact_store/index.js';
|
|
4
6
|
export * from './note_store/index.js';
|
|
5
|
-
export * from './anchor_block_store/index.js';
|
|
6
7
|
export * from './tagging_store/index.js';
|
|
7
8
|
export * from './metadata.js';
|
|
8
9
|
export * from './private_event_store/private_event_store.js';
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyw4Q0FBOEMsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,8CAA8C,CAAC"}
|
package/dest/storage/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './address_store/index.js';
|
|
2
|
+
export * from './anchor_block_store/index.js';
|
|
2
3
|
export * from './capsule_store/index.js';
|
|
3
4
|
export * from './contract_store/index.js';
|
|
5
|
+
export * from './fact_store/index.js';
|
|
4
6
|
export * from './note_store/index.js';
|
|
5
|
-
export * from './anchor_block_store/index.js';
|
|
6
7
|
export * from './tagging_store/index.js';
|
|
7
8
|
export * from './metadata.js';
|
|
8
9
|
export * from './private_event_store/private_event_store.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PXE_DATA_SCHEMA_VERSION =
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export declare const PXE_DATA_SCHEMA_VERSION = 12;
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0YWRhdGEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL21ldGFkYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQU8sTUFBTSx1QkFBdUIsS0FBSyxDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/storage/metadata.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/storage/metadata.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,KAAK,CAAC"}
|
package/dest/storage/metadata.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PXE_DATA_SCHEMA_VERSION =
|
|
1
|
+
export const PXE_DATA_SCHEMA_VERSION = 12;
|
|
@@ -6,14 +6,19 @@ import { NoteDao } from '@aztec/stdlib/note';
|
|
|
6
6
|
import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
|
|
7
7
|
import type { NotesFilter } from '../../notes_filter.js';
|
|
8
8
|
/**
|
|
9
|
-
* NoteStore manages the storage and retrieval of notes.
|
|
9
|
+
* NoteStore manages the storage and retrieval of notes using an append-only model.
|
|
10
10
|
*
|
|
11
|
-
* Notes
|
|
12
|
-
* the
|
|
13
|
-
|
|
11
|
+
* Notes are written once (keyed by siloedNullifier) and never mutated. They might be deleted in case of reorg though.
|
|
12
|
+
* Nullifier emissions are recorded as separate append-only entries: a map from nullifier to the number of the block
|
|
13
|
+
* that emitted it.
|
|
14
|
+
*
|
|
15
|
+
* Reorgs are handled by delete-on-prune: the `chain-pruned` event triggers deletion of every note and nullifier
|
|
16
|
+
* originating on a reorg'd block.
|
|
17
|
+
*/
|
|
14
18
|
export declare class NoteStore implements StagedStore {
|
|
15
19
|
#private;
|
|
16
20
|
readonly storeName: string;
|
|
21
|
+
logger: import("@aztec/foundation/log").Logger;
|
|
17
22
|
constructor(store: AztecAsyncKVStore);
|
|
18
23
|
/**
|
|
19
24
|
* Adds multiple notes to the notes store under the specified scope.
|
|
@@ -29,46 +34,37 @@ export declare class NoteStore implements StagedStore {
|
|
|
29
34
|
/**
|
|
30
35
|
* Retrieves notes based on the provided filter criteria.
|
|
31
36
|
*
|
|
32
|
-
*
|
|
37
|
+
* A note is considered nullified iff its corresponding nullifier emission has been recorded.
|
|
38
|
+
*
|
|
39
|
+
* All DB reads are kicked off before any await so IndexedDB does not auto-commit the transaction mid-read.
|
|
33
40
|
*
|
|
34
41
|
* @param filter - Filter criteria including contractAddress (required), and optional owner,
|
|
35
42
|
* storageSlot, status, scopes, and siloedNullifier.
|
|
36
|
-
* @
|
|
37
|
-
* @returns Filtered and deduplicated notes (a note might be present in multiple scopes
|
|
38
|
-
* returned once if this is the case)
|
|
43
|
+
* @param jobId - the job context to read from.
|
|
44
|
+
* @returns Filtered and deduplicated notes (a note might be present in multiple scopes, but returned at most once)
|
|
39
45
|
*/
|
|
40
46
|
getNotes(filter: NotesFilter, jobId: string): Promise<NoteDao[]>;
|
|
41
47
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* This operation processes a batch of nullifiers to mark the corresponding notes as spent/nullified.
|
|
45
|
-
* The operation is atomic - if any nullifier is not found, the entire operation fails and no notes are modified.
|
|
48
|
+
* Records emission of the given siloed nullifiers, which causes notes to be considered nullified.
|
|
46
49
|
*
|
|
47
|
-
*
|
|
48
|
-
* This relaxes constraints on usage of NoteService#validateAndStoreNote, which can then be run concurrently in a Promise.all
|
|
49
|
-
* context without risking unnecessarily defensive checks failing.
|
|
50
|
-
*
|
|
51
|
-
* @param nullifiers - Array of nullifiers with their block numbers to process
|
|
52
|
-
* @param jobId - The job context for staged writes
|
|
53
|
-
* @returns Array of NoteDao objects that were nullified
|
|
54
|
-
* @throws Error if any nullifier is not found in this notes store
|
|
55
|
-
*/
|
|
56
|
-
applyNullifiers(nullifiers: DataInBlock<Fr>[], jobId: string): Promise<NoteDao[]>;
|
|
57
|
-
/**
|
|
58
|
-
* Synchronizes notes and nullifiers to a specific block number.
|
|
50
|
+
* Each nullifier gets an append-only entry recording the block number at which it was emitted.
|
|
59
51
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
52
|
+
* Every nullifier passed must correspond to a note already present in this store. Callers only apply nullifiers for
|
|
53
|
+
* notes of scopes they track, and a note is always discovered before the nullifier that spends it, so a nullifier
|
|
54
|
+
* with no matching note signals a bug (broken nonce/index discovery, a sync-ordering error, store corruption, etc).
|
|
63
55
|
*
|
|
64
|
-
*
|
|
56
|
+
* `applyNullifiers` is idempotent: a nullifier whose emission is already recorded (committed or staged in this job) is
|
|
57
|
+
* skipped, so re-applying it neither re-writes the emission, changes note visibility, nor appears in the result.
|
|
65
58
|
*
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
59
|
+
* @param siloedNullifiers - Array of nullifiers with their block locations to record
|
|
60
|
+
* @param jobId - The job context for staged writes
|
|
61
|
+
* @returns The notes that transition from active to nullified in this call; already-nullified notes are skipped, so
|
|
62
|
+
* a repeat application returns an empty array.
|
|
63
|
+
* @throws If any nullifier has no matching note in this store, or was emitted at block 0.
|
|
68
64
|
*/
|
|
69
|
-
|
|
65
|
+
applyNullifiers(siloedNullifiers: DataInBlock<Fr>[], jobId: string): Promise<NoteDao[]>;
|
|
70
66
|
/**
|
|
71
|
-
* Commits in
|
|
67
|
+
* Commits in-memory job data to persistent storage.
|
|
72
68
|
*
|
|
73
69
|
* Called by JobCoordinator when a job completes successfully.
|
|
74
70
|
*
|
|
@@ -79,5 +75,18 @@ export declare class NoteStore implements StagedStore {
|
|
|
79
75
|
*/
|
|
80
76
|
commit(jobId: string): Promise<void>;
|
|
81
77
|
discardStaged(jobId: string): Promise<void>;
|
|
78
|
+
/** Returns the nullifiers (note ids) of all notes created at the given block number. Used by delete-on-prune. */
|
|
79
|
+
nullifiersOfNotesAtBlock(blockNumber: number): Promise<string[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Rolls the store back to `toBlock`: deletes every note and nullifier emission originating on a block strictly above
|
|
82
|
+
* it, as if nothing past that block height ever happened. Used to retract notes and nullifiers on a reorg.
|
|
83
|
+
*
|
|
84
|
+
* Must be called inside a transaction owned by the caller (it issues no `transactionAsync` of its own, because the
|
|
85
|
+
* reorg path wraps it together with other store operations, and IndexedDB has no nested transaction support).
|
|
86
|
+
*
|
|
87
|
+
* Throws if any job has uncommitted staged writes, since rolling back mid-job could later re-introduce notes or
|
|
88
|
+
* nullifier emissions anchored to deleted blocks.
|
|
89
|
+
*/
|
|
90
|
+
rollback(toBlock: number): Promise<void>;
|
|
82
91
|
}
|
|
83
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
92
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2Uvbm90ZV9zdG9yZS9ub3RlX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFxQyxNQUFNLGlCQUFpQixDQUFDO0FBQzVGLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxPQUFPLEVBQWMsTUFBTSxvQkFBb0IsQ0FBQztBQUV6RCxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSwwQ0FBMEMsQ0FBQztBQUM1RSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUs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SxRQUFRLENBQUMsT0FBTyxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBa0RwRDtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note_store.d.ts","sourceRoot":"","sources":["../../../src/storage/note_store/note_store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"note_store.d.ts","sourceRoot":"","sources":["../../../src/storage/note_store/note_store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,iBAAiB,CAAC;AAC5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAc,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAUzD;;;;;;;;;GASG;AACH,qBAAa,SAAU,YAAW,WAAW;;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAU;IAEpC,MAAM,yCAA8B;IA0CpC,YAAY,KAAK,EAAE,iBAAiB,EAWnC;IAED;;;;;;;;;OASG;IACI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAarF;IA+BD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CA8F/D;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CAAC,gBAAgB,EAAE,WAAW,CAAC,EAAE,CAAC,EAAE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