diff --git a/pallets/subtensor/src/staking/set_children.rs b/pallets/subtensor/src/staking/set_children.rs index ebd8db6bf..31bf96f52 100644 --- a/pallets/subtensor/src/staking/set_children.rs +++ b/pallets/subtensor/src/staking/set_children.rs @@ -60,10 +60,10 @@ impl Pallet { // Ensure the hotkey passes the rate limit. ensure!( - Self::passes_rate_limit_globally( + Self::passes_rate_limit_on_subnet( + &TransactionType::SetChildren, // Set children. &hotkey, // Specific to a hotkey. netuid, // Specific to a subnet. - &TransactionType::SetChildren, // Set children. ), Error::::TxRateLimitExceeded ); diff --git a/pallets/subtensor/src/utils/rate_limiting.rs b/pallets/subtensor/src/utils/rate_limiting.rs index 1b75de7d5..b02ad9855 100644 --- a/pallets/subtensor/src/utils/rate_limiting.rs +++ b/pallets/subtensor/src/utils/rate_limiting.rs @@ -58,11 +58,8 @@ impl Pallet { } /// Check if a transaction should be rate limited globally - pub fn passes_rate_limit_globally( - hotkey: &T::AccountId, - netuid: u16, - tx_type: &TransactionType, - ) -> bool { + pub fn passes_rate_limit_globally(tx_type: &TransactionType, hotkey: &T::AccountId) -> bool { + let netuid: u16 = u16::MAX; let block: u64 = Self::get_current_block_as_u64(); let limit: u64 = Self::get_rate_limit(tx_type); let last_block: u64 = Self::get_last_transaction_block(hotkey, netuid, tx_type);