feat(freshness): enhance diagnostics and update snapshot structure

- Introduced a new Diagnostics struct to capture transaction visibility state and activity state.
- Updated BuildSnapshot function to return diagnostics alongside snapshot, completeness, and sampling.
- Enhanced test cases to validate the new diagnostics data.
- Updated frontend components to utilize the new diagnostics information for improved user feedback on freshness context.

This change improves the observability of transaction activity and enhances the user experience by providing clearer insights into the freshness of data.
This commit is contained in:
defiQUG
2026-04-12 18:22:08 -07:00
parent 50c5435c0c
commit b5a2e0c0a4
34 changed files with 1328 additions and 165 deletions

View File

@@ -1,4 +1,5 @@
import { getExplorerApiBase } from './blockscout'
import type { ExplorerFreshnessDiagnostics } from './stats'
export interface MissionControlRelaySummary {
text: string
@@ -99,6 +100,7 @@ export interface MissionControlBridgeStatusResponse {
status?: string
checked_at?: string
freshness?: unknown
diagnostics?: ExplorerFreshnessDiagnostics | null
sampling?: {
stats_generated_at?: string | null
rpc_probe_at?: string | null
@@ -150,6 +152,11 @@ function describeRelayStatus(snapshot: MissionControlRelaySnapshot, status: stri
? 'underfunded queued release'
: 'underfunded release'
}
if (snapshot.last_error?.scope === 'bridge_inventory_probe') {
return snapshot.queue?.size && snapshot.queue.size > 0
? 'inventory check deferred'
: 'inventory check pending'
}
if (status === 'paused' && snapshot.monitoring?.delivery_enabled === false) {
return snapshot.queue?.size && snapshot.queue.size > 0 ? 'delivery paused (queueing)' : 'delivery paused'
}