Verifier topologies
Where the verifier keeps its state decides how many instances can run (Store). This page lays out the topologies, what each needs, and how they fail.
Need |
Topology |
|---|---|
A test host, no database |
One instance, |
One verifier host |
One instance, |
Failover, more instances |
Several instances, |
More writes than one database takes |
Several instances, |
Read load off the writers |
|
One instance
--dbEvery record in one SQLite file. The instance survives a restart with its baselines and clients.
--state-dbThe default when no backend is named. The nonce history, revocations, bans, audit log and decision log are in SQLite; the baselines are in memory. After a restart every client presents as new, and with no enrollment road its first round is refused (Verifier).
One instance has no failover. Its file is its state: back it up with the SQLite tools, from the same host.
Several instances
Every instance runs with --pg-dsn on one Postgres primary, behind a load
balancer that checks GET /health:
hosts --> load balancer --> verifier --+
--> verifier --+--> Postgres primary
--> verifier --+
A client may reach any instance on any round:
a baseline, a revocation or a ban written by one instance holds on all of them;
a nonce used on one is refused as reused on all of them;
GET /api/v1/clientslists the whole fleet on every instance;a host's passing rounds extend one decision-log row, whichever instance serves them: the writer locks the host in the database.
A challenge is held by the instance that sent it, and the report comes back
on the same TLS connection, so the balancer needs no affinity. The values an
instance keeps in memory are its own: lota_pending_challenges, the
counters of /metrics and /api/v1/stats, and monotonic_counter on a
client (Monitoring API).
Give every instance the same build, policy files, --policy-pubkey,
--aik-ca-cert and --aik-crl: the database holds none of them. A
database written by another build is refused at startup
(Protocol versions).
Database
Reach it over TLS,
sslmode=verify-fullin the DSN, with a role of its own.LOTA_PG_DSNkeeps the DSN off the command line.An instance opens up to
--pg-max-open-connsconnections, default 20.max_connectionsmust cover every instance's pool beside the other clients; Postgres ships 100. The verifier warns when its own pool exceedsmax_connectionsor half of it, as the server it connects to reports it.Concurrent rounds commit together, so a wider pool takes a burst of first rounds faster, up to
max_connections.Instances that start together apply the migrations once, under a lock.
Run the database with its own failover. An attesting instance needs the primary: it refuses a hot standby at startup with
database is a read-only standby.
Rolling out
On shutdown an instance closes its attestation listener first. With
--shutdown-drain, /health answers 503 degraded for that long
before the monitoring API stops, so the balancer stops routing to it
(Command line).
Reporting instances
--report-only serves the monitoring API alone, from a database it never
writes, a hot standby or the primary:
lota-verifier --report-only \
--pg-dsn "postgres://lota@pg-replica.example/lota?sslmode=verify-full" \
--http-addr 127.0.0.1:8081
No attestation listener opens;
--addris not needed, and--certonly for a monitoring API off loopback.The schema is checked, never applied. A database at an older version, or with no schema, is refused.
Every admin route answers 503 before the key is read. Reader routes answer as on an attesting instance.
/healthanswers 200 withmodereporting.--policyis ignored, with a warning.
A standby lags the primary by its replication delay, and the reads show that delay.