Versions in this module Expand all Collapse all v1 v1.3.1 Jul 31, 2021 Changes in this version + const DataChannel + const ROUND_NOT_PROPOSED + const ROUND_PROPOSED + const RoundStepCommit + const RoundStepNewHeight + const RoundStepNewRound + const RoundStepPrecommit + const RoundStepPrecommitWait + const RoundStepPrevote + const RoundStepPrevoteWait + const RoundStepPropose + const RoundStepWaitForMinerBlock + const StateChannel + const VoteChannel + const VoteSetBitsChannel + var ErrAddingVote = errors.New("Error adding vote") + var ErrDuplicateSignatureAggr = errors.New("Duplicate signature aggregation") + var ErrInvalidProposalPOLRound = errors.New("Error invalid proposal POL round") + var ErrInvalidProposalSignature = errors.New("Error invalid proposal signature") + var ErrInvalidSignatureAggr = errors.New("Invalid signature aggregation") + var ErrMinerBlock = errors.New("Miner block is nil") + var ErrNotMaj23SignatureAggr = errors.New("Signature aggregation has no +2/3 power") + var ErrPeerStateHeightRegression = errors.New("Error peer state height regression") + var ErrPeerStateInvalidStartTime = errors.New("Error peer state invalid startTime") + var ErrVoteHeightMismatch = errors.New("Error vote height mismatch") + var Major = "0" + var Minor = "2" + var NodeID = "" + var Revision = "2" + var Spec = "1" + var Version = Fmt("v%s/%s.%s.%s", Spec, Major, Minor, Revision) + func BytesToBig(data []byte) *big.Int + func CompareHRS(h1 uint64, r1 int, s1 RoundStepType, h2 uint64, r2 int, s2 RoundStepType) int + type Backend interface + ChainReader func() consss.ChainReader + Commit func(proposal *types.NCBlock, seals [][]byte, isProposer func() bool) error + GetBroadcaster func() consss.Broadcaster + GetCreateEmptyBlocks func() bool + GetCreateEmptyBlocksInterval func() int + GetLogger func() log.Logger + WaitForTxs func() bool + type BlockPartMessage struct + Height uint64 + Part *types.Part + Round int + func (m *BlockPartMessage) String() string + type CommitStepMessage struct + BlockParts *BitArray + BlockPartsHeader types.PartSetHeader + Height uint64 + func (m *CommitStepMessage) String() string + type ConsensusMessage interface + func DecodeMessage(bz []byte) (msgType byte, msg ConsensusMessage, err error) + type ConsensusReactor struct + ChainId string + func NewConsensusReactor(consensusState *ConsensusState) *ConsensusReactor + func (conR *ConsensusReactor) AddPeer(peer consensus.Peer) + func (conR *ConsensusReactor) AfterStart() + func (conR *ConsensusReactor) OnStart() error + func (conR *ConsensusReactor) OnStop() + func (conR *ConsensusReactor) Receive(chID uint64, src consensus.Peer, msgBytes []byte) + func (conR *ConsensusReactor) RemovePeer(peer consensus.Peer, reason interface{}) + func (conR *ConsensusReactor) SetEventSwitch(evsw types.EventSwitch) + func (conR *ConsensusReactor) String() string + type ConsensusState struct + Epoch *ep.Epoch + func NewConsensusState(backend Backend, config cfg.Config, chainConfig *params.ChainConfig, ...) *ConsensusState + func (bs *ConsensusState) GetChainReader() consss.ChainReader + func (cs *ConsensusState) AddProposalBlockPart(height uint64, round int, part *types.Part, peerKey string) error + func (cs *ConsensusState) AddVote(vote *types.Vote, peerKey string) (added bool, err error) + func (cs *ConsensusState) BLSVerifySignAggr(signAggr *types.SignAggr) (bool, error) + func (cs *ConsensusState) GetProposer() *types.Validator + func (cs *ConsensusState) GetRoundState() *RoundState + func (cs *ConsensusState) GetState() *sm.State + func (cs *ConsensusState) GetValidators() (uint64, []*types.Validator) + func (cs *ConsensusState) InitState(epoch *ep.Epoch) *sm.State + func (cs *ConsensusState) Initialize() + func (cs *ConsensusState) IsProposer() bool + func (cs *ConsensusState) LoadBlock(height uint64) *types.NCBlock + func (cs *ConsensusState) LoadCommit(height uint64) *types.Commit + func (cs *ConsensusState) LoadLastNeatConExtra() (*types.NeatConExtra, uint64) + func (cs *ConsensusState) LoadNeatConExtra(height uint64) (*types.NeatConExtra, uint64) + func (cs *ConsensusState) OnStart() error + func (cs *ConsensusState) OnStop() + func (cs *ConsensusState) ReconstructLastCommit(state *sm.State) + func (cs *ConsensusState) SetEventSwitch(evsw types.EventSwitch) + func (cs *ConsensusState) SetPrivValidator(priv PrivValidator) + func (cs *ConsensusState) SetProposal(proposal *types.Proposal, peerKey string) error + func (cs *ConsensusState) SetProposalAndBlock(proposal *types.Proposal, block *types.NCBlock, parts *types.PartSet, ...) error + func (cs *ConsensusState) SetTimeoutTicker(timeoutTicker TimeoutTicker) + func (cs *ConsensusState) StartNewHeight() + func (cs *ConsensusState) String() string + func (cs *ConsensusState) UpdateToState(state *sm.State) + func (cs *ConsensusState) ValidateTX4(b *types.NCBlock) error + func (cs *ConsensusState) Wait() + type HasVoteMessage struct + Height uint64 + Index int + Round int + Type byte + func (m *HasVoteMessage) String() string + type HeightVoteSet struct + func NewHeightVoteSet(chainID string, height uint64, valSet *types.ValidatorSet, logger log.Logger) *HeightVoteSet + func (hvs *HeightVoteSet) AddVote(vote *types.Vote, peerKey string) (added bool, err error) + func (hvs *HeightVoteSet) Height() uint64 + func (hvs *HeightVoteSet) POLInfo() (polRound int, polBlockID types.BlockID) + func (hvs *HeightVoteSet) Precommits(round int) *types.VoteSet + func (hvs *HeightVoteSet) Prevotes(round int) *types.VoteSet + func (hvs *HeightVoteSet) Reset(height uint64, valSet *types.ValidatorSet) + func (hvs *HeightVoteSet) ResetTop2Round(round int) + func (hvs *HeightVoteSet) Round() int + func (hvs *HeightVoteSet) SetPeerMaj23(round int, type_ byte, peerID string, blockID types.BlockID) + func (hvs *HeightVoteSet) SetRound(round int) + func (hvs *HeightVoteSet) String() string + func (hvs *HeightVoteSet) StringIndented(indent string) string + type HeightVoteSignAggr struct + func NewHeightVoteSignAggr(chainID string, height uint64, valSet *types.ValidatorSet, logger log.Logger) *HeightVoteSignAggr + func (hvs *HeightVoteSignAggr) AddSignAggr(signAggr *types.SignAggr) (added bool, err error) + func (hvs *HeightVoteSignAggr) Height() uint64 + func (hvs *HeightVoteSignAggr) POLInfo() (polRound int, polBlockID types.BlockID) + func (hvs *HeightVoteSignAggr) Precommits(round int) *types.SignAggr + func (hvs *HeightVoteSignAggr) Prevotes(round int) *types.SignAggr + func (hvs *HeightVoteSignAggr) Reset(height uint64, valSet *types.ValidatorSet) + func (hvs *HeightVoteSignAggr) ResetTop2Round(round int) + func (hvs *HeightVoteSignAggr) Round() int + func (hvs *HeightVoteSignAggr) SetRound(round int) + func (hvs *HeightVoteSignAggr) String() string + func (hvs *HeightVoteSignAggr) StringIndented(indent string) string + type Maj23SignAggrMessage struct + Maj23SignAggr *types.SignAggr + func (m *Maj23SignAggrMessage) String() string + type NewRoundStepMessage struct + Height uint64 + LastCommitRound int + Round int + SecondsSinceStartTime int + Step RoundStepType + func (m *NewRoundStepMessage) String() string + type PeerRoundState struct + Height uint64 + PrecommitMaj23SignAggr bool + Precommits *BitArray + PrevoteMaj23SignAggr bool + Prevotes *BitArray + Proposal bool + ProposalBlockParts *BitArray + ProposalBlockPartsHeader types.PartSetHeader + ProposalPOL *BitArray + ProposalPOLRound int + Round int + StartTime time.Time + Step RoundStepType + func (prs PeerRoundState) String() string + func (prs PeerRoundState) StringIndented(indent string) string + type PeerState struct + Connected bool + Peer consensus.Peer + func NewPeerState(peer consensus.Peer, logger log.Logger) *PeerState + func (ps *PeerState) ApplyCommitStepMessage(msg *CommitStepMessage) + func (ps *PeerState) ApplyHasVoteMessage(msg *HasVoteMessage) + func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage) + func (ps *PeerState) ApplyProposalPOLMessage(msg *ProposalPOLMessage) + func (ps *PeerState) ApplyVoteSetBitsMessage(msg *VoteSetBitsMessage, ourVotes *BitArray) + func (ps *PeerState) Disconnect() + func (ps *PeerState) EnsureVoteBitArrays(height uint64, numValidators uint64) + func (ps *PeerState) GetHeight() uint64 + func (ps *PeerState) GetRoundState() *PeerRoundState + func (ps *PeerState) PickSendSignAggr(signAggr *types.SignAggr) (ok bool) + func (ps *PeerState) PickSendVote(votes types.VoteSetReader) (ok bool) + func (ps *PeerState) PickVoteToSend(votes types.VoteSetReader) (vote *types.Vote, ok bool) + func (ps *PeerState) SetHasMaj23SignAggr(signAggr *types.SignAggr) + func (ps *PeerState) SetHasProposal(proposal *types.Proposal) + func (ps *PeerState) SetHasProposalBlockPart(height uint64, round int, index int) + func (ps *PeerState) SetHasVote(vote *types.Vote) + func (ps *PeerState) String() string + func (ps *PeerState) StringIndented(indent string) string + type PrivValidator interface + GetAddress func() []byte + GetPubKey func() tmdcrypto.PubKey + SignProposal func(chainID string, proposal *types.Proposal) error + SignVote func(chainID string, vote *types.Vote) error + type ProposalMessage struct + Proposal *types.Proposal + func (m *ProposalMessage) String() string + type ProposalPOLMessage struct + Height uint64 + ProposalPOL *BitArray + ProposalPOLRound int + func (m *ProposalPOLMessage) String() string + type RoundState struct + CommitRound int + CommitTime time.Time + Height uint64 + LockedBlock *types.NCBlock + LockedBlockParts *types.PartSet + LockedRound int + PrecommitMaj23SignAggr *types.SignAggr + PrevoteMaj23SignAggr *types.SignAggr + Proposal *types.Proposal + ProposalBlock *types.NCBlock + ProposalBlockParts *types.PartSet + ProposerPeerKey string + Round int + StartTime time.Time + Step RoundStepType + Validators *types.ValidatorSet + VoteSignAggr *HeightVoteSignAggr + Votes *HeightVoteSet + func (rs *RoundState) RoundStateEvent() types.EventDataRoundState + func (rs *RoundState) String() string + func (rs *RoundState) StringIndented(indent string) string + func (rs *RoundState) StringShort() string + type RoundStepType uint8 + func (rs RoundStepType) String() string + type RoundVoteSet struct + Precommits *types.VoteSet + Prevotes *types.VoteSet + type RoundVoteSignAggr struct + Precommits *types.SignAggr + Prevotes *types.SignAggr + type TimeoutParams struct + Commit0 int + Precommit0 int + PrecommitDelta int + Prevote0 int + PrevoteDelta int + Propose0 int + ProposeDelta int + SkipTimeoutCommit bool + WaitForMinerBlock0 int + func InitTimeoutParamsFromConfig(config cfg.Config) *TimeoutParams + func (tp *TimeoutParams) Commit(t time.Time) time.Time + func (tp *TimeoutParams) Precommit(round int) time.Duration + func (tp *TimeoutParams) Prevote(round int) time.Duration + func (tp *TimeoutParams) Propose(round int) time.Duration + func (tp *TimeoutParams) WaitForMinerBlock() time.Duration + type TimeoutTicker interface + Chan func() <-chan timeoutInfo + ScheduleTimeout func(ti timeoutInfo) + Start func() (bool, error) + Stop func() bool + func NewTimeoutTicker(logger log.Logger) TimeoutTicker + type VRFProposer struct + Height uint64 + Proposer *types.Validator + Round int + func (propser *VRFProposer) Validate(height uint64, round int) bool + type VoteMessage struct + Vote *types.Vote + func (m *VoteMessage) String() string + type VoteSetBitsMessage struct + BlockID types.BlockID + Height uint64 + Round int + Type byte + Votes *BitArray + func (m *VoteSetBitsMessage) String() string + type VoteSetMaj23Message struct + BlockID types.BlockID + Height uint64 + Round int + Type byte + func (m *VoteSetMaj23Message) String() string v1.3.0 Jul 31, 2021