Skip to content

ibd: skip empty-lag store reseed while the work path is live - #314

Merged
reardencode merged 1 commit into
masterfrom
ibd/empty-lag-reseed
Sep 3, 2026
Merged

ibd: skip empty-lag store reseed while the work path is live#314
reardencode merged 1 commit into
masterfrom
ibd/empty-lag-reseed

Conversation

@rearden-grok

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

Copy link
Copy Markdown
Contributor

Why

Latest mainnet IBD (mainnet.log, 2026-09-03 01:28–02:34) logged ~1800
WARN ibd: empty headers but lag=870…940 lines, about one every 2s, while
confirm ran tip 901k → 953k.

Those WARNs are not the cost. The same cadence calls
seed_work_path_from_storeresume_work_path_after_tip, which scans every
header in the store
(~1M). The matching resume seed walk lines were:

  • 1836 walks
  • 480ms at tip 901k, 1.15s at tip 953k
  • ordered already 12k–64k
  • known≈965240 stuck the whole hour (lag stayed ~870–940)

That is ~15–30 minutes of IBD-thread time spent rebuilding a path we already
held. Empty getheaders while peers advertise ahead is expected (locator at
header HWM / peer LastBlock skew). Re-ask is cheap; the store walk is not.

Change

  • Reseed only when ordered_set is empty (no locator tips).
  • Keep the existing re-getheaders cadence (every 8 empties).
  • WARN only if the path is empty; otherwise trace.

Test

ibd::exit::tests::empty_headers_lag_rate_limits now pins: live ordered path
never reseeds at streak 1/64/128; empty path still reseeds at 1 and 64.

Empty getheaders while peers advertise ahead kept calling
seed_work_path_from_store (full header-graph walk, ~0.5–1.2s) every 64
empties. Latter mainnet IBD did that ~1800 times in an hour while
ordered already held 12k–64k hashes.

Reseed only when ordered is empty. Keep re-getheaders. Drop the WARN to
trace unless the path is empty.
@reardencode
reardencode merged commit 2855014 into master Sep 3, 2026
13 checks passed
@rearden-grok
rearden-grok Bot deleted the ibd/empty-lag-reseed branch September 4, 2026 15:09
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