proto

package
v0.0.0-...-379b430 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package proto defines the code for protocol buffer

Index

Constants

This section is empty.

Variables

View Source
var (
	MessageType_name = map[int32]string{
		0: "PREPREPARE",
		1: "PREPARE",
		2: "COMMIT",
		3: "ROUND_CHANGE",
	}
	MessageType_value = map[string]int32{
		"PREPREPARE":   0,
		"PREPARE":      1,
		"COMMIT":       2,
		"ROUND_CHANGE": 3,
	}
)

Enum value maps for MessageType.

View Source
var File_messages_proto_messages_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CommitMessage

type CommitMessage struct {

	// proposalHash is the Keccak hash of the proposal
	ProposalHash []byte `protobuf:"bytes,1,opt,name=proposalHash,proto3" json:"proposalHash,omitempty"`
	// committedSeal is the seal of the sender
	CommittedSeal []byte `protobuf:"bytes,2,opt,name=committedSeal,proto3" json:"committedSeal,omitempty"`
	// contains filtered or unexported fields
}

CommitMessage is the message for the COMMIT phase

func (*CommitMessage) Descriptor deprecated

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

Deprecated: Use CommitMessage.ProtoReflect.Descriptor instead.

func (*CommitMessage) GetCommittedSeal

func (x *CommitMessage) GetCommittedSeal() []byte

func (*CommitMessage) GetProposalHash

func (x *CommitMessage) GetProposalHash() []byte

func (*CommitMessage) ProtoMessage

func (*CommitMessage) ProtoMessage()

func (*CommitMessage) ProtoReflect

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

func (*CommitMessage) Reset

func (x *CommitMessage) Reset()

func (*CommitMessage) String

func (x *CommitMessage) String() string

type Message

type Message struct {

	// view is the current view for the message
	View *View `protobuf:"bytes,1,opt,name=view,proto3" json:"view,omitempty"`
	// from defines who is the message sender
	From []byte `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`
	// the signature of the sender, if any
	Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	// type defines the message type
	Type MessageType `protobuf:"varint,4,opt,name=type,proto3,enum=MessageType" json:"type,omitempty"`
	// payload is the specific message payload
	//
	// Types that are assignable to Payload:
	//	*Message_PreprepareData
	//	*Message_PrepareData
	//	*Message_CommitData
	//	*Message_RoundChangeData
	Payload isMessage_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

Message defines the base message structure

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetCommitData

func (x *Message) GetCommitData() *CommitMessage

func (*Message) GetFrom

func (x *Message) GetFrom() []byte

func (*Message) GetPayload

func (m *Message) GetPayload() isMessage_Payload

func (*Message) GetPrepareData

func (x *Message) GetPrepareData() *PrepareMessage

func (*Message) GetPreprepareData

func (x *Message) GetPreprepareData() *PrePrepareMessage

func (*Message) GetRoundChangeData

func (x *Message) GetRoundChangeData() *RoundChangeMessage

func (*Message) GetSignature

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

func (*Message) GetType

func (x *Message) GetType() MessageType

func (*Message) GetView

func (x *Message) GetView() *View

func (*Message) PayloadNoSig

func (m *Message) PayloadNoSig() ([]byte, error)

PayloadNoSig returns marshaled message without signature

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type MessageType

type MessageType int32

MessageType defines the types of messages circulating in the system

const (
	MessageType_PREPREPARE   MessageType = 0
	MessageType_PREPARE      MessageType = 1
	MessageType_COMMIT       MessageType = 2
	MessageType_ROUND_CHANGE MessageType = 3
)

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 Message_CommitData

type Message_CommitData struct {
	CommitData *CommitMessage `protobuf:"bytes,7,opt,name=commitData,proto3,oneof"`
}

type Message_PrepareData

type Message_PrepareData struct {
	PrepareData *PrepareMessage `protobuf:"bytes,6,opt,name=prepareData,proto3,oneof"`
}

type Message_PreprepareData

type Message_PreprepareData struct {
	PreprepareData *PrePrepareMessage `protobuf:"bytes,5,opt,name=preprepareData,proto3,oneof"`
}

type Message_RoundChangeData

type Message_RoundChangeData struct {
	RoundChangeData *RoundChangeMessage `protobuf:"bytes,8,opt,name=roundChangeData,proto3,oneof"`
}

type PrePrepareMessage

type PrePrepareMessage struct {

	// proposal is the actual data being proposed for consensus
	Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"`
	// proposalHash is the Keccak hash of the proposal
	ProposalHash []byte `protobuf:"bytes,2,opt,name=proposalHash,proto3" json:"proposalHash,omitempty"`
	// certificate is the RCC that can accompany
	// a proposal message
	Certificate *RoundChangeCertificate `protobuf:"bytes,3,opt,name=certificate,proto3" json:"certificate,omitempty"`
	// contains filtered or unexported fields
}

PrePrepareMessage is the message for the PREPREPARE phase

func (*PrePrepareMessage) Descriptor deprecated

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

Deprecated: Use PrePrepareMessage.ProtoReflect.Descriptor instead.

func (*PrePrepareMessage) GetCertificate

func (x *PrePrepareMessage) GetCertificate() *RoundChangeCertificate

func (*PrePrepareMessage) GetProposal

func (x *PrePrepareMessage) GetProposal() *Proposal

func (*PrePrepareMessage) GetProposalHash

func (x *PrePrepareMessage) GetProposalHash() []byte

func (*PrePrepareMessage) ProtoMessage

func (*PrePrepareMessage) ProtoMessage()

func (*PrePrepareMessage) ProtoReflect

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

func (*PrePrepareMessage) Reset

func (x *PrePrepareMessage) Reset()

func (*PrePrepareMessage) String

func (x *PrePrepareMessage) String() string

type PrepareMessage

type PrepareMessage struct {

	// proposalHash is the Keccak hash of the proposal
	ProposalHash []byte `protobuf:"bytes,1,opt,name=proposalHash,proto3" json:"proposalHash,omitempty"`
	// contains filtered or unexported fields
}

PrepareMessage is the message for the PREPARE phase

func (*PrepareMessage) Descriptor deprecated

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

Deprecated: Use PrepareMessage.ProtoReflect.Descriptor instead.

func (*PrepareMessage) GetProposalHash

func (x *PrepareMessage) GetProposalHash() []byte

func (*PrepareMessage) ProtoMessage

func (*PrepareMessage) ProtoMessage()

func (*PrepareMessage) ProtoReflect

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

func (*PrepareMessage) Reset

func (x *PrepareMessage) Reset()

func (*PrepareMessage) String

func (x *PrepareMessage) String() string

type PreparedCertificate

type PreparedCertificate struct {

	// proposalMessage is the proposal message to reach
	// at least Q(N) - 1 PREPARE messages
	ProposalMessage *Message `protobuf:"bytes,1,opt,name=proposalMessage,proto3" json:"proposalMessage,omitempty"`
	// prepareMessages are the PREPARE messages at least Q(N) - 1
	PrepareMessages []*Message `protobuf:"bytes,2,rep,name=prepareMessages,proto3" json:"prepareMessages,omitempty"`
	// contains filtered or unexported fields
}

PreparedCertificate is a collection of prepare messages for a certain proposal

func (*PreparedCertificate) Descriptor deprecated

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

Deprecated: Use PreparedCertificate.ProtoReflect.Descriptor instead.

func (*PreparedCertificate) GetPrepareMessages

func (x *PreparedCertificate) GetPrepareMessages() []*Message

func (*PreparedCertificate) GetProposalMessage

func (x *PreparedCertificate) GetProposalMessage() *Message

func (*PreparedCertificate) ProtoMessage

func (*PreparedCertificate) ProtoMessage()

func (*PreparedCertificate) ProtoReflect

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

func (*PreparedCertificate) Reset

func (x *PreparedCertificate) Reset()

func (*PreparedCertificate) String

func (x *PreparedCertificate) String() string

type Proposal

type Proposal struct {

	// rawProposal is an original proposal like block
	RawProposal []byte `protobuf:"bytes,1,opt,name=rawProposal,proto3" json:"rawProposal,omitempty"`
	// round is the round for which the proposal is created
	Round uint64 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
	// contains filtered or unexported fields
}

Proposal is the tuple (raw_proposal, round)

func (*Proposal) Descriptor deprecated

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

Deprecated: Use Proposal.ProtoReflect.Descriptor instead.

func (*Proposal) GetRawProposal

func (x *Proposal) GetRawProposal() []byte

func (*Proposal) GetRound

func (x *Proposal) GetRound() uint64

func (*Proposal) ProtoMessage

func (*Proposal) ProtoMessage()

func (*Proposal) ProtoReflect

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

func (*Proposal) Reset

func (x *Proposal) Reset()

func (*Proposal) String

func (x *Proposal) String() string

type RoundChangeCertificate

type RoundChangeCertificate struct {

	// roundChangeMessages are the ROUND CHANGE messages
	RoundChangeMessages []*Message `protobuf:"bytes,1,rep,name=roundChangeMessages,proto3" json:"roundChangeMessages,omitempty"`
	// contains filtered or unexported fields
}

RoundChangeCertificate is a collection of round change messages for a certain round

func (*RoundChangeCertificate) Descriptor deprecated

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

Deprecated: Use RoundChangeCertificate.ProtoReflect.Descriptor instead.

func (*RoundChangeCertificate) GetRoundChangeMessages

func (x *RoundChangeCertificate) GetRoundChangeMessages() []*Message

func (*RoundChangeCertificate) ProtoMessage

func (*RoundChangeCertificate) ProtoMessage()

func (*RoundChangeCertificate) ProtoReflect

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

func (*RoundChangeCertificate) Reset

func (x *RoundChangeCertificate) Reset()

func (*RoundChangeCertificate) String

func (x *RoundChangeCertificate) String() string

type RoundChangeMessage

type RoundChangeMessage struct {

	// lastProposal is the last proposal
	// to reach Q(N) - 1 PREPARE messages
	LastPreparedProposal *Proposal `protobuf:"bytes,1,opt,name=lastPreparedProposal,proto3" json:"lastPreparedProposal,omitempty"`
	// latestPreparedCertificate is the PC that accompanies
	// the last proposal
	LatestPreparedCertificate *PreparedCertificate `protobuf:"bytes,2,opt,name=latestPreparedCertificate,proto3" json:"latestPreparedCertificate,omitempty"`
	// contains filtered or unexported fields
}

RoundChangeMessage is the message for the ROUND CHANGE phase

func (*RoundChangeMessage) Descriptor deprecated

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

Deprecated: Use RoundChangeMessage.ProtoReflect.Descriptor instead.

func (*RoundChangeMessage) GetLastPreparedProposal

func (x *RoundChangeMessage) GetLastPreparedProposal() *Proposal

func (*RoundChangeMessage) GetLatestPreparedCertificate

func (x *RoundChangeMessage) GetLatestPreparedCertificate() *PreparedCertificate

func (*RoundChangeMessage) ProtoMessage

func (*RoundChangeMessage) ProtoMessage()

func (*RoundChangeMessage) ProtoReflect

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

func (*RoundChangeMessage) Reset

func (x *RoundChangeMessage) Reset()

func (*RoundChangeMessage) String

func (x *RoundChangeMessage) String() string

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 in the specific height
	Round uint64 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
	// contains filtered or unexported fields
}

View defines the current status

func (*View) Descriptor deprecated

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

Deprecated: Use View.ProtoReflect.Descriptor instead.

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