playerRelayTransport

fun playerRelayTransport(inner: RaftTransport, relayChannel: Seam, voters: () -> Set<NodeId>, scope: CoroutineScope): RoutedRaftTransport

Build a RoutedRaftTransport for a player: it always forwards to its single server and never routes for anyone else. Required even single-server — without it a learner's reply, handed raw to a follower server, is dropped or answered NotLeader, wedging the commit path.

A player trusts a down-frame only when its true origin is one of the current voters — read live per frame, never captured — so the relay server need not be a voter (closing the admission-hang where a non-voter relay id would be rejected) and a co-player cannot forge an AppendEntries the server forwards down (closing a log-corruption vector).

One unsupported edge (unreachable today)

A brand-new voter that wins an election before this client commits the config entry adding it would have its frames rejected (voters would not yet list it). This requires dynamic voter changes, which nothing does today — admitLearner only ever grows learners, never voters. It is documented as unsupported and deliberately not engineered around.

Parameters

inner

the player's direct transport (its one peer is its server).

relayChannel

the seam to its server; the transport owns its incoming.

voters

the live provider of the current voter node ids — the origin trust set, read per frame so a committed membership growth is honoured.

scope

parents the relay coroutine. Required.