Skip to content

Commit

Permalink
Update some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Dec 6, 2021
1 parent c633df6 commit 0330324
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dot/sync/chain_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type peerState struct {
// workHandler should be implemented by `bootstrapSync` and `tipSync`
type workHandler interface {
// handleNewPeerState returns a new worker based on a peerState.
// It returns the error errNoWorker in which case we do nothing.
// The worker may be nil in which case we do nothing.
handleNewPeerState(*peerState) (*worker, error)

// handleWorkerResult handles the result of a worker, which may be
Expand Down
4 changes: 2 additions & 2 deletions lib/babe/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func makeTranscript(randomness Randomness, slot, epoch uint64) *merlin.Transcrip
}

// claimPrimarySlot checks if a slot can be claimed.
// If it cannot be claimed the wrapped error errPrimarySlotThreshold
// is returned.
// If it cannot be claimed, the wrapped error
// errOverPrimarySlotThreshold is returned.
// https://github.com/paritytech/substrate/blob/master/client/consensus/babe/src/authorship.rs#L239
func claimPrimarySlot(randomness Randomness,
slot, epoch uint64,
Expand Down
3 changes: 2 additions & 1 deletion lib/babe/epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ func (b *Service) incrementEpoch() (uint64, error) {
// runLottery runs the lottery for a specific slot number.
// It returns an encoded VrfOutputAndProof if the validator is authorised
// to produce a block for that slot.
// It returns the wrapped error errPrimarySlotThreshold if it is not authorised.
// It returns the wrapped error errOverPrimarySlotThreshold
// if it is not authorised.
// output = return[0:32]; proof = return[32:96]
func (b *Service) runLottery(slot, epoch uint64) (*VrfOutputAndProof, error) {
return claimPrimarySlot(
Expand Down

0 comments on commit 0330324

Please sign in to comment.