Versions in this module Expand all Collapse all v0 v0.0.9 Aug 14, 2020 v0.0.9-Bytes01 Aug 18, 2020 v0.0.9-Bytes Aug 18, 2020 v0.0.8 Aug 14, 2020 v0.0.7 Aug 11, 2020 Changes in this version + const TimeoutDelta + const TimeoutPreCommit + const TimeoutPreVote + const TimeoutPropose + func MajorityTwoThird(n int) int + type BftBasicInfo struct + HeightRound HeightRound + PublicKeyBytes hexutil.Bytes + SourceId uint16 + func (b *BftBasicInfo) ProvideHeight() uint64 + func (m BftBasicInfo) String() string + func (z *BftBasicInfo) DecodeMsg(dc *msgp.Reader) (err error) + func (z *BftBasicInfo) EncodeMsg(en *msgp.Writer) (err error) + func (z *BftBasicInfo) MarshalMsg(b []byte) (o []byte, err error) + func (z *BftBasicInfo) Msgsize() (s int) + func (z *BftBasicInfo) UnmarshalMsg(bts []byte) (o []byte, err error) + type BftMessage interface + GetType func() BftMessageType + ProvideHeight func() uint64 + String func() string + type BftMessageEvent struct + Message BftMessage + Peer BftPeer + type BftMessagePreCommit struct + BlsSignature hexutil.Bytes + Idv *types.Hash + func (m *BftMessagePreCommit) BlsSignatureTargets() []byte + func (m *BftMessagePreCommit) SignatureTargets() []byte + func (m BftMessagePreCommit) String() string + func (z *BftMessagePreCommit) DecodeMsg(dc *msgp.Reader) (err error) + func (z *BftMessagePreCommit) EncodeMsg(en *msgp.Writer) (err error) + func (z *BftMessagePreCommit) GetType() BftMessageType + func (z *BftMessagePreCommit) MarshalMsg(b []byte) (o []byte, err error) + func (z *BftMessagePreCommit) Msgsize() (s int) + func (z *BftMessagePreCommit) PublicKey() []byte + func (z *BftMessagePreCommit) UnmarshalMsg(bts []byte) (o []byte, err error) + type BftMessagePreVote struct + Idv *types.Hash + func (m *BftMessagePreVote) SignatureTargets() []byte + func (m BftMessagePreVote) String() string + func (z *BftMessagePreVote) DecodeMsg(dc *msgp.Reader) (err error) + func (z *BftMessagePreVote) EncodeMsg(en *msgp.Writer) (err error) + func (z *BftMessagePreVote) GetType() BftMessageType + func (z *BftMessagePreVote) MarshalMsg(b []byte) (o []byte, err error) + func (z *BftMessagePreVote) Msgsize() (s int) + func (z *BftMessagePreVote) PublicKey() []byte + func (z *BftMessagePreVote) UnmarshalMsg(bts []byte) (o []byte, err error) + type BftMessageProposal struct + ValidRound int + Value Proposal + func (m *BftMessageProposal) GetType() BftMessageType + func (m *BftMessageProposal) PublicKey() []byte + func (m *BftMessageProposal) SignatureTargets() []byte + func (m BftMessageProposal) String() string + func (z *BftMessageProposal) DecodeMsg(dc *msgp.Reader) (err error) + func (z *BftMessageProposal) EncodeMsg(en *msgp.Writer) (err error) + func (z *BftMessageProposal) MarshalMsg(b []byte) (o []byte, err error) + func (z *BftMessageProposal) Msgsize() (s int) + func (z *BftMessageProposal) UnmarshalMsg(bts []byte) (o []byte, err error) + type BftMessageType uint16 + const BftMessageTypePreCommit + const BftMessageTypePreVote + const BftMessageTypeProposal + func (m BftMessageType) String() string + func (z *BftMessageType) DecodeMsg(dc *msgp.Reader) (err error) + func (z *BftMessageType) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z BftMessageType) EncodeMsg(en *msgp.Writer) (err error) + func (z BftMessageType) MarshalMsg(b []byte) (o []byte, err error) + func (z BftMessageType) Msgsize() (s int) + type BftPartner interface + EventLoop func() + GetBftPeerCommunicatorIncoming func() BftPeerCommunicatorIncoming + RegisterConsensusReachedListener func(listener ConsensusReachedListener) + Start func() + StartNewEra func(height uint64, round int) + Stop func() + WaiterLoop func() + type BftPeer struct + Address common.Address + Id int + PublicKey crypto.PublicKey + PublicKeyBytes hexutil.Bytes + type BftPeerCommunicatorIncoming interface + GetPipeIn func() chan *BftMessageEvent + GetPipeOut func() chan *BftMessageEvent + type BftPeerCommunicatorOutgoing interface + Broadcast func(msg BftMessage, peers []BftPeer) + Unicast func(msg BftMessage, peer BftPeer) + type BftStatus struct + CurrentHR HeightRound + F int + Maj23 int + N int + Peers []BftPeer + States HeightRoundStateMap + type BftStatusReport struct + HeightRound HeightRound + Now time.Time + States HeightRoundStateMap + type ChangeStateEvent struct + HeightRound HeightRound + NewStepType StepType + type ConsensusDecision Proposal + type ConsensusReachedListener interface + GetConsensusDecisionMadeEventChannel func() chan ConsensusDecision + type DecisionMaker interface + MakeDecision func(proposal Proposal, state *HeightRoundState) (ConsensusDecision, error) + type DefaultBftPartner struct + BftStatus *BftStatus + ConsensusReachedListeners []ConsensusReachedListener + DecisionMaker DecisionMaker + Id int + ProposalGenerator ProposalGenerator + ProposalValidator ProposalValidator + WaiterTimeoutChannel chan *WaiterRequest + func NewDefaultBFTPartner(nbParticipants int, id int, blockTime time.Duration, ...) *DefaultBftPartner + func (p *DefaultBftPartner) Broadcast(messageType BftMessageType, hr HeightRound, content Proposal, validRound int) + func (p *DefaultBftPartner) EventLoop() + func (p *DefaultBftPartner) GetBftPeerCommunicatorIncoming() BftPeerCommunicatorIncoming + func (p *DefaultBftPartner) GetValue(newBlock bool) (Proposal, ProposalCondition) + func (p *DefaultBftPartner) OnTimeoutPreCommit(context WaiterContext) + func (p *DefaultBftPartner) OnTimeoutPreVote(context WaiterContext) + func (p *DefaultBftPartner) OnTimeoutPropose(context WaiterContext) + func (p *DefaultBftPartner) Proposer(hr HeightRound) int + func (p *DefaultBftPartner) RegisterConsensusReachedListener(listener ConsensusReachedListener) + func (p *DefaultBftPartner) Reset(nbParticipants int, id int) + func (p *DefaultBftPartner) Start() + func (p *DefaultBftPartner) StartNewEra(height uint64, round int) + func (p *DefaultBftPartner) Status() interface{} + func (p *DefaultBftPartner) Stop() + func (p *DefaultBftPartner) WaitStepTimeout(stepType StepType, timeout time.Duration, hr HeightRound, ...) + func (p *DefaultBftPartner) WaiterLoop() + func (p *DefaultBftPartner) WipeOldStates() + type HeightRound struct + Height uint64 + Round int + func (h *HeightRound) IsAfter(o HeightRound) bool + func (h *HeightRound) IsAfterOrEqual(o HeightRound) bool + func (h *HeightRound) IsBefore(o HeightRound) bool + func (h *HeightRound) String() string + func (z *HeightRound) DecodeMsg(dc *msgp.Reader) (err error) + func (z *HeightRound) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z HeightRound) EncodeMsg(en *msgp.Writer) (err error) + func (z HeightRound) MarshalMsg(b []byte) (o []byte, err error) + func (z HeightRound) Msgsize() (s int) + type HeightRoundState struct + Decision ConsensusDecision + LockedRound int + LockedValue Proposal + MessageProposal *BftMessageProposal + PreCommits []*BftMessagePreCommit + PreVotes []*BftMessagePreVote + Sources map[uint16]bool + StartAt time.Time + Step StepType + StepTypeEqualOrLargerPreVoteTriggered bool + StepTypeEqualPreCommitTriggered bool + StepTypeEqualPreVoteTriggered bool + ValidRound int + ValidValue Proposal + func NewHeightRoundState(total int) *HeightRoundState + type HeightRoundStateMap map[HeightRound]*HeightRoundState + func (h *HeightRoundStateMap) MarshalJSON() ([]byte, error) + type MsgpEnabled interface + type Proposal interface + Copy func() Proposal + Equal func(Proposal) bool + GetId func() *types.Hash + String func() string + type ProposalCondition struct + ValidHeight uint64 + type ProposalGenerator interface + ProduceProposal func() (proposal Proposal, validCondition ProposalCondition) + type ProposalValidator interface + ValidateProposal func(proposal Proposal) error + type Signable interface + SignatureTargets func() []byte + type StepType int + const StepTypePreCommit + const StepTypePreVote + const StepTypePropose + func (m *StepType) MarshalJSON() ([]byte, error) + func (m StepType) IsAfter(o StepType) bool + func (m StepType) String() string + type StringProposal struct + Content string + func (s StringProposal) Copy() Proposal + func (s StringProposal) Equal(o Proposal) bool + func (s StringProposal) GetId() *types.Hash + func (s StringProposal) String() string + func (z *StringProposal) DecodeMsg(dc *msgp.Reader) (err error) + func (z *StringProposal) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z StringProposal) EncodeMsg(en *msgp.Writer) (err error) + func (z StringProposal) MarshalMsg(b []byte) (o []byte, err error) + func (z StringProposal) Msgsize() (s int) + type TendermintContext struct + HeightRound HeightRound + StepType StepType + func (t *TendermintContext) Equal(w WaiterContext) bool + func (t *TendermintContext) IsAfter(w WaiterContext) bool + type ValueIdMatchType int + const MatchTypeAny + const MatchTypeByValue + const MatchTypeNil + type Waiter struct + func NewWaiter(callbackEventChannel chan *WaiterRequest) *Waiter + func (w *Waiter) StartEventLoop() + func (w *Waiter) UpdateContext(context WaiterContext) + func (w *Waiter) UpdateRequest(req *WaiterRequest) + type WaiterContext interface + Equal func(WaiterContext) bool + IsAfter func(WaiterContext) bool + type WaiterRequest struct + Context WaiterContext + TimeoutCallback func(WaiterContext) + WaitTime time.Duration v0.0.5-unstable Aug 11, 2020