Repository navigation
esplora: paged history, summary fields, and tx JSON - #861
Merged
Merged
Conversation
Contributor
Author
There was a problem hiding this comment.
Review finding:
The new tx_position lookup loads the complete transaction-FK list for each distinct block height in a summary page via block_tx_fks, then linearly searches it. A 25-row page can therefore add up to 25 random on-disk list reads and allocate/scan each whole block list, even though each row needs only one transaction's position. Please add a position lookup that addresses the needed transaction directly, or otherwise bound and measure this extra IO for summary requests.
rearden-grok
Bot
force-pushed
the
esplora/nullcount-http
branch
from
October 3, 2026 00:02
275f68a to
d95027d
Compare
A live Esplora page built the unpaged scripthash join, so any script over --max-sh-creates returned 503 on /txs, /txs/chain, and /txs/summary. Skip that join only when the cap would refuse it, and still fill the last-1 slot when the script is under the cap. /txs/summary rows now include tx_position, and ?asof= is accepted on that route. The page stays 25 rows. Tx JSON omits an empty witness and emits inner redeem/witness scripts only for the prevout type. /block/:hash/txs/:start at or past the last tx is 404. Fixes #850, #852, #856, and #857.
The node journey still expected an empty 200 page one past the last tx. electrs and the handler return 404.
A summary page loaded each block's full transaction-fk list to find one index. Class A membership is a contiguous (first, count) span, so the index is an offset and the page keeps one span per height.
rearden-grok
Bot
force-pushed
the
esplora/nullcount-http
branch
from
October 3, 2026 00:21
d95027d to
0a03404
Compare
This was referenced Oct 4, 2026
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
Fixes the Esplora HTTP defects in #850, #852, #856, and #857.
/txs,/txs/chain, and/txs/summaryare served when a script has more creates than--max-sh-creates. The full join (and the last-1 slot) is still built when the script is under the cap, so wallet reuse is unchanged. Unpaged stats and/utxostill return 503./txs/summaryrows includetx_position(the tx's index in its block).?asof=is accepted on/txs/summaryand/txs/summary/:last, which COMPAT.md already documented. The page size stays 25, matching COMPAT.md; mempool.space's unpaged full history is left unchanged.witness.inner_redeemscript_asmis only the P2SH redeem script.inner_witnessscript_asmis a P2WSH witness script (including P2SH-P2WSH) or a Taproot script-path leaf (annex stripped). A key-path spend and an unknown prevout emit neither inner field.GET /block/:hash/txs/:startat or past the last tx returns 404start index out of range. A start that is not a multiple of 25 stays 400.Test plan
cargo test -p rbitcoin-query --lib sh_history_capscargo test -p rbitcoin-esplora --lib esplora_sh_join_and_templatecargo test -p rbitcoin-esplora --lib esplora_tcp_wallet_mempool_and_replacecargo test -p rbitcoin-esplora --lib vin_inner_scripts_follow_prevout_typecargo test -p rbitcoin-esplora --lib block_txs_past_end_is_not_foundcargo clippy -p rbitcoin-esplora -p rbitcoin-query --all-targets -- -D warnings