[][src]Crate sp_consensus

Common utilities for building and using consensus engines in substrate.

Much of this crate is unstable and thus the API is likely to undergo change. Implementors of traits should not rely on the interfaces to remain the same.

Re-exports

pub use self::error::Error;
pub use block_import::BlockImport;
pub use block_import::BlockOrigin;
pub use block_import::ForkChoiceStrategy;
pub use block_import::ImportedAux;
pub use block_import::BlockImportParams;
pub use block_import::BlockCheckParams;
pub use block_import::ImportResult;
pub use block_import::JustificationImport;
pub use import_queue::DefaultImportQueue;

Modules

block_import

Block import helpers.

block_validation

Block announcement validation.

error

Error types in Consensus

evaluation

Block evaluation and evaluation errors.

import_queue

Import Queue primitive: something which can verify and import blocks.

offline_tracker

Tracks offline validators.

Structs

AlwaysCanAuthor

Returns always true for can_author_with. This is useful for tests.

CanAuthorWithNativeVersion

Checks if the node can author blocks by using NativeVersion::can_author_with.

InherentData

Inherent data to include in a block.

NeverCanAuthor

Never can author.

NoNetwork

A synchronization oracle for when there is no network.

Proposal

A proposal that is created by a Proposer.

Enums

BlockStatus

Block status.

RecordProof

Used as parameter to Proposer to tell the requirement on recording a proof.

Traits

CanAuthorWith

Checks if the current active native block authoring implementation can author with the runtime at the given block.

Environment

Environment for a Consensus instance.

Proposer

Logic for a proposer.

SelectChain

The SelectChain trait defines the strategy upon which the head is chosen if multiple forks are present for an opaque definition of "best" in the specific chain build.

SlotData

A type from which a slot duration can be obtained.

StateBackend

A state backend is used to read state data and can have changes committed to it.

SyncOracle

An oracle for when major synchronization work is being undertaken.