Skip to content

Commit a313461

Browse files
authored
Merge pull request #2048 from opentensor/sam-change-hyperparameter-rate-limit
hyperparameter refactor
2 parents 00d83cb + 25e7402 commit a313461

File tree

15 files changed

+369
-265
lines changed

15 files changed

+369
-265
lines changed

evm-tests/src/subtensor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { convertH160ToSS58, convertPublicKeyToSs58, ethAddressToH160 } from './a
77
import { tao } from './balance-math'
88
import internal from "stream";
99

10-
// create a new subnet and return netuid
10+
// create a new subnet and return netuid
1111
export async function addNewSubnetwork(api: TypedApi<typeof devnet>, hotkey: KeyPair, coldkey: KeyPair) {
1212
const alice = getAliceSigner()
1313
const totalNetworks = await api.query.SubtensorModule.TotalNetworks.getValue()
@@ -392,13 +392,13 @@ export async function disableAdminFreezeWindowAndOwnerHyperparamRateLimit(api: T
392392
}
393393

394394
const currentOwnerHyperparamRateLimit = await api.query.SubtensorModule.OwnerHyperparamRateLimit.getValue()
395-
if (currentOwnerHyperparamRateLimit !== BigInt(0)) {
395+
if (currentOwnerHyperparamRateLimit !== 0) {
396396
// Set OwnerHyperparamRateLimit to 0
397-
const setOwnerRateLimit = api.tx.AdminUtils.sudo_set_owner_hparam_rate_limit({ limit: BigInt(0) })
397+
const setOwnerRateLimit = api.tx.AdminUtils.sudo_set_owner_hparam_rate_limit({ epochs: 0 })
398398
const sudoOwnerRateTx = api.tx.Sudo.sudo({ call: setOwnerRateLimit.decodedCall })
399399
await waitForTransactionWithRetry(api, sudoOwnerRateTx, alice)
400400
}
401401

402402
assert.equal(0, await api.query.SubtensorModule.AdminFreezeWindow.getValue())
403403
assert.equal(BigInt(0), await api.query.SubtensorModule.OwnerHyperparamRateLimit.getValue())
404-
}
404+
}

pallets/admin-utils/src/benchmarking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ mod benchmarks {
416416
// disable admin freeze window
417417
pallet_subtensor::Pallet::<T>::set_admin_freeze_window(0);
418418
#[extrinsic_call]
419-
_(RawOrigin::Root, 10u64/*limit*/)/*sudo_set_owner_hparam_rate_limit*/;
419+
_(RawOrigin::Root, 2u16/*epochs*/)/*sudo_set_owner_hparam_rate_limit*/;
420420
}
421421

422422
#[benchmark]

0 commit comments

Comments
 (0)