types

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0, Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMessageView          = errors.New("invalid message view")
	ErrInvalidMessageSender        = errors.New("invalid message sender")
	ErrInvalidMessageProposal      = errors.New("invalid message proposal")
	ErrInvalidMessageProposalRound = errors.New("invalid message proposal round")
)
View Source
var (
	MessageType_name = map[int32]string{
		0: "PROPOSAL",
		1: "PREVOTE",
		2: "PRECOMMIT",
	}
	MessageType_value = map[string]int32{
		"PROPOSAL":  0,
		"PREVOTE":   1,
		"PRECOMMIT": 2,
	}
)

Enum value maps for MessageType.

View Source
var File_messages_types_proto_messages_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type MessageType

type MessageType int32

MessageType defines the types of messages that are related to the consensus process

const (
	MessageType_PROPOSAL  MessageType = 0
	MessageType_PREVOTE   MessageType = 1
	MessageType_PRECOMMIT MessageType = 2
)

func (MessageType) Descriptor

func (MessageType) Enum

func (x MessageType) Enum() *MessageType

func (MessageType) EnumDescriptor deprecated

func (MessageType) EnumDescriptor() ([]byte, []int)

Deprecated: Use MessageType.Descriptor instead.

func (MessageType) Number

func (x MessageType) Number() protoreflect.EnumNumber

func (MessageType) String

func (x MessageType) String() string

func (MessageType) Type

type PrecommitMessage

type PrecommitMessage struct {

	// view is the current view for the message
	// (the view in which the message was sent)
	View *View `protobuf:"bytes,1,opt,name=view,proto3" json:"view,omitempty"`
	// sender is the message sender (unique identifier)
	Sender []byte `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"`
	// signature is the message signature of the sender
	Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	// identifier is the unique identifier for
	// the proposal associated with this
	// precommit message (ex. proposal hash)
	Identifier []byte `protobuf:"bytes,4,opt,name=identifier,proto3" json:"identifier,omitempty"`
	// contains filtered or unexported fields
}

PrecommitMessage is the message containing the consensus proposal precommit. The precommit message, same as the prevote message, contains a unique identifier for the proposal for which this precommit is meant for (ex. proposal hash) <PRECOMMIT, hP, roundP, id(v)>

func (*PrecommitMessage) Descriptor deprecated

func (*PrecommitMessage) Descriptor() ([]byte, []int)

Deprecated: Use PrecommitMessage.ProtoReflect.Descriptor instead.

func (*PrecommitMessage) Equals

func (m *PrecommitMessage) Equals(message *PrecommitMessage) bool

func (*PrecommitMessage) GetIdentifier

func (x *PrecommitMessage) GetIdentifier() []byte

func (*PrecommitMessage) GetSender

func (x *PrecommitMessage) GetSender() []byte

func (*PrecommitMessage) GetSignature

func (x *PrecommitMessage) GetSignature() []byte

func (*PrecommitMessage) GetSignaturePayload

func (m *PrecommitMessage) GetSignaturePayload() []byte

GetSignaturePayload returns the sign payload for the proposal message

func (*PrecommitMessage) GetView

func (x *PrecommitMessage) GetView() *View

func (*PrecommitMessage) Marshal

func (m *PrecommitMessage) Marshal() []byte

Marshal returns the marshalled message

func (*PrecommitMessage) ProtoMessage

func (*PrecommitMessage) ProtoMessage()

func (*PrecommitMessage) ProtoReflect

func (x *PrecommitMessage) ProtoReflect() protoreflect.Message

func (*PrecommitMessage) Reset

func (x *PrecommitMessage) Reset()

func (*PrecommitMessage) String

func (x *PrecommitMessage) String() string

func (*PrecommitMessage) Verify

func (m *PrecommitMessage) Verify() error

Verify validates that the given message is valid

type PrevoteMessage

type PrevoteMessage struct {

	// view is the current view for the message
	// (the view in which the message was sent)
	View *View `protobuf:"bytes,1,opt,name=view,proto3" json:"view,omitempty"`
	// sender is the message sender (unique identifier)
	Sender []byte `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"`
	// signature is the message signature of the sender
	Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	// identifier is the unique identifier for
	// the proposal associated with this
	// prevote message (ex. proposal hash)
	Identifier []byte `protobuf:"bytes,4,opt,name=identifier,proto3" json:"identifier,omitempty"`
	// contains filtered or unexported fields
}

PrevoteMessage is the message containing the consensus proposal prevote. The prevote message is pretty light, apart from containing the view, it just contains a unique identifier of the proposal for which this prevote is meant for (ex. proposal hash) <PREVOTE, hP, roundP, id(v)>

func (*PrevoteMessage) Descriptor deprecated

func (*PrevoteMessage) Descriptor() ([]byte, []int)

Deprecated: Use PrevoteMessage.ProtoReflect.Descriptor instead.

func (*PrevoteMessage) Equals

func (m *PrevoteMessage) Equals(message *PrevoteMessage) bool

func (*PrevoteMessage) GetIdentifier

func (x *PrevoteMessage) GetIdentifier() []byte

func (*PrevoteMessage) GetSender

func (x *PrevoteMessage) GetSender() []byte

func (*PrevoteMessage) GetSignature

func (x *PrevoteMessage) GetSignature() []byte

func (*PrevoteMessage) GetSignaturePayload

func (m *PrevoteMessage) GetSignaturePayload() []byte

GetSignaturePayload returns the sign payload for the proposal message

func (*PrevoteMessage) GetView

func (x *PrevoteMessage) GetView() *View

func (*PrevoteMessage) Marshal

func (m *PrevoteMessage) Marshal() []byte

Marshal returns the marshalled message

func (*PrevoteMessage) ProtoMessage

func (*PrevoteMessage) ProtoMessage()

func (*PrevoteMessage) ProtoReflect

func (x *PrevoteMessage) ProtoReflect() protoreflect.Message

func (*PrevoteMessage) Reset

func (x *PrevoteMessage) Reset()

func (*PrevoteMessage) String

func (x *PrevoteMessage) String() string

func (*PrevoteMessage) Verify

func (m *PrevoteMessage) Verify() error

Verify validates that the given message is valid

type ProposalMessage

type ProposalMessage struct {

	// view is the current view for the message
	// (the view in which the message was sent)
	View *View `protobuf:"bytes,1,opt,name=view,proto3" json:"view,omitempty"`
	// sender is the message sender (unique identifier)
	Sender []byte `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"`
	// signature is the message signature of the sender
	Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	// proposal is the actual consensus proposal
	Proposal []byte `protobuf:"bytes,4,opt,name=proposal,proto3" json:"proposal,omitempty"`
	// proposalRound is the round associated with the
	// proposal in the PROPOSE message.
	// NOTE: this round value DOES NOT have
	// to match the message view (proposal from an earlier round)
	ProposalRound int64 `protobuf:"varint,5,opt,name=proposalRound,proto3" json:"proposalRound,omitempty"`
	// contains filtered or unexported fields
}

ProposalMessage is the message containing the consensus proposal for the view <PROPOSAL, hP, roundP, proposal, validRoundP>

func (*ProposalMessage) Descriptor deprecated

func (*ProposalMessage) Descriptor() ([]byte, []int)

Deprecated: Use ProposalMessage.ProtoReflect.Descriptor instead.

func (*ProposalMessage) Equals

func (m *ProposalMessage) Equals(message *ProposalMessage) bool

func (*ProposalMessage) GetProposal

func (x *ProposalMessage) GetProposal() []byte

func (*ProposalMessage) GetProposalRound

func (x *ProposalMessage) GetProposalRound() int64

func (*ProposalMessage) GetSender

func (x *ProposalMessage) GetSender() []byte

func (*ProposalMessage) GetSignature

func (x *ProposalMessage) GetSignature() []byte

func (*ProposalMessage) GetSignaturePayload

func (m *ProposalMessage) GetSignaturePayload() []byte

GetSignaturePayload returns the sign payload for the proposal message

func (*ProposalMessage) GetView

func (x *ProposalMessage) GetView() *View

func (*ProposalMessage) Marshal

func (m *ProposalMessage) Marshal() []byte

Marshal returns the marshalled message

func (*ProposalMessage) ProtoMessage

func (*ProposalMessage) ProtoMessage()

func (*ProposalMessage) ProtoReflect

func (x *ProposalMessage) ProtoReflect() protoreflect.Message

func (*ProposalMessage) Reset

func (x *ProposalMessage) Reset()

func (*ProposalMessage) String

func (x *ProposalMessage) String() string

func (*ProposalMessage) Verify

func (m *ProposalMessage) Verify() error

Verify validates that the given message is valid

type View

type View struct {

	// height represents the number of the proposal
	Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	// round represents the round number within a
	// specific height (starts from 0)
	Round uint64 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
	// contains filtered or unexported fields
}

View is the consensus state associated with the message

func (*View) Descriptor deprecated

func (*View) Descriptor() ([]byte, []int)

Deprecated: Use View.ProtoReflect.Descriptor instead.

func (*View) Equals

func (v *View) Equals(view *View) bool

func (*View) GetHeight

func (x *View) GetHeight() uint64

func (*View) GetRound

func (x *View) GetRound() uint64

func (*View) ProtoMessage

func (*View) ProtoMessage()

func (*View) ProtoReflect

func (x *View) ProtoReflect() protoreflect.Message

func (*View) Reset

func (x *View) Reset()

func (*View) String

func (x *View) String() string

Jump to

Keyboard shortcuts

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