Skip to content

Commit a82a1f8

Browse files
committed
disable set weights rate limit for commit-reveal
1 parent 25a26e8 commit a82a1f8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pallets/subtensor/src/subnets/weights.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,12 @@ impl<T: Config> Pallet<T> {
505505
// --- 9. Ensure the uid is not setting weights faster than the weights_set_rate_limit.
506506
let neuron_uid = Self::get_uid_for_net_and_hotkey(netuid, &hotkey)?;
507507
let current_block: u64 = Self::get_current_block_as_u64();
508-
ensure!(
509-
Self::check_rate_limit(netuid, neuron_uid, current_block),
510-
Error::<T>::SettingWeightsTooFast
511-
);
508+
if !Self::get_commit_reveal_weights_enabled(netuid) {
509+
ensure!(
510+
Self::check_rate_limit(netuid, neuron_uid, current_block),
511+
Error::<T>::SettingWeightsTooFast
512+
);
513+
}
512514

513515
// --- 10. Check that the neuron uid is an allowed validator permitted to set non-self weights.
514516
ensure!(

0 commit comments

Comments
 (0)