Struct phron_finality::party::manager::NodeSessionManagerImpl
source · pub struct NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>where
B: BlockT<Hash = BlockHash>,
B::Header: HeaderT<Number = BlockNumber>,
C: ClientForPhron<B, BE> + Send + Sync + 'static,
BE: Backend<B> + 'static,
SC: SelectChain<B> + 'static,
RB: RequestBlocks,
SM: SessionManager<VersionedEitherMessage<Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>, Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>>> + 'static,
JS: JustificationSubmissions<Justification> + Send + Sync + Clone,{
client: Arc<C>,
select_chain: SC,
session_info: SessionBoundaryInfo,
unit_creation_delay: UnitCreationDelay,
justifications_for_sync: JS,
justification_translator: JustificationTranslator,
block_requester: RB,
metrics: TimingBlockMetrics,
spawn_handle: SpawnHandle,
session_manager: SM,
keystore: Arc<dyn Keystore>,
_phantom: PhantomData<(B, BE)>,
}
Fields§
§client: Arc<C>
§select_chain: SC
§session_info: SessionBoundaryInfo
§unit_creation_delay: UnitCreationDelay
§justifications_for_sync: JS
§justification_translator: JustificationTranslator
§block_requester: RB
§metrics: TimingBlockMetrics
§spawn_handle: SpawnHandle
§session_manager: SM
§keystore: Arc<dyn Keystore>
§_phantom: PhantomData<(B, BE)>
Implementations§
source§impl<C, SC, B, RB, BE, SM, JS> NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>where
B: BlockT<Hash = BlockHash>,
B::Header: HeaderT<Number = BlockNumber>,
C: ClientForPhron<B, BE> + Send + Sync + 'static,
C::Api: PhronSessionApi<B>,
BE: Backend<B> + 'static,
SC: SelectChain<B> + 'static,
RB: RequestBlocks,
SM: SessionManager<VersionedEitherMessage<Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>, Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>>>,
JS: JustificationSubmissions<Justification> + Send + Sync + Clone + 'static,
impl<C, SC, B, RB, BE, SM, JS> NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>where
B: BlockT<Hash = BlockHash>,
B::Header: HeaderT<Number = BlockNumber>,
C: ClientForPhron<B, BE> + Send + Sync + 'static,
C::Api: PhronSessionApi<B>,
BE: Backend<B> + 'static,
SC: SelectChain<B> + 'static,
RB: RequestBlocks,
SM: SessionManager<VersionedEitherMessage<Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>, Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>>>,
JS: JustificationSubmissions<Justification> + Send + Sync + Clone + 'static,
pub fn new( client: Arc<C>, select_chain: SC, session_period: SessionPeriod, unit_creation_delay: UnitCreationDelay, justifications_for_sync: JS, justification_translator: JustificationTranslator, block_requester: RB, metrics: TimingBlockMetrics, spawn_handle: SpawnHandle, session_manager: SM, keystore: Arc<dyn Keystore> ) -> Self
fn legacy_subtasks<N: Network<VersionedEitherMessage<Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>, Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>>> + 'static>( &self, params: SubtasksParams<C, B, N, BE, JS> ) -> Subtasks
fn current_subtasks<N: Network<VersionedEitherMessage<Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>, Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>>> + 'static>( &self, params: SubtasksParams<C, B, N, BE, JS> ) -> Subtasks
async fn spawn_subtasks( &self, session_id: SessionId, authorities: &[AuthorityId], node_id: NodeIndex, exit_rx: Receiver<()>, backup: (Box<dyn Write + Send + Sync>, Box<dyn Read + Send + Sync>) ) -> Subtasks
Trait Implementations§
source§impl<C, SC, B, RB, BE, SM, JS> NodeSessionManager for NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>where
B: BlockT<Hash = BlockHash>,
B::Header: HeaderT<Number = BlockNumber>,
C: ClientForPhron<B, BE> + Send + Sync + 'static,
C::Api: PhronSessionApi<B>,
BE: Backend<B> + 'static,
SC: SelectChain<B> + 'static,
RB: RequestBlocks,
SM: SessionManager<VersionedEitherMessage<Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>, Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>>>,
JS: JustificationSubmissions<Justification> + Send + Sync + Clone + 'static,
impl<C, SC, B, RB, BE, SM, JS> NodeSessionManager for NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>where
B: BlockT<Hash = BlockHash>,
B::Header: HeaderT<Number = BlockNumber>,
C: ClientForPhron<B, BE> + Send + Sync + 'static,
C::Api: PhronSessionApi<B>,
BE: Backend<B> + 'static,
SC: SelectChain<B> + 'static,
RB: RequestBlocks,
SM: SessionManager<VersionedEitherMessage<Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>, Split<NetworkData<HashWrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, RmcNetworkData<BlockHash, Signature, SignatureSet<Signature>>>>>,
JS: JustificationSubmissions<Justification> + Send + Sync + Clone + 'static,
type Error = <SM as SessionManager<VersionedEitherMessage<Split<NetworkData<Wrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, Message<SignableHash<<Header<u32, BlakeTwo256> as Header>::Hash>, Signature, SignatureSet<Signature>>>, Split<NetworkData<Wrapper<BlakeTwo256>, PhronData, Signature, SignatureSet<Signature>>, Message<SignableHash<<Header<u32, BlakeTwo256> as Header>::Hash>, Signature, SignatureSet<Signature>>>>>>::Error
Spawns every task needed for an authority to run in a session.
source§fn early_start_validator_session(
&self,
session: SessionId,
node_id: NodeIndex,
authorities: &[AuthorityId]
) -> Result<(), Self::Error>
fn early_start_validator_session( &self, session: SessionId, node_id: NodeIndex, authorities: &[AuthorityId] ) -> Result<(), Self::Error>
Prepare validator session.
source§fn start_nonvalidator_session(
&self,
session: SessionId,
authorities: &[AuthorityId]
) -> Result<(), Self::Error>
fn start_nonvalidator_session( &self, session: SessionId, authorities: &[AuthorityId] ) -> Result<(), Self::Error>
Starts nonvalidator session.
Auto Trait Implementations§
impl<C, SC, B, RB, BE, SM, JS> !RefUnwindSafe for NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>
impl<C, SC, B, RB, BE, SM, JS> Send for NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>
impl<C, SC, B, RB, BE, SM, JS> Sync for NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>
impl<C, SC, B, RB, BE, SM, JS> Unpin for NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>
impl<C, SC, B, RB, BE, SM, JS> !UnwindSafe for NodeSessionManagerImpl<C, SC, B, RB, BE, SM, JS>
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
Mutably borrows from an owned value. Read more
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.