Storage Adapter Interface
Vorliq now has a storage adapter interface for future scalability work. Production still uses hardened JSON storage. This interface is preparation only and does not switch runtime storage to PostgreSQL.
Audit Summary
- JSON storage currently owns canonical chain history, pending transactions, lending, exchange, governance, treasury, profiles, forum, registry, faucet, price discovery, achievements, peers, backups, and derived index files.
- The shadow migration already proves copied JSON state can be imported into a guarded PostgreSQL schema, counted, checked for latest block hash parity, checked for transaction ID parity, checked for balance parity, scanned for secret-like text, and cleaned up without modifying production JSON.
- The adapter layer should eventually own domain load and save operations, health metadata, backend selection, and parity-safe reads while preserving the existing public API behavior.
- The PostgreSQL adapter must stay disabled in production because cutover has not been rehearsed against live data, rollback still depends on JSON backups, and an accidental database runtime could diverge from
chain.json. - Before any future cutover, counts, chain height, latest block hash, block hashes by index, confirmed and pending transaction IDs, balances, public API responses, audit exports, readiness gates, backups, and rollback drills must pass repeatedly.
Interface
The Python interface lives under blockchain/storage_adapters/. It defines domain methods for chain, pending transactions, lending, exchange, governance, treasury, profiles, forum, registry, faucet, price discovery, achievements, and health. The JSON adapter wraps the existing hardened Storage class. The PostgreSQL adapter is experimental and shadow-only.
Production Contract
Production readiness must continue to report storage_backend: json, active_storage_adapter: json, postgres_active: false, postgres_adapter_enabled: false, and postgres_write_mode: disabled. No production route should connect to a production PostgreSQL database in this release.