This makes the application fully async; freeing web server threads to
handle new connections when waiting on SQL queries.
Additionally sqlx will allow easier move to a different database if
needed in the future.
Includes some SQL optimizations as well (slow queries more easliy identifiable
with sqlx).
- Refactor update_changes_score_volume_and_ranking to use read connections
for read/compute phases, only acquiring write connection for final writes
- Change first_pool_creation to use try_get() for opportunistic caching,
preventing thread exhaustion if write pool is busy
- Add linter to flag blocking _w.get() calls in RPC handlers
Migrate all 32-byte hash fields from TEXT (64-char hex) to BLOB
(32 bytes) for ~50% storage savings on hash columns.
Changes:
- Add src/db/blob.rs with ToBlob/FromBlob traits for hash types
- Update all table schemas to use BLOB for hash columns
- Replace .to_hex() with .to_blob() for DB inserts
- Replace ::from_hex() with ::from_blob() for DB reads
- Use SQL hex() function where API responses need hex strings
- Bump DB_VERSION from 4 to 5
Affected tables: tx, pool, pool_history_entry, utxo_spending,
utxo_funding, user_action, auth_chain_entry, bcmr_data,
bcmr_failure, bcmr_well_known, crc20, crc20_candidates,
delphi_entry, cached_token_metrics
Fixes#1
Introduce a shutdown flag and Rocket fairing that signals background
threads to exit cleanly when Ctrl+C is pressed. Affects the indexing
thread, metrics updater, and block receiver loop.