Skip to content

ibd: densify download by recent speed, not request age - #306

Closed
rearden-grok[bot] wants to merge 7 commits into
masterfrom
ibd/densify-download
Closed

ibd: densify download by recent speed, not request age#306
rearden-grok[bot] wants to merge 7 commits into
masterfrom
ibd/densify-download

Conversation

@rearden-grok

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

Copy link
Copy Markdown
Contributor

Summary

  • Unique getdata is no longer glued to hung or relatively-slow peers: tip-hole drops at most one owner of a hash when a sibling is pulling (never a 6s whole-set abort), and densify steals only when the owner has no stream rx for ~30s and a faster peer has a slot.
  • New densify work is issued by recent-window bps rank. Default cap stays 8; 16 only if recent bps ≥ 2× pack median; hole>0 still drips 2. A tight slow pack (local bottleneck) keeps its getdata.
  • Ranking and relative-slow use a ~60s complete-block window; lifetime speed_sample remains for AddrMan on disconnect.

Test plan

  • cargo test -p rbitcoin-net --lib cover_tip_holes
  • cargo test -p rbitcoin-net --lib densify_
  • cargo test -p rbitcoin-net --lib relative_slow
  • Required GitHub Actions green (fmt, deny, clippy, ast-grep, test, windows, macos, multinode, coverage)

Made with Cursor

rbitcoin-grok and others added 7 commits August 29, 2026 14:54
Request age no longer clears every racer. Drop at most one owner of a
hole when a sibling has stream rx or that owner is a half-median
outlier among owners, so a slow local pipe can finish the block.

Co-authored-by: Cursor <cursoragent@cursor.com>
Single-peer densify hashes with no stream rx for 30s move to a faster
peer with a free slot. Slow-but-steady downloads stay put; a hung hash
with no slot rewinds densify_scan_lo.

Co-authored-by: Cursor <cursoragent@cursor.com>
New densify hashes follow the same speed rank as tip-hole cover instead
of assign_rot round-robin, so unique work lands on pack leaders first.
Slow peers still take leftover slots.

Co-authored-by: Cursor <cursoragent@cursor.com>
collect_height_band must not run (and must not advance densify_scan_lo)
when no alive peer has a densify slot, even if cfg.window still has room.

Co-authored-by: Cursor <cursoragent@cursor.com>
Lifetime speed_sample stays for AddrMan on disconnect. Ranking and
relative-slow disconnect use complete-block bytes over up to ~60s so a
historically-fast idle peer no longer hoards unique getdata.

Co-authored-by: Cursor <cursoragent@cursor.com>
Default densify cap stays 8 (2 while a tip hole is open). A peer gets
the full 16 only when recent bps is at least twice the pack median and
the pack is not a tight cluster, so slow peers cannot hoard unique hashes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Operator docs: no wall-clock whole-set abort; default densify 8, full
16 only for a 2×-median outlier. Assign pins that densify past fetched
take the same env lock as the assign-stop test so parallel cargo test
does not clip the band.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rearden-grok

rearden-grok Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by ibd/peer-rate-ewma: same assign/densify policy (no 6s whole-set abort, hung densify steal, speed-rank, skip walk, 2×-median extra slots) but one per-peer EWMA of all received bytes while block getdata is in flight, instead of the 60s complete-block window + last_rx_progress_ms. Closing this PR without merge.

@rearden-grok

rearden-grok Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Closing without merge; work continues on ibd/peer-rate-ewma.

@rearden-grok rearden-grok Bot closed this Aug 30, 2026
@rearden-grok rearden-grok Bot mentioned this pull request Aug 30, 2026
3 tasks
@rearden-grok

rearden-grok Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #308 (ibd/peer-rate-ewma).

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.

0 participants