Documentation ¶
Index ¶
Constants ¶
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 ¶
var ( ErrInvalidProposalPOLRound = errors.New("invalid proposal POL round") ErrInvalidProposalSignature = errors.New("invalid proposal signature") ErrVoteHeightMismatch = errors.New("vote height mismatch") ErrVoteInvalidValidatorAddress = errors.New("invalid validator address") ErrEmptyBlockProposal = errors.New("empty block proposal") ErrSignerMessageMissMatch = errors.New("deprived signer and address field of msg are miss-match") ErrCatchUpReplyAddressMissMatch = errors.New("address of catch up reply msg and its child are miss match") )
var ( ErrConflictingVotes = errors.New("vote received from the same validator for different block in the same round") ErrDifferentMsgType = errors.New("message set is not of the same type of the received message") )
Functions ¶
func NewMsgStorage ¶
func NewMsgStorage() *msgStorage
NewMsgStorage returns new instance of msgStorage
Types ¶
type CatchUpReplyMsg ¶
CatchUpReplyMsg stores the data of previous message send to a stuck node
type CatchUpRequestMsg ¶
type CatchUpRequestMsg struct { BlockNumber *big.Int Round int64 Step RoundStepType }
CatchUpRequestMsg represents the info of current stage of a node which is stuck in prevote or precommit for a while
type Engine ¶
Engine abstract the core's functions Note that backend and other packages doesn't care about core's internal logic. It only requires core to start receiving/handling messages The sending of events/message from core to backend will be done by calling accessing Backend.EventMux()
func New ¶
func New(backend tendermint.Backend, config *tendermint.Config, opts ...Option) Engine
New creates an Tendermint consensus core
type MsgStorageData ¶
type MsgStorageData struct { Step RoundStepType Round int64 Data []byte }
MsgStorageData contain data for message stored
type Option ¶
type Option func(c *core) error
func WithoutRebroadcast ¶
func WithoutRebroadcast() Option
WithoutRebroadcast return an option to set whether or not core will rebroadcast its message
type Proposal ¶
Proposal represent a propose message to be sent in the case of the node is a proposer for its Round.
type RoundStepType ¶
type RoundStepType uint8 // These must be numeric, ordered.
RoundStepType enumerates the state of the consensus state machine
func (RoundStepType) IsValid ¶
func (rs RoundStepType) IsValid() bool
IsValid returns true if the step is valid, false if unknown/undefined.
func (RoundStepType) String ¶
func (rs RoundStepType) String() string
String returns a string represent the current step based on RoundStepType Todo: use stringer for this.
type TimeoutTicker ¶
type TimeoutTicker interface { Start() error Stop() error 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. TimeoutTicker is thread-safe
func NewTimeoutTicker ¶
func NewTimeoutTicker() TimeoutTicker
NewTimeoutTicker returns a new TimeoutTicker that's ready to use