confirm: homogeneous Class A kind per load/write batch - #267
Merged
Conversation
Lookup may decode a mixed BQ prefix after crash recovery. Loadq chunks must be one kind so stamp never plans a subset of the prepared heights. Co-authored-by: Cursor <cursoragent@cursor.com>
Crash recovery some→none is two meta-batches. Write drain already keeps leftover; mixed polarity must not glue packed onto extra prepared heights. Co-authored-by: Cursor <cursoragent@cursor.com>
Prefix-stripping a mixed keep-list left packed/prepared misaligned. A homogeneous batch is either fully at-or-below tip (no-op) or fully above (zip the whole batch). Spanning tip is an invariant break. Co-authored-by: Cursor <cursoragent@cursor.com>
After need-body filter, a proper subset means lookup sent mixed has_body kinds. Fail closed instead of planning some headers and get_list-filling the rest. plan=Some has no hitchhiker rows. Co-authored-by: Cursor <cursoragent@cursor.com>
S3 is two lookup/write batches split at has_body / plan polarity, not one mixed write. Write vs tip is all-or-nothing. 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
Encode-at-write stays a straight zip of packed vs prepared. A crash leftover
some→none(header_txs.has_bodyprefix already archived, suffix still needs Class A) is two homogeneous batches, not one mixed write and not a fill-time skip.LoadBatches at ahas_bodykind change (in addition to 8000-input / 144-block caps).append_contiguousstops whenarchive_planpolarity differs (SomevsNone); leftover is the next meta-batch.Ok([])), all-new (fill the whole batch), orCorrupt("invariant: write batch spans tip")— no prefix strip.need_fksisCorrupt("invariant: confirm batch mixed archived").plan=Someno longer hitchhikesget_listfor already-bodied rows. One-shot mixedconfirm_wire_loadfails closed (call twice).Test plan
cargo test -p rbitcoin-net split_wave_into_load_batches -- --test-threads=1cargo test -p rbitcoin-consensus write_idempotent -- --test-threads=1Made with Cursor