TopologyPolicy

interface TopologyPolicy

The shape of the gossip overlay for one node: given the live roster, which peers this node eager-floods broadcasts to (and GCs against), and which peers it may sample as anti-entropy partners.

A policy answers who, not how: GossipSeam's relay, dedup, and anti-entropy backstop run unchanged over any shape, and unicast (us.tractat.kuilt.core.Seam.sendTo) is never governed by the policy — it only ever shapes broadcast dissemination.

The two shipped policies are isotropic — any k peers are as good as any other k: FullFanout (the hub star) and RandomKRegular (the k-regular partial mesh). Structural topologies (e.g. a two-tier server core + client periphery) implement the same interface by returning position-dependent views.

Any selection randomness is owned by the policy instance (see RandomKRegular), never by the caller, so results are deterministic for a given seed + arguments. A stateful instance belongs to one node — GossipView calls it from a single coroutine; don't share one across seams.

Inheritors

Functions

Link copied to clipboard
abstract fun activeView(self: PeerId, roster: Set<PeerId>): Set<PeerId>

The peers this node eager-floods to and GCs against, selected from roster (which includes self; the result never does). Called on every roster or liveness change with the currently-live members.

Link copied to clipboard
abstract fun antiEntropyPool(self: PeerId, roster: Set<PeerId>): Set<PeerId>

The pool this node samples anti-entropy partners from — usually every other member (roster minus self); structural topologies may restrict it (e.g. tier-local). Never contains self.