Skip to content

Commit 2adf27a

Browse files
durkmurderAlexander Hentschel
andauthored
Apply suggestions from code review
Co-authored-by: Alexander Hentschel <[email protected]>
1 parent f681cd4 commit 2adf27a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

engine/common/follower/core.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ func (c *Core) OnBlockRange(originID flow.Identifier, batch []*flow.Block) error
199199

200200
// processCoreSeqEvents processes events that need to be dispatched on dedicated core's goroutine.
201201
// Here we process events that need to be sequentially ordered(processing certified blocks and new finalized blocks).
202+
// Implements `component.ComponentWorker` signature.
202203
// Is NOT concurrency safe: should be executed by _single dedicated_ goroutine.
203204
func (c *Core) processCoreSeqEvents(ctx irrecoverable.SignalerContext, ready component.ReadyFunc) {
204205
ready()

engine/common/follower/core_test.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,13 @@ func (s *CoreSuite) TestAddFinalizedBlock() {
122122
require.Nil(s.T(), s.core.pendingCache.Peek(block.ID()))
123123
}
124124

125-
// TestProcessingRangeHappyPath tests processing range with length > 1, which will result in a chain of certified blocks
126-
// that have to be added to the protocol state once validated and added to pending cache and then pending tree.
125+
// TestProcessingRangeHappyPath tests processing range of blocks with length > 1, which should result
126+
// in a chain of certified blocks that have been
127+
// 1. validated
128+
// 2. added to the pending cache
129+
// 3. added to the pending tree
130+
// 4. added to the protocol state
131+
// Finally, the certified blocks should be forwarded to the HotStuff follower.
127132
func (s *CoreSuite) TestProcessingRangeHappyPath() {
128133
blocks := unittest.ChainFixtureFrom(10, s.finalizedBlock)
129134

@@ -238,9 +243,10 @@ func (s *CoreSuite) TestDetectingProposalEquivocation() {
238243
// TestConcurrentAdd simulates multiple workers adding batches of connected blocks out of order.
239244
// We use next setup:
240245
// Number of workers - workers
241-
// Number of batches submitted by worker - batchesPerWorker
242-
// Number of blocks in each batch submitted by worker - blocksPerBatch
243-
// Each worker submits batchesPerWorker*blocksPerBatch blocks
246+
// - Number of workers - workers
247+
// - Number of batches submitted by worker - batchesPerWorker
248+
// - Number of blocks in each batch submitted by worker - blocksPerBatch
249+
// - Each worker submits batchesPerWorker*blocksPerBatch blocks
244250
// In total we will submit workers*batchesPerWorker*blocksPerBatch
245251
// After submitting all blocks we expect that chain of blocks except last one will be added to the protocol state and
246252
// submitted for further processing to Hotstuff layer.

0 commit comments

Comments
 (0)