$temp_file is only created when curl is invoked with -o (the -o loop
above), but the post-success null/error check always ran `cat "$temp_file"`.
When a caller omits -o (e.g. check-health.sh's Cosmos reference RPC), the
variable is empty, so bash executed `cat ""` and printed
"cat: '': No such file or directory" — once per show-status run.
In that no-o case the body is already captured in $output, so read the
response from $output when $temp_file is unset, and from $temp_file when
it exists. Behaviour with -o is unchanged; the result==null / JSON-RPC
error skip-to-next-URL fallback is preserved in both paths.
Co-Authored-By: Claude <noreply@anthropic.com>
Match the dRPC gateway's per-chain "how many blocks behind is ok" model instead of a
fixed 2s/5s timestamp tolerance:
- check-health.sh: compare the reference head vs local head by BLOCK NUMBER and classify
with the chain's dRPC lag thresholds (LAGGING_LAG/SYNCING_LAG, in blocks, from
chains.yaml). dRPC uses the two thresholds inconsistently across chains (sometimes
lagging<syncing, sometimes the reverse) so the smaller is the online boundary and the
larger the syncing/drop boundary. Defaults 2/6 when a chain has no thresholds.
- multicurl.sh: also skip responses with result:null (a lagging endpoint lacking the
requested block) so the fallback reference URLs are actually tried. Previously the first
endpoint's {"result":null} was accepted as success -> fallbacks never ran, and the null
reference hash made check-health report false "forked" (the online/forked flapping).
- sync-status.sh: resolve the lag thresholds (by drpc slug or chain id) and export
LAGGING_LAG/SYNCING_LAG.
- reference-rpc-endpoint.sh: add --lags and --block-time-ms lookups.
- reference-rpc-endpoint.json: regenerated with per-chain block_time_ms + lagging_lag +
syncing_lag (additive).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>