Documentation ¶
Index ¶
- func CanTry(maxAttempt int, chunk *ChunkStatus) bool
- type ChunkStatus
- type Chunks
- type Engine
- func (e *Engine) Done() <-chan struct{}
- func (e *Engine) Process(originID flow.Identifier, event interface{}) error
- func (e *Engine) ProcessLocal(event interface{}) error
- func (e *Engine) Ready() <-chan struct{}
- func (e *Engine) Submit(originID flow.Identifier, event interface{})
- func (e *Engine) SubmitLocal(event interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanTry ¶
func CanTry(maxAttempt int, chunk *ChunkStatus) bool
CanTry returns checks the history attempts and determine whether a chunk request can be tried again.
Types ¶
type ChunkStatus ¶
type ChunkStatus struct { Chunk *flow.Chunk ExecutionResultID flow.Identifier ExecutorID flow.Identifier LastAttempt time.Time Attempt int }
func NewChunkStatus ¶
func NewChunkStatus(chunk *flow.Chunk, resultID flow.Identifier, executorID flow.Identifier) *ChunkStatus
func (*ChunkStatus) Checksum ¶
func (s *ChunkStatus) Checksum() flow.Identifier
func (*ChunkStatus) ID ¶
func (s *ChunkStatus) ID() flow.Identifier
type Chunks ¶
func (*Chunks) Add ¶
func (cs *Chunks) Add(chunk *ChunkStatus) bool
func (*Chunks) All ¶
func (cs *Chunks) All() []*ChunkStatus
func (*Chunks) ByID ¶
func (cs *Chunks) ByID(chunkID flow.Identifier) (*ChunkStatus, bool)
func (*Chunks) IncrementAttempt ¶
func (cs *Chunks) IncrementAttempt(chunkID flow.Identifier) bool
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine takes processable execution results, finds the chunks the are assigned to me, fetches the chunk data pack from execution nodes, and passes verifiable chunks to Verifier engine
func New ¶
func New( log zerolog.Logger, metrics module.VerificationMetrics, tracer module.Tracer, net module.Network, me module.Local, results mempool.ResultDataPacks, chunkIdsByResult mempool.IdentifierMap, verifier network.Engine, assigner module.ChunkAssigner, state protocol.State, chunks *Chunks, headers storage.Headers, retryInterval time.Duration, maxAttempt int, ) (*Engine, error)
func (*Engine) Done ¶
func (e *Engine) Done() <-chan struct{}
Done terminates the engine and returns a channel that is closed when the termination is done
func (*Engine) Process ¶
func (e *Engine) Process(originID flow.Identifier, event interface{}) error
Process processes the given event from the node with the given origin ID in a blocking manner. It returns the potential processing error when done.
func (*Engine) ProcessLocal ¶
ProcessLocal processes an event originating on the local node. Note: this method is required as an Engine implementation, however it should not be invoked as match engine requires origin ID of events it receives. Use Process method instead.
func (*Engine) Ready ¶
func (e *Engine) Ready() <-chan struct{}
Ready initializes the engine and returns a channel that is closed when the initialization is done
func (*Engine) Submit ¶
func (e *Engine) Submit(originID flow.Identifier, event interface{})
Submit submits the given event from the node with the given origin ID for processing in a non-blocking manner. It returns instantly and logs a potential processing error internally when done.
func (*Engine) SubmitLocal ¶
func (e *Engine) SubmitLocal(event interface{})
SubmitLocal submits an event originating on the local node.