Skip to content

Implement node selection algorithm (rate × rtt × 1/reputation²) #322

Closed

Description

@alpergundogdu

Context

ADR 001 specifies a unified node selection score for choosing which peer to request content from after discovery. Currently no selection logic exists.

Scope (crates/node or a new selection module)

  • Score formula: rate_per_mb × rtt_ms × (1 / reputation²) — lower is better
  • Reputation floor: clamp at 0.1 minimum to prevent division by near-zero
  • Inputs: rate_per_mb from ProbeResponse/gossip, RTT from probe timing, reputation from local scoring
  • Tie-breaking (ADR 008): load → geo → stake → random
  • Integration: called after content discovery returns candidate nodes, before opening cdn/client/v1 stream
  • Fallback: max 3 provider attempts before returning error to caller

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions