Skip to content

feat(rpc): serve the endpoint capability matrix, and make get_best_rpc_endpoint workload-aware #11072

Description

@JSONbored

Parent: #11066. Producer: the rpc-bench container class in metagraphed-infra.

What "best" means today, and why it is not enough

get_best_rpc_endpoint ranks on a five-call HTTP probe — liveness, genesis-hash chain identity, and
block-height plausibility. That correctly excludes an endpoint answering for the wrong chain. It
says nothing about whether the endpoint can do the work the caller has.

We already know the difference matters, from a measurement recorded in a config comment rather than
a table: get_delegates() (~15 MB) measured 11.1 s direct against 92.9 s through our own
balancer
, and that single figure is why the poller does not route through wss.metagraph.sh. The
same comment notes the balancer denies the state_call prefix, which subxt issues for every
at_block() — so routing bulk reads through it would not degrade those lanes, it would break them.

None of that is expressible in the current model, and a caller integrating against us has to
rediscover it.

Scope

  • A capability row per endpoint: method surface, denied prefixes, archive depth measured rather than
    declared, runtime-API support, bulk-read throughput, max response size, unsafe RPCs exposed
  • get_best_rpc_endpoint gains a workload argument — "bulk archive read" and "head subscription"
    are different answers and today we return one
  • The matrix served as its own surface, because it is independently useful

Contract note

Archive depth is a measurement, not a claim, and it changes. Serve it with its observation
timestamp and never let a stale depth read as current.

Acceptance

  • Capability row per endpoint, dated, method surface captured verbatim
  • get_best_rpc_endpoint returns different endpoints for different workloads, with the reason
  • The 11.1 s / 92.9 s comparison is reproducible from served data
  • Route + MCP registration checklists complete

Metadata

Metadata

Assignees

Labels

backendmaintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions