88 "github.com/rs/zerolog"
99 "github.com/rs/zerolog/log"
1010
11- "github.com/onflow/flow-go/engine"
1211 "github.com/onflow/flow-go/model/chunks"
1312 "github.com/onflow/flow-go/model/flow"
1413 "github.com/onflow/flow-go/model/flow/filter"
@@ -24,7 +23,6 @@ import (
2423// to me to verify, and then save it to the chunks job queue for the
2524// fetcher engine to process.
2625type Engine struct {
27- unit * engine.Unit
2826 log zerolog.Logger
2927 metrics module.VerificationMetrics
3028 tracer module.Tracer
@@ -36,8 +34,11 @@ type Engine struct {
3634 blockConsumerNotifier module.ProcessingNotifier // to report a block has been processed.
3735 stopAtHeight uint64
3836 stopAtBlockID atomic.Value
37+ * module.NoopReadyDoneAware
3938}
4039
40+ var _ module.ReadyDoneAware = (* Engine )(nil )
41+
4142func New (
4243 log zerolog.Logger ,
4344 metrics module.VerificationMetrics ,
@@ -50,7 +51,6 @@ func New(
5051 stopAtHeight uint64 ,
5152) * Engine {
5253 e := & Engine {
53- unit : engine .NewUnit (),
5454 log : log .With ().Str ("engine" , "assigner" ).Logger (),
5555 metrics : metrics ,
5656 tracer : tracer ,
@@ -69,14 +69,6 @@ func (e *Engine) WithBlockConsumerNotifier(notifier module.ProcessingNotifier) {
6969 e .blockConsumerNotifier = notifier
7070}
7171
72- func (e * Engine ) Ready () <- chan struct {} {
73- return e .unit .Ready ()
74- }
75-
76- func (e * Engine ) Done () <- chan struct {} {
77- return e .unit .Done ()
78- }
79-
8072// resultChunkAssignment receives an execution result that appears in a finalized incorporating block.
8173// In case this verification node is authorized at the reference block of this execution receipt's result,
8274// chunk assignment is computed for the result, and the list of assigned chunks returned.
@@ -164,7 +156,8 @@ func (e *Engine) processChunk(chunk *flow.Chunk, resultID flow.Identifier, block
164156func (e * Engine ) ProcessFinalizedBlock (block * flow.Block ) {
165157 blockID := block .ID ()
166158
167- span , ctx := e .tracer .StartBlockSpan (e .unit .Ctx (), blockID , trace .VERProcessFinalizedBlock )
159+ // We don't have any existing information and don't need cancellation, so use a background (empty) context
160+ span , ctx := e .tracer .StartBlockSpan (context .Background (), blockID , trace .VERProcessFinalizedBlock )
168161 defer span .End ()
169162
170163 e .processFinalizedBlock (ctx , block )
0 commit comments