tendermint

package
v0.0.0-...-caec882 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

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

View Source
var (
	ErrInvalidProposalSignature = errors.New("Error invalid proposal signature")
	ErrInvalidProposalPOLRound  = errors.New("Error invalid proposal POL round")
	ErrAddingVote               = errors.New("Error adding vote")
	ErrVoteHeightMismatch       = errors.New("Error vote height mismatch")
)

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) Prevotes

func (hvs *HeightVoteSet) Prevotes(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

func NewRoundStep(height uint64, valSet *params.ValidatorSet, singer *params.Singer, extension Extension) RoundStep

type RoundStepType

type RoundStepType uint8 // These must be numeric, ordered.

RoundStepType enumerates the state of the consensus state machine

func (RoundStepType) String

func (rs RoundStepType) String() string

String returns a string

type RoundVoteSet

type RoundVoteSet struct {
	Prevotes   *params.VoteSet
	Precommits *params.VoteSet
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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