hotstuff_rs::hotstuff::roles

Function is_proposer

source
pub(crate) fn is_proposer(
    validator: &VerifyingKey,
    view: ViewNumber,
    validator_set_state: &ValidatorSetState,
) -> bool
Expand description

Determine whether validator should act as a proposer in the given view, given the current validator_set_state.

ยงis_proposer Logic

Whether or not validator is a proposer in view depends on two factors:

  1. Whether or not validator is the leader in either the CVS or the PVS in view (it could possibly be in both), and
  2. Whether or not validator_set_update.update_decided.

The below table specifies exactly the return value of is_proposer in every possible combination of the two factors:

Validator Set Update DecidedValidator Set Update Not Decided
Leader in CVS (and maybe also PVS)truetrue
Leader in PVS onlyfalsetrue
Leader in neither CVS or PVSfalsefalse