async fn store_drb_seed_and_result<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions>(
    task_state: &mut QuorumVoteTaskState<TYPES, I, V>,
    decided_leaf: &Leaf2<TYPES>,
) -> Result<()>
Expand description

Store the DRB seed two epochs in advance and the computed or received DRB result for next epoch.

We store a combination of the following data.

  • The DRB seed two epochs in advance, if the third from the last block, i.e., the epoch root, is decided and we are in the quorum committee of the next epoch.
  • The computed result for the next epoch, if the third from the last block is decided.
  • The received result for the next epoch, if the last block of the epoch is decided and we are in the quorum committee of the committee of the next epoch.

Special cases:

  • Epoch 0: No DRB computation since we’ll transition to epoch 1 immediately.
  • Epoch 1 and 2: No computed DRB result since when we first start the computation in epoch 1, the result is for epoch 3.

We don’t need to handle the special cases explicitly here, because the first leaf with which we’ll start the DRB computation is for epoch 3.