Add per-client bid seen tracking - #824
Merged
Merged
Conversation
Collaborator
|
wow this is huge ! |
barnabasbusa
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Dora tracks and deduplicates execution payload bids (ePBS), but discarded which clients observed each bid on gossip — a major visibility gap. This PR records per-client bid observations (including first-seen timing) with minimal overhead and surfaces them in the slot page's bid list.
How it works
Ingestion: The bid cache (
blockBidCache) interns observer client names and keeps a per-bid map ofclient → first-seen offset(ms from slot start, negative = gossiped ahead of the slot). Duplicate SSE bid events — previously discarded — now record the observation: the hot path goes from "map lookup, drop" to "map lookup, record one entry". Bids extracted from block bodies record no observer, so0/Ngenuinely means "nobody saw it on gossip".Storage (two tiers):
block_bids(SQL) only gains two int columns:seen_count/seen_total, stamped at flush time.0/0marks pre-feature rows.BIDSobject (<slot>_bidsin S3, namespace 7 in pebble): client-name table + full bid fields + seen bitmask + per-client first-seen offsets (~5 KB/slot). Since entries carry the complete bid, historic bid data could later be served from the blockdb alone, without the relational table. Flushes do read-merge-write so restarts and late-arriving bids union instead of clobber; observations are restored into the cache on startup. Persistence is optional — without a blockdb, counts still work for all slots and the detail view covers cached slots.UI: The bids table gets a "Seen by" column with a colored
42/50badge (green = all clients, yellow = majority, red = minority) rendered purely from the SQL columns — no blockdb access on page load. Expanding the callout row lazily fetches/slot/{slot}/bidseenonce per page (frontend-cached), showing "Seen by" chips with per-client delays (+380ms) and a "Not seen by" group.API:
seen_count/seen_totaladded to/v1/slot/{slotOrHash}/bids; docs regenerated.Config
blockDb.pebble.bidsRetention— optional retention for bids objects (pebble mode; tiered mode stores them in S3 only, uncached).Tooling
dora-utils blockdb-copygains a--no-bidsflag and a dedicated raw-bytes bids pass (identical encoding on both backends); the block passes explicitly skip_bidsobjects / namespace 7.Overhead
Hot path: one bitset/map insert per duplicate event. Memory: <200 KB for the cache window. Storage: ~5 KB/slot, one blockdb write per slot at flush. Historic slot pages only touch the blockdb when the seen callout is expanded.