List every active TokenToken pool (no pair filter) so the frontend can
present the set of pooled token pairs without probing each candidate pair.
Mirrors db_active_pools_for_pair minus the pair WHERE clause; served at a
distinct /pools path (the param'd /pool/active already matches param-less
requests via its Option guards, so reusing it would collide).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes the indexer crash on chipnet: bitcoincash 0.32.1's
Opcode::classify panicked on BCH re-enabled opcodes (e.g. OP_SPLIT),
which riftenlabs-defi hit while parsing input scriptSigs in
parse_cauldrons_from_tx. bitcoincash 0.32.2 makes classify total and
panic-free (and adds the May 2026 upgrade opcodes); riftenlabs-defi
0.4.1 additionally hardens read_push_from_script to not classify
non-push opcodes at all.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Migrate off the deprecated bitcoincash 0.29 API (Amount/Version types,
FromHex -> FromStr/parse, non-exhaustive Network) across the indexer and
tests.
Add indexing of native token-A <-> token-B (TokenToken) AMM pools:
- tokentoken_pool / tokentoken_pool_history_entry tables in cauldron.db,
created via an always-run idempotent migration (no DB_VERSION bump, so
existing databases upgrade in place)
- block-path indexing sharing the cauldron write transaction and reorg
undo, with creation/swap/withdrawal state tracking and reserve deltas
- mempool indexing: electrum mempool.get filters on the tokentoken
contract code (spends) and the CONJURE op_return hint (creations);
first_seen_timestamp reconciles with mtp on confirmation
- RPC endpoints /tokentoken/pool/active (pair lookup, order-insensitive)
and /tokentoken/tokens
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
According to BCMR spec, if bare domains are un op_return, we should look
up "well known" path for the domain.
Fallback to previous behaviour if well known is not found.
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).
The previous commit tried to query bcmr_data table from the crc20
database connection, but bcmr_data exists only in the bcmr database.
Fix by introducing STATE_SKIP_HAS_BCMR to mark tokens that have BCMR
data. The CRC20 fetcher now queries the bcmr database separately to
find candidates with BCMR data, marks them in the crc20 database, and
skips them in future iterations.
- 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