Module protocol

Source
Expand description

API for protocol implementors.

A protocol is a directed acyclic graph with the nodes being objects of types implementing Round (to be specific, “acyclic” means that the values returned in the id field of TransitionInfo should not repeat during the protocol execution; the types might). The starting point is a type that implements EntryPoint. All the rounds must have their associated type Round::Protocol set to the same Protocol instance to be executed by a Session.

For more details, see the documentation of the mentioned traits.

Structs§

Artifact
Associated data created alongside a message in Round::make_direct_message.
BoxedFormat
A serializer/deserializer for protocol messages.
BoxedRound
A wrapped new round that may be returned by Round::finalize or EntryPoint::make_round.
CommunicationInfo
Describes what other parties this rounds sends messages to, and what other parties it expects messages from.
DeserializationError
An error that can be returned during deserialization error.
DirectMessage
A serialized direct message.
DirectMessageError
An error during deserialization of a direct message.
EchoBroadcast
A serialized echo broadcast.
EchoBroadcastError
An error during deserialization of an echo broadcast.
LocalError
An error indicating a local problem, most likely a misuse of the API or a bug in the code.
NoProtocolErrors
A stub type indicating that this protocol does not generate any provable errors.
NormalBroadcast
A serialized regular (non-echo) broadcast.
NormalBroadcastError
An error during deserialization of a normal broadcast.
Payload
Message payload created in Round::receive_message.
ProtocolMessage
A bundle containing the message parts for one round.
ReceiveError
An error that can be returned from Round::receive_message.
RemoteError
An error indicating a problem whose reason is another node sending invalid data.
RequiredMessageParts
Declares which parts of the message from a round have to be stored to serve as the evidence of malicious behavior.
RequiredMessages
Declares which messages from this and previous rounds have to be stored to serve as the evidence of malicious behavior.
RoundId
A round identifier.
TransitionInfo
Information about the position of the round in the state transition graph.

Enums§

EchoRoundParticipation
The specific way the node participates in the echo round (if any).
FinalizeOutcome
Possible successful outcomes of Round::finalize.
MessageValidationError
An error that can occur during the validation of an evidence of an invalid message.
ProtocolValidationError
An error that can occur during the validation of an evidence of a protocol error.

Traits§

EntryPoint
A round that initiates a protocol.
PartyId
A trait alias for the combination of traits needed for a party identifier.
Protocol
A distributed protocol.
ProtocolError
Describes provable errors originating during protocol execution.
ProtocolMessagePart
A serialized part of the protocol message.
Round
A type representing a single round of a protocol.