Skip to content

Commit 9047781

Browse files
author
Samuel Dare
committed
chore: max childkey take
1 parent 2fc1e3c commit 9047781

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

pallets/admin-utils/tests/mock.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ parameter_types! {
8181
pub const InitialMinDelegateTake: u16 = 5_898; // 9%;
8282
pub const InitialDefaultChildKeyTake: u16 = 0; // Allow 0 %
8383
pub const InitialMinChildKeyTake: u16 = 0; // Allow 0 %
84+
pub const InitialMaxChildKeyTake: u16 = 11_796; // 18 %;
8485
pub const InitialWeightsVersionKey: u16 = 0;
8586
pub const InitialServingRateLimit: u64 = 0; // No limit.
8687
pub const InitialTxRateLimit: u64 = 0; // Disable rate limit for testing
@@ -153,6 +154,7 @@ impl pallet_subtensor::Config for Test {
153154
type InitialMinDelegateTake = InitialMinDelegateTake;
154155
type InitialDefaultChildKeyTake = InitialDefaultChildKeyTake;
155156
type InitialMinChildKeyTake = InitialMinChildKeyTake;
157+
type InitialMaxChildKeyTake = InitialMaxChildKeyTake;
156158
type InitialWeightsVersionKey = InitialWeightsVersionKey;
157159
type InitialMaxDifficulty = InitialMaxDifficulty;
158160
type InitialMinDifficulty = InitialMinDifficulty;

pallets/subtensor/src/macros/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ mod config {
122122
/// Initial minimum childkey take.
123123
#[pallet::constant]
124124
type InitialMinChildKeyTake: Get<u16>;
125+
/// Initial maximum childkey take.
126+
#[pallet::constant]
127+
type InitialMaxChildKeyTake: Get<u16>;
125128
/// Initial weights version key.
126129
#[pallet::constant]
127130
type InitialWeightsVersionKey: Get<u64>;

pallets/subtensor/tests/mock.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ parameter_types! {
133133
pub const InitialFoundationDistribution: u64 = 0;
134134
pub const InitialDefaultDelegateTake: u16 = 11_796; // 18%, same as in production
135135
pub const InitialMinDelegateTake: u16 = 5_898; // 9%;
136-
pub const InitialDefaultChildKeyTake: u16 = 11_796; // 18%, same as in production
136+
pub const InitialDefaultChildKeyTake: u16 = 0 ;// 0 %
137137
pub const InitialMinChildKeyTake: u16 = 0; // 0 %;
138+
pub const InitialMaxChildKeyTake: u16 = 11_796; // 18 %;
138139
pub const InitialWeightsVersionKey: u16 = 0;
139140
pub const InitialServingRateLimit: u64 = 0; // No limit.
140141
pub const InitialTxRateLimit: u64 = 0; // Disable rate limit for testing
@@ -172,7 +173,7 @@ parameter_types! {
172173
pub const InitialAlphaLow: u16 = 45875; // Represents 0.7 as per the production default
173174
pub const InitialLiquidAlphaOn: bool = false; // Default value for LiquidAlphaOn
174175
pub const InitialHotkeyEmissionTempo: u64 = 0; // Defaults to draining every block.
175-
pub const InitialNetworkMaxStake: u64 = 500_000_000_000_000; // 500,000 TAO
176+
pub const InitialNetworkMaxStake: u64 = u64::MAX; // Maximum possible value for u64
176177

177178
}
178179

@@ -367,6 +368,7 @@ impl pallet_subtensor::Config for Test {
367368
type InitialMinDelegateTake = InitialMinDelegateTake;
368369
type InitialDefaultChildKeyTake = InitialDefaultChildKeyTake;
369370
type InitialMinChildKeyTake = InitialMinChildKeyTake;
371+
type InitialMaxChildKeyTake = InitialMaxChildKeyTake;
370372
type InitialTxChildKeyTakeRateLimit = InitialTxChildKeyTakeRateLimit;
371373
type InitialWeightsVersionKey = InitialWeightsVersionKey;
372374
type InitialMaxDifficulty = InitialMaxDifficulty;

runtime/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ parameter_types! {
910910
pub const SubtensorInitialMinDelegateTake: u16 = 0; // Allow 0% delegate take
911911
pub const SubtensorInitialDefaultChildKeyTake: u16 = 0; // Allow 0% childkey take
912912
pub const SubtensorInitialMinChildKeyTake: u16 = 0; // 0 %
913+
pub const SubtensorInitialMaxChildKeyTake: u16 = 11_796; // 18 %
913914
pub const SubtensorInitialWeightsVersionKey: u64 = 0;
914915
pub const SubtensorInitialMinDifficulty: u64 = 10_000_000;
915916
pub const SubtensorInitialMaxDifficulty: u64 = u64::MAX / 4;
@@ -981,6 +982,7 @@ impl pallet_subtensor::Config for Runtime {
981982
type InitialTxRateLimit = SubtensorInitialTxRateLimit;
982983
type InitialTxDelegateTakeRateLimit = SubtensorInitialTxDelegateTakeRateLimit;
983984
type InitialTxChildKeyTakeRateLimit = SubtensorInitialTxChildKeyTakeRateLimit;
985+
type InitialMaxChildKeyTake = SubtensorInitialMaxChildKeyTake;
984986
type InitialRAORecycledForRegistration = SubtensorInitialRAORecycledForRegistration;
985987
type InitialSenateRequiredStakePercentage = SubtensorInitialSenateRequiredStakePercentage;
986988
type InitialNetworkImmunityPeriod = SubtensorInitialNetworkImmunity;

0 commit comments

Comments
 (0)