-- Record whether a block's `observed_at` is a tip observation. -- -- `RollingWindow::push` has always taken an `at_tip` flag, because the elapsed -- time between importing two *historical* blocks measures the observer catching -- up rather than the network producing — divide difficulty by that and the -- hashrate is wrong by orders of magnitude while still rendering as a number. -- That flag lived only in memory, so nothing in the database distinguished a -- block seen as it was mined from one fetched minutes later by a gap fill, and -- every row in a backfilled batch carries very nearly the same `observed_at`. -- -- Any query that treats `observed_at` as timing data therefore needs this -- column. The chain series does not — it derives block interval from -- `authored_at`, the chain's own clock, which is immune to when we looked — but -- the propagation and withholding signal documented on `BlockObservation` is -- precisely `authored_at` minus `observed_at`, and that difference means -- nothing at all unless the observation was made at the tip. -- -- Existing rows default to false: most of them *were* tip observations, but -- which ones is not recoverable, and false reads as "not known to be" — the -- conservative direction for a flag whose whole job is to stop untrustworthy -- timings being used as if they were measurements. alter table block add column at_tip boolean not null default false;