Versions in this module Expand all Collapse all v0 v0.1.1 May 14, 2023 Changes in this version + const BP_ACK + const BP_CATCHUP + const BP_RECV + const BP_SEND + const DataChannel + const EnablePrerunTx + const MetricsSubsystem + const StateChannel + const ViewChangeChannel + const VoteChannel + const VoteSetBitsChannel + var ErrAddingVote = errors.New("error adding vote") + var ErrInvalidProposalPOLRound = errors.New("error invalid proposal POL round") + var ErrInvalidProposalSignature = errors.New("error invalid proposal signature") + 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") + func CompareHRS(h1 int64, r1 int, s1 cstypes.RoundStepType, h2 int64, r2 int, ...) int + func GetActiveVC() bool + func IsDataCorruptionError(err error) bool + func RegisterMessages(cdc *amino.Codec) + func RegisterWALMessages(cdc *amino.Codec) + func RunReplayFile(config cfg.BaseConfig, csConfig *cfg.ConsensusConfig, console bool) + func SetActiveVC(value bool) + func WALGenerateNBlocks(t *testing.T, wr io.Writer, numBlocks int) (err error) + func WALWithNBlocks(t *testing.T, numBlocks int) (data []byte, err error) + type BaseWAL struct + func NewWAL(walFile string, groupOptions ...func(*auto.Group)) (*BaseWAL, error) + func (wal *BaseWAL) FlushAndSync() error + func (wal *BaseWAL) Group() *auto.Group + func (wal *BaseWAL) OnReset() error + func (wal *BaseWAL) OnStart() error + func (wal *BaseWAL) OnStop() + func (wal *BaseWAL) SearchForEndHeight(height int64, options *WALSearchOptions) (rd io.ReadCloser, found bool, err error) + func (wal *BaseWAL) SetFlushInterval(i time.Duration) + func (wal *BaseWAL) SetLogger(l log.Logger) + func (wal *BaseWAL) Wait() + func (wal *BaseWAL) Write(msg WALMessage) error + func (wal *BaseWAL) WriteSync(msg WALMessage) error + type BlockPartMessage struct + Height int64 + Part *types.Part + Round int + func (m *BlockPartMessage) String() string + func (m *BlockPartMessage) ValidateBasic() error + type BlockTransport struct + Logger log.Logger + type DataCorruptionError struct + func (e DataCorruptionError) Cause() error + func (e DataCorruptionError) Error() string + type EndHeightMessage struct + Height int64 + type Handshaker struct + func NewHandshaker(stateDB dbm.DB, state sm.State, store sm.BlockStore, genDoc *types.GenesisDoc) *Handshaker + func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error + func (h *Handshaker) NBlocks() int + func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight int64, proxyApp proxy.AppConns) ([]byte, error) + func (h *Handshaker) SetEventBus(eventBus types.BlockEventPublisher) + func (h *Handshaker) SetLogger(l log.Logger) + type HasBlockPartMessage struct + Height int64 + Index int + Round int + func (m *HasBlockPartMessage) String() string + func (m *HasBlockPartMessage) ValidateBasic() error + type HasVoteMessage struct + Height int64 + Index int + Round int + Type types.SignedMsgType + func (m *HasVoteMessage) String() string + func (m *HasVoteMessage) ValidateBasic() error + type Message interface + ValidateBasic func() error + type Metrics struct + BlockIntervalSeconds metrics.Gauge + BlockParts metrics.Counter + BlockSizeBytes metrics.Gauge + ByzantineValidators metrics.Gauge + ByzantineValidatorsPower metrics.Gauge + CommitProcessingTime metrics.Gauge + CommittedHeight metrics.Gauge + FastSyncing metrics.Gauge + Height metrics.Gauge + MissingValidators metrics.Gauge + MissingValidatorsPower metrics.Gauge + NewRoundProcessingTime metrics.Gauge + NumTxs metrics.Gauge + PrecommitProcessingTime metrics.Gauge + PrevoteProcessingTime metrics.Gauge + ProposeProcessingTime metrics.Gauge + Rounds metrics.Gauge + TotalTxs metrics.Gauge + ValidatorLastSignedHeight metrics.Gauge + ValidatorMissedBlocks metrics.Gauge + ValidatorPower metrics.Gauge + Validators metrics.Gauge + ValidatorsPower metrics.Gauge + func NopMetrics() *Metrics + func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics + type NewRoundStepMessage struct + HasVC bool + Height int64 + LastCommitRound int + Round int + SecondsSinceStartTime int + Step cstypes.RoundStepType + func (m *NewRoundStepMessage) String() string + func (m *NewRoundStepMessage) ValidateBasic() error + type NewValidBlockMessage struct + BlockParts *bits.BitArray + BlockPartsHeader types.PartSetHeader + Height int64 + IsCommit bool + Round int + func (m *NewValidBlockMessage) String() string + func (m *NewValidBlockMessage) ValidateBasic() error + type PeerState struct + PRS cstypes.PeerRoundState + Stats *peerStateStats + func NewPeerState(peer p2p.Peer) *PeerState + func (ps *PeerState) ApplyHasVoteMessage(msg *HasVoteMessage) + func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage) + func (ps *PeerState) ApplyNewValidBlockMessage(msg *NewValidBlockMessage) + func (ps *PeerState) ApplyProposalPOLMessage(msg *ProposalPOLMessage) + func (ps *PeerState) ApplyVoteSetBitsMessage(msg *VoteSetBitsMessage, ourVotes *bits.BitArray) + func (ps *PeerState) BlockPartsSent() int + func (ps *PeerState) EnsureVoteBitArrays(height int64, numValidators int) + func (ps *PeerState) GetHeight() int64 + func (ps *PeerState) GetRoundState() *cstypes.PeerRoundState + func (ps *PeerState) InitProposalBlockParts(partsHeader types.PartSetHeader) + func (ps *PeerState) PickSendVote(votes types.VoteSetReader) bool + func (ps *PeerState) PickVoteToSend(votes types.VoteSetReader) (vote *types.Vote, ok bool) + func (ps *PeerState) RecordBlockPart() int + func (ps *PeerState) RecordVote() int + func (ps *PeerState) SetAvcHeight(height int64) + func (ps *PeerState) SetHasProposal(proposal *types.Proposal) + func (ps *PeerState) SetHasProposalBlockPart(height int64, round int, index int, t bpType, bt *BlockTransport) + func (ps *PeerState) SetHasVote(vote *types.Vote) + func (ps *PeerState) SetLogger(logger log.Logger) *PeerState + func (ps *PeerState) String() string + func (ps *PeerState) StringIndented(indent string) string + func (ps *PeerState) ToJSON() ([]byte, error) + func (ps *PeerState) VotesSent() int + type ProposalMessage struct + Proposal *types.Proposal + func (m *ProposalMessage) String() string + func (m *ProposalMessage) ValidateBasic() error + type ProposalPOLMessage struct + Height int64 + ProposalPOL *bits.BitArray + ProposalPOLRound int + func (m *ProposalPOLMessage) String() string + func (m *ProposalPOLMessage) ValidateBasic() error + type ProposeRequestMessage struct + CurrentProposer types.Address + Height int64 + NewProposer types.Address + Proposal *types.Proposal + Signature []byte + func (m *ProposeRequestMessage) SignBytes() []byte + func (m *ProposeRequestMessage) ValidateBasic() error + func (m *ProposeRequestMessage) Verify(pubKey crypto.PubKey) error + type ProposeResponseMessage struct + Height int64 + Proposal *types.Proposal + func (m *ProposeResponseMessage) ValidateBasic() error + type Reactor struct + func NewReactor(consensusState *State, fastSync bool, autoFastSync bool, ...) *Reactor + func (conR *Reactor) AddPeer(peer p2p.Peer) + func (conR *Reactor) FastSync() bool + func (conR *Reactor) GetChannels() []*p2p.ChannelDescriptor + func (conR *Reactor) InitPeer(peer p2p.Peer) p2p.Peer + func (conR *Reactor) OnStart() error + func (conR *Reactor) OnStop() + func (conR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) + func (conR *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) + func (conR *Reactor) SetEventBus(b *types.EventBus) + func (conR *Reactor) String() string + func (conR *Reactor) StringIndented(indent string) string + func (conR *Reactor) SwitchToConsensus(state sm.State, blocksSynced uint64) bool + func (conR *Reactor) SwitchToFastSync() (sm.State, error) + type ReactorOption func(*Reactor) + func ReactorMetrics(metrics *Metrics) ReactorOption + type State struct + func NewState(config *cfg.ConsensusConfig, state sm.State, blockExec *sm.BlockExecutor, ...) *State + func (cs *State) AddProposalBlockPart(height int64, round int, part *types.Part, peerID p2p.ID) error + func (cs *State) BlockExec() *sm.BlockExecutor + func (cs *State) GetLastHeight() int64 + func (cs *State) GetRoundState() *cstypes.RoundState + func (cs *State) GetRoundStateJSON() ([]byte, error) + func (cs *State) GetRoundStateSimpleJSON() ([]byte, error) + func (cs *State) GetState() sm.State + func (cs *State) GetValidators() (int64, []*types.Validator) + func (cs *State) LoadCommit(height int64) *types.Commit + func (cs *State) OnReset() error + func (cs *State) OnStart() error + func (cs *State) OnStop() + func (cs *State) OpenWAL(walFile string) (WAL, error) + func (cs *State) ReplayFile(file string, console bool) error + func (cs *State) SetEventBus(b *types.EventBus) + func (cs *State) SetLogger(l log.Logger) + func (cs *State) SetPrivValidator(priv types.PrivValidator) + func (cs *State) SetProposal(proposal *types.Proposal, peerID p2p.ID) error + func (cs *State) SetProposalAndBlock(proposal *types.Proposal, block *types.Block, parts *types.PartSet, ...) error + func (cs *State) SetTimeoutTicker(timeoutTicker TimeoutTicker) + func (cs *State) String() string + func (cs *State) Wait() + type StateOption func(*State) + func StateMetrics(metrics *Metrics) StateOption + type TimedWALMessage struct + Msg WALMessage + Time time.Time + type TimeoutTicker interface + Chan func() <-chan timeoutInfo + Reset func() error + ScheduleTimeout func(ti timeoutInfo) + SetLogger func(log.Logger) + Start func() error + Stop func() error + func NewTimeoutTicker() TimeoutTicker + type ViewChangeMessage struct + CurrentProposer types.Address + Height int64 + NewProposer types.Address + Signature []byte + func (m *ViewChangeMessage) SignBytes() []byte + func (m *ViewChangeMessage) Validate(height int64, proposer types.Address) bool + func (m *ViewChangeMessage) ValidateBasic() error + func (m *ViewChangeMessage) Verify(pubKey crypto.PubKey) error + type VoteMessage struct + Vote *types.Vote + func (m *VoteMessage) String() string + func (m *VoteMessage) ValidateBasic() error + type VoteSetBitsMessage struct + BlockID types.BlockID + Height int64 + Round int + Type types.SignedMsgType + Votes *bits.BitArray + func (m *VoteSetBitsMessage) String() string + func (m *VoteSetBitsMessage) ValidateBasic() error + type VoteSetMaj23Message struct + BlockID types.BlockID + Height int64 + Round int + Type types.SignedMsgType + func (m *VoteSetMaj23Message) String() string + func (m *VoteSetMaj23Message) ValidateBasic() error + type WAL interface + FlushAndSync func() error + Reset func() error + SearchForEndHeight func(height int64, options *WALSearchOptions) (rd io.ReadCloser, found bool, err error) + Start func() error + Stop func() error + Wait func() + Write func(WALMessage) error + WriteSync func(WALMessage) error + type WALDecoder struct + func NewWALDecoder(rd io.Reader) *WALDecoder + func (dec *WALDecoder) Decode() (*TimedWALMessage, error) + type WALEncoder struct + func NewWALEncoder(wr io.Writer) *WALEncoder + func (enc *WALEncoder) Encode(v *TimedWALMessage) error + type WALMessage interface + type WALSearchOptions struct + IgnoreDataCorruptionErrors bool