Not UNLOGGED: an unlogged table is emptied after a crash, and every
proof still inside its window is then accepted once more.
Each proof is one INSERT ... ON CONFLICT (key) DO UPDATE ... WHERE the
existing row has expired, so the key is recorded only if it is absent or
dead, atomically, inside Postgres. Expiry is on the database's clock, so
the nodes' clocks never meet here.
Delete every expired row, and resolve how many went. Nothing breaks if
you never call it, except that the table grows by one row per accepted
request. Once a minute is plenty: a row is dead maxProofAge plus six
seconds after it was written.
A replay store shared by every process connected to one Postgres.
Create the table once, the way you create your others:
Not
UNLOGGED: an unlogged table is emptied after a crash, and every proof still inside its window is then accepted once more.Each proof is one
INSERT ... ON CONFLICT (key) DO UPDATE ... WHEREthe existing row has expired, so the key is recorded only if it is absent or dead, atomically, inside Postgres. Expiry is on the database's clock, so the nodes' clocks never meet here.Expired rows stay until PostgresReplayStore.deleteExpired removes them. Antlion starts no timers, so schedule it yourself.