opentensor / subtensor

Bittensor Blockchain Layer
The Unlicense
123 stars 126 forks source link

Unnecessary limitation in `do_become_delegate` #506

Open gztensor opened 1 month ago

gztensor commented 1 month ago

Rate limiting implementation only uses TotalHotkeyColdkeyStakesThisInterval map here:

https://github.com/opentensor/subtensor/blob/86b7f6dd702cf173ca98d683d6d01cc402ea9854/pallets/subtensor/src/staking.rs#L312

But here is sets both LastTxBlock and TotalHotkeyColdkeyStakesThisInterval: https://github.com/opentensor/subtensor/blob/86b7f6dd702cf173ca98d683d6d01cc402ea9854/pallets/subtensor/src/staking.rs#L341

In do_become_delegate the LastTxBlock is used to ratelimit the coldkey's transactions. So, effectively we are limiting how frequently can a coldkey make its hotkeys become delegates based on how frequently it stakes / unstakes.

This might not be an issue, just making an observation. Please close if this is OK.