Expand description
Subscribable events that are published when significant things happen in the replica.
§Event enum
Significant occurences in the replica include committing a block, starting a new view, broadcasting a proposal, or receiving a proposal.
Each of these significant occurences correspond to a variant of the event enum. Each
variant tuple in turn contains an inner struct type. For example, the
insert block variant contains the InsertBlockEvent
struct type.
Each inner struct stores information that summarizes the particular kind of event. This information always includes a timestamp corresponding to the exact time when the event occured.
§Registering event handlers
Library users can register event handler closures, these are internally called by the library’s event bus thread when the handler’s particular event variant happens.
Custom event handlers can be registered using the replica builder pattern, while default event handlers that log out events (e.g., into the terminal, or into a log file) can be enabled in the configuration.
§Timing
Events are always emitted after the corresponding occurence is “completed”. So for example, the insert block event is only emitted after the insertion has been persisted into the backing storage of the block tree.
Structs§
- The replica broadcasted an advance view message to all peers.
- The replica collected a new
phase_certificate
from the votes it received from the validators in the current view. - The replica collected a new
timeout_certificate
from the votes it received from the validators in the current view. - A
block
was committed. This involves persistent changes to the Block Tree. - The replica exited sync mode, during which it tried to sync with a given peer identifiable by its public key, and inserted a given number of blocks received from the peer into its block tree.
- A new
block
was inserted into the Block Tree in a persistent manner. - The replica sent a new view message for its current view to the leader of the next view upon moving to a new view.
- The replica nudged for a block by broadcasting a nudge for the block to all validators.
- The replica voted for a phase of a block by sending
phase_vote
to a leader of the next view. - The replica proposed a block by broadcasting it as a proposal to all validators.
- A
block
was “pruned” (i.e., the block’s siblings were permanently deleted from the Block Tree). - The replica received an
advance_view
message from another replica, identified by itsverifying_key
. - The replica received a new view message for the current view from another replica identifiable by its public key.
- The replica received a
nudge
for the replica’s current view from the leader of the view, identified by itsVerifyingKey
. - The replica received a
phase_vote
for the replica’s current view from the replica identified byorigin
. - The replica received a
proposal
for the replica’s current view from the leader of the view, identified by itsVerifyingKey
. - The replica’s sync server received a sync request from a peer identifiable by its public key. Includes information about the requested start height from which the peer wants to sync, and the limit on the number of blocks that can be sent in a sync response.
- The replica received a
timeout_certificate
for the replica’s current view from another replica, identified byverifying_key
. - The replica’s sync server sent a sync response to a peer identifiable by its public key. Includes information about the vector of blocks and the Highest Quroum Certificate sent to the peer.
- The replica entered sync mode and tried to sync with a given peer, identified by its
VerifyingKey
. - The replica started a new view with a given
ViewNumber
. - The replica broadcasted a timeout vote message to all peers.
- The “Highest
PhaseCertificate
” stored in the block tree was updated. - The “Highest
TimeoutCertificate
” stored in the block tree was updated. - The “Locked
PhaseCertificate
” stored in the block tree was updated. - The “Committed Validator Set” stored in the block tree, was updated.
- The replica’s view, with a given
ViewNumber
, timed out.
Enums§
- Enumerates all events defined for HotStuff-rs.