Continuous ledger self-consistency
Your task
Design a continuous self-consistency checker for a high-volume double-entry ledger that proves, on an ongoing basis, that the ledger's own invariants hold: every transaction's debits equal its credits, the sum of all balances across each currency is zero (or equals the expected float), and no balance violates its floor. ~30M postings/day. You need to catch a violation within minutes of it being introduced (a bug in a new code path), pinpoint the offending transaction, and do this without locking or scanning the entire ledger every time. How do you build it?
It covers
- Self consistency
- Invariants
- Continuous