pub struct CollationManager<CF, V>where
CF: CollatorFactory,{ /* private fields */ }Implementations§
Source§impl<CF, V> CollationManager<CF, V>where
CF: CollatorFactory,
V: Validator,
impl<CF, V> CollationManager<CF, V>where
CF: CollatorFactory,
V: Validator,
pub fn start<STF, MPF>(
keypair: Arc<KeyPair>,
config: CollatorConfig,
mq_adapter: Arc<dyn MessageQueueAdapter<EnqueuedMessage>>,
state_node_adapter_factory: STF,
mpool_adapter_factory: MPF,
validator: V,
collator_factory: CF,
mempool_config_override: Option<MempoolGlobalConfig>,
) -> RunningCollationManager<CF, V>where
STF: StateNodeAdapterFactory,
MPF: MempoolAdapterFactory,
Sourcepub async fn process_new_anchor_from_mempool(
&self,
_anchor: Arc<MempoolAnchor>,
) -> Result<()>
pub async fn process_new_anchor_from_mempool( &self, _anchor: Arc<MempoolAnchor>, ) -> Result<()>
(TODO) Check sync status between mempool and blockchain state and pause collation when we are far behind other nodesб jusct sync blcoks from blockchain
Sourcepub async fn handle_collated_block_candidate(
self: &Arc<Self>,
collation_result: BlockCollationResult,
) -> Result<()>
pub async fn handle_collated_block_candidate( self: &Arc<Self>, collation_result: BlockCollationResult, ) -> Result<()>
Process collated block candidate
- Save block to cache
- Spawn block validation
- Check if the master block interval elapsed (according to chain time) and schedule collation
- If master block then update last master block chain time
- Notify mempool about new master block (it may perform gc or nodes rotation)
- Execute master block processing routines
Sourcepub async fn enqueue_handle_block_from_bc(
&self,
ctx: HandledBlockFromBcCtx,
) -> Result<()>
pub async fn enqueue_handle_block_from_bc( &self, ctx: HandledBlockFromBcCtx, ) -> Result<()>
Finish active sync if it is not finished yet and enqueue received block
Sourcepub fn finish_collation_session(
&self,
collation_session: Arc<CollationSessionInfo>,
) -> Result<()>
pub fn finish_collation_session( &self, collation_session: Arc<CollationSessionInfo>, ) -> Result<()>
Execute collation session finalization routines
Sourcepub fn handle_collator_stopped(
&self,
collation_session_id: (ShardIdent, u32, u32),
) -> Result<()>
pub fn handle_collator_stopped( &self, collation_session_id: (ShardIdent, u32, u32), ) -> Result<()>
Remove stopped collator from cache
Sourcepub async fn handle_validated_master_block(
&self,
block_id: BlockId,
status: ValidationStatus,
) -> Result<()>
pub async fn handle_validated_master_block( &self, block_id: BlockId, status: ValidationStatus, ) -> Result<()>
Process validated block
- Process invalid block (currently, just panic)
- Update block in cache with validation info
- Execute processing for master or shard block
Auto Trait Implementations§
impl<CF, V> !Freeze for CollationManager<CF, V>
impl<CF, V> !RefUnwindSafe for CollationManager<CF, V>
impl<CF, V> Send for CollationManager<CF, V>
impl<CF, V> Sync for CollationManager<CF, V>
impl<CF, V> Unpin for CollationManager<CF, V>where
CF: Unpin,
impl<CF, V> UnsafeUnpin for CollationManager<CF, V>where
CF: UnsafeUnpin,
impl<CF, V> !UnwindSafe for CollationManager<CF, V>
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
Mutably borrows from an owned value. Read more
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