Traffic redistribution
1) What is redistribution and why it is needed
Traffic redistribution is the controlled change of routes/providers/queues for parts of the load (flows, causality keys, QoS classes) during overloads, incidents, price shocks or changes in compliance status. Objectives:- hold SLO (p95/p99, success rate) during bursts;
- reduce Tail Amplification and finality time;
- minimize Cost-to-Serve without loss of quality and order;
- provide fail-closed behavior for risks and violations.
2) QoS objects, roles and classes
Redistribution objects: routes, bridges, sequencers, DA pools, POP/edge, GPU/CPU clusters, service queues.
Роли: Operator/Router, Provider (узел/бридж/DA/GPU), Compliance Gate, Orchestrator, Auditor/Regulator, Treasury/治理.
- Q4 - deadline commands (critical to order/finality).
- Q3 - ordered flows (causality key).
- Q2 - exactly-once effectively (snapshots/billing).
- Q1/Q0 - telemetry/analytics/best effect.
3) When to start redistribution (detection)
Triggers (any of the conditions):- p95/p99 above the corridor, TailAmplification = p99/p50 rising.
- Queue depth or consumer lag exceed thresholds.
- Finality lag/bridge errors rise, reorg/orphan above normal.
- Cost/Req on the route goes over budget.
- Compliance event: geo/age/sanctions → block/restriction.
- Degradation signals: SLA-брейки, flap-rate, error-budget burn.
4) Decision on a new route (utility function)
The route/provider is selected at the minimum expected "cost" subject to the invariants:
Utility(route) =
wL·Latency_p95_EWMA
+ wJ·Jitter
+ wQ·QueueDepth
+ wC·Cost_per_unit (gas + DA + egress + compute)
+ wF·FinalityTime
+ wR·RiskScore
+ wA·AvailabilityPenalty
+ wG·Geo/CompliancePenalty
The profiles of the scales depend on the QoS class: for Q4 ↑wL, ↑wF, ↑wR; for Q1 ↑wC, ↓wF.
Hard invariants: 'Order (true) ∧ Idempotency (true) ∧ Quotas (true) ∧ Compliance (true)'.
5) Redistribution algorithms and mechanics
Consistent hashing per key → minimizes permutations;
Hot-Shard Relief is a temporary subsegmentation of hot keys.
Percentile-aware routing - solutions on p95/p99, not p50.
EDF/LLF для Q4 (Earliest Deadline / Least Laxity First).
Weighted Fair Queuing/DRR - fair share in total queues.
Leaky/Token buckets - quotas per class/route/provider.
Circuit breakers — trip → reroute; half-open recovery sample.
Adaptive retries - limited retreats with jitter and deadlines.
Spillover tiers - downshift: Q0/Q1 leave for batch/edge, freeing up the Q3/Q4 strip.
6) Order, idempotence, finality
Strict order per key (Q3/Q4) on the selected route; with failover - "stop barrier" + replay from outbox/inbox, then "defrost."
Idempotency key + seen-tables (TTL) - dedup on redelivery.
X-chain finality: take into account the 'FinalityTime '/challenge window; critical operations receive a path with a minimum total finality.
7) Redistribution economics
Surge surcharges: when queues/tailings grow ↑ wC on congested routes.
The provider's Quality Factor (QF) affects volume and payment.
Budget-limits: daily/hourly cost ceilings and egress.
Treasury hooks: sustainable quality domains receive ↓take - rate/↑obyem.
8) Compliance and geo-rules
Fail-closed: status doubt → block, manual quorum.
ZK passes: age/geo docs without PD disclosure.
Export/retention policies: DA/egress by region, tax deductions in the way of payments.
Geo-evasion guard: bypass signatures → quarantine + audit.
9) Observability and alerting
Trace: 'x _ msg _ id', 'route _ id', 'provider _ id', bridge/DA stages, finality.
Metrics: p50/p95/p99, retry%, timeout%, duplicate/out-of-order%, queue depth, finality lag, cost/req, surge index.
Дашборды: Reroute Live, Tail Heatmap, Queue/Finality Monitor, Cost-per-Route, Fairness Panel.
Alerts: error-budget burn, flap-rate, DLQ depth, compliance blocks.
10) Incidents (RCA) and Degradation Protocol
1. Detection (see § 3) → route isolation (trip), redistribution of shares.
2. Mitigation: downshift Q0/Q1, increasing the priority of Q4/Q3, cutting off limits to "noisy" flows.
3. Compensations: from the insurance pool (S-pledge, RNFT-rules).
4. Post-mortem: reasons, weight/limit adjustment, signature update, rehearsal.
11) Formulas and landmarks
SuccessRate = 1 − (timeouts + errors)/requests
TailAmplification = p99/p50 (target: ↓, corridors per QoS)
Headroom = (cap − current)/cap
Cost/Req = Σ (resource × bid )/successful _ requests
FairnessIndex (Jain) = (Σ x) ²/( n· Σ x ²) by quota/resource
Provider QualityFactor: (QF = f (\text {success}, p95, DLQ, finality))
SLO landmarks (example):- Q4: success ≥ 99. 99%, p95 ≤ 200 ms, DLQ = 0, MTTR ≤ 15 min.
- Q3: violation of the order of ≤ 10⁻⁶/soobshch., p95 ≤ 500 ms.
- DA/Bridge: finality ≤ 3 × T _ block, false confirmations = 0.
12) 治理: rules for changing weights/quotas/prices
Shifts (w), quotas, tariffs and QF bonuses.
R-modifier of votes for qualitative roles (corridor [0. 8..1. 2]).
Sunset edits: temporary changes with auto-rollback.
Public reporting: quarterly reallocation metrics and fairness audits.
13) Implementation playbook (in steps)
1. Mapping flows and causality keys (by QoS/region/compliance).
2. Telemetry and samples: OWD/RTT/jitter/queue/finality/cost (EWMA + p95/p99).
3. Utility policies: per QoS weight profiles, cost budgets, surge corridors.
4. Quotas and shapers: token-buckets per route/provider/class.
5. Delivery guarantees: outbox/inbox, idempotence, serial barriers.
6. Fairness & backpressure: WFQ/DRR, anti-noise, spillover tiers.
7. Observability: dashboards, alerts, error budgets, DLQ/Replay.
8. Game-days/chaos: domain/bridge/DA drop, price shock, geo-block.
9. 治理: procedures for changing weights/limits/prices (proposals, sunset).
10. Pilot → scaling: A/B profiles, recalibration, public report.
14) KPI of the redistribution program
Delivery: success by QoS classes, DLQ = 0 (Q3/Q4), duplicate/out-of-order ↓.
Delay: p95/p99 and TailAmplification in target corridors.
Robustness: MTTR median ≤ target, flap-rate ↓.
Economy: Cost/Req ↓ while maintaining SLO; growth in the share of "cheap" routes.
Justice: Jain in the hallway; reducing "noisy neighbor" incidents.
Finality/safety: finality lag ↓, 0 false confirmations.
Compliance: 100% pass geo/age/sanctions, zero violations.
15) Delivery checklist
- QoS, SLO/SLAs, causality keys and error budgets defined
- Implemented utility policies, quotas and token buckets per route/provider
- Included consistent hashing, hot-shard relief, EDF/LLF (Q4)
- Configured outbox/inbox, idempotency and ordinal barriers
- WFQ/DRR, backpressure and spillover tiers work
- Dashboards latency/tail/queue/finality/cost and alerts are available
- circuit breakers, DLQ/Replay and compensation (S-escrow) included
- Held game-days/chaos and post-mortems
- Compliance Gate and tax deductions on payments are connected
- Utverzhden治理 - process of changing weights/limits/prices (sunset)
16) Glossary
Traffic redistribution: managed reroute/reassignment of queues/providers.
Tail Amplification: p99/p50 - the strength of the "tail" of delays.
FinalityTime: time to irreversibility of the cross-chain event.
Utility-routing: path selection by aggregated utility.
WFQ/DRR: Fair Queue Maintenance Discipline.
Spillover tiers: lowering soft classes in batch/edge when overloaded.
Circuit breaker: automatic shutdown of a degraded route.
17) The bottom line
Traffic redistribution is an operational stability loop: we measure → solve → redirect without violating the order, finality and rules. The combination of utility routing, fairness/quotas, strict delivery i治理 control guarantees turns the multi-chain ecosystem into an adaptive system that can withstand peaks in demand, incidents and price shocks - quickly, honestly and economically.