Documentation ¶
Index ¶
- func DecidedIndexKey(lambda []byte) string
- func IBFTAllRoundChangeIndexKey(lambda []byte, seqNumber uint64) string
- func IBFTMessageIndexKey(lambda []byte, seqNumber uint64, round uint64) string
- func SigRoundIndexKey(lambda []byte, seqNumber uint64) string
- func SyncIndexKey(lambda []byte) string
- type IndexFunc
- type MessageQueue
- func (q *MessageQueue) AddIndexFunc(f IndexFunc)
- func (q *MessageQueue) AddMessage(msg *network.Message)
- func (q *MessageQueue) DeleteMessagesWithIds(ids []string)
- func (q *MessageQueue) MessagesForIndex(index string) map[string]*network.Message
- func (q *MessageQueue) MsgCount(index string) int
- func (q *MessageQueue) PopMessage(index string) *network.Message
- func (q *MessageQueue) PurgeIndexedMessages(index string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecidedIndexKey ¶ added in v0.0.4
DecidedIndexKey is the ibft decisions index key
func IBFTAllRoundChangeIndexKey ¶ added in v0.0.6
IBFTAllRoundChangeIndexKey is the ibft index key for all round change msgs
func IBFTMessageIndexKey ¶ added in v0.0.5
IBFTMessageIndexKey is the ibft index key
func SigRoundIndexKey ¶
SigRoundIndexKey is the SSV node signature collection index key
func SyncIndexKey ¶ added in v0.0.4
SyncIndexKey is the ibft sync index key
Types ¶
type IndexFunc ¶
IndexFunc is the function that indexes messages to be later pulled by those indexes
type MessageQueue ¶
type MessageQueue struct {
// contains filtered or unexported fields
}
MessageQueue is a broker of messages for the IBFT instance to process. Messages can come in various times, even next round's messages can come "early" as other nodes can change round before this node. To solve this issue we have a message broker from which the instance pulls new messages, this also reduces concurrency issues as the instance is now single threaded. The message queue has internal logic to organize messages by their round.
func (*MessageQueue) AddIndexFunc ¶
func (q *MessageQueue) AddIndexFunc(f IndexFunc)
AddIndexFunc adds an index function that will be activated every new message the queue receives
func (*MessageQueue) AddMessage ¶
func (q *MessageQueue) AddMessage(msg *network.Message)
AddMessage adds a message the queue based on the message round. AddMessage is thread safe
func (*MessageQueue) DeleteMessagesWithIds ¶ added in v0.0.6
func (q *MessageQueue) DeleteMessagesWithIds(ids []string)
DeleteMessagesWithIds deletes all msgs by the given id
func (*MessageQueue) MessagesForIndex ¶ added in v0.0.6
func (q *MessageQueue) MessagesForIndex(index string) map[string]*network.Message
MessagesForIndex returns all messages for an index
func (*MessageQueue) MsgCount ¶
func (q *MessageQueue) MsgCount(index string) int
MsgCount will return a count of messages by their index
func (*MessageQueue) PopMessage ¶
func (q *MessageQueue) PopMessage(index string) *network.Message
PopMessage will return a message by its index if found, will also delete all other index occurrences of that message
func (*MessageQueue) PurgeIndexedMessages ¶
func (q *MessageQueue) PurgeIndexedMessages(index string)
PurgeIndexedMessages will delete all indexed messages for the given index