Skip to content

Implement node reputation scoring for decentralized RPC node selection #612

Description

@Smartdevs17

Context

Soroban contract transactions can be submitted through multiple RPC nodes. No intelligent selection mechanism exists beyond simple round-robin.

Current Limitation/Problem

If a node is slow or returns incorrect data, the entire transaction fails. Users have no visibility into node health.

Expected Outcome

Node reputation scoring: track response time, success rate, data freshness, and liveness per node. Score-based weighted selection with automatic dead node removal.

Acceptance Criteria

  • Metrics per node: response time (p50, p95, p99), success rate (24h rolling), last block height, liveness (ping every 30s)
  • Reputation score formula: 40% success rate + 30% inverse latency + 20% freshness + 10% liveness
  • Node selection: weighted random selection by score (higher score = higher probability)
  • Dead node detection: 5 consecutive failures -> mark dead, retry health check every 5 min
  • Score persistence: Redis with 5-minute TTL per node score
  • Fallback chain: primary (highest score) -> secondary -> tertiary for each transaction
  • Edge case: all nodes dead -> circuit breaker opens, alert ops team, retry every 30s
  • Edge case: new node starts with neutral score (50th percentile) to allow fair evaluation

Technical Scope

  • backend/shared/soroban/ - NodeReputationService
  • backend/shared/soroban/ - NodeSelector (weighted random selection)
  • backend/monitoring/ - node health and reputation metrics
  • backend/config/ - node registry with endpoints and metadata
  • backend/shared/cache/ - score persistence in Redis

Metadata

Metadata

Assignees

Labels

200-points200 point issueStellar WaveIssues in the Stellar wave programdrips-waveIssues in the Drips Wave programhighHigh complexity issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions