GossipSeam
A partial-mesh Seam over a base full-membership seam, exposing two views of the endpoints (docs/gossip-mesh-design.md):
active-neighbour view (activePeers) — the ~k peers this node pushes deltas to and GCs against. Shaped by the injected TopologyPolicy and maintained by an internal GossipView.
full-membership view (peers) — everyone in the room, the pool anti-entropy samples. Delegated straight from base.
For a full-mesh base seam the active view is a strict subset, so broadcast floods only to the ~k active neighbours rather than the whole room — the O(N)-fan-out win.
Relayed dissemination (Phase 3). broadcast wraps the payload in a GossipFrame (origin id + per-origin sequence + a hop-budget TTL) and eager-floods it to the active neighbours. On receive, incoming decodes the frame, delivers the payload to the application once and in per-origin send order — keyed by the (origin, seq) pair in a bounded GossipDedup, which holds reordered frames for contiguous release — and, while the TTL permits, decrements the budget and re-floods to this node's active neighbours minus the peer the frame arrived from. So a broadcast reaches the whole overlay device-to-device along ~k-regular edges, dedup terminates the flood (a node relays each message at most once), and the TTL is only a hard cap against pathological loops. Anything a flood drops is backstopped by anti-entropy (Phase 1), so the overlay need only be usually connected. sendTo is delegated straight to base (point-to-point, unwrapped), which on a full-mesh transport can reach any connected peer directly.
Single-collection incoming (ADR-034). GossipSeam is the single collector of base.incoming. Its start loop fans every inbound Swatch to an internal rawIncoming bus that the per-neighbour detectors subscribe to, and re-publishes only non-heartbeat frames to incoming — ping/pong frames are consumed by the detectors and never surface to the application. Collect incoming exactly once; wrap with shareIn for fan-out.
Reverse-edge liveness. The active view is directed (an independent per-peer k-out sample), so a peer may watch this node without being watched back. An inbound ping from such a peer is answered with a pong directly (see answerUnwatchedPing) — otherwise the watcher's detector would starve and tear every asymmetric edge down, collapsing the overlay to mutual-only edges.
Lifecycle. Call start once with a scope you own; it launches the inbound loop and the GossipView. All timing/scheduling runs on that scope, all randomness on the injected seeded random, time via the injected clock.
Parameters
the underlying full-membership seam.
seeded RNG, seeded per-peer by the caller (drives view-recompute jitter; with the default topology it also seeds neighbour selection).
injected time source for the per-neighbour detectors; never the wall clock.
the overlay shape — which peers this node eager-floods to (see TopologyPolicy). Defaults to the RandomKRegular partial mesh seeded from random; pass FullFanout for a hub star. Only broadcast dissemination is shaped; sendTo always passes through unwrapped.
per-peer view-recompute jitter window (see GossipView); a zero range makes recompute synchronous, which deterministic tests rely on.
hop budget stamped on a locally-originated broadcast. Dedup is what terminates the flood; this is only a generous hard cap, comfortably above the overlay diameter at the tens–low-hundreds target scale.
how long a relayed frame held for an earlier same-origin gap waits before the gap is abandoned and the held run released in order (see GossipDedup). Multi-path relay reordering resolves within a few hops' latency, so a gap older than this is a genuine flood drop (anti-entropy backstops it) or a pre-join seq (a late joiner first sights an origin mid-stream) — either way the held frames must not wait forever. Measured on the seam's own sweep ticker (dispatcher time — virtual under a test dispatcher), never on clock, which is the liveness time source and may be frozen (#1309).
Constructors
Properties
The active-neighbour view — deltas/GC target set. Strict subset of peers.
Host-verified principals of the base seam's linked peers, delegated to base when it is a PrincipalRoster (a hub mesh with attested links); a constant empty map otherwise.
Functions
Starts the inbound event loop and the GossipView. Idempotent only if called once per scope; call exactly once.