Skip to content

confirm: RecentCreates overlay; one idx batch; snapshot-drain writeq - #133

Merged
reardencode merged 4 commits into
masterfrom
confirm/recent-overlay
Aug 18, 2026
Merged

confirm: RecentCreates overlay; one idx batch; snapshot-drain writeq#133
reardencode merged 4 commits into
masterfrom
confirm/recent-overlay

Conversation

@rearden-grok

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

Copy link
Copy Markdown
Contributor

Why

#131 deferred the RecentCreates snapshot clone (good) but get/snapshot only read ArcSwap. Concurrent load stamp missed just-noted creates → leftover_n p50=22k, leftover_ms 1.5s, pin_txid% 48, writeq starved, ~11.9k tx/s vs #129’s ~14.5k in/s.

What

  1. Dirty overlay + tombstones — stamp sees unflushed notes without cloning the 124MiB live map. publish_if_dirty remains the only full clone.
  2. One tx_body_range_batch per write — not per height. recent_pub=(idx= clone=).
  3. Snapshot-drain writeq — merge everything already queued (20/20), one flush_class_c_tip. Safe only after the overlay.
  4. class_c_join=class_c_commit wall minus tables (SH join / flush). Names the leftover ~1.9s other=.

Test

cargo test -p rbitcoin-query recent_creates
cargo test -p rbitcoin-query stamp_hits_recent_creates
cargo test -p rbitcoin-consensus recent_create
cargo test -p rbitcoin-net format_info_has_stable_tokens
cargo test -p rbitcoin-net thr_stats_all_stages_and_note_wire_prefer

Do not merge unless asked. After green, restart IBD and check leftover_n → 0, pin_txid% → 100, write other= / class_c_join=.

rearden-grok Bot added 4 commits August 18, 2026 10:32
#131 deferred the 124MiB snapshot clone until write flush, but get and
snapshot only read ArcSwap. Concurrent load stamp missed just-noted
creates and paid leftover TipOnly (~22k keys / 1.5s per window).

Overlay + tombstones make get/snapshot hit those notes without cloning
the live map. publish_if_dirty is still the only full clone.
note_recent_creates_defer was calling tx_body_range_batch per height
(~0.6s of recent_pub). Collect all planned fks, one idx shot, then
note per-height rows. recent_pub= now nests idx= and clone=.
After the RecentCreates overlay, a full-queue merge no longer hides
creates from load stamp. Drain every part already in writeq before
work starts (cap 20 → 20). Scripts see an empty writeq during the
write; one flush_class_c_tip instead of four.
CLASS_C_NS is tables only. The write thread still waits on SH join and
flush_class_c_tip — that residual was ~1.9s of other=. Time wall minus
tables and put class_c_join= on the write inventory.
@reardencode
reardencode merged commit cd6705b into master Aug 18, 2026
13 checks passed
@rearden-grok
rearden-grok Bot deleted the confirm/recent-overlay branch August 18, 2026 19:27
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