Expand description
Helper functions used by any task
StructsΒ§
- Leaf
Chain Traversal Outcome - Helper type to give names and to the output values of the leaf chain traversal operation.
FunctionsΒ§
- broadcast_
event - Helper function to send events and log errors
- broadcast_
view_ change - check_
qc_ πstate_ cert_ correspondence - decide_
epoch_ πroot - Handles calling add_epoch_root and sync_l1 on Membership if necessary.
- decide_
from_ proposal - Ascends the leaf chain by traversing through the parent commitments of the proposal. We begin by obtaining the parent view, and if we are in a chain (i.e. the next view from the parent is one view newer), then we begin attempting to form the chain. This is a direct impl from HotStuff section 5:
- decide_
from_ proposal_ 2 - calculate the new decided leaf chain based on the rules of HotStuff 2
- fetch_
proposal π - Trigger a request to the network for a proposal for a view and wait for the response or timeout.
- handle_
drb_ result - parent_
leaf_ πand_ state - Gets the parent leaf and state from the parent of a proposal, returning an [
utils::anytrace::Error
] if not. - transition_
qc π - update_
high_ πqc - update_
metrics π - validate_
epoch_ πtransition_ qc - validate_
light_ client_ state_ update_ certificate - Validates the light client state update certificate
- validate_
proposal_ safety_ and_ liveness - Validate the state and safety and liveness of a proposal then emit
a
QuorumProposalValidated
event. - validate_
proposal_ πview_ and_ certs - Validates, from a given
proposal
that the view that it is being submitted for is valid when compared tocur_view
which is the highest proposed view (so far) for the caller. If the proposal is for a view thatβs later than expected, that the proposal includes a timeout or view sync certificate. - validate_
qc_ and_ next_ epoch_ qc - Validates qcβs signatures and, if provided, validates next_epoch_qcβs signatures and whether it corresponds to the provided high_qc.
- wait_
for_ second_ vid_ share - Gets the second VID share, the current or the next epoch accordingly, from the shared consensus state; makes sure it corresponds to the given DA certificate; if itβs not yet available, waits for it with the given timeout.