Add M10.3b session login over QUIC
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 3m13s
Foundation / checks (client) (push) Successful in 12m12s
Foundation / checks (network) (push) Successful in 8m56s
Foundation / checks (tsan) (push) Successful in 7m42s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 19m14s
Foundation / checks (checks) (push) Canceled after 31m28s

Session protocol v1 session messages (Hello with grant, Welcome, Refresh,
RefreshResult, Close with reasons) on the QUIC reliable stream. RegionSessions
verifies grants with the issuer public keys and admits them through SessionControl:
a newer grant closes the account's old connection as superseded, expiry and epoch
advances close sessions, every close is announced and flushed. RegionSessionClient
logs in, refreshes in place and reports why a session ended. ADR-0091.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-03 21:12:00 -04:00
co-authored by Claude Opus 5.5
parent 01b4b06a09
commit 7956143cd8
17 changed files with 1262 additions and 7 deletions
+2 -2
View File
@@ -520,8 +520,8 @@ hardware (10.9). 10.2 split: 10.2a selection, pins and build of msquic/OpenSSL d
(ADR-0090); 10.2b bounded channels, exact CA pinning and the impairment relay done;
10.2c loss/head-of-line measurements done (networking/M10_TRANSPORT_MEASUREMENTS.md).
10.3 split (ADR-0091): 10.3a account ids, ECDSA grants, identity adapter and region
session control done; 10.3b QUIC session handshake and 10.3c durable control lease
follow. 10.4-10.9 planned.
session control done; 10.3b QUIC session login (schemas/network/session-v1.md) done;
10.3c durable control lease follows. 10.4-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
@@ -19,8 +19,10 @@ loss the ordered stream's p95 latency is 3-5.5x the datagram channel's and excee
(networking/M10_TRANSPORT_MEASUREMENTS.md). M10.2 is complete. M10.3a (ADR-0091) adds provider-independent account ids, ECDSA P-256
session grants verified with public keys only, the identity adapter and grant issuer
library, and per-region session control (newest grant wins and replaces the old session,
replay and stale grants refused, in-session refresh, attempt rate limits). Next: M10.3b
QUIC session handshake, then the durable control lease (10.3c).
replay and stale grants refused, in-session refresh, attempt rate limits). M10.3b adds the
session login over QUIC (session-v1: Hello, Welcome, Refresh, Close with reasons) on both
the region and client side, tested end to end on loopback. Next: the durable control
lease (10.3c).
## Previous gate - 2026-10-02
@@ -84,3 +84,22 @@ are later work behind these interfaces.
never logged; revocation (bans) and channel binding are not designed yet.
- Private-key provisioning: `GrantSigningKey::import` takes a raw 32-byte P-256 scalar;
a provisioning tool and secret handling come with the issuer service.
## M10.3b implementation (2026-10-03)
Session protocol v1 session messages ([session-v1](../../schemas/network/session-v1.md)):
Hello (grant), Welcome, Refresh, RefreshResult and Close with a reason, each a fixed-size
message with an `EVSN` header on the QUIC reliable stream.
- **Region side** (`RegionSessions`, src/server/session): owns the QUIC endpoint, the
verifier and SessionControl on the region host's thread. Hello deadline 5 s; region
attempts counted before signature work; a takeover closes the previous connection with
`superseded` before Welcome; grant expiry and epoch advances close sessions; every
close sends Close and then closes the connection after a flush of at most 1 s. A peer
that closes its own connection is reported as `client_closed` (the client's Close can
be discarded by its own immediate close). Connections are bounded by the transport limit
(at least the session limit; the rest is headroom for logins and closes still flushing).
Events carry account log labels only.
- **Client side** (`RegionSessionClient`, src/client/session): sends Hello when the pinned
connection is up and then zeroes its copy of the grant; Welcome deadline 5 s; refresh in
place; any Close, malformed message, deadline or transport loss ends the session.
- Not yet wired into evo-server or the engineering client: they keep the M9 dev path
until the durable control lease (10.3c) exists, so nothing deploys M10 sessions.
+2 -1
View File
@@ -8,7 +8,8 @@ pinning (`evo_network_quic`, M10.2b); loss/head-of-line measurements (M10.2c,
[M10_TRANSPORT_MEASUREMENTS](../networking/M10_TRANSPORT_MEASUREMENTS.md)) confirm
superseding state on DATAGRAMs and reliable actions on the ordered stream. Session
identity and control (ADR-0091, M10.3): ECDSA-signed account-scoped grants
([session-grant-v1](../../schemas/network/session-grant-v1.md)), newest grant wins. The scoped M9 dev session (TLS 1.3, protocol v1, dev-only grants)
([session-grant-v1](../../schemas/network/session-grant-v1.md)), newest grant wins; login over
QUIC per [session-v1](../../schemas/network/session-v1.md). 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.
+29
View File
@@ -4121,3 +4121,32 @@ ASan/UBSan (Debug, leak detection) `evo-network-tests`; clang-tidy 19 on the new
and tests; format check; Windows MSVC 19.44 preset `network` build and CTest 1/1.
Not done: QUIC session handshake (10.3b), durable control lease and serial persistence
across restarts and regions (10.3c), revocation, private-key provisioning tooling.
## 2026-10-03 — M10.3b session login over QUIC (ADR-0091)
Implemented the session-v1 codec (evo_network_protocol), `RegionSessions`
(evo_session_server) and `RegionSessionClient` (evo_session_client); tests
`evo-quic-session-tests` (label `quic`) and codec tests in `evo-network-tests`.
Codec: round trips of every message; every truncation, an extra byte, bad magic, other
version, flags, unknown types and invalid reasons/statuses/zero ids refused.
End to end on loopback QUIC with an injected wall clock: Welcome fields and holder;
replay (`stale_grant`); newer grant superseding the old connection (Close `superseded`);
older unexpired grant refused; refresh accepted, stale and wrong-account refusals with the
session kept; wrong region and stage-signed grant (`wrong_scope`), unknown issuer and a
modified grant (`unauthenticated`); expired grant at login and session expiry closing
only the expired session; client close releasing control; silent peer (`timeout`),
garbage, wrong first message and unknown required feature (`protocol`), other version
(`unsupported_version`); epoch advance (`stale_epoch`) and Welcome with the new epoch;
shutdown; capacity refusal not consuming the grant; region attempt limit.
Found and fixed during development: a connection cap of twice the session limit refused
new logins while refused connections were still flushing their Close (now the transport
limit, which must be at least the session limit).
Executed: Linux GCC 14 preset `quic` build and CTest `-L "quic|network"` 4/4; session
tests 10 consecutive runs 10/10; Clang 19 ASan/UBSan (Debug, leak detection) session and
network tests (msquic itself uninstrumented); clang-tidy 19 on the new sources and tests;
format check; Windows MSVC 19.44 preset `quic` build and CTest 4/4 (binary rebuilt and
timestamp checked).
Not done: wiring into evo-server and the engineering client, the durable control lease
(10.3c), an impairment-relay run of the login path.