Documentation
¶
Index ¶
- type Action
- type Addr
- type BroadcastPrecommit
- type BroadcastPrevote
- type BroadcastProposal
- type Hash
- type Hashable
- type Height
- type Message
- type MessageHeader
- type MessageType
- type Messages
- func (m *Messages[V, H, A]) AddPrecommit(p Precommit[H, A]) bool
- func (m *Messages[V, H, A]) AddPrevote(p Prevote[H, A]) bool
- func (m *Messages[V, H, A]) AddProposal(p Proposal[V, H, A]) bool
- func (m *Messages[V, H, A]) AllMessages(h Height, r Round) (map[A]Proposal[V, H, A], map[A]Prevote[H, A], map[A]Precommit[H, A])
- func (m *Messages[V, H, A]) DeleteHeightMessages(h Height)
- type Precommit
- type Prevote
- type Proposal
- type Round
- type ScheduleTimeout
- type Step
- type Timeout
- type Vote
- type VotingPower
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastPrecommit ¶
type BroadcastPrevote ¶
type Message ¶
type Message[V Hashable[H], H Hash, A Addr] interface { MsgType() MessageType GetHeight() Height }
type MessageHeader ¶
type MessageType ¶
type MessageType uint8
MessageType represents the type of message stored in the WAL.
const ( MessageTypeProposal MessageType = iota MessageTypePrevote MessageTypePrecommit MessageTypeTimeout MessageTypeUnknown )
func (MessageType) String ¶
func (m MessageType) String() string
String returns the string representation of the MessageType.
type Messages ¶
type Messages[V Hashable[H], H Hash, A Addr] struct { Proposals map[Height]map[Round]map[A]Proposal[V, H, A] Prevotes map[Height]map[Round]map[A]Prevote[H, A] Precommits map[Height]map[Round]map[A]Precommit[H, A] }
Todo: would the following representation of message be better:
height -> round -> address -> ID -> Message How would we keep track of nil votes? In golan map key cannot be nil. It is not easy to calculate a zero value when dealing with generics.
func (*Messages[V, H, A]) AddPrecommit ¶
func (*Messages[V, H, A]) AddPrevote ¶
func (*Messages[V, H, A]) AddProposal ¶
Todo: ensure duplicated messages are ignored.
func (*Messages[V, H, A]) AllMessages ¶
func (*Messages[V, H, A]) DeleteHeightMessages ¶
type Precommit ¶
func (Precommit[H, A]) MsgType ¶
func (p Precommit[H, A]) MsgType() MessageType
type Proposal ¶
type Proposal[V Hashable[H], H Hash, A Addr] struct { MessageHeader[A] ValidRound Round `cbor:"valid_round"` Value *V `cbor:"value"` }
func (Proposal[V, H, A]) MsgType ¶
func (p Proposal[V, H, A]) MsgType() MessageType
type ScheduleTimeout ¶
type ScheduleTimeout Timeout
type Timeout ¶
type Timeout struct {
Step Step
Height Height
Round Round
// contains filtered or unexported fields
}
func (Timeout) MsgType ¶
func (t Timeout) MsgType() MessageType
type Vote ¶
type Vote[H Hash, A Addr] struct { MessageHeader[A] ID *H `cbor:"id"` }
type VotingPower ¶
type VotingPower uint
Click to show internal directories.
Click to hide internal directories.