Skip to content

Spec 08 Epochs

Amp edited this page Nov 18, 2026 · 1 revision

Spec 08: Epochs

Source: spec/08-epochs.md at commit a9f0d61. The file is the source of truth; this page is a summary.

What the chapter decides

Chapter 08 defines "follow the sun": how a book moves its home every 8 hours, from TYO to LDN to NYC and back to TYO. It fixes the schedule and the go/no-go decision, the seal at the old home, and the HandoffRecord that a quorum of the old home's voters certifies. It covers the window at the new home, during which orders get a 1 µs queued Ack but no fill, and the opening auction that ends the window. It also sets the fencing rules that stop two histories from existing, the key and membership changes made at a boundary, the failure cases, client migration and the chaos tests. The boundary is a log position (e, S) fixed by a certificate, never a time.

Key decisions

  • Epochs are fixed 8-hour slots (§2.1–§2.2, E1). The boundaries are 00:00, 08:00 and 16:00 UTC, and home(e) = [TYO, LDN, NYC][e mod 3] unless a HomeOverride exists. A client computes the schedule from G and the clock alone.
  • The boundary is a certified log position (E2, §8.3). T only triggers the seal. Clock skew can change the window length but never the history.
  • The next epoch's configuration is fixed in advance (§2.3, E9). EpoConfig sets home, roster, seq_order, lane map, engine version and endpoints, and it must be final EPO_CONFIG_LEAD_S before T. If it is missing, the previous configuration carries forward.
  • Go/no-go at T − 10 s (§2.6, E6). EpoGo needs Q fresh EpoReady messages from voters of R_{e+1} and one from each of the two vyrn-seq boxes (primary F1, standby F2). If any is missing, the old home logs EpoHold and retries every 15 min (§2.5). A Byzantine proposer cannot hold a healthy handoff.
  • Seal (§4.2). A lane stops at its first packet with rx_ts ≥ T. The cut cores then publish a final cut, the BBO core drains its rings and runs a Seal step, and the last block is closed and signed.
  • The handoff is a certificate, not a WAN consensus round (§5, E3). Q voting replicas of R_e sign one 120-byte HandoffRecord with their vote keys. The record holds last_step, last_height, state_root, log_hash and next_seq_key. Neither vyrn-seq box signs. Quorum intersection allows at most one certificate per (book, epoch) (§5.3).
  • The tail is streamed (§5.5). Two relay replicas forward unfinalized frames on two WAN paths, and each path carries the whole stream. The new sequencer replays the tail speculatively, so it reaches S′ before the certificate arrives.
  • The window has a floor of one WAN one-way (§6.3). A proof shows that any handoff that keeps one price-time book has W ≥ d. Finality then adds one metro round. The bound is W ≤ t_wan + FINALITY_MAX_MS + EPO_WINDOW_SLACK_MS (§6.2).
  • Every packet gets a 1 µs answer in the window (§7.11, E10). Window messages get a queued Ack on a separate window stream, gated like any ack. Deadline admission and BUSY apply unchanged. Only the fill waits.
  • Opening auction (§7, E5). Window orders are collected without matching, applied against S′ and uncrossed once at U. The clearing tick gives maximum volume, then minimum imbalance, then the tick nearest the reference, then the lowest tick. All executions are at one price with price-time allocation. Carried orders keep priority over window orders at the same tick (INV-EPO-2). Lemma 3 proves the residual book is uncrossed.
  • Fencing (§8, INV-FENCE, F1–F6). Once a replica holds cert(e, S) it rejects epoch-e steps above S. A lane checks epoch16 before the MAC, and a wrong-epoch packet never closes a session.
  • No automatic resumption after the seal (§10.3, E7). If the certificate has not arrived by T + 250 ms, the new home logs EpoHalt. Only Q operators can then reassign the epoch with EpoReassign.
  • Sessions survive the boundary (§11, E8). SessionId, pkt_seq and resp_seq continue and only the keys rotate. The new home deduplicates resends against the state at S, so each packet is applied in exactly one epoch (INV-EPO-3).
  • Bridge signer table (CHAIN) (§9.5). An L1 rotation number maps to a SignerSet. A new set becomes active only at the first activated boundary after its approval, and every activated set stays readable by rotation number.

Key numbers

Item Value § Kind (as the spec labels it)
EPOCH_HOURS / boundaries 8 h; 00:00, 08:00, 16:00 UTC §0, §2.1 constant (01 §5)
EPO_WINDOW_SLACK_MS 3 ms §6.2 budget
W bound, TYO → LDN / LDN → NYC / NYC → TYO / same home 123 / 48 / 93 / 13 ms §6.2 budget
W typical, TYO → LDN 112.6 ms §6.2 budget
EPO_WAN_OW_MS 110, 35, 80 ms §6.1 budget (planning figures; B13 measures)
Fiber light speed ~4.9 µs/km §6.3 vendor
EPO_SEAL_US 50 µs §4.2 budget
Queued Ack at index 9 945 ns ≤ 980 ns §7.11 budget
EPO_UNCROSS_FIRST_US 500 µs (worst case 401 µs) §7.8 budget
Last uncross fill at 10^6 orders ≤ 1,000 µs §7.8 budget (B14 pass)
EPO_COLLECT_MAX_MSGS 6,000,000 per lane Local definitions budget
EPO_HIST_HALF 4,096 ticks §7.5 budget
EPO_CONFIG_LEAD_S, EPO_GO_LEAD_S, EPO_HOLD_S 3,600 s, 10 s, 900 s §4.9 budget
EPO_HALT_COLLECT_MS 250 ms after T §4.9 budget
HandoffCert size 315 B (BASE), 380 B (CHAIN) §5.1 encoding

Draft 0.2 has no measured numbers. Every value above is a target or a bound, not a result.

Section map

    1. Scope, decisions and constraints
    1. Words used in this chapter
    1. The schedule
    1. The handoff on one page
    1. State machines
    1. The HandoffRecord and its certificate
    1. Timeline per transition
    1. The opening auction
    1. Fencing (INV-FENCE)
    1. Keys and membership at the boundary (9.1 Sequencer keys, 9.2 Lane map, 9.3 Replica sets, 9.5 Bridge signer table (CHAIN), 9.4 Software upgrades; the file places 9.5 before 9.4)
    1. Failure cases
    1. Client migration
    1. Testing
  • Interfaces to other chapters
  • Local definitions
  • Requests to 01
  • Open questions

Where 01 §14 overrides or refines this chapter

  • §14.0 item 2, the handoff window. The window is one of three stated facts of physics, not an exemption. Bounded by t_wan + FINALITY_MAX_MS + EPO_WINDOW_SLACK_MS, it is the only window without a 1 µs fill, and every order in it still gets a 1 µs Ack. 08 §6.3 holds the proof.
  • §14.4, who votes. vyrn-seq never votes, so it never signs a HandoffRecord (E3, INV-EPO-7). Failover promotes only the F2 standby (§10.4).
  • §14.8, sessions and epochs. Sessions survive the boundary, and only accounts that move lane lose their sessions. A bad MAC closes a session only from the bound address with a matching epoch16 (F5). After its seal the old home closes no session and answers strays within 1 µs.
  • §14.1, §14.5, §14.17 item 2. Deadline admission, frame gating and the per-class BUSY bounds apply in the window unchanged (§7.11).
  • §14.10. This section defines the Seal and Uncross step kinds, Fill.liq = 2 for auction fills, and the Out causes 3 (auction) and 6 (lane moved).
  • §14.19 A. REQ-LAT-1 covers every received packet, meaning one that passed E1–E4 and reached the live sequencer's NIC. 08's wording "every packet that reaches a sequencer box" (E10, INV-EPO-5) should be read with that scope.
  • §14.5 and §14.15 item 3. 08's Requests to 01, item 12, points out that §14.5 still names a single core 4 while two order-stream cores exist. 08 has stream-A and stream-B each drain their half.

Implemented by

vyrn-epoch; the opening-auction uncross is in vyrn-bbo

Open questions

The chapter lists 10 open questions; see Open Questions.

Clone this wiki locally