Skip to main content

Module stacks

Module stacks 

Source
Expand description

Ready-made compositions: a layer, spelled with the link it runs over.

Every protocol here takes its link as a type parameter, which is what removed the four forked session_* broadcast modules. The cost is that naming a stack means naming both halves, and the payload the link carries is the layer’s business rather than the caller’s:

ReliableBroadcast<u32, SessionLink<reliable_broadcast::Data<u32>>>

Data is an implementation detail of Algorithm 3.3 — the originator and sequence number it deduplicates on — and a caller who wants “reliable broadcast over a session link, carrying u32” should not have to know it exists. Each layer names it as Carried<P>, and the aliases below use that to spell the whole stack in one type parameter.

§Why these live here and not beside either half

Putting OverSessions in reliable_broadcast would make that module name a particular link, which is exactly the dependency the port was built to remove — a layer states its requirement as Link and names no implementation. Putting it in session_link would invert the same problem. A composition belongs to neither of the things it composes, so it lives in its own module.

Only the session stacks are named, because they are the ones that existed as forked modules and so have call sites wanting them. A stack over an application’s own link is spelled at its own call site with its own alias; there is nothing for this crate to name.

Type Aliases§

BestEffortBroadcastOverSessions
Best-effort broadcast over a session link — what session_best_effort_broadcast was.
EventualLeaderDetectorOverPerfectDetection
Ω over the perfect failure detector — what this module was before ◇P existed.
FloodingConsensusOverSessions
Flooding consensus over a session link.
LazyProbabilisticBroadcastOverSessions
Lazy gossip over session links — both halves, the gossip and the recovery, over one session per peer pair.
MajorityAckUniformReliableBroadcastOverSessions
Majority-ack uniform reliable broadcast over a session link — what session_majority_ack_uniform_reliable_broadcast was.
ProbabilisticBroadcastOverSessions
Eager gossip over a session link — the real-world set’s form of Algorithm 3.9.
ReliableBroadcastOverSessions
Eager reliable broadcast over a session link — what session_reliable_broadcast was.
UniformReliableBroadcastOverSessions
Uniform reliable broadcast over a session link — what session_uniform_reliable_broadcast was.