pub fn safe_nudge<K: KVStore>(
nudge: &Nudge,
current_view: ViewNumber,
block_tree: &BlockTreeSingleton<K>,
chain_id: ChainID,
) -> Result<bool, BlockTreeError>Expand description
Check whether nudge can safely cause updates to block_tree, given the replica’s current_view
and chain_id.
§Conditional checks
safe_nudge returns true in case all of the following predicates are true:
safe_pc(&nudge.justify, block_tree, chain_id).nudge.justify.phaseisPrepare,Precommit, orCommit.nudge.chain_idequalschain_id.nudge.justify.phaseis eitherCommit, ornudge.justify.view = current_view - 1.
§Precondition
is_correct is true for nudge.justify.