Skip to content

esplora: UTXO status from SH join (no per-coin tx.head) - #165

Merged
reardencode merged 4 commits into
masterfrom
esplora/utxo-join-height
Aug 20, 2026
Merged

esplora: UTXO status from SH join (no per-coin tx.head)#165
reardencode merged 4 commits into
masterfrom
esplora/utxo-join-height

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Esplora /address/{addr}/utxo and /scripthash/{hash}/utxo build Blockstream status from join height plus unique headers. No per-coin tx.head / TxTable::get (that second Class A pass was the 4× gap vs /address on megakey scripts).
  • SH join loads txid.body only when the surface needs it: history (creates+spenders), listunspent (creates), balance and chain_stats (none). tx_count is unique create_fk ∪ spender_fk.
  • Address/scripthash stats and UTXO handlers run on spawn_blocking like /block.

Test plan

  • cargo test -p rbitcoin-esplora (utxo_list_json_status_from_join_height_without_tx_head, remaining_routes_fixture)
  • cargo test -p rbitcoin-query --lib (scripthash_join_includes_spend_and_keeps_sibling_utxo, sh_join_need_display)
  • Required Actions: fmt / deny / clippy / test / multinode / coverage

Operator confirm (not a CI gate): on the host that saw ~1m24s /utxo vs ~21.5s /address, --log-level debug --api-log — both sh_join class_a_us similar; /utxo wall_ms near the join.

Made with Cursor

rearden-grok Bot and others added 4 commits August 20, 2026 08:37
The SH join already has txid, vout, value, and height. Per-coin tx.head
plus TxTable::get was a second Class A pass on megakey live sets.
Unique-height headers fill block_hash/block_time. SH joins run on
spawn_blocking like /block.

Co-authored-by: Cursor <cursoragent@cursor.com>
History still needs spender txids. Balance and listunspent only need
spentness, so megakey joins skip spender txid.body. sh_join logs need=.

Co-authored-by: Cursor <cursoragent@cursor.com>
tx_count is unique touching txs. Fks already identify those rows, so
/address skips create and spender txid.body on the shared join.

Co-authored-by: Cursor <cursoragent@cursor.com>
Operator debug sh_join now includes need=. Identity sidefile IO is
optional per surface (history vs listunspent vs balance/stats).

Co-authored-by: Cursor <cursoragent@cursor.com>
@reardencode
reardencode merged commit 2f40d7f into master Aug 20, 2026
13 checks passed
@rearden-grok
rearden-grok Bot deleted the esplora/utxo-join-height branch August 20, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant