Add safe block visualization from fast_confirmation event stream#792
Add safe block visualization from fast_confirmation event stream#792barnabasbusa wants to merge 10 commits into
Conversation
Subscribe to the fast_confirmation beacon event stream topic (fast confirmation rule, see ethereum/beacon-APIs#616) as an optional ancillary SSE stream. Nodes that don't support the topic reject the subscription with a 4xx response, in which case the stream silently gives up, so the feature auto-activates only on FCR-enabled nodes. The most recent fast confirmed (safe) block is tracked per client and network-wide in the chain state, and visualized in the frontend: - index page: safe slot next to the current slot in the network overview, and a shield marker on fast confirmed slots in the recent slots list - consensus clients page: sortable "Safe Slot" column (only shown when at least one node reports fast confirmations) - /v1/clients/consensus API: fcr_enabled, safe_slot and safe_root fields
Dedicated API method returning the network-wide safe block (slot, root, epoch, last confirmation time) plus the per-client fast confirmation status.
Iteration 1 of the safe block visualization: the block dot in the chain fork graph (index, slots and blocks pages) turns green for canonical blocks at or below the network-wide safe slot.
Iteration 2 of the safe block visualization: fast confirmed blocks get a shield icon next to the status pill on the slots and blocks pages, matching the index page recent slots list.
Iteration 3 of the safe block visualization: canonical blocks at or below the safe slot get a teal "Proposed" pill instead of the default green, on the index, slots and blocks pages.
Settle on the shield icon in the status column as the single safe block visualization: drop the green fork graph dot and the teal status pill variants again, and add the shield to the filtered slots and filtered (EL) blocks views.
🤖 qu0b-reviewerConfirmed: for SummaryThe PR adds safe-block shield icons (driven by Issues
Suggestions
Reviewed @ |
Summary
Config to test with:
Adds support for the
fast_confirmationbeacon event stream topic (fast confirmation rule, see ethereum/beacon-APIs#616) and visualizes the resulting safe block in the UI.Backend
fast_confirmationtopic as an optional ancillary SSE stream per beacon node. Nodes that don't support the topic reject the subscription with a 4xx response, in which case the stream silently gives up — so the feature auto-activates only on FCR-enabled nodes, with no config needed.block,slot, and the optionalcurrent_slotadded by beacon-APIs#616) with a local type, since the pinned go-eth2-client doesn't carrycurrent_slotyet.Client.GetLastFastConfirmation()) and network-wide in the chain state (ChainState.GetFastConfirmedBlock(), monotonic by slot), plus a per-clientSubscribeFastConfirmationEvent()dispatcher for future consumers.Frontend
/index/datapolling./v1/clients/consensusnow includesfcr_enabled,safe_slotandsafe_rootper client, and a new dedicated/api/v1/network/fast_confirmationendpoint returns the network-wide safe block (slot, root, epoch, last confirmation time) plus per-client fast confirmation status.The UI additions are hidden entirely on networks where no node emits fast confirmation events.