ibd: cut pre-milestone CPU (fence Arc, densify watermark, v2 decode, MTP ring) - #245
Merged
Conversation
added 7 commits
August 25, 2026 13:21
Leftover TipOnly cloned O(blocks) runs on every get_fk_by_txid_batch. runs is Arc; clone is pointer-sized. extend/pop COW via make_mut so a live leftover snapshot does not block fence updates.
collect_height_band restarted at path_lo every assign tick (up to 65k heights). Advance densify_scan_lo over claim-ready / inflight / archived; pending is still walked so zombies demote. Tip shrink resets.
BIP324 plaintext is command+payload. Hashing a synthetic checksum and rebuilding a v1 frame ran sha256d twice plus a 4 MB copy per block. Dispatch Decodable on the payload; checksum is unused zeros.
Sequential confirm re-read 11 headers for every MTP. Push timestamp on height_fence_extend; pop rebuilds from confirmed. Historical and cold-ring heights keep the 11-read path.
Fence snapshot is Arc, densify skips the BQ-ready prefix, v2 decode skips checksum reframe, and tip MTP is an 11-slot ring. ibd-memory and CHANGELOG note the same.
v2 decode no longer hashes or verifies a checksum. The leftover field failed -D warnings on production builds.
rearden-grok
Bot
force-pushed
the
ibd/algo-cpu
branch
from
August 25, 2026 20:23
1129b4d to
d42a91c
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.
Why
Default mainnet IBD (
--milestone 840000) skips scripts and mempool relay. algo-review still had four CPU cliffs on that path:What
HeightFenceruns areArc; leftover snapshot is O(1); extend/pop COW.densify_scan_loskips BQ-ready / inflight / archived prefix. Pending is still walked so zombies demote. Tip-hole cover unchanged.parse_v2_contentsdoes not sha256d.FramedMessage::decodeis command+payload (checksum unused zeros).Closes algo-review P7, P8, P10, P16 in the same PR. Soft densify remains request-limited only. No store lock across leftover IO. No uring flatten.
Test plan
cargo test -p rbitcoin-store --lib height_fencecargo test -p rbitcoin-net --lib densify_/codec/v2cargo test -p rbitcoin-consensus --lib median_time_past