hotstuff_rs::hotstuff::roles

Function new_view_recipients

source
pub(crate) fn new_view_recipients(
    new_view: &NewView,
    validator_set_state: &ValidatorSetState,
) -> (VerifyingKey, Option<VerifyingKey>)
Expand description

Identify the leader(s) that new_view should be sent to, given the current validator_set_state.

§new_view_recipients Logic

Upon exiting a view, a replica should send a new_view message to the leader of new_view.view + 1 in the committed validator set (CVS), and, if !validator_set_state.update_decided (not decided), also to the leader of the same view in the previous validator set (PVS).

§Return value

Returns a pair containing the following items:

  1. VerifyingKey: the leader in the committed validator set in new_view.view + 1.
  2. Option<VerifyingKey>: the leader in the resigning validator set in new_view.view + 1 (None if the most recently initiated validator set update has been decided).