Documentation ¶
Index ¶
Constants ¶
const DefaultStartupTimeout = 30 * time.Second
DefaultStartupTimeout is the default time we wait when starting epoch components before giving up.
Variables ¶
var ErrNotAuthorizedForEpoch = fmt.Errorf("we are not an authorized participant for the epoch")
ErrNotAuthorizedForEpoch is returned when we attempt to create epoch components for an epoch in which we are not an authorized network participant. This is the case for epochs during which this node is joining or leaving the network.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { events.Noop // satisfy protocol events consumer interface // contains filtered or unexported fields }
Engine is the epoch manager, which coordinates the lifecycle of other modules and processes that are epoch-dependent. The manager is responsible for spinning up engines when a new epoch is about to start and spinning down engines for an epoch that has ended.
func New ¶
func New( log zerolog.Logger, me module.Local, state protocol.State, pools *epochs.TransactionPools, voter module.ClusterRootQCVoter, factory EpochComponentsFactory, heightEvents events.Heights, ) (*Engine, error)
func (*Engine) Done ¶
func (e *Engine) Done() <-chan struct{}
Done returns a done channel that is closed once the engine has fully stopped.
func (*Engine) EpochSetupPhaseStarted ¶
EpochSetupPhaseStarted handles the epoch setup phase started protocol event.
func (*Engine) EpochTransition ¶
EpochTransition handles the epoch transition protocol event.
type EpochComponents ¶
type EpochComponents struct { *component.ComponentManager // contains filtered or unexported fields }
EpochComponents represents all dependencies for running an epoch.
func NewEpochComponents ¶ added in v0.23.9
type EpochComponentsFactory ¶
type EpochComponentsFactory interface { // Create sets up and instantiates all dependencies for the epoch. It may // be used either for an ongoing epoch (for example, after a restart) or // for an epoch that will start soon. It is safe to call multiple times for // a given epoch counter. // // Must return ErrNotAuthorizedForEpoch if this node is not authorized in the epoch. Create(epoch protocol.Epoch) ( state cluster.State, proposal network.Engine, sync network.Engine, hotstuff module.HotStuff, voteAggregator hotstuff.VoteAggregator, err error, ) }
EpochComponentsFactory is responsible for creating epoch-scoped components managed by the epoch manager engine for the given epoch.
type StartableEpochComponents ¶ added in v0.23.9
type StartableEpochComponents struct { *EpochComponents // contains filtered or unexported fields }
func NewStartableEpochComponents ¶ added in v0.23.9
func NewStartableEpochComponents(components *EpochComponents, signalerCtx irrecoverable.SignalerContext, cancel context.CancelFunc) *StartableEpochComponents