referrerpolicy=no-referrer-when-downgrade

Trait sp_blockchain::ForkBackend

source ·
pub trait ForkBackend<Block: BlockT>: HeaderMetadata<Block> + HeaderBackend<Block> + Send + Sync {
    // Provided method
    fn expand_forks(
        &self,
        fork_heads: &[Block::Hash],
    ) -> Result<BTreeSet<Block::Hash>, Error> { ... }
}
Expand description

Handles stale forks.

Provided Methods§

source

fn expand_forks( &self, fork_heads: &[Block::Hash], ) -> Result<BTreeSet<Block::Hash>, Error>

Returns block hashes for provided fork heads. It skips the fork if when blocks are missing (e.g. warp-sync) and internal tree_route function fails.

Example: G — A1 — A2 — A3 — A4 ( < fork1 ) -––C4 — C5 ( < fork2 ) We finalize A3 and call expand_fork(C5). Result = (C5,C4).

Implementors§

source§

impl<Block, T> ForkBackend<Block> for T
where Block: BlockT, T: HeaderMetadata<Block> + HeaderBackend<Block> + Send + Sync,