store: schema 25 txstat.body 8 B/create ULEB - #659
Open
rearden-grok[bot] wants to merge 8 commits into
Open
rearden-grok[bot] wants to merge 8 commits into
rearden-grok[bot] wants to merge 8 commits into
Conversation
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
from
September 20, 2026 16:18
0ffc8ef to
c0612ad
Compare
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 20, 2026 21:15
d34c0f5 to
dcc12d4
Compare
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
from
September 20, 2026 21:15
fe02750 to
b9ad5f3
Compare
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 20, 2026 21:38
dcc12d4 to
11d543b
Compare
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
from
September 20, 2026 21:38
b9ad5f3 to
8129c47
Compare
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 20, 2026 22:09
11d543b to
badd49c
Compare
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
from
September 20, 2026 22:09
8129c47 to
464985c
Compare
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 20, 2026 22:31
badd49c to
0cbf383
Compare
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
from
September 20, 2026 22:31
464985c to
7cd2349
Compare
This was referenced Sep 20, 2026
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 21, 2026 06:23
0cbf383 to
f9d64c3
Compare
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
2 times, most recently
from
September 21, 2026 06:36
c985c60 to
02ce85e
Compare
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 22, 2026 02:56
f9d64c3 to
18de01e
Compare
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
from
September 22, 2026 02:56
02ce85e to
1adda6b
Compare
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
from
September 22, 2026 03:06
1adda6b to
c948ae6
Compare
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 22, 2026 03:45
b05b4d7 to
cca1b03
Compare
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
from
September 22, 2026 03:45
c948ae6 to
3f114e4
Compare
4 tasks
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>
An empty vin array is not the inputs we dropped and is easy to treat as a coinbase. Pruned /tx keeps vout, status, and txstat fee/size/weight, and leaves vin absent.
A placeholder with n_in set and size 0 is a stamped row. getblockstats would report a real zero-size, zero-fee transaction instead of reconstructing or refusing.
The file header and SCHEMA_VERSION constant already say 25. Two body sentences still said 24, and the openable range stopped at 24.
utxo_size_inc, utxo_increase_actual, and utxo_size_inc_actual follow Core v29: serialized output plus 41 bytes of coins-DB overhead. Height 0 and the two BIP30-repeat coinbases stay out of the actual counts. Coinbase stays out of ins, fees, and the size totals, the same way Core's loop does.
The UTXO delta and non-coinbase total_out travel together so stats_from_txstat stays at seven arguments.
utxo_increase_actual is spendable outputs minus non-coinbase inputs (height 0, BIP30-repeat coinbases, and unspendable scripts stay out). utxo_size_inc and utxo_size_inc_actual need coins-database overhead, so they are not returned. Size totals still exclude the coinbase, matching Core.
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 22, 2026 16:10
cca1b03 to
3713fce
Compare
rearden-grok
Bot
force-pushed
the
store/txfixed
branch
from
September 22, 2026 16:10
5770f06 to
512fe02
Compare
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
Schema 25 dense
txstat.body(8 B/create canonical ULEB) stacked on #654 (store/inwit-prune). Occupied schema 24 zero-extends the file;txout.bodyis not rewritten. Unreleased leftovertxfixed.bodyis unlinked.Rebased onto the updated #654, which is on
master(698177c8).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-headertxstat.ovf+txstat.blk.getblockstatsreads stamped rows. Coinbase stays out ofins, fees, and the size totals, matching Core.utxo_increaseis every output minus those inputs.utxo_increase_actualis the same after dropping outputs that do not enter the UTXO set (height 0, the two mainnet BIP30-repeat coinbases, unspendable scripts). Coins-DButxo_size_inc/utxo_size_inc_actualare omitted./txomitsvin. Stampedtxstatfillsfee/size/weightwhenbaseorwit_extrais non-zero. A missing wire transaction leaves the txstat cell unstamped (all-zero), sogetblockstatsreconstructs from the wire body.Test plan
cargo test -p rbitcoin-store --lib txstatcargo test -p rbitcoin-rpc --lib getblockstats_cargo test -p rbitcoin-esplora --lib pruned_tx_jsoncargo test -p rbitcoin-query --lib stamp_txstat_from_blockDo not merge unless asked.