Skip to content

confirm: IBD stamp plans from wire without TxApply - #262

Merged
reardencode merged 4 commits into
masterfrom
confirm/wire-plan-batch
Aug 26, 2026
Merged

confirm: IBD stamp plans from wire without TxApply#262
reardencode merged 4 commits into
masterfrom
confirm/wire-plan-batch

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

IBD stamp no longer clones every script_sig / witness into TxApply just to throw packed ins away after plan.

  • archive_plan_batch_from_wire walks Block + structure txids, stamps SpendEdges and CreatePin, leaves packed ins empty. from_store still drains TxApply for query tests. Shared finish_archive_plan.
  • wire_lookup_phase / one-shot load filter by header_fk and call the wire planner. prepare_block_for_archive stays for standalone archive / resume.
  • Pin plan=Some requires SpendEdges (no packed-ins fallback that silently skipped spends).
  • retain_headers_needing_body missing first fk is Corrupt (algo-review Q-M1).

Write still encodes Class A ins from Arc<Block> + SpendEdges. CreatePin outs stay stamp-time for in-flight.

Independent of query/recent-creates-cow.

Test plan

  • cargo test -p rbitcoin-query --lib archive::
  • cargo test -p rbitcoin-consensus --lib write_idempotent
  • cargo test -p rbitcoin-consensus --lib bq_resolve
  • cargo test -p rbitcoin-consensus --lib stamp_uses_caller_pres

rbitcoin-grok added 4 commits August 25, 2026 19:17
IBD stamp cloned every script_sig/witness into TxApply, then discarded
packed ins. archive_plan_batch_from_wire walks Block + txids, stamps
SpendEdges and CreatePin, and leaves packed ins empty. from_store still
drains TxApply for query tests. One finish_archive_plan stamps both.
wire_lookup_phase and one-shot load put header rows, filter by
header_fk, and call archive_plan_batch_from_wire. Packed ins start
empty so the post-plan clear is gone. CreatePin outs still match
wire script_pubkey. Standalone prepare_block_for_archive is unchanged.
Empty edges with planned fks used to walk packed ins (often empty after
wire plan) and silently skip spends. Pin now Corrupt. Tests that still
build packed ins fill edges from those records.
unwrap_or(0) kept the wrong planned span when per_header_ranges first
fk was absent. That is an invariant miss, not a default start index.
Closes algo-review Q-M1.
@rearden-grok
rearden-grok Bot force-pushed the confirm/wire-plan-batch branch from 8f90828 to a394f0a Compare August 26, 2026 02:17
@reardencode
reardencode merged commit ef22961 into master Aug 26, 2026
13 checks passed
@rearden-grok
rearden-grok Bot deleted the confirm/wire-plan-batch branch August 26, 2026 03:18
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