Module hotshot_task_impls::helpers
source · Expand description
Helper functions used by any task
Structs§
- Helper type to give names and to the output values of the leaf chain traversal operation.
Constants§
- Constant which tells
update_view
to not send a view change event when called. - Constant which tells
update_view
to send a view change event when called.
Traits§
- Utilities to print anyhow logs.
Functions§
- Helper function to send events and log errors
- Cancel a task
- 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:
- Trigger a request to the network for a proposal for a view and wait for the response or timeout.
- Gets the parent leaf and state from the parent of a proposal, returning an
anyhow::Error
if not. - Update the view if it actually changed, takes a mutable reference to the
cur_view
and thetimeout_task
which are updated during the operation of the function. - Validate the state and safety and liveness of a proposal then emit a
QuorumProposalValidated
event. - 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.