Skip to content

Commit 110f197

Browse files
committed
Updated godoc
1 parent 1aa0e51 commit 110f197

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

engine/common/follower.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ type FollowerCore interface {
1717
// The originID parameter identifies the node that sent the batch of blocks.
1818
// The connectedRange parameter contains the blocks, they must form a sequence of connected blocks.
1919
// No errors are expected during normal operations.
20-
// This function is safe to use in concurrent environment.
20+
// Implementors need to ensure that this function is safe to be used in concurrent environment.
2121
OnBlockRange(originID flow.Identifier, connectedRange []*flow.Block) error
2222
// OnFinalizedBlock is called when a new block is finalized by Hotstuff.
2323
// FollowerCore updates can update its local state using this information.
24-
// This function is safe to use in concurrent environment.
24+
// Implementors need to ensure that this function is safe to be used in concurrent environment.
2525
OnFinalizedBlock(finalized *flow.Header)
2626
}

engine/common/follower/core.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ func (c *Core) processCoreSeqEvents(ctx irrecoverable.SignalerContext, ready com
216216
}
217217
}
218218

219-
// OnFinalizedBlock updates local state of pendingCache tree using received finalized block.
220-
// Is NOT concurrency safe, has to be used by the same goroutine as extendCertifiedBlocks.
221-
// OnFinalizedBlock and extendCertifiedBlocks MUST be sequentially ordered.
219+
// OnFinalizedBlock updates local state of pendingCache tree using received finalized block and queues finalized block
220+
// to be processed by internal goroutine.
221+
// This function is safe to use in concurrent environment.
222222
func (c *Core) OnFinalizedBlock(final *flow.Header) {
223223
c.pendingCache.PruneUpToView(final.View)
224224

0 commit comments

Comments
 (0)