consensus

package
v0.0.0-...-a3b524e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2018 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterWalMessage

func FilterWalMessage(height int64, msg WALMessage) bool

Types

type BlockCsWal

type BlockCsWal struct {
	// contains filtered or unexported fields
}

func CreateBlockCsWal

func CreateBlockCsWal(ldb db.DB) *BlockCsWal

func (*BlockCsWal) ConvertWalMessage

func (bc *BlockCsWal) ConvertWalMessage(message *TimedWALMessage) *consensus.TimedWALMessage

func (*BlockCsWal) UpdateNewVoteToPrivVal

func (bc *BlockCsWal) UpdateNewVoteToPrivVal(message *consensus.TimedWALMessage)

func (*BlockCsWal) UpdateOldVoteToPrivVal

func (bc *BlockCsWal) UpdateOldVoteToPrivVal(message *TimedWALMessage)

type BlockPartMessage

type BlockPartMessage struct {
	Height int64
	Round  int
	Part   *types.Part
}

BlockPartMessage is sent when gossipping a piece of the proposed block.

func (*BlockPartMessage) String

func (m *BlockPartMessage) String() string

String returns a string representation.

type CommitStepMessage

type CommitStepMessage struct {
	Height           int64
	BlockPartsHeader types.PartSetHeader
	BlockParts       *cmn.BitArray
}

CommitStepMessage is sent when a block is committed.

func (*CommitStepMessage) String

func (m *CommitStepMessage) String() string

String returns a string representation.

type ConsensusMessage

type ConsensusMessage interface{}

type DataCorruptionError

type DataCorruptionError struct {
	// contains filtered or unexported fields
}

DataCorruptionError is an error that occures if data on disk was corrupted.

func (DataCorruptionError) Cause

func (e DataCorruptionError) Cause() error

func (DataCorruptionError) Error

func (e DataCorruptionError) Error() string

type EndHeightMessage

type EndHeightMessage struct {
	Height int64 `json:"height"`
}

EndHeightMessage marks the end of the given height inside WAL. @internal used by scripts/wal2json util.

type HasVoteMessage

type HasVoteMessage struct {
	Height int64
	Round  int
	Type   byte
	Index  int
}

HasVoteMessage is sent to indicate that a particular vote has been received.

func (*HasVoteMessage) String

func (m *HasVoteMessage) String() string

String returns a string representation.

type NewRoundStepMessage

type NewRoundStepMessage struct {
	Height                int64
	Round                 int
	Step                  cstypes.RoundStepType
	SecondsSinceStartTime int
	LastCommitRound       int
}

NewRoundStepMessage is sent for every step taken in the ConsensusState. For every height/round/step transition

func (*NewRoundStepMessage) String

func (m *NewRoundStepMessage) String() string

String returns a string representation.

type ProposalHeartbeatMessage

type ProposalHeartbeatMessage struct {
	Heartbeat *types.Heartbeat
}

ProposalHeartbeatMessage is sent to signal that a node is alive and waiting for transactions for a proposal.

func (*ProposalHeartbeatMessage) String

func (m *ProposalHeartbeatMessage) String() string

String returns a string representation.

type ProposalMessage

type ProposalMessage struct {
	Proposal *types.Proposal
}

ProposalMessage is sent when a new block is proposed.

func (*ProposalMessage) String

func (m *ProposalMessage) String() string

String returns a string representation.

type ProposalPOLMessage

type ProposalPOLMessage struct {
	Height           int64
	ProposalPOLRound int
	ProposalPOL      *cmn.BitArray
}

ProposalPOLMessage is sent when a previous proposal is re-proposed.

func (*ProposalPOLMessage) String

func (m *ProposalPOLMessage) String() string

String returns a string representation.

type TimedWALMessage

type TimedWALMessage struct {
	Time time.Time  `json:"time"` // for debugging purposes
	Msg  WALMessage `json:"msg"`
}

type VoteMessage

type VoteMessage struct {
	Vote *types.Vote
}

VoteMessage is sent when voting for a proposal (or lack thereof).

func (*VoteMessage) String

func (m *VoteMessage) String() string

String returns a string representation.

type VoteSetBitsMessage

type VoteSetBitsMessage struct {
	Height  int64
	Round   int
	Type    byte
	BlockID types.BlockID
	Votes   *cmn.BitArray
}

VoteSetBitsMessage is sent to communicate the bit-array of votes seen for the BlockID.

func (*VoteSetBitsMessage) String

func (m *VoteSetBitsMessage) String() string

String returns a string representation.

type VoteSetMaj23Message

type VoteSetMaj23Message struct {
	Height  int64
	Round   int
	Type    byte
	BlockID types.BlockID
}

VoteSetMaj23Message is sent to indicate that a given BlockID has seen +2/3 votes.

func (*VoteSetMaj23Message) String

func (m *VoteSetMaj23Message) String() string

String returns a string representation.

type WALDecoder

type WALDecoder struct {
	// contains filtered or unexported fields
}

A WALDecoder reads and decodes custom-encoded WAL messages from an input stream. See WALEncoder for the format used.

It will also compare the checksums and make sure data size is equal to the length from the header. If that is not the case, error will be returned.

func NewWALDecoder

func NewWALDecoder(rd io.Reader) *WALDecoder

NewWALDecoder returns a new decoder that reads from rd.

func (*WALDecoder) Decode

func (dec *WALDecoder) Decode() (*TimedWALMessage, error)

Decode reads the next custom-encoded value from its reader and returns it.

type WALEncoder

type WALEncoder struct {
	// contains filtered or unexported fields
}

A WALEncoder writes custom-encoded WAL messages to an output stream.

Format: 4 bytes CRC sum + 4 bytes length + arbitrary-length value (go-wire encoded)

func NewWALEncoder

func NewWALEncoder(wr io.Writer) *WALEncoder

NewWALEncoder returns a new encoder that writes to wr.

func (*WALEncoder) Encode

func (enc *WALEncoder) Encode(v *TimedWALMessage) error

Encode writes the custom encoding of v to the stream.

type WALMessage

type WALMessage interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL