Multi-Relayer
How multiple authorized Relayer instances divide work without duplicating expensive proving. Resolves Relayer-challenges § 5.1; fits the component layout of Relayer-architecture.
Scope
Two scaling problems must not be conflated:
| Problem | Scope | Mechanism |
|---|---|---|
Prover fleet — many proverd workers behind one relayer | Single operator | Shared job queue (Stateful relayer § Backend choice). Tight coupling is fine |
| Multi-relayer — several independent authorized relayers | Cross-operator | This document. Loose coordination only: a shared database would couple operators and become a single point of failure |
Constraint from the trust model: each relayer must independently sync the canonical fork (Relayer § Trust Model). Ingestion and the consensus mirror are never shared or divided. Only the trust-free work (proving, submitting) is.
Principle: coordinate through the destination chain
Relayers never talk to each other for correctness. Everything they must agree on is already on-chain and observed identically by all:
| Coordination need | On-chain source |
|---|---|
| Membership (who, how many) | The Router's authorized_relayers set: changes are serialized by the chain, so no split-brain view is possible |
| Work assignment | Deterministic: hash(MessageID) % N == my_index. Every relayer computes the same answer from the same registry |
| Work completion | The Router's delivered-MessageID log + the light client's checkpoint registry, queried before proving |
| Re-shard boundary | The destination block where a registry change finalized: all instances re-shard at the same observed block |
Invariant: coordination is a liveness optimization layered on an uncoordinated-safe base. If every mechanism below fails simultaneously, the system degrades to "everyone proves everything": wasteful, but exactly as safe and live as the spec's baseline.
Layers
Layer 0 — safety floor (in spec)
Router idempotency (Router § "Exactly-once delivery"): a lost submission race reverts harmlessly. Every layer above is economics; correctness never depends on coordination working.
Layer 1 — deterministic sharding
| Work item | Owner |
|---|---|
| Message proof | hash(MessageID) % N |
UpdateConsensusState for a chain | hash(chain_id, height_window) % N: one update per divergence window, not one per relayer |
Steady state: every proof is generated exactly once, with zero messages exchanged.
Layer 2 — timeout takeover
Non-owners already watch the Router. If a shard's message is not delivered within timeout T:
- After
T, the next relayer in the ring takes over, query-before-prove (the owner may merely have submitted late; check the proof pool before re-proving). - After
2T, any relayer may serve it.
T ≈ expected proving time + submission confirmation + margin; shipped as operator config with a recommended default. Worst-case waste: one duplicate proof per owner failure.
Takeover doubles as censorship detection inside the authorized set: a relayer sitting on its shard is visibly outpaced by peers, giving the Security Admin an observable signal for rotation. It strengthens the liveness trust assumption (Relayer § Trust Model) rather than weakening it.
Layer 3 — shared proof pool (optional, zk-proof mode)
TMP proofs are self-verifying commodities: a proof is bound to the message and its block (MessageID + finality) — not to the submitter — and any relayer can verify a peer's proof locally in milliseconds before submitting it. Sharing therefore requires zero trust: a garbage proof from a malicious peer is detected by local verification and discarded.
- Transport can be minimal: each relayer exposes
GET /proof/{message_id}; the takeover successor fetches before re-proving. - Failover cost drops from GPU-minutes to a download.
- This is also the integration seam for an external proving market later.
In direct mode every relayer rebuilds the bundle from its own mirror in milliseconds, so there is nothing to share.
Precondition to confirm in Relayer: proof bundles carry no submitter binding (the Router authenticates the transaction signer against authorized_relayers, never the proof's origin).
Bonus — peer cross-check (feeds challenge 1.2)
Since each relayer independently ingests the canonical fork, comparing block hashes across peers is a free additional canonical-fork check alongside multi-endpoint cross-checking. Multi-relayer operation is thus part of the answer to the canonical-fork guarantee, not just a cost. Now folded into the full invariant: Canonical-fork invariant.
Waste accounting
| Scenario | No coordination | Layers 1–3 |
|---|---|---|
Steady state, N relayers | N× every proof, N× gas races | 1× per proof, no races |
| One relayer down | — | +T latency on its shard; successor fetches the existing proof, else proves once |
| Membership rotation | — | Brief overlap window; duplicates bounded by the idempotency floor |
| Checkpoint updates | N× per update | 1× per height window |
Rejected alternatives
| Alternative | Why rejected |
|---|---|
| Shared extraction / ingestion | Collapses the per-relayer independence the trust model depends on (Relayer § Trust Model) |
| On-chain claim/lease transactions | Gas + latency for what deterministic sharding gives free |
| Leader election (Raft etc.) | Heavy machinery; the chain's serialized state already provides the consistent view, without a new availability dependency |
| Fee-market competition | Only meaningful if relaying becomes permissionless. Parked with Relayer-challenges § 1.1 |
Open questions
| Question | Linked challenge |
|---|---|
Recommended default for takeover timeout T (per source chain: proving time varies by consensus engine) | Relayer-challenges § 5.1 |
| Proof-pool transport: per-relayer HTTP endpoints vs a shared object store | Relayer-challenges § 5.1 |
| Confirm in Relayer that proof bundles carry no submitter binding | Relayer-challenges § 5.1 |
Related documents
- Relayer-architecture: the
Partitionplugin andSubmitterthat implement these layers - Stateful relayer: the intra-operator job queue this deliberately does not extend across operators
- Router § "Exactly-once delivery": the idempotency floor
- Relayer § Trust Model: the independence constraint and the liveness trust assumption