hotstuff_rs

Module events

source
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§

Enums§

  • Enumerates all events defined for HotStuff-rs.