Skip to content

Commit 1354aa7

Browse files
durkmurderAlexander Hentschel
andauthored
Apply suggestions from code review
Co-authored-by: Alexander Hentschel <[email protected]>
1 parent 52ed66b commit 1354aa7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

consensus/follower.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func NewFollower(log zerolog.Logger, committee hotstuff.DynamicCommittee, header
2929
// initialize the Validator
3030
validator := validator.New(committee, verifier)
3131

32-
// recover the hotstuff state as a follower
32+
// recover the HotStuff follower's internal state (inserts all pending blocks into Forks)
3333
err = recovery.Follower(log, forks, validator, pending)
3434
if err != nil {
3535
return nil, fmt.Errorf("could not recover hotstuff follower state: %w", err)

consensus/participant.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func NewParticipant(
4646
modules.VoteAggregator.PruneUpToView(finalized.View)
4747
modules.TimeoutAggregator.PruneUpToView(finalized.View)
4848

49-
// recover the hotstuff state, mainly to recover all pending blocks in Forks
49+
// recover hotstuff state (inserts all pending blocks into Forks and VoteAggregator)
5050
err := recovery.Participant(log, modules.Forks, modules.VoteAggregator, modules.Validator, pending)
5151
if err != nil {
5252
return nil, fmt.Errorf("could not recover hotstuff state: %w", err)

consensus/recovery/recover.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
// Recover implements the core logic for recovering HotStuff state after a restart.
16-
// It accepts the finalized block and a list of pending blocks that have been
16+
// It receives the list `pending` that should contain _all_ blocks that have been
1717
// received but not finalized, and that share the latest finalized block as a common
1818
// ancestor.
1919
func Recover(log zerolog.Logger, pending []*flow.Header, validator hotstuff.Validator, onProposal func(*model.Proposal) error) error {

0 commit comments

Comments
 (0)