Skip to content

fix(store+bridge-monitor): fail-fast on missing blob + sub-50ms histogram buckets#1152

Merged
Flotapponnier merged 2 commits into
devfrom
fix/store-miss-throws
Jul 13, 2026
Merged

fix(store+bridge-monitor): fail-fast on missing blob + sub-50ms histogram buckets#1152
Flotapponnier merged 2 commits into
devfrom
fix/store-miss-throws

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Summary

Two related fixes bundled together on this branch.

1. Spec store miss throws instead of caching (a5eb22e)

Previously, when the materialize store had no blob for a live bench (e.g. bnb-rpc during the awaiting-samples incident), the loader silently cached an empty result and every downstream reader saw a permanent draft state until the cache TTL rolled over. Now the loader throws on miss for live benches, so the ISR regenerator sees the failure, retries, and never poisons the cache with a "no data" sentinel.

2. Bridge-monitor sub-50ms histogram buckets + nanosecond precision (213a2ff)

Buckets grew from `[50, 100, 200, 500, 1000, 2000, 5000, 10000]` to `[10, 25, 50, 100, 200, 500, 1000, 2000, 5000, 10000]`.

Near Intents on solver-cached corridors (HyperCore in particular) returns via the 1Click coordinator fast path in <50ms. The previous scheme lumped every one of those observations into (0, 50] so `histogram_quantile` linearly interpolated to ~25ms regardless of the true value, hiding real bimodality. `/benchmarks/bridge-quote-latency?chain=HyperCore` reported p50 = 30ms which was a bucket floor, not a measurement.

Also swap `Observe(float64(quoteLatency.Milliseconds()))` → `Observe(float64(quoteLatency.Nanoseconds()) / 1e6)` across all 6 per-bridge observers (across, debridge, lifi, mobula, nearintents, relay). Same truncation-to-zero bug class as the RPC harness fix in #1128.

Bench YAML methodology + FAQ updated to match the new bucket set. Container rebuilt + restarted on VPS (`ocb-bridge-monitor`), Prom now emitting `le="10"` and `le="25"` series. 24h until the rolling window is fully populated.

Test plan

  • `go build ./cmd/monitor` on OCB main clean
  • `go vet ./cmd/monitor` clean
  • VPS container rebuilt, `sudo docker logs ocb-bridge-monitor` shows monitoring loop live
  • Prom metrics endpoint confirmed emitting sub-50ms buckets
  • 24h wait for Prom rolling window to flush old-bucket samples
  • Verify `/benchmarks/bridge-quote-latency?chain=HyperCore` shows real sub-50ms p50 for Near Intents

Florent Tapponnier added 2 commits July 13, 2026 19:24
Histogram Buckets grew from [50, 100, 200, 500, 1000, 2000, 5000, 10000]
to [10, 25, 50, 100, 200, 500, 1000, 2000, 5000, 10000]. Near Intents
on solver-cached corridors (HyperCore in particular) returns via a
1Click coordinator fast path in <50ms, and the previous scheme lumped
every one of those observations into (0, 50] so histogram_quantile
linearly interpolated to ~25ms regardless of true value. The p50 shown
on /benchmarks/bridge-quote-latency?chain=HyperCore was therefore a
bucket floor, not a measurement. Sub-50 buckets let the real bimodality
surface.

Also swap Observe(float64(quoteLatency.Milliseconds())) for
Observe(float64(quoteLatency.Nanoseconds()) / 1e6) across all 6
per-bridge observers (across, debridge, lifi, mobula, nearintents,
relay). int64 Milliseconds() truncates every sub-1ms round-trip to 0,
same bug class as the RPC harness fix in PR #1128. Not a hot path here
(network RTT dominates), but keeps precision consistent with the new
low buckets and cheap to fix while we are already touching each file.

Bench YAML methodology + FAQ updated to reflect the new bucket set.
@Flotapponnier
Flotapponnier merged commit 29a4594 into dev Jul 13, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant