Documentation ¶
Index ¶
- func AppRestoreState(destModule t.ModuleID, checkpoint *checkpointpb.StableCheckpoint) *eventpb.Event
- func AppSnapshotRequest(destModule t.ModuleID, replyTo t.ModuleID) *eventpb.Event
- func AppSnapshotResponse(destModule t.ModuleID, appData []byte) *eventpb.Event
- func ClientRequest(clientID t.ClientID, reqNo t.ReqNo, data []byte) *requestpb.Request
- func DeliverCert(destModule t.ModuleID, sn t.SeqNr, cert *availabilitypb.Cert) *eventpb.Event
- func EpochConfig(epochNr t.EpochNr, firstSn t.SeqNr, length int, ...) *commonpb.EpochConfig
- func Factory(destModule t.ModuleID, evt *factorymodulepb.Factory) *eventpb.Event
- func HashRequest(destModule t.ModuleID, data [][][]byte, origin *eventpb.HashOrigin) *eventpb.Event
- func HashResult(destModule t.ModuleID, digests [][]byte, origin *eventpb.HashOrigin) *eventpb.Event
- func HashedRequest(request *requestpb.Request, digest []byte) *requestpb.HashedRequest
- func Init(destModule t.ModuleID) *eventpb.Event
- func MessageReceived(destModule t.ModuleID, from t.NodeID, message *messagepb.Message) *eventpb.Event
- func NewClientRequests(destModule t.ModuleID, requests []*requestpb.Request) *eventpb.Event
- func NewConfig(destModule t.ModuleID, epochNr t.EpochNr, ...) *eventpb.Event
- func NewEpoch(destModule t.ModuleID, epochNr t.EpochNr) *eventpb.Event
- func NodeSigsVerified(destModule t.ModuleID, valid []bool, errors []string, nodeIDs []t.NodeID, ...) *eventpb.Event
- func Redirect(event *eventpb.Event, destination t.ModuleID) *eventpb.Event
- func SendMessage(destModule t.ModuleID, message *messagepb.Message, destinations []t.NodeID) *eventpb.Event
- func SignRequest(destModule t.ModuleID, data [][]byte, origin *eventpb.SignOrigin) *eventpb.Event
- func SignResult(destModule t.ModuleID, signature []byte, origin *eventpb.SignOrigin) *eventpb.Event
- func TestingString(dest t.ModuleID, s string) *eventpb.Event
- func TestingUint(dest t.ModuleID, u uint64) *eventpb.Event
- func TimerDelay(destModule t.ModuleID, events []*eventpb.Event, delay t.TimeDuration) *eventpb.Event
- func TimerGarbageCollect(destModule t.ModuleID, retIndex t.RetentionIndex) *eventpb.Event
- func TimerRepeat(destModule t.ModuleID, events []*eventpb.Event, delay t.TimeDuration, ...) *eventpb.Event
- func VerifyNodeSigs(destModule t.ModuleID, data [][][]byte, signatures [][]byte, ...) *eventpb.Event
- func WALAppend(destModule t.ModuleID, event *eventpb.Event, retentionIndex t.RetentionIndex) *eventpb.Event
- func WALEntry(persistedEvent *eventpb.Event, retentionIndex t.RetentionIndex) *eventpb.Event
- func WALTruncate(destModule t.ModuleID, retentionIndex t.RetentionIndex) *eventpb.Event
- type EventList
- func (el *EventList) Head(n int) *EventList
- func (el *EventList) Iterator() *EventListIterator
- func (el *EventList) Len() int
- func (el *EventList) PushBack(event *eventpb.Event) *EventList
- func (el *EventList) PushBackList(newEvents *EventList) *EventList
- func (el *EventList) PushBackSlice(events []*eventpb.Event) *EventList
- func (el *EventList) RemoveFront(n int) int
- func (el *EventList) Slice() []*eventpb.Event
- func (el *EventList) StripFollowUps() (*EventList, *EventList)
- type EventListIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppRestoreState ¶
func AppRestoreState(destModule t.ModuleID, checkpoint *checkpointpb.StableCheckpoint) *eventpb.Event
AppRestoreState returns an event representing the protocol module asking the application for restoring its state from the snapshot.
func AppSnapshotRequest ¶
AppSnapshotRequest returns an event representing the protocol module asking the application for a state snapshot.
func AppSnapshotResponse ¶
AppSnapshotResponse returns an event representing the application making a snapshot of its state. appData is the serialized application state (the snapshot itself) and origin is the origin of the corresponding AppSnapshotRequest.
func ClientRequest ¶
ClientRequest returns an event representing the reception of a request from a client.
func DeliverCert ¶
Deliver returns an event of delivering a request batch to the application in sequence number order.
func EpochConfig ¶
func EpochConfig( epochNr t.EpochNr, firstSn t.SeqNr, length int, memberships []map[t.NodeID]t.NodeAddress, ) *commonpb.EpochConfig
EpochConfig represents the configuration of the system during one epoch
func HashRequest ¶
HashRequest returns an event representing a request to the hashing module for computing hashes of data. For each object to be hashed the data argument contains a slice of byte slices representing it (thus [][][]byte). The origin is an object used to maintain the context for the requesting module and will be included in the HashResult produced by the hashing module.
func HashResult ¶
HashResult returns an event representing the computation of hashes by the hashing module. It contains the computed digests and the HashOrigin, an object used to maintain the context for the requesting module, i.e., information about what to do with the contained digest.
func HashedRequest ¶
func HashedRequest(request *requestpb.Request, digest []byte) *requestpb.HashedRequest
func Init ¶
Init returns an event instructing a module to initialize. This event is the first to be applied to a module after applying all events from the WAL.
func MessageReceived ¶
func MessageReceived(destModule t.ModuleID, from t.NodeID, message *messagepb.Message) *eventpb.Event
MessageReceived returns an event representing the reception of a message from another node. The from parameter is the ID of the node the message was received from.
func NewClientRequests ¶
NewClientRequests returns an event representing the reception of new requests from clients.
func NodeSigsVerified ¶
func NodeSigsVerified( destModule t.ModuleID, valid []bool, errors []string, nodeIDs []t.NodeID, origin *eventpb.SigVerOrigin, allOk bool, ) *eventpb.Event
NodeSigsVerified returns an event representing the result of the verification of multiple nodes' signatures by the crypto module. It contains the results of the verifications (as boolean values and errors produced by the Crypto module if the verification failed) and the SigVerOrigin, an object used to maintain the context for the requesting module, i.e., information about what to do with the results of the signature verification. The allOK argument must be set to true if the valid argument only contains true values.
func SendMessage ¶
func SendMessage(destModule t.ModuleID, message *messagepb.Message, destinations []t.NodeID) *eventpb.Event
SendMessage returns an event of sending the message message to destinations. destinations is a slice of replica IDs that will be translated to actual addresses later.
func SignRequest ¶
SignRequest returns an event representing a request to the crypto module for computing the signature over data. The origin is an object used to maintain the context for the requesting module and will be included in the SignResult produced by the crypto module.
func SignResult ¶
SignResult returns an event representing the computation of a signature by the crypto module. It contains the computed signature and the SignOrigin, an object used to maintain the context for the requesting module, i.e., information about what to do with the contained signature.
func TimerDelay ¶
func TimerGarbageCollect ¶
func TimerRepeat ¶
func TimerRepeat( destModule t.ModuleID, events []*eventpb.Event, delay t.TimeDuration, retIndex t.RetentionIndex, ) *eventpb.Event
func VerifyNodeSigs ¶
func VerifyNodeSigs( destModule t.ModuleID, data [][][]byte, signatures [][]byte, nodeIDs []t.NodeID, origin *eventpb.SigVerOrigin, ) *eventpb.Event
VerifyNodeSigs returns an event representing a request to the crypto module for verifying a batch of node signatures. The origin is an object used to maintain the context for the requesting module and will be included in the NodeSigsVerified event produced by the crypto module. For each signed message, the data argument contains a slice of byte slices (thus [][][]byte)
func WALAppend ¶
func WALAppend(destModule t.ModuleID, event *eventpb.Event, retentionIndex t.RetentionIndex) *eventpb.Event
WALAppend returns an event of appending a new entry to the WAL. This event is produced by the protocol state machine for persisting its state.
func WALEntry ¶
WALEntry returns an event of reading an entry from the WAL. Those events are used at system initialization.
func WALTruncate ¶
WALTruncate returns and event on removing all entries from the WAL that have been appended with a retentionIndex smaller than the specified one.
Types ¶
type EventList ¶
type EventList struct {
// contains filtered or unexported fields
}
EventList represents a list of Events, e.g. as produced by a module.
func EmptyList ¶
func EmptyList() *EventList
EmptyList returns an empty EventList. TODO: consider passing EventList by value here and everywhere else.
func Strip ¶
Strip returns a new identical (shallow copy of the) event, but with all follow-up events (stored under event.Next) removed. The removed events are stored in a new EventList that Strip returns a pointer to as the second return value.
func (*EventList) Head ¶
Head returns the first up to n events in the list as a new list. The original list is not modified.
func (*EventList) Iterator ¶
func (el *EventList) Iterator() *EventListIterator
Iterator returns a pointer to an EventListIterator object used to iterate over the events in this list, starting from the beginning of the list.
func (*EventList) PushBack ¶
PushBack appends an event to the end of the list. Returns the EventList itself, for the convenience of chaining multiple calls to PushBack.
func (*EventList) PushBackList ¶
PushBackList appends all events in newEvents to the end of the current EventList.
func (*EventList) PushBackSlice ¶
PushBackSlice appends all events in newEvents to the end of the current EventList.
func (*EventList) RemoveFront ¶
RemoveFront removes the first up to n events from the list. Returns the number of events actually removed.
func (*EventList) Slice ¶
Slice returns a slice representation of the current state of the list. The returned slice only contains pointers to the events in this list, no deep copying is performed. Any modifications performed on the events will affect the contents of both the EventList and the returned slice.
func (*EventList) StripFollowUps ¶
StripFollowUps collects all follow-up Events of the Events in the list. It returns two lists: 1. An EventList containing the same events as this list, but with all follow-up events removed. 2. An EventList containing only those follow-up events.
type EventListIterator ¶
type EventListIterator struct {
// contains filtered or unexported fields
}
EventListIterator is an object returned from EventList.Iterator used to iterate over the elements (Events) of an EventList using the iterator's Next method.
func (*EventListIterator) Next ¶
func (eli *EventListIterator) Next() *eventpb.Event
Next will return the next Event until the end of the associated EventList is encountered. Thereafter, it will return nil.