Problem Statement / Feature Objective
Operators running validators across multiple data centers risk correlated slashing events when a shared infrastructure dependency (same cloud provider, same ISP, same power grid) causes simultaneous failures. Build a risk analyzer that takes a cluster topology map (node coordinates + provider metadata), cross-references it against known slashing vectors (same IP range, same ASN, same cloud region), and computes a correlated slashing risk score for each node cluster with mitigation recommendations.
Technical Invariants & Bounds
- Risk score per cluster = 0.4 × (shared_IP_count / total_nodes) + 0.3 × (shared_ASN_count / total_nodes) + 0.3 × (shared_cloud_region_count / total_nodes)
- Cluster detected via DBSCAN density-based clustering on geocoordinates (ε=500km, minPts=3)
- Infrastructure metadata sourced from: (1) node self-reported config, (2) IP geolocation API, (3) BGP ASN lookup
- Risk tier thresholds: Low (<0.25), Medium (0.25–0.5), High (0.5–0.75), Critical (>0.75)
- Mitigation recommendations: for each risk factor, suggest diversification strategies (e.g., "Move 3 nodes to different ASN 12345")
- Cluster map must render up to 500 nodes on a Canvas global map projection (equirectangular) with cluster overlays
Codebase Navigation Guide
src/hooks/useCorrelationRisk.ts – risk analysis hook
src/workers/riskClusterWorker.ts – web worker for DBSCAN clustering
src/components/canvas/RiskTopologyMap.tsx – canvas map renderer
src/services/infrastructureService.ts – IP/ASN/cloud metadata service
src/utils/dbscan.ts – DBSCAN clustering implementation
src/store/riskSlice.ts – state management for risk data
Implementation Blueprint
- Implement
src/utils/dbscan.ts – DBSCAN clustering algorithm with ε=500km, minPts=3 using Haversine distance calculation on lat/lng coordinates
- Build
src/services/infrastructureService.ts – aggregates node infrastructure metadata: IP (from node config), ASN (via BGP lookup API), cloud region (from node labels/tags)
- Create
src/workers/riskClusterWorker.ts – receives node list → runs DBSCAN → returns cluster assignments + risk scores via postMessage
- Implement
src/utils/riskScore.ts – computes cluster risk score using the weighted formula
- Create
src/utils/mitigationRecommender.ts – for each risk factor, generates human-readable diversification recommendations
- Build
src/components/canvas/RiskTopologyMap.tsx – equirectangular canvas map with:
- Node dots colored by risk tier
- Cluster convex hull polygons (semi-transparent)
- Zoom/pan support
- Click cluster → show risk breakdown and mitigations
- Create
src/components/validators/RiskSummaryPanel.tsx – tabular summary of all clusters with risk score, node count, and top mitigation
- Mount in a new "Correlation Risk" tab on
ValidatorDashboard.tsx
Problem Statement / Feature Objective
Operators running validators across multiple data centers risk correlated slashing events when a shared infrastructure dependency (same cloud provider, same ISP, same power grid) causes simultaneous failures. Build a risk analyzer that takes a cluster topology map (node coordinates + provider metadata), cross-references it against known slashing vectors (same IP range, same ASN, same cloud region), and computes a correlated slashing risk score for each node cluster with mitigation recommendations.
Technical Invariants & Bounds
Codebase Navigation Guide
src/hooks/useCorrelationRisk.ts– risk analysis hooksrc/workers/riskClusterWorker.ts– web worker for DBSCAN clusteringsrc/components/canvas/RiskTopologyMap.tsx– canvas map renderersrc/services/infrastructureService.ts– IP/ASN/cloud metadata servicesrc/utils/dbscan.ts– DBSCAN clustering implementationsrc/store/riskSlice.ts– state management for risk dataImplementation Blueprint
src/utils/dbscan.ts– DBSCAN clustering algorithm with ε=500km, minPts=3 using Haversine distance calculation on lat/lng coordinatessrc/services/infrastructureService.ts– aggregates node infrastructure metadata: IP (from node config), ASN (via BGP lookup API), cloud region (from node labels/tags)src/workers/riskClusterWorker.ts– receives node list → runs DBSCAN → returns cluster assignments + risk scores via postMessagesrc/utils/riskScore.ts– computes cluster risk score using the weighted formulasrc/utils/mitigationRecommender.ts– for each risk factor, generates human-readable diversification recommendationssrc/components/canvas/RiskTopologyMap.tsx– equirectangular canvas map with:src/components/validators/RiskSummaryPanel.tsx– tabular summary of all clusters with risk score, node count, and top mitigationValidatorDashboard.tsx