Bittensor Rate Limits
This document provides a comprehensive overview of all rate limits implemented in the Bittensor Subtensor chain. Rate limits are crucial for preventing spam, ensuring network stability, and maintaining fair access to network resources.
Rate limits in Bittensor are implemented as block-based cooldown periods. When a rate-limited operation is performed, subsequent attempts to perform the same operation must wait for a specified number of blocks to pass before they can be executed again.
Global rate limits
This section discusses rate limits that apply globally across the entire network.
General transaction rate limit
This is the default transaction rate limit in Bittensor. It helps to prevent excessive transaction spam from a single account on the network.
- Rate Limit: 1000 blocks (~3.3 hours)
- Configuration:
TxRateLimit
in runtime/src/lib.rs - Error message:
TxRateLimitExceeded
Delegate take rate limit
This rate limit prevents frequent changes to delegate take percentages.
- Rate Limit: 216,000 blocks (~30 days)
- Configuration:
TxDelegateTakeRateLimit
in runtime/src/lib.rs - Error message:
DelegateTxRateLimitExceeded
Child key take rate limit
This rate limit prevents the owner of a child hotkey from making frequent changes to the child key take percentages. This protects against rapid manipulation of child key relationships and ensures stability in the child key delegation system.
- Rate Limit: 216,000 blocks (~30 days)
- Configuration:
TxChildkeyTakeRateLimit
in runtime/src/lib.rs - Error message:
TxChildkeyTakeRateLimitExceeded
Hotkey set rate limit
This rate limit prevents a user from setting or swapping a hotkey too frequently.
- Rate Limit: 1,000 blocks (~3.3 hours)
- Configuration: macros/errors.rs
- Error message:
HotKeySetTxRateLimitExceeded
UID trimming rate limit
This rate limit controls how frequently subnet owners can trim UIDs on their subnets. This prevents disruptions in subnet stability and excessive network reorganization.
- Rate Limit: 216,000 blocks (~30 days)
- Configuration:
MaxUidsTrimmingRateLimit
macros/errors.rs - Error message:
TxRateLimitExceeded
Network registration rate rimit
This rate limit prevents frequent creation of new subnets.
- Rate Limit: 28,800 blocks (~4 days)
- Configuration:
NetworkRateLimit
in runtime/src/lib.rs - Error message:
NetworkTxRateLimitExceeded
Subnet-specific rate limits
This section discusses rate limits that apply within a specific subnet on the network. These limits are typically configurable at the subnet level.
Serving rate limits
This rate limit controls how frequently neurons can update their serving information (axon and prometheus data) on the Bittensor network. This rate limit can be modified by changing the serving_rate_limit
parameter in the subnet hyperparameters. For more information, see subnet hyperparameters.
- Rate Limit: Configurable per subnet (default: 50 blocks)
- Configuration:
ServingRateLimit
in runtime/src/lib.rs - Error message:
ServingRateLimitExceeded
Staking operations rate limits
This rate limit controls how frequently a user can perform staking operations (add/remove stake, move stake).
- Rate Limit: 1 per block
- Configuration: macros/errors.rs
- Error message:
StakingOperationRateLimitExceeded
Weights rate limits
This section covers rate limits related to setting weights on a subnet. This rate limit can be modified by changing the weights_rate_limit
parameter in the subnet hyperparameters. For more information, see subnet hyperparameters.
Weights setting rate limit
This rate limit controls how frequently a subnet validator can set weights to the network.
- Rate Limit: Configurable per subnet (default: 100 blocks)
- Configuration:
WeightsSetRateLimit
per subnet - Implementation: subnets/weights.rs
- Error message:
SettingWeightsTooFast
Commit-reveal weights rate limit
This rate limit controls how frequently a subnet validator can set commit on to the Bittensor chain. Changing the weights_rate_limit
parameter in the subnet's hyperparameters also modifies this rate limit. For more information, see subnet hyperparameters.
- Rate Limit: Uses the same rate limit as weights setting rate limit
- Implementation: subnets/weights.rs
- Error message:
CommittingWeightsTooFast
Registration rate limits
This section covers rate limits related to neuron registrations on a subnet and on the network.
Per-block registration limit
This rate limit controls how frequently registrations can occur on a particular subnet. This rate limit can be modified by changing the max_regs_per_block
parameter in the subnet hyperparameters. For more information, see subnet hyperparameters.
- Rate Limit: Configurable per subnet (default: 1 registration per block)
- Configuration:
MaxRegistrationsPerBlock
in runtime/src/lib.rs - Error message:
TooManyRegistrationsThisBlock
Per-interval registration limit
This rate limit controls the frequency of neuron registrations within an interval. This limit occurs when registration attempts in the current interval exceed three times the target registrations per interval.
- Rate Limit: 3x the target registrations per interval
- Configuration:
TargetRegistrationsPerInterval
in runtime/src/lib.rs - Error message:
TooManyRegistrationsThisInterval
Best Practices
- Monitor Usage: Regularly monitor rate limit usage patterns
- Document Changes: Always document rate limit changes
- Test Thoroughly: Test rate limit changes on testnets