Documentation ¶
Overview ¶
Package proto defines the code for protocol buffer
Index ¶
- Variables
- type CommitMessage
- func (*CommitMessage) Descriptor() ([]byte, []int)deprecated
- func (x *CommitMessage) GetCommittedSeal() []byte
- func (x *CommitMessage) GetProposalHash() []byte
- func (*CommitMessage) ProtoMessage()
- func (x *CommitMessage) ProtoReflect() protoreflect.Message
- func (x *CommitMessage) Reset()
- func (x *CommitMessage) String() string
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetCommitData() *CommitMessage
- func (x *Message) GetFrom() []byte
- func (m *Message) GetPayload() isMessage_Payload
- func (x *Message) GetPrepareData() *PrepareMessage
- func (x *Message) GetPreprepareData() *PrePrepareMessage
- func (x *Message) GetRoundChangeData() *RoundChangeMessage
- func (x *Message) GetSignature() []byte
- func (x *Message) GetType() MessageType
- func (x *Message) GetView() *View
- func (m *Message) PayloadNoSig() ([]byte, error)
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type MessageType
- func (MessageType) Descriptor() protoreflect.EnumDescriptor
- func (x MessageType) Enum() *MessageType
- func (MessageType) EnumDescriptor() ([]byte, []int)deprecated
- func (x MessageType) Number() protoreflect.EnumNumber
- func (x MessageType) String() string
- func (MessageType) Type() protoreflect.EnumType
- type Message_CommitData
- type Message_PrepareData
- type Message_PreprepareData
- type Message_RoundChangeData
- type PrePrepareMessage
- func (*PrePrepareMessage) Descriptor() ([]byte, []int)deprecated
- func (x *PrePrepareMessage) GetCertificate() *RoundChangeCertificate
- func (x *PrePrepareMessage) GetProposal() *Proposal
- func (x *PrePrepareMessage) GetProposalHash() []byte
- func (*PrePrepareMessage) ProtoMessage()
- func (x *PrePrepareMessage) ProtoReflect() protoreflect.Message
- func (x *PrePrepareMessage) Reset()
- func (x *PrePrepareMessage) String() string
- type PrepareMessage
- type PreparedCertificate
- func (*PreparedCertificate) Descriptor() ([]byte, []int)deprecated
- func (x *PreparedCertificate) GetPrepareMessages() []*Message
- func (x *PreparedCertificate) GetProposalMessage() *Message
- func (*PreparedCertificate) ProtoMessage()
- func (x *PreparedCertificate) ProtoReflect() protoreflect.Message
- func (x *PreparedCertificate) Reset()
- func (x *PreparedCertificate) String() string
- type Proposal
- type RoundChangeCertificate
- func (*RoundChangeCertificate) Descriptor() ([]byte, []int)deprecated
- func (x *RoundChangeCertificate) GetRoundChangeMessages() []*Message
- func (*RoundChangeCertificate) ProtoMessage()
- func (x *RoundChangeCertificate) ProtoReflect() protoreflect.Message
- func (x *RoundChangeCertificate) Reset()
- func (x *RoundChangeCertificate) String() string
- type RoundChangeMessage
- func (*RoundChangeMessage) Descriptor() ([]byte, []int)deprecated
- func (x *RoundChangeMessage) GetLastPreparedProposal() *Proposal
- func (x *RoundChangeMessage) GetLatestPreparedCertificate() *PreparedCertificate
- func (*RoundChangeMessage) ProtoMessage()
- func (x *RoundChangeMessage) ProtoReflect() protoreflect.Message
- func (x *RoundChangeMessage) Reset()
- func (x *RoundChangeMessage) String() string
- type View
Constants ¶
This section is empty.
Variables ¶
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.
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) GetCommitData ¶
func (x *Message) GetCommitData() *CommitMessage
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 (*Message) GetType ¶
func (x *Message) GetType() MessageType
func (*Message) PayloadNoSig ¶
PayloadNoSig returns marshaled message without signature
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
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) Descriptor() protoreflect.EnumDescriptor
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 ¶
func (MessageType) Type() protoreflect.EnumType
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) GetRawProposal ¶
func (*Proposal) ProtoMessage ¶
func (*Proposal) ProtoMessage()
func (*Proposal) ProtoReflect ¶
func (x *Proposal) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*View) ProtoMessage()
func (*View) ProtoReflect ¶
func (x *View) ProtoReflect() protoreflect.Message