Files
observer/crates/blackbeard-data
grenadeandClaude Opus 5 813e49c43c
deploy / build (push) Successful in 7m52s
deploy / deploy-api (push) Successful in 18s
deploy / deploy-web (push) Successful in 5s
fix: time a head by when it arrived, not by when we got round to it
The gap-fill guard fixed the coarse half of #14 — Planck went from 0.175 s/block
to 4.9 — and left the rest standing. Measured just now against a real ~30 s on
Planck and ~6 s on Heisenberg:

    quantus     9.59 s     plausible
    planck      4.919 s    six times too fast
    heisenberg  0.052 s    a hundred times too fast

`record` stamped `observed_at` with `Utc::now()`, which runs *after* two RPC
round trips and behind a 64-deep channel. On a remote endpoint those round trips
are hundreds of milliseconds, so heads queue and then drain in a burst — a batch
carrying near-identical observation times while their heights march on.
`measured_interval` divides elapsed time by height difference and reads that as
a chain producing blocks twenty times faster than it does.

`observed_at` means "when this observer saw it", so it is now stamped where the
frame is read off the socket: `subscribe_new_heads` sends a `SeenHead` carrying
that moment and `record` uses it rather than asking the clock again. Every
consumer improves at once, because the same field is the DB row, the ticker's
gap, and the tip sample.

Worth noting what this does *not* need: no threshold, no plausibility check, no
discarding of samples. The measurement was always sound; it was being given the
wrong time.

Refs #14

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 15:09:16 +03:00
..