Documentation ¶
Index ¶
- Constants
- Variables
- type Extension
- type HeightVoteSet
- func (hvs *HeightVoteSet) AddVote(vote *pb.Vote, signature []byte) bool
- func (hvs *HeightVoteSet) POLInfo() (uint64, hash.Hash, bool)
- func (hvs *HeightVoteSet) Precommits(round uint64) *params.VoteSet
- func (hvs *HeightVoteSet) Prevotes(round uint64) *params.VoteSet
- func (hvs *HeightVoteSet) Reset(height uint64, valSet *params.ValidatorSet)
- func (hvs *HeightVoteSet) SetRound(round uint64)
- type Interface
- type RoundStep
- type RoundStepType
- type RoundVoteSet
- type TimeoutTicker
Constants ¶
View Source
const ( RoundStepNewHeight = RoundStepType(0x01) // Wait til CommitTime + timeoutCommit RoundStepNewRound = RoundStepType(0x02) // Setup new round and go to RoundStepPropose RoundStepPropose = RoundStepType(0x03) // Did propose, gossip proposal RoundStepPrevote = RoundStepType(0x04) // Did prevote, gossip prevotes RoundStepPrevoteWait = RoundStepType(0x05) // Did receive any +2/3 prevotes, start timeout RoundStepPrecommit = RoundStepType(0x06) // Did precommit, gossip precommits RoundStepPrecommitWait = RoundStepType(0x07) // Did receive any +2/3 precommits, start timeout RoundStepCommit = RoundStepType(0x08) // Entered commit state machine )
RoundStepType
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Extension ¶
type Extension interface { ProposalBlock(height uint64, signer *params.Singer) (*pb.Block, error) ValidateProposalBlock(proposal *pb.Proposal) error BroadcastProposal(proposal *pb.Proposal, signature []byte) error BroadcastVote(vote *pb.Vote, signature []byte) error Commit(block *pb.Block) error GetValidatorSet(height uint64) (*params.ValidatorSet, error) WAL(data []byte) error }
type HeightVoteSet ¶
type HeightVoteSet struct {
// contains filtered or unexported fields
}
func NewHeightVoteSet ¶
func NewHeightVoteSet(height, round uint64, valSet *params.ValidatorSet) *HeightVoteSet
func (*HeightVoteSet) AddVote ¶
func (hvs *HeightVoteSet) AddVote(vote *pb.Vote, signature []byte) bool
func (*HeightVoteSet) POLInfo ¶
func (hvs *HeightVoteSet) POLInfo() (uint64, hash.Hash, bool)
Last round and blockID that has +2/3 prevotes for a particular block or nil. Returns -1 if no such round exists.
func (*HeightVoteSet) Precommits ¶
func (hvs *HeightVoteSet) Precommits(round uint64) *params.VoteSet
func (*HeightVoteSet) Reset ¶
func (hvs *HeightVoteSet) Reset(height uint64, valSet *params.ValidatorSet)
func (*HeightVoteSet) SetRound ¶
func (hvs *HeightVoteSet) SetRound(round uint64)
type Interface ¶
type Interface interface { SetProposal(ctx context.Context, proposal *pb.Proposal, signature []byte) error SetVote(ctx context.Context, vote *pb.Vote, signature []byte) error }
func New ¶
func New(authClient pb.AuthClient, chainClient pb.ChainClient, networkClient pb.NetworkClient) Interface
type RoundStep ¶
type RoundStep interface { SetProposal(proposal *pb.Proposal, signature []byte) error SetVote(vote *pb.Vote, signature []byte) error }
RoundStep defines the internal consensus state. NOTE: Not thread safe. Should only be manipulated by functions downstream of the cs.receiveRoutine
func NewRoundStep ¶
type RoundStepType ¶
type RoundStepType uint8 // These must be numeric, ordered.
RoundStepType enumerates the state of the consensus state machine
type RoundVoteSet ¶
type TimeoutTicker ¶
type TimeoutTicker interface { Start() Stop() Chan() <-chan timeoutInfo // on which to receive a timeout ScheduleTimeout(ti timeoutInfo) // reset the timer }
TimeoutTicker is a timer that schedules timeouts conditional on the height/round/step in the timeoutInfo. The timeoutInfo.Duration may be non-positive.
func NewTimeoutTicker ¶
func NewTimeoutTicker() TimeoutTicker
NewTimeoutTicker returns a new TimeoutTicker.
Click to show internal directories.
Click to hide internal directories.