Rate limits axon /prometheus updates.
Current Value
50Relevant for: minersvalidatorsdevelopers
The Big Picture
Miners publish serving info (IP, port, protocol) via serve_axon and serve_prometheus. This constant limits how often they can update. It prevents spam while allowing legitimate changes like IP rotation or port updates. The rate limit balances flexibility with chain resource conservation.
Why This Matters
If you need to update your axon or prometheus endpoints, you must wait between updates. Plan IP changes and migrations around this cooldown.
Example
With ServingRateLimit of 50 blocks (~10 minutes), after calling serve_axon at block 1000, you can't update until block 1050. If your IP changes, you're offline to new connections for up to 10 minutes.
Common Questions
- What if my IP changes unexpectedly?
- You must wait for the rate limit. Use static IPs or services like dynamic DNS to minimize disruption. Plan for brief unavailability during transitions.
- Does this apply to first-time serving setup?
- No, initial setup is always allowed. The rate limit only applies to subsequent updates to existing serving info.
Use Cases
- Serving operations
- Rate limiting
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Query InitialServingRateLimit constant
const value = api.consts[stringCamelCase("SubtensorModule")][stringCamelCase("InitialServingRateLimit")];
console.log("InitialServingRateLimit:", value.toHuman());
// Convert RAO to TAO if this is a balance value
const taoValue = value.toBigInt() / BigInt(1e9);
console.log("TAO:", taoValue.toString());Type Information
- Type
- u64
- Byte Size
- 8 bytes
- Encoding
- fixed
- Raw Hex
- 0x3200000000000000
Runtime Info
- Pallet
- SubtensorModule
- First Version
- v101
- Latest Version
- v101
- Current Runtime
- v393