opentensor / subtensor

Bittensor Blockchain Layer
The Unlicense
160 stars 159 forks source link

Add RPC API for getting rate limits information #985

Open ales-otf opened 1 week ago

ales-otf commented 1 week ago

Description

This PR adds RateLimitInfoRuntimeApi, which provides RPC methods to fetch information about rate-limited transactions. The intention behind it is to allow clients to build logic not based on request errors, but by actual values.

Related Issue(s)

Type of Change

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

Checklist

sam0x17 commented 1 week ago

bit late to this but idea: what if we just provide rate limiting information in the responses to all rate-limited requests. Like tell them how close to the quota they are at all times. Then we won't have extra traffic of them constantly checking these rpcs