sc_consensus_subspace::slot_worker

Struct SubspaceSlotWorker

source
pub struct SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>
where Block: BlockT, SO: SyncOracle + Send + Sync,
{ /* private fields */ }
Expand description

Subspace slot worker responsible for block and vote production

Implementations§

source§

impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>
where PosTable: Table, Block: BlockT, Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static, Client::Api: SubspaceApi<Block, PublicKey>, E: Environment<Block, Error = Error> + Send + Sync, E::Proposer: Proposer<Block, Error = Error>, SO: SyncOracle + Send + Sync, L: JustificationSyncLink<Block>, BS: BackoffAuthoringBlocksStrategy<NumberFor<Block>> + Send + Sync, Error: Error + Send + From<Error> + 'static, AS: AuxStore + Send + Sync + 'static, BlockNumber: From<<Block::Header as Header>::Number>,

source

pub fn new( _: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>, ) -> Self

Create new Subspace slot worker

Trait Implementations§

source§

impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>
where Block: BlockT, Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>, Client::Api: SubspaceApi<Block, PublicKey>, SO: SyncOracle + Send + Sync,

source§

fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)

Called when new proof of time is available for slot. Read more
source§

impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>
where PosTable: Table, Block: BlockT, Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static, Client::Api: SubspaceApi<Block, PublicKey>, E: Environment<Block, Error = Error> + Send + Sync, E::Proposer: Proposer<Block, Error = Error>, SO: SyncOracle + Send + Sync, L: JustificationSyncLink<Block>, BS: BackoffAuthoringBlocksStrategy<NumberFor<Block>> + Send + Sync, Error: Error + Send + From<Error> + 'static, AS: AuxStore + Send + Sync + 'static, BlockNumber: From<<Block::Header as Header>::Number>,

source§

type BlockImport = Box<dyn BlockImport<Block, Error = Error> + Sync + Send>

A handle to a BlockImport.
source§

type SyncOracle = SubspaceSyncOracle<SO>

A handle to a SyncOracle.
A handle to a JustificationSyncLink, allows hooking into the sync module to control the justification sync process.
source§

type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send>>

The type of future resolving to the proposer.
source§

type Proposer = <E as Environment<Block>>::Proposer

The type of proposer to use to build blocks.
source§

type Claim = (PreDigest<PublicKey>, SubspaceJustification)

Data associated with a slot claim.
source§

type AuxData = ()

Auxiliary data necessary for authoring.
source§

fn logging_target(&self) -> &'static str

The logging target to use when logging messages.
source§

fn block_import(&mut self) -> &mut Self::BlockImport

A handle to a BlockImport.
source§

fn aux_data( &self, _parent: &Block::Header, _slot: Slot, ) -> Result<Self::AuxData, ConsensusError>

Returns the auxiliary data necessary for authoring.
source§

fn authorities_len(&self, _epoch_data: &Self::AuxData) -> Option<usize>

Returns the number of authorities. None indicate that the authorities information is incomplete.
source§

fn claim_slot<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, parent_header: &'life1 Block::Header, slot: Slot, _aux_data: &'life2 Self::AuxData, ) -> Pin<Box<dyn Future<Output = Option<Self::Claim>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Tries to claim the given slot, returning an object with claim data if successful.
source§

fn pre_digest_data( &self, _slot: Slot, (pre_digest, _justification): &Self::Claim, ) -> Vec<DigestItem>

Return the pre digest data to include in a block authored with the given claim.
source§

fn block_import_params<'life0, 'life1, 'async_trait>( &'life0 self, header: Block::Header, header_hash: &'life1 Block::Hash, body: Vec<Block::Extrinsic>, storage_changes: StorageChanges<Block>, __arg5: Self::Claim, _aux_data: Self::AuxData, ) -> Pin<Box<dyn Future<Output = Result<BlockImportParams<Block>, ConsensusError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns a function which produces a BlockImportParams.
source§

fn force_authoring(&self) -> bool

Whether to force authoring if offline.
source§

fn should_backoff(&self, slot: Slot, chain_head: &Block::Header) -> bool

Returns whether the block production should back off. Read more
source§

fn sync_oracle(&mut self) -> &mut Self::SyncOracle

Returns a handle to a SyncOracle.
Returns a handle to a JustificationSyncLink.
source§

fn proposer(&mut self, block: &Block::Header) -> Self::CreateProposer

Returns a Proposer to author on top of the given block.
source§

fn telemetry(&self) -> Option<TelemetryHandle>

Returns a [TelemetryHandle] if any.
source§

fn proposing_remaining_duration(&self, slot_info: &SlotInfo<Block>) -> Duration

Remaining duration for proposing.
§

fn notify_slot( &self, _header: &<B as Block>::Header, _slot: Slot, _aux_data: &Self::AuxData, )

Notifies the given slot. Similar to claim_slot, but will be called no matter whether we need to author blocks or not.
§

fn propose<'life0, 'life1, 'async_trait>( &'life0 mut self, proposer: Self::Proposer, claim: &'life1 Self::Claim, slot_info: SlotInfo<B>, end_proposing_at: Instant, ) -> Pin<Box<dyn Future<Output = Option<Proposal<B, <Self::Proposer as Proposer<B>>::Proof>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Send + 'async_trait,

Propose a block by Proposer.
§

fn create_inherent_data<'life0, 'life1, 'async_trait>( slot_info: &'life0 SlotInfo<B>, logging_target: &'life1 str, end_proposing_at: Instant, ) -> Pin<Box<dyn Future<Output = Option<InherentData>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait,

Calls create_inherent_data and handles errors.
§

fn on_slot<'life0, 'async_trait>( &'life0 mut self, slot_info: SlotInfo<B>, ) -> Pin<Box<dyn Future<Output = Option<SlotResult<B, <Self::Proposer as Proposer<B>>::Proof>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + Send + 'async_trait,

Implements [SlotWorker::on_slot].

Auto Trait Implementations§

§

impl<PosTable, Block, Client, E, SO, L, BS, AS> Freeze for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>
where E: Freeze, L: Freeze, SO: Freeze, BS: Freeze,

§

impl<PosTable, Block, Client, E, SO, L, BS, AS> !RefUnwindSafe for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>

§

impl<PosTable, Block, Client, E, SO, L, BS, AS> Send for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>
where E: Send, L: Send, Client: Sync + Send, BS: Send, PosTable: Send, AS: Sync + Send,

§

impl<PosTable, Block, Client, E, SO, L, BS, AS> Sync for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>
where E: Sync, L: Sync, Client: Sync + Send, BS: Sync, PosTable: Sync, AS: Sync + Send,

§

impl<PosTable, Block, Client, E, SO, L, BS, AS> Unpin for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>
where E: Unpin, L: Unpin, SO: Unpin, BS: Unpin, PosTable: Unpin,

§

impl<PosTable, Block, Client, E, SO, L, BS, AS> !UnwindSafe for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CheckedConversion for T

§

fn checked_from<T>(t: T) -> Option<Self>
where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
§

fn checked_into<T>(self) -> Option<T>
where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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, Outer> IsWrappedBy<Outer> for T
where Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
§

impl<T> SaturatedConversion for T

§

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
§

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> JsonSchemaMaybe for T