Documentation ¶
Index ¶
- func AllHaveLowerRound(messages []*proto.Message, round uint64) bool
- func AllHaveSameHeight(messages []*proto.Message, height uint64) bool
- func ExtractCommitHash(commitMessage *proto.Message) []byte
- func ExtractLastPreparedProposedBlock(roundChangeMessage *proto.Message) []byte
- func ExtractLatestPC(roundChangeMessage *proto.Message) *proto.PreparedCertificate
- func ExtractPrepareHash(prepareMessage *proto.Message) []byte
- func ExtractProposal(proposalMessage *proto.Message) []byte
- func ExtractProposalHash(proposalMessage *proto.Message) []byte
- func ExtractRoundChangeCertificate(proposalMessage *proto.Message) *proto.RoundChangeCertificate
- func HasUniqueSenders(messages []*proto.Message) bool
- func HaveSameProposalHash(messages []*proto.Message) bool
- type CommittedSeal
- type Messages
- func (ms *Messages) AddMessage(message *proto.Message)
- func (ms *Messages) Close()
- func (ms *Messages) GetMostRoundChangeMessages(minRound, height uint64) []*proto.Message
- func (ms *Messages) GetValidMessages(view *proto.View, messageType proto.MessageType, ...) []*proto.Message
- func (ms *Messages) PruneByHeight(height uint64)
- func (ms *Messages) Subscribe(details SubscriptionDetails) *Subscription
- func (ms *Messages) Unsubscribe(id SubscriptionID)
- type Subscription
- type SubscriptionDetails
- type SubscriptionID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllHaveLowerRound ¶
AllHaveLowerRound checks if all messages have the same round
func AllHaveSameHeight ¶
AllHaveSameHeight checks if all messages have the same height
func ExtractCommitHash ¶
ExtractCommitHash extracts the commit proposal hash from the passed in message
func ExtractLastPreparedProposedBlock ¶
ExtractLastPreparedProposedBlock extracts the latest prepared proposed block from the passed in message
func ExtractLatestPC ¶
func ExtractLatestPC(roundChangeMessage *proto.Message) *proto.PreparedCertificate
ExtractLatestPC extracts the latest PC from the passed in message
func ExtractPrepareHash ¶
ExtractPrepareHash extracts the prepare proposal hash from the passed in message
func ExtractProposal ¶
ExtractProposal extracts the proposal from the passed in message
func ExtractProposalHash ¶
ExtractProposalHash extracts the proposal hash from the passed in message
func ExtractRoundChangeCertificate ¶
func ExtractRoundChangeCertificate(proposalMessage *proto.Message) *proto.RoundChangeCertificate
ExtractRoundChangeCertificate extracts the RCC from the passed in message
func HasUniqueSenders ¶
HasUniqueSenders checks if the messages have unique senders
func HaveSameProposalHash ¶
HaveSameProposalHash checks if the messages have the same proposal hash
Types ¶
type CommittedSeal ¶
func ExtractCommittedSeal ¶
func ExtractCommittedSeal(commitMessage *proto.Message) *CommittedSeal
ExtractCommittedSeal extracts the committed seal from the passed in message
func ExtractCommittedSeals ¶
func ExtractCommittedSeals(commitMessages []*proto.Message) []*CommittedSeal
ExtractCommittedSeals extracts the committed seals from the passed in messages
type Messages ¶
type Messages struct {
// contains filtered or unexported fields
}
Messages contains the relevant messages for each view (height, round)
func (*Messages) AddMessage ¶
AddMessage adds a new message to the message queue
func (*Messages) GetMostRoundChangeMessages ¶
GetMostRoundChangeMessages fetches most round change messages for the minimum round and above
func (*Messages) GetValidMessages ¶
func (ms *Messages) GetValidMessages( view *proto.View, messageType proto.MessageType, isValid func(message *proto.Message) bool, ) []*proto.Message
GetValidMessages fetches all messages of a specific type for the specified view, that pass the validity check; invalid messages are pruned out
func (*Messages) PruneByHeight ¶
PruneByHeight prunes out all old messages from the message queues by the specified height in the view
func (*Messages) Subscribe ¶
func (ms *Messages) Subscribe(details SubscriptionDetails) *Subscription
Subscribe creates a new message type subscription
func (*Messages) Unsubscribe ¶
func (ms *Messages) Unsubscribe(id SubscriptionID)
Unsubscribe cancels a message type subscription
type Subscription ¶
type Subscription struct { // ID is the unique identifier of the subscription ID SubscriptionID // SubCh is the notification channel // on which the listener will receive notifications SubCh chan uint64 }
Subscription is the subscription returned to the user
type SubscriptionDetails ¶
type SubscriptionDetails struct { // MessageType is the type of message // being subscribed to MessageType proto.MessageType // View is the combination of height + round // being subscribed to View *proto.View // MinNumMessages is the threshold of messages // being subscribed to MinNumMessages int // HasMinRound is the flag indicating if the // round number is a lower bound HasMinRound bool }
SubscriptionDetails contain the requested details for the subscription
type SubscriptionID ¶
type SubscriptionID int32