Repository navigation
Spec 08 Epochs
Source: spec/08-epochs.md at commit a9f0d61. The file is the source of truth; this page is a summary.
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.
-
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 aHomeOverrideexists. A client computes the schedule fromGand 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).
EpoConfigsets home, roster,seq_order, lane map, engine version and endpoints, and it must be finalEPO_CONFIG_LEAD_Sbefore T. If it is missing, the previous configuration carries forward. -
Go/no-go at T − 10 s (§2.6, E6).
EpoGoneeds Q freshEpoReadymessages from voters ofR_{e+1}and one from each of the twovyrn-seqboxes (primary F1, standby F2). If any is missing, the old home logsEpoHoldand 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 aSealstep, 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_esign one 120-byteHandoffRecordwith their vote keys. The record holdslast_step,last_height,state_root,log_hashandnext_seq_key. Neithervyrn-seqbox 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
Ackon a separate window stream, gated like any ack. Deadline admission andBUSYapply 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 checksepoch16before 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 withEpoReassign. -
Sessions survive the boundary (§11, E8).
SessionId,pkt_seqandresp_seqcontinue 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.
| 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.
-
- Scope, decisions and constraints
-
- Words used in this chapter
-
- The schedule
-
- The handoff on one page
-
- State machines
-
- The
HandoffRecordand its certificate
- The
-
- Timeline per transition
-
- The opening auction
-
- Fencing (
INV-FENCE)
- Fencing (
-
- 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)
-
- Failure cases
-
- Client migration
-
- Testing
- Interfaces to other chapters
- Local definitions
- Requests to 01
- Open questions
-
§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 µsAck. 08 §6.3 holds the proof. -
§14.4, who votes.
vyrn-seqnever votes, so it never signs aHandoffRecord(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
BUSYbounds apply in the window unchanged (§7.11). -
§14.10. This section defines the
SealandUncrossstep kinds,Fill.liq= 2 for auction fills, and theOutcauses 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.
vyrn-epoch; the opening-auction uncross is in vyrn-bbo
The chapter lists 10 open questions; see Open Questions.
Overview
Working on VYRN
Spec
- 00 Index
- 01 Conventions
- 02 Requirements
- 03 Architecture
- 04 Protocol
- 05 Engine
- 06 Platform
- 07 Replication
- 08 Epochs
- 09 Chain
- 10 Accounts, Risk, MD
- 11 Build
- 12 Commitment
- 13 Availability
- 14 Envelope
Engine crates
Other crates
- vyrn-nic
- vyrn-log
- vyrn-data
- vyrn-consensus
- vyrn-replica
- vyrn-epoch
- vyrn-chain
- vyrn-md
- vyrn-sim
- vyrn-bench
Binaries
- vyrn-seq (stub)
- vyrn-validator (stub)
- vyrn-admin
Outside Rust
Reflects main at a9f0d61.