Skip to content

store: schema 25 txstat.body 8 B/create ULEB - #659

Open
rearden-grok[bot] wants to merge 2 commits into
store/inwit-prunefrom
store/txfixed
Open

rearden-grok[bot] wants to merge 2 commits into
store/inwit-prunefrom
store/txfixed

Conversation

@rearden-grok

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

Copy link
Copy Markdown
Contributor

Summary

Schema 25 dense txstat.body (8 B/create canonical ULEB) stacked on #654 (store/inwit-prune). Occupied 24 zero-extends the file; txout.body is not rewritten. Unreleased leftover txfixed.body is unlinked.

  • Confirm stamps n_in / fee_sat / base / wit_extra. Size and weight are derived (size = base + wit_extra, weight = 4×base + wit_extra). No sigops field. Overflow remaining-bytes live in per-header txstat.ovf + txstat.blk (not a global fk map).
  • New LAYOUT17 writes set bit 4 and omit the n_in uleb; leftover 24 rows still decode. Overlay reads n_in from the first ULEB even when the cell needs a tail.
  • getblockstats reads stamped rows (no inwit reconstruct). JSON keeps utxo_increase as outs − ins and omits Core coins-DB utxo_size_* / utxo_increase_actual.
  • Pruned Esplora /tx keeps empty vin; stamped txstat fills fee / size / weight (no sigops). Named disk ~11.3 GiB, not process-resident.

Test plan

  • cargo test -p rbitcoin-store --lib txstat
  • cargo test -p rbitcoin-store --lib open_schema24_occupied_creates_zero_txstat
  • cargo test -p rbitcoin-store --lib -- --skip sp_tweaks --skip pool_rmw
  • cargo test -p rbitcoin-rpc --lib getblockstats_uses_txstat
  • cargo test -p rbitcoin-rpc --lib getblockstats_reconstructs_when_txstat_unstamped
  • cargo test -p rbitcoin-esplora --lib pruned_tx_json_has_fee_from_txstat
  • cargo test -p rbitcoin-consensus --lib confirm_write_stamps_txstat
  • cargo test -p rbitcoin-query --lib stamp_txstat_from_block
  • cargo test -p rbitcoin-query --lib txstat_row_merges_overflow
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • ./scripts/ast-grep.sh
  • required CI

Do not merge unless asked.

Comment thread crates/rbitcoin-esplora/src/tx_json.rs Fixed
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Fixed
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Dismissed
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Dismissed
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Dismissed
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Dismissed
Comment thread crates/rbitcoin-store/src/tx_table/tests.rs Dismissed
@rearden-grok rearden-grok Bot changed the title store: schema 25 txfixed.body 16 B/create store: schema 25 txstat.body 8 B/create ULEB Sep 20, 2026
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Dismissed
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Dismissed
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Dismissed
Replace packing n_in into txout leftover with a dense 8 B/create
txstat cell (fee/size/weight/n_in/sigops). Class A append publishes
txstat.body with txid.body; leftover 24 B occupied rows still decode.
Confirm, reconstruct, getblockstats, and pruned esplora JSON read the
cells. Leftover txfixed.body is unlinked.

Co-authored-by: Cursor <cursoragent@cursor.com>
txstat truncate left repair_class_a_count_skew at CRAP 31.9. Target
count, stem ends, truncate, and align-check are separate fns.

Co-authored-by: Cursor <cursoragent@cursor.com>
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