The Statistics Worker continuously aggregates indexed data into rollup tables — daily transaction counts, active addresses, gas price trends, token activity — that power the explorer’s charts and homepage counters without expensive on-the-fly queries.
What It Aggregates
- Daily rollups — transactions, blocks, gas used, new addresses per day
- Counters — total transactions, total addresses, total contracts
- Token metrics — holder counts and transfer volumes per token
- Network trends — average block time and gas price series for charts
How It Runs
The worker processes newly finalized blocks on a schedule, writing aggregates into dedicated tables. It checkpoints its progress, so restarts resume exactly where they stopped. Aggregates trail the chain head by the same confirmation depth as the indexer.
Operating Notes
- Safe to restart — no state lives in the worker itself.
- If it falls behind, charts and homepage counters go stale while core pages (blocks, transactions, addresses) remain current. Check its lag metric in Monitoring.
- After a reindex, let the worker re-aggregate the rebuilt range before judging chart accuracy.
Failure Symptoms
| Symptom | Cause |
|---|---|
| Homepage counters frozen | Worker down or behind — check logs and lag metric |
| Charts stop at a past date | Aggregation stalled at a failed range; restart the worker |
| Gaps in historical charts | Reindex or migration in progress — wait for catch-up |