query: --prune-inwit watermark, NETWORK_LIMITED, Core -8 - #654
Open
rearden-grok[bot] wants to merge 17 commits into
Open
rearden-grok[bot] wants to merge 17 commits into
rearden-grok[bot] wants to merge 17 commits into
Conversation
rearden-grok
Bot
force-pushed
the
net/cjdns
branch
from
September 20, 2026 02:03
f092d40 to
9359caf
Compare
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 20, 2026 02:03
bf82400 to
d0c3969
Compare
5 tasks
rearden-grok
Bot
force-pushed
the
net/cjdns
branch
from
September 20, 2026 21:15
9359caf to
9026ec5
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
net/cjdns
branch
from
September 20, 2026 21:37
9026ec5 to
d09f684
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
net/cjdns
branch
from
September 20, 2026 22:09
d09f684 to
8862500
Compare
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
2 times, most recently
from
September 20, 2026 22:31
badd49c to
0cbf383
Compare
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
3 times, most recently
from
September 22, 2026 03:45
b05b4d7 to
cca1b03
Compare
Wire reconstruct must not look like Corrupt when inwit was dropped on purpose. Query holds a stub pruneheight; rolling segments come next. Co-authored-by: Cursor <cursoragent@cursor.com>
A reorg through pruned inwit cannot rebuild vin from spent alone. Fail closed with StoreError::Pruned and leave the tip in place. Co-authored-by: Cursor <cursoragent@cursor.com>
`--prune-inwit` must survive reopen. File presence is prune mode; u32::MAX means nothing dropped yet. Confirm past 288 heights writes tip-288 so the last BIP159 window stays reconstructable. Co-authored-by: Cursor <cursoragent@cursor.com>
A pruned node is not NETWORK. VERSION, addrv2, and getaddr use the hub flag; getdata maps StoreError::Pruned to notfound instead of disconnect. Co-authored-by: Cursor <cursoragent@cursor.com>
getblock/getrawtransaction/getblockstats use the same -8 message Core prints for pruned data. Electrum transaction.get returns \"pruned\"; Esplora answers 404. Co-authored-by: Cursor <cursoragent@cursor.com>
Kebab CLI / snake conf / NixOS camelCase. Startup sets Query prune mode and PeerHub so IBD from genesis advertises NETWORK_LIMITED before the first 288-height watermark. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Prune mode no longer rewrites historical inwit.loc; recent witness lives in a 288-height RAM window with a byte threshold and store/inwit.window spill, and startup refuses a pruned datadir without --prune-inwit. Co-authored-by: Cursor <cursoragent@cursor.com>
confirm_blocks_run_with_create_pins scored CRAP 31.1 after the RAM-window hook; move that post-tip work to a named helper so coverage-crap stays under 30. Co-authored-by: Cursor <cursoragent@cursor.com>
Load by matching a dirent whose parsed height is the window slot, not by joining the path. Intermediate path-join and dirent-only steps are the same end state. Co-authored-by: Cursor <cursoragent@cursor.com>
open_inwit hit clippy cognitive_complexity 27/25 after prune-inwit branches; loc open and count-skew repair are named seams, not a silent allow. Co-authored-by: Cursor <cursoragent@cursor.com>
Disconnect and a later block at the same height left the old creates
in the fk map, so the 288-height cap no longer bounded RAM. Spill
loads open the pinned {height}.bin path, and a failed unlink of a
dropped spill file is an IO error.
A height read from the store was joined into `{height}.bin` and opened
as-is. Canonicalize the path, then require it to stay under `inwit.window`,
so a symlink cannot be read as witness.
`--prune-inwit-ram-threshold-bytes 0` is a supported mode. Confirm still
writes `inwit.window/{height}.bin`, and the RAM window stays empty so tiny
IBD blocks are not kept in process memory.
Unpruned nodes read inwit.body. Pruned nodes serve the last 288 heights
from inwit.window/{height}.bin plus a RAM cache. A zero RAM cap keeps
nothing in memory. Plan 09, OPERATOR, COMPAT, and the CLI no longer
describe unlinking a rolling inwit stem.
The usage string is a format template. A bare {height} does not compile.
rearden-grok
Bot
force-pushed
the
store/inwit-prune
branch
from
September 22, 2026 16:10
cca1b03 to
3713fce
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
Plan 09. Own store stack on
master. #659 (store/txfixed) sits on this branch.Rebased onto
master(698177c8).Unpruned nodes read
inwit.body.--prune-inwitstops serving witness at or below a height watermark and keeps the last 288 heights asstore/inwit.window/{height}.binplus a RAM cache.{store}/inwit.pruneis a 4-byte LE sidecar. File presence is prune mode;u32::MAXmeans nothing dropped yet. Once the tip is above 288, confirm writespruneheight = tip - 288.StoreError::Prunedat or below the watermark.--prune-inwitadvertisesNETWORK_LIMITED|WITNESS|P2P_V2. getdata maps pruned blocks to notfound. RPC uses Core-8; Electrumtransaction.getreturns"pruned"; Esplora omits thevinkey on pruned txs.--prune-inwit-ram-threshold-bytesdefaults to 256 MiB.0keeps nothing in RAM: every height, including tiny IBD blocks, is read from its file. Disconnect and a re-confirm of the same height drop that height's RAM rows before the new rows are inserted.--prune-inwitis a hard startup error. NixOSpruneInwit. NoSCHEMA_VERSIONbump.Closes #589
Test plan
cargo test -p rbitcoin-query prune_cargo test -p rbitcoin-query prune_ram_threshold_zero_spills_tiny_blockscargo test -p rbitcoin-node prune_inwit_is_kebabDo not merge unless asked.