Skip to content

Commit

Permalink
fix godocs
Browse files Browse the repository at this point in the history
  • Loading branch information
kc1116 committed Jul 8, 2024
1 parent 097757d commit 74bf50c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
13 changes: 5 additions & 8 deletions consensus/hotstuff/cruisectl/block_time_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (ctl *BlockTimeController) getProposalTiming() ProposalTiming {
}

// TargetPublicationTime is intended to be called by the EventHandler, whenever it
// wants to publish a new proposal. The data handler inputs
// wants to publish a new proposal. The event handler inputs
// - proposalView: the view it is proposing for,
// - timeViewEntered: the time when the EventHandler entered this view
// - parentBlockId: the ID of the parent block, which the EventHandler is building on
Expand Down Expand Up @@ -440,18 +440,15 @@ func (ctl *BlockTimeController) measureViewDuration(tb TimedBlock) error {

// processEpochExtended processes the EpochExtended protocol data.
// Whenever we encounter an epoch extension, we:
// - check if this epoch fallback triggered is true, if not this is our first extension we should update the epoch fallback triggered flag:
// - set ProposalTiming to the default value
// - set epoch fallback triggered, to disable the controller
// - update the curr epoch final view and target end time with the extension data
// - set epochFallbackTriggered to true if this is the first extension encountered.
// - update the curr epoch final view and target end time with the extension data.
//
// No errors are expected during normal operation.
func (ctl *BlockTimeController) processEpochExtended(_ uint64, _ *flow.Header, extension flow.EpochExtension) error {
if !ctl.epochFallbackTriggered {
// set epochFallbackTriggered to true when we encounter the first extension
ctl.epochFallbackTriggered = true
}

ctl.curEpochFinalView = extension.FinalView
ctl.curEpochTargetEndTime = extension.TargetEndTime
return nil
Expand Down Expand Up @@ -491,8 +488,8 @@ func (ctl *BlockTimeController) processEpochCommittedPhaseStarted(_ uint64, firs
}

// OnBlockIncorporated listens to notification from HotStuff about incorporating new blocks.
// The data is queued for async processing by the worker. If the channel is full,
// the data is discarded - since we are taking an average it doesn't matter if we
// The event is queued for async processing by the worker. If the channel is full,
// the event is discarded - since we are taking an average it doesn't matter if we
// occasionally miss a sample.
func (ctl *BlockTimeController) OnBlockIncorporated(block *model.Block) {
select {
Expand Down
2 changes: 1 addition & 1 deletion consensus/hotstuff/cruisectl/block_time_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (bs *BlockTimeControllerSuite) TestOnEpochCommittedPhaseStarted() {
}

// TestOnBlockIncorporated_UpdateProposalDelay tests that a new measurement is taken and
// GetProposalTiming updated upon receiving an OnBlockIncorporated data.
// GetProposalTiming updated upon receiving an OnBlockIncorporated event.
func (bs *BlockTimeControllerSuite) TestOnBlockIncorporated_UpdateProposalDelay() {
bs.CreateAndStartController()
defer bs.StopController()
Expand Down
4 changes: 2 additions & 2 deletions state/protocol/events/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ func (n Noop) EpochTransition(uint64, *flow.Header) {}

func (n Noop) EpochSetupPhaseStarted(uint64, *flow.Header) {}

func (n Noop) EpochCommittedPhaseStarted(_ uint64, _ *flow.Header) {}
func (n Noop) EpochCommittedPhaseStarted(uint64, *flow.Header) {}

func (n Noop) EpochFallbackModeTriggered(uint64, *flow.Header) {}

func (n Noop) EpochFallbackModeExited(uint64, *flow.Header) {}

func (n Noop) EpochExtended(_ uint64, _ *flow.Header, _ flow.EpochExtension) {}
func (n Noop) EpochExtended(uint64, *flow.Header, flow.EpochExtension) {}

func (n Noop) ActiveClustersChanged(flow.ChainIDList) {}

0 comments on commit 74bf50c

Please sign in to comment.