Add M10.2b bounded QUIC channels with exact CA pinning
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m47s
Foundation / checks (network) (push) Successful in 8m11s
Foundation / checks (client) (push) Successful in 12m20s
Foundation / checks (tsan) (push) Successful in 7m44s
Foundation / checks (checks) (push) Successful in 31m12s
Foundation / checks (postgres) (push) Successful in 33m27s
Foundation / image (push) Successful in 2m14s
Foundation / postgres-tools (push) Successful in 6m24s
Foundation / server-image (push) Successful in 18m6s

evo_network_quic wraps msquic in a single-owner Endpoint: newest-wins datagram
channel and one length-framed reliable stream, both bounded, with explicit close
causes. The client pins exactly one CA and name with an owned Mbed TLS check that
is the sole authority (OpenSSL's verdict advisory), callbacks never call msquic
under the lock, and MinimumMtu starts at 1280 so 1,200-byte datagrams fit minimum
paths. An owned seeded UDP impairment relay drives loss, duplication, reordering,
corruption, MTU and outage tests, passing on MSVC, GCC and Clang ASan/UBSan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-03 16:11:59 -04:00
co-authored by Claude Opus 5.5
parent 3c421cd0cf
commit ca762bff75
12 changed files with 1844 additions and 6 deletions
+2 -2
View File
@@ -517,8 +517,8 @@ bounded replication and recovery under loss, overload and region transfer.
**Status (2026-10-03):** 10.1 ratified (ADR-0089, schemas/network/m10-budgets-v1.md,
networking/M10_TIMING_TRACES.md); targets are not yet qualified on the reference
hardware (10.9). 10.2 split: 10.2a selection, pins and build of msquic/OpenSSL done
(ADR-0090); 10.2b bounded channels, exact CA pinning and the impairment relay, and 10.2c
loss/head-of-line measurements follow. 10.3-10.9 planned.
(ADR-0090); 10.2b bounded channels, exact CA pinning and the impairment relay done;
10.2c loss/head-of-line measurements follow. 10.3-10.9 planned.
**Entry:** M9 client/session evidence and M7/M8 dev/stage durability. Read
NETWORK_ARCHITECTURE, PERSISTENCE_ARCHITECTURE and ADR-0017. The M9 transport is
+4 -2
View File
@@ -10,8 +10,10 @@ traces (`evo-dev-session trace`, networking/M10_TIMING_TRACES.md) measured admis
p99 <= 5.2 ms, durable p95 about 1.4 s and 50 ms view cadence. Finding: genome v1 and
metabolism use per-tick rates, so the quantum fixes biological rates until M11.1
converts or ratifies them. M10.2a selects QUIC with msquic 2.6.2 and OpenSSL 3.5.9 LTS
(ADR-0090), pinned and building on Windows and Linux with a loopback smoke test. Next:
M10.2b bounded channels, exact CA pinning and the owned impairment relay.
(ADR-0090), pinned and building on Windows and Linux with a loopback smoke test. M10.2b adds
the bounded QUIC endpoint (datagram and reliable channels, exact CA pinning with the owned
check authoritative, minimum-MTU start) and the owned impairment relay, tested on both
platforms. Next: M10.2c loss and head-of-line measurements.
## Previous gate - 2026-10-02
+28
View File
@@ -92,3 +92,31 @@ When the client adopts QUIC, the Windows package (ADR-0086) adds `msquic.dll` to
allowlist and the msquic (MIT) and OpenSSL (Apache-2.0) notices. OpenSSL and msquic
security releases update the pin, checksums and this ADR. UDP-blocked networks are
served only by the dev fallback for now.
## M10.2b implementation (2026-10-03)
`evo_network_quic` (`include/evo/network/quic_transport.hpp`) provides one `Endpoint`
(server or client) owned by one thread that calls `poll()`:
- **Channels:** realtime DATAGRAMs (payload <= min(1,200, the peer's current maximum);
inbound newest-wins per connection, outbound in-flight cap refuses) and one
client-opened bidirectional stream carrying 32-bit length-framed messages (<= 64 KiB,
once, in order). Outbound reliable bytes not yet completed and inbound bytes awaiting
`poll()` are bounded; inbound overflow closes the connection (`overloaded`), an
oversized or malformed frame closes it (`protocol`), a second peer stream is refused.
Closures carry a cause: local, peer, idle, untrusted, overloaded, protocol, transport.
- **Exact pinning closes the 10.2a gap:** the client defers OpenSSL's verdict, receives the
peer leaf as DER and returns pending; `poll()` verifies it with Mbed TLS against only
the configured CA and name and completes validation. The owned check is the sole
authority; OpenSSL's verdict is advisory (counted when it disagrees). Reason: dev CAs
share a subject name, so with another CA in `SSL_CERT_FILE` OpenSSL's issuer lookup
failed a genuine server; the environment must neither add nor remove trust.
- **Threading rule:** callbacks touch state only under one mutex and never call msquic
while holding it (msquic may run callbacks inline); handles are closed only by the
owning thread. Mbed TLS runs only on the owning thread.
- **Path MTU:** msquic assumes a 1,288-byte IP MTU by default (1,260-byte IPv4 UDP
payloads), which a compliant 1,280-byte path drops. `MinimumMtu` is set to 1,280; path
discovery only probes upward, and the 1,200-byte datagram budget fits that path.
- **Settings:** idle 5 s, keep-alive 1 s, handshake 5 s, flow-control windows equal to the
inbound reliable bound, one peer bidirectional stream, no unidirectional streams.
- **Impairment relay** (`tools/network/impair`, tests and measurements only): seeded
loss, duplication, reordering, corruption, delay/jitter, payload-size limit and live
reconfiguration (outage).
+2 -1
View File
@@ -3,7 +3,8 @@
Status: locked server authority and untrusted clients; transport/reliability are
proposals for M10. M10 timing and workload budgets: ADR-0089 and
[m10-budgets-v1](../../schemas/network/m10-budgets-v1.md). M10 transport: QUIC via msquic
with OpenSSL (ADR-0090); channels and impairment tests follow in M10.2b. The scoped M9 dev session (TLS 1.3, protocol v1, dev-only grants)
with OpenSSL (ADR-0090): bounded DATAGRAM and reliable-stream channels with exact CA
pinning (`evo_network_quic`, M10.2b); loss/head-of-line measurements follow in M10.2c. The scoped M9 dev session (TLS 1.3, protocol v1, dev-only grants)
is specified in [DEV_SESSION_PROTOCOL](../networking/DEV_SESSION_PROTOCOL.md) and
ADR-0082. M0 has no networking. Steam distribution follows later through
an identity-provider adapter; core account IDs are independent of Steam IDs.
+33
View File
@@ -4039,3 +4039,36 @@ explicitly). Security finding recorded in ADR-0090: OpenSSL's built-in verificat
trusts its default verify paths; exact pinning is 10.2b work.
Not done: bounded channels, impairment relay, loss/HOL measurements, CI integration of
the quic preset, sanitizer builds of msquic, packaging of msquic.dll.
## 2026-10-03 — M10.2b bounded QUIC channels, exact pinning, impairment relay (ADR-0090)
Implemented `evo_network_quic` (Endpoint, MessageReassembler, framing),
`evo_network_impair` (UdpRelay) and `evo-quic-transport-tests` (label `quic`).
Tests: framing with 2,000 random-length messages under random chunking, oversized
frame refusal, empty messages; 100 ordered messages each way, datagrams each way, local
size limits, unknown connection, outbound reliable budget (busy), peer protocol
violation closing the connection; exact pinning (attacker CA via `SSL_CERT_FILE`
refused, genuine server still accepted with that environment, wrong name refused);
impairment through the relay (10 % loss, 10 % duplication, 20 % reordering, 5 %
corruption, 5 ms + 0-10 ms jitter both ways): 200/200 messages exactly once in order,
datagrams never duplicated and partly lost (262-290 of 300 across runs); 1,252-byte UDP
path: 1,200-byte datagrams and 1,100-byte messages cross it (6 larger PMTUD probes
dropped); total outage: both sides idle-closed after about 1.3 s (1 s idle timeout);
bounds: newest-wins datagram queue (at most 4 kept), connection cap refusal, reliable
inbound overflow closing as overloaded; 500 random UDP datagrams at the listener produce
no events and a genuine client still connects; clean local/peer close.
Found and fixed during development: a possible deadlock (msquic calls under our lock;
callbacks can run inline), OpenSSL's issuer lookup failing a genuine server when another
same-named CA was in `SSL_CERT_FILE` (owned pin made authoritative), msquic's 1,288-byte
default MTU exceeding a 1,280-byte path (MinimumMtu 1280), a flaky coverage assertion
(2 % corruption could produce none), two test bugs found by UBSan/assertions, Windows
`NOMINMAX`/`<array>` portability, and clang-tidy findings.
Executed: Linux GCC 14 preset `quic` CTest 3/3 and transport tests 5/5 repeated runs;
Clang 19 ASan/UBSan (Debug, leak detection) transport tests; clang-tidy on endpoint,
relay and tests; format check; Windows MSVC 19.44 preset `quic` 3/3 and transport tests
5/5 repeated runs.
Not done: loss/head-of-line measurements and TCP comparison (10.2c), msquic itself under
sanitizers, CI integration of the quic preset, integration into the region host/client.