Versions in this module Expand all Collapse all v0 v0.34.24 Mar 7, 2023 Changes in this version + const DataChannel + const MetricsSubsystem + const StateChannel + 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 ErrSignatureFoundInPastBlocks = errors.New("found signature from the same key") + func CompareHRS(h1 int64, r1 int32, s1 cstypes.RoundStepType, h2 int64, r2 int32, ...) int + func IsDataCorruptionError(err error) bool + func MsgToProto(msg Message) (*tmcons.Message, error) + func MustEncode(msg Message) []byte + func RunReplayFile(config cfg.BaseConfig, csConfig *cfg.ConsensusConfig, console bool) + func WALGenerateNBlocks(t *testing.T, wr io.Writer, numBlocks int) (err error) + func WALToProto(msg WALMessage) (*tmcons.WALMessage, 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) 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 int32 + func (m *BlockPartMessage) String() string + func (m *BlockPartMessage) ValidateBasic() error + type DataCorruptionError struct + func (e DataCorruptionError) Cause() error + func (e DataCorruptionError) Error() string + type EndHeightMessage struct + Height int64 + type Handshaker struct + func NewHandshaker(stateStore sm.Store, state sm.State, store sm.BlockStore, ...) *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 HasVoteMessage struct + Height int64 + Index int32 + Round int32 + Type tmproto.SignedMsgType + func (m *HasVoteMessage) String() string + func (m *HasVoteMessage) ValidateBasic() error + type Message interface + ValidateBasic func() error + func MsgFromProto(p *tmcons.Message) (Message, error) + type Metrics struct + BlockIntervalSeconds metrics.Histogram + BlockParts metrics.Counter + BlockSizeBytes metrics.Gauge + ByzantineValidators metrics.Gauge + ByzantineValidatorsPower metrics.Gauge + CommittedHeight metrics.Gauge + FastSyncing metrics.Gauge + FullPrevoteMessageDelay metrics.Gauge + Height metrics.Gauge + MissingValidators metrics.Gauge + MissingValidatorsPower metrics.Gauge + NumTxs metrics.Gauge + QuorumPrevoteMessageDelay metrics.Gauge + Rounds metrics.Gauge + StateSyncing 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 + Height int64 + LastCommitRound int32 + Round int32 + SecondsSinceStartTime int64 + Step cstypes.RoundStepType + func (m *NewRoundStepMessage) String() string + func (m *NewRoundStepMessage) ValidateBasic() error + func (m *NewRoundStepMessage) ValidateHeight(initialHeight int64) error + type NewValidBlockMessage struct + BlockPartSetHeader types.PartSetHeader + BlockParts *bits.BitArray + Height int64 + IsCommit bool + Round int32 + 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(partSetHeader 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) SetHasProposal(proposal *types.Proposal) + func (ps *PeerState) SetHasProposalBlockPart(height int64, round int32, index int) + 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 int32 + func (m *ProposalPOLMessage) String() string + func (m *ProposalPOLMessage) ValidateBasic() error + type Reactor struct + Metrics *Metrics + func NewReactor(consensusState *State, waitSync bool, options ...ReactorOption) *Reactor + func (conR *Reactor) AddPeer(peer p2p.Peer) + 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, peer p2p.Peer, msgBytes []byte) + func (conR *Reactor) ReceiveEnvelope(e p2p.Envelope) + 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, skipWAL bool) + func (conR *Reactor) WaitSync() bool + 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 int32, part *types.Part, peerID p2p.ID) error + func (cs *State) AddVote(vote *types.Vote, peerID p2p.ID) (added bool, err error) + 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) 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 + ScheduleTimeout func(ti timeoutInfo) + SetLogger func(log.Logger) + Start func() error + Stop func() error + func NewTimeoutTicker() TimeoutTicker + 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 int32 + Type tmproto.SignedMsgType + Votes *bits.BitArray + func (m *VoteSetBitsMessage) String() string + func (m *VoteSetBitsMessage) ValidateBasic() error + type VoteSetMaj23Message struct + BlockID types.BlockID + Height int64 + Round int32 + Type tmproto.SignedMsgType + func (m *VoteSetMaj23Message) String() string + func (m *VoteSetMaj23Message) ValidateBasic() error + type WAL interface + FlushAndSync 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 + func WALFromProto(msg *tmcons.WALMessage) (WALMessage, error) + type WALSearchOptions struct + IgnoreDataCorruptionErrors bool