scheduler

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package scheduler defines interfaces and implementations for scheduling different processes as value proposers. At any given height and round, exactly one process is expected to take responsibility for proposing a value, and this is determined by the Scheduler.

It is important that all processes agree on the schedule. That is, at any given height and round, all processes must arrive at the same decision regarding which process is expected to be the proposer. This is most commonly done by making the schedule deterministic and locally computable. This means that processes do not have to invoke a consensus algorithm in order to agree on the schedule (although, this is possible to do, using values from height N to agree on the schedule for height N+1).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoundRobin

func NewRoundRobin(signatories []id.Signatory) process.Scheduler

NewRoundRobin returns a Scheduler that uses a simple round-robin scheduling algorithm to select a proposer. Round-robin scheduling has the advantage of being very easy to implement and understand, but has the disadvantage of being unfair. As such, it should be avoided when the proposer is expected to receive a reward.

Types

type RoundRobin

type RoundRobin struct {
	// contains filtered or unexported fields
}

RoundRobin holds a list of signatories that will participate in the round robin scheduling

func (*RoundRobin) Schedule

func (rr *RoundRobin) Schedule(height process.Height, round process.Round) id.Signatory

Schedule a proposer using the sum of the height and round, modulo the number of candidate processes, as an index into the current slice of candidate processes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL