pub struct SyncServiceManager { /* private fields */ }Expand description
Manager for background journal synchronization
Integrates aura_sync::SyncService into the agent runtime lifecycle.
Handles startup, shutdown, and coordination with other agent services.
Implementations§
Source§impl SyncServiceManager
impl SyncServiceManager
pub const ACTOR_BOUNDARY_CATEGORY: BoundaryDeclarationCategory = ::aura_core::BoundaryDeclarationCategory::ActorOwned
pub const ACTOR_OWNER_NAME: &'static str = "sync_service_manager"
pub const ACTOR_DOMAIN_NAME: &'static str = "sync"
pub const ACTOR_INGRESS_GATE: &'static str = "sync_command_ingress"
pub const ACTOR_DECLARATION_CATEGORY_LITERAL: &'static str = "actor_owned"
pub fn actor_declaration() -> ActorDeclaration<Self, SyncCommand>
pub fn actor_ingress() -> BoundedActorIngress<Self, SyncCommand>
pub fn register_actor_supervision<HandleId>( handle_id: HandleId, shutdown: OwnedShutdownToken, ) -> SupervisionRegistration<Self, SyncCommand, HandleId>
Source§impl SyncServiceManager
impl SyncServiceManager
pub const OWNERSHIP_CATEGORY: OwnershipCategory = OwnershipCategory::ActorOwned
Sourcepub fn new(config: SyncManagerConfig) -> Self
pub fn new(config: SyncManagerConfig) -> Self
Create a new sync service manager
Sourcepub fn with_indexed_journal(
config: SyncManagerConfig,
indexed_journal: Arc<dyn IndexedJournalEffects + Send + Sync>,
time: Arc<dyn PhysicalTimeEffects>,
) -> Self
pub fn with_indexed_journal( config: SyncManagerConfig, indexed_journal: Arc<dyn IndexedJournalEffects + Send + Sync>, time: Arc<dyn PhysicalTimeEffects>, ) -> Self
Create a new sync service manager with indexed journal for Merkle verification
This enables fact sync with cryptographic verification of facts using Merkle trees and Bloom filters from the indexed journal.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default configuration
Sourcepub async fn state(&self) -> SyncManagerState
pub async fn state(&self) -> SyncManagerState
Get the current state
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if the service is running
Sourcepub async fn sync_with_peers<E>(
&self,
effects: &E,
peers: Vec<DeviceId>,
) -> Result<(), SyncManagerError>where
E: JournalEffects + NetworkEffects + PhysicalTimeEffects + GuardContextProvider + Send + Sync,
pub async fn sync_with_peers<E>(
&self,
effects: &E,
peers: Vec<DeviceId>,
) -> Result<(), SyncManagerError>where
E: JournalEffects + NetworkEffects + PhysicalTimeEffects + GuardContextProvider + Send + Sync,
Perform a manual sync with specific peers
§Arguments
effects: Effect system providing journal, network, and time capabilitiespeers: List of peers to sync with
Sourcepub async fn remove_peer(&self, peer: &DeviceId)
pub async fn remove_peer(&self, peer: &DeviceId)
Remove a peer from the known peers list
Sourcepub async fn sync_service_health(&self) -> Option<SyncServiceHealth>
pub async fn sync_service_health(&self) -> Option<SyncServiceHealth>
Get service health information
Sourcepub async fn metrics(&self) -> Option<ServiceMetrics>
pub async fn metrics(&self) -> Option<ServiceMetrics>
Get service metrics
Sourcepub fn config(&self) -> &SyncManagerConfig
pub fn config(&self) -> &SyncManagerConfig
Get the configuration
Sourcepub fn has_merkle_verification(&self) -> bool
pub fn has_merkle_verification(&self) -> bool
Check if Merkle verification is available
Returns true if the manager was created with an indexed journal,
enabling cryptographic fact verification.
Sourcepub async fn local_merkle_root(&self) -> Option<[u8; 32]>
pub async fn local_merkle_root(&self) -> Option<[u8; 32]>
Get the local Merkle root for exchange with peers
Returns None if Merkle verification is not enabled (no indexed journal).
The root represents the current state of the local fact journal and can
be compared with remote roots to determine if synchronization is needed.
Sourcepub async fn verify_facts(
&self,
facts: Vec<IndexedFact>,
claimed_root: [u8; 32],
) -> Option<VerificationResult>
pub async fn verify_facts( &self, facts: Vec<IndexedFact>, claimed_root: [u8; 32], ) -> Option<VerificationResult>
Verify incoming facts against the local Merkle tree
Returns None if Merkle verification is not enabled.
Otherwise returns the verification result containing:
verified: Facts that passed verificationrejected: Facts that failed verification with reasonsmerkle_root: Current local Merkle root after verification
Sourcepub fn merkle_verifier(&self) -> Option<&Arc<MerkleVerifier>>
pub fn merkle_verifier(&self) -> Option<&Arc<MerkleVerifier>>
Get the internal Merkle verifier reference
Returns None if Merkle verification is not enabled.
Use this for direct access to verification operations like
compare_roots() or local_bloom_filter().
Source§impl SyncServiceManager
Async health check implementation
impl SyncServiceManager
Async health check implementation
Sourcepub async fn health_async(&self) -> ServiceHealth
pub async fn health_async(&self) -> ServiceHealth
Get the service health status asynchronously
This provides full health information including underlying service health.
For the synchronous RuntimeService::health(), a simplified status is returned.
Source§impl SyncServiceManager
impl SyncServiceManager
Sourcepub async fn execute_epoch_rotation_coordinator(
&self,
effects: Arc<AuraEffectSystem>,
coordinator_id: AuthorityId,
participant1_id: AuthorityId,
participant2_id: AuthorityId,
proposal: EpochRotationProposal,
commit: EpochCommit,
) -> Result<(), SyncManagerError>
pub async fn execute_epoch_rotation_coordinator( &self, effects: Arc<AuraEffectSystem>, coordinator_id: AuthorityId, participant1_id: AuthorityId, participant2_id: AuthorityId, proposal: EpochRotationProposal, commit: EpochCommit, ) -> Result<(), SyncManagerError>
Execute epoch rotation protocol as coordinator.
Sourcepub async fn execute_epoch_rotation_participant(
&self,
effects: Arc<AuraEffectSystem>,
role: EpochRotationProtocolRole,
coordinator_id: AuthorityId,
participant1_id: AuthorityId,
participant2_id: AuthorityId,
confirmation: EpochConfirmation,
) -> Result<(), SyncManagerError>
pub async fn execute_epoch_rotation_participant( &self, effects: Arc<AuraEffectSystem>, role: EpochRotationProtocolRole, coordinator_id: AuthorityId, participant1_id: AuthorityId, participant2_id: AuthorityId, confirmation: EpochConfirmation, ) -> Result<(), SyncManagerError>
Execute epoch rotation protocol as participant.
Sourcepub async fn delegate_epoch_rotation_session(
&self,
effects: Arc<AuraEffectSystem>,
rotation_id: &str,
from_authority: AuthorityId,
to_authority: AuthorityId,
bundle_id: Option<String>,
) -> Result<DelegationReceipt, SyncManagerError>
pub async fn delegate_epoch_rotation_session( &self, effects: Arc<AuraEffectSystem>, rotation_id: &str, from_authority: AuthorityId, to_authority: AuthorityId, bundle_id: Option<String>, ) -> Result<DelegationReceipt, SyncManagerError>
Delegate ownership of an epoch-rotation session to another authority.
This updates runtime session footprints and records a relational protocol fact.
Trait Implementations§
Source§impl Clone for SyncServiceManager
impl Clone for SyncServiceManager
Source§fn clone(&self) -> SyncServiceManager
fn clone(&self) -> SyncServiceManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for SyncServiceManager
impl Default for SyncServiceManager
Source§impl RuntimeService for SyncServiceManager
impl RuntimeService for SyncServiceManager
Source§fn dependencies(&self) -> &[&'static str]
fn dependencies(&self) -> &[&'static str]
Source§fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 RuntimeServiceContext,
) -> Pin<Box<dyn Future<Output = Result<(), ServiceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 RuntimeServiceContext,
) -> Pin<Box<dyn Future<Output = Result<(), ServiceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for SyncServiceManager
impl !RefUnwindSafe for SyncServiceManager
impl Send for SyncServiceManager
impl Sync for SyncServiceManager
impl Unpin for SyncServiceManager
impl UnsafeUnpin for SyncServiceManager
impl !UnwindSafe for SyncServiceManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more