Skip to content

Commit aad332c

Browse files
Apply suggestions from code review
Doc comment changes, metrics naming, and queue length. For reasoning behind chosen queue length, see #6747 (comment) Co-authored-by: Jordan Schalm <[email protected]>
1 parent 17a9a2b commit aad332c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

engine/collection/pusher/engine.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ import (
2525
"github.com/onflow/flow-go/utils/logging"
2626
)
2727

28-
// Engine is part of the Collection Nodes. It broadcasts finalized collections
29-
// that the cluster generates to the broader network.
28+
// Engine is part of the Collection Node. It broadcasts finalized collections
29+
// ("collection guarantees") that the cluster generates to Consensus Nodes
30+
// for inclusion in blocks.
3031
type Engine struct {
3132
log zerolog.Logger
3233
engMetrics module.EngineMetrics
@@ -61,7 +62,7 @@ func New(
6162
transactions storage.Transactions,
6263
) (*Engine, error) {
6364
queue, err := fifoqueue.NewFifoQueue(
64-
1000,
65+
200, // roughly 1 minute of collections, at 3BPS
6566
fifoqueue.WithLengthObserver(func(len int) {
6667
mempoolMetrics.MempoolEntries(metrics.ResourceSubmitCollectionGuaranteesQueue, uint(len))
6768
}),
@@ -99,7 +100,8 @@ func New(
99100
return e, nil
100101
}
101102

102-
// Worker to process SubmitCollectionGuarantee messages coming from the Finalizer.
103+
// outboundQueueWorker implements a component worker which broadcasts collection guarantees,
104+
// enqueued by the Finalizer upon finalization, to Consensus Nodes.
103105
func (e *Engine) outboundQueueWorker(ctx irrecoverable.SignalerContext, ready component.ReadyFunc) {
104106
ready()
105107

module/metrics/labels.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const (
113113
ResourceFollowerLoopCertifiedBlocksChannel = "follower_loop_certified_blocks_channel" // follower loop, certified blocks buffered channel
114114
ResourceClusterBlockProposalQueue = "cluster_compliance_proposal_queue" // collection node, compliance engine
115115
ResourceTransactionIngestQueue = "ingest_transaction_queue" // collection node, ingest engine
116-
ResourceSubmitCollectionGuaranteesQueue = "submit_col_guarantee_queue" // collection node, pusher engine
116+
ResourceSubmitCollectionGuaranteesQueue = "pusher_col_guarantee_queue" // collection node, pusher engine
117117
ResourceBeaconKey = "beacon-key" // consensus node, DKG engine
118118
ResourceDKGMessage = "dkg_private_message" // consensus, DKG messaging engine
119119
ResourceApprovalQueue = "sealing_approval_queue" // consensus node, sealing engine

0 commit comments

Comments
 (0)