Skip to content

index: seal filters and tweaks as IBD connects them - #800

Merged
reardencode merged 1 commit into
masterfrom
index/ibd-append
Sep 28, 2026
Merged

reardencode merged 1 commit into
masterfrom
index/ibd-append

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When --block-filter-index or --sp-tweaks is on before a block is connected, the confirm write thread appends that index after confirmed[h] is set. Filters and tweaks are assembled from the wire block and the batch's parent pins, one height per scripts-pool claim.
  • A crash gap of at most one index window is filled with read_index_window, then the new batch is appended. A larger gap is left alone during IBD. rbtc-idx-wb still runs at tip entry only when a watermark is behind the tip, and NODE_COMPACT_FILTERS is advertised immediately when filters already cover the tip.
  • ibd: perf records idx_asm= on the scripts stage and idx_put= on the write stage. tip: accept bf= stays the sum of those two.

Test plan

  • Three heights in one confirm batch (same-batch spend, same-block spend, one P2TR output) match basic_filter_from_window / tweak_records_from_window, and both watermarks sit at the tip.
  • A watermark at 0 and a batch whose first height is past one window does not advance the watermark.
  • A one-window gap of already-confirmed heights is sealed by the write path, then the new batch appends.
  • A tip whose watermark is already behind still fills through build_indexes_released.
  • Host IBD with both indexes on from the start: idx_asm= and idx_put= show up, and there is no post-sync index: build from 0.

Made with Cursor

Indexes enabled before a block is connected append on the confirm write
thread. Startup seals a restart gap of at most one write drain with the
same window reader; a larger gap still materializes after catch-up.

Both paths share one filter-script rule, one height wave, and one commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@reardencode
reardencode merged commit 0c041c7 into master Sep 28, 2026
18 checks passed
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