hotstuff_rs::block_tree::invariants

Function safe_block

source
pub(crate) fn safe_block<K: KVStore>(
    block: &Block,
    block_tree: &BlockTreeSingleton<K>,
    chain_id: ChainID,
) -> Result<bool, BlockTreeError>
Expand description

Check whether block can safely cause updates to block_tree, given the replica’s chain_id.

§Conditional checks

safe_block returns true in case all of the following predicates are true:

  1. safe_pc(&block.justify, block_tree, chain_id).
  2. block.pc.phase is either Generic or Decide.

§Precondition

is_correct is true for block.