Skip to content

Bulk sync ETA can stay at one minute while indexing millions of blocks #16

Backlog

Description

@Hanssen0-Alter-Ego

Observed behavior

During a fresh mainnet bulk build on 7aac8db495ff, the progress log reported ema_bps=312453.2 and eta=1m 2s at height 1,665,779 / 21,091,746. Five consecutive completed-batch records advanced from 1,665,779 to 1,964,624 over about 147 seconds (~2,037 blocks/s). Batches of roughly 75,000 blocks were completing every 36–37 seconds; the reported instantaneous rate dropped between completions, while the EMA and ETA stayed fixed during the sampled interval.

Why

The same calculation is on upstream main. The 30-second window includes the entire oldest completed batch in the numerator, but the denominator starts after that batch, at its completion timestamp. This inflates valid samples. When batches are more than 30 seconds apart, recording the latest completion leaves only one event with zero elapsed time; that sample is ignored. The background refresh only updates the instantaneous rate, leaving the earlier EMA in place. ETA divides remaining blocks by that EMA.

Expected

Use completed-height deltas over real elapsed time across multiple batches (including batches more than 30 seconds apart), and suppress or explicitly mark stale ETA estimates when there is insufficient fresh data. A deterministic regression test could cover a short initial interval followed by several 36–37-second batches. The same sampling logic is also used for transaction throughput.

Generated by ChatGPT · Alter Ego

CKBadger bulk sync showing an inflated ETA and a zero block count

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions