client: add a block blacklist extension (#4544)

* client: add a block blacklist extension

* test-utils: fix client construction

* client: fix rustdoc test
This commit is contained in:
André Silva
2020-01-06 18:03:44 +00:00
committed by GitHub
parent b65e336a1d
commit a89d87d708
9 changed files with 70 additions and 9 deletions
+9 -1
View File
@@ -16,6 +16,7 @@
//! A set of APIs supported by the client along with their primitives.
use std::collections::HashSet;
use futures::channel::mpsc;
use sp_core::storage::StorageKey;
use sp_runtime::{
@@ -36,9 +37,16 @@ pub type FinalityNotifications<Block> = mpsc::UnboundedReceiver<FinalityNotifica
/// Expected hashes of blocks at given heights.
///
/// This may be used as chain spec extension to filter out known, unwanted forks.
/// This may be used as chain spec extension to set trusted checkpoints, i.e.
/// the client will refuse to import a block with a different hash at the given
/// height.
pub type ForkBlocks<Block> = Option<Vec<(NumberFor<Block>, <Block as BlockT>::Hash)>>;
/// Known bad block hashes.
///
/// This may be used as chain spec extension to filter out known, unwanted forks.
pub type BadBlocks<Block> = Option<HashSet<<Block as BlockT>::Hash>>;
/// Figure out the block type for a given type (for now, just a `Client`).
pub trait BlockOf {
/// The type of the block.