Skip to content

Commit

Permalink
chore: max childkey take
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Dare committed Aug 19, 2024
1 parent 2fc1e3c commit 9047781
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pallets/admin-utils/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ parameter_types! {
pub const InitialMinDelegateTake: u16 = 5_898; // 9%;
pub const InitialDefaultChildKeyTake: u16 = 0; // Allow 0 %
pub const InitialMinChildKeyTake: u16 = 0; // Allow 0 %
pub const InitialMaxChildKeyTake: u16 = 11_796; // 18 %;
pub const InitialWeightsVersionKey: u16 = 0;
pub const InitialServingRateLimit: u64 = 0; // No limit.
pub const InitialTxRateLimit: u64 = 0; // Disable rate limit for testing
Expand Down Expand Up @@ -153,6 +154,7 @@ impl pallet_subtensor::Config for Test {
type InitialMinDelegateTake = InitialMinDelegateTake;
type InitialDefaultChildKeyTake = InitialDefaultChildKeyTake;
type InitialMinChildKeyTake = InitialMinChildKeyTake;
type InitialMaxChildKeyTake = InitialMaxChildKeyTake;
type InitialWeightsVersionKey = InitialWeightsVersionKey;
type InitialMaxDifficulty = InitialMaxDifficulty;
type InitialMinDifficulty = InitialMinDifficulty;
Expand Down
3 changes: 3 additions & 0 deletions pallets/subtensor/src/macros/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ mod config {
/// Initial minimum childkey take.
#[pallet::constant]
type InitialMinChildKeyTake: Get<u16>;
/// Initial maximum childkey take.
#[pallet::constant]
type InitialMaxChildKeyTake: Get<u16>;
/// Initial weights version key.
#[pallet::constant]
type InitialWeightsVersionKey: Get<u64>;
Expand Down
6 changes: 4 additions & 2 deletions pallets/subtensor/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ parameter_types! {
pub const InitialFoundationDistribution: u64 = 0;
pub const InitialDefaultDelegateTake: u16 = 11_796; // 18%, same as in production
pub const InitialMinDelegateTake: u16 = 5_898; // 9%;
pub const InitialDefaultChildKeyTake: u16 = 11_796; // 18%, same as in production
pub const InitialDefaultChildKeyTake: u16 = 0 ;// 0 %
pub const InitialMinChildKeyTake: u16 = 0; // 0 %;
pub const InitialMaxChildKeyTake: u16 = 11_796; // 18 %;
pub const InitialWeightsVersionKey: u16 = 0;
pub const InitialServingRateLimit: u64 = 0; // No limit.
pub const InitialTxRateLimit: u64 = 0; // Disable rate limit for testing
Expand Down Expand Up @@ -172,7 +173,7 @@ parameter_types! {
pub const InitialAlphaLow: u16 = 45875; // Represents 0.7 as per the production default
pub const InitialLiquidAlphaOn: bool = false; // Default value for LiquidAlphaOn
pub const InitialHotkeyEmissionTempo: u64 = 0; // Defaults to draining every block.
pub const InitialNetworkMaxStake: u64 = 500_000_000_000_000; // 500,000 TAO
pub const InitialNetworkMaxStake: u64 = u64::MAX; // Maximum possible value for u64

}

Expand Down Expand Up @@ -367,6 +368,7 @@ impl pallet_subtensor::Config for Test {
type InitialMinDelegateTake = InitialMinDelegateTake;
type InitialDefaultChildKeyTake = InitialDefaultChildKeyTake;
type InitialMinChildKeyTake = InitialMinChildKeyTake;
type InitialMaxChildKeyTake = InitialMaxChildKeyTake;
type InitialTxChildKeyTakeRateLimit = InitialTxChildKeyTakeRateLimit;
type InitialWeightsVersionKey = InitialWeightsVersionKey;
type InitialMaxDifficulty = InitialMaxDifficulty;
Expand Down
2 changes: 2 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ parameter_types! {
pub const SubtensorInitialMinDelegateTake: u16 = 0; // Allow 0% delegate take
pub const SubtensorInitialDefaultChildKeyTake: u16 = 0; // Allow 0% childkey take
pub const SubtensorInitialMinChildKeyTake: u16 = 0; // 0 %
pub const SubtensorInitialMaxChildKeyTake: u16 = 11_796; // 18 %
pub const SubtensorInitialWeightsVersionKey: u64 = 0;
pub const SubtensorInitialMinDifficulty: u64 = 10_000_000;
pub const SubtensorInitialMaxDifficulty: u64 = u64::MAX / 4;
Expand Down Expand Up @@ -981,6 +982,7 @@ impl pallet_subtensor::Config for Runtime {
type InitialTxRateLimit = SubtensorInitialTxRateLimit;
type InitialTxDelegateTakeRateLimit = SubtensorInitialTxDelegateTakeRateLimit;
type InitialTxChildKeyTakeRateLimit = SubtensorInitialTxChildKeyTakeRateLimit;
type InitialMaxChildKeyTake = SubtensorInitialMaxChildKeyTake;
type InitialRAORecycledForRegistration = SubtensorInitialRAORecycledForRegistration;
type InitialSenateRequiredStakePercentage = SubtensorInitialSenateRequiredStakePercentage;
type InitialNetworkImmunityPeriod = SubtensorInitialNetworkImmunity;
Expand Down

0 comments on commit 9047781

Please sign in to comment.