esplora: UTXO status from SH join (no per-coin tx.head) - #165
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/address/{addr}/utxoand/scripthash/{hash}/utxobuild Blockstreamstatusfrom join height plus unique headers. No per-cointx.head/TxTable::get(that second Class A pass was the 4× gap vs/addresson megakey scripts).txid.bodyonly when the surface needs it: history (creates+spenders), listunspent (creates), balance and chain_stats (none).tx_countis unique create_fk ∪ spender_fk.spawn_blockinglike/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)fmt/deny/clippy/test/multinode/coverageOperator confirm (not a CI gate): on the host that saw ~1m24s
/utxovs ~21.5s/address,--log-level debug --api-log— bothsh_joinclass_a_ussimilar;/utxowall_msnear the join.Made with Cursor