Serve lean: txid.body identity, SH join fks, mempool UTXO overlay - #168
Merged
Conversation
Merkle proofs, Esplora /txids, and Electrum id_from_pos only need create identity. TxTable::get decoded every output. Consecutive header_txs use body_txid_range. Co-authored-by: Cursor <cursoragent@cursor.com>
Esplora /txs and WS block-transactions already have create/spender fks from the SH join. Re-probing tx.head per page item was the leftover megakey gap after /utxo. Co-authored-by: Cursor <cursoragent@cursor.com>
scripthash_history_filtered already documented this. Spend height is at least create height, so future creates cannot contribute to the window. Co-authored-by: Cursor <cursoragent@cursor.com>
Esplora tx JSON and RPC gettxout only need the parent output. TxTable::get_full zipped inwit on every prevout. Stored txid comes from txid.body. Co-authored-by: Cursor <cursoragent@cursor.com>
The prevout commit staged an empty workspace lock via git add -A. Co-authored-by: Cursor <cursoragent@cursor.com>
/txs, /tx/*, merkle, outspends, and block tx lists share spawn_join with /utxo. Tip, hash, and fee-estimates stay on the worker. Co-authored-by: Cursor <cursoragent@cursor.com>
v0/v2 share the archived prev_txid cache. getblockstats parent prevouts use create_fk outs, not per-input tx.head. Co-authored-by: Cursor <cursoragent@cursor.com>
Status, merkle, and outspend existence use tx_fk_by_txid. Spend txid is txid.body; vin is the annotated index. Merkleblock is header + txid.body leaves, not reconstruct_archived_block. Co-authored-by: Cursor <cursoragent@cursor.com>
SH listunspent already has the create fk. Coinbase is whether that fk is first in the block's header_txs range — no packed inwit zip. Co-authored-by: Cursor <cursoragent@cursor.com>
Shared helper funds from mempool SH index and drops mempool-spent confirmed coins. Esplora mempool_stats uses the same loops. JSON for NULL-fk rows is unconfirmed with no block_*. Co-authored-by: Cursor <cursoragent@cursor.com>
Header push already ran on TipNotify. Clients that only subscribe to hashes missed confirmed history until a mempool announce. Window the new height, then send full status. Co-authored-by: Cursor <cursoragent@cursor.com>
COMPAT/OPERATOR match txid.body listings, SH join fks on /txs, and Electrum subscribe restatus on confirming tip. 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
getblockverbosity 1, outspend spend txid) readtxid.body/tx_fk_by_txidinstead of packedtxoutor full reconstruct./txskeeps SH join fks; historyto_heightskips Class A expand for later creates; parent prevouts are outs-only; merkleblock is header + txid leaves./utxoandmempool_statsmatch Electrum listunspent (shared helper). Electrum scripthash subscribe restatuses on confirming tip.scantxoutsetcoinbase is firstheader_txsfk.Test plan
cargo test -p rbitcoin-query --lib scripthash_historycargo test -p rbitcoin-esplora --libcargo test -p rbitcoin-electrum --lib scripthash_subscribe/listunspentcargo test -p rbitcoin-rpc gettxout/scantxoutset/getblockMade with Cursor