github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/collection/epochmgr/factory.go (about)

     1  package epochmgr
     2  
     3  import (
     4  	"github.com/onflow/flow-go/consensus/hotstuff"
     5  	"github.com/onflow/flow-go/module"
     6  	"github.com/onflow/flow-go/module/component"
     7  	"github.com/onflow/flow-go/state/cluster"
     8  	"github.com/onflow/flow-go/state/protocol"
     9  )
    10  
    11  // EpochComponentsFactory is responsible for creating epoch-scoped components
    12  // managed by the epoch manager engine for the given epoch.
    13  type EpochComponentsFactory interface {
    14  
    15  	// Create sets up and instantiates all dependencies for the epoch. It may
    16  	// be used either for an ongoing epoch (for example, after a restart) or
    17  	// for an epoch that will start soon. It is safe to call multiple times for
    18  	// a given epoch counter.
    19  	//
    20  	// Must return ErrNotAuthorizedForEpoch if this node is not authorized in the epoch.
    21  	Create(epoch protocol.Epoch) (
    22  		state cluster.State,
    23  		proposal component.Component,
    24  		sync module.ReadyDoneAware,
    25  		hotstuff module.HotStuff,
    26  		voteAggregator hotstuff.VoteAggregator,
    27  		timeoutAggregator hotstuff.TimeoutAggregator,
    28  		messageHub component.Component,
    29  		err error,
    30  	)
    31  }