Skip to content

Commit 2048b4a

Browse files
committed
Apply suggestions from code review
1 parent cebf100 commit 2048b4a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

engine/collection/pusher/engine.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ func New(
6969
return nil, fmt.Errorf("could not create fifoqueue: %w", err)
7070
}
7171

72-
notifier := engine.NewNotifier()
73-
7472
e := &Engine{
7573
log: log.With().Str("engine", "pusher").Logger(),
7674
engMetrics: engMetrics,
@@ -79,7 +77,7 @@ func New(
7977
collections: collections,
8078
transactions: transactions,
8179

82-
notifier: notifier,
80+
notifier: engine.NewNotifier(),
8381
queue: queue,
8482
}
8583

@@ -194,11 +192,12 @@ func (e *Engine) SubmitCollectionGuarantee(msg *messages.SubmitCollectionGuarant
194192
func (e *Engine) publishCollectionGuarantee(guarantee *flow.CollectionGuarantee) error {
195193
consensusNodes, err := e.state.Final().Identities(filter.HasRole[flow.Identity](flow.RoleConsensus))
196194
if err != nil {
197-
return fmt.Errorf("could not get consensus nodes: %w", err)
195+
return fmt.Errorf("could not get consensus nodes' identities: %w", err)
198196
}
199197

200-
// NOTE: Consensus nodes do not broadcast guarantees among themselves, so it needs that
201-
// at least one collection node make a publish to all of them.
198+
// NOTE: Consensus nodes do not broadcast guarantees among themselves. So for the collection to be included,
199+
// at least one collector has to successfully broadcast the collection to consensus nodes. Otherwise, the
200+
// collection is lost, which is acceptable as long as we only lose a small fraction of collections.
202201
err = e.conduit.Publish(guarantee, consensusNodes.NodeIDs()...)
203202
if err != nil {
204203
return fmt.Errorf("could not submit collection guarantee: %w", err)

0 commit comments

Comments
 (0)